|
@@ -45,8 +45,8 @@
|
|
|
<div class="text">{{ isCollection ? '已关注' : '关注' }}</div>
|
|
<div class="text">{{ isCollection ? '已关注' : '关注' }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="line" id="top"></div>
|
|
|
|
|
- <div class="main">
|
|
|
|
|
|
|
+ <div class="line"></div>
|
|
|
|
|
+ <div class="main" id="top">
|
|
|
<van-sticky :scroll-top="scrollTop" :offset-top="offsetTop">
|
|
<van-sticky :scroll-top="scrollTop" :offset-top="offsetTop">
|
|
|
<van-tabs :sticky="false" :active="active" :line-height="0" @change="active = $event.detail.index">
|
|
<van-tabs :sticky="false" :active="active" :line-height="0" @change="active = $event.detail.index">
|
|
|
<van-tab title="关于展商"> </van-tab>
|
|
<van-tab title="关于展商"> </van-tab>
|
|
@@ -63,7 +63,13 @@
|
|
|
:showConnect="showConnect"
|
|
:showConnect="showConnect"
|
|
|
@changeActive="changeActive"
|
|
@changeActive="changeActive"
|
|
|
></about>
|
|
></about>
|
|
|
- <product v-else-if="active === 1" :vendorInfo="vendorInfo" :fixedTop="searchTop"></product>
|
|
|
|
|
|
|
+ <product
|
|
|
|
|
+ ref="product"
|
|
|
|
|
+ v-else-if="active === 1"
|
|
|
|
|
+ :vendorInfo="vendorInfo"
|
|
|
|
|
+ :fixedTop="headerTop"
|
|
|
|
|
+ :scrollEnabled="scrollEnabled"
|
|
|
|
|
+ ></product>
|
|
|
<news v-else-if="active === 2" :vendorInfo="vendorInfo"></news>
|
|
<news v-else-if="active === 2" :vendorInfo="vendorInfo"></news>
|
|
|
</div>
|
|
</div>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -112,7 +118,9 @@ export default {
|
|
|
main: null,
|
|
main: null,
|
|
|
scrollTop: 0,
|
|
scrollTop: 0,
|
|
|
offsetTop: 0,
|
|
offsetTop: 0,
|
|
|
- scrollId: ''
|
|
|
|
|
|
|
+ scrollId: '',
|
|
|
|
|
+ scrollEnabled: false,
|
|
|
|
|
+ headerTop: 0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -143,6 +151,11 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
this.showConnect = true;
|
|
this.showConnect = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (event.detail.scrollTop < this.offsetTop - 44) {
|
|
|
|
|
+ this.scrollEnabled = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.scrollEnabled = true;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
changeActive(index) {
|
|
changeActive(index) {
|
|
|
this.active = index;
|
|
this.active = index;
|
|
@@ -176,13 +189,13 @@ export default {
|
|
|
.select('#vendor')
|
|
.select('#vendor')
|
|
|
.boundingClientRect(rect => {
|
|
.boundingClientRect(rect => {
|
|
|
this.searchTop = this.searchTop - rect.height;
|
|
this.searchTop = this.searchTop - rect.height;
|
|
|
|
|
+ this.headerTop = rect.height;
|
|
|
})
|
|
})
|
|
|
.exec();
|
|
.exec();
|
|
|
})
|
|
})
|
|
|
.exec();
|
|
.exec();
|
|
|
},
|
|
},
|
|
|
onPageScroll(e) {
|
|
onPageScroll(e) {
|
|
|
- console.log(e);
|
|
|
|
|
if (e.scrollTop < 115) {
|
|
if (e.scrollTop < 115) {
|
|
|
this.showConnect = false;
|
|
this.showConnect = false;
|
|
|
} else {
|
|
} else {
|
|
@@ -198,10 +211,12 @@ export default {
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
active() {
|
|
active() {
|
|
|
- this.scrollId = 'top';
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- this.scrollId = '';
|
|
|
|
|
- }, 200);
|
|
|
|
|
|
|
+ this.scrollId = 'top';
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.scrollId = '';
|
|
|
|
|
+ }, 200);
|
|
|
|
|
+ }, 100);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|