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,13 +22,13 @@ Page({ | ||
22 | projectId:"",//项目id | 22 | projectId:"",//项目id |
23 | }, | 23 | }, |
24 | onReachBottom: function() { | 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 | query_cology: function() { | 33 | query_cology: function() { |
34 | var th = this; | 34 | var th = this; |
@@ -42,27 +42,31 @@ Page({ | @@ -42,27 +42,31 @@ Page({ | ||
42 | serviceId: itemId, | 42 | serviceId: itemId, |
43 | storageId: storageId, | 43 | storageId: storageId, |
44 | page: th.data.curpage, | 44 | page: th.data.curpage, |
45 | - pageSize: th.data.pageSize | 45 | + pageSize: 100 |
46 | } | 46 | } |
47 | }).then(res => { | 47 | }).then(res => { |
48 | wx.hideLoading(); | 48 | wx.hideLoading(); |
49 | if (res.data.code == 0) { | 49 | if (res.data.code == 0) { |
50 | - th.data.curpage++; | 50 | + // th.data.curpage++; |
51 | var arr1 = th.data.cosmetology_list; | 51 | var arr1 = th.data.cosmetology_list; |
52 | var arr2 = res.data.data; | 52 | var arr2 = res.data.data; |
53 | var arr3 = [...arr1, ...arr2]; | 53 | var arr3 = [...arr1, ...arr2]; |
54 | - | ||
55 | - | ||
56 | th.setData({ | 54 | th.setData({ |
57 | cosmetology_list: arr3, | 55 | cosmetology_list: arr3, |
58 | total: res.data.data.total, | 56 | total: res.data.data.total, |
59 | is_service_read: 1, | 57 | is_service_read: 1, |
60 | is_cosmetology_read:1 | 58 | is_cosmetology_read:1 |
61 | }), wx.stopPullDownRefresh(); //停止下拉刷新 | 59 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
60 | + if (arr2.length < th.data.pageSize) { | ||
61 | + th.setData({ | ||
62 | + is_cosmetology_read:1, | ||
63 | + ismore:1 | ||
64 | + }) | ||
65 | + } | ||
62 | } else { | 66 | } else { |
63 | th.setData({ | 67 | th.setData({ |
64 | is_cosmetology_read:1, | 68 | is_cosmetology_read:1, |
65 | - ismore:1 | 69 | + ismore:1 |
66 | }) | 70 | }) |
67 | } | 71 | } |
68 | }) | 72 | }) |