fanfan 4 months ago
parent 1e1471dbe9
commit a9dca1623e
  1. 22
      pages/gamll/index.vue

@ -3,8 +3,10 @@
<view class="park-top">
<view class="park-navbar">
<!-- :is-fixed='false' -->
<u-navbar title="开通商城" :border-bottom="false" :background="scrollTop?background:backgroundNone">
</u-navbar>
<view class="navbarHeight">
<u-navbar title="开通商城" :border-bottom="false" :background="scrollTop?background:backgroundNone">
</u-navbar>
</view>
<view class="box_1">
<image :src="$picUrl+'/static/default-logo.png'" class="image_2"
@click="goJump('/pages/news1/setting')"></image>
@ -20,7 +22,7 @@
</view>
</view>
</view>
<u-sticky offset-top="142">
<u-sticky :offset-top="heightTop">
<view class="tab_fix" :style="{ 'border-radius': radius}">
<view class="tab_pos">
<view class="tab_bg">
@ -267,9 +269,11 @@
retail: '',
wholesale: '',
scrollTop: 0,
heightTop:136,
}
},
onLoad() {
this.retail = uni.getStorageSync('userInfo').retail
this.getRetailList()
this.getDescribe()
@ -279,7 +283,8 @@
uni.$off('appShow', this.solveShowMsg);
},
onShow() {
this.checkIfElementIsAtTop()
let that = this
that.checkIfElementIsAtTop()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop > 120 ? true : false
@ -290,11 +295,16 @@
}
},
methods: {
pxToRpx(px) {
const screenWidth = uni.getSystemInfoSync().screenWidth //
let rpx = (750 * Number.parseInt(px)) / screenWidth //rpx
return Number(rpx)
},
checkIfElementIsAtTop() {
const query = uni.createSelectorQuery().in(this);
query.select('u-navbar ').boundingClientRect(data => {
query.select('.navbarHeight ').boundingClientRect(data => {
if (data) {
console.log(data, 'kkkkkkkkkkkkkkkkk')
this.heightTop=this.pxToRpx(data.height)
}
}).exec();
},

Loading…
Cancel
Save