|
@@ -1,53 +1,33 @@
|
1
|
1
|
import { Component } from "react";
|
2
|
2
|
import { View, Text, Image } from "@tarojs/components";
|
3
|
3
|
import "./index.less";
|
4
|
|
-import { AtDivider,AtActivityIndicator } from "taro-ui";
|
|
4
|
+import { AtDivider, AtActivityIndicator } from "taro-ui";
|
5
|
5
|
import level from "../../../images/partner/level.png";
|
6
|
6
|
import Taro from "@tarojs/taro";
|
7
|
7
|
import vip from "../../../images/earningsOrder/vip.png";
|
8
|
8
|
import { getPartnerDetail } from "../../../service";
|
9
|
9
|
export default class Index extends Component {
|
10
|
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
|
13
|
page: 1, //页数
|
38
|
14
|
loading: false, //加载状态
|
39
|
15
|
totalPages: 1, // 添加总页数
|
40
|
16
|
isNoMore: false,
|
41
|
17
|
};
|
42
|
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
|
26
|
const { page } = this.state;
|
48
|
27
|
this.setState({ loading: true });
|
49
|
28
|
|
50
|
29
|
const res = await getPartnerDetail({
|
|
30
|
+ partner_id: this.state.id,
|
51
|
31
|
page,
|
52
|
32
|
page_size: 10,
|
53
|
33
|
});
|
|
@@ -56,6 +36,7 @@ export default class Index extends Component {
|
56
|
36
|
orderList: isRefresh
|
57
|
37
|
? res.income_list
|
58
|
38
|
: [...prevState.orderList, ...res.income_list],
|
|
39
|
+ partnerDetail: res.partner_user,
|
59
|
40
|
totalPages: res.total_pages,
|
60
|
41
|
loading: false,
|
61
|
42
|
isNoMore: res.total_pages <= page,
|
|
@@ -91,53 +72,61 @@ export default class Index extends Component {
|
91
|
72
|
}
|
92
|
73
|
};
|
93
|
74
|
render() {
|
94
|
|
- const { orderList,loading,isNoMore } = this.state;
|
|
75
|
+ const { orderList, loading, isNoMore, partnerDetail } = this.state;
|
95
|
76
|
return (
|
96
|
77
|
<View className="index">
|
97
|
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
|
90
|
</View>
|
105
|
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
|
103
|
<Text className="personal-info-item-label">累计贡献管理奖</Text>
|
120
|
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
|
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
|
124
|
</View>
|
136
|
125
|
</View>
|
137
|
|
- </View>
|
|
126
|
+ )}
|
138
|
127
|
{/* 订单列表 */}
|
139
|
128
|
<View className="order-list">
|
140
|
|
- {orderList.map((item, index) => (
|
|
129
|
+ {orderList && orderList.map((item, index) => (
|
141
|
130
|
<View className="order-item" key={index}>
|
142
|
131
|
{/* 订单信息 */}
|
143
|
132
|
<View className="order-info">
|
|
@@ -185,7 +174,7 @@ export default class Index extends Component {
|
185
|
174
|
</View>
|
186
|
175
|
))}
|
187
|
176
|
</View>
|
188
|
|
- {orderList.length === 0 && (
|
|
177
|
+ {orderList && orderList.length === 0 && (
|
189
|
178
|
<AtDivider
|
190
|
179
|
content="暂无成交订单"
|
191
|
180
|
fontColor="#B5B5B5"
|