accountDetail.vue
3.5 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
<template>
<view>
<view class="tabList">
<view class="tabItem" :class="{active:tabIndex == 0}" @click="changeTab(0)">
全部
</view>
<view class="tabItem" :class="{active:tabIndex == 1}" @click="changeTab(1)">
充值
</view>
<view class="tabItem" :class="{active:tabIndex == 2}" @click="changeTab(2)">
提现
</view>
<view class="line" :style="{left:60 + 210 * tabIndex + 105 - 40 + 'rpx'}"></view>
</view>
<view style="height: 88rpx;"></view>
<view class="detailListWrap">
<view class="detailItem" v-for="(item,index) in list" :key="index">
<view class="detailLeft">
<view class="detailTime">
{{item.createtime}}
</view>
<view class="detailDesc">
{{item.text}}
<!-- {{
item.type == '1' ? '余额充值' :
item.type == '2' ? '预约服务' :
item.type == '3' ? '尾款支付' :
item.type == '4' ? '送礼物' :
item.type == '5' ? '问野币充值' :
item.type == '6' ? '礼物收益' :
item.type == '7' ? '预约收益' :
item.type == '8' ? '预约退款' :
item.type == '9' ? '礼物收益提现' : '预约收益提现'
}} -->
</view>
</view>
<!-- 类型:1=余额充值,2=预约服务,3=尾款支付,4=送礼物,5=问野币充值,6=礼物收益,7=预约收益,8=预约退款,9=礼物收益提现,10=预约收益提现 -->
<text><!-- {{item.type == '1' || item.type == '5' || item.type == '6' || item.type == '7' || item.type == '9' || item.type == '10' ? '-' : '+'}} -->{{item.money}}</text>
</view>
</view>
</view>
</template>
<script>
export default{
data(){
return{
last_page:0,
current_page:1,
param:{
type:'1',//1=账户明细全部,2=充值,3=提现,4=收到礼物,5=送出礼物
page:1,
per_page:15
},
tabIndex:0,
list:[]
}
},
onShow() {
this.param.page = 1
this.last_page = 0
this.current_page = 1
this.list = []
this.getData()
},
onReachBottom(){
console.log('滑动到底部了')
if(this.current_page == this.last_page){
uni.showToast({
title:'无更多数据',
icon:'none'
})
}else{
this.param.page++
this.getData()
}
},
methods:{
getData(){
this.$request('/wallet/getDetailedList',this.param).then((res)=>{
this.last_page = res.data.last_page
this.current_page = res.data.current_page
this.list = this.list.concat(res.data.data)
})
},
changeTab(index){
this.param.page = 1
this.last_page = 0
this.current_page = 1
this.list = []
this.tabIndex = index
this.param.type = index == 0 ? '1' : index == 1 ? '2' : '3'
this.getData()
}
}
}
</script>
<style lang="scss" scoped>
page{background: #f8f8f9;}
.tabList{
position: fixed;
width: 100%;
height: 88rpx;
border-top: 2rpx solid rgba(25,24,51,0.06);
top: 0;
padding: 0 60rpx;
display: flex;
color: #969799;
font-size: 28rpx;
background: #fff;
z-index: 1;
.tabItem{
width: 210rpx;
text-align: center;
line-height: 88rpx;
}
.tabItem.active{
color: #35655f;
}
.line{
position: absolute;
bottom: 0;
width: 80rpx;
height: 6rpx;
background: #35655f;
border-radius: 4rpx;
transition: 0.5s;
}
}
.detailListWrap{
padding: 0 32rpx;
.detailItem{
height: 130rpx;
display: flex;
justify-content: space-between;
align-items: center;
text{font-size: 28rpx;}
.detailLeft{
.detailTime{
color: rgba(25,24,51,0.25);
font-size: 24rpx;
}
.detailDesc{
font-size: 28rpx;
}
}
}
}
</style>