From b8a7d5634f72ee89290c45ee690013de0456b490 Mon Sep 17 00:00:00 2001 From: czm <2192718639@qq.com> Date: Tue, 13 Dec 2022 15:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf(=E4=BC=98=E5=8C=96=E9=9D=A2?= =?UTF-8?q?=E6=96=99=E8=AF=A6=E6=83=85=E5=88=86=E4=BA=AB=E5=9B=BE):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/constant.ts | 4 ++-- src/components/moveBtn/index.tsx | 18 ++++++++++-------- src/pages/details/index.tsx | 3 +-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/common/constant.ts b/src/common/constant.ts index 32af514..2f06165 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,4 +1,4 @@ -// export const BASE_URL = CURRENT_BASE_URL +export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` @@ -12,7 +12,7 @@ // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境 // export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞 -export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添 +// export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添 // export const BASE_URL = 'http://192.168.1.28:50002/lymarket' // 婷 // export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰 diff --git a/src/components/moveBtn/index.tsx b/src/components/moveBtn/index.tsx index f504e6d..82644d5 100644 --- a/src/components/moveBtn/index.tsx +++ b/src/components/moveBtn/index.tsx @@ -30,14 +30,16 @@ const MoveBtn = ({ children = null, onClick, showList = [], orderInfo }: param) const [showMoveBtn, setShowMoveBtn] = useState(false) const screenWidthRef = useRef(0) useEffect(() => { - const res = Taro.getSystemInfoSync() - if (res.screenHeight) { - const ratio = 750 / res.screenWidth - const num = res.screenHeight * ratio - setScreenHeight(() => ({ shop: num - 460, customer: num - 580, order: num - 700 })) - screenWidthRef.current = res.screenWidth / 2 - } - setShowMoveBtn(true) + Taro.nextTick(() => { + const res = Taro.getSystemInfoSync() + if (res.screenHeight) { + const ratio = 750 / res.screenWidth + const num = res.screenHeight * ratio + setScreenHeight(() => ({ shop: num - 460, customer: num - 580, order: num - 700 })) + screenWidthRef.current = res.screenWidth / 2 + } + setShowMoveBtn(true) + }) }, []) useDidShow(() => { diff --git a/src/pages/details/index.tsx b/src/pages/details/index.tsx index 1709664..9924c67 100644 --- a/src/pages/details/index.tsx +++ b/src/pages/details/index.tsx @@ -90,8 +90,7 @@ const Details = (props: Params) => { type: ShareDetail.value, product_id: parseInt(params.id), }) - const img = formatImgUrl(shareImg, '!w400') - setSortCode({ ...userObj.sort_code, shareShortDetail: { title: productName as string, code: resDetail.md5_key, img } }) + setSortCode({ ...userObj.sort_code, shareShortDetail: { title: productName as string, code: resDetail.md5_key, shareImg } }) } useDidShow(() => { judgeParam()