周立森 5 years ago
parent
commit
c0a5faffe0

BIN
src/assets/bianji.png View File


BIN
src/assets/cards/bg.jpg View File


BIN
src/assets/didian.png View File


BIN
src/assets/group_10@2x.png View File


BIN
src/assets/group_9@2x.png View File


BIN
src/assets/huodong.png View File


BIN
src/assets/img3.jpg View File


BIN
src/assets/jianli.png View File


BIN
src/assets/jisuanqi.png View File


BIN
src/assets/kapian.png View File


BIN
src/assets/loupan.png View File


BIN
src/assets/poster-bg.jpg View File


BIN
src/assets/shoucang.png View File


BIN
src/assets/shouye.png View File


BIN
src/assets/tui.png View File


BIN
src/assets/yijian.png View File


BIN
src/assets/yonghu.png View File


+ 3
- 3
src/components/charts/Line.js View File

35
 
35
 
36
   // 禁止 props 变更时渲染
36
   // 禁止 props 变更时渲染
37
   shouldComponentUpdate(nextProps) {
37
   shouldComponentUpdate(nextProps) {
38
-    if (nextProps.source && nextProps.source.length) {
39
-      this.refreshChart(nextProps.source)
40
-    }
38
+    console.log('--nextProps--->', nextProps)
39
+
40
+    this.refreshChart(nextProps.source)
41
 
41
 
42
     return false
42
     return false
43
   }
43
   }

+ 1
- 1
src/components/charts/style.scss View File

2
   position: absolute;
2
   position: absolute;
3
   top: 80px;
3
   top: 80px;
4
   bottom: 0;
4
   bottom: 0;
5
-  left: 1vw;
5
+  left: 0;
6
   right: 0;
6
   right: 0;
7
   width:100vw;
7
   width:100vw;
8
   height:400px;
8
   height:400px;

+ 60
- 22
src/pages/person/customerAnalysis/analysis.js View File

32
       // { name: '周五', value: '127' },
32
       // { name: '周五', value: '127' },
33
       // { name: '周六', value: '64' },
33
       // { name: '周六', value: '64' },
34
       // { name: '周日', value: '94' },
34
       // { name: '周日', value: '94' },
35
-    ]
35
+    ],
36
+    chartInfo2: [],
37
+    chartInfo3: [],
36
   }
38
   }
37
 
39
 
38
   componentWillUnmount() {
40
   componentWillUnmount() {
41
   }
43
   }
42
 
44
 
