1.设置充值金额

yj-dev
杨杰 3 years ago
parent 087440ba61
commit 4ae82dd51c
  1. 70
      subPages/trade-union-recharge/trade-union-recharge.vue

@ -21,14 +21,14 @@
{{amount}} {{amount}}
</view> </view>
</view> </view>
<view class="num"> <!-- <view class="num">
<view class="text"> <view class="text">
自定义充值金额 自定义充值金额
</view> </view>
<view class="input"> <view class="input">
<input type="number" maxlength="4" v-model="inputAmount" /> <input type="number" maxlength="4" v-model="inputAmount" />
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
@ -77,7 +77,7 @@
data() { data() {
return { return {
inputAmount: '', // inputAmount: '', //
amountList: [50, 100, 200], //3 amountList: [50, 100, 150], //3
paytype: 'wxpay', // paytype: 'wxpay', //
user: "", user: "",
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
@ -105,38 +105,38 @@
}); });
return; return;
} }
if (parseFloat(this.inputAmount).toString() == "NaN") { // if (parseFloat(this.inputAmount).toString() == "NaN") {
uni.showToast({ // uni.showToast({
title: '请输入正确金额', // title: '',
icon: 'none', // icon: 'none',
duration: 2000 // duration: 2000
}); // });
return; // return;
} // }
if (this.inputAmount <= 0) { // if (this.inputAmount <= 0) {
uni.showToast({ // uni.showToast({
title: '请输入大于0的金额', // title: '0',
icon: 'none', // icon: 'none',
duration: 2000 // duration: 2000
}); // });
return; // return;
} // }
if (this.inputAmount > 2000) { // if (this.inputAmount > 2000) {
uni.showToast({ // uni.showToast({
title: '充值金额不能超过大于2000', // title: '2000',
icon: 'none', // icon: 'none',
duration: 2000 // duration: 2000
}); // });
return; // return;
} // }
if (parseFloat(this.inputAmount).toFixed(2) != parseFloat(this.inputAmount)) { // if (parseFloat(this.inputAmount).toFixed(2) != parseFloat(this.inputAmount)) {
uni.showToast({ // uni.showToast({
title: '最多只能输入两位小数哦~', // title: '~',
icon: 'none', // icon: 'none',
duration: 2000 // duration: 2000
}); // });
return; // return;
} // }
uni.showLoading({ uni.showLoading({
title: '正在提交订单...' title: '正在提交订单...'
}) })

Loading…
Cancel
Save