🎈 perf(优化面料详情分享图):
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user