diff --git a/pages_promotion/merch/detail.vue b/pages_promotion/merch/detail.vue index 2e2c183..c5c770f 100644 --- a/pages_promotion/merch/detail.vue +++ b/pages_promotion/merch/detail.vue @@ -23,6 +23,7 @@ + {{ merch.desc }} @@ -58,7 +59,7 @@ - + { + this.initHeaderHeight(); + }); + }, + deep: true + } + }, + methods: { + initHeaderHeight() { + setTimeout(() => { + const query = uni.createSelectorQuery().in(this); + query.select('.head-wrap').boundingClientRect(rect => { + if (rect) { + this.headerHeight = (rect.height / this.screenWidth) * 750; + } + }).exec(); + }, 100); + } + }, + mounted() { + this.initHeaderHeight(); + } };