|
@@ -79,67 +79,112 @@ export default class analysis extends Taro.Component {
|
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
|
108
|
render() {
|
84
|
109
|
|
85
|
110
|
const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
|
86
|
111
|
const dailyMonth = ['日', '月']
|
87
|
|
- const { sexInfo, chartInfo, checkedWhich } = this.state
|
|
112
|
+ const { sexInfo, chartInfo, checkedWhich, current } = this.state
|
88
|
113
|
|
89
|
114
|
return (
|
90
|
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
|
118
|
<View>
|
94
|
|
- <View style="width:90vw;height:600rpx">
|
|
119
|
+ <View style="height:'40rpx;position: relative;">
|
95
|
120
|
<View className="daily-month" >
|
96
|
121
|
{
|
97
|
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
|
124
|
{item}
|
100
|
|
- </View>
|
101
|
|
- ))
|
|
125
|
+ </View>))
|
102
|
126
|
}
|
103
|
|
-
|
104
|
127
|
</View>
|
|
128
|
+ </View>
|
|
129
|
+ <View style="width:100vw;height:530rpx">
|
105
|
130
|
<LineChart source={chartInfo} />
|
106
|
131
|
</View>
|
107
|
|
-
|
108
|
132
|
<View style="height:20rpx;background:#f5f5f5;"> </View>
|
109
|
133
|
<View style="padding: 40rpx;">
|
110
|
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
|
139
|
</View>
|
117
|
140
|
</View>
|
118
|
141
|
</AtTabsPane>
|
119
|
|
- <AtTabsPane current={this.state.current} index={1}>
|
|
142
|
+ <AtTabsPane current={current} index={1}>
|
120
|
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
|
157
|
<View style="height:20rpx;background:#f5f5f5;"> </View>
|
123
|
158
|
<View style="padding: 40rpx;">
|
124
|
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
|
164
|
</View>
|
131
|
165
|
</View>
|
132
|
166
|
</AtTabsPane>
|
133
|
|
- <AtTabsPane current={this.state.current} index={2}>
|
|
167
|
+ <AtTabsPane current={current} index={2}>
|
134
|
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
|
182
|
<View style="height:20rpx;background:#f5f5f5;"> </View>
|
137
|
183
|
<View style="padding: 40rpx;">
|
138
|
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
|
189
|
</View>
|
145
|
190
|
</View>
|