Commit fc79a0b71bc258f8969c611037b83dc0cc894a8c
1 parent
6f476050
优化服务预约选择美容师页面下拉
Showing
1 changed file
with
16 additions
and
12 deletions
packageG/pages/user/my_service/cosmetology_list.js
... | ... | @@ -22,13 +22,13 @@ Page({ |
22 | 22 | projectId:"",//项目id |
23 | 23 | }, |
24 | 24 | onReachBottom: function() { |
25 | - var th = this; | |
26 | - if (this.data.total <= th.data.pageSize) return; | |
27 | - if (this.data.ismore) return; | |
28 | - wx.showLoading({ | |
29 | - title: '加载中...', | |
30 | - }) | |
31 | - th.query_cology(); | |
25 | + // var th = this; | |
26 | + // if (this.data.total <= th.data.pageSize) return; | |
27 | + // if (this.data.ismore) return; | |
28 | + // wx.showLoading({ | |
29 | + // title: '加载中...', | |
30 | + // }) | |
31 | + // th.query_cology(); | |
32 | 32 | }, |
33 | 33 | query_cology: function() { |
34 | 34 | var th = this; |
... | ... | @@ -42,27 +42,31 @@ Page({ |
42 | 42 | serviceId: itemId, |
43 | 43 | storageId: storageId, |
44 | 44 | page: th.data.curpage, |
45 | - pageSize: th.data.pageSize | |
45 | + pageSize: 100 | |
46 | 46 | } |
47 | 47 | }).then(res => { |
48 | 48 | wx.hideLoading(); |
49 | 49 | if (res.data.code == 0) { |
50 | - th.data.curpage++; | |
50 | + // th.data.curpage++; | |
51 | 51 | var arr1 = th.data.cosmetology_list; |
52 | 52 | var arr2 = res.data.data; |
53 | 53 | var arr3 = [...arr1, ...arr2]; |
54 | - | |
55 | - | |
56 | 54 | th.setData({ |
57 | 55 | cosmetology_list: arr3, |
58 | 56 | total: res.data.data.total, |
59 | 57 | is_service_read: 1, |
60 | 58 | is_cosmetology_read:1 |
61 | 59 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
60 | + if (arr2.length < th.data.pageSize) { | |
61 | + th.setData({ | |
62 | + is_cosmetology_read:1, | |
63 | + ismore:1 | |
64 | + }) | |
65 | + } | |
62 | 66 | } else { |
63 | 67 | th.setData({ |
64 | 68 | is_cosmetology_read:1, |
65 | - ismore:1 | |
69 | + ismore:1 | |
66 | 70 | }) |
67 | 71 | } |
68 | 72 | }) | ... | ... |