周立森 5 年 前
コミット
c0a5faffe0
共有22 個のファイルを変更した64 個の追加28 個の削除を含む
  1. バイナリ
      src/assets/bianji.png
  2. バイナリ
      src/assets/cards/bg.jpg
  3. バイナリ
      src/assets/didian.png
  4. バイナリ
      src/assets/group_10@2x.png
  5. バイナリ
      src/assets/group_9@2x.png
  6. バイナリ
      src/assets/huodong.png
  7. バイナリ
      src/assets/img3.jpg
  8. バイナリ
      src/assets/jianli.png
  9. バイナリ
      src/assets/jisuanqi.png
  10. バイナリ
      src/assets/kapian.png
  11. バイナリ
      src/assets/loupan.png
  12. バイナリ
      src/assets/poster-bg.jpg
  13. バイナリ
      src/assets/shoucang.png
  14. バイナリ
      src/assets/shouye.png
  15. バイナリ
      src/assets/tui.png
  16. バイナリ
      src/assets/yijian.png
  17. バイナリ
      src/assets/yonghu.png
  18. 3
    3
      src/components/charts/Line.js
  19. 1
    1
      src/components/charts/style.scss
  20. 60
    22
      src/pages/person/customerAnalysis/analysis.js
  21. 0
    1
      src/pages/person/profile/detail/index.js
  22. 0
    1
      src/pages/signin/index.js

バイナリ
src/assets/bianji.png ファイルの表示


バイナリ
src/assets/cards/bg.jpg ファイルの表示


バイナリ
src/assets/didian.png ファイルの表示


バイナリ
src/assets/group_10@2x.png ファイルの表示


バイナリ
src/assets/group_9@2x.png ファイルの表示


バイナリ
src/assets/huodong.png ファイルの表示


バイナリ
src/assets/img3.jpg ファイルの表示


バイナリ
src/assets/jianli.png ファイルの表示


バイナリ
src/assets/jisuanqi.png ファイルの表示


バイナリ
src/assets/kapian.png ファイルの表示


バイナリ
src/assets/loupan.png ファイルの表示


バイナリ
src/assets/poster-bg.jpg ファイルの表示


バイナリ
src/assets/shoucang.png ファイルの表示


バイナリ
src/assets/shouye.png ファイルの表示


バイナリ
src/assets/tui.png ファイルの表示


バイナリ
src/assets/yijian.png ファイルの表示


バイナリ
src/assets/yonghu.png ファイルの表示


+ 3
- 3
src/components/charts/Line.js ファイルの表示

@@ -35,9 +35,9 @@ export default class LineChart extends Component {
35 35
 
36 36
   // 禁止 props 变更时渲染
37 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 42
     return false
43 43
   }

+ 1
- 1
src/components/charts/style.scss ファイルの表示

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

+ 60
- 22
src/pages/person/customerAnalysis/analysis.js ファイルの表示

@@ -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;">

+ 0
- 1
src/pages/person/profile/detail/index.js ファイルの表示

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

+ 0
- 1
src/pages/signin/index.js ファイルの表示

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