|
|
|
@ -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%; |
|
|
|
|