聊天功能优化,部分问题修复
This commit is contained in:
@@ -222,6 +222,12 @@ async function save() {
|
||||
console.log(form);
|
||||
const submitData = {
|
||||
...form,
|
||||
conditionList: conditionLists.value
|
||||
.filter((v) => v.checked)
|
||||
.map((v) => ({
|
||||
code: v.code,
|
||||
value: v.value,
|
||||
})),
|
||||
};
|
||||
const res = await superVipStore.editConfig(submitData);
|
||||
uni.showToast({
|
||||
@@ -244,6 +250,18 @@ function setForm(data) {
|
||||
if (data.rewardCount == -1) {
|
||||
isLimitCount.value = 1;
|
||||
}
|
||||
console.log(data);
|
||||
|
||||
conditionLists.value = conditionLists.value.map((v) => {
|
||||
const findItem = data.conditionList.find((cond) => cond.code == v.code);
|
||||
if (findItem) {
|
||||
v.value = findItem.value;
|
||||
v.checked = true;
|
||||
} else {
|
||||
v.checked = false;
|
||||
}
|
||||
return v;
|
||||
});
|
||||
Object.assign(form, data);
|
||||
console.log(form);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user