|
@@ -32,7 +32,9 @@ export default class analysis extends Taro.Component {
|
32
|
32
|
// { name: '周五', value: '127' },
|
33
|
33
|
// { name: '周六', value: '64' },
|
34
|
34
|
// { name: '周日', value: '94' },
|
35
|
|
- ]
|
|
35
|
+ ],
|
|
36
|
+ chartInfo2: [],
|
|
37
|
+ chartInfo3: [],
|
36
|
38
|
}
|
37
|
39
|
|
38
|
40
|
componentWillUnmount() {
|
|
@@ -41,6 +43,9 @@ export default class analysis extends Taro.Component {
|
41
|
43
|
}
|
42
|
44
|
|
43
|
45
|
handleClick(value) {
|
|
46
|
+ this.setState({
|
|
47
|
+ checkedWhich: 0
|
|
48
|
+ })
|
44
|
49
|
if (value == '0') {
|
45
|
50
|
querySexInfo('new').then(res => {
|
46
|
51
|
this.setState({
|
|
@@ -60,19 +65,21 @@ export default class analysis extends Taro.Component {
|
60
|
65
|
})
|
61
|
66
|
})
|
62
|
67
|
getEchartDailyInfo('follow').then(res => {
|
|
68
|
+
|
|
69
|
+ console.log(res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum })), "5555*-----------------555555")
|
63
|
70
|
this.setState({
|
64
|
|
- chartInfo: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum }))
|
|
71
|
+ chartInfo2: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum }))
|
65
|
72
|
})
|
66
|
73
|
})
|
67
|
74
|
} else {
|
68
|
|
- querySexInfo('visite ').then(res => {
|
|
75
|
+ querySexInfo('visite').then(res => {
|
69
|
76
|
this.setState({
|
70
|
77
|
sexInfo: res || []
|
71
|
78
|
})
|
72
|
79
|
})
|
73
|
80
|
getEchartDailyInfo('visite').then(res => {
|
74
|
81
|
this.setState({
|
75
|
|
- chartInfo: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum }))
|
|
82
|
+ chartInfo3: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum }))
|
76
|
83
|
})
|
77
|
84
|
})
|
78
|
85
|
}
|
|
@@ -98,36 +105,67 @@ export default class analysis extends Taro.Component {
|
98
|
105
|
changeDailyMonth(inx) {
|
99
|
106
|
const { current } = this.state
|
100
|
107
|
const params = current == 0 ? 'new' : current == 1 ? 'follow' : 'visite'
|
|
108
|
+
|
101
|
109
|
if (inx == 0) {
|
102
|
|
- getEchartDailyInfo(params).then(res => {
|
103
|
|
- this.setState({
|
104
|
|
- chartInfo: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum }))
|
|
110
|
+ if (params == 'new') {
|
|
111
|
+ getEchartDailyInfo(params).then(res => {
|
|
112
|
+ this.setState({
|
|
113
|
+ chartInfo: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum })) || []
|
|
114
|
+ })
|
105
|
115
|
})
|
106
|
|
- })
|
|
116
|
+ } else if (params == 'follow') {
|
|
117
|
+ getEchartDailyInfo(params).then(res => {
|
|
118
|
+ this.setState({
|
|
119
|
+ chartInfo2: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum })) || []
|
|
120
|
+ })
|
|
121
|
+ })
|
|
122
|
+ } else {
|
|
123
|
+ getEchartDailyInfo(params).then(res => {
|
|
124
|
+ this.setState({
|
|
125
|
+ chartInfo3: res.map(x => ({ name: `${dayjs(x.day).format('MM月DD日')}`, value: x.customerNum })) || []
|
|
126
|
+ })
|
|
127
|
+ })
|
|
128
|
+ }
|
107
|
129
|
} else {
|
108
|
|
- getEchartMonthInfo(params).then(res => {
|
109
|
|
- this.setState({
|
110
|
|
- chartInfo: res.map(x => ({ name: `${x.month.substr(4)}月`, value: x.customerNum }))
|
|
130
|
+ if (params == 'new') {
|
|
131
|
+ getEchartMonthInfo(params).then(res => {
|
|
132
|
+ this.setState({
|
|
133
|
+ chartInfo: res.map(x => ({ name: `${x.month.substr(4)}月`, value: x.customerNum })) || []
|
|
134
|
+ })
|
111
|
135
|
})
|
112
|
|
- })
|
|
136
|
+ } else if (params == 'follow') {
|
|
137
|
+ getEchartMonthInfo(params).then(res => {
|
|
138
|
+ this.setState({
|
|
139
|
+ chartInfo2: res.map(x => ({ name: `${x.month.substr(4)}月`, value: x.customerNum })) || []
|
|
140
|
+ })
|
|
141
|
+ })
|
|
142
|
+ } else {
|
|
143
|
+ getEchartMonthInfo(params).then(res => {
|
|
144
|
+
|
|
145
|
+ this.setState({
|
|
146
|
+ chartInfo3: res.map(x => ({ name: `${x.month.substr(4)}月`, value: x.customerNum })) || []
|
|
147
|
+ })
|
|
148
|
+ })
|
|
149
|
+ }
|
113
|
150
|
}
|
114
|
151
|
this.setState({
|
115
|
152
|
checkedWhich: inx
|
116
|
153
|
})
|
|
154
|
+
|
117
|
155
|
}
|
118
|
156
|
|
119
|
157
|
render() {
|
120
|
158
|
|
121
|
159
|
const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
|
122
|
160
|
const dailyMonth = ['日', '月']
|
123
|
|
- const { sexInfo, chartInfo, checkedWhich, current } = this.state
|
|
161
|
+ const { sexInfo, chartInfo, chartInfo2, chartInfo3, checkedWhich, current } = this.state
|
124
|
162
|
|
125
|
163
|
return (
|
126
|
164
|
<View>
|
127
|
|
- <AtTabs className="tab-bar" current={current} tabList={tabList} onClick={this.handleClick.bind(this)}>
|
|
165
|
+ <AtTabs className="tab-bar" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable="false">
|
128
|
166
|
<AtTabsPane current={current} index={0} >
|
129
|
167
|
<View>
|
130
|
|
- <View style="height:'40rpx;position: relative;">
|
|
168
|
+ <View style="height:40rpx;position: relative;margin-top:20rpx">
|
131
|
169
|
<View className="daily-month" >
|
132
|
170
|
{
|
133
|
171
|
dailyMonth.map((item, index) => (
|
|
@@ -137,7 +175,7 @@ export default class analysis extends Taro.Component {
|
137
|
175
|
}
|
138
|
176
|
</View>
|
139
|
177
|
</View>
|
140
|
|
- <View style="width:100vw;height:530rpx">
|
|
178
|
+ <View style="width:100vw;height:530rpx;position: relative;">
|
141
|
179
|
<LineChart source={chartInfo} />
|
142
|
180
|
</View>
|
143
|
181
|
<View style="height:20rpx;background:#f5f5f5;"> </View>
|
|
@@ -152,7 +190,7 @@ export default class analysis extends Taro.Component {
|
152
|
190
|
</AtTabsPane>
|
153
|
191
|
<AtTabsPane current={current} index={1}>
|
154
|
192
|
<View>
|
155
|
|
- <View style="height:'40rpx;position: relative;">
|
|
193
|
+ <View style="height:40rpx;position: relative;margin-top:20rpx">
|
156
|
194
|
<View className="daily-month" >
|
157
|
195
|
{
|
158
|
196
|
dailyMonth.map((item, index) => (
|
|
@@ -162,8 +200,8 @@ export default class analysis extends Taro.Component {
|
162
|
200
|
}
|
163
|
201
|
</View>
|
164
|
202
|
</View>
|
165
|
|
- <View style="width:100vw;height:520rpx">
|
166
|
|
- <LineChart source={chartInfo} />
|
|
203
|
+ <View style="width:100vw;height:530rpx;position: relative;">
|
|
204
|
+ <LineChart source={chartInfo2} />
|
167
|
205
|
</View>
|
168
|
206
|
<View style="height:20rpx;background:#f5f5f5;"> </View>
|
169
|
207
|
<View style="padding: 40rpx;">
|
|
@@ -177,7 +215,7 @@ export default class analysis extends Taro.Component {
|
177
|
215
|
</AtTabsPane>
|
178
|
216
|
<AtTabsPane current={current} index={2}>
|
179
|
217
|
<View>
|
180
|
|
- <View style="height:'40rpx;position: relative;">
|
|
218
|
+ <View style="height:40rpx;position: relative;margin-top:20rpx">
|
181
|
219
|
<View className="daily-month" >
|
182
|
220
|
{
|
183
|
221
|
dailyMonth.map((item, index) => (
|
|
@@ -187,8 +225,8 @@ export default class analysis extends Taro.Component {
|
187
|
225
|
}
|
188
|
226
|
</View>
|
189
|
227
|
</View>
|
190
|
|
- <View style="width:100vw;height:520rpx">
|
191
|
|
- <LineChart source={chartInfo} />
|
|
228
|
+ <View style="width:100vw;height:530rpx;position: relative;">
|
|
229
|
+ <LineChart source={chartInfo3} />
|
192
|
230
|
</View>
|
193
|
231
|
<View style="height:20rpx;background:#f5f5f5;"> </View>
|
194
|
232
|
<View style="padding: 40rpx;">
|