会员积分和会员签到模块todo修改

This commit is contained in:
xiaqing
2023-08-19 14:10:11 +08:00
parent f8a4df8b77
commit 19444021ca
8 changed files with 28 additions and 30 deletions

View File

@@ -25,8 +25,8 @@
<template #default="scope">
<div>
<el-switch
v-model="scope.row.isEnable"
@change="handleSwitchChange(scope.row.id, $event)"
v-model="scope.row.enable"
@change="handleSwitchChange(scope.row, $event)"
inline-prompt
active-text="开启"
inactive-text="关闭"
@@ -105,15 +105,11 @@ const handleDelete = async (id: number) => {
} catch {}
}
const handleSwitchChange = async (id, e) => {
console.log('开关状态变更id:', id, '新状态:', e)
const handleSwitchChange = async (row, e) => {
console.log('开关状态变更id:', row, '新状态:', e)
// 创建对象
const signInConfig: SignInConfigVO = {
id: id,
day: null,
point: null,
isEnable: e
}
const signInConfig: SignInConfigVO = { enable: e }
;({ id: signInConfig.id, day: signInConfig.day, point: signInConfig.point, enable: e } = row)
await SignInConfigApi.updateSignInConfig(signInConfig)
}