Blame view

pages/rechargeDetail/rechargeDetail.vue 7.51 KB
4b045f7c   刘淇   江阴初始化项目
1
  <template>
00a21ab7   chenbiao   add 余额明细 接口联调
2
  	<view>
0b55ba4d   chenbiao   add 余额明细 接口联调
3
4
5
  		<!-- scrollable speed="50" 滚动 -->
  		<uni-notice-bar backgroundColor="#f0ad4e" color="#fff"  single :text="detailText | tranNull"></uni-notice-bar>
  
00a21ab7   chenbiao   add 余额明细 接口联调
6
7
8
9
10
11
  		<view class="uni-list">
  			<view class="uni-list-cell">
  				<view class="uni-list-cell-left">
  					消费类型
  				</view>
  				<view class="uni-list-cell-db">
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
12
  					<picker @change="bindPickerChange" :value="index" :range="kindArray" :range-key="'kindName'">
00a21ab7   chenbiao   add 余额明细 接口联调
13
14
15
16
17
18
19
20
21
22
23
24
  						<view class="uni-input">{{kindArray[index].kindName}}</view>
  					</picker>
  				</view>
  			</view>
  		</view>
  
  		<view class="uni-list">
  			<view class="uni-list-cell">
  				<view class="uni-list-cell-left">
  					充值方式
  				</view>
  				<view class="uni-list-cell-db">
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
25
  					<picker @change="bindPickerChangeWay" :value="indexWay" :range="arrayWay" :range-key="'typeName'">
10ba946f   chenbiao   add 余额明细 接口联调
26
  						<view class="uni-input">{{arrayWay[indexWay].typeName}}</view>
00a21ab7   chenbiao   add 余额明细 接口联调
27
28
29
30
31
32
33
34
35
36
37
38
39
  					</picker>
  				</view>
  			</view>
  		</view>
  
  
  		<view class="uni-list">
  			<view class="uni-list-cell">
  				<view class="uni-list-cell-left">
  					开始时间
  				</view>
  				<view class="uni-list-cell-db">
  					<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindStartDateChange">
10ba946f   chenbiao   add 余额明细 接口联调
40
  						<view class="uni-input">{{beginDate}}</view>
00a21ab7   chenbiao   add 余额明细 接口联调
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  					</picker>
  				</view>
  			</view>
  		</view>
  
  		<view class="uni-list">
  			<view class="uni-list-cell">
  				<view class="uni-list-cell-left">
  					结束时间
  				</view>
  				<view class="uni-list-cell-db">
  					<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindEndDateChange">
  						<view class="uni-input">{{overDate}}</view>
  					</picker>
  				</view>
  			</view>
  		</view>
  
  		<view class="border-bg"></view>
  
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
61
  		<view class="" v-if="orderList.length > 0">
00a21ab7   chenbiao   add 余额明细 接口联调
62
  
0b55ba4d   chenbiao   add 余额明细 接口联调
63
  			<uni-list class="rechargeWrap pos-rel" v-for="(item, index) in orderList" :key="index">
00a21ab7   chenbiao   add 余额明细 接口联调
64
  				<view class="recordCon uni-list-cell-pd">
b8bb7d4e   chenbiao   add 余额明细 接口联调
65
66
  					<text class="color-black">{{item.changeFeeDetail}}</text>
  					<text>{{item.payStateDesc}}</text>
00a21ab7   chenbiao   add 余额明细 接口联调
67
68
  				</view>
  				<view class="recordCon uni-list-cell-pd">
0b55ba4d   chenbiao   add 余额明细 接口联调
69
70
71
72
73
  					<text v-if="item.typeName == '购买卡券'" class="color-green">{{item.typeName}}</text>
  					<text v-if="item.typeName == '微信充值'" class="color-green">{{item.typeName}}</text>
  					<text v-if="item.typeName == '支付停车费'" class="color-red">{{item.typeName}}</text>
  					<text v-if="item.typeName == '支付宝充值'" class="color-blue">{{item.typeName}}</text>
  					<text v-if="item.typeName == '平台现金充值'" class="color-red">{{item.typeName}}</text>
