|
|
@ -150,18 +150,10 @@ Page({ |
|
|
|
|
|
|
|
|
const systemInfo = wx.getSystemInfoSync(); |
|
|
const systemInfo = wx.getSystemInfoSync(); |
|
|
const screenHeight = systemInfo.screenHeight * 2; |
|
|
const screenHeight = systemInfo.screenHeight * 2; |
|
|
const safeArea = systemInfo.safeArea; |
|
|
|
|
|
const btnHeight = 90; |
|
|
const btnHeight = 90; |
|
|
|
|
|
|
|
|
let minTop, maxTop; |
|
|
const minTop = screenHeight * 0.2; |
|
|
|
|
|
const maxTop = screenHeight * 0.6; |
|
|
if (safeArea && safeArea.top > 20) { |
|
|
|
|
|
minTop = safeArea.top * 2 + 20; |
|
|
|
|
|
maxTop = safeArea.bottom * 2 - btnHeight - 20; |
|
|
|
|
|
} else { |
|
|
|
|
|
minTop = screenHeight * 0.2; |
|
|
|
|
|
maxTop = screenHeight * 0.6; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (newTop < minTop) { |
|
|
if (newTop < minTop) { |
|
|
newTop = minTop; |
|
|
newTop = minTop; |
|
|
@ -206,9 +198,13 @@ Page({ |
|
|
const systemInfo = wx.getSystemInfoSync(); |
|
|
const systemInfo = wx.getSystemInfoSync(); |
|
|
const screenHeight = systemInfo.screenHeight * 2; |
|
|
const screenHeight = systemInfo.screenHeight * 2; |
|
|
|
|
|
|
|
|
let defaultTop = screenHeight / 2; |
|
|
let defaultTop = screenHeight * 0.5; |
|
|
if (savedBtnTop !== '' && savedBtnTop !== -100) { |
|
|
if (savedBtnTop !== '' && savedBtnTop !== -100) { |
|
|
defaultTop = savedBtnTop; |
|
|
const minTop = screenHeight * 0.2; |
|
|
|
|
|
const maxTop = screenHeight * 0.6; |
|
|
|
|
|
if (savedBtnTop >= minTop && savedBtnTop <= maxTop) { |
|
|
|
|
|
defaultTop = savedBtnTop; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
|