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

会员页面实名认证完善

viczhq пре 3 недеља
родитељ
комит
c92c9b28bb

+ 4 - 15
src/api/request.js

@@ -38,9 +38,6 @@ export default async (options = { method: 'GET', data: {} }) => {
38 38
       method: options.method.toUpperCase(),
39 39
     });
40 40
     const { code,data, msg } = res.data;
41
-    console.log('==========',options.url);
42
-    console.log('options',options.data);
43
-    console.log('res',res);
44 41
     switch (code) {
45 42
       case 200:
46 43
         return data;
@@ -50,16 +47,9 @@ export default async (options = { method: 'GET', data: {} }) => {
50 47
           icon: 'none',
51 48
           mask: true,
52 49
         });
53
-        // throw new Error('传参有误');
54
-        break;
50
+        return Promise.reject(msg);
55 51
       case 422:
56
-        // Taro.showToast({
57
-        //   title: 'Validation Error',
58
-        //   icon: 'none',
59
-        //   mask: true,
60
-        // });
61
-        // throw new Error('Validation Error');
62
-        break;
52
+        return Promise.reject(msg);
63 53
       case 500:
64 54
         Taro.showToast({
65 55
           title: '需要登录',
@@ -79,8 +69,7 @@ export default async (options = { method: 'GET', data: {} }) => {
79 69
         Taro.reLaunch({
80 70
           url: '/pages/login/index',
81 71
         });
82
-        // throw new Error('需要登录');
83
-        break
72
+        return Promise.reject(msg);
84 73
       default:
85 74
         if(msg){
86 75
           Taro.showToast({
@@ -89,7 +78,7 @@ export default async (options = { method: 'GET', data: {} }) => {
89 78
             mask: true,
90 79
           });
91 80
         }
92
-        // throw new Error(msg || '请求失败');
81
+        return Promise.reject(msg);
93 82
     }
94 83
   } catch (error) {
95 84
     console.error('请求错误:', error);

+ 0 - 3
src/api/request_api.js

@@ -38,9 +38,6 @@ export default async (options = { method: 'GET', data: {} }) => {
38 38
       method: options.method.toUpperCase(),
39 39
     });
40 40
     const { code, data, msg } = res.data;
41
-    console.log('==========', options.url);
42
-    console.log('options', options.data);
43
-    console.log('res', res);
44 41
     switch (code) {
45 42
       case 500:
46 43
         Taro.showToast({

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

@@ -42,10 +42,10 @@ export default class Index extends Component {
42 42
   };
43 43
   // 轮播图点击
44 44
   handleBannerClick = (item) => {
45
-    if (item.type_jpath == 1) {
45
+    if(item.type_jpath==1){
46 46
       Taro.navigateTo({
47
-        url: `${item.jpath}?isBanner=true`,
48
-      });
47
+        url: `${item.jpath}?isBanner=true`
48
+      })
49 49
     }
50 50
   };
51 51
   // 修改 tab 切换处理函数
@@ -66,9 +66,9 @@ export default class Index extends Component {
66 66
               Taro.pageScrollTo({
67 67
                 scrollTop: top - 40,
68 68
                 duration: 300,
69
-                complete: () => {
69
+                complete:()=>{
70 70
                   this.getProductList(true);
71
-                },
71
+                }
72 72
               });
73 73
             } else {
74 74
               console.warn("未找到 .product-list-wrap 元素");
@@ -127,7 +127,7 @@ export default class Index extends Component {
127 127
       <View className="index">
128 128
         <View
129 129
           className="header"
130
-          style={{ paddingTop: Taro.navigationBarHeight + 10 + "px" }}
130
+          style={{ paddingTop: Taro.navigationBarHeight + "px" }}
131 131
         >
132 132
           <View className="header-content">
133 133
             <Image
@@ -165,17 +165,12 @@ export default class Index extends Component {
165 165
               circular
166 166
               autoplay
167 167
               indicatorDots
168
-              indicatorColor="#e8e8e8"
169
-              banner
168
+              indicatorColor="#e8e8e8"banner
170 169
               indicatorActiveColor="#ffffff"
171 170
             >
172 171
               {homeData.banner &&
173 172
                 homeData.banner.map((item) => (
174
-                  <SwiperItem
175
-                    onClick={() => this.handleBannerClick(item)}
176
-                    className="banner-item"
177
-                    key={item.id}
178
-                  >
173
+                  <SwiperItem onClick={() => this.handleBannerClick(item)} className="banner-item" key={item.id}>
179 174
                     <Image
180 175
                       className="banner-img"
181 176
                       src={item.img}

+ 2 - 1
src/pages/member/index.jsx

@@ -2,6 +2,7 @@ import { Component } from "react";
2 2
 import { View, Text, Image } from "@tarojs/components";
3 3
 import { AtIcon } from "taro-ui";
4 4
 import { getVipInfo } from "../../service";
5
+import { get_my_worker_info } from "../../service/money_api";
5 6
 import Taro from "@tarojs/taro";
6 7
 import "./index.less";
7 8
 import vip from "../../images/member/vip.png";
@@ -32,7 +33,6 @@ export default class Index extends Component {
32 33
         isAlipay: false
33 34
       })
34 35
     }
35
-    console.log(res, 'res');
36 36
   }
37 37
 
38 38
   // 获取会员首页数据
@@ -53,6 +53,7 @@ export default class Index extends Component {
53 53
   componentDidShow () {
54 54
     if (Taro.getStorageSync("session_key")) {
55 55
       this.getVipInfo(); //获取会员首页数据
56
+      this.getWorkerInfo(); //获取签约信息
56 57
     }
57 58
   }
58 59
   // 去订单列表

+ 1 - 1
src/pages/memberSub/cashOut/index.jsx

@@ -132,7 +132,7 @@ export default class Index extends Component {
132 132
             <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/Alipay/index` })} title='提现认证' arrow='right' />
133 133
             <View className='line'></View>
134 134
             <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/cashOutRecord/index` })} title='提现记录' extraText='' arrow='right' />
135
-            <View className='line'></View>
135
+            {/* <View className='line'></View> */}
136 136
             {/* <AtListItem hasBorder={false} title='支付账户' extraText='需维护支付宝账户信息' arrow='right' /> */}
137 137
             {/* <View className='line'></View> */}
138 138
             {/* <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/statementRecords/index` })} title='标题结算单记录' extraText='6月结算单已出' arrow='right' /> */}