From b380d3c704d592f6e7ebdd3770e15b178e62b724 Mon Sep 17 00:00:00 2001 From: wwl Date: Fri, 10 May 2024 10:15:18 +0800 Subject: [PATCH] fix bug --- .env.development | 6 +++--- src/components/sp-sku-select-new/index.js | 8 ++++---- src/pages/index.js | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env.development b/.env.development index 9c69600..9879ff2 100755 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ -APP_BASE_URL=https://test.birkenstock.net.cn/api/h5app/wxapp -APP_WEBSOCKET=wss://test.birkenstock.net.cn/ws +APP_BASE_URL=https://slb.birkenstock.net.cn/api/h5app/wxapp +APP_WEBSOCKET=wss://slb.birkenstock.net.cn/ws APP_COMPANY_ID=1 APP_PLATFORM=standard -APP_CUSTOM_SERVER=https://test.birkenstock.net.cn/ +APP_CUSTOM_SERVER=https://slb.birkenstock.net.cn/ APP_HOME_PAGE=/pages/index APP_TRACK=youshu APP_YOUSHU_TOKEN=bi281e87ab2424481a diff --git a/src/components/sp-sku-select-new/index.js b/src/components/sp-sku-select-new/index.js index 691bbd2..d1ab2f4 100755 --- a/src/components/sp-sku-select-new/index.js +++ b/src/components/sp-sku-select-new/index.js @@ -74,11 +74,11 @@ function SpSkuSelect (props, ref) { const key = [a.skuValue[0].specId, b.skuValue[0].specId, c.skuValue[0].specId].join('_') const item = skuDictRef.current[key] // && item.store > 0 - selItem = key && item && ['onsale'].includes(item.approveStatus) ? item : null + selItem = key && item && ['onsale', 'offline_sale'].includes(item.approveStatus) ? item : null } } // 默认选中有库存并且前端可销售的sku - const defaultSpecItem = selItem ?? specItems.find((item) => item.store > 0 && ['onsale'].includes(item.approveStatus)) + const defaultSpecItem = selItem ?? specItems.find((item) => item.store > 0 && ['onsale', 'offline_sale'].includes(item.approveStatus)) let selection = Array(specItems.length).fill(null) if (defaultSpecItem) { selection = defaultSpecItem.specItem.map((item) => item.specId) @@ -105,7 +105,7 @@ function SpSkuSelect (props, ref) { return Object.keys(skuDictRef.current).some((key) => { if (key == reg) { - return skuDictRef.current[key].store > 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus) + return skuDictRef.current[key].store > 0 && ['onsale', 'offline_sale'].includes(skuDictRef.current[key].approveStatus) } else { return false } @@ -198,7 +198,7 @@ function SpSkuSelect (props, ref) { console.log("🚀 ~ _selKey:", _selKey, _selection) const isNotStore = ((idx === 0 && isClickPattern) || idx === 1) && Object.keys(skuDictRef.current).every((key) => { if (key.indexOf(_selKey) === 0) { - return skuDictRef.current[key].store <= 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus) + return skuDictRef.current[key].store <= 0 && ['onsale', 'offline_sale'].includes(skuDictRef.current[key].approveStatus) } else { return true } diff --git a/src/pages/index.js b/src/pages/index.js index 2878b92..626f61a 100755 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -341,7 +341,7 @@ function Home () { const getSwiperList = async () => { const { status, activity_info = {}, total_count } = await api.user.registrationActivity({ activity_id: 2 }) - const activeSwiper = activity_info.pics.map(item => ({ + const activeSwiper = (activity_info.pics || [])?.map(item => ({ type: 'image', src: item, goods: [] @@ -574,8 +574,8 @@ function Home () { const indexUrl = 'https://mp.weixin.qq.com/s/LBXthKa-P9gNK8FCv3n1pA' const handleGoWx = () => { - // handleApply() - Taro.navigateTo({ url: '/pages/webview?url=' + encodeURIComponent(indexUrl) }) + handleApply() + // Taro.navigateTo({ url: '/pages/webview?url=' + encodeURIComponent(indexUrl) }) } return (