Sfoglia il codice sorgente

分享商品优化

viczhq 4 giorni fa
parent
commit
bdec53ef1e

+ 7 - 7
project.private.config.json

@@ -10,6 +10,13 @@
10 10
     "miniprogram": {
11 11
       "list": [
12 12
         {
13
+          "name": "pages/login/index",
14
+          "pathName": "pages/login/index",
15
+          "query": "",
16
+          "launchMode": "default",
17
+          "scene": null
18
+        },
19
+        {
13 20
           "name": "pages/memberSub/earningsOrder/index",
14 21
           "pathName": "pages/memberSub/earningsOrder/index",
15 22
           "query": "",
@@ -59,13 +66,6 @@
59 66
           "scene": null
60 67
         },
61 68
         {
62
-          "name": "pages/mineSub/login/index",
63
-          "pathName": "pages/mineSub/login/index",
64
-          "query": "",
65
-          "launchMode": "default",
66
-          "scene": null
67
-        },
68
-        {
69 69
           "name": "pages/searchList/index",
70 70
           "pathName": "pages/indexSub/searchList/index",
71 71
           "query": "",

+ 4 - 0
src/api/request.js

@@ -38,6 +38,9 @@ export default async (options = { method: 'GET', data: {} }) => {
38 38
       method: options.method.toUpperCase(),
39 39
     });
40 40
     const { code,data, msg } = res.data;
41
+    console.log('==========',options.url);
42
+    console.log('options',options.data);
43
+    console.log('res',res);
41 44
     switch (code) {
42 45
       case 200:
43 46
         return data;
@@ -75,6 +78,7 @@ export default async (options = { method: 'GET', data: {} }) => {
75 78
           url: '/pages/login/index',
76 79
         });
77 80
         // throw new Error('需要登录');
81
+        return
78 82
       default:
79 83
         Taro.showToast({
80 84
           title: `${msg || '请求失败'}`,

+ 4 - 4
src/components/Modal/index.jsx

@@ -6,7 +6,7 @@ import selectStep from "../../images/productDetail/selectStep.png";
6 6
 import xianyu from "../../images/productDetail/xianyu.png";
7 7
 import stepThree from "../../images/productDetail/stepThree.png";
8 8
 export default function Modal(props) {
9
-  const { productPromotion } = props;
9
+  const { productPromotion, isOpened, title, linkText } = props;
10 10
   const handleCopyLink = () => {
11 11
     Taro.setClipboardData({
12 12
       data: productPromotion.short_tpwd,
@@ -18,12 +18,12 @@ export default function Modal(props) {
18 18
     });
19 19
   }
20 20
   return (
21
-    <AtModal isOpened={props.isOpened} closeOnClickOverlay={true}>
21
+    <AtModal isOpened={isOpened} closeOnClickOverlay={true}>
22 22
       <AtModalContent>
23 23
         <View className="container">
24
-          <View className="title">{props.title}</View>
24
+          <View className="title">{title}</View>
25 25
           <View className="content">
26
-            <View className="link-text">{props.linkText}</View>
26
+            <View className="link-text">{linkText}</View>
27 27
             <View className="steps">
28 28
               <View className="step-item">
29 29
                 <View className="step-title">

+ 2 - 2
src/components/index/OperationArea/index.less

@@ -44,8 +44,8 @@
44 44
             margin-top: 17px;
45 45
             padding: 0 17px;
46 46
             display: flex;
47
-            justify-content: space-between;
48
-
47
+            // justify-content: space-between;
48
+            gap: 10px;
49 49
             .product-item {
50 50
                 width: 100px;
51 51
                 text-align: center;

+ 34 - 13
src/components/index/ProductList/index.jsx

@@ -7,8 +7,10 @@ import React, {
7 7
 import { View, Text, Image, Button } from "@tarojs/components";
8 8
 import { AtCheckbox, AtActivityIndicator } from "taro-ui";
9 9
 import { setShareContent } from "../../../common/share";
10
+import { getShareJump } from "../../../service";
10 11
 import Taro from "@tarojs/taro";
11 12
 import "./index.less";
13
+import ShareModal from "../../shareModal";
12 14
 import joinStoreBg from "../../../images/index/jionStore.png";
13 15
 import joinStoreAc from "../../../images/index/joinStoreAc.png";
14 16
 import saveMoneyBg from "../../../images/index/save-money.png";
@@ -19,6 +21,7 @@ const ProductList = forwardRef((props, ref) => {
19 21
     productList, // 商品列表数据
20 22
     loading, // 加载状态
21 23
     isSeckill, // 是否秒杀页面使用
24
+    isHighCommission, // 是否高佣金页面使用
22 25
     isManagement, // 是否管理页面使用
23 26
     isManagementStatus, // 是否管理状态
24 27
     isProductClassify, // 是否分类页面使用
@@ -26,10 +29,10 @@ const ProductList = forwardRef((props, ref) => {
26 29
     onAddProduct, // 添加商品方法
27 30
     onDeleteProductSelect, // 删除商品选中id数组
28 31
     isNoMore, // 是否没有更多
29
-    onShareProduct, // 分享商品方法
30
-    } = props;
32
+  } = props;
31 33
 
32 34
   const [selectedProducts, setSelectedProducts] = useState([]); // 商品选择状态
35
+  const [shareModalOpened, setShareModalOpened] = useState(false); // 分享弹窗状态
33 36
   // 监听选中状态变化
34 37
   useEffect(() => {
35 38
     // 每当 selectedProducts 变化时,调用父组件的回调
@@ -45,7 +48,7 @@ const ProductList = forwardRef((props, ref) => {
45 48
       setSelectedProducts([]);
46 49
     }
47 50
   }, [isSelectAll]);
48
-  // 定义 clearSelectedItems 方法
51
+  // 定义 clearSelectedItems 方法,父组件调用清除选中状态
49 52
   useImperativeHandle(ref, () => ({
50 53
     clearSelectedItems: () => {
51 54
       setSelectedProducts([]);
@@ -58,7 +61,7 @@ const ProductList = forwardRef((props, ref) => {
58 61
       selectProduct(id);
59 62
     } else {
60 63
       Taro.navigateTo({
61
-        url: `/pages/indexSub/productDetail/index?id=${id}`,
64
+        url: `/pages/indexSub/productDetail/index?id=${id}&&isHighCommission=${isHighCommission}&&isSeckill=${isSeckill}`,
62 65
       });
63 66
     }
64 67
   };
@@ -86,14 +89,23 @@ const ProductList = forwardRef((props, ref) => {
86 89
       onAddProduct && onAddProduct(productId, index);
87 90
     }
88 91
   };
89
-  // 分享商品 
92
+  // 分享商品
90 93
   const shareProduct = (product, e) => {
91 94
     e.stopPropagation(); // 防止事件穿透
92
-    props.onShareProduct && props.onShareProduct();
93
-    setShareContent({
94
-      title: product.item_title,
95
-      path: `/pages/indexSub/productDetail/index?id=${product.id}&&isShare=${true}`,
96
-      imageUrl: product.image_url,
95
+    getShareJump({
96
+      share_type: 1,
97
+      share_id: product.id,
98
+    }).then((res) => {
99
+      // 设置分享内容
100
+      setShareContent({
101
+        title: product.item_title,
102
+        path: `/pages/indexSub/productDetail/index?id=${
103
+          product.id
104
+        }&&isShare=${true}&&shareJump=${res.share_unique_value}`,
105
+        imageUrl: product.image_url,
106
+      });
107
+      // 打开分享弹窗
108
+      setShareModalOpened(true);
97 109
     });
98 110
   };
99 111
   return (
@@ -126,7 +138,11 @@ const ProductList = forwardRef((props, ref) => {
126 138
                   style={{ WebkitBoxOrient: "vertical" }}
127 139
                 >
128 140
                   <Text className="self-tag">
129
-                    {!isSeckill ? "自营" : "鱼市��杀"}
141
+                    {isSeckill
142
+                      ? "鱼市秒杀"
143
+                      : isHighCommission
144
+                      ? "高佣专项"
145
+                      : "自营"}
130 146
                   </Text>
131 147
                   {product.item_title}
132 148
                 </View>
@@ -179,7 +195,6 @@ const ProductList = forwardRef((props, ref) => {
179 195
                     <Image className="bg" src={shareEarnBg} mode="aspectFit" />
180 196
                     <View className="content">
181 197
                       <Button
182
-                        openType="share"
183 198
                         onClick={(e) => shareProduct(product, e)} // 传递事件对象
184 199
                       >
185 200
                         <Text className="label">分享赚</Text>
@@ -209,12 +224,19 @@ const ProductList = forwardRef((props, ref) => {
209 224
         </View>
210 225
       )}
211 226
       {isNoMore && <View className="no-more">没有更多了~</View>}
227
+      {/* 分享弹窗 */}
228
+      <ShareModal
229
+        onClose={() => setShareModalOpened(false)}
230
+        isOpened={shareModalOpened}
231
+        title="分享赚"
232
+      />
212 233
     </View>
213 234
   );
214 235
 });
215 236
 
216 237
 ProductList.defaultProps = {
217 238
   isSeckill: false,
239
+  isHighCommission: false,
218 240
   productList: [],
219 241
   loading: false,
220 242
   isManagement: false,
@@ -224,7 +246,6 @@ ProductList.defaultProps = {
224 246
   isNoMore: false,
225 247
   onAddProduct: () => {}, // 添加商品方法
226 248
   onDeleteProductSelect: () => {}, // 删除商品选中id数组
227
-  onShareProduct: () => {}, // 分享商品方法
228 249
 };
229 250
 
230 251
 export default ProductList;

+ 1 - 1
src/components/index/ProductList/index.less

@@ -57,7 +57,7 @@
57 57
         -webkit-line-clamp: 2;
58 58
         /* autoprefixer: ignore next */
59 59
         -webkit-box-orient: vertical;
60
-
60
+        line-height: 42px;
61 61
 
62 62
         .self-tag {
63 63
           padding: 2px 8px;

+ 17 - 0
src/components/shareModal/index.jsx

@@ -0,0 +1,17 @@
1
+import { AtModal, AtModalContent } from "taro-ui";
2
+import { View, Image, Text, Button } from "@tarojs/components";
3
+import "./index.less";
4
+
5
+export default function shareModal(props) {
6
+  const { title, isOpened, onClose } = props;
7
+  return (
8
+    <AtModal isOpened={isOpened} closeOnClickOverlay={true} onClose={onClose}>
9
+      <AtModalContent>
10
+        <View className="container">
11
+          <View className="title">{title}</View>
12
+          <Button openType="share" onClick={onClose}>分享</Button>
13
+        </View>
14
+      </AtModalContent>
15
+    </AtModal>
16
+  );
17
+}

+ 21 - 0
src/components/shareModal/index.less

@@ -0,0 +1,21 @@
1
+  .at-modal__container {
2
+    width: 610px !important;
3
+  }
4
+  .at-modal__content {
5
+    max-height: none !important;  // 移除最大高度限制
6
+    min-height: auto !important;  // 移除最小高度限制
7
+    height: auto !important;      // 高度自适应
8
+  }
9
+.container{
10
+    display: flex;
11
+    flex-direction: column;
12
+    align-items: center;
13
+    justify-content: center;
14
+    .title{
15
+        color: #000000;
16
+        font-size: 32px;
17
+        font-weight: bold;
18
+        line-height: 46px;
19
+        margin-bottom: 20px;
20
+    }
21
+}

+ 13 - 12
src/pages/index/index.jsx

@@ -1,6 +1,13 @@
1 1
 import Taro from "@tarojs/taro"; // 导入 Taro
2 2
 import { Component } from "react";
3
-import { View, Image, Swiper, SwiperItem, Text } from "@tarojs/components";
3
+import {
4
+  View,
5
+  Image,
6
+  Swiper,
7
+  SwiperItem,
8
+  Text,
9
+  Button,
10
+} from "@tarojs/components";
4 11
 import { AtTabs } from "taro-ui";
5 12
 import { getHomeData, getProductList } from "../../service";
6 13
 import { getShareContent } from "../../common/share";
@@ -63,7 +70,6 @@ export default class Index extends Component {
63 70
   componentDidShow() {
64 71
     this.getHomeData(); //获取首页数据
65 72
   }
66
-
67 73
   // 添加回到顶部方法
68 74
   handleBackTop = () => {
69 75
     Taro.pageScrollTo({
@@ -101,14 +107,6 @@ export default class Index extends Component {
101 107
       loading: false,
102 108
     }));
103 109
   };
104
-
105
-  // 分享商品
106
-  handleShareProduct = () => {
107
-    Taro.showShareMenu({
108
-      withShareTicket: true,
109
-      menus: ["shareAppMessage"],
110
-    });
111
-  };
112 110
   // 配置分享内容
113 111
   onShareAppMessage() {
114 112
     return getShareContent();
@@ -174,7 +172,9 @@ export default class Index extends Component {
174 172
           </View>
175 173
         </View>
176 174
         {/* 骨架屏 */}
177
-        <Skeleton isSkeletonShow={!homeData.banner&&!productList.length>0}/>
175
+        <Skeleton
176
+          isSkeletonShow={!homeData.banner && !productList.length > 0}
177
+        />
178 178
         {/* 分类列表组件 */}
179 179
         {homeData.icon && <CategoryList categoryList={homeData.icon} />}
180 180
         {/* 运营区域 */}
@@ -186,7 +186,7 @@ export default class Index extends Component {
186 186
           <ProductList
187 187
             productList={productList}
188 188
             loading={loading}
189
-            onShareProduct={this.handleShareProduct}
189
+            onShareProduct={this.handleShare}
190 190
           />
191 191
         </View>
192 192
         {/* 添加浮动按钮 */}
@@ -206,6 +206,7 @@ export default class Index extends Component {
206 206
             <Image className="back-top" src={backTopIcon} mode="aspectFit" />
207 207
           </View>
208 208
         </View>
209
+        {/* 分享弹窗 */}
209 210
       </View>
210 211
     );
211 212
   }

+ 1 - 9
src/pages/indexSub/highCommission/index.jsx

@@ -32,13 +32,6 @@ export default class Index extends Component {
32 32
       loading: false,
33 33
     }));
34 34
   };
35
-  // 分享商品
36
-  handleShareProduct = () => {
37
-      Taro.showShareMenu({
38
-        withShareTicket: true,
39
-        menus: ["shareAppMessage"],
40
-    });
41
-  };
42 35
   // 配置分享内容
43 36
   onShareAppMessage() {
44 37
     return getShareContent();
@@ -60,10 +53,9 @@ export default class Index extends Component {
60 53
         {/* 商品列表 */}
61 54
         <View className="product-list">
62 55
           <ProductList
63
-            isSeckill={true}
56
+            isHighCommission={true}
64 57
             productList={this.state.productList}
65 58
             loading={this.state.loading}
66
-            handleShareProduct={this.handleShareProduct}
67 59
           />
68 60
         </View>
69 61
       </View>

+ 100 - 36
src/pages/indexSub/productDetail/index.jsx

@@ -1,7 +1,19 @@
1 1
 import { Component } from "react";
2
-import { View, Text, Swiper, SwiperItem, Image, Button } from "@tarojs/components";
2
+import {
3
+  View,
4
+  Text,
5
+  Swiper,
6
+  SwiperItem,
7
+  Image,
8
+} from "@tarojs/components";
3 9
 import { AtIcon } from "taro-ui";
4
-import { getProductDetail, getProductLikeList,getProductPromotion } from "../../../service";
10
+import {
11
+  getProductDetail,
12
+  getProductLikeList,
13
+  getProductPromotion,
14
+  getShareJump,
15
+  bindShareJump,
16
+} from "../../../service";
5 17
 import "./index.less";
6 18
 import Taro from "@tarojs/taro";
7 19
 import productDetailIcon from "../../../images/productDetail/productDetailIcon.png";
@@ -11,26 +23,35 @@ import selfBuy from "../../../images/productDetail/selfBuy.png";
11 23
 import share from "../../../images/productDetail/share.png";
12 24
 import ProductCard from "../../../components/ProductCard"; //产品卡片
13 25
 import Modal from "../../../components/Modal"; //弹窗
14
-
26
+import ShareModal from "../../../components/shareModal"; //分享弹窗
15 27
 export default class Index extends Component {
16 28
   state = {
17 29
     id: "", //商品id
18 30
     isShare: false, //是否是分享
19
-    isOpened: false, //是否打开弹窗
31
+    isOpened: '', //是否打开弹窗
20 32
     productDetail: [], //商品详情
21 33
     productLikeList: [], //推荐商品列表
22 34
     productPromotion: [], //商品推广转链
35
+    isHighCommission: false, //是否是高佣金页面
36
+    isSeckill: false, //是否是秒杀页面
37
+    shareJump: "", //分享跳转标识
23 38
   };
24 39
   // 获取产品详情的方法
25
-  fetchProductDetails = async (id) => { 
40
+  fetchProductDetails = async (id) => {
26 41
     const res = await getProductDetail({
27 42
       goods_id: id,
28 43
     });
29
-    this.setState({
30
-      productDetail: res,
31
-    },() => {
32
-      this.getProductPromotion(); //获取商品推广转链
33
-    });
44
+    this.setState(
45
+      {
46
+        productDetail: res,
47
+      },
48
+      () => {
49
+        let session_key = Taro.getStorageSync("session_key");
50
+        if (session_key) {
51
+          this.getProductPromotion(); //获取商品推广转链
52
+        }
53
+      }
54
+    );
34 55
   };
35 56
   // 获取猜你喜欢列表
36 57
   getProductLikeList = async () => {
@@ -46,17 +67,35 @@ export default class Index extends Component {
46 67
       item_id: [this.state.productDetail.item_id],
47 68
     });
48 69
     this.setState({
49
-      productPromotion: res.alibaba_idle_affiliate_general_link_convert_response.result.result,
70
+      productPromotion:
71
+        res.alibaba_idle_affiliate_general_link_convert_response.result.result,
50 72
     });
51 73
   };
52 74
   componentDidMount() {
53
-    const { id, isShare } = Taro.getCurrentInstance().router.params;
54
-    this.setState({
55
-      id,
56
-      isShare,
57
-    });
58
-    this.fetchProductDetails(id); //获取产品详情
59
-    this.getProductLikeList(); //获取猜你喜欢列表
75
+    const { id, isShare, isHighCommission, isSeckill, shareJump } =
76
+      Taro.getCurrentInstance().router.params;
77
+    this.setState(
78
+      {
79
+        id,
80
+        isShare,
81
+        isHighCommission: isHighCommission === "true",
82
+        isSeckill: isSeckill === "true",
83
+      },
84
+      () => {
85
+        // 获取分享跳转标识
86
+        shareJump &&
87
+          Taro.setStorage({
88
+            key: "shareJump",
89
+            data: shareJump,
90
+          });
91
+        this.fetchProductDetails(id); //获取产品详情
92
+        this.getProductLikeList(); //获取猜你喜欢列表
93
+        let session_key = Taro.getStorageSync("session_key");
94
+        if (session_key && shareJump) {
95
+          this.bindShareJump(); //绑定分享跳转标识
96
+        }
97
+      }
98
+    );
60 99
   }
61 100
   // 复制商品编号
62 101
   handleCopy = (text) => {
@@ -79,26 +118,42 @@ export default class Index extends Component {
79 118
   };
80 119
 
81 120
   // 立即购买
82
-  handleBuy = () => {
121
+  handleBuy = async () => {
122
+    if (!this.state.productPromotion.short_tpwd) {
123
+      await this.getProductPromotion();
124
+    }
83 125
     this.setState({
84
-      isOpened: true,
126
+      isOpened: 'self',
85 127
     });
86 128
   };
129
+
87 130
   // 分享
88
-  handleShare = () => {
89
-    // 只显示分享菜单
90
-    Taro.showShareMenu({
91
-      withShareTicket: true,
92
-      menus: ['shareAppMessage']
131
+  openSharePopup = async () => {
132
+    const res = await getShareJump({
133
+      share_type: 1,
134
+      share_id: this.state.id,
93 135
     });
136
+    this.setState({
137
+      shareJump: res.share_unique_value,
138
+      isOpened: 'share',
139
+    });
140
+  };
141
+  // 绑定分享跳转标识
142
+  bindShareJump = async () => {
143
+    let shareJump = Taro.getStorageSync("shareJump");
144
+    await bindShareJump({
145
+      share_type: 1,
146
+      share_unique_value: shareJump,
147
+    });
148
+    Taro.removeStorageSync("shareJump");
94 149
   };
95 150
   // 配置分享内容
96 151
   onShareAppMessage() {
97 152
     return {
98 153
       title: this.state.productDetail.item_title,
99
-      path: `/pages/indexSub/productDetail/index?id=${this.state.id}&&isShare=${this.state.isShare}`,
100
-      imageUrl: this.state.productDetail.images[0].img
101
-    }
154
+      path: `/pages/indexSub/productDetail/index?id=${this.state.id}&&isShare=true&&isHighCommission=${this.state.isHighCommission}&&isSeckill=${this.state.isSeckill}&&shareJump=${this.state.shareJump}`,
155
+      imageUrl: this.state.productDetail.images[0].img,
156
+    };
102 157
   }
103 158
   // 添加返回方法
104 159
   handleBack = () => {
@@ -111,7 +166,6 @@ export default class Index extends Component {
111 166
       });
112 167
     }
113 168
   };
114
-
115 169
   render() {
116 170
     const { productDetail } = this.state;
117 171
     return (
@@ -141,7 +195,13 @@ export default class Index extends Component {
141 195
         <View className="product-info">
142 196
           {/* 商品名称 */}
143 197
           <Text className="product-name">
144
-            <Text className="self-tag">自营</Text>
198
+            <Text className="self-tag">
199
+              {this.state.isHighCommission
200
+                ? "高佣专项"
201
+                : this.state.isSeckill
202
+                ? "鱼市秒杀"
203
+                : "自营"}
204
+            </Text>
145 205
             {productDetail.item_title}
146 206
           </Text>
147 207
 
@@ -219,13 +279,11 @@ export default class Index extends Component {
219 279
             {!this.state.isShare ? (
220 280
               <>
221 281
                 <View
222
-                  onClick={this.handleShare}
282
+                  onClick={this.openSharePopup}
223 283
                   className="bottom-buy-right-self"
224 284
                 >
225
-                <Button openType="share" onClick={this.handleShare}>
226 285
                   <Image src={share} mode="aspectFit" />
227 286
                   <Text className="bottom-buy-text">分享赚</Text>
228
-                </Button>
229 287
                 </View>
230 288
                 <View
231 289
                   onClick={this.handleBuy}
@@ -242,12 +300,18 @@ export default class Index extends Component {
242 300
             )}
243 301
           </View>
244 302
         </View>
245
-        {/* 分享弹窗 */}
303
+        {/* 自购弹窗 */}
246 304
         <Modal
247
-          linkText={this.state.productPromotion.short_tpwd}
248 305
           title="咸鱼口令已复制"
249
-          isOpened={this.state.isOpened}
306
+          isOpened={this.state.isOpened=='self'}
250 307
           productPromotion={this.state.productPromotion}
308
+          linkText={this.state.productPromotion.short_tpwd}
309
+        />
310
+        {/* 分享弹窗 */}
311
+        <ShareModal
312
+          isOpened={this.state.isOpened=='share'}
313
+          onClose={() => this.setState({ isOpened: '' })}
314
+          title="分享赚"
251 315
         />
252 316
       </View>
253 317
     );

+ 25 - 20
src/pages/indexSub/productDetail/index.less

@@ -205,7 +205,9 @@
205 205
             .bottom-buy-right-self {
206 206
                 background-color: #fbe00f;
207 207
                 color: #000000;
208
-
208
+                display: flex;
209
+                justify-content: center;
210
+                align-items: center;
209 211
                 image {
210 212
                     width: 47px;
211 213
                     height: 46px;
@@ -260,23 +262,26 @@
260 262
 }
261 263
 
262 264
 // 清除Button默认样式
263
-Button {
264
-    padding: 0;
265
-    margin: 0;
266
-    background: none;
267
-    border: none;
268
-    line-height: normal;
269
-    height: 100%;
270
-    width: 100%;
271
-    display: flex;
272
-    justify-content: center;
273
-    align-items: center;
274
-
275
-    &::after {
276
-        border: none;
277
-    }
278
-}
265
+// Button {
266
+//     padding: 0;
267
+//     margin: 0;
268
+//     background: none;
269
+//     border: none;
270
+//     line-height: normal;
271
+//     height: 100%;
272
+//     width: 100%;
273
+//     display: flex;
274
+//     justify-content: center;
275
+//     align-items: center;
276
+
277
+//     &::after {
278
+//         border: none;
279
+//     }
280
+// }
281
+
279 282
 .button-hover {
280
-    background-color: transparent !important; /* 移除背景高亮 */
281
-    box-shadow: none !important;             /* 移除可能的阴影 */
282
-  }
283
+    background-color: transparent !important;
284
+    /* 移除背景高亮 */
285
+    box-shadow: none !important;
286
+    /* 移除可能的阴影 */
287
+}

+ 0 - 8
src/pages/indexSub/seckillIndex/index.jsx

@@ -32,13 +32,6 @@ export default class Index extends Component {
32 32
       loading: false,
33 33
     }));
34 34
   };
35
-  // 分享商品
36
-  handleShareProduct = () => {
37
-    Taro.showShareMenu({
38
-      withShareTicket: true,
39
-      menus: ["shareAppMessage"],
40
-    });
41
-  };
42 35
   // 配置分享内容
43 36
   onShareAppMessage() {
44 37
     return getShareContent();
@@ -63,7 +56,6 @@ export default class Index extends Component {
63 56
             isSeckill={true}
64 57
             productList={this.state.productList}
65 58
             loading={this.state.loading}
66
-            onShareProduct={this.handleShareProduct}
67 59
           />
68 60
         </View>
69 61
       </View>

+ 21 - 7
src/pages/login/index.jsx

@@ -1,8 +1,8 @@
1 1
 import { Component } from "react";
2
-import { View, Image, Button, Checkbox } from "@tarojs/components";
2
+import { View, Image, Button } from "@tarojs/components";
3 3
 import Taro from "@tarojs/taro";
4 4
 import { AtCheckbox } from "taro-ui";
5
-import { login,getUserInfo } from "../../service";
5
+import { login,getUserInfo,bindShareJump } from "../../service";
6 6
 import { objToParam } from "../../common/toParams";
7 7
 import "./index.less";
8 8
 import logo1 from "../../images/logo1.png";
@@ -61,18 +61,32 @@ export default class Index extends Component {
61 61
                 title: '登录成功',
62 62
                 icon: 'none',
63 63
               })
64
+              // 获取个人信息
64 65
               getUserInfo().then(res => {
65 66
                 Taro.setStorageSync('userInfo', res)
66 67
               })
68
+              // 绑定分享跳转标识
69
+              let shareJump = Taro.getStorageSync('shareJump')
70
+              if(shareJump){
71
+                bindShareJump({
72
+                  share_unique_value: shareJump,
73
+                  share_type:1
74
+                }).then(res => {
75
+                  Taro.removeStorageSync('shareJump')
76
+                  if (global.globalData.optionsData) {
77
+                    delete global.globalData.optionsData.shareJump
78
+                  }
79
+                })
80
+              }
67 81
               let lastPage = Taro.getStorageSync('currentPage')
68 82
               if (lastPage == 'pages/mineSub/login/index') {
69 83
                 lastPage = 'pages/index/index'
70 84
               }
71
-                Taro.reLaunch({
72
-                  url: `/${lastPage}?${objToParam(Taro.getStorageSync('optionsData'))}`
73
-                })
74
-                Taro.removeStorageSync('currentPage')
75
-                global.globalData.optionsData = {}
85
+              Taro.reLaunch({
86
+                url: `/${lastPage}?${objToParam(global.globalData.optionsData)}`
87
+              })
88
+              Taro.removeStorageSync('currentPage')
89
+              global.globalData.optionsData = {}
76 90
             });
77 91
           },
78 92
         });

+ 0 - 8
src/pages/memberSub/productClassify/index.jsx

@@ -90,13 +90,6 @@ export default class Index extends Component {
90 90
       }
91 91
     });
92 92
   };
93
-  // 分享商品
94
-  handleShareProduct = () => {
95
-    Taro.showShareMenu({
96
-      withShareTicket: true,
97
-      menus: ["shareAppMessage"],
98
-    });
99
-  };
100 93
   // 配置分享内容
101 94
   onShareAppMessage() {
102 95
     return getShareContent();
@@ -125,7 +118,6 @@ export default class Index extends Component {
125 118
           loading={this.state.loading}
126 119
           productList={this.state.productList}
127 120
           isProductClassify={true}
128
-          onShareProduct={this.handleShareProduct}
129 121
           onAddProduct={(productId, index) =>
130 122
             this.onAddProduct(productId, index)
131 123
           }

+ 0 - 8
src/pages/memberSub/productManagement/index.jsx

@@ -204,13 +204,6 @@ export default class Index extends Component {
204 204
       });
205 205
     }
206 206
   };
207
-  // 分享商品
208
-  handleShareProduct = () => {
209
-    Taro.showShareMenu({
210
-      withShareTicket: true,
211
-      menus: ["shareAppMessage"],
212
-    });
213
-  };
214 207
   // 配置分享内容
215 208
   onShareAppMessage() {
216 209
     return getShareContent();
@@ -278,7 +271,6 @@ export default class Index extends Component {
278 271
                     loading={this.state.loading}
279 272
                     onDeleteProductSelect={this.onDeleteProductSelect}
280 273
                     isNoMore={this.state.isNoMore}
281
-                    onShareProduct={this.handleShareProduct}
282 274
                   />
283 275
                 )}
284 276
               </View>

+ 14 - 9
src/pages/memberSub/storeManagement/index.jsx

@@ -2,7 +2,7 @@ import { Component } from "react";
2 2
 import { View, Text, Image, Button } from "@tarojs/components";
3 3
 import { AtIcon } from "taro-ui";
4 4
 import "./index.less";
5
-import { getMyShopList, getMyShopDetail, getShareShopDetail, getShareShopProductList } from "../../../service";
5
+import { getMyShopList, getMyShopDetail, getShareShopDetail, getShareShopProductList, getShareJump,bindShareJump } from "../../../service";
6 6
 import storeManagement from "../../../images/storeManagement/storeManagement.png";
7 7
 import storeManagementIcon from "../../../images/storeManagement/storeManagementIcon.png";
8 8
 import ProductCard from "../../../components/ProductCard"; //卡片模块
@@ -52,6 +52,8 @@ export default class Index extends Component {
52 52
   componentDidShow() {
53 53
     const { router } = Taro.getCurrentInstance();
54 54
     const params = router.params;
55
+    console.log(params,1111);
56
+    
55 57
     this.setState({
56 58
       isManager: JSON.parse(params.isManager), //是否是店长
57 59
       isShare: params.isShare||false, // 是否是分享进入
@@ -77,20 +79,23 @@ export default class Index extends Component {
77 79
       url: "/pages/mineSub/infoEdit/index",
78 80
     });
79 81
   };
80
-  // 分享店铺
81
-  handleShare = () => {
82
-    Taro.showShareMenu({
83
-      withShareTicket: true,
84
-      menus: ['shareAppMessage']
85
-    });
86
-  };
87 82
   // 配置分享内容
88 83
   onShareAppMessage() {
89 84
     return {
90 85
       title: "店铺",
91
-      path: `/pages/memberSub/storeManagement/index?shopId=${this.state.shopDetail.id}&isShare=true&isManager=false`,
86
+      path: `/pages/memberSub/storeManagement/index?shopId=${this.state.shopDetail.id}&isShare=true&isManager=false&&shareJump=${res.share_unique_value}`,
92 87
       imageUrl: ''
93 88
     }
89
+    return getShareJump({
90
+      share_type:2,
91
+      share_id: this.state.shopDetail.id
92
+    }).then(res=>{
93
+      return {
94
+        title: "店铺",
95
+        path: `/pages/memberSub/storeManagement/index?shopId=${this.state.shopDetail.id}&isShare=true&isManager=false&&shareJump=${res.share_unique_value}`,
96
+        imageUrl: ''
97
+      }
98
+    })
94 99
   }
95 100
   render() {
96 101
     const { shopDetail, productList } = this.state;

+ 14 - 0
src/service/index.js

@@ -79,6 +79,20 @@ export const getUserAgreement = data =>
79 79
     method: 'POST',
80 80
     data,
81 81
   })
82
+  // 获取分享跳转标识
83
+export const getShareJump = data =>
84
+  Request({
85
+    url: '/user/get_not_oneself_store_detail',
86
+    method: 'POST',
87
+    data,
88
+  })
89
+  // 绑定分享跳转标识
90
+  export const bindShareJump = data =>
91
+  Request({
92
+    url: '/user/get_share_unique_value',
93
+    method: 'POST',
94
+    data,
95
+  })
82 96
 // ---------------------会员
83 97
 // 获取会员详情
84 98
 export const getVipInfo = data =>