Browse Source

会员页面实名认证完善

viczhq 3 weeks ago
parent
commit
c92c9b28bb

+ 4 - 15
src/api/request.js

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

+ 0 - 3
src/api/request_api.js

@@ -38,9 +38,6 @@ export default async (options = { method: 'GET', data: {} }) => {
38
       method: options.method.toUpperCase(),
38
       method: options.method.toUpperCase(),
39
     });
39
     });
40
     const { code, data, msg } = res.data;
40
     const { code, data, msg } = res.data;
41
-    console.log('==========', options.url);
42
-    console.log('options', options.data);
43
-    console.log('res', res);
44
     switch (code) {
41
     switch (code) {
45
       case 500:
42
       case 500:
46
         Taro.showToast({
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
   handleBannerClick = (item) => {
44
   handleBannerClick = (item) => {
45
-    if (item.type_jpath == 1) {
45
+    if(item.type_jpath==1){
46
       Taro.navigateTo({
46
       Taro.navigateTo({
47
-        url: `${item.jpath}?isBanner=true`,
48
-      });
47
+        url: `${item.jpath}?isBanner=true`
48
+      })
49
     }
49
     }
50
   };
50
   };
51
   // 修改 tab 切换处理函数
51
   // 修改 tab 切换处理函数
@@ -66,9 +66,9 @@ export default class Index extends Component {
66
               Taro.pageScrollTo({
66
               Taro.pageScrollTo({
67
                 scrollTop: top - 40,
67
                 scrollTop: top - 40,
68
                 duration: 300,
68
                 duration: 300,
69
-                complete: () => {
69
+                complete:()=>{
70
                   this.getProductList(true);
70
                   this.getProductList(true);
71
-                },
71
+                }
72
               });
72
               });
73
             } else {
73
             } else {
74
               console.warn("未找到 .product-list-wrap 元素");
74
               console.warn("未找到 .product-list-wrap 元素");
@@ -127,7 +127,7 @@ export default class Index extends Component {
127
       <View className="index">
127
       <View className="index">
128
         <View
128
         <View
129
           className="header"
129
           className="header"
130
-          style={{ paddingTop: Taro.navigationBarHeight + 10 + "px" }}
130
+          style={{ paddingTop: Taro.navigationBarHeight + "px" }}
131
         >
131
         >
132
           <View className="header-content">
132
           <View className="header-content">
133
             <Image
133
             <Image
@@ -165,17 +165,12 @@ export default class Index extends Component {
165
               circular
165
               circular
166
               autoplay
166
               autoplay
167
               indicatorDots
167
               indicatorDots
168
-              indicatorColor="#e8e8e8"
169
-              banner
168
+              indicatorColor="#e8e8e8"banner
170
               indicatorActiveColor="#ffffff"
169
               indicatorActiveColor="#ffffff"
171
             >
170
             >
172
               {homeData.banner &&
171
               {homeData.banner &&
173
                 homeData.banner.map((item) => (
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
                     <Image
174
                     <Image
180
                       className="banner-img"
175
                       className="banner-img"
181
                       src={item.img}
176
                       src={item.img}

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

@@ -2,6 +2,7 @@ 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 } from "../../service";
4
 import { getVipInfo } from "../../service";
5
+import { get_my_worker_info } from "../../service/money_api";
5
 import Taro from "@tarojs/taro";
6
 import Taro from "@tarojs/taro";
6
 import "./index.less";
7
 import "./index.less";
7
 import vip from "../../images/member/vip.png";
8
 import vip from "../../images/member/vip.png";
@@ -32,7 +33,6 @@ export default class Index extends Component {
32
         isAlipay: false
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
   componentDidShow () {
53
   componentDidShow () {
54
     if (Taro.getStorageSync("session_key")) {
54
     if (Taro.getStorageSync("session_key")) {
55
       this.getVipInfo(); //获取会员首页数据
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
             <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/Alipay/index` })} title='提现认证' arrow='right' />
132
             <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/Alipay/index` })} title='提现认证' arrow='right' />
133
             <View className='line'></View>
133
             <View className='line'></View>
134
             <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/cashOutRecord/index` })} title='提现记录' extraText='' arrow='right' />
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
             {/* <AtListItem hasBorder={false} title='支付账户' extraText='需维护支付宝账户信息' arrow='right' /> */}
136
             {/* <AtListItem hasBorder={false} title='支付账户' extraText='需维护支付宝账户信息' arrow='right' /> */}
137
             {/* <View className='line'></View> */}
137
             {/* <View className='line'></View> */}
138
             {/* <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/statementRecords/index` })} title='标题结算单记录' extraText='6月结算单已出' arrow='right' /> */}
138
             {/* <AtListItem hasBorder={false} onClick={() => Taro.navigateTo({ url: `/pages/memberSub/statementRecords/index` })} title='标题结算单记录' extraText='6月结算单已出' arrow='right' /> */}