许静 5 lat temu
rodzic
commit
3c0cf3fd0d

+ 41
- 19
src/components/charts/Line.js Wyświetl plik

54
     const colorWithOpacity = op => `rgba(187,156,121, ${op})`
54
     const colorWithOpacity = op => `rgba(187,156,121, ${op})`
55
 
55
 
56
     const defaultOpt = {
56
     const defaultOpt = {
57
-      color: [ colorWithOpacity(1) ],
58
-      xAxis: { type: 'category', boundaryGap: false },
59
-      yAxis: { type: 'value' },
57
+      color: [colorWithOpacity(1)],
58
+      xAxis: {
59
+        type: 'category',
60
+        boundaryGap: false,
61
+        axisLabel: {
62
+          textStyle: {
63
+            color: '#666'
64
+          }
65
+        }
66
+
67
+      },
68
+      yAxis: {
69
+        type: 'value',
70
+        axisLabel: {
71
+          textStyle: {
72
+            color: '#666'
73
+          }
74
+        }
75
+      },
76
+      grid: {
77
+        left: '10%',
78
+        right: '8%',
79
+        bottom: '10%',
80
+        top: '6%',
81
+      },
60
       series: [],
82
       series: [],
61
     }
83
     }
62
 
84
 
74
         symbolSize: 6,
96
         symbolSize: 6,
75
         smooth: true,
97
         smooth: true,
76
         label: {
98
         label: {
77
-            show: true,
78
-            formatter: '{@value}人'
99
+          show: true,
100
+          formatter: '{@value}人'
79
         },
101
         },
80
         lineStyle: {
102
         lineStyle: {
81
-            shadowColor: colorWithOpacity(0.5),
82
-            shadowBlur: 5,
83
-            shadowOffsetY: 7
103
+          shadowColor: colorWithOpacity(0.5),
104
+          shadowBlur: 5,
105
+          shadowOffsetY: 7
84
         },
106
         },
85
         areaStyle: {
107
         areaStyle: {
86
           color: {
108
           color: {
87
-              type: 'linear',
88
-              x: 0,
89
-              y: 0,
90
-              x2: 0,
91
-              y2: 1,
92
-              colorStops: [{
93
-                  offset: 0, color: colorWithOpacity(0.2) // 0% 处的颜色
94
-              }, {
95
-                  offset: 1, color: colorWithOpacity(0) // 100% 处的颜色
96
-              }],
97
-              global: false,
109
+            type: 'linear',
110
+            x: 0,
111
+            y: 0,
112
+            x2: 0,
113
+            y2: 1,
114
+            colorStops: [{
115
+              offset: 0, color: colorWithOpacity(0.2) // 0% 处的颜色
116
+            }, {
117
+              offset: 1, color: colorWithOpacity(0) // 100% 处的颜色
118
+            }],
119
+            global: false,
98
           }
120
           }
99
         },
121
         },
100
       }],
122
       }],

+ 3
- 3
src/components/charts/style.scss Wyświetl plik

1
 .map-container {
1
 .map-container {
2
   position: absolute;
2
   position: absolute;
3
-  top: 0;
3
+  top: 80px;
4
   bottom: 0;
4
   bottom: 0;
5
   left: 1vw;
5
   left: 1vw;
6
   right: 0;
6
   right: 0;
7
-  width:98vw;
8
-  height:600px;
7
+  width:100vw;
8
+  height:400px;
9
   display: flex;
9
   display: flex;
10
   flex-direction: column;
10
   flex-direction: column;
11
   align-items: center;
11
   align-items: center;

+ 70
- 25
src/pages/person/customerAnalysis/analysis.js Wyświetl plik

79
       })
79
       })
80
     })
80
     })
81
   }
81
   }
82
+  changeDailyMonth(inx) {
83
+    const { current } = this.state
84
+    const params = current == 0 ? 'new' : current == 1 ? 'follow' : 'visite'
85
+    if (inx == 0) {
86
+      getEchartDailyInfo(params).then(res => {
87
+        console.log(res, "res")
88
+        // let arr = []
89
+        // data.map((item, index) => {
90
+        //   arr.push({ img: item, sort: index })
91
+        // })
92
+        this.setState({
93
+        })
94
+      })
95
+    } else {
96
+      getEchartMonthInfo(params).then(res => {
97
+        console.log(res, "res")
98
+        this.setState({
99
+        })
100
+      })
101
+    }
102
+    this.setState({
103
+      checkedWhich: inx
104
+    })
105
+
106
+  }
82
 
