myWallet.vue
8.6 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
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<template>
<view>
<!-- 导航栏区域 -->
<view class="navBarWrap" :style="{'padding-top':statusBarHeight+'rpx'}">
<image @click="back" src="../../static/image/back_white.png" mode=""></image>
我的钱包
<view style="width: 44rpx;"></view>
<!-- <image @click="shareFlag = true" src="../../static/image/Group_365@2x.png" mode=""></image> -->
</view>
<!-- 钱包余额区域 -->
<view class="walletBalWrap">
<!-- 实名认证:现在在“礼物收益”界面中,应调换到“我的钱包” -->
<view class="checkNameTxt" v-if="userInfo.id_no == ''" @click="href('checkName')">
为了不影响您使用钱包,请先实名认证
</view>
<view class="balVal">
{{wallet.gift_money}}
</view>
<view class="bottomBtn" @click="turnOut">
<view class="btn">
提现
</view>
</view>
<!-- <view class="walletBal" @click="href('wallet/accountDetail')">账户明细<image src="../../static/image/my/right_white.png" mode=""></image></view> -->
<view class="detailBtn" @click="href('wallet/accountDetail')">
账户明细
<image src="../../static/image/my/right_white.png" mode=""></image>
</view>
<view class="incomeWrap">
<view class="income">
<view class="incomeItem" @click="href('recharge')">
<view class="title">
问野币
</view>
<view class="val">
<text>{{wallet.landlord_money | formatPrice}}</text>
</view>
</view>
<view class="incomeItem" @click="href('wallet/giftProceeds?pgType=gift')">
<view class="title">
礼物收益
</view>
<view class="val">
<text>{{wallet.gift_total}}</text>
</view>
</view>
<!-- <view class="incomeItem" @click="href('wallet/giftProceeds?pgType=appoint')">
<view class="title">
预约收益
</view>
<view class="val">
<text>{{wallet.make_total}}</text>
</view>
</view> -->
</view>
</view>
<view class="moreServiceWrap">
<view class="title">
更多服务
</view>
<view class="serviceList">
<!-- <view class="serviceItem" @click="href('recharge')">
<view class="img">
<image src="../../static/image/my/Group_584@2x.png" mode=""></image>
</view>
<view class="serviceTitle">
充值问野币
</view>
</view> -->
<!-- 钱包:首次进入应“设置支付密码”,现在是“修改支付密码”(设置完之后再进入才是“修改支付密码”) -->
<view class="serviceItem" @click="href(userInfo.pay_password == '' ? 'changePayPassword' : 'checkPayPassword')">
<view class="img">
<image src="../../static/image/my/Group_583@2x.png" mode=""></image>
</view>
<view class="serviceTitle">
{{userInfo.pay_password == '' ? '设置' : '修改'}}支付密码
</view>
</view>
<!-- <view class="serviceItem" @click="bindWechat">
<view class="img">
<image src="../../static/image/my/zhanghu-3_1@2x.png" mode=""></image>
</view>
<view class="serviceTitle">
{{userInfo.bind_wechat == '' ? '绑定' : '已绑定'}}提现账户
</view>
</view> -->
</view>
</view>
</view>
</view>
</template>
<script>
// var apiUrl = 'http://landlord.t.brotop.cn/api'
var apiUrl = 'http://app.zhaodizhu.cn/api'
export default{
data(){
return{
statusBarHeight:0,
userInfo:{},
wallet:{}
}
},
created() {
//获取状态栏高度
uni.getSystemInfo({
success: (res) => {
this.statusBarHeight = res.statusBarHeight*2
}
})
},
onShow() {
this.getData()
},
filters:{
formatPrice(data){
return parseFloat(data).toFixed(0);
}
},
methods:{
getData(){
this.$request('/wallet/index').then((res)=>{
console.log('钱包页面',res)
this.wallet = res.data
})
//获取用户信息
this.$request('/user/info').then((res)=>{
this.userInfo = res.data
})
},
back(){
this.$href('my',2)
},
//绑定微信
bindWechat(){
if(this.userInfo.bind_wechat != ''){
return
}
let that = this
uni.login({
provider: 'weixin',
success: function (loginRes) {
console.log(loginRes.authResult);
// 获取用户信息
uni.getUserInfo({
provider: 'weixin',
success: function (infoRes) {
uni.request({
url:apiUrl+'/api/user/bindWechat',
method:'POST',
data:{
extend:infoRes.userInfo
},
header: {
'token': uni.getStorageSync('token')
},
success: (res) => {
console.log('绑定微信',res)
if(res.data.code == 1){
that.getData()
uni.showToast({
title:'绑定成功'
})
}else{
uni.showToast({
title:res.data.msg,
icon:'none'
})
}
}
})
}
});
}
});
},
href(url){
this.$href(url)
},
//提现
turnOut(){
/* if(this.userInfo.id_no == ''){
uni.showToast({
title:'请先进行实名认证',
icon:'none'
})
return
} */
if(this.userInfo.pay_password == ''){
uni.showToast({
title:'请先设置支付密码',
icon:'none'
})
return
}
this.$href('wallet/turnOut')
},
//绑定提现账户
bindAcount(){
/* uni.showActionSheet({
itemList: ['绑定微信', '绑定支付宝'],
success: (res) => {
if (res.tapIndex == 1) {
this.$href('bindAccount?type=zfb')
} else if (res.tapIndex == 0) {
this.$href('bindAccount?type=wx')
}
},
fail: (res) => {
console.log(res.errMsg);
}
}); */
this.$href('bindAccount?type=wx')
}
}
}
</script>
<style lang="scss" scoped>
page{background: #f8f8f9;}
/* 导航栏区域 */
.navBarWrap{height: 88rpx;padding: var(--status-bar-height) 32rpx 0 32rpx;display: flex;align-items: center;justify-content: space-between;background: #588989;color: #fff;}
.navBarWrap image{width: 44rpx;height: 44rpx;}
/* 导航栏区域 */
.navBarWrap{height: 88rpx;padding: 0 32rpx;display: flex;align-items: center;justify-content: space-between;}
.navBarWrap image{width: 44rpx;height: 44rpx;}
/* 钱包余额区域 */
.walletBalWrap{
background: url(../../static/image/my/Frame_150@2x.png) no-repeat;
background-size: 100% 334rpx;
height: 334rpx;
position: relative;
.balVal{
padding-top: 16rpx;
font-size: 88rpx;
color: #fff;
text-align: center;
}
.walletBal{
display: flex;
align-items: center;
font-size: 28rpx;
color: #fff;
justify-content: center;
image{width: 28rpx;height: 28rpx;}
}
.bottomBtn{
padding-top: 14rpx;
display: flex;
justify-content: center;
.btn{
width: 168rpx;
height: 54rpx;
border: 2rpx solid #ffffff;
border-radius: 104rpx;
font-size: 24rpx;
color: #fff;
text-align: center;
line-height: 54rpx;
}
}
.detailBtn{
position: absolute;
right: 0;
top: 54rpx;
width: 176rpx;
height: 52rpx;
background: rgba(255,255,255,0.30);
border-radius: 50rpx 0 0 50rpx;
display: flex;
align-items: center;
font-size: 24rpx;
color: #fff;
justify-content: center;
image{width: 27rpx;height: 27rpx;}
}
.incomeWrap{
display: flex;
justify-content: center;
padding: 16rpx 24rpx 0 24rpx;
.income{
width: 100%;
height: 172rpx;
background: #fff;
border-radius: 16rpx;
box-shadow: 0rpx 20rpx 40rpx 0rpx rgba(12,98,98,0.07);
padding: 32rpx 0 30rpx 0;
display: flex;
.incomeItem{
flex: 1;
border-right: 2rpx solid #f0f0f0;
.title{
color: #9897a3;
font-size: 24rpx;
text-align: center;
}
.val{
padding-top: 32rpx;
color: #4a8b94;
text-align: center;
text{font-size: 48rpx;}
}
}
}
.income .incomeItem:nth-of-type(3){border-right: none;}
}
.checkNameTxt{
padding-top: 10rpx;
font-size: 22rpx;
text-align: center;
color: #fff;
}
.moreServiceWrap{
padding: 0 32rpx;
.title{
height: 100rpx;
font-size: 32rpx;
color: #646566;
line-height: 100rpx;
font-weight: 600;
}
.serviceList{
display: flex;
height: 206rpx;
background: #fff;
border-radius: 16rpx;
box-shadow: 0rpx 28rpx 34rpx 0rpx rgba(15,36,152,0.05);
align-items: center;
.serviceItem{
flex: 1;
.img{
display: flex;
justify-content: center;
image{width: 68rpx;height: 68rpx;}
}
.serviceTitle{
color: #646566;
font-size: 24rpx;
text-align: center;
padding-top: 24rpx;
}
}
}
}
}
/* 收益区域 */
/* 更多服务区域 */
</style>