计算购物车钱之前
This commit is contained in:
@@ -13,7 +13,8 @@ export const useNavbarStore = defineStore('navbar', {
|
||||
isTransparent: false,
|
||||
height: 0,
|
||||
hasPlaceholder: true,
|
||||
scrollTop: 0 //滚动高度
|
||||
scrollTop: 0 ,//滚动高度
|
||||
screenHeight:375
|
||||
}),
|
||||
actions: {
|
||||
updateNavbarConfig(config) {
|
||||
@@ -23,21 +24,21 @@ export const useNavbarStore = defineStore('navbar', {
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
const statusBarHeight = res.statusBarHeight;
|
||||
// 总高度
|
||||
this.screenHeight = res.screenHeight
|
||||
let navBarHeight;
|
||||
|
||||
// 微信小程序的特殊处理
|
||||
if (res.platform === 'weapp') {
|
||||
if (res.uniPlatform === 'mp-weixin' || res.uniPlatform === 'mp-alipay') {
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
const topGap = menuButtonInfo.top - statusBarHeight;
|
||||
const bottomGap = statusBarHeight + menuButtonInfo.height + topGap * 2 - (
|
||||
menuButtonInfo.top + menuButtonInfo.height);
|
||||
navBarHeight = menuButtonInfo.height + topGap + bottomGap;
|
||||
navBarHeight = menuButtonInfo.height + topGap + bottomGap - 4;
|
||||
} else if (uni.getSystemInfoSync().platform === 'ios') {
|
||||
navBarHeight = 44;
|
||||
} else {
|
||||
navBarHeight = 48;
|
||||
}
|
||||
|
||||
this.height = statusBarHeight + navBarHeight;
|
||||
},
|
||||
fail: (err) => {
|
||||
|
||||
Reference in New Issue
Block a user