b8bb7d4e   chenbiao   add 余额明细 接口联调
74
  					<text>{{item.opTime}}</text>
00a21ab7   chenbiao   add 余额明细 接口联调
75
  				</view>
0b55ba4d   chenbiao   add 余额明细 接口联调
76
77
  				<view class="uni-icon pos-abs icon-arrowright uni-icon-arrowright">
  				</view>
00a21ab7   chenbiao   add 余额明细 接口联调
78
  			</uni-list>
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
79
  			<uni-load-more :status="status" />
00a21ab7   chenbiao   add 余额明细 接口联调
80
  
b8bb7d4e   chenbiao   add 余额明细 接口联调
81
  		</view>
00a21ab7   chenbiao   add 余额明细 接口联调
82
  
b8bb7d4e   chenbiao   add 余额明细 接口联调
83
84
85
86
87
  		<view v-else class="margin-top-30">
  			<image class="marginAuto" src="../../static/vipcard/novipcard.png" mode="aspectFit"></image>
  			<view class="text-center">
  				暂无记录
  			</view>
00a21ab7   chenbiao   add 余额明细 接口联调
88
  
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
89
90
  		</view>
  
00a21ab7   chenbiao   add 余额明细 接口联调
91
  
00a21ab7   chenbiao   add 余额明细 接口联调
92
  
00a21ab7   chenbiao   add 余额明细 接口联调
93
  	</view>
4b045f7c   刘淇   江阴初始化项目
94
95
96
  </template>
  
  <script>
