店铺商品的下拉刷新
This commit is contained in:
parent
8dc86cfa53
commit
75e98578c2
@ -662,8 +662,7 @@
|
|||||||
"path": "home/index",
|
"path": "home/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTitleText": "店铺首页",
|
"navigationBarTitleText": "店铺首页"
|
||||||
"enablePullDownRefresh": true
|
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
,
|
,
|
||||||
"navigationBarTextStyle": "#FFFFFF"
|
"navigationBarTextStyle": "#FFFFFF"
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="main" scroll-y="true" @scroll="scrollHome" catchtouchmove :style="viewColor">
|
<scroll-view @refresherrefresh="onRefresh" refresher-enabled="true" :refresher-triggered="isTriggered" class="main" scroll-y="true" @scroll="scrollHome" catchtouchmove :style="viewColor">
|
||||||
<!-- 店铺信息 -->
|
<!-- 店铺信息 -->
|
||||||
<view id="store" class="store">
|
<view id="store" class="store">
|
||||||
<image :src="store.mer_avatar"></image>
|
<image :src="store.mer_avatar"></image>
|
||||||
@ -496,6 +496,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//下拉
|
||||||
|
isTriggered:false,
|
||||||
domain: HTTP_REQUEST_URL,
|
domain: HTTP_REQUEST_URL,
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
menuButtonInfo: uni.getMenuButtonBoundingClientRect(),
|
menuButtonInfo: uni.getMenuButtonBoundingClientRect(),
|
||||||
@ -1183,7 +1185,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//#endif
|
//#endif
|
||||||
|
onRefresh(){
|
||||||
|
this.isTriggered = true;
|
||||||
|
const newList = this.goods.reverse();
|
||||||
|
this.goods = newList;
|
||||||
|
this.getProductSpu()
|
||||||
|
setTimeout(() => {
|
||||||
|
this.isTriggered = false;
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
// 模拟触底刷新
|
// 模拟触底刷新
|
||||||
if (this.tabActive == 0) {
|
if (this.tabActive == 0) {
|
||||||
@ -1200,7 +1213,7 @@
|
|||||||
this.goods = newList;
|
this.goods = newList;
|
||||||
this.getProductSpu()
|
this.getProductSpu()
|
||||||
// uni.startPullDownRefresh();
|
// uni.startPullDownRefresh();
|
||||||
uni.stopPullDownRefresh();
|
// uni.stopPullDownRefresh();
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user