|
@@ -21,7 +21,7 @@
|
|
|
id="topBar"
|
|
|
v-show="isNavbarFiexd"
|
|
|
:class="navbarFiexd"
|
|
|
- :style="{ top: CustomBar + 'px' }"
|
|
|
+ :style="{ top: ( CustomBar - 2 ) + 'px' }"
|
|
|
>
|
|
|
<view class="search-input">
|
|
|
<view class="gosearch-btn" :class="navbarFiexd" @click="this.$api.navigateTo(clickPath)">
|
|
@@ -778,7 +778,6 @@ export default {
|
|
|
identity: this.identity
|
|
|
})
|
|
|
.then(response => {
|
|
|
- this.skeletonShow = false
|
|
|
this.productImage = []
|
|
|
this.shop = response.data.shop
|
|
|
this.shopId = response.data.shopId
|
|
@@ -866,7 +865,10 @@ export default {
|
|
|
}
|
|
|
this.queryProductDetilsCoupons()
|
|
|
this.getCommodityCombinationList()
|
|
|
- this.isRequest = true
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.skeletonShow = false
|
|
|
+ this.isRequest = true
|
|
|
+ },1000)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
this.$util.msg(error.msg, 2000)
|
|
@@ -992,7 +994,7 @@ export default {
|
|
|
// 点击tab 300ms才执行跳转,避免出错(来回跳动)
|
|
|
timer = setTimeout(() => {
|
|
|
this.tabClickAction(index)
|
|
|
- }, 300)
|
|
|
+ }, 500)
|
|
|
},
|
|
|
// 跳转执行
|
|
|
tabClickAction(index) {
|
|
@@ -1292,7 +1294,6 @@ export default {
|
|
|
const productMain = await this.$util.boundingClientRect(this, '.container-product-main', false)
|
|
|
const productDetail = await this.$util.boundingClientRect(this, '.product-details', true)
|
|
|
const topBar = await this.$util.boundingClientRect(this, '#topBar', false)
|
|
|
-
|
|
|
/*
|
|
|
说明:采用累加方式来计算每一个 prdocut-details 的 scrollTop 定位
|
|
|
scrollTop = 上一个的scrollTop + 上一个的高度
|
|
@@ -1335,6 +1336,15 @@ export default {
|
|
|
100,
|
|
|
true
|
|
|
),
|
|
|
+ debounce (fn,delay){
|
|
|
+ let timer = null //借助闭包
|
|
|
+ return function() {
|
|
|
+ if(timer){
|
|
|
+ clearTimeout(timer)
|
|
|
+ }
|
|
|
+ timer = setTimeout(fn,delay) // 简化写法
|
|
|
+ }
|
|
|
+ },
|
|
|
getWinHeight() {
|
|
|
this.winHeight = wx.getSystemInfoSync().windowHeight
|
|
|
},
|
|
@@ -1344,7 +1354,8 @@ export default {
|
|
|
},
|
|
|
onPageScroll(e) {
|
|
|
//实时获取到滚动的值
|
|
|
- const { scrollTop } = e
|
|
|
+ const { scrollTop } = e
|
|
|
+ this.debounce(this.getSectionProps(),1000)
|
|
|
if (!this.tabSelectFlag) {
|
|
|
this.activeTab(scrollTop, this)
|
|
|
}
|