From c4f85aa9dc25165ddffc7b56d9d8c6b88e4f51f5 Mon Sep 17 00:00:00 2001 From: jzp <783183164@qq.com> Date: Wed, 12 Nov 2025 22:03:36 +0800 Subject: [PATCH] =?UTF-8?q?bug:=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/types/shop.ts | 100 +++++++---- src/utils/axios.ts | 4 +- .../components/shopping-cart.vue | 158 +++++++++++++----- 3 files changed, 179 insertions(+), 83 deletions(-) diff --git a/src/api/types/shop.ts b/src/api/types/shop.ts index cc582ca..d46fbc6 100644 --- a/src/api/types/shop.ts +++ b/src/api/types/shop.ts @@ -1,46 +1,72 @@ -export type PrDetailType = { - adminCategoryId1: 146 - adminCategoryId2: 147 - appCategoryId1: 48 - appCategoryId2: 56 - createTime: 1762760434000 - defaultSort: 0 - frontPage: 1 - id: 73 - isDelete: 0 - isFlash: 0 - isNew: 1 - isTest: 0 - mainImageUrl: 'https://heyuimage.ihzhy.com/prd/202511/9a77567562f87caf.jpg?key=xxxxxxx' - modifyTime: 1762760434000 - realSaleCount: 0 - showPromotionPrice: 0 - showSaleCount: 0 - showSalePrice: 0 - status: 'online' - title: 'Akoya双珠海水戒指' +export type ProductDetailType = { + adminCategoryId1: number + adminCategoryId2: number + appCategoryId1: number + appCategoryId2: number + createTime: number + defaultSort: number + frontPage: number + id: number + isDelete: number + isFlash: number + isNew: number + isTest: number + mainImageUrl: string + modifyTime: number + realSaleCount: number + showPromotionPrice: number + showSaleCount: number + showSalePrice: number + status: string + title: string vvSkuList: SkuType[] - vvProductDetailList: [] - vvProductPropertyList: [] + vvProductDetailList: ProductDetailImagesType[] + vvProductPropertyList: ProudictProductPropertyType[] } export type SkuType = { createTime: number - id: 364 - isDelete: 0 - modifyTime: 1762760434000 - productId: 73 - promotionPrice: 0 - showSaleCount: 0 - stock: 0 + id: number + isDelete: number + modifyTime: number + productId: number + promotionPrice: number + showSaleCount: number + stock: number + imageUrl: string + salePrice: number + vvSkuPropertyValueList: SkuPropretyType[] +} + +export type SkuPropretyType = { + createTime: number + id: number + isDelete: number + modifyTime: number + productId: number + productPropertyName: string + productPropertyValue: string + skuId: number } export type ProductDetailImagesType = { - createTime: 1762760434000 - detail: 'https://heyuimage.ihzhy.com/prd/202511/304182481ebfc9ab.jpg?key=xxxxxxx' - id: 187 - isDelete: 0 - modifyTime: 1762760434000 - productId: 73 - type: 1 + createTime: number + detail: string + id: number + isDelete: number + modifyTime: number + productId: number + type: number +} + +export type ProudictProductPropertyType = { + createTime: number + defaultSort: number + id: number + isDelete: number + modifyTime: number + productId: number + productPropertyName: string + vvProductPropertyList?: ProudictProductPropertyType[] // 如需树状结构可用此字段 + vvProductPropertyValueList: ProudictProductPropertyType[] // 按你原写法保持不变 } diff --git a/src/utils/axios.ts b/src/utils/axios.ts index 8660eb0..d5e9b72 100644 --- a/src/utils/axios.ts +++ b/src/utils/axios.ts @@ -15,8 +15,8 @@ const service: AxiosInstance = axios.create({ timeout: 150000, // 请求超时时间 }) -const noEncryptWhiteList = ['/common/protocol/content', '/portal/common/protocol/content', '/bl-log/web/log/add'] -const noConsoleWhiteList = ['bl-log/web/log/add'] +// const noEncryptWhiteList = ['/common/protocol/content', '/portal/common/protocol/content', '/bl-log/web/log/add'] +// const noConsoleWhiteList = ['bl-log/web/log/add'] // request拦截器 service.interceptors.request.use( diff --git a/src/views/commodity-detail/components/shopping-cart.vue b/src/views/commodity-detail/components/shopping-cart.vue index 9f9a104..5d6f4e1 100644 --- a/src/views/commodity-detail/components/shopping-cart.vue +++ b/src/views/commodity-detail/components/shopping-cart.vue @@ -6,7 +6,7 @@

{{ curAddressData?.buyerName }} - {{ (curAddressData?.province ?? '') + (curAddressData?.city ?? '') + (curAddressData?.district ?? '') + (curAddressData?.detail?? '') }}{{ (curAddressData?.province ?? '') + (curAddressData?.city ?? '') + (curAddressData?.district ?? '') + (curAddressData?.detail ?? '') }}

@@ -19,6 +19,13 @@

+ + (最大可购买{{ curPageData?.num }}) + + + + {{ curPageData?.num > 0 ? "有货" : "缺货"}} +

@@ -28,11 +35,11 @@

- {{ v?.label }} + {{ v.label }} {{ v.num }}

@@ -49,59 +56,109 @@