diff --git a/pages.json b/pages.json index cc5a0e8..560d811 100644 --- a/pages.json +++ b/pages.json @@ -37,7 +37,8 @@ "style": { "navigationBarTitleText": "场景演练", "navigationBarTextStyle": "black", - "enablePullDownRefresh": true, + "enablePullDownRefresh": false, + "onReachBottomDistance": 150, "navigationStyle": "custom" } }, diff --git a/subpkg/list/list.vue b/subpkg/list/list.vue index 3f2ebff..61a4c50 100644 --- a/subpkg/list/list.vue +++ b/subpkg/list/list.vue @@ -35,10 +35,16 @@ export default { data() { return { - name:"", + queryObj:{ + name:"", + pageNum:1, + pageSize:1 + }, + total:0, + isloading:false, //轮播图数据列表 swiperList: [], - //轮播图数据列表 + //场景数据列表 sceneList: [] }; }, @@ -62,26 +68,19 @@ uni.$showMsg('数据请求成功!') }, async getSceneList() { - + this.isloading = true const { data: res - } = await uni.$http.post('/small/scene/manage/listAll',{name:this.name}) - if (!res.success) return uni.$showMsg() - this.sceneList = [] - res.data.forEach(item=>{ + } = await uni.$http.post('/small/scene/manage/listApp',this.queryObj) + this.isloading = false + + res.rows.forEach(item=>{ item.uploadPath = uni.$http.baseUrl +item.uploadPath - this.sceneList.push(item) }) - + this.sceneList =[...this.sceneList,...res.rows] + this.total = res.total uni.$showMsg('数据请求成功!') }, - objToParams(obj){ - let arr = []; - for (let key in obj) { - arr.push(`${key}=${obj[key]}`); - } - return arr.join('&') - }, navClickHandler(item) { if(item !== ""){ uni.navigateTo({ @@ -102,6 +101,12 @@ delta:1,//返回层数,2则上上页 }) }, + onReachBottom(){ + if(this.queryObj.pageNum * this.queryObj.pageSize >= this.total) return uni.$showMsg('已展示所有场景') + if(this.isloading) return + this.queryObj.pageNum++ + this.getSceneList() + } } }