From 11c49a0ff876eb0d18ca0ce4ce432b8ec0c08f4e Mon Sep 17 00:00:00 2001 From: jerry Date: Mon, 18 Aug 2025 10:00:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sp-sku-select/index.js | 7 +++++-- src/doc/goods.js | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/sp-sku-select/index.js b/src/components/sp-sku-select/index.js index 04fb43ba0..03365a8c7 100644 --- a/src/components/sp-sku-select/index.js +++ b/src/components/sp-sku-select/index.js @@ -63,11 +63,10 @@ function SpSkuSelect(props) { } // 防止列表页遗留其他商品信息 if (info && info.nospec) { + specItemed() setState((draft) => { draft.curItem = null draft.skuText = '' - draft.minNum = specItemed() - draft.num = specItemed() }) } }, [info]) @@ -106,6 +105,7 @@ function SpSkuSelect(props) { //多规格 if(info.specItems.length > 0 && val.length > 0){ //多规格动态获取起订量 const newval = val.length == 1 ? val[0] : val.join('-') + console.log('newval:', newval,val,info.specItems) info.specItems.forEach((item) => { if(item.customSpecId == newval){ setState((draft) => { @@ -119,6 +119,9 @@ function SpSkuSelect(props) { //单规格 return info.startNum }else{ + setState((draft) => { + draft.minNum = 1 + }) return 1 } diff --git a/src/doc/goods.js b/src/doc/goods.js index 9a5917a41..3876a8eeb 100644 --- a/src/doc/goods.js +++ b/src/doc/goods.js @@ -238,6 +238,7 @@ export const GOODS_INFO = { specItems: ({ spec_items, is_point }) => { return pickBy(spec_items, { approveStatus: 'approve_status', + customSpecId:'custom_spec_id', specItem: ({ item_spec }) => { return pickBy(item_spec, { specId: 'spec_value_id', @@ -249,6 +250,7 @@ export const GOODS_INFO = { }) }, itemId: 'item_id', + startNum: 'start_num',// 起订量 store: 'store', limitNum: 'limit_num', // price: ({ price }) => price / 100, @@ -284,6 +286,7 @@ export const GOODS_INFO = { video: 'videos', medicineData: 'medicine_data', isMedicine: 'is_medicine', + startNum: 'start_num'// 起订量 } export const ESPIER_DETAIL_GOODS_INFO = {