|
@@ -7,10 +7,27 @@
|
|
|
@close="close"
|
|
|
>
|
|
|
<el-form :inline="true" :model="form" :rules="rules" ref="form">
|
|
|
- <el-form-item label="提现金额:">
|
|
|
- <el-input v-model="form.money" placeholder="请输入提现金额"> </el-input>
|
|
|
+ <el-form-item label="提现金额:" prop="cash">
|
|
|
+ <el-input
|
|
|
+ @input="formatNum(form.cash, 'cash')"
|
|
|
+ v-model.Number="form.cash"
|
|
|
+ placeholder="请输入提现金额"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <div class="step-box">
|
|
|
+ <el-steps :active="active" align-center>
|
|
|
+ <el-step title="微信账号授权"></el-step>
|
|
|
+ <el-step title="提现申请"></el-step>
|
|
|
+ <el-step title="提现审核"></el-step>
|
|
|
+ <el-step title="提现申请成功"></el-step>
|
|
|
+ </el-steps>
|
|
|
+ <div class="step-code-box" v-if="active == 1">
|
|
|
+ <vue-qr text="modelData.cardCode.name" :size="200"></vue-qr>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="withd-tips">
|
|
|
提现注意事项:
|
|
|
<p>1.当佣金被结算时有一定的冻结期,被解冻的佣金方可提现</p>
|
|
@@ -21,6 +38,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import vueQr from "vue-qr";
|
|
|
+import { checkBindGzh, withdrawal } from "@/api/salesman/user";
|
|
|
export default {
|
|
|
props: {
|
|
|
dialogVisible: {
|
|
@@ -31,6 +50,10 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
+ cash: {
|
|
|
+ type: Number,
|
|
|
+ default: 0,
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -50,22 +73,45 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
form: {
|
|
|
- money: 0,
|
|
|
+ cash: 0,
|
|
|
},
|
|
|
rules: {
|
|
|
- name: [
|
|
|
- { required: true, message: "请输入活动名称", trigger: "blur" },
|
|
|
- { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
|
|
|
- ],
|
|
|
+ cash: [{ required: true, message: "请输入提现金额", trigger: "blur" }],
|
|
|
},
|
|
|
+ reverse: true,
|
|
|
+ activities: [
|
|
|
+ {
|
|
|
+ content: "活动按期开始",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ content: "通过审核",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ content: "创建成功",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ active: 2,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
submitForm() {
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
+ if (this.active == 1) {
|
|
|
+ await this.checkBindGzh();
|
|
|
+ if (this.active == 1) {
|
|
|
+ this.$message.warning("请先微信授权");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ withdrawal(this.form).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("提现申请成功");
|
|
|
+ this.isShow = false;
|
|
|
+ this.$emit("getSellerInfo");
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
- console.log("error submit!!");
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
@@ -75,6 +121,27 @@ export default {
|
|
|
},
|
|
|
close() {
|
|
|
this.isShow = false;
|
|
|
+ this.$refs.form.clearValidate();
|
|
|
+ },
|
|
|
+ checkBindGzh() {
|
|
|
+ return checkBindGzh().then((res) => {
|
|
|
+ this.active = res.data ? 2 : 1;
|
|
|
+ return Promise.resolve();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ formatNum(val, key) {
|
|
|
+ if (val > this.cash) {
|
|
|
+ this.form[key] = this.cash;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let temp = val.toString();
|
|
|
+ temp = temp.replace(/。/g, ".");
|
|
|
+ temp = temp.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
|
|
|
+ temp = temp.replace(/^\./g, ""); //验证第一个字符是数字
|
|
|
+ temp = temp.replace(/\.{2,}/g, ""); //只保留第一个, 清除多余的
|
|
|
+ temp = temp.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
|
|
+ temp = temp.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
|
|
|
+ this.form[key] = temp;
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
@@ -87,14 +154,16 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.checkBindGzh();
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ vueQr,
|
|
|
+ },
|
|
|
watch: {
|
|
|
dialogVisible(val) {
|
|
|
- if (val === false) {
|
|
|
- this.uploadText("");
|
|
|
- } else {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.formData.clearValidate();
|
|
|
- });
|
|
|
+ if (val) {
|
|
|
+ this.form.cash = this.cash || 0;
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -107,8 +176,15 @@ export default {
|
|
|
align-items: center;
|
|
|
}
|
|
|
.withd-tips {
|
|
|
- margin-top: 20px;
|
|
|
+ margin-top: 30px;
|
|
|
line-height: 10px;
|
|
|
color: #999;
|
|
|
}
|
|
|
+.step-box {
|
|
|
+ margin-top: 20px;
|
|
|
+ .step-code-box {
|
|
|
+ width: 200px;
|
|
|
+ margin: 20px auto 0;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|