xujing 5 年前
父节点
当前提交
5844cef521

+ 2
- 0
src/app.js 查看文件

315
           Taro.removeStorageSync('activityPageIndex')
315
           Taro.removeStorageSync('activityPageIndex')
316
           Taro.removeStorageSync('newsPageIndex')
316
           Taro.removeStorageSync('newsPageIndex')
317
           Taro.removeStorageSync('buildingPageIndex')
317
           Taro.removeStorageSync('buildingPageIndex')
318
+          Taro.removeStorageSync('followPageIndex')
319
+          Taro.removeStorageSync('clinchPageIndex')
318
 
320
 
319
           // 获取未读消息
321
           // 获取未读消息
320
           const { person: { personId } } = res
322
           const { person: { personId } } = res

+ 25
- 10
src/useless/pages/person/customerAnalysis/followUpCustomer/index.js 查看文件

44
   }
44
   }
45
   componentDidShow() {
45
   componentDidShow() {
46
     Taro.showLoading()
46
     Taro.showLoading()
47
-    this.loadList(1)
47
+    const pageSize = (Taro.getStorageSync('followPageIndex') || 1) * 10
48
+    this.loadList(1, pageSize)
48
 
49
 
49
   }
50
   }
51
+  componentDidHide() {
52
+    const { pageIndex } = this.state;
53
+    Taro.setStorageSync('followPageIndex', pageIndex)
54
+  }
50
 
55
 
51
-  loadList(pageNumber) {
56
+  loadList(page = 0, pageSize = 10) {
57
+    const currentPage = page || this.state.pageIndex
52
     const payload = {
58
     const payload = {
53
       type: 'follow',
59
       type: 'follow',
54
-      pageNumber,
55
-      pageSize: 10
60
+      pageSize,
61
+      pageNumber: currentPage,
56
     }
62
     }
63
+
57
     queryCustomerList(payload.type, payload).then(res => {
64
     queryCustomerList(payload.type, payload).then(res => {
58
-      const { records, list, total, current, pages } = res || {}
65
+      const { records, list, total, current, pages, size } = res || {}
59
       const _list = records || list || []
66
       const _list = records || list || []
60
       const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
67
       const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
68
+      const pageNum = Math.max(Taro.getStorageSync('followPageIndex'), current)
61
       this.setState({
69
       this.setState({
62
         customerList: newList,
70
         customerList: newList,
63
         isEmpty: total == 0,
71
         isEmpty: total == 0,
64
-        hasMore: current < pages,
65
-        pageIndex: current >= pages ? pages : current
72
+        hasMore: current * size < total,
73
+        pageIndex: pageNum,
74
+        // hasMore: current < pages,
75
+        // pageIndex: current >= pages ? pages : current
66
       })
76
       })
67
       Taro.hideLoading()
77
       Taro.hideLoading()
68
     })
78
     })
97
   // 筛查跟进客户
107
   // 筛查跟进客户
98
   filterCustomerList() {
108
   filterCustomerList() {
99
 
109
 
110
+
100
     const payload = {
111
     const payload = {
101
       type: 'follow',
112
       type: 'follow',
102
-      pageNumber: 0,
113
+      pageNumber: 1,
103
       pageSize: 9999,
114
       pageSize: 9999,
104
       name: this.state.inputValue,
115
       name: this.state.inputValue,
105
       status: (this.state.statusIndex == 0 || this.state.statusIndex == -1) ? '' : this.state.statusIndex,
116
       status: (this.state.statusIndex == 0 || this.state.statusIndex == -1) ? '' : this.state.statusIndex,
109
       endReportDate: this.state.endReportDate,
120
       endReportDate: this.state.endReportDate,
110
     }
121
     }
111
     queryCustomerList(payload.type, payload).then(res => {
122
     queryCustomerList(payload.type, payload).then(res => {
112
-
123
+      const { records, total, current, pages, size } = res || {}
113
       this.setState({
124
       this.setState({
114
-        customerList: res.records || []
125
+
126
+        customerList: records || [],
127
+        isEmpty: total == 0,
128
+        hasMore: current * size < total,
129
+        pageIndex: pageNum,
115
       })
130
       })
116
       Taro.hideLoading()
131
       Taro.hideLoading()
117
     })
132
     })

+ 17
- 8
src/useless/pages/person/customerAnalysis/transactionCustomer/index.js 查看文件

29
 
29
 
30
   componentDidShow() {
30
   componentDidShow() {
31
     Taro.showLoading()
31
     Taro.showLoading()
32
-    this.loadList(1)
33
-
32
+    const pageSize = (Taro.getStorageSync('clinchPageIndex') || 1) * 10
33
+    this.loadList(1, pageSize)
34
   }
34
   }
35
-  loadList(pageNumber) {
35
+  componentDidHide() {
36
+    const { pageIndex } = this.state;
37
+    Taro.setStorageSync('clinchPageIndex', pageIndex)
38
+  }
39
+
40
+  loadList(page = 0, pageSize = 10) {
41
+    const currentPage = page || this.state.pageIndex
36
     const payload = {
42
     const payload = {
37
       type: 'clinch',
43
       type: 'clinch',
38
-      pageNumber,
39
-      pageSize: 9999
44
+      pageSize,
45
+      pageNumber: currentPage,
40
     }
46
     }
41
     queryCustomerList(payload.type, payload).then(res => {
47
     queryCustomerList(payload.type, payload).then(res => {
42
-      const { records, list, total, current, pages } = res || {}
48
+      const { records, list, total, current, pages, size } = res || {}
43
       const _list = records || list || []
49
       const _list = records || list || []
44
       const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
50
       const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
51
+      const pageNum = Math.max(Taro.getStorageSync('clinchPageIndex'), current)
45
       this.setState({
52
       this.setState({
46
         customerList: newList,
53
         customerList: newList,
47
         isEmpty: total == 0,
54
         isEmpty: total == 0,
48
-        hasMore: current < pages,
49
-        pageIndex: current >= pages ? pages : current
55
+        hasMore: current * size < total,
56
+        pageIndex: pageNum,
57
+        // hasMore: current < pages,
58
+        // pageIndex: current >= pages ? pages : current
50
       })
59
       })
51
       Taro.hideLoading()
60
       Taro.hideLoading()
52
     })
61
     })