feat: 添加新增套餐是否展示在首页参数
Build and Deploy Vue3 / build (push) Successful in 2m26s
Build and Deploy Vue3 / deploy (push) Successful in 55s

This commit is contained in:
2026-03-10 10:49:59 +08:00
parent 2f38932878
commit fe29a8b3d0
2 changed files with 29 additions and 598 deletions
+23 -4
View File
@@ -506,6 +506,13 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="首页展示" width="90">
<template #default="{ row }">
<el-tag :type="row.showHome || row.show_home ? 'success' : 'info'" size="small">
{{ row.showHome || row.show_home ? '展示' : '不展示' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template #default="{ row }">
<el-button type="primary" link @click="handleEditPlan(row)">编辑</el-button>
@@ -702,6 +709,14 @@
<el-radio :value="true">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="首页展示" prop="show_home">
<el-switch
v-model="planForm.show_home"
active-text="展示"
inactive-text="不展示"
/>
<div class="form-tip">控制商品套餐是否在首页显示</div>
</el-form-item>
</el-form>
</div>
<template #footer>
@@ -1649,7 +1664,8 @@ const planForm = reactive({
fixed_price: 0,
enable_fixed_price: false,
index: 0,
disable: false
disable: false,
show_home: false
})
const planFormRules = {
@@ -2012,7 +2028,8 @@ const handleAddPlan = async () => {
fixed_price: 0,
enable_fixed_price: false,
index: 0,
disable: false
disable: false,
show_home: false
})
planFormDialogVisible.value = true
@@ -2067,7 +2084,8 @@ const handleEditPlan = async (row) => {
fixed_price: ((data.fixedPrice || data.fixed_price || 0) / 100).toFixed(2) * 1, // 分转元
enable_fixed_price: !!(data.enableFixedPrice || data.enable_fixed_price), // 转为布尔值
index: data.index || 0,
disable: data.disable || false
disable: data.disable || false,
show_home: !!(data.showHome || data.show_home) // 转为布尔值
})
// 从已有的args初始化选择状态(包括额外参数)
@@ -2166,7 +2184,8 @@ const submitPlanForm = () => {
extra_arg_ids: extraArgIdsStr || planForm.extra_arg_ids || '',
inventory: Number(planForm.inventory) || 0,
fixed_price: Math.round(Number(planForm.fixed_price) * 100) || 0, // 元转分
index: Number(planForm.index) || 0
index: Number(planForm.index) || 0,
show_home: planForm.show_home === true
}
// 只有创建时才传递 enable_fixed_price