...
|
...
|
@@ -34,6 +34,11 @@ |
|
|
<Form-item label="提现金额" prop="withdrawAmount">
|
|
|
<input v-model="data.withdrawAmount" :disabled="isAble" placeholder="请选择日期获取提现金额" />
|
|
|
</Form-item>
|
|
|
<Form-item label="短信验证码">
|
|
|
<input v-model="data.verifyCode" placeholder="短信验证码" />
|
|
|
<Button v-show="show" type="primary" size="large" @click="getVerifyCode">获取验证码</Button>
|
|
|
<Button v-show="!show" type="default" size="large" disabled> {{ timeCount }}s 后重新发送</Button>
|
|
|
</Form-item>
|
|
|
<Form-item label="提现到帐号">
|
|
|
<span>{{ data.withdrawAccount }}</span>
|
|
|
</Form-item>
|
...
|
...
|
@@ -56,6 +61,7 @@ |
|
|
import moment from 'moment';
|
|
|
import crypto from 'util/crypto';
|
|
|
import FinanceService from 'services/finance/finance-service';
|
|
|
import ShopService from 'services/shop/shop-service';
|
|
|
import { WithdrawApply } from './store';
|
|
|
|
|
|
export default {
|
...
|
...
|
@@ -67,6 +73,7 @@ export default { |
|
|
token: this.$user.token,
|
|
|
timestamps: Math.round(new Date().getTime() / 1000),
|
|
|
};
|
|
|
this.shopService = new ShopService();
|
|
|
this.financeService = new FinanceService();
|
|
|
this.financeService
|
|
|
.shopWithdrawApplyInit(params)
|
...
|
...
|
@@ -97,9 +104,89 @@ export default { |
|
|
this.$Message.error('请求出错');
|
|
|
this.showLoading = false;
|
|
|
});
|
|
|
this.getShopInfo();
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
//获取店铺信息
|
|
|
getShopInfo() {
|
|
|
this.shopService.getShop().then(res => {
|
|
|
const { customerTel } = res.data;
|
|
|
this.shopPhone = customerTel;
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//验证短信验证码
|
|
|
verifySmsCode(verifyCode) {
|
|
|
if (!verifyCode || verifyCode === '') {
|
|
|
this.$Notice.error({
|
|
|
title: '提交错误',
|
|
|
desc: '验证码不能为空',
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
this.financeService.verifySmsCode({ phones: this.shopPhone, verifyCode }).then(res => {
|
|
|
if (res.code !== 200) {
|
|
|
this.$Notice.error({
|
|
|
title: '提交错误',
|
|
|
desc: res.message,
|
|
|
});
|
|
|
return false;
|
|
|
} else {
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//获取短信验证码
|
|
|
getVerifyCode() {
|
|
|
if (this.shopPhone === '') {
|
|
|
this.$Notice.error({
|
|
|
title: '发送失败',
|
|
|
desc: '店铺绑定手机为空,请先绑定手机',
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
this.validateBtn();
|
|
|
const smsParams = {
|
|
|
phones: this.shopPhone,
|
|
|
project: 'shop',
|
|
|
className: 'withdraw',
|
|
|
methodName: 'getVerifyCode',
|
|
|
};
|
|
|
return this.financeService.sendShopVerifyCode(smsParams).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
this.$Notice.success({
|
|
|
title: '发送成功',
|
|
|
desc: '验证码已发送到您手机!',
|
|
|
});
|
|
|
} else {
|
|
|
this.$Notice.error({
|
|
|
title: '发送失败',
|
|
|
desc: result.message,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 点击验证码后倒计时
|
|
|
validateBtn() {
|
|
|
const timeCount = 60;
|
|
|
if (!this.timer) {
|
|
|
this.timeCount = timeCount;
|
|
|
this.show = false;
|
|
|
this.timer = setInterval(() => {
|
|
|
if (this.timeCount > 0 && this.timeCount <= timeCount) {
|
|
|
this.timeCount--;
|
|
|
} else {
|
|
|
this.show = true;
|
|
|
clearInterval(this.timer);
|
|
|
this.timer = null;
|
|
|
}
|
|
|
}, 1000);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
backList() {
|
|
|
this.$router.push({ name: 'finance.withdraw.withdrawlist' });
|
|
|
},
|
...
|
...
|
@@ -130,10 +217,20 @@ export default { |
|
|
params.sign = crypto.md5(arrParams.join('|'));
|
|
|
params.account = this.$user.name;
|
|
|
params.timeout = 60000; // 提现超时时间60秒
|
|
|
// 短信验证码
|
|
|
params.verifyCode = this.data.verifyCode;
|
|
|
return params;
|
|
|
},
|
|
|
save() {
|
|
|
if (!this.beforeSave()) {
|
|
|
return false;
|
|
|
}
|
|
|
const applyParams = this.beforeSave();
|
|
|
|
|
|
if (!this.verifySmsCode(applyParams.verifyCode)) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
this.$Loading.start();
|
|
|
this.submitDisabled = true;
|
|
|
return this.financeService.shopWithdrawApply(applyParams).then(result => {
|
...
|
...
|
|