Browse Source

优化滚动

master
wanghongjun 2 years ago
parent
commit
e531d211af
  1. 19
      pages/category/index.vue
  2. 2
      pages/recommend/index.vue

19
pages/category/index.vue

@ -17,8 +17,8 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 右侧 二级分类 --> <!-- 右侧 二级分类 -->
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<scroll-view v-if="list.length>0 && type==0" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }"> <scroll-view v-if="list.length>0 && type==0" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<!-- 有数据的时候 --> <!-- 有数据的时候 -->
<view class="cate-right-cont"> <view class="cate-right-cont">
<view class="cate-two-box"> <view class="cate-two-box">
@ -34,10 +34,8 @@
</view> </view>
</view> </view>
</view> </view>
</mescroll-body>
</scroll-view> </scroll-view>
<scroll-view v-else-if="userList.length>0 && type==1"class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }"> <scroll-view v-else-if="userList.length>0 && type==1"class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<view class="cate-right-cont"> <view class="cate-right-cont">
<view class="cate-two-box"> <view class="cate-two-box">
<view class="cate-cont-box"> <view class="cate-cont-box">
@ -57,10 +55,8 @@
</view> </view>
</view> </view>
</view> </view>
</mescroll-body>
</scroll-view> </scroll-view>
<scroll-view v-else-if="informationList.length>0 && type==2"class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }"> <scroll-view v-else-if="informationList.length>0 && type==2"class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<view class="cate-right-cont"> <view class="cate-right-cont">
<view class="cate-two-box"> <view class="cate-two-box">
<view class="cate-cont-box"> <view class="cate-cont-box">
@ -73,10 +69,8 @@
</view> </view>
</view> </view>
</view> </view>
</mescroll-body>
</scroll-view> </scroll-view>
<scroll-view v-else-if="serviceProvidersList.length>0 && type==3" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }"> <scroll-view v-else-if="serviceProvidersList.length>0 && type==3" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<view class="cate-right-cont"> <view class="cate-right-cont">
<view class="cate-two-box"> <view class="cate-two-box">
<view class="cate-cont-box"> <view class="cate-cont-box">
@ -91,10 +85,8 @@
</view> </view>
</view> </view>
</view> </view>
</mescroll-body>
</scroll-view> </scroll-view>
<scroll-view v-else-if="transactionList.length>0 && type==4" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }"> <scroll-view v-else-if="transactionList.length>0 && type==4" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<view class="cate-right-cont"> <view class="cate-right-cont">
<view class="cate-two-box"> <view class="cate-two-box">
<view class="cate-cont-box"> <view class="cate-cont-box">
@ -107,8 +99,8 @@
</view> </view>
</view> </view>
</view> </view>
</mescroll-body>
</scroll-view> </scroll-view>
</mescroll-body>
</view> </view>
@ -210,7 +202,7 @@
*/ */
onLoad(options) { onLoad(options) {
// //
this.onRefreshPage() //this.onRefreshPage()
this.curIndex = options.curIndex ? options.curIndex : 0 this.curIndex = options.curIndex ? options.curIndex : 0
}, },
@ -359,6 +351,7 @@
async getHomeListImage() { async getHomeListImage() {
this.list.forEach((item, key) => { this.list.forEach((item, key) => {
if (item.goods_image === "") { if (item.goods_image === "") {
uni.hideLoading()
GoodsApi.nbgoodsImage({"id": item.id}).then(res2 => { GoodsApi.nbgoodsImage({"id": item.id}).then(res2 => {
if (res2.code === 200) { if (res2.code === 200) {
this.list[key].goods_image = res2.data.data[0].goods_image; this.list[key].goods_image = res2.data.data[0].goods_image;
@ -451,8 +444,8 @@
.secondary{ .secondary{
z-index: 19; z-index: 19;
border-top: 1rpx solid #444; border-top: 1rpx solid #444;
// height: 100vh; height: 95vh;
height: 100%; //height: 100%;
} }
// //

2
pages/recommend/index.vue

@ -226,7 +226,7 @@ export default {
.secondary { .secondary {
z-index: 19; z-index: 19;
border-top: 1rpx solid #444; border-top: 1rpx solid #444;
height: 100vh; height: 95vh;
} }
// //

Loading…
Cancel
Save