Browse Source

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

viczhq 4 weeks ago
parent
commit
83b5793063

+ 7 - 0
project.private.config.json

@@ -10,6 +10,13 @@
10
     "miniprogram": {
10
     "miniprogram": {
11
       "list": [
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
           "name": "pages/calculatorSub/calculatorResult/index",
20
           "name": "pages/calculatorSub/calculatorResult/index",
14
           "pathName": "pages/calculatorSub/calculatorResult/index",
21
           "pathName": "pages/calculatorSub/calculatorResult/index",
15
           "query": "",
22
           "query": "",

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

@@ -3,7 +3,7 @@ import "./index.less";
3
 
3
 
4
 // 签约模态框组件
4
 // 签约模态框组件
5
 export default function instructionModal(props) {
5
 export default function instructionModal(props) {
6
-  const { isOpened, onClose, title, content} = props;
6
+  const { isOpened, onClose, title, content } = props;
7
   // 关闭弹窗
7
   // 关闭弹窗
8
   const closeModal = () => {
8
   const closeModal = () => {
9
     onClose();
9
     onClose();
@@ -14,15 +14,19 @@ export default function instructionModal(props) {
14
         <View className="modal-container">
14
         <View className="modal-container">
15
           <View className="modal-mask" />
15
           <View className="modal-mask" />
16
           <View className="modal-content">
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
               <View className="instruction-content">
25
               <View className="instruction-content">
24
                 <RichText nodes={content} />
26
                 <RichText nodes={content} />
25
               </View>
27
               </View>
28
+            </View>
29
+            <View className="instruction-button-box">
26
               <View onClick={closeModal} className="instruction-button">
30
               <View onClick={closeModal} className="instruction-button">
27
                 我知道了
31
                 我知道了
28
               </View>
32
               </View>

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

@@ -27,30 +27,36 @@
27
   max-width: 600px;
27
   max-width: 600px;
28
   z-index: 1001;
28
   z-index: 1001;
29
   animation: modalFadeIn 0.3s ease;
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
   .content-box {
43
   .content-box {
32
-    min-height: 400px;
33
-    padding: 54px 32px 38px 32px;
44
+    max-height: 70vh;
45
+    padding: 54px 32px 148px 32px;
34
     display: flex;
46
     display: flex;
35
     flex-direction: column;
47
     flex-direction: column;
36
     align-items: center;
48
     align-items: center;
37
-    justify-content: center;
49
+    justify-content: flex-start;
38
     position: relative;
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
     .instruction-title {
54
     .instruction-title {
50
       font-weight: 700;
55
       font-weight: 700;
51
       font-size: 32px;
56
       font-size: 32px;
52
       color: #000000;
57
       color: #000000;
53
     }
58
     }
59
+
54
     .instruction-content {
60
     .instruction-content {
55
       font-size: 28px;
61
       font-size: 28px;
56
       color: #3D3D3D;
62
       color: #3D3D3D;
@@ -58,19 +64,34 @@
58
       margin-top: 28px;
64
       margin-top: 28px;
59
       padding: 0 39px;
65
       padding: 0 39px;
60
       box-sizing: border-box;
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
     return {
37
     return {
38
       title: "捡漏计算器",
38
       title: "捡漏计算器",
39
       path: `/pages/calculatorSub/calculatorWish/index?isShare=true`,
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
   render() {
43
   render() {

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

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

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

@@ -52,7 +52,7 @@ export default class Index extends Component {
52
       Taro.navigateTo({
52
       Taro.navigateTo({
53
         url: `/pages/calculatorSub/calculatorResult/index?isSearch=${
53
         url: `/pages/calculatorSub/calculatorResult/index?isSearch=${
54
           res.is_search
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
     } finally {
57
     } finally {
58
       Taro.hideLoading();
58
       Taro.hideLoading();

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

@@ -43,8 +43,9 @@ export default class Index extends Component {
43
   // 轮播图点击
43
   // 轮播图点击
44
   handleBannerClick = (item) => {
44
   handleBannerClick = (item) => {
45
     if (item.type_jpath == 1) {
45
     if (item.type_jpath == 1) {
46
+      const connector = item.jpath.includes('?') ? '&' : '?';
46
       Taro.navigateTo({
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
   onShareAppMessage() {
122
   onShareAppMessage() {
122
     return getShareContent();
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
   render() {
125
   render() {
133
     const { homeData, productList, loading } = this.state;
126
     const { homeData, productList, loading } = this.state;
134
     return (
127
     return (
@@ -194,7 +187,6 @@ export default class Index extends Component {
194
             </Swiper>
187
             </Swiper>
195
           </View>
188
           </View>
196
         </View>
189
         </View>
197
-        {/* <Button onClick={this.ooo}>订阅</Button> */}
198
         {/* 骨架屏 */}
190
         {/* 骨架屏 */}
199
         <Skeleton
191
         <Skeleton
200
           isSkeletonShow={!homeData.banner && !productList.length > 0}
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
       tagTitle,
77
       tagTitle,
78
       shareType,
78
       shareType,
79
     } = Taro.getCurrentInstance().router.params;
79
     } = Taro.getCurrentInstance().router.params;
80
-    console.log(isShare);
81
 
80
 
82
     let session_key = Taro.getStorageSync("session_key");
81
     let session_key = Taro.getStorageSync("session_key");
83
     let userInfo = Taro.getStorageSync("userInfo");
82
     let userInfo = Taro.getStorageSync("userInfo");

+ 31 - 14
src/pages/member/index.jsx

@@ -1,7 +1,7 @@
1
 import { Component } from "react";
1
 import { Component } from "react";
2
 import { View, Text, Image } from "@tarojs/components";
2
 import { View, Text, Image } from "@tarojs/components";
3
 import { AtIcon } from "taro-ui";
3
 import { AtIcon } from "taro-ui";
4
-import { getVipInfo,getUserAgreement } from "../../service";
4
+import { getVipInfo, getUserAgreement } from "../../service";
5
 import { get_my_worker_info } from "../../service/money_api";
5
 import { get_my_worker_info } from "../../service/money_api";
6
 import Taro from "@tarojs/taro";
6
 import Taro from "@tarojs/taro";
7
 import "./index.less";
7
 import "./index.less";
@@ -33,7 +33,7 @@ export default class Index extends Component {
33
     }, //会员信息
33
     }, //会员信息
34
     isAlipay: true, //是否签约
34
     isAlipay: true, //是否签约
35
     isInstructionModal: false, //是否显示伙伴说明弹窗
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
   Login = () => {
73
   Login = () => {
75
     if (!Taro.getStorageSync("session_key")) {
74
     if (!Taro.getStorageSync("session_key")) {
@@ -85,6 +84,30 @@ export default class Index extends Component {
85
     }
84
     }
86
     this.getUserAgreement(); //获取会员规则
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
   handleOrderClick = (type) => {
112
   handleOrderClick = (type) => {
90
     Taro.navigateTo({
113
     Taro.navigateTo({
@@ -132,11 +155,7 @@ export default class Index extends Component {
132
               </View>
155
               </View>
133
               {/* 我的小店 */}
156
               {/* 我的小店 */}
134
               <View
157
               <View
135
-                onClick={() =>
136
-                  Taro.navigateTo({
137
-                    url: `/pages/memberSub/storeManagement/index?isManager=${true}`,
138
-                  })
139
-                }
158
+                onClick={() => this.handleShopClick()}
140
                 className="my-shop"
159
                 className="my-shop"
141
               >
160
               >
142
                 <Image className="my-shop-icon" src={home} />
161
                 <Image className="my-shop-icon" src={home} />
@@ -212,9 +231,7 @@ export default class Index extends Component {
212
                 <Text className="my-partner-title">我的伙伴</Text>
231
                 <Text className="my-partner-title">我的伙伴</Text>
213
               </View>
232
               </View>
214
               <View
233
               <View
215
-                onClick={() =>
216
-                  Taro.navigateTo({ url: `/pages/memberSub/myPartner/index` })
217
-                }
234
+                onClick={() => this.handlePartnerClick()}
218
                 className="my-partner-header-right"
235
                 className="my-partner-header-right"
219
               >
236
               >
220
                 查看更多
237
                 查看更多
@@ -231,7 +248,7 @@ export default class Index extends Component {
231
                   onClick={() => this.handleInstructionModal()}
248
                   onClick={() => this.handleInstructionModal()}
232
                   className="partnerExplain"
249
                   className="partnerExplain"
233
                   src="https://yushi.tos-cn-beijing.volces.com/calculator/partnerExplain.png"
250
                   src="https://yushi.tos-cn-beijing.volces.com/calculator/partnerExplain.png"
234
-              />
251
+                />
235
               )}
252
               )}
236
               <View
253
               <View
237
                 onClick={() =>
254
                 onClick={() =>
@@ -300,13 +317,13 @@ export default class Index extends Component {
300
                   {vipInfo.order.on_arrival_order_cnt}
317
                   {vipInfo.order.on_arrival_order_cnt}
301
                 </Text>
318
                 </Text>
302
               </View>
319
               </View>
303
-              <View
320
+              {/* <View
304
                 className="order-item"
321
                 className="order-item"
305
                 onClick={() => this.handleOrderClick(2)}
322
                 onClick={() => this.handleOrderClick(2)}
306
               >
323
               >
307
                 <Text className="label">已结算订单</Text>
324
                 <Text className="label">已结算订单</Text>
308
                 <Text className="amount">{vipInfo.order.order_pay}</Text>
325
                 <Text className="amount">{vipInfo.order.order_pay}</Text>
309
-              </View>
326
+              </View> */}
310
               <View
327
               <View
311
                 className="order-item"
328
                 className="order-item"
312
                 onClick={() => this.handleOrderClick(2)}
329
                 onClick={() => this.handleOrderClick(2)}

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

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