支付设置选中状态错误问题

This commit is contained in:
chc 2025-01-17 17:42:49 +08:00
parent 765b633cea
commit aea03cf975

View File

@ -73,6 +73,7 @@ export default {
WALLET: "余额支付", WALLET: "余额支付",
}, },
supportForm: "", // supportForm: "", //
checkSupport: {},
}; };
}, },
props: ["res", "type"], props: ["res", "type"],
@ -96,7 +97,7 @@ export default {
this.setupSetting(); this.setupSetting();
}, },
onCancel: () => { 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( setSetting(this.type, { paymentSupportItems: this.formValidate }).then(
(res) => { (res) => {
if (res.success) { if (res.success) {
this.checkSupport = JSON.parse(JSON.stringify(this.formValidate));
this.$Message.success("保存成功!"); this.$Message.success("保存成功!");
this.$Modal.remove(); this.$Modal.remove();
} else { } else {
@ -117,12 +119,13 @@ export default {
// //
async init() { async init() {
this.formValidate = JSON.parse(this.res).paymentSupportItems; this.formValidate = JSON.parse(this.res).paymentSupportItems;
this.checkSupport = JSON.parse(JSON.stringify(this.formValidate));
console.log(this.formValidate); console.log(this.formValidate);
await getPaymentSupportForm().then((res) => { await getPaymentSupportForm().then((res) => {
// res.result.payments = ["H5", "PC"]; // res.result.payments = ["H5", "PC"];
this.supportForm = res.result; this.supportForm = res.result;
}); });
}, },
}, },