admin的数据库文件补全,修复uvue中的数据库接入bug
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="admin-main">
|
||||
<!-- 头部搜索和操作 -->
|
||||
<view class="search-card">
|
||||
@@ -292,17 +292,24 @@ item.status = !item.status
|
||||
}
|
||||
|
||||
async function deleteItem(item: CateItem) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定删除该分类吗?',
|
||||
uni.showModal({
|
||||
title: '删除确认',
|
||||
content: `确定要删除分类 "${item.name}" 吗?\n\n⚠️ 警告:该操作将同时删除该分类下的所有子分类及关联商品!`,
|
||||
confirmText: '确认删除',
|
||||
confirmColor: '#ff4d4f',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
await deleteAdminCategory(item.id)
|
||||
uni.showToast({ title: '删除成功', icon: 'success' })
|
||||
loadList()
|
||||
}
|
||||
}
|
||||
})
|
||||
if (res.confirm) {
|
||||
try {
|
||||
await deleteAdminCategory(item.id)
|
||||
uni.showToast({ title: '删除成功', icon: 'success' })
|
||||
loadList()
|
||||
} catch (e: any) {
|
||||
const errMsg = e?.message || '删除失败'
|
||||
uni.showToast({ title: errMsg, icon: 'none', duration: 3000 })
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user