Browse Source

优化下拉获取数据提示信息显示

master
wanghongjun 2 years ago
parent
commit
da0e37d472
  1. 2
      components/mescroll-uni/mescroll-uni-option.js
  2. 45
      pages/category/index.vue

2
components/mescroll-uni/mescroll-uni-option.js

@ -16,7 +16,7 @@ const GlobalOption = {
// 其他up的配置参数也可以写,这里只展示了常用的配置: // 其他up的配置参数也可以写,这里只展示了常用的配置:
textLoading: '加载中 ...', // 加载中的提示文本 textLoading: '加载中 ...', // 加载中的提示文本
textNoMore: '亲, 没有更多了', // 没有更多数据的提示文本 textNoMore: '亲, 没有更多了', // 没有更多数据的提示文本
textUpText: '', // 没有更多数据的提示文本 textUpText: '向上滑动 加载更多', // 没有更多数据的提示文本
offset: 150, // 距底部多远时,触发upCallback,仅mescroll-uni生效 ( mescroll-body配置的是pages.json的 onReachBottomDistance ) offset: 150, // 距底部多远时,触发upCallback,仅mescroll-uni生效 ( mescroll-body配置的是pages.json的 onReachBottomDistance )
toTop: { toTop: {
// 回到顶部按钮,需配置src才显示 // 回到顶部按钮,需配置src才显示

45
pages/category/index.vue

@ -248,7 +248,7 @@
// //
await app.getCatList(page.num) await app.getCatList(page.num)
.then(list => { .then(list => {
// console.log('list',list) console.log('list',list)
const curPageLen = list.data.length const curPageLen = list.data.length
const totalSize = list.total const totalSize = list.total
app.mescroll.endBySize(curPageLen, totalSize) app.mescroll.endBySize(curPageLen, totalSize)
@ -280,7 +280,7 @@
handleSelectNav(index) { handleSelectNav(index) {
this.curIndex = index this.curIndex = index
this.scrollTop = 0 this.scrollTop = 0
this.getCatList() this.upCallback(1)
}, },
// //
getCatList(pageNo = 1){ getCatList(pageNo = 1){
@ -296,10 +296,15 @@
resolve(resolveList) resolve(resolveList)
}) })
} else if (type === 2) { } else if (type === 2) {
app.getConsultingContextSelection() app.getConsultingContextSelection().then(res => {
resolve({data:res, total: res.length})
})
} else if (type === 3) { } else if (type === 3) {
app.getServiceProviders() app.getServiceProviders().then(res => {
resolve({data:res, total: 4})
})
} else if (type === 4) { } else if (type === 4) {
resolve({data:[{test:1},{test:2}], total: 2})
} else { } else {
let rd={"goods_status":1,"page":app.page,"limit":limit} let rd={"goods_status":1,"page":app.page,"limit":limit}
app.bindData(rd).then(bindList=> { app.bindData(rd).then(bindList=> {
@ -372,23 +377,29 @@
// //
getConsultingContextSelection() { getConsultingContextSelection() {
const app = this const app = this
CategoryApi.consultingContextSelection().then(res=>{ return new Promise((resolve, reject) => {
if (res.resultCode == '00000000') { CategoryApi.consultingContextSelection().then(res=>{
app.informationList = res.data if (res.resultCode == '00000000') {
} else { app.informationList = res.data
app.$error('获取资讯信息失败') resolve(res.data)
} } else {
}); app.$error('获取资讯信息失败')
}
})
})
}, },
// //
getServiceProviders() { getServiceProviders() {
const app = this const app = this
CategoryApi.serviceProviders().then(res=>{ return new Promise((resolve, reject) => {
if (res.resultCode == '00000000') { CategoryApi.serviceProviders().then(res=>{
app.serviceProvidersList = res.data if (res.resultCode == '00000000') {
} else { app.serviceProvidersList = res.data
app.$error('获取文化数据经纪商失败') resolve(res.data)
} } else {
app.$error('获取文化数据经纪商失败')
}
})
}); });
}, },
// //

Loading…
Cancel
Save