myWall.vue
4.1 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
<template>
<view v-if="showMyWall">
<view class="moneyWrap">
<view class="money">
<view class="moneyNum">
¥<text>{{myMoney.Money}}</text>
</view>
<view class="moneyBal">
钱包余额
</view>
<view class="moneyHandle">
<text @click="href('moneyDetail')">收益明细</text>
|
<text @click="href('moneyRecord')">提现记录</text>
</view>
</view>
</view>
<view class="moneyHadleWrap">
<view class="titleDesc">
<view class="titleLabel"></view>
提现
</view>
<view class="moneyInput">
<input type="number" @input="validateNumber" v-model="money" placeholder="请输入金额"/>
</view>
<view class="titleDesc">
<view class="titleLabel"></view>
规则说明
</view>
<view class="desc">
<parse :content="myMoney.Content" :imageProp="{'domain':'www.mall.com'}"></parse>
</view>
</view>
<view style="height: 160rpx;"></view>
<view class="bottomWrap">
<view class="confirmBtn" @click="confirm">
确认提现
</view>
</view>
</view>
</template>
<script>
import parse from '../../components/gaoyia-parse/parse.vue'
export default{
data(){
return{
money:'',
myMoney:{},
showMyWall:false
}
},
components:{
parse
},
onShow() {
this.getData()
},
methods:{
confirm(){
if(this.money == ''){
uni.showToast({
title:'请输入提现金额',
icon:'none'
})
return
}
if(this.money > this.myMoney.Money){
uni.showToast({
title:'体现金额高于钱包余额',
icon:'none'
})
return
}
if(this.money < this.myMoney.SmallMoney){
uni.showToast({
title:'体现金额低于最少提现金额',
icon:'none'
})
return
}
this.$request('/api/Config/OutMoney',{money:this.money},2).then((res)=>{
if(res.code == 1){
this.getData()
setTimeout(()=>{
uni.showToast({
title:'提现成功'
})
},1000)
}
})
},
validateNumber(e){
let val = e.detail.value
val = val.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
val = val.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
val = val.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
val = val.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数
if (val.indexOf(".") < 0 && val != "") {//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
val = parseFloat(val);
}
//重新赋值给input
this.$nextTick(() => {
this.money= val
})
},
getData(){
this.$request('/api/Config/MyMoneyBad').then((res)=>{
this.myMoney = res.data
this.showMyWall = true
})
},
href(url){
this.$href(url)
}
}
}
</script>
<style>
.moneyWrap{width: 100%;height: 356rpx;background: url(../../static/image/Frame-150@2x.png) no-repeat;background-size: 100% 356rpx;display: flex;justify-content: center;align-items: center;color: #fff;text-align: center;}
.moneyWrap .money{width: 306rpx;}
.moneyNum text{font-size: 72rpx;}
.moneyBal{font-size: 28rpx;}
.moneyHandle{font-size: 28rpx;display: flex;align-items: center;justify-content: space-between;margin-top: 32rpx;}
.moneyHadleWrap{padding: 32rpx;}
.titleDesc{display: flex;align-items: center;font-size: 28rpx;}
.titleLabel{
height: 32rpx;
width: 8rpx;
border-radius: 2px;
background-image: linear-gradient(to top, #fff , #491716);
margin-right: 10rpx;
}
.moneyInput{border: 1px solid #C8C9CC;border-radius: 14rpx;width: 100%;height: 96rpx;display: flex;align-items: center;margin: 10rpx 0;}
.moneyInput input{width: 100%;margin-left: 10rpx;font-size: 28rpx;}
.desc{color: #646566;font-size: 28rpx;line-height: 44rpx;margin-top: 10rpx;WORD-WRAP:break-word;TABLE-LAYOUT:fixed;word-break:break-all;}
.bottomWrap{width: 100%;height: 160rpx;position: fixed;bottom: 0;background: #fff;z-index: 9;display: flex;justify-content: center;align-items: center;}
.confirmBtn{background: #894746;border-radius: 4px;color: #fff;font-size: 32rpx;text-align: center;line-height: 80rpx;height: 80rpx;width: 686rpx;}
</style>