Browse Source

优化信息公开下拉

master
wanghongjun 2 years ago
parent
commit
b080308100
  1. 39
      pages/category/consulting/list.vue

39
pages/category/consulting/list.vue

@ -17,16 +17,6 @@
</view>
<!-- 二级分类 20 -->
<view class="cate-content">
<!-- 左侧 一级分类 -->
<!-- <scroll-view class="cate-left" scroll-y="true">
<view class="type-nav" :class="{ selected: curIndex == index }" v-for="(item, index) in informationList" :key="index"
@click="handleSelectNav(index,item.consultingId)">
<image class="cate-left-image" :src="'./static/tabbar/recommend-cate.png'"></image>
<text class="cate-left-text">{{ item.consultingName }}</text>
</view>
</scroll-view> -->
<!-- 右侧 二级分类 -->
<scroll-view 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 v-if="list.length>0" class="cate-right-cont">
<view class="cate-two-box">
@ -61,7 +51,6 @@
</view>
</mescroll-body>
</scroll-view>
</view>
</view>
@ -110,10 +99,6 @@
isLoading: true,
//
curIndex: 0,
//
scrollHeight: 0,
//
scrollTop: 0,
// id
consultingId: '',
//
@ -159,8 +144,7 @@
}
},
created() {
//
this.setListHeight()
},
methods: {
//
@ -168,19 +152,12 @@
//
this.getCatList()
},
//
setListHeight() {
const { windowHeight } = uni.getSystemInfoSync()
this.scrollHeight = windowHeight - rpx2px(96)
},
//
onRefreshPage() {
//
lastRefreshTime = new Date().getTime()
//
this.getPageData()
//
this.getCatList()
},
//
getPageData() {
@ -188,13 +165,6 @@
app.isLoading = true
Promise.all([]).then(result => {}).finally(() => app.isLoading = false)
},
//
handleSelectNav(index,consultingId) {
this.curIndex = index
this.scrollTop = 0
this.consultingId = consultingId
this.getCatList()
},
/**
* 上拉加载的回调 (页面初始化时也会执行一次)
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
@ -204,8 +174,8 @@
const app = this
//
app.getCatList(page.num).then(list => {
const curPageLen = list.length
const totalSize = list.total
const curPageLen = list.pageDataList.length
const totalSize = list.pageDataSize
app.mescroll.endBySize(curPageLen, totalSize)
})
.catch(() => app.mescroll.endErr())
@ -226,7 +196,7 @@
if (res.resultCode === '00000000') {
let newList = res.data.pageDataList;
app.list = CategoryApi.getMoreListData(newList, app.list, pageIndex)
resolve(newList)
resolve(res.data)
}
})
})
@ -293,6 +263,7 @@
.flex-three {
float: left;
width: 100%;
margin-top: 20rpx;
.cate-cont {
width: 90%;

Loading…
Cancel
Save