From fc79a0b71bc258f8969c611037b83dc0cc894a8c Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Thu, 11 Jan 2024 15:28:32 +0800 Subject: [PATCH] 优化服务预约选择美容师页面下拉 --- packageG/pages/user/my_service/cosmetology_list.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/packageG/pages/user/my_service/cosmetology_list.js b/packageG/pages/user/my_service/cosmetology_list.js index 5d71119..900a7c1 100644 --- a/packageG/pages/user/my_service/cosmetology_list.js +++ b/packageG/pages/user/my_service/cosmetology_list.js @@ -22,13 +22,13 @@ Page({ projectId:"",//项目id }, onReachBottom: function() { - var th = this; - if (this.data.total <= th.data.pageSize) return; - if (this.data.ismore) return; - wx.showLoading({ - title: '加载中...', - }) - th.query_cology(); + // var th = this; + // if (this.data.total <= th.data.pageSize) return; + // if (this.data.ismore) return; + // wx.showLoading({ + // title: '加载中...', + // }) + // th.query_cology(); }, query_cology: function() { var th = this; @@ -42,27 +42,31 @@ Page({ serviceId: itemId, storageId: storageId, page: th.data.curpage, - pageSize: th.data.pageSize + pageSize: 100 } }).then(res => { wx.hideLoading(); if (res.data.code == 0) { - th.data.curpage++; + // th.data.curpage++; var arr1 = th.data.cosmetology_list; var arr2 = res.data.data; var arr3 = [...arr1, ...arr2]; - - th.setData({ cosmetology_list: arr3, total: res.data.data.total, is_service_read: 1, is_cosmetology_read:1 }), wx.stopPullDownRefresh(); //停止下拉刷新 + if (arr2.length < th.data.pageSize) { + th.setData({ + is_cosmetology_read:1, + ismore:1 + }) + } } else { th.setData({ is_cosmetology_read:1, - ismore:1 + ismore:1 }) } }) -- libgit2 0.21.4