43
   handleClick(value) {
45
   handleClick(value) {
46
+    this.setState({
47
+      checkedWhich: 0
48
+    })
44
     if (value == '0') {
49
     if (value == '0') {
45
       querySexInfo('new').then(res => {
50
       querySexInfo('new').then(res => {
46
         this.setState({
51
         this.setState({
60
         })
65
         })
61
       })
66
       })
62
       getEchartDailyInfo('follow').then(res => {
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
         this.setState({
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
     } else {
74
     } else {
68
-      querySexInfo('visite ').then(res => {
75
+      querySexInfo('visite').then(res => {
69
         this.setState({
76
         this.setState({
70
           sexInfo: res || []
77
           sexInfo: res || []
71
         })
78
         })
72
       })
79
       })
73
       getEchartDailyInfo('visite').then(res => {
80
       getEchartDailyInfo('visite').then(res => {
74
         this.setState({
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
   changeDailyMonth(inx) {
105
   changeDailyMonth(inx) {
99
     const { current } = this.state
106
     const { current } = this.state
100
     const params = current == 0 ? 'new' : current == 1 ? 'follow' : 'visite'
107
     const params = current == 0 ? 'new' : current == 1 ? 'follow' : 'visite'
108
+
101
     if (inx == 0) {
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
     } else {
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
     this.setState({
151
     this.setState({
115
       checkedWhich: inx
152
       checkedWhich: inx
116
     })
153
     })
154
+
117
   }
155
   }
118
 
156
 
119
   render() {
157
   render() {
120
 
158
 
121
     const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
159
     const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
122
     const dailyMonth = ['日', '月']
160
     const dailyMonth = ['日', '月']
123
-    const { sexInfo, chartInfo, checkedWhich, current } = this.state
161
+    const { sexInfo, chartInfo, chartInfo2, chartInfo3, checkedWhich, current } = this.state
124
 
162
 
125
     return (
163
     return (
126
       <View>
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
           <AtTabsPane current={current} index={0} >
166
           <AtTabsPane current={current} index={0} >
129
             <View>
167
             <View>
130
-              <View style="height:'40rpx;position: relative;">
168
+              <View style="height:40rpx;position: relative;margin-top:20rpx">
131
                 <View className="daily-month" >
169
                 <View className="daily-month" >
132
                   {
170
                   {
133
                     dailyMonth.map((item, index) => (
171
                     dailyMonth.map((item, index) => (
137
                   }
175
                   }
138
                 </View>
176
                 </View>
139
               </View>
177
               </View>
140
-              <View style="width:100vw;height:530rpx">
178
+              <View style="width:100vw;height:530rpx;position: relative;">
141
                 <LineChart source={chartInfo} />
179
                 <LineChart source={chartInfo} />
142
               </View>
180
               </View>
143
               <View style="height:20rpx;background:#f5f5f5;"> </View>
181
               <View style="height:20rpx;background:#f5f5f5;"> </View>
152
           </AtTabsPane>
190
           </AtTabsPane>
153
           <AtTabsPane current={current} index={1}>
191
           <AtTabsPane current={current} index={1}>
154
             <View>
192
             <View>
155
-              <View style="height:'40rpx;position: relative;">
193
+              <View style="height:40rpx;position: relative;margin-top:20rpx">
156
                 <View className="daily-month" >
194
                 <View className="daily-month" >
157
                   {
195
                   {
158
                     dailyMonth.map((item, index) => (
196
                     dailyMonth.map((item, index) => (
162
                   }
200
                   }
163
                 </View>
201
                 </View>
164
               </View>
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
               </View>
205
               </View>
168
               <View style="height:20rpx;background:#f5f5f5;"> </View>
206
               <View style="height:20rpx;background:#f5f5f5;"> </View>
169
               <View style="padding: 40rpx;">
207
               <View style="padding: 40rpx;">
177
           </AtTabsPane>
215
           </AtTabsPane>
178
           <AtTabsPane current={current} index={2}>
216
           <AtTabsPane current={current} index={2}>
179
             <View>
217
             <View>
180
-              <View style="height:'40rpx;position: relative;">
218
+              <View style="height:40rpx;position: relative;margin-top:20rpx">
181
                 <View className="daily-month" >
219
                 <View className="daily-month" >
182
                   {
220
                   {
183
                     dailyMonth.map((item, index) => (
221
                     dailyMonth.map((item, index) => (
187
                   }
225
                   }
188
                 </View>
226
                 </View>
189
               </View>
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
               </View>
230
               </View>
193
               <View style="height:20rpx;background:#f5f5f5;"> </View>
231
               <View style="height:20rpx;background:#f5f5f5;"> </View>
194
               <View style="padding: 40rpx;">
232
               <View style="padding: 40rpx;">

+ 0
- 1
src/pages/person/profile/detail/index.js View File

10
 import "taro-ui/dist/style/components/image-picker.scss";
10
 import "taro-ui/dist/style/components/image-picker.scss";
11
 import "taro-ui/dist/style/components/icon.scss";
11
 import "taro-ui/dist/style/components/icon.scss";
12
 const add = require('@assets/add.png')
12
 const add = require('@assets/add.png')
13
-
14
 const closeImg = require('@assets/close.png')
13
 const closeImg = require('@assets/close.png')
15
 
14
 
16
 // import { connect } from '@tarojs/redux'
15
 // import { connect } from '@tarojs/redux'

+ 0
- 1
src/pages/signin/index.js View File

72
 
72
 
73
     return (
73
     return (
74
       <View className="page">
74
       <View className="page">
75
-        {/* <Image className="bg" mode="aspectFit" src={require('@assets/poster-bg.jpg')}></Image> */}
76
         {
75
         {
77
           (isSigned) ? (
76
           (isSigned) ? (
78
             <Button type="primary" className="btn">{nickname},您已签到成功</Button>
77
             <Button type="primary" className="btn">{nickname},您已签到成功</Button>