pifa
fanfan 4 months ago
parent 9c1a60484e
commit 00acb054f6
  1. 48
      pages/gamll/index.vue

@ -3,7 +3,7 @@
<view class="park-top">
<view class="park-navbar">
<!-- :is-fixed='false' -->
<u-navbar :is-fixed='false' title="开通商城" :border-bottom="false" :background="backgroundNone">
<u-navbar title="开通商城" :border-bottom="false" :background="scrollTop?background:backgroundNone">
</u-navbar>
<view class="box_1">
<image :src="$picUrl+'/static/default-logo.png'" class="image_2"
@ -20,16 +20,18 @@
</view>
</view>
</view>
<view class="tab_fix" :style="{ 'border-radius': radius,'padding-top':paddingTo}">
<view class="tab_pos">
<view class="tab_bg">
<view :class="[tabIndex==index ? 'tab_active' : 'tab_a']" v-for="(item,index) in tabbar"
@click="onChage(index)" :key="index">
{{item}}
<u-sticky offset-top="142">
<view class="tab_fix" :style="{ 'border-radius': radius}">
<view class="tab_pos">
<view class="tab_bg">
<view :class="[tabIndex==index ? 'tab_active' : 'tab_a']" v-for="(item,index) in tabbar"
@click="onChage(index)" :key="index">
{{item}}
</view>
</view>
</view>
</view>
</view>
</u-sticky>
<view class="tab-type">
<view class="tab-pro" v-for="(item,index) in tabType" :class="index==banIndex?'tab-pro-active':''"
@click="onChageBan(index)" :key="index">
@ -238,7 +240,6 @@
paymentMethods: [],
isClick: true,
radius: '28rpx 0 0 0',
paddingTo: '0rpx',
leftNum: 33.33333,
tabbar: ['零售商城', '批发商城'],
tabIndex: 0,
@ -266,12 +267,10 @@
retail: '',
wholesale: '',
scrollTop: 0,
isAtTop: ''
}
},
onLoad() {
this.retail = uni.getStorageSync('userInfo').retail
console.log(this.retail)
this.getRetailList()
this.getDescribe()
uni.$on('appShow', this.solveShowMsg);
@ -280,25 +279,22 @@
uni.$off('appShow', this.solveShowMsg);
},
onShow() {
this.checkIfElementIsAtTop()
},
onPageScroll(e) {
this.checkIfElementIsAtTop()
this.scrollTop = e.scrollTop > 120 ? true : false
if (this.scrollTop) {
this.radius = '0rpx';
} else {
this.radius = this.tabIndex == 0 ? '28rpx 0 0 0' : '0 28rpx 0 0';
}
},
methods: {
checkIfElementIsAtTop() {
const query = uni.createSelectorQuery().in(this);
query.select('.tab_fix').boundingClientRect(data => {
query.select('u-navbar ').boundingClientRect(data => {
if (data) {
// top0
this.isAtTop = data.top === 0;
if (this.isAtTop) {
this.radius = '28rpx 0 0 0';
this.paddingTo = '120rpx';
} else {
this.radiu = '0';
this.paddingTo = '0rpx';
}
console.log(data, 'kkkkkkkkkkkkkkkkk')
}
}).exec();
},
@ -720,10 +716,7 @@
.tab_fix {
overflow: hidden;
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 99999;
height: 126rpx;
background: linear-gradient(180deg, rgba(253, 202, 197, 1) 0.42%, rgba(254, 231, 229, 1) 32.99%, rgba(255, 255, 255, 1) 100%);
}
@ -875,6 +868,7 @@
.tab-box {
margin: 10rpx 30rpx 24rpx 30rpx;
overflow: hidden;
.tabFavour {
display: flex;
justify-content: space-between;

Loading…
Cancel
Save