修改商详情页UI
This commit is contained in:
@@ -2094,13 +2094,23 @@ const familyItems = [
|
||||
|
||||
// 初始化页面
|
||||
const initPage = () => {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
statusBarHeight.value = systemInfo.statusBarHeight != null ? systemInfo.statusBarHeight : 20
|
||||
const searchContentHeight = Math.round(68 * systemInfo.screenWidth / 750)
|
||||
const searchTopGap = Math.round(14 * systemInfo.screenWidth / 750)
|
||||
const headerBottomPadding = Math.round(10 * systemInfo.screenWidth / 750)
|
||||
const moduleRowHeight = Math.round(62 * systemInfo.screenWidth / 750)
|
||||
const categoryRowHeight = Math.round(56 * systemInfo.screenWidth / 750)
|
||||
let screenWidth = 375
|
||||
let screenHeight = 667
|
||||
let safeAreaBottom = 0
|
||||
try {
|
||||
const windowInfo = uni.getWindowInfo()
|
||||
statusBarHeight.value = windowInfo.statusBarHeight != null ? windowInfo.statusBarHeight : 20
|
||||
screenWidth = windowInfo.screenWidth != null ? windowInfo.screenWidth : (windowInfo.windowWidth != null ? windowInfo.windowWidth : 375)
|
||||
screenHeight = windowInfo.screenHeight != null ? windowInfo.screenHeight : (windowInfo.windowHeight != null ? windowInfo.windowHeight : 667)
|
||||
safeAreaBottom = windowInfo.safeArea != null ? windowInfo.safeArea.bottom : 0
|
||||
} catch (e) {
|
||||
statusBarHeight.value = 20
|
||||
}
|
||||
const searchContentHeight = Math.round(68 * screenWidth / 750)
|
||||
const searchTopGap = Math.round(14 * screenWidth / 750)
|
||||
const headerBottomPadding = Math.round(10 * screenWidth / 750)
|
||||
const moduleRowHeight = Math.round(62 * screenWidth / 750)
|
||||
const categoryRowHeight = Math.round(56 * screenWidth / 750)
|
||||
|
||||
let menuInfo: CapsuleButtonInfo | null = null
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
@@ -2116,7 +2126,7 @@ const initPage = () => {
|
||||
const navHeight = (menuInfo.top - statusBarHeight.value) * 2 + menuInfo.height
|
||||
navBarHeight.value = navHeight
|
||||
|
||||
const rightReserve = systemInfo.screenWidth - menuInfo.left + 8
|
||||
const rightReserve = screenWidth - menuInfo.left + 8
|
||||
navBarRight.value = rightReserve
|
||||
const searchRowTotalH = statusBarHeight.value + Math.max(navHeight, moduleRowHeight) + searchTopGap + searchContentHeight + headerBottomPadding
|
||||
searchRowStyle.value = `padding-right:${rightReserve}px;`
|
||||
@@ -2132,10 +2142,9 @@ const initPage = () => {
|
||||
headerStyle.value = ``
|
||||
categoryBarHeightPx.value = categoryRowHeight
|
||||
headerPlaceholderHeight.value = navbarTotalHeight.value + categoryBarHeightPx.value
|
||||
const safeBottom = systemInfo.safeArea != null ? systemInfo.screenHeight - systemInfo.safeArea.bottom : 20
|
||||
const safeBottom = safeAreaBottom > 0 ? (screenHeight - safeAreaBottom) : 20
|
||||
bottomSafeArea.value = safeBottom > 0 ? safeBottom : 20
|
||||
|
||||
const screenWidth = systemInfo.screenWidth
|
||||
isMobile.value = screenWidth < 768
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user