Browse Source

我的伙伴

cnyuhao 4 weeks ago
parent
commit
56d8a5b78e

+ 1 - 1
project.private.config.json

@@ -19,7 +19,7 @@
19
         {
19
         {
20
           "name": "pages/memberSub/partnerDetail/index",
20
           "name": "pages/memberSub/partnerDetail/index",
21
           "pathName": "pages/memberSub/partnerDetail/index",
21
           "pathName": "pages/memberSub/partnerDetail/index",
22
-          "query": "",
22
+          "query": "id=2818",
23
           "launchMode": "default",
23
           "launchMode": "default",
24
           "scene": null
24
           "scene": null
25
         },
25
         },

+ 3 - 3
src/pages/member/index.jsx

@@ -120,12 +120,12 @@ export default class Index extends Component {
120
                   ¥{vipInfo.draw_money.store_earnings_now}
120
                   ¥{vipInfo.draw_money.store_earnings_now}
121
                 </Text>
121
                 </Text>
122
 
122
 
123
-                <View className="warning-icon-box">
123
+                {/* <View className="warning-icon-box">
124
                   <Image className="warning-icon" src={warning} />
124
                   <Image className="warning-icon" src={warning} />
125
                   <Text className="warning-text">未完成提现认证</Text>
125
                   <Text className="warning-text">未完成提现认证</Text>
126
-                </View>
126
+                </View> */}
127
               </View>
127
               </View>
128
-              <View onClick={() => Taro.navigateTo({ url: `/pages/memberSub/cashOut/index` })} className="right">点击提现</View>
128
+              {/* <View onClick={() => Taro.navigateTo({ url: `/pages/memberSub/cashOut/index` })} className="right">点击提现</View> */}
129
             </View>
129
             </View>
130
           </View>
130
           </View>
131
           {/* 我的伙伴 */}
131
           {/* 我的伙伴 */}

+ 15 - 11
src/pages/memberSub/myPartner/index.jsx

@@ -42,36 +42,40 @@ export default class Index extends Component {
42
             <Text className="partner-number-count">{partnerList.all_partner_cnt}</Text>
42
             <Text className="partner-number-count">{partnerList.all_partner_cnt}</Text>
43
         </View>
43
         </View>
44
         <View className="partner-list">
44
         <View className="partner-list">
45
-          <View className="partner-item">
46
-            <View className="partner-item-top">
47
-              <View className="partner-item-top-left">
48
-                <Image src="" className="partner-item-top-left-avatar" />
45
+          {partnerList.partner_list && partnerList.partner_list.map((item, index) => (
46
+            <View key={index} className="partner-item">
47
+              <View className="partner-item-top">
48
+                <View className="partner-item-top-left">
49
+                <Image src={item.icon} className="partner-item-top-left-avatar" />
49
               </View>
50
               </View>
50
               <View className="partner-item-top-right">
51
               <View className="partner-item-top-right">
51
-                <View className="name">张三</View>
52
+                <View className="name">{item.name}</View>
52
                 <View className="level">
53
                 <View className="level">
53
                   <Image src={level} className="level-icon" />
54
                   <Image src={level} className="level-icon" />
54
                   <Text className="level-text">导购员</Text>
55
                   <Text className="level-text">导购员</Text>
55
                 </View>
56
                 </View>
56
               </View>
57
               </View>
57
-              <View onClick={() => Taro.navigateTo({ url: `/pages/memberSub/partnerDetail/index` })} className="detail">详情
58
+              <View onClick={() => Taro.navigateTo({ url: `/pages/memberSub/partnerDetail/index?id=${item.id}` })} className="detail">详情
58
                 <AtIcon value='chevron-right' size='10' color='#A1A1A1'></AtIcon>
59
                 <AtIcon value='chevron-right' size='10' color='#A1A1A1'></AtIcon>
59
               </View>
60
               </View>
60
             </View>
61
             </View>
61
             <View className="partner-item-bottom">
62
             <View className="partner-item-bottom">
62
               <View className="item">
63
               <View className="item">
63
                 <Text className="item-text">绑定手机号</Text>
64
                 <Text className="item-text">绑定手机号</Text>
64
-                <View className="phone-container">
65
-                  <Text className="item-value">138****8888</Text>
66
-                  <Text className="copy-btn" onClick={() => this.copyPhone('138****8888')}>复制</Text>
67
-                </View>
65
+                {item.phone && (
66
+                  <View className="phone-container">
67
+                    <Text className="item-value">{item.phone}</Text>
68
+                    <Text className="copy-btn" onClick={() => this.copyPhone(item.phone)}>复制</Text>
69
+                  </View>
70
+                )}
68
               </View>
71
               </View>
69
               <View className="item">
72
               <View className="item">
70
                 <Text className="item-text">推荐绑定时间</Text>
73
                 <Text className="item-text">推荐绑定时间</Text>
71
-                <Text className="item-value">2024-03-21 12:00:00</Text>
74
+                <Text className="item-value">{item.start_date}</Text>
72
               </View>
75
               </View>
73
             </View>
76
             </View>
74
           </View>
77
           </View>
78
+          ))}
75
         </View>
79
         </View>
76
       </View>
80
       </View>
77
     );
81
     );

