Browse Source

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

* 'master' of http://code.qutaovip.com/lihai/fish_app:
  修改自购&&分享赚显示字段
  会员页面实名认证完善
黎海 1 month ago
parent
commit
742823d27b

+ 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({

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

@@ -244,7 +244,7 @@ const ProductList = forwardRef((props, ref) => {
244
                     <View className="content">
244
                     <View className="content">
245
                         <Text className="label">自购省</Text>
245
                         <Text className="label">自购省</Text>
246
                         <Text className="money">
246
                         <Text className="money">
247
-                          ¥{product.estimated_commission}
247
+                          ¥{product.estimated_commission_promotion}
248
                         </Text>
248
                         </Text>
249
                     </View>
249
                     </View>
250
                   </View>
250
                   </View>
@@ -260,7 +260,7 @@ const ProductList = forwardRef((props, ref) => {
260
                       >
260
                       >
261
                         <Text className="label">分享赚</Text>
261
                         <Text className="label">分享赚</Text>
262
                         <Text className="money">
262
                         <Text className="money">
263
-                          ¥{product.estimated_commission}
263
+                          ¥{product.estimated_commission_buy}
264
                         </Text>
264
                         </Text>
265
                       </Button>
265
                       </Button>
266
                     </View>
266
                     </View>

+ 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' /> */}

+ 85 - 66
src/pages/memberSub/earningsOrder/index.jsx

@@ -9,30 +9,33 @@ import { getEarningsOrderTab, getEarningsOrderList } from "../../../service";
9
 export default class Index extends Component {
9
 export default class Index extends Component {
10
   state = {
10
   state = {
11
     current: 0,
11
     current: 0,
12
-    orderType: 2,//默认为推广订单
12
+    orderType: 2, //默认为推广订单
13
     value: "", //搜索值
13
     value: "", //搜索值
14
     tabList: [{ title: "全部" }],
14
     tabList: [{ title: "全部" }],
15
     page: 1, //页数
15
     page: 1, //页数
16
     loading: false, //加载状态
16
     loading: false, //加载状态
17
     totalPages: 1, // 添加总页数
17
     totalPages: 1, // 添加总页数
18
     isNoMore: false,
18
     isNoMore: false,
19
-    orderList: [],//订单列表
20
-    userInfo: {},//个人信息
19
+    orderList: [], //订单列表
20
+    userInfo: {}, //个人信息
21
   };
21
   };
22
   componentDidShow() {
22
   componentDidShow() {
23
     const { router } = Taro.getCurrentInstance();
23
     const { router } = Taro.getCurrentInstance();
24
     const params = router.params;
24
     const params = router.params;
25
-    this.setState({
26
-      orderType: params.type||2,
27
-    },()=>{
28
-      this.getEarningsOrderTab();
29
-    });
25
+    this.setState(
26
+      {
27
+        orderType: params.type || 2,
28
+      },
29
+      () => {
30
+        this.getEarningsOrderTab();
31
+      }
32
+    );
30
   }
33
   }
31
   // 获取个人信息
34
   // 获取个人信息
32
   getUserInfo = async () => {
35
   getUserInfo = async () => {
33
     const res = await getUserInfo();
36
     const res = await getUserInfo();
34
     this.setState({ userInfo: res });
37
     this.setState({ userInfo: res });
35
-  }
38
+  };
36
   // 获取收益订单列表
39
   // 获取收益订单列表
37
   getEarningsOrderList = async (isRefresh) => {
40
   getEarningsOrderList = async (isRefresh) => {
38
     const { page } = this.state;
41
     const { page } = this.state;
@@ -43,18 +46,17 @@ export default class Index extends Component {
43
       page,
46
       page,
44
       page_size: 10,
47
       page_size: 10,
45
       search_name: this.state.value,
48
       search_name: this.state.value,
46
-      user_type:this.state.orderType
49
+      user_type: this.state.orderType,
47
     });
50
     });
48
 
51
 
49
-    this.setState(
50
-      (prevState) => ({
51
-        orderList: isRefresh
52
-          ? res.income_list
53
-          : [...prevState.orderList, ...res.income_list],
54
-        totalPages: res.total_pages,
55
-        loading: false,
56
-        isNoMore: res.total_pages <= page,
57
-      }));
52
+    this.setState((prevState) => ({
53
+      orderList: isRefresh
54
+        ? res.income_list
55
+        : [...prevState.orderList, ...res.income_list],
56
+      totalPages: res.total_pages,
57
+      loading: false,
58
+      isNoMore: res.total_pages <= page,
59
+    }));
58
   };
60
   };
59
   // 获取收益订单tab
61
   // 获取收益订单tab
60
   getEarningsOrderTab = async () => {
62
   getEarningsOrderTab = async () => {
@@ -62,21 +64,24 @@ export default class Index extends Component {
62
     const newTabList = res.tabs.map((item) => ({
64
     const newTabList = res.tabs.map((item) => ({
63
       title: item,
65
       title: item,
64
     }));
66
     }));
65
-    this.setState({
66
-      tabList: newTabList,
67
-    },()=>{
68
-      this.getEarningsOrderList(true);
69
-    });
67
+    this.setState(
68
+      {
69
+        tabList: newTabList,
70
+      },
71
+      () => {
72
+        this.getEarningsOrderList(true);
73
+      }
74
+    );
70
   };
75
   };
71
   // 订单类型切换
76
   // 订单类型切换
72
   handleOrderTypeClick = (type) => {
77
   handleOrderTypeClick = (type) => {
73
-    this.setState({ orderType: type, page: 1, value: '' },()=>{
78
+    this.setState({ orderType: type, page: 1, value: "" }, () => {
74
       this.getEarningsOrderList(true);
79
       this.getEarningsOrderList(true);
75
     });
80
     });
76
   };
81
   };
77
   // tab切换
82
   // tab切换
78
   handleTabClick = (index) => {
83
   handleTabClick = (index) => {
79
-    this.setState({ current: index, page: 1, value: '' },()=>{
84
+    this.setState({ current: index, page: 1, value: "" }, () => {
80
       this.getEarningsOrderList(true);
85
       this.getEarningsOrderList(true);
81
     });
86
     });
82
   };
87
   };
@@ -119,15 +124,22 @@ export default class Index extends Component {
119
     }
124
     }
120
   };
125
   };
121
   render() {
126
   render() {
122
-    const { current, tabList, value, orderList, loading, isNoMore, orderType } = this.state;
127
+    const { current, tabList, value, orderList, loading, isNoMore, orderType } =
128
+      this.state;
123
     return (
129
     return (
124
       <View className="index">
130
       <View className="index">
125
         {/* 订单类型切换 */}
131
         {/* 订单类型切换 */}
126
         <View className="order-type-switch">
132
         <View className="order-type-switch">
127
-          <View className={`order-type-item ${orderType == 2 ? "active" : ""}`} onClick={() => this.handleOrderTypeClick(2)}>
133
+          <View
134
+            className={`order-type-item ${orderType == 2 ? "active" : ""}`}
135
+            onClick={() => this.handleOrderTypeClick(2)}
136
+          >
128
             <Text>推广订单</Text>
137
             <Text>推广订单</Text>
129
           </View>
138
           </View>
130
-          <View className={`order-type-item ${orderType == 1 ? "active" : ""}`} onClick={() => this.handleOrderTypeClick(1)}>
139
+          <View
140
+            className={`order-type-item ${orderType == 1 ? "active" : ""}`}
141
+            onClick={() => this.handleOrderTypeClick(1)}
142
+          >
131
             <Text>购买订单</Text>
143
             <Text>购买订单</Text>
132
           </View>
144
           </View>
133
         </View>
145
         </View>
@@ -177,49 +189,53 @@ export default class Index extends Component {
177
               </View>
189
               </View>
178
               <Text className="pay-status">{item.state_text}</Text>
190
               <Text className="pay-status">{item.state_text}</Text>
179
             </View> */}
191
             </View> */}
180
-            {/* 订单信息 */}
181
-            <View className="order-info">
182
-              <View className="order-details">
183
-                <View className="detail-item">
184
-                  <Text className="label">订单编号:</Text>
185
-                  <Text className="value">{item.order_number}</Text>
186
-                  <Text
187
-                    className="copy-text"
188
-                    onClick={() => this.handleCopy(item.order_number)}
189
-                  >
190
-                    复制
191
-                  </Text>
192
-                </View>
193
-                <View className="detail-item">
194
-                  <Text className="label">下单时间:</Text>
195
-                  <Text className="value">{item.pay_time}</Text>
192
+              {/* 订单信息 */}
193
+              <View className="order-info">
194
+                <View className="order-details">
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>
204
+                  </View>
205
+                  <View className="detail-item">
206
+                    <Text className="label">下单时间:</Text>
207
+                    <Text className="value">{item.pay_time}</Text>
208
+                  </View>
196
                 </View>
209
                 </View>
197
-              </View>
198
-              {/* <View className="member-info">
210
+                {/* <View className="member-info">
199
                 <Image className="member-icon" src={vip} />
211
                 <Image className="member-icon" src={vip} />
200
                 <Text className="member-text">闲鱼会员</Text>
212
                 <Text className="member-text">闲鱼会员</Text>
201
               </View> */}
213
               </View> */}
202
-            </View>
214
+              </View>
203
 
215
 
204
-            {/* 产品信息 */}
205
-            <View className="product-info">
206
-              <Image mode="aspectFill" className="product-image" src={item.item_pic_url} />
207
-              <View className="product-details">
208
-                <Text className="product-name">
209
-                  {item.item_title}
210
-                </Text>
211
-                {orderType == 2 && (
216
+              {/* 产品信息 */}
217
+              <View className="product-info">
218
+                <Image
219
+                  mode="aspectFill"
220
+                  className="product-image"
221
+                  src={item.item_pic_url}
222
+                />
223
+                <View className="product-details">
224
+                  <Text className="product-name">{item.item_title}</Text>
212
                   <View className="promotion-info">
225
                   <View className="promotion-info">
213
                     <View className="tag">预估收入</View>
226
                     <View className="tag">预估收入</View>
214
-                    <Text className="amount">¥{item.assess_amount_text}</Text>
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>
235
+                  <View className="payment-info">
236
+                    <Text className="label">实付金额:</Text>
237
+                    <Text className="amount">¥{item.actual_paid_fee}</Text>
215
                   </View>
238
                   </View>
216
-                )}
217
-                <View className="payment-info">
218
-                </View>
219
-                <View className="payment-info">
220
-                  <Text className="label">实付金额:</Text>
221
-                  <Text className="amount">¥{item.actual_paid_fee}</Text>
222
-                </View>
223
                 </View>
239
                 </View>
224
               </View>
240
               </View>
225
             </View>
241
             </View>
@@ -239,11 +255,14 @@ export default class Index extends Component {
239
         {/* 没有更多 */}
255
         {/* 没有更多 */}
240
         {isNoMore && (
256
         {isNoMore && (
241
           <View className="no-more">
257
           <View className="no-more">
242
-            <AtDivider fontSize={18} fontColor="#949494" content="我是有底线的" />
258
+            <AtDivider
259
+              fontSize={18}
260
+              fontColor="#949494"
261
+              content="我是有底线的"
262
+            />
243
           </View>
263
           </View>
244
         )}
264
         )}
245
       </View>
265
       </View>
246
     );
266
     );
247
   }
267
   }
248
 }
268
 }
249
-

+ 2 - 2
src/pages/memberSub/partnerDetail/index.jsx

@@ -162,8 +162,8 @@ export default class Index extends Component {
162
                   <View className="product-details">
162
                   <View className="product-details">
163
                     <Text className="product-name">{item.item_title}</Text>
163
                     <Text className="product-name">{item.item_title}</Text>
164
                     <View className="promotion-info">
164
                     <View className="promotion-info">
165
-                      <View className="tag">推广收入</View>
166
-                      <Text className="amount">¥{item.assess_amount_text}</Text>
165
+                      <View className="tag">预估收入</View>
166
+                      <Text className="amount">¥{item.assess_amount_text_promotion}</Text>
167
                     </View>
167
                     </View>
168
                     <View className="payment-info">
168
                     <View className="payment-info">
169
                       <Text className="label">实付金额:</Text>
169
                       <Text className="label">实付金额:</Text>