|
@@ -22,38 +22,38 @@ Page({
|
|
|
},
|
|
|
async withdrawalFun() {
|
|
|
let money = this.data.money
|
|
|
- /* if (isNaN(money)) {
|
|
|
- this.setData({
|
|
|
- errMsg: '金额不合法'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- // 判断金额是否超过两位小数
|
|
|
- var decimalCount = (money.split('.')[1] || '').length;
|
|
|
- if (decimalCount > 2) {
|
|
|
- this.setData({
|
|
|
- errMsg: '最多两位小数'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (money <= 0) {
|
|
|
- this.setData({
|
|
|
- errMsg: '请输入要提现的金额'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (money > this.data.allIncome.withdraw / 100) {
|
|
|
- this.setData({
|
|
|
- errMsg: '可提现金额不足'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- if (money > 500 || money < 50) {
|
|
|
- this.setData({
|
|
|
- errMsg: '提现金额需≥50元,单笔最高可提500元'
|
|
|
- })
|
|
|
- return
|
|
|
- } */
|
|
|
+ if (isNaN(money)) {
|
|
|
+ this.setData({
|
|
|
+ errMsg: '金额不合法'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断金额是否超过两位小数
|
|
|
+ var decimalCount = (money.split('.')[1] || '').length;
|
|
|
+ if (decimalCount > 2) {
|
|
|
+ this.setData({
|
|
|
+ errMsg: '最多两位小数'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (money <= 0) {
|
|
|
+ this.setData({
|
|
|
+ errMsg: '请输入要提现的金额'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (money > this.data.allIncome.withdraw / 100) {
|
|
|
+ this.setData({
|
|
|
+ errMsg: '可提现金额不足'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (money > 500 || money < 50) {
|
|
|
+ this.setData({
|
|
|
+ errMsg: '提现金额需≥50元,单笔最高可提500元'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
let res = await cashOut({
|
|
|
amount: money * 100
|
|
|
})
|