diff --git a/components/mescroll-uni/mescroll-uni-option.js b/components/mescroll-uni/mescroll-uni-option.js index d44c626..8a12b79 100644 --- a/components/mescroll-uni/mescroll-uni-option.js +++ b/components/mescroll-uni/mescroll-uni-option.js @@ -16,7 +16,7 @@ const GlobalOption = { // 其他up的配置参数也可以写,这里只展示了常用的配置: textLoading: '加载中 ...', // 加载中的提示文本 textNoMore: '亲, 没有更多了', // 没有更多数据的提示文本 - textUpText: '', // 没有更多数据的提示文本 + textUpText: '向上滑动 加载更多', // 没有更多数据的提示文本 offset: 150, // 距底部多远时,触发upCallback,仅mescroll-uni生效 ( mescroll-body配置的是pages.json的 onReachBottomDistance ) toTop: { // 回到顶部按钮,需配置src才显示 diff --git a/pages/category/index.vue b/pages/category/index.vue index 979cc66..8da2ced 100644 --- a/pages/category/index.vue +++ b/pages/category/index.vue @@ -248,7 +248,7 @@ // 设置列表数据 await app.getCatList(page.num) .then(list => { - // console.log('list',list) + console.log('list',list) const curPageLen = list.data.length const totalSize = list.total app.mescroll.endBySize(curPageLen, totalSize) @@ -280,7 +280,7 @@ handleSelectNav(index) { this.curIndex = index this.scrollTop = 0 - this.getCatList() + this.upCallback(1) }, // 查询分类 获取列表 getCatList(pageNo = 1){ @@ -296,10 +296,15 @@ resolve(resolveList) }) } else if (type === 2) { - app.getConsultingContextSelection() + app.getConsultingContextSelection().then(res => { + resolve({data:res, total: res.length}) + }) } else if (type === 3) { - app.getServiceProviders() + app.getServiceProviders().then(res => { + resolve({data:res, total: 4}) + }) } else if (type === 4) { + resolve({data:[{test:1},{test:2}], total: 2}) } else { let rd={"goods_status":1,"page":app.page,"limit":limit} app.bindData(rd).then(bindList=> { @@ -372,23 +377,29 @@ // 资讯中心 getConsultingContextSelection() { const app = this - CategoryApi.consultingContextSelection().then(res=>{ - if (res.resultCode == '00000000') { - app.informationList = res.data - } else { - app.$error('获取资讯信息失败') - } - }); + return new Promise((resolve, reject) => { + CategoryApi.consultingContextSelection().then(res=>{ + if (res.resultCode == '00000000') { + app.informationList = res.data + resolve(res.data) + } else { + app.$error('获取资讯信息失败') + } + }) + }) }, // 文化数据经纪商 getServiceProviders() { const app = this - CategoryApi.serviceProviders().then(res=>{ - if (res.resultCode == '00000000') { - app.serviceProvidersList = res.data - } else { - app.$error('获取文化数据经纪商失败') - } + return new Promise((resolve, reject) => { + CategoryApi.serviceProviders().then(res=>{ + if (res.resultCode == '00000000') { + app.serviceProvidersList = res.data + resolve(res.data) + } else { + app.$error('获取文化数据经纪商失败') + } + }) }); }, // 处理列表中的特殊字段