🎈 perf(优化面料详情分享图):

This commit is contained in:
2022-12-13 15:21:20 +08:00
parent b893c5a77d
commit b8a7d5634f
3 changed files with 13 additions and 12 deletions
+10 -8
View File
@@ -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(() => {