Преглед изворни кода

Merge branch 'master' of http://code.qutaovip.com/lihai/fish_app

* 'master' of http://code.qutaovip.com/lihai/fish_app:
  商品分类搜索框&我的-鱼市说明
  商品分享页修改上传
  处理商品分享页面逻辑
  分享页面&&处理埋点
  新春活动页面&&签约修改
  分享隐藏返回&&活动页面&&实名认证修改
  隐藏安卓滚动条&&上传头像
  增加商品描述&&更换本地图片
  隐藏微信号填写
  订阅消息&&banner跳转&&捡漏计算器bug修改
  捡漏计算器对接接口
  捡漏计算器页面&推广人展示&伙伴说明弹窗
  绑定关系重复展示隐藏&分享后页面按钮展示&订单类型展示
  专项&&我的小店分享绑定
  首页专项区域动态配置
  调整我的小店加载状态
  收益详情字段修改
黎海 пре 6 дана
родитељ
комит
c085ef3e85
80 измењених фајлова са 4127 додато и 644 уклоњено
  1. 126 0
      project.private.config.json
  2. 14 9
      src/api/request.js
  3. 15 2
      src/app.config.js
  4. 25 0
      src/common/track.js
  5. 9 28
      src/components/Modal/index.jsx
  6. 2 2
      src/components/ProductCard/index.jsx
  7. 4 18
      src/components/index/OperationArea/index.jsx
  8. 2 2
      src/components/index/OperationArea/index.less
  9. 107 99
      src/components/index/ProductList/index.jsx
  10. 33 3
      src/components/index/ProductList/index.less
  11. 39 0
      src/components/instructionModal/index.jsx
  12. 108 0
      src/components/instructionModal/index.less
  13. 1 2
      src/components/signModal/index.jsx
  14. BIN
      src/images/calculator/IconThree.png
  15. BIN
      src/images/calculator/iconOne.png
  16. BIN
      src/images/calculator/iconTwo.png
  17. BIN
      src/images/calculator/more.png
  18. BIN
      src/images/calculator/toShare.png
  19. BIN
      src/images/calculator/wish.png
  20. BIN
      src/images/index/shareBuy.png
  21. BIN
      src/images/loginBg.png
  22. BIN
      src/images/member/calculator.png
  23. BIN
      src/images/mine/avatar.png
  24. BIN
      src/images/productDetail/selectStep.png
  25. BIN
      src/images/productDetail/sign.png
  26. BIN
      src/images/productDetail/stepThree.png
  27. BIN
      src/images/productDetail/xianyu.png
  28. BIN
      src/images/seckill/heighTop.jpg
  29. BIN
      src/images/seckill/seckillTop.jpg
  30. 3 0
      src/pages/calculatorSub/calculator/index.config.js
  31. 95 0
      src/pages/calculatorSub/calculator/index.jsx
  32. 203 0
      src/pages/calculatorSub/calculator/index.less
  33. 3 0
      src/pages/calculatorSub/calculatorInventory/index.config.js
  34. 76 0
      src/pages/calculatorSub/calculatorInventory/index.jsx
  35. 68 0
      src/pages/calculatorSub/calculatorInventory/index.less
  36. 3 0
      src/pages/calculatorSub/calculatorResult/index.config.js
  37. 130 0
      src/pages/calculatorSub/calculatorResult/index.jsx
  38. 273 0
      src/pages/calculatorSub/calculatorResult/index.less
  39. 3 0
      src/pages/calculatorSub/calculatorWish/index.config.js
  40. 159 0
      src/pages/calculatorSub/calculatorWish/index.jsx
  41. 172 0
      src/pages/calculatorSub/calculatorWish/index.less
  42. 3 0
      src/pages/calculatorSub/calculatorWishList/index.config.js
  43. 47 0
      src/pages/calculatorSub/calculatorWishList/index.jsx
  44. 68 0
      src/pages/calculatorSub/calculatorWishList/index.less
  45. 25 9
      src/pages/index/index.jsx
  46. 11 2
      src/pages/index/index.less
  47. 4 0
      src/pages/indexSub/activity/index.config.js
  48. 320 0
      src/pages/indexSub/activity/index.jsx
  49. 287 0
      src/pages/indexSub/activity/index.less
  50. 1 2
      src/pages/indexSub/highCommission/index.jsx
  51. 129 97
      src/pages/indexSub/productDetail/index.jsx
  52. 20 2
      src/pages/indexSub/productDetail/index.less
  53. 1 1
      src/pages/indexSub/seckillIndex/index.config.js
  54. 78 50
      src/pages/indexSub/seckillIndex/index.jsx
  55. 2 2
      src/pages/indexSub/seckillIndex/index.less
  56. 3 0
      src/pages/indexSub/sharePage/index.config.js
  57. 279 0
      src/pages/indexSub/sharePage/index.jsx
  58. 232 0
      src/pages/indexSub/sharePage/index.less
  59. 32 29
      src/pages/login/index.jsx
  60. 175 44
      src/pages/member/index.jsx
  61. 35 19
      src/pages/member/index.less
  62. 16 7
      src/pages/memberSub/Alipay/index.jsx
  63. 22 15
      src/pages/memberSub/earningsDetail/index.jsx
  64. 28 20
      src/pages/memberSub/earningsOrder/index.jsx
  65. 39 22
      src/pages/memberSub/earningsOrder/index.less
  66. 44 8
      src/pages/memberSub/productClassify/index.jsx
  67. 53 3
      src/pages/memberSub/productClassify/index.less
  68. 7 1
      src/pages/memberSub/productManagement/index.less
  69. 113 51
      src/pages/memberSub/storeManagement/index.jsx
  70. 107 53
      src/pages/memberSub/storeManagement/index.less
  71. 63 17
      src/pages/mine/index.jsx
  72. 43 0
      src/pages/mine/index.less
  73. 3 0
      src/pages/mineSub/explain/index.config.js
  74. 28 0
      src/pages/mineSub/explain/index.jsx
  75. 6 0
      src/pages/mineSub/explain/index.less
  76. 56 23
      src/pages/mineSub/infoEdit/index.jsx
  77. 9 0
      src/pages/mineSub/infoEdit/index.less
  78. 2 0
      src/pages/mineSub/userSpecification/index.less
  79. 54 0
      src/service/activity.js
  80. 9 2
      src/service/index.js

Разлика између датотеке није приказан због своје велике величине
+ 126 - 0
project.private.config.json


+ 14 - 9
src/api/request.js

@@ -37,16 +37,21 @@ export default async (options = { method: 'GET', data: {} }) => {
37 37
       },
38 38
       method: options.method.toUpperCase(),
39 39
     });
40
-    const { code,data, msg } = res.data;
40
+    const { code, data, msg } = res.data;
41 41
     switch (code) {
42 42
       case 200:
43 43
         return data;
44 44
       case 400:
45
-        Taro.showToast({
46
-          title: msg,
47
-          icon: 'none',
48
-          mask: true,
49
-        });
45
+        if (options.url.includes('/user/get_share_unique_value')) {
46
+        } else {
47
+          if (msg) {
48
+            Taro.showToast({
49
+              title: msg,
50
+              icon: 'none',
51
+              mask: true,
52
+            });
53
+          }
54
+        }
50 55
         return Promise.reject(msg);
51 56
       case 422:
52 57
         return Promise.reject(msg);
@@ -56,7 +61,7 @@ export default async (options = { method: 'GET', data: {} }) => {
56 61
           icon: 'none',
57 62
           mask: true,
58 63
         });
59
-        
64
+
60 65
         // 获取当前跳转到登录的页面路径
61 66
         const currentPages = Taro.getCurrentPages();
62 67
         const currentPage = currentPages[currentPages.length - 1];
@@ -65,13 +70,13 @@ export default async (options = { method: 'GET', data: {} }) => {
65 70
           Taro.setStorageSync('currentPage', currentPage.route);
66 71
           global.globalData.optionsData = currentPage.options || {};
67 72
         }
68
-        
73
+
69 74
         Taro.reLaunch({
70 75
           url: '/pages/login/index',
71 76
         });
72 77
         return Promise.reject(msg);
73 78
       default:
74
-        if(msg){
79
+        if (msg) {
75 80
           Taro.showToast({
76 81
             title: `${msg}`,
77 82
             icon: 'none',

+ 15 - 2
src/app.config.js

@@ -13,7 +13,9 @@ export default defineAppConfig({
13 13
         "productDetail/index",
14 14
         "seckillIndex/index",
15 15
         "searchList/index",
16
-        "highCommission/index"
16
+        "highCommission/index",
17
+        "activity/index",
18
+        "sharePage/index"
17 19
       ]
18 20
     },
19 21
     {
@@ -36,7 +38,18 @@ export default defineAppConfig({
36 38
       root: "pages/mineSub",
37 39
       pages: [
38 40
         "infoEdit/index",
39
-        "userSpecification/index"
41
+        "userSpecification/index",
42
+        "explain/index"
43
+      ]
44
+    },
45
+    {
46
+      root: "pages/calculatorSub",
47
+      pages: [
48
+        "calculator/index",
49
+        "calculatorInventory/index",
50
+        "calculatorResult/index",
51
+        "calculatorWish/index",
52
+        "calculatorWishList/index",
40 53
       ]
41 54
     },
42 55
   ],

+ 25 - 0
src/common/track.js

@@ -0,0 +1,25 @@
1
+import Taro from "@tarojs/taro";
2
+import { formatDate } from "./time";
3
+import { addLog } from "../service/index";
4
+import { isDebounce } from "./debounce";
5
+// 统计埋点
6
+export const handleLog = (data) => {
7
+  if (!isDebounce(500)) return; // 如果在500ms内重复触发,直接返回
8
+  const dayid = formatDate(new Date(), "YYYY-MM-DD");
9
+  const userId = Taro.getStorageSync("loginInfo")?.id || 0;
10
+  const ext = data.shareUserId ? JSON.stringify({ share_users_id: data.shareUserId }) : '';
11
+  const event_type = data.event_type;
12
+  const event_type_title = data.event_type_title;
13
+  const goods_id = data.goods_id || 0;
14
+  const params = {
15
+    dayid,
16
+    users_id:userId,
17
+    goods_id,
18
+    event_type,
19
+    event_type_title,
20
+    ext,
21
+  };
22
+  addLog(params);
23
+};
24
+
25
+

+ 9 - 28
src/components/Modal/index.jsx

@@ -1,18 +1,12 @@
1 1
 import { AtModal, AtModalContent } from "taro-ui";
2 2
 import { View, Image, Text } from "@tarojs/components";
3
-import { addLog } from "../../service";
4
-import { formatDate } from "../../common/time";
5
-import { isDebounce } from "../../common/debounce";
3
+import { handleLog } from "../../common/track";
6 4
 import "./index.less";
7 5
 import Taro from "@tarojs/taro";
8
-import selectStep from "../../images/productDetail/selectStep.png";
9
-import xianyu from "../../images/productDetail/xianyu.png";
10
-import stepThree from "../../images/productDetail/stepThree.png";
11 6
 export default function Modal(props) {
12
-  const { productPromotion, isOpened, title, linkText, id, shareUserId,isHighCommission,isSeckill } =
7
+  const { productPromotion, isOpened, title, linkText, id, shareUserId,isSeckill } =
13 8
     props;
14 9
   const handleCopyLink = () => {
15
-    if (!isDebounce(500)) return; // 如果在300ms内重复触发,直接返回
16 10
     Taro.setClipboardData({
17 11
       data: productPromotion.short_tpwd,
18 12
     }).then(() => {
@@ -20,25 +14,12 @@ export default function Modal(props) {
20 14
         title: "口令已复制",
21 15
         icon: "success",
22 16
       });
23
-      if (isHighCommission || isSeckill) {
24
-        const dayid = formatDate(new Date(), "YYYY-MM-DD");
25
-        let userId = "";
26
-        if (Taro.getStorageSync("loginInfo")) {
27
-          userId = Taro.getStorageSync("loginInfo").id;
28
-        }
29
-        let ext = "";
30
-        if (shareUserId) {
31
-          ext = JSON.stringify({
32
-            share_users_id: shareUserId,
33
-          });
34
-        }
35
-        addLog({
17
+      if (isSeckill) {
18
+        handleLog({
19
+          shareUserId:shareUserId,
36 20
           event_type: "buy_product_link",
37 21
           event_type_title: "点击购买",
38 22
           goods_id: Number(id),
39
-          ext,
40
-          dayid,
41
-          users_id: userId||0,
42 23
         });
43 24
       }
44 25
     });
@@ -58,7 +39,7 @@ export default function Modal(props) {
58 39
                 </View>
59 40
                 <View className="step-box">
60 41
                   <View className="step-One">复制口令</View>
61
-                  <Image className="step-img-one" src={selectStep} />
42
+                  <Image className="step-img-one" src='https://yushi.tos-cn-beijing.volces.com/productDetail/selectStep.png'/>
62 43
                 </View>
63 44
               </View>
64 45
               <View className="step-item">
@@ -67,8 +48,8 @@ export default function Modal(props) {
67 48
                   <Text className="desc">打开闲鱼APP</Text>
68 49
                 </View>
69 50
                 <View className="step-box">
70
-                  <Image className="step-img-t" src={xianyu} />
71
-                  <Image className="step-img-two" src={selectStep} />
51
+                  <Image className="step-img-t" src='https://yushi.tos-cn-beijing.volces.com/productDetail/xianyu.png' />
52
+                  <Image className="step-img-two" src='https://yushi.tos-cn-beijing.volces.com/productDetail/selectStep.png' />
72 53
                 </View>
73 54
               </View>
74 55
               <View className="step-item">
@@ -80,7 +61,7 @@ export default function Modal(props) {
80 61
                   <Image
81 62
                     mode="heightFix"
82 63
                     className="step-img-three"
83
-                    src={stepThree}
64
+                    src='https://yushi.tos-cn-beijing.volces.com/productDetail/stepThree.png'
84 65
                   />
85 66
                 </View>
86 67
               </View>

+ 2 - 2
src/components/ProductCard/index.jsx

@@ -2,9 +2,9 @@ import { View, Text, Image } from '@tarojs/components'
2 2
 import Taro from '@tarojs/taro'
3 3
 import './index.less'
4 4
 
5
-const ProductCard = ({ product }) => {
5
+const ProductCard = ({ product,isShare,isShowBack }) => {
6 6
   return (
7
-    <View onClick={() => Taro.navigateTo({ url: `/pages/indexSub/productDetail/index?id=${product.id}` })} className='product-card'>
7
+    <View onClick={() => Taro.navigateTo({ url: `/pages/indexSub/productDetail/index?id=${product.id}&isShare=${isShare}&isShowBack=${isShowBack}` })} className='product-card'>
8 8
       <Image className='product-img' src={product.image_url} mode='aspectFill' />
9 9
       <View className='product-content'>
10 10
         <Text className='title'>{product.item_title}</Text>

+ 4 - 18
src/components/index/OperationArea/index.jsx

@@ -5,24 +5,17 @@ import "./index.less";
5 5
 const OperationArea = ({ recommend }) => {
6 6
   // 添加跳转方法
7 7
   const handleNavigate = (type) => {
8
-    if (type === "鱼市秒杀") {
9
-      Taro.navigateTo({
10
-        url: `/pages/indexSub/seckillIndex/index?isDirect=true`,
11
-      });
12
-    } else if (type === "高佣专项") {
13
-      Taro.navigateTo({
14
-        url: `/pages/indexSub/highCommission/index?isDirect=true`,
15
-      });
16
-    }
8
+    Taro.navigateTo({
9
+      url: `/pages/indexSub/seckillIndex/index?isDirect=true&title=${type.name}&id=${type.id}`,
10
+    });
17 11
   };
18
-
19 12
   return (
20 13
     <View className="operation-wrap">
21 14
       {recommend.map((item, index) => (
22 15
         <View
23 16
           key={index}
24 17
           className="operation-item"
25
-          onClick={() => handleNavigate(item.tag.name)}
18
+          onClick={() => handleNavigate(item.tag)}
26 19
         >
27 20
           <View className="title-wrap">
28 21
             <Text className="title">{item.tag.name}</Text>
@@ -53,13 +46,6 @@ const OperationArea = ({ recommend }) => {
53 46
           </View>
54 47
         </View>
55 48
       ))}
56
-
57
-      {/* <View className="operation-item" onClick={() => handleNavigate('highCommission')}>
58
-        <View className="title-wrap">
59
-          <Text className="title">高佣专项</Text>
60
-          <Text className="tag">高佣金必囤爆品</Text>
61
-        </View>
62
-      </View> */}
63 49
     </View>
64 50
   );
65 51
 };

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

@@ -2,14 +2,14 @@
2 2
     margin: 16px 16px 0;
3 3
     display: flex;
4 4
     justify-content: space-between;
5
-
5
+    flex-wrap: wrap;
6 6
     .operation-item {
7 7
         width: 350px;
8 8
         height: 256px;
9 9
         background: #FFFFFF;
10 10
         border-radius: 16px;
11 11
         border: 1px solid #FFFFFF;
12
-
12
+        margin-bottom: 16px;
13 13
         .title {
14 14
             font-size: 28px;
15 15
             font-weight: bold;

+ 107 - 99
src/components/index/ProductList/index.jsx

@@ -7,8 +7,9 @@ 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 { formatDate } from "../../../common/time";
11
-import { getShareJump, addLog } from "../../../service";
10
+import { getShareJump } from "../../../service";
11
+import { handleLog } from "../../../common/track";
12
+import { isDebounce } from "../../../common/debounce";
12 13
 import Taro from "@tarojs/taro";
13 14
 import "./index.less";
14 15
 import ShareModal from "../../shareModal";
@@ -16,15 +17,15 @@ import joinStoreBg from "../../../images/index/jionStore.png";
16 17
 import joinStoreAc from "../../../images/index/joinStoreAc.png";
17 18
 import saveMoneyBg from "../../../images/index/save-money.png";
18 19
 import buy from "../../../images/index/buy.png";
20
+import shareBuy from "../../../images/index/shareBuy.png";
19 21
 import shareEarnBg from "../../../images/index/share-earn.png";
20 22
 import seckillIcon from "../../../images/seckill/seckillIcon.png";
21
-import { isDebounce } from "../../../common/debounce";
22 23
 const ProductList = forwardRef((props, ref) => {
23 24
   const {
24 25
     productList, // 商品列表数据
25 26
     loading, // 加载状态
26
-    isSeckill, // 是否秒杀页面使用
27
-    isHighCommission, // 是否高佣金��面使用
27
+    isSeckill, // 是否专项区域页面使用
28
+    tagTitle, //专项区域名称
28 29
     isManagement, // 是否管理页面使用
29 30
     isManagementStatus, // 是否管理状态
30 31
     isProductClassify, // 是否分类页面使用
@@ -34,6 +35,8 @@ const ProductList = forwardRef((props, ref) => {
34 35
     isNoMore, // 是否没有更多
35 36
     shareUserId, // 分享用户id
36 37
     isEmpty, // 是否为空
38
+    isShare, //是否是分享
39
+    isShowBack, //是否显示返回
37 40
   } = props;
38 41
 
39 42
   const [selectedProducts, setSelectedProducts] = useState([]); // 商品选择状态
@@ -69,7 +72,7 @@ const ProductList = forwardRef((props, ref) => {
69 72
       selectProduct(id);
70 73
     } else {
71 74
       Taro.navigateTo({
72
-        url: `/pages/indexSub/productDetail/index?id=${id}&&isHighCommission=${isHighCommission}&&isSeckill=${isSeckill}&&shareUserId=${shareUserId}`,
75
+        url: `/pages/indexSub/productDetail/index?id=${id}&&isSeckill=${isSeckill}&&shareUserId=${shareUserId}&&tagTitle=${tagTitle}&&isShare=${isShare}&&isShowBack=${isShowBack}`,
73 76
       });
74 77
     }
75 78
   };
@@ -97,76 +100,68 @@ const ProductList = forwardRef((props, ref) => {
97 100
       onAddProduct && onAddProduct(productId, index);
98 101
     }
99 102
   };
100
-  // 设置分享标题
101
-  const handleShareTitleChange = (newTitle) => {
102
-    setShareTitle(newTitle);
103
-  };
104
-  useEffect(() => {
105
-    if (shareModalOpened) {
106
-      // 设置分享内容
107
-      setShareContent({
108
-        title: shareTitle || currentShareProduct.item_title,
109
-        path: `/pages/indexSub/productDetail/index?id=${
110
-          currentShareProduct.id
111
-        }&&isShare=${true}&&shareJump=${shareLink}`,
112
-        imageUrl: currentShareProduct.image_url,
113
-      });
114
-    }
115
-  }, [shareTitle]);
116
-  // 埋点
117
-  const handleLog = (id) => {
118
-    if (!isDebounce(500)) return; // 如果在300ms内重复触发,直接返回
119
-    const dayid = formatDate(new Date(), "YYYY-MM-DD");
120
-    let userId = "";
121
-    if (Taro.getStorageSync("loginInfo")) {
122
-      userId = Taro.getStorageSync("loginInfo").id;
123
-    }
124
-    addLog({
125
-      event_type: "share_product_link",
126
-      event_type_title: "点击分享赚",
127
-      goods_id: Number(id),
128
-      ext: "",
129
-      dayid,
130
-      users_id: userId,
131
-    });
132
-  };
133 103
   // 分享商品
134
-  const shareProduct = (product, e) => {
104
+  const shareProduct = async (product, e) => {
105
+    if (!isDebounce(500)) return; // 如果在500ms内重复触发,直接返回
135 106
     e.stopPropagation(); // 防止事件穿透
136 107
     setCurrentShareProduct(product);
137
-    getShareJump({
138
-      share_type: 1,
139
-      share_id: product.id,
140
-    }).then((res) => {
141
-      // 打开分享弹窗
142
-      let shareUserId = "";
143
-      if (Taro.getStorageSync("loginInfo")) {
144
-        shareUserId = Taro.getStorageSync("loginInfo").id;
145
-      }
146
-      setShareContent({
147
-        title: shareTitle || product.item_title,
148
-        path: `/pages/indexSub/productDetail/index?id=${
149
-          product.id
150
-        }&&isShare=${true}&&shareJump=${
151
-          res.share_unique_value
152
-        }&&isHighCommission=${isHighCommission}&&isSeckill=${isSeckill}&&shareUserId=${shareUserId}`,
153
-        imageUrl: product.image_url,
154
-      });
155
-      setShareLink(res.share_unique_value);
156
-      setShareModalOpened(true);
157
-      if (isHighCommission || isSeckill) {
158
-        handleLog(product.id);
159
-      }
108
+    Taro.navigateTo({
109
+      url: `/pages/indexSub/sharePage/index?isSeckill=${isSeckill}&&tagTitle=${tagTitle}&&shareUserId=${shareUserId}&id=${product.id}`,
160 110
     });
111
+    // 埋点
112
+    if (isSeckill) {
113
+      handleLog({
114
+        event_type: "share_product_link",
115
+        event_type_title: "点击分享赚",
116
+        goods_id: product.id,
117
+      });
118
+    }
119
+    // getShareJump({
120
+    //   share_type: 1,
121
+    //   share_id: product.id,
122
+    // }).then((res) => {
123
+    //   // 打开分享弹窗
124
+    //   let shareUserId = "";
125
+    //   if (Taro.getStorageSync("loginInfo")) {
126
+    //     shareUserId = Taro.getStorageSync("loginInfo").id;
127
+    //   }
128
+    //   setShareContent({
129
+    //     title: shareTitle || product.item_title,
130
+    //     path: `/pages/indexSub/productDetail/index?id=${
131
+    //       product.id
132
+    //     }&&isShare=${true}&&shareJump=${
133
+    //       res.share_unique_value
134
+    //     }&&isSeckill=${isSeckill}&&shareUserId=${shareUserId}`,
135
+    //     imageUrl: product.image_url,
136
+    //   });
137
+    //   setShareLink(res.share_unique_value);
138
+    //   setShareModalOpened(true);
139
+    // });
161 140
   };
141
+  // 设置分享标题
142
+  // const handleShareTitleChange = (newTitle) => {
143
+  //   setShareTitle(newTitle);
144
+  // };
145
+  // useEffect(() => {
146
+  //   if (shareModalOpened) {
147
+  //     // 设置分享内容
148
+  //     setShareContent({
149
+  //       title: shareTitle || currentShareProduct.item_title,
150
+  //       path: `/pages/indexSub/productDetail/index?id=${
151
+  //         currentShareProduct.id
152
+  //       }&&isShare=${true}&&shareJump=${shareLink}`,
153
+  //       imageUrl: currentShareProduct.image_url,
154
+  //     });
155
+  //   }
156
+  // }, [shareTitle]);
162 157
   return (
163 158
     <View className="product-list-wrap">
164
-      {isSeckill && (
159
+      {/* {isSeckill && (
165 160
         <View className="seckill-icon">
166 161
           <Image src={seckillIcon} mode="aspectFit" />
167 162
           <Text>每日疯抢 限时秒杀</Text>
168 163
         </View>
169
-      )}
164
+      )} */}
170 165
       {productList.map((product, index) => (
171 166
         <View key={product.id}>
172 167
           <View onClick={() => toDetail(product.id)} className="product-item">
@@ -197,11 +192,7 @@ const ProductList = forwardRef((props, ref) => {
197 192
                   style={{ WebkitBoxOrient: "vertical" }}
198 193
                 >
199 194
                   <Text className="self-tag">
200
-                    {isSeckill
201
-                      ? "鱼市秒杀"
202
-                      : isHighCommission
203
-                      ? "高佣专项"
204
-                      : "自营"}
195
+                    {isSeckill ? tagTitle : "自营"}
205 196
                   </Text>
206 197
                   {product.item_title}
207 198
                 </View>
@@ -240,40 +231,55 @@ const ProductList = forwardRef((props, ref) => {
240 231
                     </View>
241 232
                   )}
242 233
                 </View>
243
-                <View className="profit-line">
244
-                  {Number(product.estimated_commission_buy) > 0 ? (
245
-                    <View className="save-money">
234
+                <View className={`profit-line ${isShare ? "flexEnd" : ""}`}>
235
+                  {!isShare ? (
236
+                    Number(product.estimated_commission_buy) > 0 ? (
237
+                      <View className="save-money">
238
+                        <Image
239
+                          className="bg"
240
+                          src={saveMoneyBg}
241
+                          mode="aspectFit"
242
+                        />
243
+                        <View className="content">
244
+                          <Text className="label">自购省</Text>
245
+                          <Text className="money">
246
+                            ¥{product.estimated_commission_buy}
247
+                          </Text>
248
+                        </View>
249
+                      </View>
250
+                    ) : (
251
+                      <View className="buy">
252
+                        <Image className="bg" src={buy} mode="aspectFit" />
253
+                        <View className="content">立 即 购 买</View>
254
+                      </View>
255
+                    )
256
+                  ) : (
257
+                    // 这里添加 isShare 为 true 时要显示的内容
258
+                    <View className="shareBuy">
259
+                      <Image className="bg" src={shareBuy} />
260
+                      <View className="content">立 即 购 买</View>
261
+                    </View>
262
+                  )}
263
+
264
+                  {!isShare && (
265
+                    <View className="share-earn">
246 266
                       <Image
247 267
                         className="bg"
248
-                        src={saveMoneyBg}
268
+                        src={shareEarnBg}
249 269
                         mode="aspectFit"
250 270
                       />
251 271
                       <View className="content">
252
-                        <Text className="label">自购省</Text>
253
-                        <Text className="money">
254
-                          ¥{product.estimated_commission_buy}
255
-                        </Text>
272
+                        <Button
273
+                          onClick={(e) => shareProduct(product, e)} // 传递事件对象
274
+                        >
275
+                          <Text className="label">分享赚</Text>
276
+                          <Text className="money">
277
+                            ¥{product.estimated_commission_promotion}
278
+                          </Text>
279
+                        </Button>
256 280
                       </View>
257 281
                     </View>
258
-                  ) : (
259
-                    <View className="buy">
260
-                      <Image className="bg" src={buy} mode="aspectFit" />
261
-                      <View className="content">立 即 购 买</View>
262
-                    </View>
263 282
                   )}
264
-                  <View className="share-earn">
265
-                    <Image className="bg" src={shareEarnBg} mode="aspectFit" />
266
-                    <View className="content">
267
-                      <Button
268
-                        onClick={(e) => shareProduct(product, e)} // 传递事件对象
269
-                      >
270
-                        <Text className="label">分享赚</Text>
271
-                        <Text className="money">
272
-                          ¥{product.estimated_commission_promotion}
273
-                        </Text>
274
-                      </Button>
275
-                    </View>
276
-                  </View>
277 283
                 </View>
278 284
               </View>
279 285
             </View>
@@ -295,7 +301,7 @@ const ProductList = forwardRef((props, ref) => {
295 301
       )}
296 302
       {isNoMore && !isEmpty && <View className="no-more">没有更多了~</View>}
297 303
       {/* 分享弹窗 */}
298
-      <ShareModal
304
+      {/* <ShareModal
299 305
         onClose={() => {
300 306
           setShareModalOpened(false);
301 307
           // 添加延时,等待关闭动画完成后再重置其他状态
@@ -308,14 +314,14 @@ const ProductList = forwardRef((props, ref) => {
308 314
         isOpened={shareModalOpened}
309 315
         product={currentShareProduct}
310 316
         onShareTitleChange={handleShareTitleChange}
311
-      />
317
+      /> */}
312 318
     </View>
313 319
   );
314 320
 });
315 321
 
316 322
 ProductList.defaultProps = {
317 323
   isSeckill: false,
318
-  isHighCommission: false,
324
+  tagTitle: "",
319 325
   productList: [],
320 326
   loading: false,
321 327
   isManagement: false,
@@ -325,6 +331,8 @@ ProductList.defaultProps = {
325 331
   isNoMore: false,
326 332
   shareUserId: "",
327 333
   isEmpty: false, // 是否为空
334
+  isShare: false, //分享
335
+  isShowBack: false, //是否显示返回
328 336
   onAddProduct: () => {}, // 添加商品方法
329 337
   onDeleteProductSelect: () => {}, // 删除商品选中id数组
330 338
 };

+ 33 - 3
src/components/index/ProductList/index.less

@@ -126,11 +126,12 @@
126 126
           }
127 127
         }
128 128
       }
129
-
129
+      .flexEnd{
130
+        justify-content: flex-end;
131
+      }
130 132
       .profit-line {
131 133
         display: flex;
132 134
         gap: 20px;
133
-
134 135
         .save-money {
135 136
           color: #F6C71A;
136 137
           // color: #F6C71A;
@@ -145,7 +146,8 @@
145 146
           //   text-align: center;
146 147
           // }
147 148
         }
148
-        .buy{
149
+
150
+        .buy {
149 151
           color: #F6C71A;
150 152
           display: flex;
151 153
           align-items: center;
@@ -161,6 +163,7 @@
161 163
             top: 0;
162 164
             left: 0;
163 165
           }
166
+
164 167
           .content {
165 168
             width: 74px;
166 169
             height: 80px;
@@ -169,6 +172,33 @@
169 172
             text-align: center;
170 173
           }
171 174
         }
175
+
176
+        .shareBuy {
177
+          color: #F6C71A;
178
+          display: flex;
179
+          align-items: center;
180
+          justify-content: center;
181
+          position: relative;
182
+          width: 60%;
183
+          height: 84px;
184
+          .bg {
185
+            width: 100%;
186
+            height: 100%;
187
+            position: absolute;
188
+            top: 0;
189
+            left: 0;
190
+          }
191
+
192
+          .content {
193
+            width: 100%;
194
+            height: 80px;
195
+            font-size: 30px;
196
+            text-align: center;
197
+            line-height: 80px;
198
+            letter-spacing:8px;
199
+          }
200
+        }
201
+
172 202
         .share-earn {
173 203
           color: #fff;
174 204
         }

+ 39 - 0
src/components/instructionModal/index.jsx

@@ -0,0 +1,39 @@
1
+import { View, Image, RichText } from "@tarojs/components";
2
+import "./index.less";
3
+
4
+// 签约模态框组件
5
+export default function instructionModal(props) {
6
+  const { isOpened, onClose, title, content } = props;
7
+  // 关闭弹窗
8
+  const closeModal = () => {
9
+    onClose();
10
+  };
11
+  return (
12
+    <>
13
+      {isOpened && (
14
+        <View className="modal-container">
15
+          <View className="modal-mask" />
16
+          <View className="modal-content">
17
+              {/* 背景图 */}
18
+              <Image
19
+                mode="widthFix"
20
+                src="https://yushi.tos-cn-beijing.volces.com/member/instructionBg.png"
21
+                className="instruction-bg"
22
+              />
23
+            <View className="content-box">
24
+              <View className="instruction-title">{title}</View>
25
+              <View className="instruction-content">
26
+                <RichText nodes={content} />
27
+              </View>
28
+            </View>
29
+            <View className="instruction-button-box">
30
+              <View onClick={closeModal} className="instruction-button">
31
+                我知道了
32
+              </View>
33
+            </View>
34
+          </View>
35
+        </View>
36
+      )}
37
+    </>
38
+  );
39
+}

+ 108 - 0
src/components/instructionModal/index.less

@@ -0,0 +1,108 @@
1
+.modal-container {
2
+  position: fixed;
3
+  top: 0;
4
+  left: 0;
5
+  width: 100%;
6
+  height: 100%;
7
+  z-index: 1000;
8
+  display: flex;
9
+  align-items: center;
10
+  justify-content: center;
11
+}
12
+
13
+.modal-mask {
14
+  position: absolute;
15
+  top: 0;
16
+  left: 0;
17
+  width: 100%;
18
+  height: 100%;
19
+  background-color: rgba(0, 0, 0, 0.6);
20
+}
21
+
22
+.modal-content {
23
+  position: relative;
24
+  background-color: #fff;
25
+  border-radius: 40px;
26
+  width: 80%;
27
+  max-width: 600px;
28
+  z-index: 1001;
29
+  animation: modalFadeIn 0.3s ease;
30
+  max-height: 90vh;
31
+  overflow: hidden;
32
+
33
+  // 背景图
34
+  .instruction-bg {
35
+    width: 100%;
36
+    height: 100%;
37
+    position: absolute;
38
+    top: 0;
39
+    left: 0;
40
+    z-index: -1;
41
+  }
42
+
43
+  .content-box {
44
+    max-height: 70vh;
45
+    padding: 54px 32px 148px 32px;
46
+    display: flex;
47
+    flex-direction: column;
48
+    align-items: center;
49
+    justify-content: flex-start;
50
+    position: relative;
51
+    overflow-y: auto;
52
+
53
+
54
+    .instruction-title {
55
+      font-weight: 700;
56
+      font-size: 32px;
57
+      color: #000000;
58
+    }
59
+
60
+    .instruction-content {
61
+      font-size: 28px;
62
+      color: #3D3D3D;
63
+      line-height: 41px;
64
+      margin-top: 28px;
65
+      padding: 0 39px;
66
+      box-sizing: border-box;
67
+      width: 100%;
68
+    }
69
+  }
70
+
71
+  .instruction-button-box {
72
+    position: absolute; // 绝对定位
73
+    bottom: 0; // 固定在底部
74
+    left: 0;
75
+    width: 100%;
76
+    display: flex;
77
+    justify-content: center;
78
+    align-items: center;
79
+    height: 110px;
80
+    background: #fff;
81
+  }
82
+
83
+  .instruction-button {
84
+    width: 272px;
85
+    height: 76px;
86
+    background: linear-gradient(270deg, #FF6E39 0%, #FF891B 100%);
87
+    border-radius: 121px 121px 121px 121px;
88
+    font-size: 30px;
89
+    color: #FFFFFF;
90
+    margin-top: 44px;
91
+    display: flex;
92
+    align-items: center;
93
+    justify-content: center;
94
+    margin: 0 auto;
95
+  }
96
+}
97
+
98
+@keyframes modalFadeIn {
99
+  from {
100
+    opacity: 0;
101
+    transform: scale(0.9);
102
+  }
103
+
104
+  to {
105
+    opacity: 1;
106
+    transform: scale(1);
107
+  }
108
+}

+ 1 - 2
src/components/signModal/index.jsx

@@ -3,7 +3,6 @@ import { getSign, getUserAgreement } from "../../service";
3 3
 import { AtCheckbox } from "taro-ui";
4 4
 import "./index.less";
5 5
 import Taro from "@tarojs/taro";
6
-import sign from "../../images/productDetail/sign.png";
7 6
 import close from "../../images/productDetail/close.png";
8 7
 import { useState, useEffect } from "react";
9 8
 
@@ -60,7 +59,7 @@ export default function signModal(props) {
60 59
           <View className="modal-content">
61 60
             <Image onClick={closeModal} src={close} className="close-icon" />
62 61
             <View className="content-box">
63
-              <Image src={sign} className="sign-icon" />
62
+              <Image src='https://yushi.tos-cn-beijing.volces.com/calculator/sign.png' className="sign-icon" />
64 63
               <View className="sign-title">
65 64
                 鱼市招募推广者!自购享折扣,省钱多多;分享有佣金,赚钱轻松。速来开启共赢之旅!
66 65
               </View>

BIN
src/images/calculator/IconThree.png


BIN
src/images/calculator/iconOne.png


BIN
src/images/calculator/iconTwo.png


BIN
src/images/calculator/more.png


BIN
src/images/calculator/toShare.png


BIN
src/images/calculator/wish.png


BIN
src/images/index/shareBuy.png


BIN
src/images/loginBg.png


BIN
src/images/member/calculator.png


BIN
src/images/mine/avatar.png


BIN
src/images/productDetail/selectStep.png


BIN
src/images/productDetail/sign.png


BIN
src/images/productDetail/stepThree.png


BIN
src/images/productDetail/xianyu.png


BIN
src/images/seckill/heighTop.jpg


BIN
src/images/seckill/seckillTop.jpg


+ 3 - 0
src/pages/calculatorSub/calculator/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '捡漏计算器'
3
+})

+ 95 - 0
src/pages/calculatorSub/calculator/index.jsx

@@ -0,0 +1,95 @@
1
+import { Component } from "react";
2
+import { View, Image, Text, Button } from "@tarojs/components";
3
+import { getCalculatorPartData } from "../../../service/activity";
4
+import "./index.less";
5
+import Taro from "@tarojs/taro";
6
+import more from "../../../images/calculator/more.png";
7
+import toShare from "../../../images/calculator/toShare.png";
8
+import wish from "../../../images/calculator/wish.png";
9
+export default class Index extends Component {
10
+  state = {
11
+    calculatorPartData: {},// 捡漏计算器部分数据
12
+  };
13
+  componentDidMount() {
14
+    this.getCalculatorPartData();// 获取捡漏计算器部分数据
15
+  }
16
+  // 去TA的捡漏心愿
17
+  toWishList = (id) => {
18
+    Taro.navigateTo({
19
+      url: `/pages/calculatorSub/calculatorWishList/index?id=${id}`,
20
+    });
21
+  };
22
+  // 去捡漏清单
23
+  calculatorInventory = () => {
24
+    Taro.navigateTo({
25
+      url: `/pages/calculatorSub/calculatorInventory/index`,
26
+    });
27
+  };
28
+  // 获取捡漏计算器部分数据
29
+  async getCalculatorPartData() {
30
+    const res = await getCalculatorPartData();
31
+    this.setState({
32
+      calculatorPartData: res.jianlou_list,
33
+    });
34
+  };
35
+  // 配置分享内容
36
+  onShareAppMessage(res) {
37
+    return {
38
+      title: "捡漏计算器",
39
+      path: `/pages/calculatorSub/calculatorWish/index?isShare=true`,
40
+      imageUrl: 'https://yushi.tos-cn-beijing.volces.com/calculator/shareImg.png',
41
+    }
42
+  }
43
+  render() {
44
+    const { calculatorPartData } = this.state;
45
+    return (
46
+      <View className="index">
47
+        {/* 顶部 */}
48
+        <View className="top-box">
49
+          <Image className="top-img" src='https://yushi.tos-cn-beijing.volces.com/calculator/topImg.png' />
50
+          <View className="button-box">
51
+            <Image className="button-icon" src='https://yushi.tos-cn-beijing.volces.com/calculator/button.png' />
52
+            <View className="button-text-box">
53
+              <Button openType="share">
54
+                <Text className="button-text">去分享</Text>
55
+                <Image className="to-share-icon" src={toShare} />
56
+              </Button>
57
+            </View>
58
+          </View>
59
+        </View>
60
+        {/* 底部 */}
61
+        <View className="bottom-box">
62
+          <Image mode="heightFix" className="bg-img" src='https://yushi.tos-cn-beijing.volces.com/calculator/bottomImg.png' />
63
+          <View className="content-box">
64
+            <View className="content-title">
65
+              <Image className="wish-icon" src={wish} />
66
+              <Text className="title-text">计算结果</Text>
67
+            </View>
68
+            {/* 列表 */}
69
+            <View className="list-box">
70
+              {calculatorPartData.length > 0 && calculatorPartData.map((item, index) => (
71
+                <View key={index} className="list-item">
72
+                  <View className="list-item-left">
73
+                    <Image className="avatar" src={item.icon} />
74
+                  <View className="list-item-left-text">
75
+                    <Text className="name">{item.name}</Text>
76
+                    <Text className="wishNum">{item.activity_jianlou_cnt}次捡漏许愿</Text>
77
+                  </View>
78
+                </View>
79
+                <View onClick={() => this.toWishList(item.id)} className="list-item-right">
80
+                  查看
81
+                </View>
82
+                </View>
83
+              ))}
84
+            </View>
85
+          </View>
86
+          {/* 查看全部 */}
87
+          <View onClick={this.calculatorInventory} className="all-box">
88
+            <Text className="all-text">查看全部</Text>
89
+            <Image className="all-icon" src={more} />
90
+          </View>
91
+        </View>
92
+      </View>
93
+    );
94
+  }
95
+}

+ 203 - 0
src/pages/calculatorSub/calculator/index.less

@@ -0,0 +1,203 @@
1
+.index {
2
+    // 顶部
3
+    .top-box {
4
+        position: relative;
5
+
6
+        // 顶部图片
7
+        .top-img {
8
+            width: 100%;
9
+            height: 492px;
10
+        }
11
+
12
+        // 按钮
13
+        .button-box {
14
+            position: absolute;
15
+            top: 316px;
16
+            left: 50%;
17
+            transform: translateX(-50%);
18
+
19
+            .button-icon {
20
+                width: 324px;
21
+                height: 107px;
22
+            }
23
+
24
+            .button-text-box {
25
+                position: absolute;
26
+                top: 26px;
27
+                left: 50%;
28
+                transform: translateX(-50%);
29
+                font-weight: 700;
30
+                font-size: 32px;
31
+                color: #fff;
32
+                display: flex;
33
+                align-items: center;
34
+                justify-content: center;
35
+                width: 100%;
36
+                z-index: 999;
37
+                .button-text {
38
+                    margin-right: 10px;
39
+                }
40
+
41
+                .to-share-icon {
42
+                    width: 44px;
43
+                    height: 30px;
44
+                }
45
+            }
46
+        }
47
+    }
48
+
49
+    // 底部
50
+    .bottom-box {
51
+        width: 100%;
52
+        min-height: calc(100vh - 442px);
53
+        margin-top: -50px;
54
+        border-radius: 30px 30px 0 0;
55
+        z-index: 100;
56
+        position: relative;
57
+        overflow: hidden;
58
+        padding: 52px 0;
59
+        box-sizing: border-box;
60
+
61
+        .bg-img {
62
+            width: 100% !important;
63
+            height: 100%;
64
+            position: absolute;
65
+            top: 0;
66
+            left: 0;
67
+            z-index: -1;
68
+        }
69
+
70
+        .content-box {
71
+            width: 100%;
72
+            height: 100%;
73
+
74
+            .content-title {
75
+                display: flex;
76
+                align-items: center;
77
+                justify-content: center;
78
+
79
+                .wish-icon {
80
+                    width: 34px;
81
+                    height: 34px;
82
+                    margin-right: 10px;
83
+                }
84
+
85
+                .title-text {
86
+                    font-weight: 700;
87
+                    font-size: 32px;
88
+                    color: #000000;
89
+                }
90
+            }
91
+
92
+            // 列表
93
+            .list-box {
94
+                width: 100%;
95
+                height: 100%;
96
+                margin-top: 36px;
97
+                padding: 0 51px;
98
+                box-sizing: border-box;
99
+
100
+                .list-item {
101
+                    width: 100%;
102
+                    display: flex;
103
+                    align-items: center;
104
+                    justify-content: space-between;
105
+                    margin-bottom: 20px;
106
+
107
+                    .list-item-left {
108
+                        display: flex;
109
+                        align-items: center;
110
+
111
+                        .avatar {
112
+                            width: 130px;
113
+                            height: 130px;
114
+                            border-radius: 50%;
115
+                            margin-right: 20px;
116
+                        }
117
+
118
+                        .list-item-left-text {
119
+                            display: flex;
120
+                            flex-direction: column;
121
+
122
+                            .name {
123
+                                font-weight: 700;
124
+                                font-size: 28px;
125
+                                color: #000000;
126
+                                width: 380px;
127
+                                overflow: hidden;
128
+                                text-overflow: ellipsis;
129
+                                white-space: nowrap;
130
+                            }
131
+
132
+                            .wishNum {
133
+                                font-weight: 500;
134
+                                font-size: 24px;
135
+                                color: #FC8C31;
136
+                                margin-top: 16px;
137
+                            }
138
+                        }
139
+                    }
140
+
141
+                    .list-item-right {
142
+                        display: flex;
143
+                        align-items: center;
144
+                        justify-content: center;
145
+                        width: 112px;
146
+                        height: 64px;
147
+                        background: linear-gradient(270deg, #FFBD4B 0%, #F3802E 100%);
148
+                        border-radius: 62px 62px 62px 62px;
149
+                        font-weight: 700;
150
+                        font-size: 28px;
151
+                        color: #FFFFFF;
152
+                    }
153
+                }
154
+            }
155
+        }
156
+    }
157
+
158
+    // 查看全部
159
+    .all-box {
160
+        display: flex;
161
+        align-items: center;
162
+        justify-content: center;
163
+        margin-top: 34px;
164
+
165
+        .all-text {
166
+            font-weight: 500;
167
+            font-size: 24px;
168
+            color: #999999;
169
+        }
170
+
171
+        .all-icon {
172
+            width: 25px;
173
+            height: 21px;
174
+            margin-left: 10px;
175
+        }
176
+    }
177
+
178
+    // 清除Button默认样式
179
+    Button {
180
+        padding: 0;
181
+        margin: 0;
182
+        background: none;
183
+        border: none;
184
+        line-height: normal;
185
+        height: 100%;
186
+        width: 100%;
187
+        display: flex;
188
+        align-items: center;
189
+        justify-content: center;
190
+        font-size: 32px;
191
+        color: #FFFFFF;
192
+        &::after {
193
+            border: none;
194
+        }
195
+    }
196
+
197
+    .button-hover {
198
+        background-color: transparent !important;
199
+        /* 移除背景高亮 */
200
+        box-shadow: none !important;
201
+        /* 移除可能的阴影 */
202
+    }
203
+}

+ 3 - 0
src/pages/calculatorSub/calculatorInventory/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '捡漏清单'
3
+})

+ 76 - 0
src/pages/calculatorSub/calculatorInventory/index.jsx

@@ -0,0 +1,76 @@
1
+import { Component } from "react";
2
+import { View, Image, Text } from "@tarojs/components";
3
+import "./index.less";
4
+import Taro from "@tarojs/taro";
5
+import { getCalculatorList } from "../../../service/activity";
6
+export default class Index extends Component {
7
+  state = {
8
+    inventoryList: [],
9
+    page: 1, // 添加页码
10
+    totalPages: 1, // 添加总页数
11
+    loading: false, // 添加加载状态
12
+  };
13
+  componentDidMount() {
14
+    this.getCalculatorList(true); // 获取捡漏清单
15
+  }
16
+  // 获取捡漏清单
17
+  getCalculatorList = async (isRefresh) => {
18
+    this.setState({ loading: true });
19
+    const res = await getCalculatorList({
20
+      page: this.state.page,
21
+      page_size: 10,
22
+    });
23
+    this.setState({
24
+      inventoryList: isRefresh
25
+        ? res.jianlou_list
26
+        : [...this.state.inventoryList, ...res.jianlou_list],
27
+      totalPages: res.total_pages,
28
+      loading: false,
29
+    });
30
+  }
31
+  // 查看心愿列表
32
+  toWishList = (id) => {
33
+    Taro.navigateTo({
34
+      url: `/pages/calculatorSub/calculatorWishList/index?id=${id}`,
35
+    });
36
+  };
37
+  // 页面上拉触底
38
+  onReachBottom = () => {
39
+    const { page, totalPages, loading } = this.state;
40
+    if (page < totalPages && !loading) {
41
+      this.setState(
42
+        (prevState) => ({ page: prevState.page + 1 }),
43
+        () => this.getCalculatorList(false)
44
+      );
45
+    }
46
+  };
47
+  render() {
48
+    return (
49
+      <View className="index">
50
+        {/* 列表 */}
51
+        <View className="list-box">
52
+          {this.state.inventoryList.length > 0 &&
53
+            this.state.inventoryList.map((item, index) => (
54
+              <View key={index} className="list-item">
55
+                <View className="list-item-left">
56
+                  <Image className="avatar" src={item.icon} />
57
+                  <View className="list-item-left-text">
58
+                    <Text className="name">{item.name}</Text>
59
+                    <Text className="wishNum">
60
+                      {item.activity_jianlou_cnt}次捡漏许愿
61
+                    </Text>
62
+                  </View>
63
+                </View>
64
+                <View
65
+                  onClick={() => this.toWishList(item.id)}
66
+                  className="list-item-right"
67
+                >
68
+                  查看
69
+                </View>
70
+              </View>
71
+            ))}
72
+        </View>
73
+      </View>
74
+    );
75
+  }
76
+}

+ 68 - 0
src/pages/calculatorSub/calculatorInventory/index.less

@@ -0,0 +1,68 @@
1
+.index {
2
+    padding-top: 58px;
3
+    box-sizing: border-box;
4
+
5
+    // 列表
6
+    .list-box {
7
+        width: 100%;
8
+        height: 100%;
9
+        margin-top: 36px;
10
+        padding: 0 51px;
11
+        box-sizing: border-box;
12
+
13
+        .list-item {
14
+            width: 100%;
15
+            display: flex;
16
+            align-items: center;
17
+            justify-content: space-between;
18
+            margin-bottom: 20px;
19
+
20
+            .list-item-left {
21
+                display: flex;
22
+                align-items: center;
23
+
24
+                .avatar {
25
+                    width: 130px;
26
+                    height: 130px;
27
+                    border-radius: 50%;
28
+                    margin-right: 20px;
29
+                }
30
+
31
+                .list-item-left-text {
32
+                    display: flex;
33
+                    flex-direction: column;
34
+
35
+                    .name {
36
+                        font-weight: 700;
37
+                        font-size: 28px;
38
+                        color: #000000;
39
+                        width: 380px;
40
+                        overflow: hidden;
41
+                        text-overflow: ellipsis;
42
+                        white-space: nowrap;
43
+                    }
44
+
45
+                    .wishNum {
46
+                        font-weight: 500;
47
+                        font-size: 24px;
48
+                        color: #FC8C31;
49
+                        margin-top: 16px;
50
+                    }
51
+                }
52
+            }
53
+
54
+            .list-item-right {
55
+                display: flex;
56
+                align-items: center;
57
+                justify-content: center;
58
+                width: 112px;
59
+                height: 64px;
60
+                background: linear-gradient(270deg, #FFBD4B 0%, #F3802E 100%);
61
+                border-radius: 62px 62px 62px 62px;
62
+                font-weight: 700;
63
+                font-size: 28px;
64
+                color: #FFFFFF;
65
+            }
66
+        }
67
+    }
68
+}

+ 3 - 0
src/pages/calculatorSub/calculatorResult/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '捡漏计算器'
3
+})

+ 130 - 0
src/pages/calculatorSub/calculatorResult/index.jsx

@@ -0,0 +1,130 @@
1
+import { Component } from "react";
2
+import { View, Image, Text } from "@tarojs/components";
3
+import "./index.less";
4
+import Taro from "@tarojs/taro";
5
+export default class Index extends Component {
6
+  state = {
7
+    isSearch: 1,// 是否计算成功
8
+    list: [],// 列表
9
+    wish: '',// 心愿
10
+    price: '',// 价格
11
+  };
12
+  componentDidMount() {
13
+    let { isSearch, list, wish, price } = Taro.getCurrentInstance().router.params;
14
+    this.setState({
15
+      isSearch,
16
+      list: JSON.parse(decodeURIComponent(list)),
17
+      wish,
18
+      price,
19
+    });
20
+  }
21
+  // 再次捡漏
22
+  handleAgain = () => {
23
+    Taro.navigateBack();
24
+  }
25
+  // 去捡漏清单
26
+  toCalculatorInventory = (id) => {
27
+    Taro.navigateTo({
28
+      url: `/pages/calculatorSub/calculatorInventory/index?id=${id}&&isShare=true`,
29
+    });
30
+  }
31
+  // 精选推荐
32
+  handleGoodRecommend = (id) => {
33
+    Taro.navigateTo({
34
+      url: `/pages/indexSub/productDetail/index?id=${id}&&isShare=true`,
35
+    });
36
+  }
37
+  render() {
38
+    const { isSearch, list, wish, price } = this.state;
39
+    return (
40
+      <View className="index">
41
+        {/* 顶部盒子 */}
42
+        <View className="top-box">
43
+          <Image
44
+            className="top-img"
45
+            src={isSearch == 1 ? "https://yushi.tos-cn-beijing.volces.com/calculator/resultImg.png" : "https://yushi.tos-cn-beijing.volces.com/calculator/failResult.png"}
46
+          />
47
+          {/* 捡漏产品 */}
48
+          <View className="calculator-info">
49
+            <View className="title-box">
50
+              <Text className="title-text-left">您想要的:</Text>
51
+              <Text className="title-text">{wish}</Text>
52
+            </View>
53
+            <View className="title-box">
54
+              <Text className="title-text-left">期望花费:</Text>
55
+              <Text className="title-text">{price}元</Text>
56
+            </View>
57
+          </View>
58
+          {/* 首选推荐产品 */}
59
+          <View className="first-recommend">
60
+            <View className="first-recommend-title">
61
+              <Image
62
+                className="first-recommend-title-img"
63
+                src="https://yushi.tos-cn-beijing.volces.com/calculator/recommend.png"
64
+              />
65
+              <Text className="first-recommend-title-text">首选推荐</Text>
66
+            </View>
67
+            <View className="first-recommend-content">
68
+              {list.length > 0 && (
69
+                <View className="product-info" onClick={() => this.handleGoodRecommend(list[0].id)}>
70
+                  <Image
71
+                    className="product-avatar"
72
+                    mode="aspectFill"
73
+                    src={list[0].image_url}
74
+                  />
75
+                  <View className="product-detail">
76
+                    <Text className="product-title">{list[0].item_title}</Text>
77
+                    <View className="price-box">
78
+                      <Text className="current-price">{list[0].reserve_price}</Text>
79
+                      {list[0].original_price != 0 && (
80
+                        <Text className="original-price">¥{list[0].original_price}</Text>
81
+                      )}
82
+                    </View>
83
+                  </View>
84
+                </View>
85
+              )}
86
+            </View>
87
+            {/* 再次捡漏 */}
88
+            <View onClick={this.handleAgain} className="first-recommend-button">
89
+              <Image
90
+                className="first-recommend-button-img"
91
+                src="https://yushi.tos-cn-beijing.volces.com/calculator/resultButton.png"
92
+              />
93
+              <Text className="first-recommend-button-text">再次捡漏</Text>
94
+            </View>
95
+          </View>
96
+        </View>
97
+        {/* 精选推荐列表 */}
98
+        <View className="good-recommend-content">
99
+          <View className="good-recommend-list-title">
100
+            <Image
101
+              className="good-recommend-list-title-img"
102
+              src="https://yushi.tos-cn-beijing.volces.com/calculator/recommendIcon.png"
103
+            />
104
+            <Text className="good-recommend-list-title-text">精选推荐</Text>
105
+          </View>
106
+          {/* 精选推荐列表内容 */}
107
+          <View className="good-recommend-list">
108
+            {list.length > 1 && list.slice(1, 7).map((item, index) => (
109
+              <View onClick={() => this.handleGoodRecommend(item.id)} key={index} className="good-recommend-list-item">
110
+                <Image
111
+                  mode="aspectFill"
112
+                  className="item-image"
113
+                  src={item.image_url}
114
+                />
115
+                <Text className="item-title">{item.item_title}</Text>
116
+                <View className="item-price">
117
+                  <Text className="price-symbol">¥</Text>
118
+                  <Text className="current-price">{item.reserve_price}</Text>
119
+                  {item.original_price != 0 && (
120
+                    <Text className="original-price">¥{item.original_price}</Text>
121
+                  )}
122
+                </View>
123
+              </View>
124
+            ))}
125
+          </View>
126
+        </View>
127
+      </View>
128
+    );
129
+  }
130
+}

+ 273 - 0
src/pages/calculatorSub/calculatorResult/index.less

@@ -0,0 +1,273 @@
1
+.index {
2
+    padding-top: 28px;
3
+    box-sizing: border-box;
4
+    background-color: #f4f4f4;
5
+    min-height: 100vh;
6
+
7
+    .top-box {
8
+        margin: 0 24px;
9
+        box-sizing: border-box;
10
+        position: relative;
11
+        background: #fff;
12
+        border-radius: 40px;
13
+        background-color: #faefe2;
14
+
15
+        &::before {
16
+            content: '';
17
+            position: absolute;
18
+            inset: 0;
19
+            padding: 10px;
20
+            background: linear-gradient(45deg, #f6dc65, #e87d3a);
21
+            border-radius: 40px;
22
+            -webkit-mask:
23
+                linear-gradient(#fff 0 0) content-box,
24
+                linear-gradient(#fff 0 0);
25
+            -webkit-mask-composite: xor;
26
+            mask-composite: exclude;
27
+            pointer-events: none;
28
+        }
29
+
30
+        .top-img {
31
+            width: 682px;
32
+            height: 608px;
33
+        }
34
+
35
+        // 期望花费
36
+        .calculator-info {
37
+            position: absolute;
38
+            top: 93px;
39
+            left: 266px;
40
+
41
+            .title-box {
42
+                display: flex;
43
+                align-items: center;
44
+
45
+                .title-text-left {
46
+                    font-size: 22px;
47
+                    color: #444444;
48
+                    margin-right: 6px;
49
+                }
50
+
51
+                .title-text {
52
+                    font-weight: 700;
53
+                    font-size: 30px;
54
+                    color: #000;
55
+                    width: 340px;
56
+                    overflow: hidden;
57
+                    text-overflow: ellipsis;
58
+                    display: -webkit-box;
59
+                    -webkit-box-orient: vertical;
60
+                    -webkit-line-clamp: 2;
61
+                    word-break: break-all;
62
+                }
63
+            }
64
+        }
65
+
66
+        // 首选推荐产品
67
+        .first-recommend {
68
+            position: absolute;
69
+            top: 210px;
70
+            left: 50%;
71
+            transform: translateX(-50%);
72
+            width: 642px;
73
+            height: 378px;
74
+            background-color: #fcdcb6;
75
+            border-radius: 40px;
76
+            display: flex;
77
+            flex-direction: column;
78
+            align-items: center;
79
+            padding: 20px 40px 0 24px;
80
+            box-sizing: border-box;
81
+
82
+            .first-recommend-title {
83
+                display: flex;
84
+                align-items: center;
85
+                font-weight: 700;
86
+                font-size: 30px;
87
+                color: #000000;
88
+
89
+                .first-recommend-title-img {
90
+                    width: 43px;
91
+                    height: 30px;
92
+                }
93
+            }
94
+        }
95
+
96
+        // 产品信息
97
+
98
+        .first-recommend-content {
99
+            width: 100%;
100
+
101
+            .product-info {
102
+                display: flex;
103
+                padding: 20px;
104
+                align-items: center;
105
+                width: 100%;
106
+                height: 146px;
107
+
108
+                .product-avatar {
109
+                    width: 146px;
110
+                    height: 146px;
111
+                    border-radius: 20px;
112
+                    margin-right: 12px;
113
+                }
114
+
115
+                .product-detail {
116
+                    flex: 1;
117
+                    height: 100%;
118
+                    display: flex;
119
+                    flex-direction: column;
120
+                    justify-content: space-between;
121
+                    padding-bottom: 13px;
122
+                    box-sizing: border-box;
123
+
124
+                    .product-title {
125
+                        font-size: 28px;
126
+                        color: #000000;
127
+                        margin-bottom: 16px;
128
+                        display: -webkit-box;
129
+                        -webkit-box-orient: vertical;
130
+                        -webkit-line-clamp: 2;
131
+                        overflow: hidden;
132
+                        text-overflow: ellipsis;
133
+                    }
134
+
135
+                    .price-box {
136
+                        display: flex;
137
+                        align-items: center;
138
+
139
+                        .current-price {
140
+                            font-size: 32px;
141
+                            color: #FF4B4B;
142
+                            font-weight: bold;
143
+                            margin-right: 16px;
144
+
145
+                            &::before {
146
+                                content: '¥';
147
+                                font-size: 22px;
148
+                            }
149
+                        }
150
+
151
+                        .original-price {
152
+                            font-size: 22px;
153
+                            color: #ABABAB;
154
+                            line-height: 32px;
155
+                            text-decoration: line-through;
156
+                        }
157
+                    }
158
+                }
159
+            }
160
+        }
161
+
162
+        // 再次捡漏
163
+        .first-recommend-button {
164
+            width: 273px;
165
+            height: 111px;
166
+            display: flex;
167
+            align-items: center;
168
+            justify-content: center;
169
+            margin-top: 11px;
170
+            position: relative;
171
+
172
+            .first-recommend-button-img {
173
+                position: absolute;
174
+                top: 0;
175
+                left: 0;
176
+                width: 100%;
177
+                height: 100%;
178
+                z-index: 1;
179
+            }
180
+
181
+            .first-recommend-button-text {
182
+                font-weight: 700;
183
+                font-size: 28px;
184
+                color: #FFFFFF;
185
+                z-index: 2;
186
+                margin-bottom: 18px;
187
+            }
188
+        }
189
+    }
190
+
191
+    // 精选推荐
192
+    .good-recommend-content {
193
+        margin-top: 32px;
194
+        padding: 40px 26px 0 26px;
195
+        box-sizing: border-box;
196
+        display: flex;
197
+        flex-direction: column;
198
+        align-items: center;
199
+        background-color: #fff;
200
+        border-radius: 30px 30px 0 0;
201
+
202
+        .good-recommend-list-title {
203
+            display: flex;
204
+            align-items: center;
205
+            font-weight: 700;
206
+            font-size: 36px;
207
+            color: #000000;
208
+            margin-bottom: 30px;
209
+
210
+            .good-recommend-list-title-img {
211
+                width: 34px;
212
+                height: 34px;
213
+                margin-right: 12px;
214
+            }
215
+        }
216
+        // 列表
217
+        .good-recommend-list {
218
+            display: flex;
219
+            flex-wrap: wrap;
220
+            gap: 19px;
221
+            padding: 0 16px;
222
+            width: 100%;
223
+            .good-recommend-list-item {
224
+                width: calc((100% - 38px) / 3); // 确保一行显示3个商品,中间间隔19px
225
+                display: flex;
226
+                flex-direction: column;
227
+                margin-bottom: 40px;
228
+                .item-image {
229
+                    width: 220px;
230
+                    height: 213px;
231
+                    border-radius: 20px 20px 0 0;
232
+                }
233
+
234
+                .item-title {
235
+                    font-size: 18px;
236
+                    color: #000000;
237
+                    line-height: 33px;
238
+                    height: 60px;
239
+                    display: -webkit-box;
240
+                    -webkit-box-orient: vertical;
241
+                    -webkit-line-clamp: 2;
242
+                    overflow: hidden;
243
+                    text-overflow: ellipsis;
244
+                }
245
+
246
+                .item-price {
247
+                    margin-top: 4px;
248
+                    display: flex;
249
+                    align-items: baseline;
250
+
251
+                    .price-symbol {
252
+                        font-size: 20px;
253
+                        color: #FF1D17;
254
+                    }
255
+
256
+                    .current-price {
257
+                        font-size: 30px;
258
+                        font-weight: bold;
259
+                        color: #FF1D17;
260
+                        margin-right: 4px;
261
+                    }
262
+
263
+                    .original-price {
264
+                        font-size: 14px;
265
+                        color: #ABABAB;
266
+                        line-height: 20px;
267
+                        text-decoration: line-through;
268
+                    }
269
+                }
270
+            }
271
+        }
272
+    }
273
+}

+ 3 - 0
src/pages/calculatorSub/calculatorWish/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '捡漏计算器'
3
+})

+ 159 - 0
src/pages/calculatorSub/calculatorWish/index.jsx

@@ -0,0 +1,159 @@
1
+import { Component } from "react";
2
+import { View, Image, Text, Input } from "@tarojs/components";
3
+import Taro from "@tarojs/taro";
4
+import "./index.less";
5
+import iconOne from "../../../images/calculator/iconOne.png";
6
+import iconTwo from "../../../images/calculator/iconTwo.png";
7
+import iconThree from "../../../images/calculator/iconThree.png";
8
+import {
9
+  getCalculatorData,
10
+  getCalculatorSearch,
11
+} from "../../../service/activity";
12
+export default class Index extends Component {
13
+  state = {
14
+    wishList: [],
15
+    wish: "", // 心愿
16
+    price: "", // 价格
17
+  };
18
+  componentDidMount() {
19
+    this.getCalculator(); // 计算捡漏
20
+  }
21
+  // 计算捡漏
22
+  getCalculator = async () => {
23
+    const res = await getCalculatorData();
24
+    this.setState({
25
+      wishList: res,
26
+    });
27
+  };
28
+  // 搜索捡漏
29
+  getCalculatorSearch = async () => {
30
+    if (!this.state.wish.trim()) {
31
+      Taro.showToast({
32
+        title: "请输入您想要捡漏的物品或服务",
33
+        icon: "none",
34
+      });
35
+      return;
36
+    }
37
+    if (!this.state.price.trim()) {
38
+      Taro.showToast({
39
+        title: "请输入您预期的价格",
40
+        icon: "none",
41
+      });
42
+      return;
43
+    }
44
+    Taro.showLoading({
45
+      title: "正在计算...",
46
+    });
47
+    try {
48
+      const res = await getCalculatorSearch({
49
+        keyword: this.state.wish,
50
+        money: this.state.price,
51
+      });
52
+      Taro.navigateTo({
53
+        url: `/pages/calculatorSub/calculatorResult/index?isSearch=${
54
+          res.is_search
55
+        }&&list=${encodeURIComponent(JSON.stringify(res.goods_list))}&&wish=${this.state.wish}&&price=${this.state.price}`,
56
+      });
57
+    } finally {
58
+      Taro.hideLoading();
59
+    }
60
+  };
61
+  // 心愿输入框改变
62
+  handleWishChange = (e) => {
63
+    this.setState({
64
+      wish: e.detail.value,
65
+    });
66
+  };
67
+  // 价格输入框改变
68
+  handlePriceChange = (e) => {
69
+    if (e.detail.value < 1 && e.detail.value.trim() !== "") {
70
+      e.detail.value = 1;
71
+    }
72
+    this.setState({
73
+      price: e.detail.value,
74
+    });
75
+  };
76
+  render() {
77
+    return (
78
+      <View className="index">
79
+        <Image
80
+          className="top-img"
81
+          src="https://yushi.tos-cn-beijing.volces.com/calculator/wishTopImg.png"
82
+        />
83
+        {/* 底部 */}
84
+        <View className="bottom-box">
85
+          <Image
86
+            mode="heightFix"
87
+            className="bg-img"
88
+            src="https://yushi.tos-cn-beijing.volces.com/calculator/bottomImg.png"
89
+          />
90
+          {/* 输入内容区域 */}
91
+          <View className="input-box">
92
+            <View className="input-box-title">
93
+              <Image className="title-icon" src={iconOne} />
94
+              <Text className="title-text">您想要的物品或服务</Text>
95
+            </View>
96
+            <View className="input-box-content">
97
+              <View className="input-box-content-box">
98
+                <Input
99
+                  value={this.state.wish}
100
+                  onInput={this.handleWishChange}
101
+                  className="input-box-content-input"
102
+                  placeholder="请详细描述需求"
103
+                />
104
+              </View>
105
+              <View className="input-box-content-text">
106
+                例: 输入机票不如输入从深圳到北京的机票
107
+              </View>
108
+            </View>
109
+          </View>
110
+          <View className="input-box">
111
+            <View className="input-box-title">
112
+              <Image className="title-icon" src={iconTwo} />
113
+              <Text className="title-text">您预期的价格</Text>
114
+            </View>
115
+            <View className="input-box-content">
116
+              <View className="input-box-content-box">
117
+                <Input
118
+                  value={this.state.price}
119
+                  onInput={this.handlePriceChange}
120
+                  type="number"
121
+                  min="1"
122
+                  className="input-box-content-input"
123
+                  placeholder="价格最低不能少于1元"
124
+                />
125
+              </View>
126
+              <View className="input-box-content-text">
127
+                注意:我们是认真的!
128
+              </View>
129
+            </View>
130
+          </View>
131
+          <View onClick={this.getCalculatorSearch} className="button-box">
132
+            <Image
133
+              className="button-icon"
134
+              src="https://yushi.tos-cn-beijing.volces.com/calculator/buttonTwo.png"
135
+            />
136
+            <View className="button-text-box">
137
+              <Text className="button-text">捡漏计算</Text>
138
+            </View>
139
+          </View>
140
+          {/* 底部捡漏列表 */}
141
+          <View className="bottom-list-box">
142
+            <View className="bottom-list-box-title">
143
+              <Image className="title-icon" src={iconThree} />
144
+              <Text className="title-text">TA们捡了哪些漏</Text>
145
+            </View>
146
+            <View className="bottom-list-box-content">
147
+              {this.state.wishList.length > 0 &&
148
+                this.state.wishList.map((item, index) => (
149
+                  <View key={index} className="bottom-list-box-content-item">
150
+                    TA想要“{item.jianlou_title}”,捡漏{item.reserve_price}元
151
+                  </View>
152
+                ))}
153
+            </View>
154
+          </View>
155
+        </View>
156
+      </View>
157
+    );
158
+  }
159
+}

+ 172 - 0
src/pages/calculatorSub/calculatorWish/index.less

@@ -0,0 +1,172 @@
1
+.index {
2
+    .top-img {
3
+        width: 100%;
4
+        height: 668px;
5
+    }
6
+
7
+    // 底部
8
+    .bottom-box {
9
+        width: 100%;
10
+        min-height: calc(100vh - 550px);
11
+        margin-top: -118px;
12
+        border-radius: 30px 30px 0 0;
13
+        z-index: 100;
14
+        position: relative;
15
+        overflow: hidden;
16
+        padding: 41px 0;
17
+        box-sizing: border-box;
18
+        display: flex;
19
+        flex-direction: column;
20
+        align-items: center;
21
+
22
+        .bg-img {
23
+            width: 100% !important;
24
+            height: 100%;
25
+            position: absolute;
26
+            top: 0;
27
+            left: 0;
28
+            z-index: -1;
29
+        }
30
+
31
+        // 输入内容区域
32
+        .input-box {
33
+            width: 100%;
34
+            height: 100%;
35
+            padding: 0 96px;
36
+            box-sizing: border-box;
37
+            margin-bottom: 20px;
38
+            display: flex;
39
+            flex-direction: column;
40
+            align-items: center;
41
+            justify-content: center;
42
+
43
+            .input-box-title {
44
+                width: 100%;
45
+                display: flex;
46
+                align-items: center;
47
+                justify-content: center;
48
+                margin-bottom: 13px;
49
+
50
+                .title-icon {
51
+                    width: 50px;
52
+                    height: 48px;
53
+                    margin-right: 10px;
54
+                }
55
+
56
+                .title-text {
57
+                    font-weight: 600;
58
+                    font-size: 32px;
59
+                    color: #D2202B;
60
+                }
61
+            }
62
+
63
+            // 输入内容
64
+            .input-box-content {
65
+                width: 100%;
66
+
67
+                .input-box-content-box {
68
+                    border: 10px solid #e87d3a;
69
+                    box-sizing: border-box;
70
+                    border-radius: 30px;
71
+                    overflow: hidden;
72
+                }
73
+
74
+                .input-box-content-input {
75
+                    width: 100%;
76
+                    height: 80px;
77
+                    background: #FFFFFF;
78
+                    text-align: center;
79
+                    font-weight: 350;
80
+                    font-size: 26px;
81
+                    padding: 0 20px;
82
+                    box-sizing: border-box;
83
+                }
84
+
85
+                .input-box-content-text {
86
+                    font-weight: 500;
87
+                    font-size: 22px;
88
+                    color: #444444;
89
+                    margin-top: 12px;
90
+                }
91
+            }
92
+        }
93
+
94
+        // 按钮
95
+        .button-box {
96
+            width: 452px;
97
+            height: 156px;
98
+            margin-top: 30px;
99
+            position: relative;
100
+
101
+            .button-icon {
102
+                position: absolute;
103
+                top: 0;
104
+                left: 0;
105
+                width: 100%;
106
+                height: 100%;
107
+            }
108
+
109
+            .button-text-box {
110
+                position: absolute;
111
+                top: 34px;
112
+                left: 50%;
113
+                transform: translateX(-50%);
114
+                font-weight: 700;
115
+                font-size: 32px;
116
+                color: #FFFFFF;
117
+                line-height: 46px;
118
+            }
119
+        }
120
+
121
+        // 底部捡漏列表
122
+        .bottom-list-box {
123
+            width: 100%;
124
+            height: 100%;
125
+            padding: 0 50px;
126
+            box-sizing: border-box;
127
+            margin-top: 44px;
128
+            display: flex;
129
+            flex-direction: column;
130
+            align-items: center;
131
+
132
+            .bottom-list-box-title {
133
+                width: 100%;
134
+                display: flex;
135
+                align-items: center;
136
+                justify-content: center;
137
+                margin-bottom: 30px;
138
+
139
+                .title-icon {
140
+                    width: 46px;
141
+                    height: 46px;
142
+                }
143
+
144
+                .title-text {
145
+                    font-weight: 700;
146
+                    font-size: 36px;
147
+                    color: #000000;
148
+                }
149
+            }
150
+
151
+            // 捡漏列表
152
+            .bottom-list-box-content {
153
+                width: 100%;
154
+                height: 100%;
155
+
156
+                .bottom-list-box-content-item {
157
+                    width: 100%;
158
+                    border-radius: 18px;
159
+                    font-weight: 500;
160
+                    font-size: 24px;
161
+                    color: #444444;
162
+                    margin-bottom: 30px;
163
+                    display: flex;
164
+                    align-items: center;
165
+                    padding: 17px 18px;
166
+                    background: linear-gradient(to right, #F9CA2E, #F1AF2C);
167
+                    box-sizing: border-box;
168
+                }
169
+            }
170
+        }
171
+    }
172
+}

+ 3 - 0
src/pages/calculatorSub/calculatorWishList/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: 'TA的捡漏心愿'
3
+})

+ 47 - 0
src/pages/calculatorSub/calculatorWishList/index.jsx

@@ -0,0 +1,47 @@
1
+import { Component } from "react";
2
+import Taro from "@tarojs/taro";
3
+import { View } from "@tarojs/components";
4
+import "./index.less";
5
+import { getCalculatorDetail } from "../../../service/activity";
6
+export default class Index extends Component {
7
+  state = {
8
+    wishList: [],
9
+  };
10
+  componentDidMount() {
11
+    const { id } = Taro.getCurrentInstance().router.params;
12
+    this.getCalculatorDetail(id); // 获取心愿列表
13
+  }
14
+  // 获取心愿列表
15
+  async getCalculatorDetail(id) {
16
+    const res = await getCalculatorDetail({
17
+      user_id: id,
18
+    });
19
+    this.setState({
20
+      wishList: res,
21
+    });
22
+  }
23
+  render() {
24
+    return (
25
+      <View className="index">
26
+        {/* 心愿列表 */}
27
+        <View className="wish-list">
28
+          {this.state.wishList.length > 0 &&
29
+            this.state.wishList.map((item, index) => (
30
+              <View key={index} className="item">
31
+                <View className="left">{index + 1}</View>
32
+                <View className="right">
33
+                  <View className="left-text">
34
+                    <View className="title">{item.jianlou_title}</View>
35
+                    <View className="price">
36
+                      预算&emsp;{item.reserve_price}元
37
+                    </View>
38
+                  </View>
39
+                  <View className="right-text">{item.time}</View>
40
+                </View>
41
+              </View>
42
+            ))}
43
+        </View>
44
+      </View>
45
+    );
46
+  }
47
+}

+ 68 - 0
src/pages/calculatorSub/calculatorWishList/index.less

@@ -0,0 +1,68 @@
1
+.index {
2
+    .wish-list {
3
+        padding-top: 82px;
4
+        box-sizing: border-box;
5
+        padding-right: 40px;
6
+
7
+        .item {
8
+            display: flex;
9
+
10
+
11
+            .left {
12
+                width: 160px;
13
+                height: 100%;
14
+                font-weight: 500;
15
+                font-size: 60px;
16
+                color: #FF6200;
17
+                text-align: center;
18
+                padding-top: 20px;
19
+                box-sizing: border-box;
20
+            }
21
+
22
+            .right {
23
+                flex: 1;
24
+                display: flex;
25
+                justify-content: space-between;
26
+                align-items: center;
27
+                border-bottom: 1px solid #D8D8D8;
28
+                height: 100%;
29
+                padding: 30px 0;
30
+                box-sizing: border-box;
31
+
32
+                .left-text {
33
+                    display: flex;
34
+                    flex-direction: column;
35
+
36
+                    .title {
37
+                        width: 300px;
38
+                        font-weight: 500;
39
+                        font-size: 30px;
40
+                        color: #333333;
41
+                        white-space: nowrap;
42
+                        overflow: hidden;
43
+                        text-overflow: ellipsis;
44
+                    }
45
+
46
+                    .price {
47
+                        font-weight: 500;
48
+                        font-size: 26px;
49
+                        color: #FC8C31;
50
+                        margin-top: 10px;
51
+                    }
52
+                }
53
+
54
+                .right-text {
55
+                    font-weight: 350;
56
+                    font-size: 24px;
57
+                    color: #999999;
58
+                }
59
+            }
60
+
61
+            &:last-child {
62
+                .right {
63
+                    border-bottom: none;
64
+                }
65
+            }
66
+        }
67
+    }
68
+}

+ 25 - 9
src/pages/index/index.jsx

@@ -7,6 +7,7 @@ import {
7 7
   SwiperItem,
8 8
   Text,
9 9
   Button,
10
+  ScrollView,
10 11
 } from "@tarojs/components";
11 12
 import { AtTabs } from "taro-ui";
12 13
 import { getHomeData, getProductList } from "../../service";
@@ -42,10 +43,11 @@ export default class Index extends Component {
42 43
   };
43 44
   // 轮播图点击
44 45
   handleBannerClick = (item) => {
45
-    if(item.type_jpath==1){
46
+    if (item.type_jpath == 1) {
47
+      const connector = item.jpath.includes("?") ? "&" : "?";
46 48
       Taro.navigateTo({
47
-        url: `${item.jpath}?isBanner=true`
48
-      })
49
+        url: `${item.jpath}${connector}isBanner=true`,
50
+      });
49 51
     }
50 52
   };
51 53
   // 修改 tab 切换处理函数
@@ -66,9 +68,9 @@ export default class Index extends Component {
66 68
               Taro.pageScrollTo({
67 69
                 scrollTop: top - 40,
68 70
                 duration: 300,
69
-                complete:()=>{
71
+                complete: () => {
70 72
                   this.getProductList(true);
71
-                }
73
+                },
72 74
               });
73 75
             } else {
74 76
               console.warn("未找到 .product-list-wrap 元素");
@@ -78,7 +80,16 @@ export default class Index extends Component {
78 80
     );
79 81
   }
80 82
   componentDidShow() {
81
-    this.getHomeData(); //获取首页数据
83
+    this.setState(
84
+      {
85
+        page: 1,
86
+        totalPages: 1,
87
+        loading: false,
88
+      },
89
+      () => {
90
+        this.getHomeData(); //获取首页数据
91
+      }
92
+    );
82 93
   }
83 94
   // 添加回到顶部方法
84 95
   handleBackTop = () => {
@@ -165,16 +176,21 @@ export default class Index extends Component {
165 176
               circular
166 177
               autoplay
167 178
               indicatorDots
168
-              indicatorColor="#e8e8e8"banner
179
+              indicatorColor="#e8e8e8"
180
+              banner
169 181
               indicatorActiveColor="#ffffff"
170 182
             >
171 183
               {homeData.banner &&
172 184
                 homeData.banner.map((item) => (
173
-                  <SwiperItem onClick={() => this.handleBannerClick(item)} className="banner-item" key={item.id}>
185
+                  <SwiperItem
186
+                    onClick={() => this.handleBannerClick(item)}
187
+                    className="banner-item"
188
+                    key={item.id}
189
+                  >
174 190
                     <Image
175 191
                       className="banner-img"
176 192
                       src={item.img}
177
-                      mode="aspectFill"
193
+                      mode="widthFix"
178 194
                     />
179 195
                   </SwiperItem>
180 196
                 ))}

+ 11 - 2
src/pages/index/index.less

@@ -61,7 +61,13 @@
61 61
       .at-tabs__header::-webkit-scrollbar {
62 62
         display: none; /* 隐藏滚动条 */
63 63
       }
64
-
64
+      scroll-view ::-webkit-scrollbar {
65
+        appearance: none;
66
+        color: transparent;
67
+        display: none;
68
+        width: 0;
69
+        height: 0;
70
+      }
65 71
       .at-tabs__item {
66 72
         color: #000;
67 73
         font-size: 26px;
@@ -132,7 +138,10 @@
132 138
       }
133 139
     }
134 140
   }
135
-
141
+  // 商品列表
142
+  .product-list-wrap {
143
+    margin-top: 0;
144
+  }
136 145
   // 添加浮动按钮样式
137 146
   .float-buttons {
138 147
     position: fixed;

+ 4 - 0
src/pages/indexSub/activity/index.config.js

@@ -0,0 +1,4 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '',
3
+  navigationStyle: 'custom',
4
+})

+ 320 - 0
src/pages/indexSub/activity/index.jsx

@@ -0,0 +1,320 @@
1
+import { Component } from "react";
2
+import { View, Image, Text, ScrollView } from "@tarojs/components";
3
+import { AtTabs, AtActivityIndicator } from "taro-ui";
4
+import "./index.less";
5
+import Taro from "@tarojs/taro";
6
+import {
7
+  getNewYearTab,
8
+  getNewYearProductList,
9
+} from "../../../service/activity";
10
+import { handleLog } from "../../../common/track";
11
+export default class Index extends Component {
12
+  state = {
13
+    current: 0,
14
+    page: 1, //页数
15
+    loading: false, //加载状态
16
+    totalPages: 1, // 添加总页数
17
+    tabList: [], //tab列表
18
+    productList: [], //商品列表
19
+    isShare: false, // 是否是分享跳转
20
+    isShowBack: false, // 是否显示返回按钮
21
+  };
22
+  componentDidMount() {
23
+    const { isShare, isShowBack, shareUserId } =
24
+      Taro.getCurrentInstance().router.params || "";
25
+    this.setState(
26
+      {
27
+        isShare: isShare || false,
28
+        isShowBack: isShowBack || false,
29
+        shareUserId: shareUserId || "",
30
+      },
31
+      () => {
32
+        if (isShare) {
33
+          Taro.hideHomeButton(); //隐藏返回首页
34
+        }
35
+        this.getTab(); //获取tab
36
+        handleLog({
37
+          event_type: this.state.isShare
38
+            ? "share_to_activity"
39
+            : "click_to_activity",
40
+          event_type_title: this.state.isShare
41
+            ? "从分享链接进入春节活动页"
42
+            : "直接点击进入春节活动页",
43
+          goods_id: 0,
44
+        }); //埋点
45
+      }
46
+    );
47
+  }
48
+  // 获取tab
49
+  getTab = async () => {
50
+    const res = await getNewYearTab();
51
+    const arr = [];
52
+    res.forEach((item) => {
53
+      arr.push({ title: item.title, id: item.id, name: item.name });
54
+    });
55
+    this.setState({ tabList: arr }, () => {
56
+      this.getProductList(true);
57
+    });
58
+  };
59
+  // 获取商品列表
60
+  getProductList = async (isRefresh = false) => {
61
+    const { page } = this.state;
62
+    this.setState({ loading: true });
63
+
64
+    const res = await getNewYearProductList({
65
+      tag_id: this.state.tabList[this.state.current].id,
66
+      page,
67
+      page_size: 10,
68
+    });
69
+
70
+    this.setState((prevState) => ({
71
+      productList: isRefresh
72
+        ? res.goods_list
73
+        : [...prevState.productList, ...res.goods_list],
74
+      totalPages: res.total_pages,
75
+      loading: false,
76
+    }));
77
+  };
78
+  // 返回
79
+  handleBack = () => {
80
+    Taro.navigateBack();
81
+  };
82
+  // 专场点击
83
+  siteClick = (title, index) => {
84
+    const item = this.state.tabList.find((item) => item.name === title);
85
+    const id = item ? item.id : "";
86
+    Taro.navigateTo({
87
+      url: `/pages/indexSub/seckillIndex/index?id=${id}&&title=${title}&&isShowBack=${this.state.isShowBack}&&isShare=${this.state.isShare}&&isDirect=true`,
88
+    });
89
+  };
90
+  // 切换tab
91
+  tabClick = (index) => {
92
+    this.setState(
93
+      {
94
+        current: index,
95
+        page: 1,
96
+        productList: [],
97
+        isLoading: false,
98
+      },
99
+      () => {
100
+        this.getProductList(true);
101
+      }
102
+    );
103
+  };
104
+  // 商品详情
105
+  handleProductDetail = (product) => {
106
+    Taro.navigateTo({
107
+      url: `/pages/indexSub/productDetail/index?id=${product.id}&&isShare=${this.state.isShare}&&isShowBack=${this.state.isShowBack}`,
108
+    });
109
+  };
110
+  // 滚动到底部
111
+  handleScrollToLower = () => {
112
+    const { page, totalPages, loading } = this.state;
113
+    if (page < totalPages && !loading) {
114
+      this.setState(
115
+        (prevState) => ({ page: prevState.page + 1 }),
116
+        () => this.getProductList()
117
+      );
118
+    }
119
+  };
120
+  // 配置分享内容
121
+  onShareAppMessage() {
122
+    let shareUserId = "";
123
+    if (Taro.getStorageSync("loginInfo")) {
124
+      shareUserId = Taro.getStorageSync("loginInfo").id;
125
+    }
126
+    return {
127
+      title: "新春活动",
128
+      path: `/pages/indexSub/activity/index?isShare=true&&isShowBack=true&&shareUserId=${shareUserId}`,
129
+      imageUrl: "",
130
+    };
131
+  }
132
+  render() {
133
+    return (
134
+      <View className="index">
135
+        {/* 返回按钮 */}
136
+        {!this.state.isShare && (
137
+          <Image
138
+            onClick={this.handleBack}
139
+            style={{ top: Taro.navigationBarHeight + "px" }}
140
+            className="top-back"
141
+            src="https://yushi.tos-cn-beijing.volces.com/activity/back.png"
142
+            mode="widthFix"
143
+          />
144
+        )}
145
+        {/* 顶部图片包裹盒子 */}
146
+        <View className="top-img-wrap">
147
+          <Image
148
+            className="top-img"
149
+            src="https://yushi.tos-cn-beijing.volces.com/activity/topImg.png"
150
+            mode="widthFix"
151
+          />
152
+          <Image
153
+            className="top-title-img"
154
+            src="https://yushi.tos-cn-beijing.volces.com/activity/titleImgOne.png"
155
+            mode="widthFix"
156
+          />
157
+        </View>
158
+        {/* 专场 */}
159
+        {this.state.tabList.length > 0 && (
160
+          <View className="activity-wrap">
161
+            <View className="topBox">
162
+              <View
163
+                className="item"
164
+                onClick={() => {
165
+                  this.siteClick("下午茶专场", "0");
166
+                }}
167
+              >
168
+                <View className="item-title">下午茶专场</View>
169
+                <Image
170
+                  className="item-img"
171
+                  src="https://yushi.tos-cn-beijing.volces.com/activity/topOne.png"
172
+                  mode="widthFix"
173
+                />
174
+                <View className="item-text">点击进入</View>
175
+              </View>
176
+              <View
177
+                className="item"
178
+                onClick={() => {
179
+                  this.siteClick("餐饮美食专场", "1");
180
+                }}
181
+              >
182
+                <View className="item-title">餐饮美食专场</View>
183
+                <Image
184
+                  className="item-img"
185
+                  src="https://yushi.tos-cn-beijing.volces.com/activity/topTwo.png"
186
+                  mode="widthFix"
187
+                />
188
+                <View className="item-text">点击进入</View>
189
+              </View>
190
+            </View>
191
+            <View className="centerBox">
192
+              <View
193
+                className="item"
194
+                onClick={() => {
195
+                  this.siteClick("酒店出行专场", "2");
196
+                }}
197
+              >
198
+                <View className="item-title">酒店出行专场</View>
199
+                <Image
200
+                  className="item-img"
201
+                  src="https://yushi.tos-cn-beijing.volces.com/activity/centerOne.png"
202
+                  mode="widthFix"
203
+                />
204
+                <View className="item-text">点击进入</View>
205
+              </View>
206
+              <View
207
+                className="item"
208
+                onClick={() => {
209
+                  this.siteClick("清洗服务专场", "3");
210
+                }}
211
+              >
212
+                <View className="item-title">清洗服务专场</View>
213
+                <Image
214
+                  className="item-img"
215
+                  src="https://yushi.tos-cn-beijing.volces.com/activity/centerTwo.png"
216
+                  mode="widthFix"
217
+                />
218
+                <View className="item-text">点击进入</View>
219
+              </View>
220
+              <View
221
+                className="item"
222
+                onClick={() => {
223
+                  this.siteClick("游玩娱乐专场", "4");
224
+                }}
225
+              >
226
+                <View className="item-title">游玩娱乐专场</View>
227
+                <Image
228
+                  className="item-img"
229
+                  src="https://yushi.tos-cn-beijing.volces.com/activity/centerThree.png"
230
+                  mode="widthFix"
231
+                />
232
+                <View className="item-text">点击进入</View>
233
+              </View>
234
+            </View>
235
+            <View className="bottomBox">
236
+              <View
237
+                className="item"
238
+                onClick={() => {
239
+                  this.siteClick("咖啡专场", "5");
240
+                }}
241
+              >
242
+                <View className="item-title">咖啡专场</View>
243
+                <Image
244
+                  className="item-img"
245
+                  src="https://yushi.tos-cn-beijing.volces.com/activity/bottom.png"
246
+                  mode="widthFix"
247
+                />
248
+                <View className="item-text">点击进入</View>
249
+              </View>
250
+            </View>
251
+          </View>
252
+        )}
253
+        <Image
254
+          className="bottom-title-img"
255
+          src="https://yushi.tos-cn-beijing.volces.com/activity/titleImgTwo.png"
256
+          mode="widthFix"
257
+        />
258
+        {/* 商品列表盒子 */}
259
+        <View className="product-list-wrap">
260
+          {/* tab分类 */}
261
+          <View className="tabs-list">
262
+            <AtTabs
263
+              current={this.state.current}
264
+              scroll
265
+              tabList={this.state.tabList}
266
+              onClick={this.tabClick}
267
+            />
268
+          </View>
269
+          <ScrollView
270
+            onScrollToLower={this.handleScrollToLower}
271
+            className="product-list"
272
+            scrollY
273
+          >
274
+            <View className="product-list-container">
275
+              {this.state.productList.map((product) => (
276
+                <View
277
+                  onClick={() => this.handleProductDetail(product)}
278
+                  key={product.id}
279
+                  className="product-list-item"
280
+                >
281
+                  <Image
282
+                    className="product-img"
283
+                    src={product.image_url}
284
+                    mode="aspectFill"
285
+                  />
286
+                  <View className="product-content">
287
+                    <Text className="product-title">{product.item_title}</Text>
288
+                    <View className="product-price">
289
+                      <View className="product-price-left">
290
+                        <Text className="product-price-text">到手价</Text>
291
+                        <Text className="product-price-text-price">
292
+                          ¥{product.reserve_price}
293
+                        </Text>
294
+                      </View>
295
+                      <View className="product-commission">
296
+                        <Text className="product-commission-text">
297
+                          赚¥{product.estimated_commission_promotion}
298
+                        </Text>
299
+                      </View>
300
+                    </View>
301
+                  </View>
302
+                </View>
303
+              ))}
304
+              {this.state.loading && (
305
+                <View className="loading">
306
+                  <AtActivityIndicator
307
+                    content="加载中..."
308
+                    isOpened={this.state.loading}
309
+                    mode="center"
310
+                    color="#fff"
311
+                  />
312
+                </View>
313
+              )}
314
+            </View>
315
+          </ScrollView>
316
+        </View>
317
+      </View>
318
+    );
319
+  }
320
+}

+ 287 - 0
src/pages/indexSub/activity/index.less

@@ -0,0 +1,287 @@
1
+.index {
2
+    width: 100%;
3
+    min-height: 100vh;
4
+    background: linear-gradient(90deg, #FE5F3B 0%, #F51C1C 52%, #FE5F3B 99%);
5
+    padding-bottom: 33px;
6
+
7
+    .top-back {
8
+        position: fixed;
9
+        left: 22px;
10
+        width: 64px;
11
+        height: 64px;
12
+        z-index: 1000;
13
+    }
14
+
15
+    // 顶部图片包裹盒子
16
+    .top-img-wrap {
17
+        position: relative;
18
+
19
+        .top-img {
20
+            width: 100%;
21
+        }
22
+
23
+        .top-title-img {
24
+            position: absolute;
25
+            bottom: 0;
26
+            left: 50%;
27
+            transform: translateX(-50%);
28
+            width: 542px;
29
+            height: 105px;
30
+        }
31
+    }
32
+
33
+    // 专场盒子
34
+    .activity-wrap {
35
+        margin: 0 13px;
36
+        width: 724px;
37
+        height: 1007px;
38
+        background: url('https://yushi.tos-cn-beijing.volces.com/activity/activeWrap.png') no-repeat center center;
39
+        background-size: 100% 100%;
40
+        padding: 44px 30px 0 36px;
41
+        box-sizing: border-box;
42
+
43
+        .topBox,
44
+        .centerBox,
45
+        .bottomBox {
46
+            display: flex;
47
+            justify-content: space-between;
48
+            align-items: center;
49
+
50
+            .item {
51
+                position: relative;
52
+                width: 320px;
53
+                height: 276px;
54
+
55
+                .item-title {
56
+                    font-weight: 700;
57
+                    font-size: 24px;
58
+                    color: #FF4A00;
59
+                    position: absolute;
60
+                    top: 24px;
61
+                    left: 50%;
62
+                    transform: translateX(-50%);
63
+                    white-space: nowrap;
64
+                }
65
+
66
+                .item-img {
67
+                    width: 100%;
68
+                }
69
+
70
+                .item-text {
71
+                    position: absolute;
72
+                    font-size: 20px;
73
+                    color: #FFFFFF;
74
+                    line-height: 29px;
75
+                    bottom: 11px;
76
+                    left: 50%;
77
+                    transform: translateX(-50%);
78
+                }
79
+            }
80
+        }
81
+
82
+        .centerBox {
83
+            margin-top: 20px;
84
+
85
+            .item {
86
+                width: 206px;
87
+                height: 298px;
88
+            }
89
+
90
+            .item-text {
91
+                bottom: 10px !important;
92
+            }
93
+        }
94
+
95
+        .bottomBox {
96
+            margin-top: 24px;
97
+
98
+            .item {
99
+                width: 100%;
100
+                height: 274px;
101
+            }
102
+
103
+            .item-text {
104
+                bottom: 5px;
105
+            }
106
+        }
107
+    }
108
+
109
+    .bottom-title-img {
110
+        width: 542px;
111
+        height: 105px;
112
+        margin: 24px 104px 0 104px;
113
+    }
114
+
115
+    // 商品列表盒子
116
+    .product-list-wrap {
117
+        margin: 0 16px;
118
+        width: 718px;
119
+        min-height: 1110px;
120
+        background: url('https://yushi.tos-cn-beijing.volces.com/activity/productListBg.png') no-repeat center center;
121
+        background-size: 100% 100%;
122
+        padding: 30px 20px 47px 27px;
123
+        box-sizing: border-box;
124
+
125
+        // tab分类
126
+        .tabs-list {
127
+            box-sizing: border-box;
128
+            padding: 0 34px;
129
+            display: flex;
130
+            overflow: hidden;
131
+
132
+            .at-tabs__header {
133
+                background-color: transparent;
134
+                height: 100%;
135
+                text-align: left;
136
+            }
137
+
138
+            .at-tabs__header::-webkit-scrollbar {
139
+                display: none;
140
+                /* 隐藏滚动条 */
141
+            }
142
+
143
+            scroll-view ::-webkit-scrollbar {
144
+                appearance: none;
145
+                color: transparent;
146
+                display: none;
147
+                width: 0;
148
+                height: 0;
149
+            }
150
+
151
+            .at-tabs__item {
152
+                color: #FFE1BA;
153
+                font-size: 26px;
154
+                padding: 0;
155
+                min-width: auto;
156
+                width: auto;
157
+                margin-right: 34px;
158
+                padding-bottom: 12px;
159
+                height: 100%;
160
+                line-height: 41px;
161
+
162
+                &--active {
163
+                    color: #fff;
164
+                    font-size: 28px;
165
+                    font-weight: bold;
166
+
167
+                    .at-tabs__item-underline {
168
+                        display: block;
169
+                        background-color: #fdd315;
170
+                        height: 8px;
171
+                        border-radius: 8px 8px 0 0;
172
+                        bottom: 0;
173
+                        width: 42px;
174
+                        left: 50%;
175
+                        transform: translateX(-50%);
176
+                    }
177
+                }
178
+
179
+                &:last-child {
180
+                    margin-right: 0;
181
+                }
182
+            }
183
+
184
+            .at-tabs__item-underline {
185
+                display: none;
186
+            }
187
+
188
+            .at-tabs__underline {
189
+                width: auto;
190
+            }
191
+        }
192
+
193
+        // 商品列表
194
+        .product-list {
195
+            margin-top: 24px;
196
+            height: 1000px;
197
+
198
+            .product-list-container {
199
+                display: flex;
200
+                flex-wrap: wrap;
201
+                justify-content: space-between;
202
+
203
+                .product-list-item {
204
+                    width: 331px;
205
+                    height: 493px;
206
+                    background: url('https://yushi.tos-cn-beijing.volces.com/activity/productImg.png') no-repeat center center;
207
+                    background-size: contain;
208
+                    margin-bottom: 7px;
209
+                    padding: 6px 20px 52px 11px;
210
+                    box-sizing: border-box;
211
+                    display: flex;
212
+                    flex-direction: column;
213
+
214
+                    .product-img {
215
+                        width: 100%;
216
+                        height: 262px;
217
+                        border-radius: 38px;
218
+                    }
219
+
220
+                    .product-content {
221
+                        margin-top: 10px;
222
+                        flex: 1;
223
+                        padding: 0 6px 0 25px;
224
+                        box-sizing: border-box;
225
+                        display: flex;
226
+                        flex-direction: column;
227
+                        justify-content: space-between;
228
+
229
+                        .product-title {
230
+                            font-weight: 700;
231
+                            font-size: 26px;
232
+                            color: #000000;
233
+                            line-height: 38px;
234
+                            height: 72px;
235
+                            display: -webkit-box;
236
+                            -webkit-box-orient: vertical;
237
+                            -webkit-line-clamp: 2;
238
+                            overflow: hidden;
239
+                            text-overflow: ellipsis;
240
+                        }
241
+
242
+                        .product-price {
243
+                            display: flex;
244
+                            align-items: center;
245
+                            justify-content: space-between;
246
+                            align-items: flex-end;
247
+
248
+                            .product-price-left {
249
+                                display: flex;
250
+                                flex-direction: column;
251
+                                font-weight: 700;
252
+                                font-size: 16px;
253
+                                color: #FD5608;
254
+                                line-height: 21px;
255
+
256
+                                .product-price-text-price {
257
+                                    font-size: 30px;
258
+                                    margin-top: 12px;
259
+                                }
260
+                            }
261
+                            .product-commission {
262
+                                text-align: center;
263
+                                line-height: 52px;
264
+                                width: 125px;
265
+                                height: 52px;
266
+                                border-radius: 30px;
267
+                                font-size: 26px;
268
+                                color: #FFFFFF;
269
+                                background: url('https://yushi.tos-cn-beijing.volces.com/activity/btn.png') no-repeat center center;
270
+                                background-size: 100% 100%;
271
+                            }
272
+                        }
273
+                    }
274
+                }
275
+                .loading {
276
+                    width: 100%;
277
+                    position: relative;
278
+                    height: 60px;
279
+                    .at-activity-indicator__content{
280
+                        color: #fff;
281
+                    }
282
+                  }
283
+            }
284
+
285
+        }
286
+    }
287
+}

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

@@ -2,7 +2,6 @@ import { Component } from "react";
2 2
 import { View, Image } from "@tarojs/components";
3 3
 import "./index.less";
4 4
 import Taro from "@tarojs/taro";
5
-import seckillImg from "../../../images/seckill/heighTop.jpg";
6 5
 import ProductList from "../../../components/index/ProductList";
7 6
 import { getRecommendProductList, addLog } from "../../../service";
8 7
 import { getShareContent } from "../../../common/share";
@@ -121,7 +120,7 @@ export default class Index extends Component {
121 120
   render() {
122 121
     return (
123 122
       <View className="index">
124
-        <Image className="seckill" src={seckillImg} mode="aspectFill" />
123
+        {/* <Image className="seckill" src={seckillImg} mode="aspectFill" /> */}
125 124
         {/* 商品列表 */}
126 125
         <View className="product-list">
127 126
           <ProductList

+ 129 - 97
src/pages/indexSub/productDetail/index.jsx

@@ -7,9 +7,8 @@ import {
7 7
   getProductPromotion,
8 8
   getShareJump,
9 9
   bindShareJump,
10
-  addLog,
11 10
 } from "../../../service";
12
-import { formatDate } from "../../../common/time";
11
+import { handleLog } from "../../../common/track";
13 12
 import { isDebounce } from "../../../common/debounce";
14 13
 import "./index.less";
15 14
 import Taro from "@tarojs/taro";
@@ -30,11 +29,12 @@ export default class Index extends Component {
30 29
     productDetail: [], //商品详情
31 30
     productLikeList: [], //推荐商品列表
32 31
     productPromotion: [], //商品推广转链
33
-    isHighCommission: false, //是否是高佣金页面
34
-    isSeckill: false, //是否是秒杀页面
32
+    isSeckill: false, //是否是专项区域页面
33
+    tagTitle: "", //专项跳转标题
35 34
     shareJump: "", //分享跳转标识
36 35
     shareTitle: "", //分享标题
37 36
     shareUserId: "", //分享用户id
37
+    isShowBack: false, //是否显示返回
38 38
   };
39 39
   // 获取产品详情的方法
40 40
   fetchProductDetails = async (id) => {
@@ -68,18 +68,29 @@ export default class Index extends Component {
68 68
     Taro.hideShareMenu({
69 69
       menus: ["shareAppMessage", "shareTimeline"],
70 70
     });
71
-    const { id, isShare, isHighCommission, isSeckill, shareJump, shareUserId } =
72
-      Taro.getCurrentInstance().router.params;
71
+    let {
72
+      id,
73
+      isShare,
74
+      isSeckill,
75
+      shareJump,
76
+      shareUserId,
77
+      tagTitle,
78
+      shareType,
79
+      isShowBack,
80
+      share_unique_value
81
+    } = Taro.getCurrentInstance().router.params;
82
+    shareJump = shareJump || share_unique_value
73 83
     let session_key = Taro.getStorageSync("session_key");
74 84
     let userInfo = Taro.getStorageSync("userInfo");
75 85
     let isShowSign = Taro.getStorageSync("isShowSign");
76 86
     this.setState(
77 87
       {
78 88
         id,
79
-        isShare,
80
-        isHighCommission: isHighCommission === "true",
89
+        isShare: isShare === "true",
81 90
         isSeckill: isSeckill === "true",
82 91
         shareUserId: shareUserId,
92
+        tagTitle: tagTitle,
93
+        isShowBack: isShowBack === "true" || false,
83 94
       },
84 95
       () => {
85 96
         // 获取分享跳转标识
@@ -88,27 +99,39 @@ export default class Index extends Component {
88 99
             key: "shareJump",
89 100
             data: shareJump,
90 101
           });
102
+        shareType &&
103
+          Taro.setStorage({
104
+            key: "shareType",
105
+            data: shareType,
106
+          });
91 107
         this.fetchProductDetails(id); //获取产品详情
92 108
         this.getProductLikeList(); //获取猜你喜欢列表
93 109
         if (session_key && shareJump) {
94 110
           this.bindShareJump(); //绑定分享跳转标识
95 111
         }
96
-        if (this.state.isHighCommission || this.state.isSeckill) {
97
-          this.handleLog("direct_to_product"); //埋点
112
+        // 埋点
113
+        if (this.state.isSeckill) {
114
+          handleLog({
115
+            event_type: "direct_to_product",
116
+            event_type_title: "进入商品详情页",
117
+            goods_id: Number(this.state.id),
118
+            shareUserId: this.state.shareUserId,
119
+          }); //埋点
120
+        }
121
+        // 判断是否显示签约弹窗
122
+        if (
123
+          session_key &&
124
+          isShowSign !== false &&
125
+          userInfo &&
126
+          userInfo.user_identity == 0 &&
127
+          !this.state.isShare
128
+        ) {
129
+          this.setState({
130
+            isOpened: "sign",
131
+          });
98 132
         }
99 133
       }
100 134
     );
101
-    // 判断是否显示签约弹窗
102
-    if (
103
-      session_key &&
104
-      isShowSign !== false &&
105
-      userInfo &&
106
-      userInfo.user_identity == 0
107
-    ) {
108
-      this.setState({
109
-        isOpened: "sign",
110
-      });
111
-    }
112 135
   }
113 136
   // 复制商品编号
114 137
   handleCopy = (text) => {
@@ -139,50 +162,6 @@ export default class Index extends Component {
139 162
       isOpened: "self",
140 163
     });
141 164
   };
142
-  // 埋点
143
-  handleLog = (event_type) => {
144
-    if (!isDebounce(500)) return; // 如果在300ms内重复触发,直接返回
145
-    if (this.state.isHighCommission || this.state.isSeckill) {
146
-      const dayid = formatDate(new Date(), "YYYY-MM-DD");
147
-      const event_type_title =
148
-        event_type == "share_product_link"
149
-          ? "点击分享赚"
150
-          : event_type == "direct_to_product"
151
-          ? "进入商品详情页"
152
-          : "进入商品详情页";
153
-      let userId = "";
154
-      if (Taro.getStorageSync("loginInfo")) {
155
-        userId = Taro.getStorageSync("loginInfo").id;
156
-      }
157
-      // 构建ext对象,包含share_id
158
-      let ext = "";
159
-      if (this.state.shareUserId) {
160
-        ext = JSON.stringify({
161
-          share_users_id: this.state.shareUserId,
162
-        });
163
-      }
164
-      addLog({
165
-        users_id: userId || 0,
166
-        goods_id: Number(this.state.id),
167
-        event_type_title,
168
-        event_type,
169
-        dayid,
170
-        ext,
171
-      });
172
-    }
173
-  };
174
-  // 分享
175
-  openSharePopup = async () => {
176
-    const res = await getShareJump({
177
-      share_type: 1,
178
-      share_id: this.state.id,
179
-    });
180
-    this.setState({
181
-      shareJump: res.share_unique_value,
182
-      isOpened: "share",
183
-    });
184
-    this.handleLog("share_product_link"); //埋点
185
-  };
186 165
   // 绑定分享跳转标识
187 166
   bindShareJump = async () => {
188 167
     let shareJump = Taro.getStorageSync("shareJump");
@@ -191,21 +170,56 @@ export default class Index extends Component {
191 170
       share_unique_value: shareJump,
192 171
     });
193 172
     Taro.removeStorageSync("shareJump");
173
+    Taro.removeStorageSync("shareType");
194 174
   };
195
-  // 设置分享标题
196
-  handleShareTitleChange = (newTitle) => {
197
-    this.setState({
198
-      shareTitle: newTitle,
175
+  // 分享
176
+  openSharePopup = async () => {
177
+    if (!isDebounce(500)) return; // 如果在500ms内重复触发,直接返回
178
+    let shareUserId = "";
179
+    if (Taro.getStorageSync("loginInfo")) {
180
+      shareUserId = Taro.getStorageSync("loginInfo").id;
181
+    }
182
+    // 使用 encodeURIComponent 编码商品详情数据
183
+    const encodedProductDetail = encodeURIComponent(
184
+      JSON.stringify(this.state.productDetail)
185
+    );
186
+    Taro.navigateTo({
187
+      url: `/pages/indexSub/sharePage/index?isSeckill=${this.state.isSeckill}&tagTitle=${this.state.tagTitle}&productDetail=${encodedProductDetail}&shareUserId=${shareUserId}`,
199 188
     });
189
+    // 埋点
190
+    if (this.state.isSeckill) {
191
+      handleLog({
192
+        event_type: "share_product_link",
193
+        event_type_title: "点击分享赚",
194
+        goods_id: Number(this.state.id),
195
+        shareUserId: this.state.shareUserId,
196
+      });
197
+    }
198
+    // return
199
+    // const res = await getShareJump({
200
+    //   share_type: 1,
201
+    //   share_id: this.state.id,
202
+    // });
203
+    // this.setState({
204
+    //   shareJump: res.share_unique_value,
205
+    //   isOpened: "share",
206
+    // });
207
+    // 埋点
200 208
   };
209
+  // 设置分享标题
210
+  // handleShareTitleChange = (newTitle) => {
211
+  //   this.setState({
212
+  //     shareTitle: newTitle,
213
+  //   });
214
+  // };
201 215
   // 配置分享内容
202
-  onShareAppMessage() {
203
-    return {
204
-      title: this.state.shareTitle || this.state.productDetail.item_title,
205
-      path: `/pages/indexSub/productDetail/index?id=${this.state.id}&&isShare=true&&isHighCommission=${this.state.isHighCommission}&&isSeckill=${this.state.isSeckill}&&shareJump=${this.state.shareJump}`,
206
-      imageUrl: this.state.productDetail.images[0].img,
207
-    };
208
-  }
216
+  // onShareAppMessage() {
217
+  //   return {
218
+  //     title: this.state.shareTitle || this.state.productDetail.item_title,
219
+  //     path: `/pages/indexSub/productDetail/index?id=${this.state.id}&&isShare=true&&isSeckill=${this.state.isSeckill}&&shareJump=${this.state.shareJump}&&tagTitle=${this.state.tagTitle}&&shareType=1`,
220
+  //     imageUrl: this.state.productDetail.images[0].img,
221
+  //   };
222
+  // }
209 223
   // 添加返回方法
210 224
   handleBack = () => {
211 225
     const pages = Taro.getCurrentPages();
@@ -218,7 +232,7 @@ export default class Index extends Component {
218 232
     }
219 233
   };
220 234
   render() {
221
-    const { productDetail } = this.state;
235
+    const { productDetail, tagTitle } = this.state;
222 236
     return (
223 237
       <View
224 238
         className="index"
@@ -229,6 +243,11 @@ export default class Index extends Component {
229 243
             <AtIcon value="chevron-left" size="24" color="#999999"></AtIcon>
230 244
           </View>
231 245
         )}
246
+        {this.state.isShowBack && (
247
+          <View className="back-btn" onClick={this.handleBack}>
248
+            <AtIcon value="chevron-left" size="24" color="#999999"></AtIcon>
249
+          </View>
250
+        )}
232 251
         {/* 轮播图 */}
233 252
         <Swiper className="swiper" autoplay circular>
234 253
           {productDetail.images &&
@@ -247,11 +266,7 @@ export default class Index extends Component {
247 266
           {/* 商品名称 */}
248 267
           <Text className="product-name">
249 268
             <Text className="self-tag">
250
-              {this.state.isHighCommission
251
-                ? "高佣专项"
252
-                : this.state.isSeckill
253
-                ? "鱼市秒杀"
254
-                : "自营"}
269
+              {this.state.isSeckill ? tagTitle : "自营"}
255 270
             </Text>
256 271
             {productDetail.item_title}
257 272
           </Text>
@@ -271,11 +286,13 @@ export default class Index extends Component {
271 286
               )}
272 287
             </View>
273 288
             {/* 标签区域 */}
274
-            <View className="tag-box">
275
-              <Text className="tag">
276
-                分享赚¥{productDetail.estimated_commission}
277
-              </Text>
278
-            </View>
289
+            {!this.state.isShare && (
290
+              <View className="tag-box">
291
+                <Text className="tag">
292
+                  分享赚¥{productDetail.estimated_commission_promotion}
293
+                </Text>
294
+              </View>
295
+            )}
279 296
           </View>
280 297
 
281 298
           {/* 分割线 */}
@@ -288,7 +305,7 @@ export default class Index extends Component {
288 305
             </Text>
289 306
             <Text
290 307
               className="copy-btn"
291
-              onClick={() => this.handleCopy("123456")}
308
+              onClick={() => this.handleCopy(productDetail.goods_number)}
292 309
             >
293 310
               复制
294 311
             </Text>
@@ -309,6 +326,13 @@ export default class Index extends Component {
309 326
             <Text className="tag-text">无忧售后</Text>
310 327
           </View>
311 328
         </View>
329
+        {/* 产品详情 */}
330
+        <View className="product-detail">
331
+          <View className="title">商品描述</View>
332
+          {productDetail.item_desc && (
333
+            <Text className="content">{productDetail.item_desc}</Text>
334
+          )}
335
+        </View>
312 336
         {/* 猜你喜欢 */}
313 337
         <View className="guess-you-like">
314 338
           <Image src={like} mode="aspectFit" />
@@ -317,15 +341,24 @@ export default class Index extends Component {
317 341
         {/* 猜你喜欢产品列表 */}
318 342
         <View className="product-card-list">
319 343
           {this.state.productLikeList.map((product) => (
320
-            <ProductCard key={product.id} product={product} />
344
+            <ProductCard
345
+              key={product.id}
346
+              product={product}
347
+              isShowBack={this.state.isShowBack}
348
+              isShare={this.state.isShare}
349
+            />
321 350
           ))}
322 351
         </View>
323 352
         {/* 底部购买模块 */}
324
-        <View className="bottom-buy">
325
-          <View onClick={this.handleToHome} className="bottom-buy-left">
326
-            <Image src={home} mode="aspectFit" />
327
-            <Text className="bottom-buy-text">首页</Text>
328
-          </View>
353
+        <View
354
+          className={`bottom-buy ${this.state.isShare ? "share-active" : ""}`}
355
+        >
356
+          {!this.state.isShare && (
357
+            <View onClick={this.handleToHome} className="bottom-buy-left">
358
+              <Image src={home} mode="aspectFit" />
359
+              <Text className="bottom-buy-text">首页</Text>
360
+            </View>
361
+          )}
329 362
           <View className="bottom-buy-right">
330 363
             {!this.state.isShare ? (
331 364
               <>
@@ -368,11 +401,10 @@ export default class Index extends Component {
368 401
           linkText={this.state.productPromotion.short_tpwd}
369 402
           id={this.state.id}
370 403
           shareUserId={this.state.shareUserId}
371
-          isHighCommission={this.state.isHighCommission}
372 404
           isSeckill={this.state.isSeckill}
373 405
         />
374 406
         {/* 分享弹窗 */}
375
-        {this.state.isOpened == "share" && (
407
+        {/* {this.state.isOpened == "share" && (
376 408
           <ShareModal
377 409
             onClose={() => {
378 410
               this.setState({
@@ -384,7 +416,7 @@ export default class Index extends Component {
384 416
             product={this.state.productDetail}
385 417
             onShareTitleChange={this.handleShareTitleChange}
386 418
           />
387
-        )}
419
+        )} */}
388 420
         {/* 签约弹窗 */}
389 421
         <SignModal
390 422
           isOpened={this.state.isOpened == "sign"}

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

@@ -126,7 +126,22 @@
126 126
             }
127 127
         }
128 128
     }
129
-
129
+    // 产品详情
130
+    .product-detail {
131
+        margin: 20px 16px 0 16px;
132
+        padding: 22px 17px;
133
+        box-sizing: border-box;
134
+        background-color: #fff;
135
+        border-radius: 20px;
136
+        .title {
137
+            font-size: 32px;
138
+            line-height: 40px;
139
+            color: #000000;
140
+            font-weight: 700;
141
+            text-align: center;
142
+            width: 100%;
143
+        }
144
+    }
130 145
     //   猜你喜欢
131 146
     .guess-you-like {
132 147
         display: flex;
@@ -150,7 +165,10 @@
150 165
             font-weight: 500;
151 166
         }
152 167
     }
153
-
168
+    .share-active{
169
+        justify-content: center !important;
170
+        align-items: center !important;
171
+    }
154 172
     // 底部购买模块
155 173
     .bottom-buy {
156 174
         width: 100%;

+ 1 - 1
src/pages/indexSub/seckillIndex/index.config.js

@@ -1,3 +1,3 @@
1 1
 export default definePageConfig({
2
-  navigationBarTitleText: '鱼市秒杀'
2
+  navigationBarTitleText: '鱼市专项'
3 3
 })

+ 78 - 50
src/pages/indexSub/seckillIndex/index.jsx

@@ -2,13 +2,18 @@ import { Component } from "react";
2 2
 import { View, Image } from "@tarojs/components";
3 3
 import "./index.less";
4 4
 import Taro from "@tarojs/taro";
5
-import seckillImg from "../../../images/seckill/seckillTop.jpg";
6 5
 import ProductList from "../../../components/index/ProductList";
7
-import { getRecommendProductList, addLog } from "../../../service";
8
-import { formatDate } from "../../../common/time";
6
+import {
7
+  getRecommendProductList,
8
+  getShareJump,
9
+  bindShareJump,
10
+} from "../../../service";
11
+import { handleLog } from "../../../common/track";
9 12
 import { getShareContent } from "../../../common/share";
10 13
 export default class Index extends Component {
11 14
   state = {
15
+    title: "", // 页面标题
16
+    id: "", // 页面类型id
12 17
     productList: [], //推荐商品列表
13 18
     page: 1, //页数
14 19
     loading: false, //加载状态
@@ -18,30 +23,66 @@ export default class Index extends Component {
18 23
     isBanner: false, // 是否是banner跳转
19 24
     isShare: false, // 是否是分享跳转
20 25
     shareUserId: "", // 分享用户id
26
+    img: "", // 图片
27
+    isShowBack: false, // 是否显示返回
21 28
   };
22 29
   componentDidMount() {
23
-    const { isDirect, isBanner, isShare, shareUserId } =
30
+    const { isDirect, isBanner, isShare, shareUserId, title, id, shareJump,shareType,isShowBack } =
24 31
       Taro.getCurrentInstance().router.params || "";
32
+    let session_key = Taro.getStorageSync("session_key");
25 33
     this.setState(
26 34
       {
27 35
         isDirect: isDirect || false,
28 36
         isBanner: isBanner || false,
29
-        isShare: isShare || false,
37
+        isShare: isShare === "true" || false,
30 38
         shareUserId: shareUserId || "",
39
+        title: title || "",
40
+        id: id || "",
41
+        isShowBack: isShowBack === "true" || false,
31 42
       },
32 43
       () => {
33
-        this.handleLog(
34
-          isDirect
35
-            ? "direct_to_fish_seckill"
44
+        // 设置页面标题
45
+        Taro.setNavigationBarTitle({
46
+          title: this.state.title || "鱼市",
47
+        });
48
+        if (isShare) {
49
+          Taro.hideHomeButton();//隐藏返回首页
50
+        }
51
+        handleLog({
52
+          event_type: isDirect
53
+            ? `direct_to_${this.state.id}_${this.state.title}`
36 54
             : isBanner
37
-            ? "banner_to_fish_seckill"
55
+            ? `banner_to_${this.state.id}_${this.state.title}`
38 56
             : isShare
39
-            ? "share_to_fish_seckill"
40
-            : "direct_to_fish_seckill"
41
-        );
57
+            ? `share_to_${this.state.id}_${this.state.title}`
58
+            : `direct_to_${this.state.id}_${this.state.title}`,
59
+          event_type_title: isDirect
60
+            ? `直接点击进入${this.state.title}`
61
+            : isBanner
62
+            ? `从banner 跳转到${this.state.title}`
63
+            : isShare
64
+            ? `从分享链接跳转到${this.state.title}`
65
+            : `直接点击进入${this.state.title}`,
66
+          goods_id: 0,
67
+          shareUserId: this.state.shareUserId,
68
+        });
69
+        this.getRecommendProductList();
70
+        // 获取分享跳转标识
71
+        shareJump &&
72
+          Taro.setStorage({
73
+            key: "shareJump",
74
+            data: shareJump,
75
+          });
76
+        shareType &&
77
+          Taro.setStorage({
78
+            key: "shareType",
79
+            data: shareType,
80
+          });
81
+        if (session_key && shareJump) {
82
+          this.bindShareJump(); //绑定分享跳转标识
83
+        }
42 84
       }
43 85
     );
44
-    this.getRecommendProductList();
45 86
   }
46 87
   // 获取推荐商品列表
47 88
   getRecommendProductList = async () => {
@@ -49,7 +90,7 @@ export default class Index extends Component {
49 90
     this.setState({ loading: true });
50 91
 
51 92
     const res = await getRecommendProductList({
52
-      tag_id: 120,
93
+      tag_id: this.state.id,
53 94
       page,
54 95
       page_size: 10,
55 96
     });
@@ -59,38 +100,18 @@ export default class Index extends Component {
59 100
       totalPages: res.total_pages,
60 101
       loading: false,
61 102
       isNoMore: res.total_pages <= page,
103
+      img: res.img,
62 104
     }));
63 105
   };
64
-  // 埋点
65
-  handleLog = (event_type) => {
66
-    const dayid = formatDate(new Date(), "YYYY-MM-DD");
67
-    const event_type_title =
68
-      event_type == "banner_to_fish_seckill"
69
-        ? "从banner 跳转到鱼市秒杀"
70
-        : event_type == "share_to_fish_seckill"
71
-        ? "从分享链接跳转到鱼市秒杀"
72
-        : event_type == "direct_to_fish_seckill"
73
-        ? "直接点击进入鱼市秒杀"
74
-        : "直接点击进入鱼市秒杀";
75
-    let userId = "";
76
-    if (Taro.getStorageSync("loginInfo")) {
77
-      userId = Taro.getStorageSync("loginInfo").id;
78
-    }
79
-    // 构建ext对象,包含share_id
80
-    let ext = "";
81
-    if (this.state.shareUserId) {
82
-      ext = JSON.stringify({
83
-        share_users_id: this.state.shareUserId,
84
-      });
85
-    }
86
-    addLog({
87
-      users_id: userId||0,
88
-      goods_id: 0,
89
-      event_type_title,
90
-      event_type,
91
-      dayid,
92
-      ext,
106
+  // 绑定分享跳转标识
107
+  bindShareJump = async () => {
108
+    let shareJump = Taro.getStorageSync("shareJump");
109
+    await bindShareJump({
110
+      share_type: 3,
111
+      share_unique_value: shareJump,
93 112
     });
113
+    Taro.removeStorageSync("shareJump");
114
+    Taro.removeStorageSync("shareType");
94 115
   };
95 116
   // 配置分享内容
96 117
   onShareAppMessage(res) {
@@ -98,13 +119,17 @@ export default class Index extends Component {
98 119
     if (Taro.getStorageSync("loginInfo")) {
99 120
       shareUserId = Taro.getStorageSync("loginInfo").id;
100 121
     }
101
-    const shareConfig = getShareContent();
102 122
     if (res.from == "menu") {
103
-      return {
104
-        title: "鱼市秒杀",
105
-        path: `/pages/indexSub/seckillIndex/index?isShare=true&shareUserId=${shareUserId}`,
106
-        imageUrl: "",
107
-      };
123
+      return getShareJump({
124
+        share_type: 3,
125
+        share_id: this.state.id,
126
+      }).then((res) => {
127
+        return {
128
+          title: `${this.state.title}`,
129
+          path: `/pages/indexSub/seckillIndex/index?isShare=true&shareUserId=${shareUserId}&title=${this.state.title}&id=${this.state.id}&&shareJump=${res.share_unique_value}&&shareType=3&&isShowBack=true`,
130
+          imageUrl: "",
131
+        };
132
+      });
108 133
     } else {
109 134
       return getShareContent();
110 135
     }
@@ -122,7 +147,7 @@ export default class Index extends Component {
122 147
   render() {
123 148
     return (
124 149
       <View className="index">
125
-        <Image className="seckill" src={seckillImg} mode="aspectFill" />
150
+        <Image className="seckill" src={this.state.img} mode="widthFix" />
126 151
         {/* 商品列表 */}
127 152
         <View className="product-list">
128 153
           <ProductList
@@ -131,6 +156,9 @@ export default class Index extends Component {
131 156
             loading={this.state.loading}
132 157
             isNoMore={this.state.isNoMore}
133 158
             shareUserId={this.state.shareUserId}
159
+            tagTitle={this.state.title}
160
+            isShare={this.state.isShare}
161
+            isShowBack={this.state.isShowBack}
134 162
           />
135 163
         </View>
136 164
       </View>

+ 2 - 2
src/pages/indexSub/seckillIndex/index.less

@@ -2,12 +2,12 @@
2 2
     width: 100%;
3 3
     padding-bottom: 40px;
4 4
     box-sizing: border-box;
5
+    background-color: #f9f9f9;
5 6
     .seckill{
6 7
         width: 100%;
7 8
         height: 300px;
8
-        background-color: yellow;
9 9
     }
10 10
     .product-list{
11
-        margin-top: -71px;
11
+        margin-top: -196px;
12 12
     }
13 13
 }

+ 3 - 0
src/pages/indexSub/sharePage/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '编辑分享内容',
3
+})

+ 279 - 0
src/pages/indexSub/sharePage/index.jsx

@@ -0,0 +1,279 @@
1
+import { Component } from "react";
2
+import { View, Image, Button, Input } from "@tarojs/components";
3
+import { getShareJump, getProductDetail } from "../../../service/index";
4
+import Taro from "@tarojs/taro";
5
+import "./index.less";
6
+
7
+export default class Index extends Component {
8
+  state = {
9
+    id: "", //商品id(专题列表分享过来的)
10
+    shareTitle: "", //分享标题
11
+    productDetail: {}, //商品详情
12
+    isSeckill: false, //是否是秒杀商品
13
+    shareJump: "", //分享链接
14
+    tagTitle: "", //标签标题
15
+    shareUserId: "", //分享用户id
16
+    share_scheme_link: "", //分享方案链接
17
+  };
18
+  componentDidMount() {
19
+    Taro.hideShareMenu({
20
+      menus: ["shareAppMessage", "shareTimeline"],
21
+    });
22
+    const { isSeckill, tagTitle, productDetail, shareUserId, id } =
23
+      Taro.getCurrentInstance().router.params;
24
+    this.setState(
25
+      {
26
+        isSeckill: isSeckill === "true",
27
+        tagTitle,
28
+        productDetail: productDetail ? JSON.parse(decodeURIComponent(productDetail)) : {},
29
+        shareTitle: productDetail ? JSON.parse(decodeURIComponent(productDetail)).item_title : "",
30
+        shareUserId,
31
+        id: id,
32
+      },
33
+      async () => {
34
+        Taro.showLoading({
35
+          title: "加载中...",
36
+        });
37
+        try {
38
+          await Promise.all([
39
+            this.getProductDetail(id),
40
+            this.getShareJump(id)
41
+          ]);
42
+        } finally {
43
+          Taro.hideLoading();
44
+        }
45
+      }
46
+    );
47
+  }
48
+  // 获取商品详情
49
+  getProductDetail = async (id='') => {
50
+    const res = await getProductDetail({
51
+      goods_id: id||this.state.productDetail.id,
52
+    });
53
+    this.setState({
54
+      productDetail: res,
55
+      shareTitle: res.item_title,
56
+    });
57
+  }
58
+  // 获取分享跳转标识
59
+  getShareJump = async (id='') => {
60
+    // 设置分享路径
61
+    const share_extend = JSON.stringify({
62
+      path: `pages/indexSub/productDetail/index?id=${ id||this.state.productDetail.id}&isShare=true&isSeckill=${this.state.isSeckill}&shareType=11&&shareUserId=${this.state.shareUserId}`,
63
+    });
64
+    const res = await getShareJump({
65
+      share_type: 11,
66
+      share_id: id||this.state.productDetail.id,
67
+      share_extend,
68
+    });
69
+    this.setState({
70
+      shareJump: res.share_unique_value,
71
+      share_scheme_link: res.share_scheme_link,
72
+    });
73
+  };
74
+  // 设置分享标题
75
+  handleShareTitleChange = (newTitle) => {
76
+    this.setState({
77
+      shareTitle: newTitle.detail.value,
78
+    });
79
+  };
80
+  // 保存图片到手机
81
+  handleSaveImage = () => {
82
+    Taro.getSetting({
83
+      success: (res) => {
84
+        if (!res.authSetting["scope.writePhotosAlbum"]) {
85
+          Taro.authorize({
86
+            scope: "scope.writePhotosAlbum",
87
+            success: () => {
88
+              this.saveImage();
89
+            },
90
+            fail: () => {
91
+              Taro.showModal({
92
+                title: "提示",
93
+                content: "需要您授权保存图片到相册",
94
+                success: (modalRes) => {
95
+                  if (modalRes.confirm) {
96
+                    Taro.openSetting();
97
+                  }
98
+                },
99
+              });
100
+            },
101
+          });
102
+        } else {
103
+          this.saveImage();
104
+        }
105
+      },
106
+    });
107
+  };
108
+
109
+  saveImage = async () => {
110
+    Taro.showLoading({
111
+      title: "保存中...",
112
+    });
113
+    const { images } = this.state.productDetail;
114
+    try {
115
+      for (const image of images) {
116
+        // 转换图片链接从 http 到 https
117
+        const imgUrl = image.img.startsWith("http:")
118
+          ? image.img.replace("http:", "https:")
119
+          : image.img;
120
+        // 先获取图片信息
121
+        const imageInfo = await Taro.getImageInfo({
122
+          src: imgUrl,
123
+        });
124
+        // 使用图片路径保存
125
+        await Taro.saveImageToPhotosAlbum({
126
+          filePath: imageInfo.path,
127
+        });
128
+      }
129
+      // 全部保存成功后提示
130
+      Taro.showToast({
131
+        title: "所有图片保存成功",
132
+        icon: "success",
133
+        duration: 2000,
134
+      });
135
+    } catch (error) {
136
+      Taro.showToast({
137
+        title: "保存失败",
138
+        icon: "none",
139
+        duration: 2000,
140
+      });
141
+    }
142
+  };
143
+  // 复制全部内容
144
+  handleCopyAll = () => {
145
+    Taro.setClipboardData({
146
+      data: `${this.state.shareTitle}\n${this.state.share_scheme_link}`,
147
+    });
148
+  };
149
+  // 复制标题
150
+  handleCopyTitle = () => {
151
+    Taro.setClipboardData({
152
+      data: this.state.shareTitle,
153
+      success: () => {
154
+        Taro.showToast({
155
+          title: "标题复制成功",
156
+          icon: "none",
157
+          duration: 1500,
158
+        });
159
+      },
160
+    });
161
+  };
162
+  // 复制链接
163
+  handleCopyLink = () => {
164
+    Taro.setClipboardData({
165
+      data: this.state.share_scheme_link,
166
+      success: () => {
167
+        Taro.showToast({
168
+          title: "链接复制成功",
169
+          icon: "none",
170
+          duration: 1500,
171
+        });
172
+      },
173
+    });
174
+  };
175
+  // 配置分享内容
176
+  onShareAppMessage() {
177
+    return {
178
+      title: this.state.shareTitle || this.state.productDetail.item_title,
179
+      path: `/pages/indexSub/productDetail/index?id=${this.state.productDetail.id}&&isShare=true&&isSeckill=${this.state.isSeckill}&&shareJump=${this.state.shareJump}&&tagTitle=${this.state.tagTitle}&&shareType=11&&shareUserId=${this.state.shareUserId}`,
180
+      imageUrl: this.state.productDetail.images[0].img,
181
+    };
182
+  }
183
+  render() {
184
+    const { productDetail } = this.state;
185
+    return (
186
+      <View className="index">
187
+        {/* 图片素材盒子 */}
188
+        <View className="image-box">
189
+          <View className="image-box-top">
190
+            <View className="image-box-title">图片素材</View>
191
+            <View className="image-box-save" onClick={this.handleSaveImage}>
192
+              保存图片
193
+            </View>
194
+          </View>
195
+          {productDetail.images && (
196
+            <View className="image-box-content">
197
+              {this.state.productDetail.images.map((item, index) => (
198
+                <Image
199
+                  className="image-box-content-item"
200
+                  key={index}
201
+                  src={item.img}
202
+                  mode="aspectFill"
203
+                />
204
+              ))}
205
+            </View>
206
+          )}
207
+        </View>
208
+        {/* 文案素材盒子 */}
209
+        <View className="text-box">
210
+          <View className="text-box-top">
211
+            <View className="text-box-title">文案素材</View>
212
+            <View onClick={this.handleCopyAll} className="text-box-save">
213
+              复制全部内容
214
+            </View>
215
+          </View>
216
+          <View className="text-box-content">
217
+            {/* 商品标题盒子 */}
218
+            <View className="text-box-content-title">
219
+              <View className="text-box-content-title-top">
220
+                <View className="text-box-content-title-top-title">
221
+                  商品标题
222
+                </View>
223
+                <View
224
+                  onClick={this.handleCopyTitle}
225
+                  className="text-box-content-title-top-copy"
226
+                >
227
+                  复制标题
228
+                </View>
229
+              </View>
230
+              {/* 分享标题输入框 */}
231
+              <View className="text-box-content-title-input">
232
+                <Input
233
+                  onInput={this.handleShareTitleChange}
234
+                  className="input"
235
+                  value={this.state.shareTitle}
236
+                />
237
+              </View>
238
+            </View>
239
+            {/* 商品链接盒子 */}
240
+            <View className="text-box-content-link">
241
+              <View className="text-box-content-link-top">
242
+                <View className="text-box-content-link-top-title">
243
+                  商品链接
244
+                </View>
245
+              </View>
246
+              {/* 商品链接 */}
247
+              <View className="text-box-content-link-bottom">
248
+                <Input
249
+                  onInput={this.handleShareTitleChange}
250
+                  className="linkInput"
251
+                  value={this.state.share_scheme_link}
252
+                  disabled
253
+                />
254
+                <View className="copy-box">
255
+                  <View className="copy-box-line"></View>
256
+                  <Image
257
+                    onClick={this.handleCopyLink}
258
+                    className="copy-box-icon"
259
+                    src="https://yushi.tos-cn-beijing.volces.com/productDetail/copy.png"
260
+                  />
261
+                </View>
262
+              </View>
263
+            </View>
264
+          </View>
265
+        </View>
266
+        {/* 分享按钮 */}
267
+        {this.state.shareJump && (
268
+          <Button
269
+            className="share-button"
270
+            openType="share"
271
+            onClick={this.handleShare}
272
+          >
273
+            直接分享商品卡片到聊天框
274
+          </Button>
275
+        )}
276
+      </View>
277
+    );
278
+  }
279
+}

+ 232 - 0
src/pages/indexSub/sharePage/index.less

@@ -0,0 +1,232 @@
1
+.index {
2
+    // background: linear-gradient(180deg, #faeb5d 0%, rgba(250, 238, 116, 0) 573px);
3
+    background-color: #f9f9f9;
4
+    min-height: 100vh;
5
+    padding: 30px 16px 0 16px;
6
+    box-sizing: border-box;
7
+
8
+    // 图片素材盒子
9
+    .image-box {
10
+        padding: 21px 0 43px 20px;
11
+        box-sizing: border-box;
12
+        background-color: #fff;
13
+        border-radius: 34px;
14
+
15
+        // 图片素材盒子顶部
16
+        .image-box-top {
17
+            display: flex;
18
+            justify-content: space-between;
19
+            align-items: center;
20
+            margin-bottom: 24px;
21
+            padding-right: 20px;
22
+
23
+            .image-box-title {
24
+                font-weight: 700;
25
+                font-size: 32px;
26
+                color: #000000;
27
+            }
28
+
29
+            .image-box-save {
30
+                width: 156px;
31
+                height: 60px;
32
+                border-radius: 70px;
33
+                background-color: #FFECCA;
34
+                color: #F48106;
35
+                font-size: 24px;
36
+                line-height: 60px;
37
+                text-align: center;
38
+            }
39
+        }
40
+
41
+        // 图片素材盒子内容
42
+        .image-box-content {
43
+            display: flex;
44
+            flex-wrap: nowrap;
45
+            overflow-x: scroll;
46
+
47
+            .image-box-content-item {
48
+                width: 240px;
49
+                height: 240px;
50
+                border-radius: 40px;
51
+                margin-right: 20px;
52
+                background-color: #f7f8fa;
53
+                flex-shrink: 0;
54
+            }
55
+        }
56
+    }
57
+
58
+    // 文案素材盒子
59
+    .text-box {
60
+        margin-top: 40px;
61
+
62
+        .text-box-top {
63
+            display: flex;
64
+            justify-content: space-between;
65
+            align-items: center;
66
+            margin-bottom: 24px;
67
+            padding: 0 20px;
68
+
69
+            .text-box-title {
70
+                font-weight: 700;
71
+                font-size: 32px;
72
+                color: #000000;
73
+            }
74
+
75
+            .text-box-save {
76
+                width: 198px;
77
+                height: 60px;
78
+                line-height: 60px;
79
+                text-align: center;
80
+                border-radius: 70px;
81
+                background-color: #FFECCA;
82
+                color: #FF8400;
83
+                font-size: 26px;
84
+            }
85
+        }
86
+
87
+        // 文案素材盒子内容
88
+        .text-box-content {
89
+            padding: 31px 20px;
90
+            box-sizing: border-box;
91
+            background-color: #fff;
92
+            border-radius: 34px;
93
+
94
+            // 商品标题
95
+            .text-box-content-title {
96
+                display: flex;
97
+                flex-direction: column;
98
+                justify-content: space-between;
99
+                margin-bottom: 24px;
100
+
101
+                .text-box-content-title-top {
102
+                    width: 100%;
103
+                    display: flex;
104
+                    justify-content: space-between;
105
+                    align-items: center;
106
+                    padding: 0 22px 0 10px;
107
+                    box-sizing: border-box;
108
+
109
+                    .text-box-content-title-top-title {
110
+                        font-size: 30px;
111
+                        color: #333;
112
+                    }
113
+
114
+                    .text-box-content-title-top-copy {
115
+                        font-size: 24px;
116
+                        color: #F48106;
117
+                    }
118
+                }
119
+
120
+                .text-box-content-title-input {
121
+                    margin-top: 30px;
122
+                    border: 4px solid #F6C71A;
123
+                    border-radius: 34px;
124
+                    overflow: hidden;
125
+                    .input {
126
+                        width: 100%;
127
+                        height: 94px;
128
+                        border-radius: 34px;
129
+                        padding-left: 24px;
130
+                        padding-right: 24px;
131
+                        font-size: 28px;
132
+                        color: #999999;
133
+                        box-sizing: border-box;
134
+                    }
135
+                }
136
+            }
137
+
138
+            // 商品链接
139
+            .text-box-content-link {
140
+                display: flex;
141
+                flex-direction: column;
142
+                justify-content: space-between;
143
+
144
+                .text-box-content-link-top {
145
+                    padding-left: 10px;
146
+
147
+                    .text-box-content-link-top-title {
148
+                        font-size: 30px;
149
+                        color: #333;
150
+                    }
151
+                }
152
+
153
+                .text-box-content-link-bottom {
154
+                    position: relative;
155
+                    margin-top: 30px;
156
+
157
+                    .copy-box {
158
+                        position: absolute;
159
+                        right: 19px;
160
+                        top: 50%;
161
+                        transform: translateY(-50%);
162
+                        display: flex;
163
+                        align-items: center;
164
+
165
+                        .copy-box-line {
166
+                            width: 1px;
167
+                            height: 54px;
168
+                            background-color: #FF8119;
169
+                            margin-right: 39px;
170
+                        }
171
+
172
+                        .copy-box-icon {
173
+                            width: 34px;
174
+                            height: 34px;
175
+                        }
176
+                    }
177
+                }
178
+
179
+                .linkInput {
180
+                    width: 100%;
181
+                    height: 94px;
182
+                    border-radius: 34px;
183
+                    border: none;
184
+                    padding-left: 24px;
185
+                    padding-right: 110px;
186
+                    font-size: 28px;
187
+                    box-sizing: border-box;
188
+                    color: #999999;
189
+                    background-color: #f7f8fa;
190
+                }
191
+            }
192
+        }
193
+    }
194
+
195
+    // 清除Button默认样式
196
+    Button {
197
+        padding: 0;
198
+        margin: 0;
199
+        background: none;
200
+        border: none;
201
+        line-height: normal;
202
+        height: 100%;
203
+        width: 100%;
204
+        display: flex;
205
+        flex-direction: column;
206
+        align-items: center;
207
+        justify-content: center;
208
+        font-size: 28px;
209
+        color: #FFFFFF;
210
+
211
+        &::after {
212
+            border: none;
213
+        }
214
+    }
215
+
216
+    .share-button {
217
+        position: fixed;
218
+        bottom: 30px;
219
+        left: 50%;
220
+        transform: translateX(-50%);
221
+        width: calc(100% - 44px);
222
+        height: 88px;
223
+        border-radius: 160px;
224
+        background-color: #F6C71A;
225
+        font-weight: 700;
226
+        font-size: 30px;
227
+        color: #3D3D3D;
228
+        display: flex;
229
+        justify-content: center;
230
+        align-items: center;
231
+    }
232
+}

+ 32 - 29
src/pages/login/index.jsx

@@ -6,7 +6,6 @@ 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";
9
-import loginBg from "../../images/loginBg.png";
10 9
 export default class Index extends Component {
11 10
   state = {
12 11
     isChecked: false,
@@ -28,7 +27,7 @@ export default class Index extends Component {
28 27
       url: "/pages/mineSub/userSpecification/index",
29 28
     });
30 29
   };
31
-  
30
+
32 31
   // handleGetPhoneNumber = (e) => {
33 32
   //   if (e.detail.errMsg === "getPhoneNumber:ok") {
34 33
   //     // 处理获取到的手机号信息
@@ -67,34 +66,38 @@ export default class Index extends Component {
67 66
           icon: "none",
68 67
         });
69 68
 
70
-        // 先处理分享跳转
71
-        let shareJump = Taro.getStorageSync("shareJump");
72
-        if (shareJump) {
73
-          await bindShareJump({
74
-            share_unique_value: shareJump,
75
-            share_type: 1,
76
-          });
77
-          Taro.removeStorageSync("shareJump");
78
-          if (global.globalData.optionsData) {
79
-            delete global.globalData.optionsData.shareJump;
69
+        // 获取用户信息
70
+        getUserInfo().then(userInfoRes => {
71
+          Taro.setStorageSync("userInfo", userInfoRes);
72
+        });
73
+        try {
74
+          // 先处理分享跳转
75
+          let shareJump = Taro.getStorageSync("shareJump");
76
+          let shareType = Taro.getStorageSync("shareType");
77
+          if (shareJump) {
78
+            await bindShareJump({
79
+              share_unique_value: shareJump,
80
+              share_type: shareType || 2,
81
+            });
82
+            Taro.removeStorageSync("shareJump");
83
+            Taro.removeStorageSync("shareType");
84
+            if (global.globalData.optionsData) {
85
+              delete global.globalData.optionsData.shareJump;
86
+              delete global.globalData.optionsData.share_unique_value;
87
+            }
80 88
           }
89
+        } finally {
90
+          // 最后处理页面跳转
91
+          let lastPage = Taro.getStorageSync("currentPage");
92
+          if (!lastPage || lastPage === "pages/mineSub/login/index") {
93
+            lastPage = "pages/index/index";
94
+          }
95
+          await Taro.reLaunch({
96
+            url: `/${lastPage}?${objToParam(global.globalData.optionsData)}`,
97
+          });
98
+          Taro.removeStorageSync("currentPage");
99
+          global.globalData.optionsData = {};
81 100
         }
82
-
83
-        // 再获取用户信息
84
-        const userInfoRes = await getUserInfo();
85
-        Taro.setStorageSync("userInfo", userInfoRes);
86
-
87
-        // 最后处理页面跳转
88
-        
89
-        let lastPage = Taro.getStorageSync("currentPage");
90
-        if (!lastPage || lastPage === "pages/mineSub/login/index") {
91
-          lastPage = "pages/index/index";
92
-        }
93
-        await Taro.reLaunch({
94
-          url: `/${lastPage}?${objToParam(global.globalData.optionsData)}`,
95
-        });
96
-        Taro.removeStorageSync("currentPage");
97
-        global.globalData.optionsData = {};
98 101
       },
99 102
     });
100 103
   };
@@ -134,7 +137,7 @@ export default class Index extends Component {
134 137
             授权登录
135 138
           </Button>
136 139
         </View>
137
-        <Image src={loginBg} className="login-bg" />
140
+        <Image src='https://yushi.tos-cn-beijing.volces.com/login/loginBg.png' className="login-bg" />
138 141
       </View>
139 142
     );
140 143
   }

+ 175 - 44
src/pages/member/index.jsx

@@ -1,7 +1,7 @@
1 1
 import { Component } from "react";
2 2
 import { View, Text, Image } from "@tarojs/components";
3 3
 import { AtIcon } from "taro-ui";
4
-import { getVipInfo } from "../../service";
4
+import { getVipInfo, getUserAgreement } from "../../service";
5 5
 import { get_my_worker_info } from "../../service/money_api";
6 6
 import Taro from "@tarojs/taro";
7 7
 import "./index.less";
@@ -11,18 +11,28 @@ import toDetail from "../../images/member/toDetail.png";
11 11
 import warning from "../../images/member/warning.png";
12 12
 import withdrawable from "../../images/member/withdrawable.png";
13 13
 import order from "../../images/member/order.png";
14
-import avatar from "../../images/mine/avatar.png";
15 14
 import partner from "../../images/member/myPartner.png";
15
+import calculator from "../../images/member/calculator.png";
16
+import InstructionModal from "../../components/instructionModal";
16 17
 export default class Index extends Component {
17 18
   state = {
18 19
     vipInfo: {
19
-      users: { name: "去登录", icon: avatar },
20
+      users: { name: "去登录", icon: 'https://yushi.tos-cn-beijing.volces.com/mine/avatar.png',user_identity_translate:0 },//user_identity_translate 0:默认未认证,1:已认证成功,2:认证失败,3:认证中
20 21
       earnings: { store_earnings_now: 0, store_earnings_all: 0 },
21 22
       draw_money: { store_earnings_now: 0 },
22 23
       partner: { partner_direct_cnt: 0 },
23
-      order: { order_all: 0, order_promotion: 0, order_pay: 0, unissued_order_cnt: 0, on_arrival_order_cnt: 0, dead_order_cnt: 0 },
24
+      order: {
25
+        order_all: 0,
26
+        order_promotion: 0,
27
+        order_pay: 0,
28
+        unissued_order_cnt: 0,
29
+        on_arrival_order_cnt: 0,
30
+        dead_order_cnt: 0,
31
+      },
24 32
     }, //会员信息
25
-    isAlipay: true,//是否签约
33
+    isAlipay: true, //是否签约
34
+    isInstructionModal: false, //是否显示伙伴说明弹窗
35
+    userAgreement: "", //会员规则
26 36
   };
27 37
 
28 38
   // 获取签约信息
@@ -30,10 +40,10 @@ export default class Index extends Component {
30 40
     const res = await get_my_worker_info();
31 41
     if (res.data.length == 0) {
32 42
       this.setState({
33
-        isAlipay: false
34
-      })
43
+        isAlipay: false,
44
+      });
35 45
     }
36
-  }
46
+  };
37 47
 
38 48
   // 获取会员首页数据
39 49
   getVipInfo = async () => {
@@ -42,6 +52,22 @@ export default class Index extends Component {
42 52
       vipInfo: res,
43 53
     });
44 54
   };
55
+  // 获取会员规则
56
+  getUserAgreement = async () => {
57
+    const res = await getUserAgreement({
58
+      type: 4,
59
+    });
60
+    this.setState({
61
+      userAgreement: res.content,
62
+    });
63
+  };
64
+  // 打开伙伴说明弹窗
65
+  handleInstructionModal = () => {
66
+    this.setState({
67
+      isInstructionModal: true,
68
+    });
69
+  };
70
+
45 71
   // 去登录
46 72
   Login = () => {
47 73
     if (!Taro.getStorageSync("session_key")) {
@@ -50,17 +76,44 @@ export default class Index extends Component {
50 76
       });
51 77
     }
52 78
   };
53
-  componentDidShow () {
79
+  componentDidShow() {
54 80
     if (Taro.getStorageSync("session_key")) {
55 81
       this.getVipInfo(); //获取会员首页数据
56 82
       this.getWorkerInfo(); //获取签约信息
57 83
     }
84
+    this.getUserAgreement(); //获取会员规则
58 85
   }
86
+  // 我的小店
87
+  handleShopClick = () => {
88
+    Taro.navigateTo({
89
+      url: `/pages/memberSub/storeManagement/index?isManager=${true}`,
90
+    });
91
+    Taro.requestSubscribeMessage({
92
+      tmplIds: ["vAYG7hbNbsD75YHpmGvF8O_Pve_1Q5AvnLBd-2JF9ys"],
93
+      success: function (res) {
94
+        console.log(res);
95
+      },
96
+    });
97
+  };
98
+  // 去我的伙伴
99
+  handlePartnerClick = () => {
100
+    Taro.navigateTo({
101
+      url: `/pages/memberSub/myPartner/index`,
102
+    });
103
+    Taro.requestSubscribeMessage({
104
+      tmplIds: ["vAYG7hbNbsD75YHpmGvF8O_Pve_1Q5AvnLBd-2JF9ys"],
105
+      success: function (res) {
106
+        console.log(res);
107
+      },
108
+    });
109
+  };
59 110
   // 去订单列表
60 111
   handleOrderClick = (type) => {
61
-    Taro.navigateTo({ url: `/pages/memberSub/earningsOrder/index?type=${type}` });
62
-  }
63
-  render () {
112
+    Taro.navigateTo({
113
+      url: `/pages/memberSub/earningsOrder/index?type=${type}`,
114
+    });
115
+  };
116
+  render() {
64 117
     const { vipInfo } = this.state;
65 118
     return (
66 119
       <View className="member">
@@ -76,7 +129,9 @@ export default class Index extends Component {
76 129
               />
77 130
 
78 131
               <View className="member-info-card-header-text">
79
-                <Text onClick={this.Login} className="user-name">{vipInfo.users.name}</Text>
132
+                <Text onClick={this.Login} className="user-name">
133
+                  {vipInfo.users.name}
134
+                </Text>
80 135
 
81 136
                 <View className="member-info-card-header-text-level">
82 137
                   <Text className="level-text">店长</Text>
@@ -84,17 +139,27 @@ export default class Index extends Component {
84 139
                 </View>
85 140
               </View>
86 141
             </View>
87
-            {/* 我的小店 */}
88
-            <View
89
-              onClick={() =>
90
-                Taro.navigateTo({
91
-                  url: `/pages/memberSub/storeManagement/index?isManager=${true}`,
92
-                })
93
-              }
94
-              className="my-shop"
95
-            >
96
-              <Image className="my-shop-icon" src={home} />
97
-              <View className="my-shop-text">我的小店</View>
142
+            <View className="member-info-card-content">
143
+              {/* 捡漏计算器 */}
144
+              <View
145
+                onClick={() =>
146
+                  Taro.navigateTo({
147
+                    url: "/pages/calculatorSub/calculator/index",
148
+                  })
149
+                }
150
+                className="my-shop"
151
+              >
152
+                <Image className="my-shop-icon" src={calculator} />
153
+                <View className="my-shop-text">捡漏计算器</View>
154
+              </View>
155
+              {/* 我的小店 */}
156
+              <View
157
+                onClick={() => this.handleShopClick()}
158
+                className="my-shop"
159
+              >
160
+                <Image className="my-shop-icon" src={home} />
161
+                <View className="my-shop-text">我的小店</View>
162
+              </View>
98 163
             </View>
99 164
           </View>
100 165
           {/* 预估收益 */}
@@ -116,7 +181,14 @@ export default class Index extends Component {
116 181
                 <Text className="label">累计收益</Text>
117 182
               </View>
118 183
             </View>
119
-            <view onClick={() => Taro.navigateTo({ url: `/pages/memberSub/earningsDetail/index` })} className="estimated-income-detail">
184
+            <view
185
+              onClick={() =>
186
+                Taro.navigateTo({
187
+                  url: `/pages/memberSub/earningsDetail/index`,
188
+                })
189
+              }
190
+              className="estimated-income-detail"
191
+            >
120 192
               收益详情
121 193
               <Image className="to-detail" src={toDetail} />
122 194
             </view>
@@ -133,16 +205,21 @@ export default class Index extends Component {
133 205
                 <Text className="amount">
134 206
                   {`¥ ${vipInfo.draw_money.store_earnings_now}`}
135 207
                 </Text>
136
-                {
137
-                  !this.state.isAlipay &&
208
+                {(!this.state.isAlipay || vipInfo.users.user_identity_translate != 1) && (
138 209
                   <View className="warning-icon-box">
139 210
                     <Image className="warning-icon" src={warning} />
140
-                    <Text className="warning-text">未完成提现认证</Text>
211
+                    <Text className="warning-text">{vipInfo.users.user_identity_translate == 2 ? '认证失败' : vipInfo.users.user_identity_translate == 0 ? '未完成提现认证' : '认证中'}</Text>
141 212
                   </View>
213
+                )}
214
+              </View>
215
+              <View
216
+                onClick={() =>
217
+                  Taro.navigateTo({ url: `/pages/memberSub/cashOut/index` })
142 218
                 }
143
-
219
+                className="right"
220
+              >
221
+                点击提现
144 222
               </View>
145
-              <View onClick={() => Taro.navigateTo({ url: `/pages/memberSub/cashOut/index` })} className="right">点击提现</View>
146 223
             </View>
147 224
           </View>
148 225
           {/* 我的伙伴 */}
@@ -152,15 +229,36 @@ export default class Index extends Component {
152 229
                 <Image className="my-partner-icon" src={partner} />
153 230
                 <Text className="my-partner-title">我的伙伴</Text>
154 231
               </View>
155
-              <View onClick={() => Taro.navigateTo({ url: `/pages/memberSub/myPartner/index` })} className="my-partner-header-right">
232
+              <View
233
+                onClick={() => this.handlePartnerClick()}
234
+                className="my-partner-header-right"
235
+              >
156 236
                 查看更多
157
-                <AtIcon value='chevron-right' size='10' color='#A1A1A1'></AtIcon>
237
+                <AtIcon
238
+                  value="chevron-right"
239
+                  size="10"
240
+                  color="#A1A1A1"
241
+                ></AtIcon>
158 242
               </View>
159 243
             </View>
160 244
             <View className="my-partner-content">
161
-              <View onClick={() => Taro.navigateTo({ url: `/pages/memberSub/myPartner/index` })} className="my-partner-item">
245
+              {this.state.userAgreement && (
246
+                <Image
247
+                  onClick={() => this.handleInstructionModal()}
248
+                  className="partnerExplain"
249
+                  src="https://yushi.tos-cn-beijing.volces.com/calculator/partnerExplain.png"
250
+                />
251
+              )}
252
+              <View
253
+                onClick={() =>
254
+                  Taro.navigateTo({ url: `/pages/memberSub/myPartner/index` })
255
+                }
256
+                className="my-partner-item"
257
+              >
162 258
                 <Text className="label">直接伙伴</Text>
163
-                <Text className="number">{vipInfo.partner?.partner_direct_cnt || 0}</Text>
259
+                <Text className="number">
260
+                  {vipInfo.partner?.partner_direct_cnt || 0}
261
+                </Text>
164 262
               </View>
165 263
               {/* <View className="my-partner-item">
166 264
                 <Text className="label">间接伙伴</Text>
@@ -175,9 +273,16 @@ export default class Index extends Component {
175 273
                 <Image className="today-order-icon" src={order} />
176 274
                 <Text className="today-order-title">今日订单</Text>
177 275
               </View>
178
-              <View onClick={() => this.handleOrderClick(2)} className="today-order-header-right">
276
+              <View
277
+                onClick={() => this.handleOrderClick(2)}
278
+                className="today-order-header-right"
279
+              >
179 280
                 历史订单
180
-                <AtIcon value='chevron-right' size='10' color='#A1A1A1'></AtIcon>
281
+                <AtIcon
282
+                  value="chevron-right"
283
+                  size="10"
284
+                  color="#A1A1A1"
285
+                ></AtIcon>
181 286
               </View>
182 287
             </View>
183 288
 
@@ -186,29 +291,55 @@ export default class Index extends Component {
186 291
                 <Text className="label">订单总量</Text>
187 292
                 <Text className="amount">{vipInfo.order.order_all}</Text>
188 293
               </View>
189
-              <View className="order-item" onClick={() => this.handleOrderClick(2)}>
294
+              <View
295
+                className="order-item"
296
+                onClick={() => this.handleOrderClick(2)}
297
+              >
190 298
                 <Text className="label">推广订单</Text>
191 299
                 <Text className="amount">{vipInfo.order.order_promotion}</Text>
192 300
               </View>
193
-              <View className="order-item" onClick={() => this.handleOrderClick(2)}>
301
+              <View
302
+                className="order-item"
303
+                onClick={() => this.handleOrderClick(2)}
304
+              >
194 305
                 <Text className="label">已付款订单</Text>
195
-                <Text className="amount">{vipInfo.order.unissued_order_cnt}</Text>
306
+                <Text className="amount">
307
+                  {vipInfo.order.unissued_order_cnt}
308
+                </Text>
196 309
               </View>
197
-              <View className="order-item" onClick={() => this.handleOrderClick(2)}>
310
+              <View
311
+                className="order-item"
312
+                onClick={() => this.handleOrderClick(2)}
313
+              >
198 314
                 <Text className="label">已收货订单</Text>
199
-                <Text className="amount">{vipInfo.order.on_arrival_order_cnt}</Text>
315
+                <Text className="amount">
316
+                  {vipInfo.order.on_arrival_order_cnt}
317
+                </Text>
200 318
               </View>
201
-              <View className="order-item" onClick={() => this.handleOrderClick(2)}>
319
+              {/* <View
320
+                className="order-item"
321
+                onClick={() => this.handleOrderClick(2)}
322
+              >
202 323
                 <Text className="label">已结算订单</Text>
203 324
                 <Text className="amount">{vipInfo.order.order_pay}</Text>
204
-              </View>
205
-              <View className="order-item" onClick={() => this.handleOrderClick(2)}>
325
+              </View> */}
326
+              <View
327
+                className="order-item"
328
+                onClick={() => this.handleOrderClick(2)}
329
+              >
206 330
                 <Text className="label">已失效订单</Text>
207 331
                 <Text className="amount">{vipInfo.order.dead_order_cnt}</Text>
208 332
               </View>
209 333
             </View>
210 334
           </View>
211 335
         </View>
336
+        {/* 使用说明 */}
337
+        <InstructionModal
338
+          title="我的伙伴"
339
+          content={this.state.userAgreement}
340
+          isOpened={this.state.isInstructionModal}
341
+          onClose={() => this.setState({ isInstructionModal: false })}
342
+        />
212 343
       </View>
213 344
     );
214 345
   }

+ 35 - 19
src/pages/member/index.less

@@ -81,29 +81,35 @@
81 81
                 }
82 82
             }
83 83
         }
84
-
85
-        // 我的小店
86
-        .my-shop {
84
+        .member-info-card-content{
85
+            display: flex;
87 86
             width: 100%;
88
-            height: 92px;
87
+            padding: 0 140px;
88
+            box-sizing: border-box;
89 89
             background-color: #fff5dc;
90
-            display: flex;
91
-            align-items: center;
92
-            justify-content: center;
93 90
 
94
-            image {
95
-                height: 30px;
96
-                width: 30px;
97
-                margin-right: 10px;
98
-            }
99
-
100
-            .my-shop-text {
101
-                font-size: 24px;
102
-                color: #000000;
103
-                height: 100%;
91
+            // 我的小店
92
+            .my-shop {
93
+                width: 100%;
94
+                height: 92px;
104 95
                 display: flex;
105 96
                 align-items: center;
106
-                padding-top: 10px;
97
+                justify-content: center;
98
+    
99
+                image {
100
+                    height: 30px;
101
+                    width: 30px;
102
+                    margin-right: 10px;
103
+                }
104
+    
105
+                .my-shop-text {
106
+                    font-size: 24px;
107
+                    color: #000000;
108
+                    height: 100%;
109
+                    display: flex;
110
+                    align-items: center;
111
+                    height: fit-content;
112
+                }
107 113
             }
108 114
         }
109 115
     }
@@ -293,6 +299,15 @@
293 299
             display: flex;
294 300
             justify-content: space-between;
295 301
             align-items: center;
302
+            position: relative;
303
+            .partnerExplain{
304
+                position: absolute;
305
+                width: 31px;
306
+                height: 40px;
307
+                right: 30px;
308
+                top: 50%;
309
+                transform: translateY(-50%);
310
+            }
296 311
             .my-partner-item{
297 312
                 flex: 1;
298 313
                 text-align: center;
@@ -311,6 +326,7 @@
311 326
                     color: #000000;
312 327
                     line-height: 40px;
313 328
                 }
329
+
314 330
             }
315 331
         }
316 332
     }   
@@ -354,7 +370,7 @@
354 370
             padding: 27px 20px 0 20px;
355 371
             box-sizing: border-box;
356 372
             display: flex;
357
-            justify-content: space-between;
373
+            // justify-content: space-between;
358 374
             align-items: center;
359 375
             flex-wrap: wrap;
360 376
             .order-item {

+ 16 - 7
src/pages/memberSub/Alipay/index.jsx

@@ -21,7 +21,11 @@ export default class Index extends Component {
21 21
     isLoading: false, // 是否加载中
22 22
     isAlipay: false, // 是否已绑定支付宝
23 23
     isBank: false, // 是否已绑定银行卡
24
-    signImg: "https://video-img.fyshark.com/1735033624483%E5%B7%B2%E7%AD%BE%E7%BA%A6.png", // 签约码
24
+    status_text: '', // 状态文案
25
+    status: 0, // 状态 0:默认未认证,1:已认证成功,2:认证失败,3:认证中
26
+    signImg: "https://yushi.tos-cn-beijing.volces.com/mine/shenhezhong.png", // 审核中签约
27
+    singnImgFail:'https://yushi.tos-cn-beijing.volces.com/mine/shenheshibai.png',// 审核失败签约
28
+    signImgSuccess: "https://video-img.fyshark.com/1735033624483%E5%B7%B2%E7%AD%BE%E7%BA%A6.png", // 审核成功签约
25 29
   };
26 30
 
27 31
   componentDidMount () {
@@ -41,7 +45,9 @@ export default class Index extends Component {
41 45
             idCardFront: item.portrait_page,
42 46
             idCardBack: item.national_emblem_page,
43 47
             account: item.bank_no,
44
-            isAlipay: true
48
+            isAlipay: true,
49
+            status_text: item.status_text,
50
+            status: item.status
45 51
           });
46 52
         } else {
47 53
           this.setState({
@@ -51,7 +57,9 @@ export default class Index extends Component {
51 57
             idCardFront: item.portrait_page,
52 58
             idCardBack: item.national_emblem_page,
53 59
             bankCard: item.bank_no,
54
-            isBank: true
60
+            isBank: true,
61
+            status_text: item.status_text,
62
+            status: item.status
55 63
           });
56 64
         }
57 65
       });
@@ -227,7 +235,7 @@ export default class Index extends Component {
227 235
   }
228 236
   // 是否已绑定
229 237
   isBind () {
230
-    return (this.state.isAlipay && this.state.type === 'alipay') || (this.state.isBank && this.state.type === 'bank')
238
+    return (this.state.isAlipay && this.state.type === 'alipay') || (this.state.isBank && this.state.type === 'bank'&&this.state.status != 2)
231 239
   }
232 240
   render () {
233 241
     return (
@@ -312,12 +320,13 @@ export default class Index extends Component {
312 320
           }
313 321
         </View>
314 322
         {
315
-          this.isBind() &&
323
+          (this.isBind() || this.state.status == 2) &&
316 324
           <View className="alipay-info-tips">
317 325
             <View className="alipay-info-tips-item">
318
-              <Image src={this.state.signImg} className="alipay-info-tips-item-icon" />
326
+              <Image src={this.state.status == '1' ? this.state.signImgSuccess : this.state.status == '2' ? this.state.singnImgFail : this.state.signImg} className="alipay-info-tips-item-icon" />
319 327
               <View className="alipay-info-tips-item-text">
320
-                如需更改,请联系客服
328
+                {/* 如需更改,请联系客服 */}
329
+                {this.state.status_text}
321 330
               </View>
322 331
             </View>
323 332
           </View>

+ 22 - 15
src/pages/memberSub/earningsDetail/index.jsx

@@ -28,54 +28,61 @@ export default class Index extends Component {
28 28
           <View className='earnings-list-item'>
29 29
             <View className='item-line title-one'>
30 30
               <Text className='title'>今天预估总收益</Text>
31
-              <Text className='money'>¥{today_data.assess_amount || '0.00'}</Text>
31
+              <Text className='money'>¥{Number(today_data.assess_amount_text_all)/100 || '0.00'}</Text>
32 32
             </View>
33 33
             <View className='dotted-line'></View>
34 34
             <View className='item-line title-two'>
35 35
               <Text className='title'>预估推广收益</Text>
36
-              <Text className='money'>¥{today_data.assess_amount || '0.00'}</Text>
36
+              <Text className='money'>¥{Number(today_data.assess_amount_text_promotion)/100 || '0.00'}</Text>
37
+            </View>
38
+            <View className='item-line title-two'>
39
+              <Text className='title'>预估自购收益</Text>
40
+              <Text className='money'>¥{Number(today_data.assess_amount_text_buy)/100 || '0.00'}</Text>
37 41
             </View>
38 42
           </View>
39 43
           <View className='earnings-list-item'>
40 44
             <View className='item-line title-one'>
41 45
               <Text className='title'>本月预估总收益</Text>
42
-              <Text className='money'>¥{this_month_data.assess_amount || '0.00'}</Text>
46
+              <Text className='money'>¥{Number(this_month_data.assess_amount_text_all)/100 || '0.00'}</Text>
43 47
             </View>
44 48
             <View className='dotted-line'></View>
45 49
             <View className='item-line title-two'>
46 50
               <Text className='title'>预估推广收益</Text>
47
-              <Text className='money'>¥{this_month_data.assess_amount || '0.00'}</Text>
51
+              <Text className='money'>¥{Number(this_month_data.assess_amount_text_promotion)/100 || '0.00'}</Text>
48 52
             </View>
49
-            {/* <View className='line'></View>
50 53
             <View className='item-line title-two'>
51
-              <Text className='title'>预估推广收益</Text>
52
-              <Text className='money'>¥70.00</Text>
54
+              <Text className='title'>预估自购收益</Text>
55
+              <Text className='money'>¥{Number(this_month_data.assess_amount_text_buy)/100 || '0.00'}</Text>
53 56
             </View>
54
-            <View className='item-line'>
55
-              <Text className='title'>惊喜红包</Text>
56
-              <Text className='money'>¥70.00</Text>
57
-            </View> */}
58 57
           </View>
59 58
           <View className='earnings-list-item'>
60 59
             <View className='item-line title-one'>
61 60
               <Text className='title'>上月预估总收益</Text>
62
-              <Text className='money'>¥{last_month_data.assess_amount || '0.00'}</Text>
61
+              <Text className='money'>¥{Number(last_month_data.assess_amount_text_all)/100 || '0.00'}</Text>
63 62
             </View>
64 63
             <View className='dotted-line'></View>
65 64
             <View className='item-line title-two'>
66 65
               <Text className='title'>预估推广收益</Text>
67
-              <Text className='money'>¥{last_month_data.assess_amount || '0.00'}</Text>
66
+              <Text className='money'>¥{Number(last_month_data.assess_amount_text_promotion)/100 || '0.00'}</Text>
67
+            </View>
68
+            <View className='item-line title-two'>
69
+              <Text className='title'>预估自购收益</Text>
70
+              <Text className='money'>¥{Number(last_month_data.assess_amount_text_buy)/100 || '0.00'}</Text>
68 71
             </View>
69 72
           </View>
70 73
           <View className='earnings-list-item'>
71 74
             <View className='item-line title-one'>
72 75
               <Text className='title'>历史预估总收益</Text>
73
-              <Text className='money'>¥{historical_month_data.assess_amount || '0.00'}</Text>
76
+              <Text className='money'>¥{Number(historical_month_data.assess_amount_text_all)/100 || '0.00'}</Text>
74 77
             </View>
75 78
             <View className='dotted-line'></View>
76 79
             <View className='item-line title-two'>
77 80
               <Text className='title'>预估推广收益</Text>
78
-              <Text className='money'>¥{historical_month_data.assess_amount || '0.00'}</Text>
81
+              <Text className='money'>¥{Number(historical_month_data.assess_amount_text_promotion)/100 || '0.00'}</Text>
82
+            </View>
83
+            <View className='item-line title-two'>
84
+              <Text className='title'>预估自购收益</Text>
85
+              <Text className='money'>¥{Number(historical_month_data.assess_amount_text_buy)/100 || '0.00'}</Text>
79 86
             </View>
80 87
           </View>
81 88
         </View>

+ 28 - 20
src/pages/memberSub/earningsOrder/index.jsx

@@ -15,7 +15,7 @@ export default class Index extends Component {
15 15
     page: 1, //页数
16 16
     loading: false, //加载状态
17 17
     totalPages: 1, // 添加总页数
18
-    isNoMore: false,
18
+    isNoMore: false, // 是否没有更多
19 19
     orderList: [], //订单列表
20 20
     userInfo: {}, //个人信息
21 21
   };
@@ -193,16 +193,23 @@ export default class Index extends Component {
193 193
               <View className="order-info">
194 194
                 <View className="order-details">
195 195
                   <View className="detail-item">
196
-                    <Text className="label">订单编号:</Text>
197
-                    <Text className="value">{item.order_number}</Text>
198
-                    <Text
199
-                      className="copy-text"
200
-                      onClick={() => this.handleCopy(item.order_number)}
201
-                    >
202
-                      复制
203
-                    </Text>
196
+                    <View className="left">
197
+                      <Text className="label">订单编号:</Text>
198
+                      <Text className="value">{item.order_number}</Text>
199
+                      <Text
200
+                        className="copy-text"
201
+                        onClick={() => this.handleCopy(item.order_number)}
202
+                      >
203
+                        复制
204
+                      </Text>
205
+                    </View>
206
+                    <View className="right">
207
+                      <Text className="order-status">
208
+                        {tabList[item.state + 1].title}
209
+                      </Text>
210
+                    </View>
204 211
                   </View>
205
-                  <View className="detail-item">
212
+                  <View className="detail-item fixWidth">
206 213
                     <Text className="label">下单时间:</Text>
207 214
                     <Text className="value">{item.pay_time}</Text>
208 215
                   </View>
@@ -222,16 +229,17 @@ export default class Index extends Component {
222 229
                 />
223 230
                 <View className="product-details">
224 231
                   <Text className="product-name">{item.item_title}</Text>
225
-                  <View className="promotion-info">
226
-                    <View className="tag">预估收入</View>
227
-                    <Text className="amount">
228
-                      ¥
229
-                      {orderType == 2
230
-                        ? item.assess_amount_text_promotion_yuan
231
-                        : item.assess_amount_text_buy_yuan}
232
-                    </Text>
233
-                  </View>
234
-                  <View className="payment-info"></View>
232
+                  {item.state_code != 3 && (
233
+                    <View className="promotion-info">
234
+                      <View className="tag">预估收入</View>
235
+                      <Text className="amount">
236
+                        ¥
237
+                        {orderType == 2
238
+                          ? item.assess_amount_text_promotion_yuan
239
+                          : item.assess_amount_text_buy_yuan}
240
+                      </Text>
241
+                    </View>
242
+                  )}
235 243
                   <View className="payment-info">
236 244
                     <Text className="label">实付金额:</Text>
237 245
                     <Text className="amount">¥{item.actual_paid_fee}</Text>

+ 39 - 22
src/pages/memberSub/earningsOrder/index.less

@@ -2,6 +2,7 @@
2 2
     background-color: #f9f9f9; // ... 其他样式 ...
3 3
     min-height: 100vh;
4 4
 }
5
+
5 6
 // 订单类型切换
6 7
 .order-type-switch {
7 8
     display: flex;
@@ -10,6 +11,7 @@
10 11
     padding: 20px 134px 10px 134px;
11 12
     align-items: center;
12 13
     box-sizing: border-box;
14
+
13 15
     .order-type-item {
14 16
         font-size: 30px;
15 17
         color: #999999;
@@ -18,11 +20,13 @@
18 20
         box-sizing: border-box;
19 21
         border-radius: 40px;
20 22
     }
23
+
21 24
     .order-type-item.active {
22 25
         color: #fff;
23 26
         background-color: #fa9703;
24 27
     }
25 28
 }
29
+
26 30
 // tab切换
27 31
 .tab-container {
28 32
     display: flex;
@@ -31,6 +35,7 @@
31 35
     padding: 22px 34px;
32 36
     box-sizing: border-box;
33 37
     align-items: center;
38
+
34 39
     .tab-item {
35 40
         font-size: 26px;
36 41
         color: #000000;
@@ -68,7 +73,7 @@
68 73
         display: flex;
69 74
         align-items: center;
70 75
         border-radius: 14px;
71
-        padding:18px;
76
+        padding: 18px;
72 77
         background-color: #f6f6f6;
73 78
 
74 79
         .search-icon {
@@ -142,32 +147,40 @@
142 147
             justify-content: space-between;
143 148
             padding-bottom: 24px;
144 149
             padding-top: 24px;
150
+
145 151
             .order-details {
152
+                width: 100%;
146 153
                 .detail-item {
147 154
                     display: flex;
148 155
                     align-items: center;
156
+                    justify-content: space-between;
149 157
                     margin-bottom: 8px;
150
-
151
-                    .label {
152
-                        color: #999;
153
-                        font-size: 22px;
154
-                        margin-right: 12px;
155
-                        line-height: 32px;
158
+                    color: #999;
159
+                    font-size: 22px;
160
+                    line-height: 32px;
161
+                    .left{
162
+                        display: flex;
163
+                        align-items: center;
164
+                        .label {
165
+                            margin-right: 12px;
166
+                        }
167
+                        .copy-text {
168
+                            color: #F6C71A;
169
+                            margin-left: 30px;
170
+                        }
156 171
                     }
157
-
158
-                    .value {
159
-                        color: #999;
160
-                        font-size: 22px;
161
-                        line-height: 32px;
162
-                    }
163
-
164
-                    .copy-text {
165
-                        color: #F6C71A;
166
-                        font-size: 22px;
167
-                        margin-left: 30px;
168
-                        line-height: 32px;
172
+                    .right{
173
+                        display: flex;
174
+                        align-items: center;
175
+                        .order-status {
176
+                            font-size: 24px;
177
+                            color: #F6C71A;
178
+                        }
169 179
                     }
170 180
                 }
181
+                .fixWidth{
182
+                    width: fit-content;
183
+                }
171 184
             }
172 185
 
173 186
             .member-info {
@@ -210,6 +223,7 @@
210 223
                 justify-content: space-between;
211 224
 
212 225
                 .product-name {
226
+                    height: 80px;
213 227
                     font-size: 28px;
214 228
                     color: #000000;
215 229
                     line-height: 41px;
@@ -271,17 +285,20 @@
271 285
         }
272 286
     }
273 287
 }
288
+
274 289
 // 加载中
275 290
 .loading {
276 291
     width: 100%;
277 292
     position: relative;
278 293
     height: 60px;
279
-  }
294
+}
295
+
280 296
 // 没有更多
281 297
 .no-more {
282
-    padding:0 33px;
298
+    padding: 0 33px;
283 299
     box-sizing: border-box;
284
-    .at-divider__content{
300
+
301
+    .at-divider__content {
285 302
         background-color: #f9f9f9;
286 303
     }
287 304
 }

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

@@ -1,6 +1,6 @@
1 1
 import { Component } from "react";
2
-import { View } from "@tarojs/components";
3
-import { AtTabs, AtTabsPane } from "taro-ui";
2
+import { View, Input } from "@tarojs/components";
3
+import { AtTabs, AtIcon } from "taro-ui";
4 4
 import "./index.less";
5 5
 import Taro from "@tarojs/taro";
6 6
 import ProductList from "../../../components/index/ProductList";
@@ -19,12 +19,14 @@ export default class Index extends Component {
19 19
     loading: false, //加载状态
20 20
     totalPages: 1, // 添加总页数
21 21
     tabList: [], // 所有闲鱼tags
22
+    value: "", // 搜索
22 23
   };
23 24
   handleClick(value) {
24 25
     this.setState(
25 26
       {
26 27
         current: value,
27 28
         page: 1,
29
+        value: "",
28 30
       },
29 31
       () => {
30 32
         Taro.pageScrollTo({
@@ -47,6 +49,7 @@ export default class Index extends Component {
47 49
       tag_name: this.state.tabList[this.state.current].title,
48 50
       page,
49 51
       page_size: 10,
52
+      search_name: this.state.value,
50 53
     });
51 54
 
52 55
     this.setState((prevState) => ({
@@ -72,6 +75,14 @@ export default class Index extends Component {
72 75
       }
73 76
     );
74 77
   };
78
+  // 输入
79
+  handleChange = (e) => {
80
+    this.setState({ value: e.target.value });
81
+  };
82
+  // 搜索
83
+  handleSearch = () => {
84
+    this.getBrowseShopProductList(true);
85
+  };
75 86
   // 添加商品
76 87
   onAddProduct = (productId, index) => {
77 88
     addShopProduct({
@@ -107,12 +118,37 @@ export default class Index extends Component {
107 118
   render() {
108 119
     return (
109 120
       <View className="index">
110
-        <AtTabs
111
-          scroll
112
-          current={this.state.current}
113
-          tabList={this.state.tabList}
114
-          onClick={this.handleClick.bind(this)}
115
-        ></AtTabs>
121
+        {/* 顶部固定 */}
122
+        <View className="top-fixed">
123
+          <AtTabs
124
+            scroll
125
+            current={this.state.current}
126
+            tabList={this.state.tabList}
127
+            onClick={this.handleClick.bind(this)}
128
+          ></AtTabs>
129
+          {/* 搜索 */}
130
+          <View className="search-container">
131
+            <View className="search-bar">
132
+              <AtIcon
133
+                className="search-icon"
134
+                value="search"
135
+                size="20"
136
+                color="#ACACAC"
137
+              ></AtIcon>
138
+              <Input
139
+                type="text"
140
+                className="search-input"
141
+                placeholder=""
142
+                value={this.state.value}
143
+                onInput={this.handleChange}
144
+              />
145
+              <View onClick={this.handleSearch} className="search-button">
146
+                搜索
147
+              </View>
148
+            </View>
149
+          </View>
150
+        </View>
151
+        {/* 商品列表 */}
116 152
         <ProductList
117 153
           loading={this.state.loading}
118 154
           productList={this.state.productList}

+ 53 - 3
src/pages/memberSub/productClassify/index.less

@@ -1,14 +1,27 @@
1 1
 .index {
2 2
     background-color: #f9f9f9;
3 3
     padding-bottom: 160px;
4
-    padding-top: 80px;
4
+    padding-top: 204px;
5 5
     box-sizing: border-box;
6
-    .at-tabs__header{
6
+
7
+    .top-fixed {
7 8
         position: fixed;
8 9
         top: 0;
9 10
         width: 100%;
10
-        z-index: 1;
11
+        z-index: 999;
12
+        background-color: #fff;
13
+        // .at-tabs__header {
14
+        // }
15
+    }
16
+
17
+    scroll-view ::-webkit-scrollbar {
18
+        appearance: none;
19
+        color: transparent;
20
+        display: none;
21
+        width: 0;
22
+        height: 0;
11 23
     }
24
+
12 25
     .at-tabs__item {
13 26
         color: #787878;
14 27
     }
@@ -21,6 +34,43 @@
21 34
         background-color: #f3e801;
22 35
     }
23 36
 
37
+    // 搜索
38
+    .search-container {
39
+        display: flex;
40
+        align-items: center;
41
+        justify-content: center;
42
+        position: relative;
43
+        background-color: #fff;
44
+        padding: 20px 34px;
45
+
46
+        .search-bar {
47
+            width: 90%;
48
+            display: flex;
49
+            align-items: center;
50
+            border-radius: 14px;
51
+            padding: 18px;
52
+            background-color: #f6f6f6;
53
+
54
+            .search-icon {
55
+                margin-right: 18px;
56
+            }
57
+
58
+            .search-input {
59
+                flex: 1;
60
+                border: none;
61
+                outline: none;
62
+                background-color: transparent;
63
+            }
64
+
65
+            .search-button {
66
+                font-weight: 500;
67
+                font-size: 28px;
68
+                color: #FAA803;
69
+            }
70
+        }
71
+
72
+    }
73
+
24 74
     .bottom-button {
25 75
         width: 100%;
26 76
         height: 88px;

+ 7 - 1
src/pages/memberSub/productManagement/index.less

@@ -17,7 +17,13 @@
17 17
         padding-left: 22px;
18 18
 
19 19
         }
20
-  
20
+        scroll-view ::-webkit-scrollbar {
21
+            appearance: none;
22
+            color: transparent;
23
+            display: none;
24
+            width: 0;
25
+            height: 0;
26
+          }
21 27
         .at-tabs__item {
22 28
           color: #000;
23 29
           font-size: 26px;

+ 113 - 51
src/pages/memberSub/storeManagement/index.jsx

@@ -1,8 +1,15 @@
1 1
 import { Component } from "react";
2 2
 import { View, Text, Image, Button } from "@tarojs/components";
3
-import { AtIcon } from "taro-ui";
3
+import { AtIcon, AtActivityIndicator } from "taro-ui";
4 4
 import "./index.less";
5
-import { getMyShopList, getMyShopDetail, getShareShopDetail, getShareShopProductList, getShareJump,bindShareJump } from "../../../service";
5
+import {
6
+  getMyShopList,
7
+  getMyShopDetail,
8
+  getShareShopDetail,
9
+  getShareShopProductList,
10
+  getShareJump,
11
+  bindShareJump,
12
+} from "../../../service";
6 13
 import storeManagement from "../../../images/storeManagement/storeManagement.png";
7 14
 import storeManagementIcon from "../../../images/storeManagement/storeManagementIcon.png";
8 15
 import ProductCard from "../../../components/ProductCard"; //卡片模块
@@ -17,13 +24,17 @@ export default class Index extends Component {
17 24
     loading: false, //加载状态
18 25
     totalPages: 1, // 添加总页数
19 26
     isShare: false, // 是否是分享进入
20
-    shopId: '', // 店铺id
27
+    shopId: "", // 店铺id
28
+    isNoMore: false, // 是否没有更多
29
+    isShowBack: false, // 是否显示返回
21 30
   };
22 31
   // 获取店铺详情
23 32
   getMyShopDetail = async () => {
24
-    const res = this.state.isShare ? await getShareShopDetail({
25
-      store_id: this.state.shopId
26
-    }) :  await getMyShopDetail();
33
+    const res = this.state.isShare
34
+      ? await getShareShopDetail({
35
+          store_id: this.state.shopId,
36
+        })
37
+      : await getMyShopDetail();
27 38
     this.setState({
28 39
       shopDetail: res,
29 40
     });
@@ -33,37 +44,74 @@ export default class Index extends Component {
33 44
     const { page } = this.state;
34 45
     this.setState({ loading: true });
35 46
 
36
-    const res = this.state.isShare ? await getShareShopProductList({
37
-      store_id: this.state.shopId,
38
-      page,
39
-      page_size: 10,
40
-      tag_name:'全部'
41
-    }) : await getMyShopList({
42
-      page,
43
-      page_size: 10,
44
-      tag_name:'全部'
45
-    });
47
+    const res = this.state.isShare
48
+      ? await getShareShopProductList({
49
+          store_id: this.state.shopId,
50
+          page,
51
+          page_size: 10,
52
+          tag_name: "全部",
53
+        })
54
+      : await getMyShopList({
55
+          page,
56
+          page_size: 10,
57
+          tag_name: "全部",
58
+        });
46 59
 
47 60
     this.setState((prevState) => ({
48
-      productList: isBack ? res.goods_list : [...prevState.productList, ...res.goods_list],
61
+      productList: isBack
62
+        ? res.goods_list
63
+        : [...prevState.productList, ...res.goods_list],
49 64
       totalPages: res.total_pages,
50 65
       loading: false,
66
+      isNoMore: res.total_pages <= page,
51 67
     }));
52 68
   };
53 69
 
54 70
   componentDidShow() {
55
-    const { router } = Taro.getCurrentInstance();
56
-    const params = router.params;
57
-    
58
-    this.setState({
59
-      isManager: JSON.parse(params.isManager), //是否是店长
60
-      isShare: params.isShare||false, // 是否是分享进入
61
-      shopId: params.shopId||'', // 店铺id
62
-    },()=>{
63
-      this.getMyShopDetail(); //获取店铺详情
64
-      this.getMyShopList(true); //获取店铺数据
65
-    });
71
+    const { isManager, shopId, isShare, shareJump,shareType,isShowBack } =
72
+      Taro.getCurrentInstance().router.params || "";
73
+    let session_key = Taro.getStorageSync("session_key");
74
+    this.setState(
75
+      {
76
+        isManager: JSON.parse(isManager), //是否是店长
77
+        isShare: isShare || false, // 是否是分享进入
78
+        shopId: shopId || "", // 店铺id
79
+        isShowBack: isShowBack || false, // 是否显示返回
80
+      },
81
+      () => {
82
+        this.getMyShopDetail(); //获取店铺详情
83
+        this.getMyShopList(true); //获取店铺数据
84
+        if (isShare) {
85
+          // 分享隐藏返回首页
86
+          Taro.hideHomeButton();
87
+        }
88
+        // 获取分享跳转标识
89
+        shareJump &&
90
+          Taro.setStorage({
91
+            key: "shareJump",
92
+            data: shareJump,
93
+          });
94
+        shareType &&
95
+          Taro.setStorage({
96
+            key: "shareType",
97
+            data: shareType,
98
+          });
99
+        if (session_key && shareJump) {
100
+          this.bindShareJump(); //绑定分享跳转标识
101
+        }
102
+      }
103
+    );
66 104
   }
105
+  // 绑定分享跳转标识
106
+  bindShareJump = async () => {
107
+    let shareJump = Taro.getStorageSync("shareJump");
108
+    await bindShareJump({
109
+      share_type: 2,
110
+      share_unique_value: shareJump,
111
+    });
112
+    Taro.removeStorageSync("shareJump");
113
+    Taro.removeStorageSync("shareType");
114
+  };
67 115
   // 页面上拉触底
68 116
   onReachBottom = () => {
69 117
     const { page, totalPages, loading } = this.state;
@@ -82,25 +130,20 @@ export default class Index extends Component {
82 130
   };
83 131
   // 配置分享内容
84 132
   onShareAppMessage() {
85
-    const name = Taro.getStorageSync('userInfo').name;
86
-    return {
87
-      title: `${name}的店铺`,
88
-      path: `/pages/memberSub/storeManagement/index?shopId=${this.state.shopDetail.id}&isShare=true&isManager=false`,
89
-      imageUrl: ''
90
-    }
133
+    const name = Taro.getStorageSync("userInfo").name;
91 134
     return getShareJump({
92
-      share_type:2,
93
-      share_id: this.state.shopDetail.id
94
-    }).then(res=>{
135
+      share_type: 2,
136
+      share_id: this.state.shopDetail.id,
137
+    }).then((res) => {
95 138
       return {
96
-        title: "店铺",
97
-        path: `/pages/memberSub/storeManagement/index?shopId=${this.state.shopDetail.id}&isShare=true&isManager=false&&shareJump=${res.share_unique_value}`,
98
-        imageUrl: ''
99
-      }
100
-    })
139
+        title: `${name||'分享者'}的店铺`,
140
+        path: `/pages/memberSub/storeManagement/index?shopId=${this.state.shopDetail.id}&isShare=true&isManager=false&&shareJump=${res.share_unique_value}&&shareType=2&&isShowBack=true`,
141
+        imageUrl: "",
142
+      };
143
+    });
101 144
   }
102 145
   render() {
103
-    const { shopDetail, productList } = this.state;
146
+    const { shopDetail, productList, loading, isNoMore,isShare } = this.state;
104 147
     return (
105 148
       <View className="index">
106 149
         {/* 头部卡片 */}
@@ -108,12 +151,12 @@ export default class Index extends Component {
108 151
           <Image className="bg-image" src={storeManagement} mode="widthFix" />
109 152
           {/* 分享店铺 */}
110 153
           {!this.state.isShare && (
111
-          <View className="share-shop">
112
-            <Button onClick={this.handleShare} openType="share">
113
-            <Text>分享店铺</Text>
114
-            <AtIcon value="chevron-right" size="10" color="#fff"></AtIcon>
115
-            </Button>
116
-          </View>
154
+            <View className="share-shop">
155
+              <Button openType="share">
156
+                <Text>分享店铺</Text>
157
+                <AtIcon value="chevron-right" size="10" color="#fff"></AtIcon>
158
+              </Button>
159
+            </View>
117 160
           )}
118 161
           {/* 个人信息 */}
119 162
           <View className="user-info">
@@ -123,7 +166,7 @@ export default class Index extends Component {
123 166
                 mode="aspectFill"
124 167
                 src={shopDetail.img_icon}
125 168
               />
126
-              <View className="change-avatar-btn">更换头像</View>
169
+              {/* <View className="change-avatar-btn">更换头像</View> */}
127 170
             </View>
128 171
             <View className="info-content">
129 172
               <Text className="name">{shopDetail.store_name}</Text>
@@ -140,7 +183,7 @@ export default class Index extends Component {
140 183
           {productList && (
141 184
             <View className="product-card-list">
142 185
               {productList.map((product) => (
143
-                <ProductCard key={product.id} product={product} />
186
+                <ProductCard isShowBack={this.state.isShowBack} key={product.id} product={product} isShare={isShare}/>
144 187
               ))}
145 188
             </View>
146 189
           )}
@@ -169,6 +212,25 @@ export default class Index extends Component {
169 212
             </View>
170 213
           )}
171 214
         </View>
215
+        {/* 加载中 */}
216
+        {loading && (
217
+          <View className="loading-container">
218
+            <AtActivityIndicator
219
+              content="加载中..."
220
+              isOpened={loading}
221
+              mode="center"
222
+              color="#fdf764"
223
+            />
224
+          </View>
225
+        )}
226
+        {/* 没有更多 */}
227
+        {isNoMore && (
228
+          <View className="no-more">
229
+            <View className="no-more-line">
230
+              <Text className="no-more-text">我是有底线的</Text>
231
+            </View>
232
+          </View>
233
+        )}
172 234
       </View>
173 235
     );
174 236
   }

+ 107 - 53
src/pages/memberSub/storeManagement/index.less

@@ -4,6 +4,7 @@
4 4
     min-height: 100vh;
5 5
     background-color: #f9f9f9;
6 6
     padding-bottom: 150px;
7
+
7 8
     .header-card {
8 9
         width: 100%;
9 10
         height: 256px;
@@ -84,7 +85,7 @@
84 85
                 font-size: 22px;
85 86
                 line-height: 40px;
86 87
                 margin-right: 7px;
87
-            color: #FFFFFF;
88
+                color: #FFFFFF;
88 89
             }
89 90
         }
90 91
     }
@@ -98,6 +99,7 @@
98 99
         box-sizing: border-box;
99 100
         position: relative;
100 101
         z-index: 1;
102
+
101 103
         .product-list-title {
102 104
             display: flex;
103 105
             flex-direction: column;
@@ -122,59 +124,67 @@
122 124
             }
123 125
         }
124 126
     }
125
-        // 底部购买模块
126
-        .bottom-buy {
127
-            width: 100%;
128
-            background-color: #fff;
129
-            height: 126px;
130
-            padding: 19px 35px 19px 44px;
131
-            box-sizing: border-box;
132
-            position: fixed;
133
-            bottom: 0;
127
+
128
+    // 底部购买模块
129
+    .bottom-buy {
130
+        width: 100%;
131
+        background-color: #fff;
132
+        height: 126px;
133
+        padding: 19px 35px 19px 44px;
134
+        box-sizing: border-box;
135
+        position: fixed;
136
+        bottom: 0;
137
+        display: flex;
138
+        justify-content: space-between;
139
+        align-items: center;
140
+        .bottom-buy-left {
134 141
             display: flex;
135
-            justify-content: space-between;
142
+            flex-direction: column;
136 143
             align-items: center;
137
-            .bottom-buy-left {
144
+
145
+            image {
146
+                width: 36px;
147
+                height: 36px;
148
+                margin-bottom: 7px;
149
+            }
150
+
151
+            .bottom-buy-text {
152
+                font-size: 22px;
153
+                line-height: 32px;
154
+                color: #000000;
155
+            }
156
+        }
157
+
158
+        .bottom-buy-right {
159
+            width: 100%;
160
+            height: 100%;
161
+            display: flex;
162
+            border-radius: 60px;
163
+            overflow: hidden;
164
+
165
+            .bottom-buy-right-self,
166
+            .bottom-buy-right-share {
167
+                line-height: 43px;
168
+                font-size: 30px;
169
+                width: 100%;
138 170
                 display: flex;
139
-                flex-direction: column;
171
+                justify-content: center;
140 172
                 align-items: center;
173
+
141 174
                 image {
142
-                    width: 36px;
143
-                    height: 36px;
144
-                    margin-bottom: 7px;
145
-                }
146
-    
147
-                .bottom-buy-text {
148
-                    font-size: 22px;
149
-                    line-height: 32px;
150
-                    color: #000000;
175
+                    margin-right: 9px;
151 176
                 }
152 177
             }
153
-            .bottom-buy-right {
154
-                width: 100%;
155
-                height: 100%;
156
-                display: flex;
157
-                border-radius: 60px;
158
-                overflow: hidden;
159
-                .bottom-buy-right-self,.bottom-buy-right-share{
160
-                    line-height: 43px;
161
-                    font-size: 30px;
162
-                    width: 100%;
163
-                    display: flex;
164
-                    justify-content: center;
165
-                    align-items: center;
166
-                    image{
167
-                        margin-right: 9px;
168
-                    }
169
-                }
170
-                .bottom-buy-right-self{
171
-                    background-color: #fbe00f;
172
-                    color: #000000;
173
-                }
174
-                .bottom-buy-right-share{
175
-                    background-color: #ff1c14;
176
-                    color: #fff;
177
-                }
178
+
179
+            .bottom-buy-right-self {
180
+                background-color: #fbe00f;
181
+                color: #000000;
182
+            }
183
+
184
+            .bottom-buy-right-share {
185
+                background-color: #ff1c14;
186
+                color: #fff;
187
+            }
178 188
         }
179 189
     }
180 190
 }
@@ -191,11 +201,55 @@ Button {
191 201
     display: flex;
192 202
     justify-content: center;
193 203
     align-items: center;
204
+
194 205
     &::after {
195
-      border: none;
206
+        border: none;
207
+    }
208
+}
209
+
210
+.button-hover {
211
+    background-color: transparent !important;
212
+    /* 移除背景高亮 */
213
+    box-shadow: none !important;
214
+    /* 移除可能的阴影 */
215
+}
216
+// 加载中
217
+.loading-container {
218
+    width: 100%;
219
+    position: relative;
220
+    height: 60px;
221
+}
222
+// 没有更多
223
+.no-more {
224
+    padding: 20px 0;
225
+    
226
+    &-line {
227
+        position: relative;
228
+        text-align: center;
229
+        
230
+        &::before,
231
+        &::after {
232
+            content: '';
233
+            position: absolute;
234
+            top: 50%;
235
+            width: 30%;
236
+            height: 1px;
237
+            background-color: #e5e5e5;
238
+        }
239
+        
240
+        &::before {
241
+            left: 10%;
242
+        }
243
+        
244
+        &::after {
245
+            right: 10%;
246
+        }
247
+    }
248
+    
249
+    &-text {
250
+        display: inline-block;
251
+        padding: 0 15px;
252
+        font-size: 24px;
253
+        color: #949494;
196 254
     }
197
-  }
198
-  .button-hover {
199
-    background-color: transparent !important; /* 移除背景高亮 */
200
-    box-shadow: none !important;             /* 移除可能的阴影 */
201
-  }
255
+}

+ 63 - 17
src/pages/mine/index.jsx

@@ -1,13 +1,12 @@
1 1
 import { Component } from "react";
2 2
 import Taro from "@tarojs/taro";
3
-import { View, Text, Image } from "@tarojs/components";
3
+import { View, Text, Image, Button } from "@tarojs/components";
4 4
 import { AtList, AtListItem } from "taro-ui";
5
-import { getUserInfo } from "../../service";
5
+import { getUserInfo, getMineData } from "../../service";
6 6
 import "./index.less";
7 7
 import loginOut from "../../images/mine/loginOut.png";
8 8
 import edit from "../../images/mine/edit.png";
9 9
 import norm from "../../images/mine/norm.png";
10
-import avatar from "../../images/mine/avatar.png";
11 10
 import sign from "../../images/mine/sign.png";
12 11
 import SignModal from "../../components/signModal";
13 12
 import levelOne from "../../images/mine/levelOne.png";
@@ -18,6 +17,7 @@ import levelFive from "../../images/mine/levelFive.png";
18 17
 export default class Index extends Component {
19 18
   state = {
20 19
     userInfo: {}, //用户信息
20
+    mineData: {}, //我的页面数据
21 21
     isOpened: false, //是否打开弹窗
22 22
   };
23 23
   // 退出登录
@@ -43,6 +43,7 @@ export default class Index extends Component {
43 43
     const session_key = Taro.getStorageSync("session_key");
44 44
     if (session_key) {
45 45
       this.getUserInfo();
46
+      this.getMineData();
46 47
     }
47 48
   }
48 49
   // 获取用户信息
@@ -53,6 +54,13 @@ export default class Index extends Component {
53 54
       userInfo: res,
54 55
     });
55 56
   };
57
+  // 获取我的页面数据
58
+  getMineData = async () => {
59
+    const res = await getMineData();
60
+    this.setState({
61
+      mineData: res,
62
+    });
63
+  };
56 64
   // 去登录
57 65
   Login = () => {
58 66
     if (!Taro.getStorageSync("session_key")) {
@@ -76,13 +84,13 @@ export default class Index extends Component {
76 84
     }
77 85
   };
78 86
   render() {
79
-    const { userInfo, isOpened } = this.state;
87
+    const { userInfo, isOpened, mineData } = this.state;
80 88
     return (
81 89
       <View className="index">
82 90
         {/* 个人信息 */}
83 91
         <View className="info">
84 92
           <Image
85
-            src={userInfo.icon ? userInfo.icon : avatar}
93
+            src={userInfo.icon ? userInfo.icon : 'https://yushi.tos-cn-beijing.volces.com/mine/avatar.png'}
86 94
             className="avatar"
87 95
           />
88 96
           <View className="info-right">
@@ -107,20 +115,21 @@ export default class Index extends Component {
107 115
                       }
108 116
                       className="level-icon"
109 117
                     />
110
-                    <Text 
118
+                    <Text
111 119
                       className="level-text"
112 120
                       style={{
113
-                        color: userInfo.user_identity === 1 
114
-                          ? '#8AA6F1' 
115
-                          : userInfo.user_identity === 2 
116
-                          ? '#0077F6' 
117
-                          : userInfo.user_identity === 3 
118
-                          ? '#7D00E1' 
119
-                          : userInfo.user_identity === 4 
120
-                          ? '#FE585A' 
121
-                          : userInfo.user_identity === 5 
122
-                          ? '#E87D12' 
123
-                          : '#8AA6F1'
121
+                        color:
122
+                          userInfo.user_identity === 1
123
+                            ? "#8AA6F1"
124
+                            : userInfo.user_identity === 2
125
+                            ? "#0077F6"
126
+                            : userInfo.user_identity === 3
127
+                            ? "#7D00E1"
128
+                            : userInfo.user_identity === 4
129
+                            ? "#FE585A"
130
+                            : userInfo.user_identity === 5
131
+                            ? "#E87D12"
132
+                            : "#8AA6F1",
124 133
                       }}
125 134
                     >
126 135
                       Lv {userInfo.user_identity}
@@ -139,6 +148,32 @@ export default class Index extends Component {
139 148
             ></Image>
140 149
           </View>
141 150
         </View>
151
+        {/* <Button onClick={() => Taro.navigateTo({ url: '/pages/indexSub/activity/index' })}>
152
+          活动页面
153
+        </Button> */}
154
+        {/* 我的推荐人 */}
155
+        {mineData.user_relations?.id && (
156
+          <View className="recommend-box">
157
+            <View className="recommend-title">
158
+              <Text className="recommend-title-text">我的推荐人</Text>
159
+            </View>
160
+            <View className="line"></View>
161
+            <View className="recommend-content">
162
+              <Image
163
+                className="recommend-avatar"
164
+                src={mineData.user_relations.icon}
165
+              />
166
+              <View className="recommend-info">
167
+                <Text className="recommend-name">
168
+                  {mineData.user_relations.name}
169
+                </Text>
170
+                <Text className="recommend-id">
171
+                  ID: {mineData.user_relations.id}
172
+                </Text>
173
+              </View>
174
+            </View>
175
+          </View>
176
+        )}
142 177
         {/* 功能 */}
143 178
         <View className="function">
144 179
           <AtList hasBorder={false}>
@@ -160,6 +195,17 @@ export default class Index extends Component {
160 195
               arrow="right"
161 196
               thumb={norm}
162 197
             />
198
+            <AtListItem
199
+              hasBorder={false}
200
+              onClick={() =>
201
+                Taro.navigateTo({
202
+                  url: `/pages/mineSub/explain/index`,
203
+                })
204
+              }
205
+              title="鱼市说明"
206
+              arrow="right"
207
+              thumb='https://yushi.tos-cn-beijing.volces.com/mine/explain.png'
208
+            />
163 209
             {/* <View className="line"></View> */}
164 210
             {/* <AtListItem
165 211
               hasBorder={false}

+ 43 - 0
src/pages/mine/index.less

@@ -74,6 +74,49 @@
74 74
         }
75 75
     }
76 76
 
77
+    // 我的推荐人
78
+    .recommend-box {
79
+        width: 100%;
80
+        background: #FFFFFF;
81
+        border-radius: 20px;
82
+        margin-bottom: 25px;
83
+        padding: 12px 17px 29px 17px;
84
+        box-sizing: border-box;
85
+        font-size: 28px;
86
+        color: #000000;
87
+        .recommend-content {
88
+            display: flex;
89
+            align-items: center;
90
+            .recommend-avatar {
91
+                width: 64px;
92
+                height: 64px;
93
+                border-radius: 50%;
94
+                margin-right: 19px;
95
+                background-color: red;
96
+            }
97
+            .recommend-info {
98
+                display: flex;
99
+                flex-direction: column;
100
+                justify-content: space-between;
101
+                .recommend-name {
102
+                    font-size: 24px;
103
+                    color: #000000;
104
+                    line-height: 35px;
105
+                }
106
+                .recommend-id {
107
+                    font-size: 20px;
108
+                    color: #999999;
109
+                    line-height: 29px;
110
+                }
111
+            }
112
+        }
113
+    }
114
+    .line {
115
+        margin: 17px 0;
116
+        width: 100%;
117
+        height: 1px;
118
+        background-color: #D8D8D8;
119
+    }
77 120
     // 功能
78 121
     .function {
79 122
         border-radius: 20px;

+ 3 - 0
src/pages/mineSub/explain/index.config.js

@@ -0,0 +1,3 @@
1
+export default definePageConfig({
2
+  navigationBarTitleText: '鱼市说明'
3
+})

+ 28 - 0
src/pages/mineSub/explain/index.jsx

@@ -0,0 +1,28 @@
1
+import { Component } from 'react'
2
+import { View, RichText } from '@tarojs/components'
3
+import './index.less'
4
+import { getUserAgreement } from '../../../service'
5
+export default class Index extends Component {
6
+  state = {
7
+    agreement: ''
8
+  }
9
+  componentDidMount () { 
10
+    this.getUserAgreement()
11
+  }
12
+  // 获取用户协议
13
+  getUserAgreement = async () => {
14
+    const res = await getUserAgreement({
15
+      type:2
16
+    })
17
+    this.setState({
18
+      agreement: res.content
19
+    })
20
+  }
21
+  render () {
22
+    return (
23
+      <View className='index'>
24
+        {this.state.agreement && <RichText nodes={this.state.agreement} />}
25
+      </View>
26
+    )
27
+  }
28
+}

+ 6 - 0
src/pages/mineSub/explain/index.less

@@ -0,0 +1,6 @@
1
+.index {
2
+  padding: 20rpx;
3
+  background-color: #f5f5f5;
4
+  min-height: 100vh;
5
+  box-sizing: border-box;
6
+}

+ 56 - 23
src/pages/mineSub/infoEdit/index.jsx

@@ -1,9 +1,9 @@
1 1
 import { Component } from "react";
2
-import { View, Text, Image,Input, Button } from "@tarojs/components";
2
+import { View, Text, Image, Input, Button } from "@tarojs/components";
3 3
 import { AtInput } from "taro-ui";
4 4
 import Taro from "@tarojs/taro";
5
-import { updateUserInfo,getUserInfo } from "../../../service";
6
-import avatar from "../../../images/mine/avatar.png";
5
+import { updateUserInfo, getUserInfo } from "../../../service";
6
+import { baseUrl } from "../../../api/config";
7 7
 import "./index.less";
8 8
 
9 9
 export default class Index extends Component {
@@ -34,11 +34,11 @@ export default class Index extends Component {
34 34
     return value;
35 35
   }
36 36
   // 昵称
37
-  handleNickNameChange(value) {
37
+  handleNickNameChange(res) {
38 38
     this.setState({
39
-      nickName: value,
39
+      nickName: res.detail.value,
40 40
     });
41
-    return value;
41
+    return res.detail.value;
42 42
   }
43 43
   // 手机号
44 44
   handlePhoneChange(value) {
@@ -48,11 +48,32 @@ export default class Index extends Component {
48 48
     return value;
49 49
   }
50 50
   // 选择头像
51
-  handleChooseAvatar = (e) => {
52
-    this.setState({
53
-      avatar: e.detail.avatarUrl,
51
+  handleChooseAvatar = async (e) => {
52
+    Taro.showLoading({
53
+      title: '上传中...',
54
+      mask: true
54 55
     });
55
-  }
56
+    Taro.uploadFile({
57
+      url: baseUrl + '/user/tos_upload_file', // 上传的接口地址
58
+      filePath: e.detail.avatarUrl,
59
+      name: 'file',
60
+      success: (uploadRes) => {
61
+        const data = uploadRes.data;
62
+        Taro.hideLoading();
63
+        this.setState({
64
+          avatar: JSON.parse(data).data.file_url,
65
+        });
66
+      },
67
+      fail: (error) => {
68
+        Taro.hideLoading();
69
+        Taro.showToast({
70
+          title: '上传失败',
71
+          icon: 'none',
72
+        });
73
+        console.log(error, 'error');
74
+      }
75
+    });
76
+  };
56 77
   // 提交
57 78
   handleSubmit = async () => {
58 79
     const phoneRegex = /^1[3-9]\d{9}$/; // 中国大陆手机号正则
@@ -76,15 +97,15 @@ export default class Index extends Component {
76 97
       wechat_account: this.state.wxAccount,
77 98
     });
78 99
     Taro.showToast({
79
-      title: '修改成功',
80
-      icon: 'none',
100
+      title: "修改成功",
101
+      icon: "none",
81 102
       duration: 1000, // 显示持续时间,单位毫秒
82 103
       success: () => {
83 104
         // 等待 toast 显示完成后再返回上一页
84 105
         setTimeout(() => {
85 106
           Taro.navigateBack();
86 107
         }, 1000);
87
-      }
108
+      },
88 109
     });
89 110
   };
90 111
   render() {
@@ -92,36 +113,48 @@ export default class Index extends Component {
92 113
       <View className="index">
93 114
         {/* 头像 */}
94 115
         <View className="info-edit">
95
-          <Image
96
-            src={this.state.avatar||avatar}
97
-            className="info-edit-img"
98
-          />
99
-          {/* <Button onChooseAvatar={this.handleChooseAvatar} open-type="chooseAvatar" className="info-edit-title">更换头像</Button> */}
116
+          <Image src={this.state.avatar || 'https://yushi.tos-cn-beijing.volces.com/mine/avatar.png'} className="info-edit-img" />
117
+          <Button
118
+            onChooseAvatar={this.handleChooseAvatar}
119
+            open-type="chooseAvatar"
120
+            className="info-edit-title"
121
+          >
122
+            更换头像
123
+          </Button>
100 124
         </View>
101 125
         {/* 内容 */}
102 126
         <View className="info-edit-content">
103
-          <AtInput
127
+          {/* <AtInput
104 128
             name="value"
105 129
             title="微信账号"
106 130
             type="text"
107 131
             placeholder="请输入微信账号"
108 132
             value={this.state.wxAccount}
109 133
             onChange={this.handleAccountChange.bind(this)}
110
-          />
134
+          /> */}
111 135
           <AtInput
136
+            className="info-edit-input"
112 137
             name="value"
113 138
             title="鱼市昵称"
114 139
             type="text"
115 140
             placeholder="请输入鱼市昵称"
116
-            value={this.state.nickName}
117
-            onChange={this.handleNickNameChange.bind(this)}
118
-          />
141
+          >
142
+            <Input
143
+              name="value"
144
+              title="鱼市昵称"
145
+              type="nickname"
146
+              placeholder="请输入鱼市昵称"
147
+              value={this.state.nickName}
148
+              onInput={this.handleNickNameChange.bind(this)}
149
+            />
150
+          </AtInput>
119 151
           <AtInput
120 152
             border={false}
121 153
             name="value"
122 154
             title="手机号"
123 155
             type="number"
124 156
             placeholder="请输入手机号"
157
+            placeholderStyle="color: #828282;"
125 158
             value={this.state.phone}
126 159
             onChange={this.handlePhoneChange.bind(this)}
127 160
           />

+ 9 - 0
src/pages/mineSub/infoEdit/index.less

@@ -55,4 +55,13 @@
55 55
         justify-content: center;
56 56
         align-items: center;
57 57
     }
58
+    // 隐藏输入框
59
+    .info-edit-input{
60
+        .at-input__input{
61
+            display: none;
62
+        }
63
+        .at-input__children::after{
64
+            border-left-width: 0;
65
+        }
66
+    }
58 67
 }

+ 2 - 0
src/pages/mineSub/userSpecification/index.less

@@ -1,4 +1,6 @@
1 1
 .index {
2 2
   padding: 20rpx;
3 3
   background-color: #f5f5f5;
4
+  min-height: 100vh;
5
+  box-sizing: border-box;
4 6
 }

+ 54 - 0
src/service/activity.js

@@ -0,0 +1,54 @@
1
+import Request from '../api/request';
2
+// -----------------------------------------------------------捡漏计算器
3
+// 获取捡漏计算机数据展示
4
+export const getCalculatorData = data =>
5
+  Request({
6
+    url: '/activity/get_jianlou_data_show',
7
+    method: 'POST',
8
+    data,
9
+  });
10
+//   获取用户捡漏清单详情
11
+export const getCalculatorDetail = data =>
12
+  Request({
13
+    url: '/activity/get_jianlou_detail',
14
+    method: 'POST',
15
+    data,
16
+  });
17
+//   用户捡漏清单列表
18
+export const getCalculatorList = data =>
19
+  Request({
20
+    url: '/activity/get_jianlou_list',
21
+    method: 'POST',
22
+    data,
23
+  });
24
+//   搜索捡漏计算器
25
+export const getCalculatorSearch = data =>
26
+  Request({
27
+    url: '/activity/search_jianlou_calculator',
28
+    method: 'POST',
29
+    data,
30
+  });
31
+//   捡漏计算器部分数据
32
+export const getCalculatorPartData = data =>
33
+  Request({
34
+    url: '/activity/get_jianlou_calculator',
35
+    method: 'POST',
36
+    data,
37
+  });
38
+//----------------------------------------------活动
39
+// 获取新春专题tab
40
+export const getNewYearTab = data =>
41
+  Request({
42
+    url: '/activity/get_category_tab_data_spring_festival',
43
+    method: 'POST',
44
+    data,
45
+  });
46
+  // 新春商品列表
47
+  export const getNewYearProductList = data =>
48
+  Request({
49
+    url: '/api/get_goods_data_list_recommend_is_index',
50
+    method: 'POST',
51
+    data,
52
+  });
53
+
54
+

+ 9 - 2
src/service/index.js

@@ -36,7 +36,7 @@ export const getProductLikeList = data =>
36 36
     method: 'POST',
37 37
     data,
38 38
   })
39
-// 获取推荐商品列表   (包括鱼市商品 = 120;高佣专属 = 121)
39
+// 获取推荐商品列表
40 40
 export const getRecommendProductList = data =>
41 41
   Request({
42 42
     url: '/api/get_goods_data_list_recommend',
@@ -86,7 +86,7 @@ export const getUserAgreement = data =>
86 86
     method: 'POST',
87 87
     data,
88 88
   })
89
-// 获取分享跳转标识
89
+// 获取分享跳转标识(1:商品;2:店铺 3:专题页)
90 90
 export const getShareJump = data =>
91 91
   Request({
92 92
     url: '/user/get_not_oneself_store_detail',
@@ -100,6 +100,13 @@ export const bindShareJump = data =>
100 100
     method: 'POST',
101 101
     data,
102 102
   })
103
+  // 获取我的页面数据
104
+  export const getMineData = data =>
105
+  Request({
106
+    url: '/user/get_my_page',
107
+    method: 'POST',
108
+    data,
109
+  })
103 110
 // -------------------------------------------------------会员
104 111
 // 获取会员详情
105 112
 export const getVipInfo = data =>