许静 5 gadus atpakaļ
vecāks
revīzija
2473f70a36

+ 8
- 6
src/pages/person/customerAnalysis/analysis.js Parādīt failu

@@ -96,26 +96,28 @@ export default class analysis extends Taro.Component {
96 96
             </View>
97 97
           </AtTabsPane>
98 98
           <AtTabsPane current={this.state.current} index={1}>
99
-            <View>
99
+          <View>
100 100
               <PieChart ref={this.refPieChart} />
101
+              <View style="height:20rpx;background:#f5f5f5;"> </View>
101 102
               <View style="padding: 40rpx;">
102
-                <View style="font-size: 32rpx;color: #666;">性别</View>
103
+                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
103 104
                 {
104 105
                   sexInfo.map(item => (
105
-                    <View style="display: flex;align-items: center;">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}<AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color='#FF4949' /></View>
106
+                    <View style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
106 107
                   ))
107 108
                 }
108 109
               </View>
109 110
             </View>
110 111
           </AtTabsPane>
111 112
           <AtTabsPane current={this.state.current} index={2}>
112
-            <View>
113
+          <View>
113 114
               <PieChart ref={this.refPieChart} />
115
+              <View style="height:20rpx;background:#f5f5f5;"> </View>
114 116
               <View style="padding: 40rpx;">
115
-                <View style="font-size: 32rpx;color: #666;">性别</View>
117
+                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
116 118
                 {
117 119
                   sexInfo.map(item => (
118
-                    <View style="display: flex;align-items: center;">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}<AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color='#FF4949' /></View>
120
+                    <View style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
119 121
                   ))
120 122
                 }
121 123
               </View>

+ 4
- 4
src/pages/person/customerAnalysis/followUpCustomer/index.js Parādīt failu

@@ -17,7 +17,7 @@ export default class transactionCustomer extends Taro.Component {
17 17
 
18 18
 
19 19
   state = {
20
-
20
+    recordId: undefined, // 埋点ID
21 21
     customerList: [],
22 22
     inputValue: '',
23 23
     screenVisible: false,
@@ -29,7 +29,6 @@ export default class transactionCustomer extends Taro.Component {
29 29
     endReportDate: '',
30 30
     hasMore: true,
31 31
     isEmpty: false,
32
-    recordId: undefined, // 埋点ID
33 32
     pageIndex: 1
34 33
   }
35 34
 
@@ -261,7 +260,7 @@ export default class transactionCustomer extends Taro.Component {
261 260
             className="wrap"
262 261
             needInit
263 262
             isEmpty={isEmpty}
264
-            emptyText="暂无活动~"
263
+            emptyText="暂无跟进客户~"
265 264
             hasMore={hasMore}
266 265
             onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
267 266
             onScrollToLower={fn => this.onScrollToLower(fn)}
@@ -269,7 +268,8 @@ export default class transactionCustomer extends Taro.Component {
269 268
             <View className="list">
270 269
               {
271 270
                 !customerList.length &&
272
-                <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
271
+                <View></View>
272
+                // <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
273 273
               }
274 274
               {
275 275
                 customerList.length &&

+ 59
- 25
src/pages/person/customerAnalysis/transactionCustomer/index.js Parādīt failu

@@ -1,5 +1,6 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import Authorize from '@components/authorize'
3
+import ListView from '@components/ListView'
3 4
 import './index.scss'
4 5
 import { savePoint, updatePoint } from '@services/common'
5 6
 import { connect } from '@tarojs/redux'
@@ -17,6 +18,9 @@ export default class transactionCustomer extends Taro.Component {
17 18
   state = {
18 19
     recordId: undefined, // 埋点ID
19 20
     customerList: [],
21
+    hasMore: true,
22
+    isEmpty: false,
23
+    pageIndex: 1
20 24
   }
21 25
 
22 26
   componentWillUnmount() {
@@ -36,40 +40,70 @@ export default class transactionCustomer extends Taro.Component {
36 40
     }
37 41
     queryCustomerList(payload.type, payload).then(res => {
38 42
       this.setState({
39
-        customerList: res.records || []
43
+        customerList: res.records || [],
44
+        isEmpty: res.total == 0,
45
+        hasMore: res.current < res.page,
46
+        pageIndex: res.current >= res.pages ? res.pages : res.current
40 47
       })
41 48
       Taro.hideLoading()
42 49
     })
43 50
   }
51
+  onScrollToLower = async (fn) => {
52
+    const { pageIndex } = this.state;
53
+    this.loadList(pageIndex + 1)
54
+    fn && fn();
55
+  }
56
+  onPullDownRefresh = (rest) => {
57
+    // debugger
58
+    if (this.refreshing) return
59
+    this.refreshing = true
60
+    this.loadList(1)
61
+    rest && rest()
62
+    this.refreshing = false
63
+  }
44 64
 
45 65
   render() {
46
-    const { customerList } = this.state
66
+    const { customerList, isEmpty, hasMore } = this.state
47 67
 
48 68
     return (
49 69
       <View style="padding:10px">
50
-        {
51
-          !customerList.length &&
52
-          <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
53
-        }
54
-        {
55
-          customerList.length &&
56
-          customerList.map(item => (
57
-            <View class="item">
58
-              <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
59
-              <View className="name">
60
-                {item.name}
61
-                {
62
-                  item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
63
-                }
64
-                {
65
-                  item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
66
-                }
67
-              </View>
68
-              <View className="phone">{item.phone} </View>
69
-              <View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View>
70
-            </View>
71
-          ))
72
-        }
70
+        <ListView
71
+          className="wrap"
72
+          needInit
73
+          isEmpty={isEmpty}
74
+          emptyText="暂无成交客户~"
75
+          hasMore={hasMore}
76
+          onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
77
+          onScrollToLower={fn => this.onScrollToLower(fn)}
78
+        >
79
+          <View className="list">
80
+            {
81
+              !customerList.length &&
82
+              <View></View>
83
+              // <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无成交客户~</View>
84
+            }
85
+            {
86
+              customerList.length &&
87
+              customerList.map(item => (
88
+                <View class="item">
89
+                  <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
90
+                  <View className="name">
91
+                    {item.name}
92
+                    {
93
+                      item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
94
+                    }
95
+                    {
96
+                      item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
97
+                    }
98
+                  </View>
99
+                  <View className="phone">{item.phone} </View>
100
+                  <View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View>
101
+                </View>
102
+              ))
103
+            }
104
+          </View>
105
+        </ListView>
106
+
73 107
 
74 108
       </View>
75 109
     )