<template>
<view style="padding: 200rpx">
<input
v-model="money"
type="number"
placeholder="金额(元)"
/>
<button @tap="withdraw">确定</button>
</view>
</template>
<script>
export default {
data() {
return {
money: "",
};
},
methods: {
withdrawFX() {
if (this.money <= 0) {
this.$u.toast('请输入提现金额');
return;
}
let mon = this.money.trim() + ''
let arr = mon.trim().split('.')
if(arr[1]&&arr[1].length >= 3){
this.$u.toast('请输入正确的提现金额');
return
}
if(isNaN(mon)){
this.$u.toast('请输入正确的提现金额');
return
}
console.log(mon)
}
},
};
</script>
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交