xiaofeijilu.vue
4.2 KB
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
<template>
<view class="box">
<view class="kindnav">
<view class="kindnav_item" :class="currentTab==1?'kindactive':''" @click="navbarTap" data-id="1">数板
</view>
<view class="kindnav_item" :class="currentTab==2?'kindactive':''" @click="navbarTap" data-id="2">数管</view>
</view>
<view class="nodata" v-if="xiaofeilist.length==0">暂无数据</view>
<view class="xiaofeilist" v-if="currentTab==1">
<view class="xiaofeiitem" v-for="(item,index) in xiaofeilist" :key="index" @click="xiaofeijilushuban" :data-id="item.id">
<view class="xfitemleft">
<view class="ordernum">订单号:{{item.order_sn}}</view>
<view class="orderword">{{item.recharge}}</view>
</view>
<view class="orderright">
<view class="ordertime">
<view class="ordertimetop">{{item.createtime}} </view>
<view class="ordertimebottom">¥{{item.pay_money}}</view>
</view>
<view class="orderrow">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</view>
<view class="xiaofeilist" v-if="currentTab==2">
<view class="xiaofeiitem" v-for="(item,index) in xiaofeilist" :key="index" @click="xiaofeijilushuguan" :data-id="item.id">
<view class="xfitemleft">
<view class="ordernum">订单号:{{item.order_sn}}</view>
<view class="orderword">{{item.recharge}}</view>
</view>
<view class="orderright">
<view class="ordertime">
<view class="ordertimetop">{{item.createtime}} </view>
<view class="ordertimebottom">¥{{item.pay_money}}</view>
</view>
<view class="orderrow">
<image src="/static/img/rowright.png"></image>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue"
export default {
data() {
return {
xiaofeilist: [],
currentTab: 1,
page: 1,
type: 1,
}
},
methods: {
//获取消费记录
getxiaofilist() {
let param = {
page: this.page,
type: this.type
}
app.post("api/person/payRecordDetail", param, 'get')
.then(res => {
console.log(res);
this.xiaofeilist = this.xiaofeilist.concat(res)
})
.catch(err => {});
},
// 消费记录切换
navbarTap(e) {
console.log(e)
let id = e.currentTarget.dataset.id;
this.currentTab = id;
this.page = 1;
this.xiaofeilist = [],
this.page = 1
if (id == 1) {
this.type = 1
} else {
this.type = 2
}
this.getxiaofilist()
},
//消费记录详情
xiaofeijilushuban(e) {
let id = e.currentTarget.dataset.id;
console.log(id)
uni.navigateTo({
url: '/pages/dingdanxiangqing/dingdanxiangqing?id=' + id + '&type=' + 0
})
},
xiaofeijilushuguan(e) {
let id = e.currentTarget.dataset.id;
console.log(id)
uni.navigateTo({
url: '/pages/dingdanxiangqing/dingdanxiangqing?id=' + id + '&type=' + 1
})
}
},
mounted() {
this.page = 1;
this.xiaofeilist = [];
this.getxiaofilist();
},
onReachBottom() {
let newpage = this.page;
newpage++;
this.page = newpage;
this.getxiaofilist()
},
}
</script>
<style>
.xiaofeiitem {
display: flex;
align-items: center;
justify-content: space-between;
padding: 36rpx 32rpx;
box-sizing: border-box;
background: #fff;
}
.xiaofeilist {
width: 750rpx;
box-sizing: border-box;
}
.ordernum {
color: #0A0808;
font-size: 28rpx;
}
.orderword {
color: #7F8389;
font-size: 26rpx;
margin-top: 22rpx
}
.orderright {
display: flex;
align-items: center;
}
.ordertimetop {
color: #7F8389;
font-size: 26rpx;
}
.ordertimebottom {
color: #F29600;
font-size: 26rpx;
margin-top: 22rpx
}
.orderrow {
width: 48rpx;
height: 48rpx;
font-size: 0;
margin-left: 0rpx;
}
.kindnav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 158rpx;
box-sizing: border-box;
background: #fff;
}
.kindnav_item {
color: #7F8389;
font-size: 30rpx;
}
.kindactive {
color: #F29600;
position: relative
}
.kindactive::after {
display: block;
content: '';
width: 48rpx;
height: 6rpx;
background: #F29600;
position: absolute;
left: 50%;
right: 50%;
transform: translate(-50%, -50%);
bottom: -20rpx;
}
</style>