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

订阅消息&&banner跳转&&捡漏计算器bug修改

viczhq пре 4 недеља
родитељ
комит
83b5793063

+ 7 - 0
project.private.config.json

@@ -10,6 +10,13 @@
10 10
     "miniprogram": {
11 11
       "list": [
12 12
         {
13
+          "name": "pages/member/index",
14
+          "pathName": "pages/member/index",
15
+          "query": "",
16
+          "launchMode": "default",
17
+          "scene": null
18
+        },
19
+        {
13 20
           "name": "pages/calculatorSub/calculatorResult/index",
14 21
           "pathName": "pages/calculatorSub/calculatorResult/index",
15 22
           "query": "",

+ 11 - 7
src/components/instructionModal/index.jsx

@@ -3,7 +3,7 @@ import "./index.less";
3 3
 
4 4
 // 签约模态框组件
5 5
 export default function instructionModal(props) {
6
-  const { isOpened, onClose, title, content} = props;
6
+  const { isOpened, onClose, title, content } = props;
7 7
   // 关闭弹窗
8 8
   const closeModal = () => {
9 9
     onClose();
@@ -14,15 +14,19 @@ export default function instructionModal(props) {
14 14
         <View className="modal-container">
15 15
           <View className="modal-mask" />
16 16
           <View className="modal-content">
17
-          <View className="content-box">
18
-            {/* 背景图 */}
19
-              <Image src='https://yushi.tos-cn-beijing.volces.com/member/instructionBg.png' className="instruction-bg" />
20
-              <View className="instruction-title">
21
-                {title}
22
-              </View>
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>
23 25
               <View className="instruction-content">
24 26
                 <RichText nodes={content} />
25 27
               </View>
28
+            </View>
29
+            <View className="instruction-button-box">
26 30
               <View onClick={closeModal} className="instruction-button">
27 31
                 我知道了
28 32
               </View>

+ 45 - 24
src/components/instructionModal/index.less

@@ -27,30 +27,36 @@
27 27
   max-width: 600px;
28 28
   z-index: 1001;
29 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
+  }
30 42
 
31 43
   .content-box {
32
-    min-height: 400px;
33
-    padding: 54px 32px 38px 32px;
44
+    max-height: 70vh;
45
+    padding: 54px 32px 148px 32px;
34 46
     display: flex;
35 47
     flex-direction: column;
36 48
     align-items: center;
37
-    justify-content: center;
49
+    justify-content: flex-start;
38 50
     position: relative;
51
+    overflow-y: auto;
52
+
39 53
 
40
-    // 背景图
41
-    .instruction-bg {
42
-      width: 100%;
43
-      height: 100%;
44
-      position: absolute;
45
-      top: 0;
46
-      left: 0;
47
-      z-index: -1;
48
-    }
49 54
     .instruction-title {
50 55
       font-weight: 700;
51 56
       font-size: 32px;
52 57
       color: #000000;
53 58
     }
59
+
54 60
     .instruction-content {
55 61
       font-size: 28px;
56 62
       color: #3D3D3D;
@@ -58,19 +64,34 @@
58 64
       margin-top: 28px;
59 65
       padding: 0 39px;
60 66
       box-sizing: border-box;
67
+      width: 100%;
61 68
     }
62
-    .instruction-button {
63
-      width: 272px;
64
-      height: 76px;
65
-      background: linear-gradient(270deg, #FF6E39 0%, #FF891B 100%);
66
-      border-radius: 121px 121px 121px 121px;
67
-      font-size: 30px;
68
-      color: #FFFFFF;
69
-      margin-top: 44px;
70
-      display: flex;
71
-      align-items: center;
72
-      justify-content: center;
73
-    }
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;
74 95
   }
75 96
 }
76 97
 

+ 1 - 1
src/pages/calculatorSub/calculator/index.jsx

@@ -37,7 +37,7 @@ export default class Index extends Component {
37 37
     return {
38 38
       title: "捡漏计算器",
39 39
       path: `/pages/calculatorSub/calculatorWish/index?isShare=true`,
40
-      imageUrl: '',
40
+      imageUrl: 'https://yushi.tos-cn-beijing.volces.com/calculator/shareImg.png',
41 41
     }
42 42
   }
43 43
   render() {

+ 15 - 5
src/pages/calculatorSub/calculatorResult/index.jsx

@@ -6,18 +6,28 @@ export default class Index extends Component {
6 6
   state = {
7 7
     isSearch: 1,// 是否计算成功
8 8
     list: [],// 列表
9
+    wish: '',// 心愿
10
+    price: '',// 价格
9 11
   };
10 12
   componentDidMount() {
11
-    let { isSearch, list } = Taro.getCurrentInstance().router.params;
13
+    let { isSearch, list, wish, price } = Taro.getCurrentInstance().router.params;
12 14
     this.setState({
13 15
       isSearch,
14 16
       list: JSON.parse(decodeURIComponent(list)),
17
+      wish,
18
+      price,
15 19
     });
16 20
   }
17 21
   // 再次捡漏
18 22
   handleAgain = () => {
19 23
     Taro.navigateBack();
20 24
   }
25
+  // 去捡漏清单
26
+  toCalculatorInventory = (id) => {
27
+    Taro.navigateTo({
28
+      url: `/pages/calculatorSub/calculatorInventory/index?id=${id}&&isShare=true`,
29
+    });
30
+  }
21 31
   // 精选推荐
22 32
   handleGoodRecommend = (id) => {
23 33
     Taro.navigateTo({
@@ -25,7 +35,7 @@ export default class Index extends Component {
25 35
     });
26 36
   }
27 37
   render() {
28
-    const { isSearch, list } = this.state;
38
+    const { isSearch, list, wish, price } = this.state;
29 39
     return (
30 40
       <View className="index">
31 41
         {/* 顶部盒子 */}
@@ -38,11 +48,11 @@ export default class Index extends Component {
38 48
           <View className="calculator-info">
39 49
             <View className="title-box">
40 50
               <Text className="title-text-left">您想要的:</Text>
41
-              <Text className="title-text">购买北京到深圳的机票</Text>
51
+              <Text className="title-text">{wish}</Text>
42 52
             </View>
43 53
             <View className="title-box">
44 54
               <Text className="title-text-left">期望花费:</Text>
45
-              <Text className="title-text">1000元</Text>
55
+              <Text className="title-text">{price}元</Text>
46 56
             </View>
47 57
           </View>
48 58
           {/* 首选推荐产品 */}
@@ -56,7 +66,7 @@ export default class Index extends Component {
56 66
             </View>
57 67
             <View className="first-recommend-content">
58 68
               {list.length > 0 && (
59
-                <View className="product-info">
69
+                <View className="product-info" onClick={() => this.handleGoodRecommend(list[0].id)}>
60 70
                   <Image
61 71
                     className="product-avatar"
62 72
                     mode="aspectFill"

+ 1 - 1
src/pages/calculatorSub/calculatorWish/index.jsx

@@ -52,7 +52,7 @@ export default class Index extends Component {
52 52
       Taro.navigateTo({
53 53
         url: `/pages/calculatorSub/calculatorResult/index?isSearch=${
54 54
           res.is_search
55
-        }&&list=${encodeURIComponent(JSON.stringify(res.goods_list))}`,
55
+        }&&list=${encodeURIComponent(JSON.stringify(res.goods_list))}&&wish=${this.state.wish}&&price=${this.state.price}`,
56 56
       });
57 57
     } finally {
58 58
       Taro.hideLoading();

+ 2 - 10
src/pages/index/index.jsx

@@ -43,8 +43,9 @@ export default class Index extends Component {
43 43
   // 轮播图点击
44 44
   handleBannerClick = (item) => {
45 45
     if (item.type_jpath == 1) {
46
+      const connector = item.jpath.includes('?') ? '&' : '?';
46 47
       Taro.navigateTo({
47
-        url: `${item.jpath}&isBanner=true`,
48
+        url: `${item.jpath}${connector}isBanner=true`,
48 49
       });
49 50
     }
50 51
   };
@@ -121,14 +122,6 @@ export default class Index extends Component {
121 122
   onShareAppMessage() {
122 123
     return getShareContent();
123 124
   }
124
-  // ooo = () => {
125
-  //   Taro.requestSubscribeMessage({
126
-  //     tmplIds: ["vAYG7hbNbsD75YHpmGvF8O_Pve_1Q5AvnLBd-2JF9ys"],
127
-  //     success: function (res) {
128
-  //       console.log(res);
129
-  //     },
130
-  //   });
131
-  // };
132 125
   render() {
133 126
     const { homeData, productList, loading } = this.state;
134 127
     return (
@@ -194,7 +187,6 @@ export default class Index extends Component {
194 187
             </Swiper>
195 188
           </View>
196 189
         </View>
197
-        {/* <Button onClick={this.ooo}>订阅</Button> */}
198 190
         {/* 骨架屏 */}
199 191
         <Skeleton
200 192
           isSkeletonShow={!homeData.banner && !productList.length > 0}

+ 0 - 1
src/pages/indexSub/productDetail/index.jsx

@@ -77,7 +77,6 @@ export default class Index extends Component {
77 77
       tagTitle,
78 78
       shareType,
79 79
     } = Taro.getCurrentInstance().router.params;
80
-    console.log(isShare);
81 80
 
82 81
     let session_key = Taro.getStorageSync("session_key");
83 82
     let userInfo = Taro.getStorageSync("userInfo");

+ 31 - 14
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,getUserAgreement } 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";
@@ -33,7 +33,7 @@ export default class Index extends Component {
33 33
     }, //会员信息
34 34
     isAlipay: true, //是否签约
35 35
     isInstructionModal: false, //是否显示伙伴说明弹窗
36
-    userAgreement: '', //会员规则
36
+    userAgreement: "", //会员规则
37 37
   };
38 38
 
39 39
   // 获取签约信息
@@ -69,7 +69,6 @@ export default class Index extends Component {
69 69
     });
70 70
   };
71 71
 
72
-
73 72
   // 去登录
74 73
   Login = () => {
75 74
     if (!Taro.getStorageSync("session_key")) {
@@ -85,6 +84,30 @@ export default class Index extends Component {
85 84
     }
86 85
     this.getUserAgreement(); //获取会员规则
87 86
   }
87
+  // 我的小店
88
+  handleShopClick = () => {
89
+    Taro.navigateTo({
90
+      url: `/pages/memberSub/storeManagement/index?isManager=${true}`,
91
+    });
92
+    Taro.requestSubscribeMessage({
93
+      tmplIds: ["vAYG7hbNbsD75YHpmGvF8O_Pve_1Q5AvnLBd-2JF9ys"],
94
+      success: function (res) {
95
+        console.log(res);
96
+      },
97
+    });
98
+  };
99
+  // 去我的伙伴
100
+  handlePartnerClick = () => {
101
+    Taro.navigateTo({
102
+      url: `/pages/memberSub/myPartner/index`,
103
+    });
104
+    Taro.requestSubscribeMessage({
105
+      tmplIds: ["vAYG7hbNbsD75YHpmGvF8O_Pve_1Q5AvnLBd-2JF9ys"],
106
+      success: function (res) {
107
+        console.log(res);
108
+      },
109
+    });
110
+  };
88 111
   // 去订单列表
89 112
   handleOrderClick = (type) => {
90 113
     Taro.navigateTo({
@@ -132,11 +155,7 @@ export default class Index extends Component {
132 155
               </View>
133 156
               {/* 我的小店 */}
134 157
               <View
135
-                onClick={() =>
136
-                  Taro.navigateTo({
137
-                    url: `/pages/memberSub/storeManagement/index?isManager=${true}`,
138
-                  })
139
-                }
158
+                onClick={() => this.handleShopClick()}
140 159
                 className="my-shop"
141 160
               >
142 161
                 <Image className="my-shop-icon" src={home} />
@@ -212,9 +231,7 @@ export default class Index extends Component {
212 231
                 <Text className="my-partner-title">我的伙伴</Text>
213 232
               </View>
214 233
               <View
215
-                onClick={() =>
216
-                  Taro.navigateTo({ url: `/pages/memberSub/myPartner/index` })
217
-                }
234
+                onClick={() => this.handlePartnerClick()}
218 235
                 className="my-partner-header-right"
219 236
               >
220 237
                 查看更多
@@ -231,7 +248,7 @@ export default class Index extends Component {
231 248
                   onClick={() => this.handleInstructionModal()}
232 249
                   className="partnerExplain"
233 250
                   src="https://yushi.tos-cn-beijing.volces.com/calculator/partnerExplain.png"
234
-              />
251
+                />
235 252
               )}
236 253
               <View
237 254
                 onClick={() =>
@@ -300,13 +317,13 @@ export default class Index extends Component {
300 317
                   {vipInfo.order.on_arrival_order_cnt}
301 318
                 </Text>
302 319
               </View>
303
-              <View
320
+              {/* <View
304 321
                 className="order-item"
305 322
                 onClick={() => this.handleOrderClick(2)}
306 323
               >
307 324
                 <Text className="label">已结算订单</Text>
308 325
                 <Text className="amount">{vipInfo.order.order_pay}</Text>
309
-              </View>
326
+              </View> */}
310 327
               <View
311 328
                 className="order-item"
312 329
                 onClick={() => this.handleOrderClick(2)}

+ 1 - 1
src/pages/member/index.less

@@ -370,7 +370,7 @@
370 370
             padding: 27px 20px 0 20px;
371 371
             box-sizing: border-box;
372 372
             display: flex;
373
-            justify-content: space-between;
373
+            // justify-content: space-between;
374 374
             align-items: center;
375 375
             flex-wrap: wrap;
376 376
             .order-item {