1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
| const app = getApp()
| let $api = require('../../utils/ajaxFn.js')
| const dateFmt = require('../../utils/date.js');
| Page({
| data: {
| isNomore: false,
| isgoOut:true,
| amt: 0,
| num: 0,
| url: '/sib/xcx/order/hbListInit',//初始化接口地址为花呗
| queryObj: {
| prodType: 200015,//初始化产品为花呗
| },
| activeTab2: 0,
| showRight: false,
| userStyle: {},
| value: '',//搜索框内容
| zfbVersionList: [],//通道数组
| termList: [],//期数数组
| prodList: [],//付息方式数组
| statusList: [],//状态数组
| priceArr: [
| {
| name: '0~999',
| code: 1
| },
| {
| name: '1000~1999',
| code: 2
| },
| {
| name: '2000~4999',
| code: 3
| },
| {
| name: '5000及以上',
| code: 4
| }
| ],//金额数组
| tabs2: [
| {
| title: '花呗分期',
| subTitle: '描述文案',
| },
| {
| title: '商户收款',
| subTitle: '描述文案',
| }
| ],//顶部产品数组
| list: []
| },
| onLoad() {
| this.setData({
| userStyle: app.userStyle,
| })
| },
| onShow() {
| this.getFilter()
| this.getList()
| this.setData({
| isgoOut: true,
| })
| },
| onHide() {
| // 页面被关闭
| this.setData({
| showRight: false,
| activeTab2: 0,
| url: '/sib/xcx/order/hbListInit',
| queryObj: { prodType: 200015 },
| value: '',
| list: [],
| isgoOut:false,
| })
| },
| test({ index, tabsName }) {
| console.log(222333)
| this.handleTabClick({ index, tabsName })
| },
| handleTabClick({ index, tabsName }) {
| console.log({ index, tabsName })
| this.setData({
| [tabsName]: index,
| isNomore: false,
| value: ''
| });
| if (index == 0) {
| this.setData({
| queryObj: { prodType: 200015 },
| url: '/sib/xcx/order/hbListInit',
| list: []
| })
| } else if (index == 1) {
| this.setData({
| queryObj: { prodType: 200008 },
| url: '/sib/xcx/order/dmfListInit',
| list: []
| })
| }
| this.getList()
| this.getFilter()
| },
| onhandInput(value) {
| this.setData({
| value: value
| })
| },
| onClear(){
| this.setData({
| value:''
| })
| },
| // 搜索框事件
| searchMation(value) {
| console.log(value)
| let obj = this.data.queryObj
| if (value) {
| obj.userName = value
| } else {
| obj.userName = ''
| delete obj.userName
| }
| delete obj.limitOrderId
| this.setData({
| list: [],
| isNomore: false,
| queryObj: {
| ...obj
| },
| })
| this.getList()
| },
| getFilter() {
| $api.ajax(
| this.data.url,
| 'POST',
| (res) => {
| let body = res.data.body
| if (this.data.activeTab2 == 0) {
| this.setData({
| zfbVersionList: body.zfbVersionList,
| termList: body.termList,
| prodList: body.prodList,
| statusList: body.statusList
| })
| }
| if (this.data.activeTab2 == 1) {
| this.setData({
| statusList: body.statusList
| })
| }
|
| },
| (err) => { },
| true
| )
| },
| // 获取列表
| getList() {
| $api.ajax(
| '/sib/xcx/order/list',
| 'POST',
| (res) => {
| this.setData({
| amt: res.data.body.amt,
| num: res.data.body.num
| })
|
| if (res.data.body.items.length < 1) {
| this.setData({
| isNomore: true
| })
| my.showToast({
| type: 'none',
| content: '没有更多了',
| duration: 2000,
| });
| } else {
| res.data.body.items.forEach(e => {
| e.creTime = dateFmt(e.creTime, 'YYYY-MM-DD HH:mm:ss')
| })
| this.setData({
| list: [...this.data.list, ...res.data.body.items],
| 'queryObj.limitOrderId': res.data.body.items[res.data.body.items.length - 1].orderId
| })
| }
|
|
| },
| (err) => { },
| true,
| {
| ...this.data.queryObj
| }
| )
| },
| // 滑动至底部处理
| lower() {
| if (!this.data.isNomore) {
| this.getList()
| }
| },
| // 查看详情
| goDetail(e) {
| let orderId = e.target.dataset.orderId
| switch (this.data.activeTab2) {
| case 0:
| my.navigateTo({
| url: `../order/hbfqOrder/hbfqOrder?orderId=${orderId}`
| });
| break;
| case 1:
| my.navigateTo({
| url: `../order/shskOrder/shskOrder?orderId=${orderId}`
| });
| break;
| }
| },
| // 展示弹出层
| showFilter() {
| this.setData({
| showRight: true
| })
| },
| // 自定义事件控制弹出层关闭
| onShowage(data) {
| this.setData({
| showRight: data
| });
| },
| // 自定义筛选事件
| onGetFilterInfo(data) {
| if (this.data.value) {
| var obj = { prodType: this.data.queryObj.prodType, ...data, userName: this.data.value }
| } else {
| var obj = { prodType: this.data.queryObj.prodType, ...data }
| }
| this.setData({
| list: [],
| isNomore: false,
| queryObj: { ...obj }
| })
| this.getList()
| }
| });
|
|