Explorar o código

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

* 'master' of http://code.qutaovip.com/lihai/fish_app:
  修改自购&&分享赚显示字段
  会员页面实名认证完善
黎海 hai 3 semanas
pai
achega
742823d27b

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

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

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

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

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

@@ -9,30 +9,33 @@ import { getEarningsOrderTab, getEarningsOrderList } from "../../../service";
9 9
 export default class Index extends Component {
10 10
   state = {
11 11
     current: 0,
12
-    orderType: 2,//默认为推广订单
12
+    orderType: 2, //默认为推广订单
13 13
     value: "", //搜索值
14 14
     tabList: [{ title: "全部" }],
15 15
     page: 1, //页数
16 16
     loading: false, //加载状态
17 17
     totalPages: 1, // 添加总页数
18 18
     isNoMore: false,
19
-    orderList: [],//订单列表
20
-    userInfo: {},//个人信息
19
+    orderList: [], //订单列表
20
+    userInfo: {}, //个人信息
21 21
   };
22 22
   componentDidShow() {
23 23
     const { router } = Taro.getCurrentInstance();
24 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 35
   getUserInfo = async () => {
33 36
     const res = await getUserInfo();
34 37
     this.setState({ userInfo: res });
35
-  }
38
+  };
36 39
   // 获取收益订单列表
37 40
   getEarningsOrderList = async (isRefresh) => {
38 41
     const { page } = this.state;
@@ -43,18 +46,17 @@ export default class Index extends Component {
43 46
       page,
44 47
       page_size: 10,
45 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 61
   // 获取收益订单tab
60 62
   getEarningsOrderTab = async () => {
@@ -62,21 +64,24 @@ export default class Index extends Component {
62 64
     const newTabList = res.tabs.map((item) => ({
63 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 77
   handleOrderTypeClick = (type) => {
73
-    this.setState({ orderType: type, page: 1, value: '' },()=>{
78
+    this.setState({ orderType: type, page: 1, value: "" }, () => {
74 79
       this.getEarningsOrderList(true);
75 80
     });
76 81
   };
77 82
   // tab切换
78 83
   handleTabClick = (index) => {
79
-    this.setState({ current: index, page: 1, value: '' },()=>{
84
+    this.setState({ current: index, page: 1, value: "" }, () => {
80 85
       this.getEarningsOrderList(true);
81 86
     });
82 87
   };
@@ -119,15 +124,22 @@ export default class Index extends Component {
119 124
     }
120 125
   };
121 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 129
     return (
124 130
       <View className="index">
125 131
         {/* 订单类型切换 */}
126 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 137
             <Text>推广订单</Text>
129 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 143
             <Text>购买订单</Text>
132 144
           </View>
133 145
         </View>
@@ -177,49 +189,53 @@ export default class Index extends Component {
177 189
               </View>
178 190
               <Text className="pay-status">{item.state_text}</Text>
179 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 209
                 </View>
197
-              </View>
198
-              {/* <View className="member-info">
210
+                {/* <View className="member-info">
199 211
                 <Image className="member-icon" src={vip} />
200 212
                 <Text className="member-text">闲鱼会员</Text>
201 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 225
                   <View className="promotion-info">
213 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 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 239
                 </View>
224 240
               </View>
225 241
             </View>
@@ -239,11 +255,14 @@ export default class Index extends Component {
239 255
         {/* 没有更多 */}
240 256
         {isNoMore && (
241 257
           <View className="no-more">
242
-            <AtDivider fontSize={18} fontColor="#949494" content="我是有底线的" />
258
+            <AtDivider
259
+              fontSize={18}
260
+              fontColor="#949494"
261
+              content="我是有底线的"
262
+            />
243 263
           </View>
244 264
         )}
245 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 162
                   <View className="product-details">
163 163
                     <Text className="product-name">{item.item_title}</Text>
164 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 167
                     </View>
168 168
                     <View className="payment-info">
169 169
                       <Text className="label">实付金额:</Text>