accountFlow.vue
2.8 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
<template>
<view class="">
<image class="bg" src="/static/takeMoneyBg.png" mode=""></image>
<view class="top">
<view >账户余额:</view>
<view > <text style="32rpx">¥</text> {{money}}</view>
</view>
<scroll-view scroll-y="true" class="center" @scrolltolower="scrolltolower">
<view class="item flexA" v-for="item in list" :key="item.id">
<view class="left">
<view class="">{{item.memo}}</view>
<view class="">{{item.createtime_text}}</view>
</view>
<view class="right">
<view class="">{{item.money}}</view>
</view>
</view>
</scroll-view >
</view>
</template>
<script>
import { getUserInfo } from '@/api/mine.js'
import { moneyLog } from '@/api/mine.js'
export default{
data() {
return {
list:[],
money:'',
page:1,
lastPage:1
}
},
onShow() {
this.getUserInfo()
this.moneyLog()
},
methods: {
async getUserInfo(){
try {
const res = await getUserInfo()
this.money = res.user.money
console.log('getUserInfo', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('getUserInfo', err)
}
},
async moneyLog(){
try {
const res = await moneyLog(this.page)
this.list = this.list.concat(res.list.data)
this.lastPage = res.list.last_page
// console.log('moneyLog', res)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('moneyLog', err)
}
},
scrolltolower(){
if(this.page >= this.lastPage) return
this.page=this.page+1
this.moneyLog()
}
},
}
</script>
<style lang="less">
page {
background: #f6f6f6;
}
.bg {
overflow: hidden;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 366rpx;
}
.top {
position: absolute;
left: 32rpx;
top: 64rpx;
view:nth-child(1) {
color: rgba(0,0,0,0.4);
font-size: 28rpx;
}
view:nth-child(2) {
color: rgba(0,0,0,0.9);
font-size: 64rpx;
font-weight: 700;
}
}
.center {
position: absolute;
width: 100%;
left: 50%;
top: 220rpx;
height: calc(100vh - 220rpx);
border-radius: 24rpx;
padding: 40rpx 30rpx;
transform: translateX(-50%);
background: #fff;
box-sizing: border-box;
.item {
justify-content: space-between;
height: 144rpx;
border-bottom: 1px solid rgba(238,239,240,1);;
.left {
view:nth-child(1){
color: rgba(50,50,51,1);
font-size: 28rpx;
margin-bottom: 8rpx;
}
view:nth-child(2){
color: rgba(200,201,204,1);
font-size: 24rpx;
}
}
.right {
color: rgba(230,61,39,1);
font-size: 28rpx;
font-weight: 500;
}
}
}
</style>