|
|
@@ -7,6 +7,7 @@ import {getAgentInfo, getRevenueSharing, getSelectUserInviteProfit} from "~/apis
|
|
7
|
7
|
import type {RevenueSharingModel} from "~/apis/model/revenueSharingModel";
|
|
8
|
8
|
import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
|
|
9
|
9
|
import {encodeBase64} from "~/utils/http/helper";
|
|
|
10
|
+
|
|
10
|
11
|
const userStore = useUserStore()
|
|
11
|
12
|
const state = reactive({
|
|
12
|
13
|
numberSun: '',
|
|
|
@@ -21,19 +22,26 @@ const state = reactive({
|
|
21
|
22
|
|
|
22
|
23
|
currentTab: 0,
|
|
23
|
24
|
list: [
|
|
24
|
|
- // {
|
|
25
|
|
- // order_sn: '11111',
|
|
26
|
|
- // status: 0,
|
|
27
|
|
- // content: '预估用户1502111',
|
|
28
|
|
- // xiadan: '2023-08-04',
|
|
29
|
|
- // jiesuan: '2023-08-05',
|
|
30
|
|
- // number: 0.10
|
|
31
|
|
- // }
|
|
32
|
|
- ]
|
|
|
25
|
+ // {
|
|
|
26
|
+ // order_sn: '11111',
|
|
|
27
|
+ // status: 0,
|
|
|
28
|
+ // content: '预估用户1502111',
|
|
|
29
|
+ // xiadan: '2023-08-04',
|
|
|
30
|
+ // jiesuan: '2023-08-05',
|
|
|
31
|
+ // number: 0.10
|
|
|
32
|
+ // }
|
|
|
33
|
+ ],
|
|
|
34
|
+
|
|
|
35
|
+ currentPage: 1,
|
|
|
36
|
+ pageSize: 10,
|
|
|
37
|
+ totalPage: 1,
|
|
|
38
|
+
|
|
|
39
|
+ status: 'noMore',
|
|
|
40
|
+ type: 0,
|
|
33
|
41
|
})
|
|
34
|
42
|
onLoad((option: any) => {
|
|
35
|
43
|
// 未结算收益
|
|
36
|
|
- getSelectUserInviteProfit({ uid: userStore.uid }).then(res => {
|
|
|
44
|
+ getSelectUserInviteProfit({uid: userStore.uid}).then(res => {
|
|
37
|
45
|
console.log(res)
|
|
38
|
46
|
state.numberSun = res.numberSun
|
|
39
|
47
|
state.UserUnsettledInviteProfit = res.UserUnsettledInviteProfit
|
|
|
@@ -49,26 +57,52 @@ onLoad((option: any) => {
|
|
49
|
57
|
state.cumulative = res.cumulative
|
|
50
|
58
|
state.extract = res.extract
|
|
51
|
59
|
})
|
|
52
|
|
- loadList(0)
|
|
|
60
|
+ // loadList(0)
|
|
|
61
|
+ loadList('reload')
|
|
53
|
62
|
})
|
|
54
|
63
|
|
|
55
|
|
-function loadList(type: number) {
|
|
56
|
|
- getRevenueSharing({
|
|
57
|
|
- page: 1,
|
|
58
|
|
- limit: 20,
|
|
59
|
|
- type
|
|
60
|
|
- }).then((res: Array<RevenueSharingModel>) => {
|
|
|
64
|
+// function loadList(type: number) {
|
|
|
65
|
+// getRevenueSharing({
|
|
|
66
|
+// page: 1,
|
|
|
67
|
+// limit: 20,
|
|
|
68
|
+// type
|
|
|
69
|
+// }).then((res: Array<RevenueSharingModel>) => {
|
|
61
|
70
|
// if (res && res.length > 0) {
|
|
62
|
|
- console.log(res)
|
|
|
71
|
+ // console.log(res)
|
|
|
72
|
+ // state.list = res
|
|
|
73
|
+ // }
|
|
|
74
|
+ // })
|
|
|
75
|
+//
|
|
|
76
|
+// }
|
|
|
77
|
+
|
|
|
78
|
+function loadList(action: 'page' | 'reload', callback?: (items) => void) {
|
|
|
79
|
+ getRevenueSharing({
|
|
|
80
|
+ page: state.currentPage,
|
|
|
81
|
+ limit: state.pageSize,
|
|
|
82
|
+ type: state.type
|
|
|
83
|
+ }).then(res => {
|
|
|
84
|
+ if (action === 'page' && res.length > 0) {
|
|
|
85
|
+ state.list = state.list.concat(res)
|
|
|
86
|
+ }
|
|
|
87
|
+ if (action === 'reload') {
|
|
63
|
88
|
state.list = res
|
|
|
89
|
+ }
|
|
|
90
|
+ // if (res && res.length === 0) {
|
|
64
|
91
|
// }
|
|
65
|
|
- })
|
|
66
|
92
|
|
|
|
93
|
+ if (callback) {
|
|
|
94
|
+ callback(res)
|
|
|
95
|
+ }
|
|
|
96
|
+ })
|
|
67
|
97
|
}
|
|
|
98
|
+
|
|
68
|
99
|
function handleTabClick(type) {
|
|
69
|
100
|
state.currentTab = type
|
|
70
|
|
- loadList(type)
|
|
|
101
|
+ state.type = type
|
|
|
102
|
+ loadList('reload')
|
|
|
103
|
+ // loadList(type)
|
|
71
|
104
|
}
|
|
|
105
|
+
|
|
72
|
106
|
function getStatusText(status: number) {
|
|
73
|
107
|
////状态:0-未结算。1-已结算。-1-失效
|
|
74
|
108
|
if (status == 0) {
|
|
|
@@ -87,16 +121,45 @@ function handleItemClick(item) {
|
|
87
|
121
|
url: '/pages/revenue-sharing/detail?detail=' + encodeBase64(Object.assign({}, item))
|
|
88
|
122
|
})
|
|
89
|
123
|
}
|
|
|
124
|
+
|
|
|
125
|
+function handleScrollToLower() {
|
|
|
126
|
+ state.status = 'loading';
|
|
|
127
|
+ state.currentPage += 1;
|
|
|
128
|
+ setTimeout(() => {
|
|
|
129
|
+ loadList('page', (items) => {
|
|
|
130
|
+ if (items.length === 0) {
|
|
|
131
|
+ state.status = 'noMore'
|
|
|
132
|
+ }
|
|
|
133
|
+ })
|
|
|
134
|
+ }, 300)
|
|
|
135
|
+
|
|
|
136
|
+ // loadList('page', (items) => {
|
|
|
137
|
+ // })
|
|
|
138
|
+ // console.log(state.totalPage)
|
|
|
139
|
+ // if (state.currentPage > state.totalPage) {
|
|
|
140
|
+ // state.status = 'noMore';
|
|
|
141
|
+ // } else {
|
|
|
142
|
+ // setTimeout(() => {
|
|
|
143
|
+ // loadList('page')
|
|
|
144
|
+ // }, 300)
|
|
|
145
|
+ // }
|
|
|
146
|
+}
|
|
|
147
|
+
|
|
|
148
|
+onReachBottom(() => {
|
|
|
149
|
+ handleScrollToLower()
|
|
|
150
|
+
|
|
|
151
|
+})
|
|
90
|
152
|
</script>
|
|
91
|
153
|
|
|
92
|
154
|
<template>
|
|
93
|
|
- <div class="flex flex-col px-3">
|
|
94
|
|
- <div class="bg-[#FD1642] h-20 rounded-bottom-full w-full absolute top-0 left-0 z--1"></div>
|
|
|
155
|
+ <div class="flex flex-col ">
|
|
|
156
|
+ <div class="bg-[#FD1642] h-20 rounded-bottom-full w-full fixed top-0 left-0 z-1"></div>
|
|
95
|
157
|
|
|
96
|
|
- <div class=" py-3 flex flex-col gap-3 fixed top-0 z-2 w-full">
|
|
97
|
|
- <div class="w-full">
|
|
|
158
|
+ <div class=" flex flex-col gap-3 fixed top-0 z-2 w-full">
|
|
|
159
|
+
|
|
|
160
|
+ <div class="p-3">
|
|
98
|
161
|
<div class="bg-white rounded-lg p-2 flex flex-col gap-4 ">
|
|
99
|
|
- <div class="flex justify-around py-8">
|
|
|
162
|
+ <div class="flex justify-around py-8 w-full">
|
|
100
|
163
|
<div class="flex-1 flex flex-col justify-center items-center gap-2">
|
|
101
|
164
|
<div class="text-[11px] text-gray">累计佣金(元)</div>
|
|
102
|
165
|
<div class="font-bold ">
|
|
|
@@ -121,65 +184,79 @@ function handleItemClick(item) {
|
|
121
|
184
|
</div>
|
|
122
|
185
|
|
|
123
|
186
|
</div>
|
|
124
|
|
- <div class="flex justify-around text-center text-sm py-3 bg-gray-300">
|
|
|
187
|
+ <div class="flex justify-around text-center text-sm py-3 bg-[#f8f8f8] ">
|
|
125
|
188
|
<div
|
|
126
|
189
|
@click="handleTabClick(0)"
|
|
127
|
190
|
:class="state.currentTab === 0? 'text-primary' : ''"
|
|
128
|
|
- >线上商城明细</div>
|
|
|
191
|
+ >线上商城明细
|
|
|
192
|
+ </div>
|
|
129
|
193
|
<div
|
|
130
|
194
|
:class="state.currentTab === 1? 'text-primary' : ''"
|
|
131
|
195
|
@click="handleTabClick(1)"
|
|
132
|
|
- >线下实体明细</div>
|
|
|
196
|
+ >线下实体明细
|
|
|
197
|
+ </div>
|
|
133
|
198
|
</div>
|
|
134
|
199
|
</div>
|
|
135
|
|
-<!-- <div class="fixed top-50">-->
|
|
136
|
200
|
|
|
137
|
|
-<!-- </div>-->
|
|
|
201
|
+ <!-- <div class="fixed top-50">-->
|
|
|
202
|
+
|
|
|
203
|
+ <!-- </div>-->
|
|
138
|
204
|
|
|
139
|
205
|
|
|
140
|
206
|
</div>
|
|
141
|
|
- <div class="px-3 py-3 flex flex-col gap-3 pt-50">
|
|
|
207
|
+ <div class="px-3 py-3 flex flex-col gap-3 pt-45 pb-safe">
|
|
142
|
208
|
<div>
|
|
143
|
|
- <div v-if="state.list && state.list.length > 0" class="bg-white p-3 gap-3">
|
|
144
|
|
- <div v-for="(item, index) in state.list" :key="index"
|
|
145
|
|
- @click="handleItemClick(item)"
|
|
146
|
|
- >
|
|
147
|
|
- <div class="flex flex-col">
|
|
148
|
|
- <div class="flex justify-between text-gray text-xs items-center f-hairline-bottom pb-3">
|
|
149
|
|
- <div>订单号:{{ item.order_sn }}</div>
|
|
150
|
|
- <div>{{ getStatusText(item.status) }}</div>
|
|
151
|
|
- </div>
|
|
152
|
|
- <div class="font-bold flex py-2 justify-between">
|
|
153
|
|
- <div>
|
|
154
|
|
- {{ item.content }}
|
|
|
209
|
+ <div v-if="state.list && state.list.length > 0" class=" gap-3 flex flex-col">
|
|
|
210
|
+ <div class="bg-white p-3">
|
|
|
211
|
+ <div v-for="(item, index) in state.list" :key="index"
|
|
|
212
|
+ @click="handleItemClick(item)"
|
|
|
213
|
+ >
|
|
|
214
|
+ <div class="flex flex-col">
|
|
|
215
|
+ <div class="flex justify-between text-gray text-xs items-center f-hairline-bottom pb-3">
|
|
|
216
|
+ <div>订单号:{{ item.order_sn }}</div>
|
|
|
217
|
+ <div>{{ getStatusText(item.status) }}</div>
|
|
155
|
218
|
</div>
|
|
156
|
|
- <div class="text-primary">+{{ Number.parseFloat(item.number).toFixed(2) }}</div>
|
|
157
|
|
- </div>
|
|
158
|
|
- <div class="flex justify-between text-gray text-xs">
|
|
159
|
|
- <div class="flex flex-col">
|
|
160
|
|
- <div>消费时间</div>
|
|
161
|
|
- <div class="text-black text-sm">{{ item.xiadan }}</div>
|
|
|
219
|
+ <div class="font-bold flex py-2 justify-between">
|
|
|
220
|
+ <div>
|
|
|
221
|
+ {{ item.content }}
|
|
|
222
|
+ </div>
|
|
|
223
|
+ <div class="text-primary">+{{ Number.parseFloat(item.number).toFixed(2) }}</div>
|
|
162
|
224
|
</div>
|
|
163
|
|
- <div class="flex flex-col">
|
|
164
|
|
- <div>结算时间</div>
|
|
165
|
|
- <div class="text-black text-sm">{{ item.jiesuan }}</div>
|
|
|
225
|
+ <div class="flex justify-between text-gray text-xs">
|
|
|
226
|
+ <div class="flex flex-col">
|
|
|
227
|
+ <div>消费时间</div>
|
|
|
228
|
+ <div class="text-black text-sm">{{ item.xiadan }}</div>
|
|
|
229
|
+ </div>
|
|
|
230
|
+ <div class="flex flex-col">
|
|
|
231
|
+ <div>结算时间</div>
|
|
|
232
|
+ <div class="text-black text-sm">{{ item.jiesuan }}</div>
|
|
|
233
|
+ </div>
|
|
166
|
234
|
</div>
|
|
167
|
235
|
</div>
|
|
168
|
|
- </div>
|
|
169
|
236
|
|
|
170
|
237
|
|
|
|
238
|
+ </div>
|
|
|
239
|
+
|
|
|
240
|
+ </div>
|
|
171
|
241
|
|
|
|
242
|
+ <div class=" flex justify-center items-center text-[12px] text-gray-500" >
|
|
|
243
|
+ <div v-if="state.status === 'loading'">
|
|
|
244
|
+ 加载中...
|
|
|
245
|
+ </div>
|
|
|
246
|
+ <div v-if="state.status === 'noMore'">
|
|
|
247
|
+ 没有更多了~
|
|
|
248
|
+ </div>
|
|
172
|
249
|
</div>
|
|
|
250
|
+
|
|
173
|
251
|
</div>
|
|
174
|
252
|
|
|
175
|
253
|
<CXBEmpty v-else/>
|
|
176
|
254
|
</div>
|
|
177
|
255
|
|
|
178
|
256
|
</div>
|
|
179
|
|
-
|
|
180
|
257
|
</div>
|
|
181
|
258
|
</template>
|
|
182
|
|
-<route lang="yaml" type="home">
|
|
|
259
|
+<route lang="yaml">
|
|
183
|
260
|
style:
|
|
184
|
261
|
navigationBarBackgroundColor: "#FD1642"
|
|
185
|
262
|
navigationBarTextStyle: "white"
|
|
|
@@ -187,6 +264,6 @@ style:
|
|
187
|
264
|
</route>
|
|
188
|
265
|
<style>
|
|
189
|
266
|
page {
|
|
190
|
|
- background: #f8f8f8;
|
|
|
267
|
+ background: #f8f8f8;
|
|
191
|
268
|
}
|
|
192
|
269
|
</style>
|