+ 1 - 2
src/pages/memberSub/myPartner/index.less

@@ -42,7 +42,7 @@
42
             background-color: #fff;
42
             background-color: #fff;
43
             padding: 17px;
43
             padding: 17px;
44
             box-sizing: border-box;
44
             box-sizing: border-box;
45
-
45
+            margin-bottom: 20px;
46
             .partner-item-top {
46
             .partner-item-top {
47
                 position: relative;
47
                 position: relative;
48
                 display: flex;
48
                 display: flex;
@@ -52,7 +52,6 @@
52
                     width: 116px;
52
                     width: 116px;
53
                     height: 116px;
53
                     height: 116px;
54
                     border-radius: 50%;
54
                     border-radius: 50%;
55
-                    background-color: #ccc;
56
                     margin-right: 20px;
55
                     margin-right: 20px;
57
 
56
 
58
                     .partner-item-top-left-avatar {
57
                     .partner-item-top-left-avatar {

+ 54 - 65
src/pages/memberSub/partnerDetail/index.jsx

@@ -1,53 +1,33 @@
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 "./index.less";
3
 import "./index.less";
4
-import { AtDivider,AtActivityIndicator } from "taro-ui";
4
+import { AtDivider, AtActivityIndicator } from "taro-ui";
5
 import level from "../../../images/partner/level.png";
5
 import level from "../../../images/partner/level.png";
6
 import Taro from "@tarojs/taro";
6
 import Taro from "@tarojs/taro";
7
 import vip from "../../../images/earningsOrder/vip.png";
7
 import vip from "../../../images/earningsOrder/vip.png";
8
 import { getPartnerDetail } from "../../../service";
8
 import { getPartnerDetail } from "../../../service";
9
 export default class Index extends Component {
9
 export default class Index extends Component {
10
   state = {
10
   state = {
11
-    orderList: [
12
-      {
13
-        order_number: "XY202403210001",
14
-        pay_time: "2024-03-21 15:30:25",
15
-        item_pic_url: "https://example.com/product1.jpg",
16
-        item_title: "2024春季新款连衣裙",
17
-        assess_amount_text: "12.50",
18
-        actual_paid_fee: "299.00",
19
-      },
20
-      {
21
-        order_number: "XY202403200015",
22
-        pay_time: "2024-03-20 10:15:33",
23
-        item_pic_url: "https://example.com/product2.jpg",
24
-        item_title: "时尚百搭小白鞋",
25
-        assess_amount_text: "8.80",
26
-        actual_paid_fee: "219.00",
27
-      },
28
-      {
29
-        order_number: "XY202403190089",
30
-        pay_time: "2024-03-19 18:45:12",
31
-        item_pic_url: "https://example.com/product3.jpg",
32
-        item_title: "韩版宽松牛仔外套",
33
-        assess_amount_text: "15.00",
34
-        actual_paid_fee: "358.00",
35
-      },
36
-    ],
11
+    orderList: [],//订单列表
12
+    id: "",//伙伴id
37
     page: 1, //页数
13
     page: 1, //页数
38
     loading: false, //加载状态
14
     loading: false, //加载状态
39
     totalPages: 1, // 添加总页数
15
     totalPages: 1, // 添加总页数
40
     isNoMore: false,
16
     isNoMore: false,
41
   };
17
   };
42
   componentDidMount() {
18
   componentDidMount() {
43
-    this.getPartnerDetail(true);
19
+    const { id } = Taro.getCurrentInstance().router.params;
20
+    this.setState({ id }, () => {
21
+      this.getPartnerDetail(true);
22
+    });
44
   }
23
   }
45
-  // 获取收益订单列表
46
-  getPartnerDetail = async (isRefresh=false) => {
24
+  // 获取伙伴详情
25
+  getPartnerDetail = async (isRefresh = false) => {
47
     const { page } = this.state;
26
     const { page } = this.state;
48
     this.setState({ loading: true });
27
     this.setState({ loading: true });
49
 
28
 
50
     const res = await getPartnerDetail({
29
     const res = await getPartnerDetail({
30
+      partner_id: this.state.id,
51
       page,
31
       page,
52
       page_size: 10,
32
       page_size: 10,
53
     });
33
     });
@@ -56,6 +36,7 @@ export default class Index extends Component {
56
       orderList: isRefresh
36
       orderList: isRefresh
57
         ? res.income_list
37
         ? res.income_list
58
         : [...prevState.orderList, ...res.income_list],
38
         : [...prevState.orderList, ...res.income_list],
39
+      partnerDetail: res.partner_user,
59
       totalPages: res.total_pages,
40
       totalPages: res.total_pages,
60
       loading: false,
41
       loading: false,
61
       isNoMore: res.total_pages <= page,
42
       isNoMore: res.total_pages <= page,
@@ -91,53 +72,61 @@ export default class Index extends Component {
91
     }
72
     }
92
   };
73
   };
93
   render() {
74
   render() {
94
-    const { orderList,loading,isNoMore } = this.state;
75
+    const { orderList, loading, isNoMore, partnerDetail } = this.state;
95
     return (
76
     return (
96
       <View className="index">
77
       <View className="index">
97
         <View className="container">
78
         <View className="container">
98
-          <View className="header">
99
-            <View className="header-left">
100
-              <Text className="name">张三</Text>
101
-              <View className="level">
102
-                <Image className="level-icon" src={level} />
103
-                <Text className="level-text">导购员</Text>
79
+          {partnerDetail && (
80
+            <View className="header">
81
+              <View className="header-left">
82
+                <Text className="name">{partnerDetail.name}</Text>
83
+                <View className="level">
84
+                  <Image className="level-icon" src={level} />
85
+                  <Text className="level-text">导购员</Text>
86
+                </View>
87
+              </View>
88
+              <View className="header-right">
89
+                <Image className="header-right-avatar" src={partnerDetail.icon} />
104
               </View>
90
               </View>
105
             </View>
91
             </View>
106
-            <View className="header-right">
107
-              <Image className="header-right-avatar" src="" />
108
-            </View>
109
-          </View>
92
+          )}
110
           {/* 个人资料 */}
93
           {/* 个人资料 */}
111
-          <View className="personal-info">
112
-            <View className="info-top">
113
-              <View className="personal-info-item">
114
-                <Text className="personal-info-item-label">累计贡献返利</Text>
115
-                <Text className="personal-info-item-value">¥0.00</Text>
116
-              </View>
117
-              <View className="line"></View>
118
-              <View className="personal-info-item">
94
+          {partnerDetail && (
95
+            <View className="personal-info">
96
+              <View className="info-top">
97
+                <View className="personal-info-item">
98
+                  <Text className="personal-info-item-label">累计贡献返利</Text>
99
+                  <Text className="personal-info-item-value">¥{partnerDetail.all_income_rebate}</Text>
100
+                </View>
101
+                <View className="line"></View>
102
+                {/* <View className="personal-info-item">
119
                 <Text className="personal-info-item-label">累计贡献管理奖</Text>
103
                 <Text className="personal-info-item-label">累计贡献管理奖</Text>
120
                 <Text className="personal-info-item-value">¥0.00</Text>
104
                 <Text className="personal-info-item-value">¥0.00</Text>
105
+              </View> */}
106
+                <View className="personal-info-item">
107
+                  <Text className="personal-info-item-label">手机号</Text>
108
+                  <Text className="personal-info-item-value">{partnerDetail.phone}</Text>
109
+                </View>
121
               </View>
110
               </View>
122
-            </View>
123
-            <View className="line-column"></View>
124
-            <View className="info-bottom">
125
-              <View className="personal-info-item">
126
-                <Text className="personal-info-item-label">手机号</Text>
127
-                <Text className="personal-info-item-value">138****8888</Text>
128
-              </View>
129
-              <View className="line"></View>
130
-              <View className="personal-info-item">
131
-                <Text className="personal-info-item-label">推荐绑定时间</Text>
132
-                <Text className="personal-info-item-value">
133
-                  2024-03-21 12:00:00
134
-                </Text>
111
+              <View className="line-column"></View>
112
+              <View className="info-bottom">
113
+                {/* <View className="personal-info-item">
114
+                  <Text className="personal-info-item-label">手机号</Text>
115
+                  <Text className="personal-info-item-value">{partnerDetail.phone}</Text>
116
+                </View> */}
117
+                <View style={{width: '46%'}} className="personal-info-item">
118
+                  <Text className="personal-info-item-label">推荐绑定时间</Text>
119
+                  <Text className="personal-info-item-value">
120
+                    {partnerDetail.start_date}
121
+                  </Text>
122
+                </View>
123
+                <View className="line"></View>
135
               </View>
124
               </View>
136
             </View>
125
             </View>
137
-          </View>
126
+          )}
138
           {/* 订单列表 */}
127
           {/* 订单列表 */}
139
           <View className="order-list">
128
           <View className="order-list">
140
-            {orderList.map((item, index) => (
129
+            {orderList && orderList.map((item, index) => (
141
               <View className="order-item" key={index}>
130
               <View className="order-item" key={index}>
142
                 {/* 订单信息 */}
131
                 {/* 订单信息 */}
143
                 <View className="order-info">
132
                 <View className="order-info">
@@ -185,7 +174,7 @@ export default class Index extends Component {
185
               </View>
174
               </View>
186
             ))}
175
             ))}
187
           </View>
176
           </View>
188
-          {orderList.length === 0 && (
177
+          {orderList && orderList.length === 0 && (
189
             <AtDivider
178
             <AtDivider
190
               content="暂无成交订单"
179
               content="暂无成交订单"
191
               fontColor="#B5B5B5"
180
               fontColor="#B5B5B5"

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

@@ -55,7 +55,6 @@
55
                     width: 144px;
55
                     width: 144px;
56
                     height: 144px;
56
                     height: 144px;
57
                     border-radius: 50%;
57
                     border-radius: 50%;
58
-                    background-color: red;
59
                 }
58
                 }
60
             }
59
             }
61
         }
60
         }
@@ -79,7 +78,8 @@
79
                 align-items: center;
78
                 align-items: center;
80
 
79
 
81
                 .personal-info-item {
80
                 .personal-info-item {
82
-                    flex: 1;
81
+                    width: 50%;
82
+                    // flex: 1;
83
                     display: flex;
83
                     display: flex;
84
                     flex-direction: column;
84
                     flex-direction: column;
85
                     padding: 36px 0 33px 17px;
85
                     padding: 36px 0 33px 17px;