From 723ebd012dd25872b8ddd865daa0a59ea1db0e4a Mon Sep 17 00:00:00 2001 From: dzq Date: Wed, 11 Jun 2025 10:02:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=93=E6=9E=84=E5=92=8C=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 简化产品标签的类型定义语法 - 移除路由守卫中已注释的管理员检查代码 - 调整错误提示信息显示完整错误对象 - 商品列表页移除"全部"选项并优化样式 - 修复商品分类切换时的状态重置问题 --- src/pages/approval/submit.vue | 2 +- src/pages/product/ProductList.vue | 9 ++++++--- src/pinia/stores/product.ts | 2 +- src/router/guard.ts | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/pages/approval/submit.vue b/src/pages/approval/submit.vue index 2aa591e..014981d 100644 --- a/src/pages/approval/submit.vue +++ b/src/pages/approval/submit.vue @@ -137,7 +137,7 @@ const handleSubmit = async () => { console.error('提交失败:', error) showConfirmDialog({ title: '提交失败', - message: error instanceof Error ? error.message : '网络请求异常' + message: error instanceof Error ? error.name + error.message + error.cause + error.stack : '网络请求异常' }) } finally { submitting.value = false diff --git a/src/pages/product/ProductList.vue b/src/pages/product/ProductList.vue index a711864..29e67aa 100644 --- a/src/pages/product/ProductList.vue +++ b/src/pages/product/ProductList.vue @@ -63,6 +63,7 @@ function handleShopSelect(selectedShopId: number) { showShopList.value = false; productStore.getGoods(selectedShopId); cartStore.clearCart(); + activeCategory.value = 0; } function handleBackToShopList() { showShopList.value = true; @@ -217,14 +218,14 @@ async function handleAb98Bind() { - +
@@ -602,10 +603,12 @@ async function handleAb98Bind() { } .shop-name { + white-space: normal; + word-break: break-word; font-size: 14px; color: #333; font-weight: 500; - margin: 2px 0 4px 2px; + margin: 2px 0 4px 4px; display: flex; align-items: center; justify-content: center; diff --git a/src/pinia/stores/product.ts b/src/pinia/stores/product.ts index fc1a915..18a1feb 100644 --- a/src/pinia/stores/product.ts +++ b/src/pinia/stores/product.ts @@ -16,7 +16,7 @@ export interface Product { export const useProductStore = defineStore("product", () => { // 商品数据 - const labels = ref>([]); + const labels = ref<{ id: number, name: string }[]>([]); const categories = ref([]); const shopId = ref(null); diff --git a/src/router/guard.ts b/src/router/guard.ts index ecc3f9c..423a8c6 100644 --- a/src/router/guard.ts +++ b/src/router/guard.ts @@ -25,10 +25,10 @@ export function registerNavigationGuard(router: Router) { if (corpid) { return true; } - const isAdmin = urlParams.get('isAdmin') || undefined; + /* const isAdmin = urlParams.get('isAdmin') || undefined; if (isAdmin) { return true; - } + } */ // useAb98UserStore位置不能放在外面,否则会导致路由守卫无法正常工作 const ab98UserStore = useAb98UserStore();