提交 9de31266 authored 作者: huaxinzhu's avatar huaxinzhu

1、资产-提现申请,获取验证码拦截校验;2、商品-上架商品-重置按钮修复

上级 17d82bb2
......@@ -30,13 +30,15 @@
</el-select>
</el-form-item>
<el-form-item label="提现金额" prop="money">
<el-input v-model="form.money" placeholder="提现金额大于等于100"
<el-input v-model="form.money"
@blur="onInputBlur($event)"
placeholder="提现金额大于等于100"
style="width:260px;"/>
</el-form-item>
<el-form-item label="短信验证码" prop="verifycode">
<el-input v-model="form.verifycode" placeholder="验证码" style="width:260px;">
<template slot="append">
<span v-show="show" @click="getCheckCode">获取验证码</span>
<span v-show="show" @click="getCheckCodeFn">获取验证码</span>
<span v-show="!show" class="count">{{count}} s</span>
</template>
</el-input>
......@@ -83,7 +85,10 @@
// 是否显示弹出层
open: true,
// 表单参数
form: {},
form: {
bankId: '',
money: ''
},
// 表单校验
rules: {
bankId: [{required: true, message: "请选择要提现的银行卡", trigger: "change"}],
......@@ -93,11 +98,7 @@
}
};
},
watch: {
// drawableCash: function() {
// this.drawableCash = this.drawableCash.toFixed(2);
// }
},
watch: {},
created() {
this.sellerId = this.$store.state.user.sellerid;
this.getList();
......@@ -141,21 +142,38 @@
}, 1000)
}
},
getCheckCode() {
if (this.money <= 0) {
this.msgError("填写提现金额");
return false
} else if (this.money < 100) {
getCheckCodeFn() {
let numRegExp = /^[0-9]+(.[0-9]{2})?$/;
if(this.form.bankId === '') {
this.$refs.form.validateField("bankId");
return;
}
if(this.form.money === '') {
this.$refs.form.validateField("money");
return;
}
if(!numRegExp.test(this.form.money)) {
this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'});
return;
}
if (this.form.money > this.drawableCash) {
this.$message({type: 'warning',message:'提现金额不足'});
return;
} else if (this.form.money < 100) {
this.msgError("提现金额必须大于等于100");
return false
return;
}
// 倒计时
this.getCode()
//发送验证码
if (this.sellerId <= 0) {
this.msgError("商户信息错误");
return false
return;
}
// 倒计时效果
this.getCode()
getCheckCode({sellerId: this.sellerId}).then(response => {
if (response.code == 0) {
this.msgSuccess(response.msg);
......@@ -164,22 +182,26 @@
},
// onInputBlur(event) {
// let fee = 0.006;
// this.money = event.target.value;
// let numRegExp = /^[0-9]+(.[0-9]{2})?$/;
// let yue = this.drawableCash;
// if (this.money > yue) {
// this.$message({type: 'warning',message:'提现金额不足'});
// return false
// }
// if(!numRegExp.test(this.money)) {
// this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'});
// return;
// }else {
// this.newFee = (this.money * fee + 1).toFixed(2);
// }
// },
onInputBlur(event) {
let fee = 0.006;
this.form.money = event.target.value;
let numRegExp = /^[0-9]+(.[0-9]{2})?$/;
if(this.form.money !== '') {
if(!numRegExp.test(this.form.money)) {
this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'});
return;
}
if (this.form.money > this.drawableCash) {
this.$message({type: 'warning',message:'提现金额不足!'});
return;
}
if (this.form.money < 100) {
this.$message({type: 'warning',message:'提现金额需大于或者等于 100'});
return;
}
this.newFee = (this.form.money * fee + 1).toFixed(2);
}
},
//获取商户的信息
getSellerInfo() {
const sellerid = this.sellerId;
......@@ -193,7 +215,7 @@
//获取商户的银行卡列表
getBankcardList() {
getBankcardList({sellerId: this.sellerId}).then(response => {
this.banklist = response.data.list
this.banklist = response.data.list;
});
},
......@@ -215,7 +237,6 @@
/** 提交按钮 */
submitForm() {
// inSureCashOut 为true的时候,则不能不能不能点击提现按钮,操作提现,false的时候,才能点击操作提现
this.$refs["form"].validate(valid => {
if (valid) {
this.form.sellerId = this.sellerId;
......@@ -229,7 +250,7 @@
return;
}
if(this.form.money > this.drawableCash ) {
this.$message({type: 'error',message: '可提现金额不足哦!'});
this.$message({type: 'error',message: '提现金额不足!'});
return;
}
addWithdrawlog(this.form).then(response => {
......
......@@ -149,7 +149,9 @@
open: false,
// 查询参数
queryParams: {
isOnsale: 1
isOnsale: 1,
goodsId: '',
goodsName: ''
},
// 表单参数
form: {},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论