This commit is contained in:
pikachu1995@126.com
2025-02-11 15:43:20 +08:00
3 changed files with 93 additions and 20 deletions

View File

@@ -73,6 +73,7 @@ export default {
WALLET: "余额支付",
},
supportForm: "", // 支持的支付方式
checkSupport: {},
};
},
props: ["res", "type"],
@@ -96,7 +97,7 @@ export default {
this.setupSetting();
},
onCancel: () => {
val.splice(val.length - 1, 1);
this.formValidate = JSON.parse(JSON.stringify(this.checkSupport));
},
});
},
@@ -105,6 +106,7 @@ export default {
setSetting(this.type, { paymentSupportItems: this.formValidate }).then(
(res) => {
if (res.success) {
this.checkSupport = JSON.parse(JSON.stringify(this.formValidate));
this.$Message.success("保存成功!");
this.$Modal.remove();
} else {
@@ -117,12 +119,13 @@ export default {
// 实例化数据
async init() {
this.formValidate = JSON.parse(this.res).paymentSupportItems;
this.checkSupport = JSON.parse(JSON.stringify(this.formValidate));
console.log(this.formValidate);
await getPaymentSupportForm().then((res) => {
// res.result.payments = ["H5", "PC"];
this.supportForm = res.result;
});
},
},

View File

@@ -1,7 +1,7 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="提现审核是否开启">
<i-switch v-model="formValidate.apply" style="margin-top:7px;"><span slot="open"></span>
<span slot="close"></span>
@@ -36,12 +36,8 @@ export default {
data() {
return {
result:"",
formValidate: { // 表单数据
apply: true,
minPrice: "",
type: "",
wechatAppId: "",
},
ruleValidate: {}, // 验证规则
formValidate: {},// 表单数据
switchTitle: "提现审核是否开启", // 切换title
};
@@ -72,7 +68,29 @@ export default {
// 实例化数据
init() {
this.result = JSON.parse(this.res);
Object.keys(this.result).map((item) => {
this.result[item] += "";
});
this.$set(this, "formValidate", { ...this.result });
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
{
validator: (rule, value, callback) => {
if (value < 0) {
callback(new Error("不能输入负数!"));
} else {
callback();
}
},
trigger: "change",
},
];
});
},
},
};