diff --git a/src/views/Layout.vue b/src/views/Layout.vue index af2d50d..eb50db3 100644 --- a/src/views/Layout.vue +++ b/src/views/Layout.vue @@ -123,7 +123,7 @@ 商品列表 商品类型专区管理 - 商品数据分析 + 商品数据分析 假单管理 diff --git a/src/views/product/List.vue b/src/views/product/List.vue index 6a2bbe6..0cff84b 100644 --- a/src/views/product/List.vue +++ b/src/views/product/List.vue @@ -282,7 +282,6 @@ 确认发布 - diff --git a/src/views/product/TypeZone.vue b/src/views/product/TypeZone.vue index 534632e..c9a0a40 100644 --- a/src/views/product/TypeZone.vue +++ b/src/views/product/TypeZone.vue @@ -15,7 +15,7 @@ show-icon class="scope-tip" title="当前为具体小程序视图" - description="可管理本俱乐部专区(增删改)。商品类型为集团共享定义,添加/编辑/删除类型请切到「集团汇总」;本俱乐部上架类型请用「小程序配置 → 抢单商品类型」。" + description="可上架/下架集团商品类型(与抢单端一致,名称不可改),并可管理本俱乐部专区。新增/编辑/删除类型定义请切到「集团汇总」。" /> @@ -55,6 +55,7 @@

商品类型

+ 添加类型 + + 上架类型
显示审核专用 @@ -83,8 +84,13 @@ 编辑 删除
+
+ 下架 +
+
+
+ {{ isAllClubScope ? '暂无商品类型' : '本俱乐部尚未上架类型,点击「上架类型」' }}
-
暂无商品类型
@@ -243,6 +249,17 @@ 保存 + + + +
+ +
+ {{ c.jieshao }} (ID {{ c.id }}) + 上架 +
+
+
@@ -251,7 +268,7 @@ import { ref, reactive, computed, onMounted } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import request from '@/utils/request' import upload from '@/utils/upload' -import { getAdminClubScope } from '@/utils/club-context' +import { getAdminClubScope, JITUAN_API } from '@/utils/club-context' const isAllClubScope = computed(() => getAdminClubScope() === 'all') @@ -268,6 +285,10 @@ const showAuditZone = ref(false) const ratePlatform = ref(0) const rateMerchant = ref(0) +const shelfCatalogVisible = ref(false) +const shelfCatalogLoading = ref(false) +const shelfCatalog = ref([]) + const formatRate = (val) => (val * 100).toFixed(2) + '%' const filteredTypeList = computed(() => { @@ -323,6 +344,65 @@ const refreshTypeList = () => { const refreshZoneList = () => {} const selectType = (id) => { selectedTypeId.value = id } +/** 俱乐部:打开可上架类型目录 */ +const openShelfCatalog = async () => { + shelfCatalogVisible.value = true + shelfCatalogLoading.value = true + try { + const res = await request.post(JITUAN_API.clubLeixingCatalog, { phone: username.value }) + if (res.code === 0) { + if (res.data?.scope_error) { + ElMessage.warning(res.data.scope_error) + shelfCatalog.value = [] + return + } + shelfCatalog.value = res.data?.catalog || [] + } else { + ElMessage.error(res.msg || '加载目录失败') + } + } catch (e) { + ElMessage.error('网络错误') + } finally { + shelfCatalogLoading.value = false + } +} + +const enableClubType = async (c) => { + const res = await request.post(JITUAN_API.clubLeixingEnable, { + phone: username.value, + leixing_id: c.id, + }) + if (res.code === 0) { + ElMessage.success('上架成功') + shelfCatalogVisible.value = false + await fetchBaseData() + } else { + ElMessage.error(res.msg || '上架失败') + } +} + +const disableClubType = async (type) => { + try { + await ElMessageBox.confirm( + `下架「${type.jieshao}」?点单/抢单将不再展示该类型(本俱乐部专区数据保留)。`, + '确认下架', + { type: 'warning' } + ) + const res = await request.post(JITUAN_API.clubLeixingDisable, { + phone: username.value, + leixing_id: type.id, + }) + if (res.code === 0) { + ElMessage.success('已下架') + await fetchBaseData() + } else { + ElMessage.error(res.msg || '下架失败') + } + } catch (e) { + /* cancel */ + } +} + // 类型管理 const typeDialogVisible = ref(false) const typeDialogTitle = ref('') @@ -687,6 +767,13 @@ onMounted(() => { .scope-tip { margin-bottom: 16px; } +.shelf-catalog-row { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 0; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); +} .no-permission { text-align: center; padding: 80px 20px;