107
 
83
   render() {
108
   render() {
84
 
109
 
85
     const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
110
     const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
86
     const dailyMonth = ['日', '月']
111
     const dailyMonth = ['日', '月']
87
-    const { sexInfo, chartInfo, checkedWhich } = this.state
112
+    const { sexInfo, chartInfo, checkedWhich, current } = this.state
88
 
113
 
89
     return (
114
     return (
90
       <View>
115
       <View>
91
-        <AtTabs className="tab-bar" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
92
-          <AtTabsPane current={this.state.current} index={0} >
116
+        <AtTabs className="tab-bar" current={current} tabList={tabList} onClick={this.handleClick.bind(this)}>
117
+          <AtTabsPane current={current} index={0} >
93
             <View>
118
             <View>
94
-              <View style="width:90vw;height:600rpx">
119
+              <View style="height:'40rpx;position: relative;">
95
                 <View className="daily-month" >
120
                 <View className="daily-month" >
96
                   {
121
                   {
97
                     dailyMonth.map((item, index) => (
122
                     dailyMonth.map((item, index) => (
98
-                      <View className={checkedWhich == index ? 'checked' : 'item'}>
123
+                      <View className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
99
                         {item}
124
                         {item}
100
-                      </View>
101
-                    ))
125
+                      </View>))
102
                   }
126
                   }
103
-
104
                 </View>
127
                 </View>
128
+              </View>
129
+              <View style="width:100vw;height:530rpx">
105
                 <LineChart source={chartInfo} />
130
                 <LineChart source={chartInfo} />
106
               </View>
131
               </View>
107
-
108
               <View style="height:20rpx;background:#f5f5f5;"> </View>
132
               <View style="height:20rpx;background:#f5f5f5;"> </View>
109
               <View style="padding: 40rpx;">
133
               <View style="padding: 40rpx;">
110
                 <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
134
                 <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
111
-                {
112
-                  sexInfo.map((item, index) => (
113
-                    <View key={index + 'sex3'} 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>
114
-                  ))
135
+                {sexInfo.map((item, index) => (
136
+                  <View key={index + 'sex3'} 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>
137
+                ))
115
                 }
138
                 }
116
               </View>
139
               </View>
117
             </View>
140
             </View>
118
           </AtTabsPane>
141
           </AtTabsPane>
119
-          <AtTabsPane current={this.state.current} index={1}>
142
+          <AtTabsPane current={current} index={1}>
120
             <View>
143
             <View>
121
-              <LineChart />
144
+              <View style="height:'40rpx;position: relative;">
145
+                <View className="daily-month" >
146
+                  {
147
+                    dailyMonth.map((item, index) => (
148
+                      <View className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
149
+                        {item}
150
+                      </View>))
151
+                  }
152
+                </View>
153
+              </View>
154
+              <View style="width:100vw;height:520rpx">
155
+                <LineChart source={chartInfo} />
156
+              </View>
122
               <View style="height:20rpx;background:#f5f5f5;"> </View>
157
               <View style="height:20rpx;background:#f5f5f5;"> </View>
123
               <View style="padding: 40rpx;">
158
               <View style="padding: 40rpx;">
124
                 <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
159
                 <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
125
-                {
126
-                  sexInfo.map((item, index) => (
127
-                    <View key={index + 'sex3'} 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>
128
-                  ))
160
+                {sexInfo.map((item, index) => (
161
+                  <View key={index + 'sex3'} 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>
162
+                ))
129
                 }
163
                 }
130
               </View>
164
               </View>
131
             </View>
165
             </View>
132
           </AtTabsPane>
166
           </AtTabsPane>
133
-          <AtTabsPane current={this.state.current} index={2}>
167
+          <AtTabsPane current={current} index={2}>
134
             <View>
168
             <View>
135
-              <LineChart />
169
+              <View style="height:'40rpx;position: relative;">
170
+                <View className="daily-month" >
171
+                  {
172
+                    dailyMonth.map((item, index) => (
173
+                      <View className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
174
+                        {item}
175
+                      </View>))
176
+                  }
177
+                </View>
178
+              </View>
179
+              <View style="width:100vw;height:520rpx">
180
+                <LineChart source={chartInfo} />
181
+              </View>
136
               <View style="height:20rpx;background:#f5f5f5;"> </View>
182
               <View style="height:20rpx;background:#f5f5f5;"> </View>
137
               <View style="padding: 40rpx;">
183
               <View style="padding: 40rpx;">
138
                 <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
184
                 <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
139
-                {
140
-                  sexInfo.map((item, index) => (
141
-                    <View key={index + 'sex3'} 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>
142
-                  ))
185
+                {sexInfo.map((item, index) => (
186
+                  <View key={index + 'sex3'} 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>
187
+                ))
143
                 }
188
                 }
144
               </View>
189
               </View>
145
             </View>
190
             </View>

+ 4
- 0
src/pages/person/customerAnalysis/index.scss Wyświetl plik

10
   align-items: center;
10
   align-items: center;
11
   text-align: right;
11
   text-align: right;
12
   padding: 0 25px;
12
   padding: 0 25px;
13
+  position: absolute;
14
+  right: 0;
13
   .item{
15
   .item{
14
     width:76px;
16
     width:76px;
15
     height:40px;
17
     height:40px;
20
     font-size: 28px;
22
     font-size: 28px;
21
     text-align: center;
23
     text-align: center;
22
     margin: 0 15px;
24
     margin: 0 15px;
25
+
23
   }
26
   }
24
   .checked{
27
   .checked{
25
     width:76px;
28
     width:76px;
31
     font-size: 28px;
34
     font-size: 28px;
32
     margin: 0 15px;
35
     margin: 0 15px;
33
     text-align: center;
36
     text-align: center;
37
+  
34
   }
38
   }
35
 }
39
 }
36
 .tab-box{
40
 .tab-box{

+ 6
- 6
src/pages/person/menus.js Wyświetl plik

45
       url: '/pages/person/customerAnalysis/index',
45
       url: '/pages/person/customerAnalysis/index',
46
       icon: icons.homepage,
46
       icon: icons.homepage,
47
       extends: undefined,
47
       extends: undefined,
48
-      userTypes: [ CONSULTANT],
48
+      userTypes: [CONSULTANT, CUSTOMER],
49
       style: '',
49
       style: '',
50
     },
50
     },
51
     // {
51
     // {
60
       url: '/pages/agent/client/index',
60
       url: '/pages/agent/client/index',
61
       icon: icons.recommend,
61
       icon: icons.recommend,
62
       extends: undefined,
62
       extends: undefined,
63
-      userTypes: [CUSTOMER,ESTATE_AGENT, CHANNEL_AGENT],
63
+      userTypes: [CUSTOMER, ESTATE_AGENT, CHANNEL_AGENT],
64
       style: '',
64
       style: '',
65
     },
65
     },
66
     // {
66
     // {
151
       url: '/pages/agent/become/index',
151
       url: '/pages/agent/become/index',
152
       icon: icons.development,
152
       icon: icons.development,
153
       extends: undefined,
153
       extends: undefined,
154
-      userTypes: [CUSTOMER,ESTATE_AGENT],
155
-      style: {color:'#888888'},
154
+      userTypes: [CUSTOMER, ESTATE_AGENT],
155
+      style: { color: '#888888' },
156
     },
156
     },
157
     {
157
     {
158
       name: '成为置业顾问',
158
       name: '成为置业顾问',
159
       url: '',
159
       url: '',
160
       icon: icons.consultant,
160
       icon: icons.consultant,
161
       extends: undefined,
161
       extends: undefined,
162
-      style: {color:'#888888'},
163
-      userTypes: [CUSTOMER,ESTATE_AGENT],
162
+      style: { color: '#888888' },
163
+      userTypes: [CUSTOMER, ESTATE_AGENT],
164
     },
164
     },
165
 
165
 
166
   ]
166
   ]