00a21ab7   chenbiao   add 余额明细 接口联调
97
98
99
100
101
102
  	export default {
  		data() {
  			const currentDate = this.getDate({
  				format: true
  			})
  			return {
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
103
104
  
  				detailText: '',
00a21ab7   chenbiao   add 余额明细 接口联调
105
106
107
108
109
  				title: 'picker',
  				kindArray: [],
  				arrayWay: [],
  				index: 0,
  				indexWay: 0,
b8bb7d4e   chenbiao   add 余额明细 接口联调
110
111
  				kind: '',
  				type: '',
10ba946f   chenbiao   add 余额明细 接口联调
112
  				beginDate: currentDate,
00a21ab7   chenbiao   add 余额明细 接口联调
113
  				overDate: currentDate,
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
114
  				orderList: [],
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
115
  				// isLoadAll: false,
b8bb7d4e   chenbiao   add 余额明细 接口联调
116
  				totalPages: 1, // 总页数
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
117
  				page: 1,
b79857f8   刘淇   商户券明细
118
  				pageSize: 10,
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
119
  				status: 'no-more',
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
120
  
00a21ab7   chenbiao   add 余额明细 接口联调
121
122
123
124
125
126
  			}
  		},
  		onLoad(params) {
  			wx.showShareMenu({
  				withShareTicket: true
  			});
10ba946f   chenbiao   add 余额明细 接口联调
127
  			this.getKindType();
b79857f8   刘淇   商户券明细
128
  
00a21ab7   chenbiao   add 余额明细 接口联调
129
130
  		},
  		onShow() {
b79857f8   刘淇   商户券明细
131
  
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
132
133
134
  		},
  		// 下拉刷新触发
  		onPullDownRefresh(val) {
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
135
  
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
136
  			this.page = 1
b79857f8   刘淇   商户券明细
137
  			this.pageSize = this.pageSize
b8bb7d4e   chenbiao   add 余额明细 接口联调
138
  			this.totalPages = 1
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
139
  			this.orderList = []
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
140
  			console.log('下拉刷新', val)
b8bb7d4e   chenbiao   add 余额明细 接口联调
141
  			this.fetchData()
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
142
143
144
  		},
  		// 上拉加载触发
  		onReachBottom() {
6bbfedb1   刘淇   商户券明细
145
146
147
            console.log(this.totalPages)
            console.log(this.orderList.length)
  
ca970168   刘淇   商户券明细
148
149
150
151
152
153
            if (this.totalPages == this.orderList.length) {
              this.status = 'no-more'
              console.log('111')
              return
            } else {
              this.page++;
6bbfedb1   刘淇   商户券明细
154
              this.fetchData();
ca970168   刘淇   商户券明细
155
            }
00a21ab7   chenbiao   add 余额明细 接口联调
156
  		},
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
157
  
00a21ab7   chenbiao   add 余额明细 接口联调
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
  		computed: {
  			startDate() {
  				return this.getDate('start');
  			},
  			endDate() {
  				return this.getDate('end');
  			}
  		},
  		methods: {
  			getKindType() {
  				let that = this;
  				that.$myRequest({
  					url: that.$common.walletKindType,
  					method: 'POST',
  					data: that.$common.requestSign()
  				}).then(res => {
10ba946f   chenbiao   add 余额明细 接口联调
174
  
00a21ab7   chenbiao   add 余额明细 接口联调
175
  					let data = res.data;
00a21ab7   chenbiao   add 余额明细 接口联调
176
  					that.kindArray = data;
4d3d7875   chenbiao   add 余额明细 接口联调
177
  					that.kind = data[0].kind;
10ba946f   chenbiao   add 余额明细 接口联调
178
  					that.arrayWay = data[0].typeList;
4d3d7875   chenbiao   add 余额明细 接口联调
179
  					that.type = data[0].typeList[0].type;
10ba946f   chenbiao   add 余额明细 接口联调
180
  					console.log(data)
b8bb7d4e   chenbiao   add 余额明细 接口联调
181
182
  					console.log(that.kind, that.type)
  					that.getDetailSummary();
b79857f8   刘淇   商户券明细
183
  
b8bb7d4e   chenbiao   add 余额明细 接口联调
184
  					that.fetchData()
00a21ab7   chenbiao   add 余额明细 接口联调
185
186
187
188
189
  				})
  			},
  			bindPickerChange: function(e) {
  				let that = this;
  				that.index = e.detail.value
4d3d7875   chenbiao   add 余额明细 接口联调
190
  				that.kind = that.kindArray[that.index].kind;
10ba946f   chenbiao   add 余额明细 接口联调
191
  				that.arrayWay = that.kindArray[that.index].typeList;
4d3d7875   chenbiao   add 余额明细 接口联调
192
  				that.type = that.kindArray[that.index].typeList[0].type;
b8bb7d4e   chenbiao   add 余额明细 接口联调
193
194
  				console.log(that.kind, that.type)
  				that.getDetailSummary();
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
195
  				that.fetchData()
00a21ab7   chenbiao   add 余额明细 接口联调
196
197
198
  			},
  			bindPickerChangeWay: function(e) {
  				console.log('picker发送选择改变,携带值为', e.detail.value)
4d3d7875   chenbiao   add 余额明细 接口联调
199
  				this.indexWay = e.detail.value;
b8bb7d4e   chenbiao   add 余额明细 接口联调
200
201
202
  				this.type = this.arrayWay[this.indexWay].type;
  				console.log(this.kind, this.type)
  				this.getDetailSummary();
4d3d7875   chenbiao   add 余额明细 接口联调
203
  				this.fetchData()
00a21ab7   chenbiao   add 余额明细 接口联调
204
205
  			},
  			bindStartDateChange: function(e) {
10ba946f   chenbiao   add 余额明细 接口联调
206
  				this.beginDate = e.detail.value
b8bb7d4e   chenbiao   add 余额明细 接口联调
207
  				this.getDetailSummary();
4d3d7875   chenbiao   add 余额明细 接口联调
208
  				this.fetchData()
00a21ab7   chenbiao   add 余额明细 接口联调
209
210
211
  			},
  			bindEndDateChange: function(e) {
  				this.overDate = e.detail.value
b8bb7d4e   chenbiao   add 余额明细 接口联调
212
  				this.getDetailSummary();
4d3d7875   chenbiao   add 余额明细 接口联调
213
  				this.fetchData()
00a21ab7   chenbiao   add 余额明细 接口联调
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
  			},
  			getDate(type) {
  				const date = new Date();
  				let year = date.getFullYear();
  				let month = date.getMonth() + 1;
  				let day = date.getDate();
  				if (type === 'start') {
  					year = year - 60;
  				} else if (type === 'end') {
  					year = year + 2;
  				}
  				month = month > 9 ? month : '0' + month;
  				day = day > 9 ? day : '0' + day;
  				return `${year}-${month}-${day}`;
  			},
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
229
230
231
  			getDetailSummary() {
  				let that = this;
  				let data = {
4d3d7875   chenbiao   add 余额明细 接口联调
232
233
  					kind: that.kind,
  					type: that.type,
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
234
235
  					beginDate: new Date(that.beginDate + " 00:00:00"),
  					endDate: new Date(that.overDate + " 23:59:59")
10ba946f   chenbiao   add 余额明细 接口联调
236
237
238
239
240
241
242
  				};
  				console.log(data)
  				that.$myRequest({
  					url: that.$common.detailSummary,
  					method: 'POST',
  					data: that.$common.requestSign(data)
  				}).then(res => {
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
243
  
10ba946f   chenbiao   add 余额明细 接口联调
244
  					let data = res.data;
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
245
  					if (data.rechargeSummary) {
10ba946f   chenbiao   add 余额明细 接口联调
246
247
  						that.detailText = data.rechargeSummary
  					}
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
248
  					if (data.paySummary) {
10ba946f   chenbiao   add 余额明细 接口联调
249
250
  						that.detailText = data.paySummary
  					}
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
251
  
10ba946f   chenbiao   add 余额明细 接口联调
252
  				})
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
253
254
  
  			},
b8bb7d4e   chenbiao   add 余额明细 接口联调
255
  			fetchData() {
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
256
  				let that = this
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
257
  				that.status = 'loading'
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
258
259
260
  				let paramsData = {
  					pageNum: that.page,
  					pageSize: that.pageSize,
4d3d7875   chenbiao   add 余额明细 接口联调
261
262
  					kind: that.kind,
  					type: that.type,
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
263
264
265
  					beginDate: new Date(that.beginDate + " 00:00:00"),
  					endDate: new Date(that.overDate + " 23:59:59")
  				}
0b55ba4d   chenbiao   add 余额明细 接口联调
266
  			
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
267
268
269
270
271
  				that.$myRequest({
  					url: that.$common.walletDetailsPage,
  					method: 'POST',
  					data: that.$common.requestSign(paramsData)
  				}).then(res => {
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
272
273
  					if (res.data.pageTotals < 10) {
  						this.status = 'no-more'
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
274
  					} else {
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
275
  						this.status = 'more'
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
276
277
  					}
  
a8e36028   chenbiao   add 我的钱包 小程序支付 接口联调
278
279
280
  					that.totalPages = res.data.pageTotals;
  					that.orderList = that.orderList.concat(res.data.dataList)
  
b8bb7d4e   chenbiao   add 余额明细 接口联调
281
  
b9ec5385   chenbiao   add 余额明细 刷新下拉分页请求
282
283
284
285
286
287
288
  				})
  
  
  
  
  			},
  
00a21ab7   chenbiao   add 余额明细 接口联调
289
290
  		}
  	}
4b045f7c   刘淇   江阴初始化项目
291
292
293
  </script>
  
  <style lang="scss" scoped>
00a21ab7   chenbiao   add 余额明细 接口联调
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
  	.rechargeWrap {
  		position: relative;
  
  		.rechargeArrow {
  			position: absolute;
  			right: 10px;
  			top: 30px;
  			font-size: 20px;
  			color: #999;
  		}
  	}
  
  	.recordCon {
  		padding-right: 35px;
  		color: #999;
  		display: flex;
  		justify-content: space-between;
  	}
0b55ba4d   chenbiao   add 余额明细 接口联调
312
313
314
315
316
317
  	.icon-arrowright {
  		color: #bbb;
  		font-size: 20px;
  		right: 2upx;
  		top: 60upx;
  	}
4b045f7c   刘淇   江阴初始化项目
318
  </style>