许静 5 gadus atpakaļ
vecāks
revīzija
f0f256bb0b

+ 4
- 4
config/dev.js Parādīt failu

@@ -5,12 +5,12 @@ module.exports = {
5 5
   defineConstants: {
6 6
     // HOST: '"http://47.101.36.130:8085"',//测试
7 7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    // HOST:  '"https://dev.jinchengjiaye.com"',//测试
9
-    // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
8
+    HOST:  '"https://dev.jinchengjiaye.com"',//测试
9
+    WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    HOST: '"http://192.168.0.84:8080"',
13
-    WSS_HOST: '"ws://192.168.0.84:8080"',
12
+    // HOST: '"http://192.168.0.84:8080"',
13
+    // WSS_HOST: '"ws://192.168.0.84:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 3
- 0
src/app.js Parādīt failu

@@ -41,10 +41,13 @@ class App extends Component {
41 41
     },
42 42
     pages: [
43 43
       'pages/project/index',
44
+      'pages/person/customerAnalysis/followUpCustomer/index',
45
+      'pages/person/customerAnalysis/transactionCustomer/index',
44 46
       'pages/shop/index',
45 47
       'pages/activity/activity',
46 48
       'pages/activity/myActivity',
47 49
       'pages/person/index',
50
+      'pages/person/customerAnalysis/index',
48 51
       'pages/person/profile/index',
49 52
       'pages/person/profile/detail/index',
50 53
       'pages/project/detail/index',

Binārs
src/assets/person/chengjiao.png Parādīt failu


Binārs
src/assets/person/genjin.png Parādīt failu


Binārs
src/assets/person/icon.png Parādīt failu


Binārs
src/assets/person/screen.png Parādīt failu


+ 166
- 0
src/components/AddChart.js Parādīt failu

@@ -0,0 +1,166 @@
1
+import Taro, { Component } from "@tarojs/taro";
2
+import * as echarts from "./ec-canvas/echarts";
3
+function setChartData(chart, data) {
4
+  let option = {
5
+    tooltip: {
6
+      trigger: "axis",
7
+      axisPointer: {
8
+        type: "shadow",
9
+        textStyle: {
10
+          color: "#fff"
11
+        }
12
+      },
13
+    },
14
+    grid: {
15
+        "borderWidth": 0,
16
+        "top": 110,
17
+        "bottom": 95,
18
+        textStyle: {
19
+            color: "#fff"
20
+        }
21
+    },
22
+    dataZoom: [
23
+      {
24
+        type: 'slider',
25
+        start: 0,
26
+        show: false,
27
+        end: 60,
28
+      },
29
+      {
30
+        type: 'inside',
31
+        start: 0,
32
+        end: 60,
33
+        filterMode: 'filter',
34
+      },
35
+    ],
36
+    xAxis: [{
37
+        type: "category",
38
+        axisLine: {
39
+          lineStyle: {
40
+            color: '#90979c'
41
+          }
42
+        },
43
+        splitLine: {
44
+          show: false
45
+        },
46
+        axisTick: {
47
+          show: false
48
+        },
49
+        splitArea: {
50
+          show: false
51
+        },
52
+        axisLabel: {
53
+          interval: 0,
54
+        },
55
+        data: [1,2,3,4,5,6,7,8,9,10,11,12],
56
+    }],
57
+    yAxis: [{
58
+      type: "value",
59
+      splitLine: {
60
+        show: false
61
+      },
62
+      axisLine: {
63
+        lineStyle: {
64
+          color: '#90979c'
65
+        }
66
+      },
67
+      axisTick: {
68
+          show: false
69
+      },
70
+      axisLabel: {
71
+          interval: 0,
72
+      },
73
+      splitArea: {
74
+          show: false
75
+      },
76
+    }],
77
+    series: [
78
+      {
79
+        name: "女",
80
+        type: "bar",
81
+        stack: "总量",
82
+        barWidth: 10,
83
+        label: {
84
+          normal: {
85
+            show: false,
86
+            position: 'top',
87
+            color: '#000'
88
+          }
89
+        },
90
+        itemStyle: {
91
+          normal: {
92
+            barBorderRadius: 20,
93
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
94
+              offset: 0,
95
+              color: '#00cefc'
96
+            }, {
97
+              offset: 1,
98
+              color: '#00cefc'
99
+            }]),
100
+          }
101
+        },
102
+        data: data.barData,
103
+      },
104
+      {
105
+        name: "男",
106
+        type: "line",
107
+        stack: "总量",
108
+        symbolSize: 10,
109
+        symbol:'circle',
110
+        itemStyle: {
111
+          normal: {
112
+            color: "green",
113
+            barBorderRadius: 0,
114
+            label: {
115
+              show: false,
116
+              position: "bottom",
117
+            }
118
+          }
119
+        },
120
+        data: data.lineData
121
+      },
122
+    ]
123
+  }
124
+  chart.setOption(option);
125
+}
126
+
127
+export default class AddChart extends Component {
128
+  config = {
129
+    usingComponents: {
130
+      "ec-canvas": "./ec-canvas/ec-canvas"
131
+    }
132
+  };
133
+
134
+  constructor(props) {
135
+    super(props);
136
+  }
137
+
138
+  state = {
139
+    ec: {
140
+      lazyLoad: true
141
+    }
142
+  };
143
+
144
+  refresh(data) {
145
+    this.Chart.init((canvas, width, height) => {
146
+      const chart = echarts.init(canvas, null, {
147
+        width: width,
148
+        height: height
149
+      });
150
+      setChartData(chart, data);
151
+      return chart;
152
+    });
153
+  }
154
+
155
+  refChart = node => (this.Chart = node);
156
+
157
+  render() {
158
+    return (
159
+      <ec-canvas
160
+        ref={this.refChart}
161
+        canvas-id="mychart-area"
162
+        ec={this.state.ec}
163
+      />
164
+    );
165
+  }
166
+}

+ 74
- 0
src/components/LineChart.js Parādīt failu

@@ -0,0 +1,74 @@
1
+import Taro, { Component } from "@tarojs/taro";
2
+import * as echarts from "./ec-canvas/echarts";
3
+
4
+function setChartData(chart, data) {
5
+  let option = {
6
+    color: ['#3398DB'],
7
+    xAxis : [
8
+      {
9
+        type: 'category',
10
+        data: [],
11
+        axisTick: {
12
+          alignWithLabel: true
13
+        }
14
+      }
15
+    ],
16
+    yAxis : [
17
+      {
18
+        type : 'value'
19
+      }
20
+    ],
21
+    series : []
22
+  };
23
+  if (data && data.dimensions && data.measures) {
24
+    option.xAxis[0].data = data.dimensions.data
25
+    option.series = data.measures.map(item => {
26
+      return {
27
+        ...item,
28
+        type:'line',
29
+      }
30
+    })
31
+  }
32
+  chart.setOption(option);
33
+}
34
+
35
+export default class LineChart extends Component {
36
+  config = {
37
+    usingComponents: {
38
+      "ec-canvas": "./ec-canvas/ec-canvas"
39
+    }
40
+  };
41
+
42
+  constructor(props) {
43
+    super(props);
44
+  }
45
+
46
+  state = {
47
+    ec: {
48
+      lazyLoad: true
49
+    }
50
+  };
51
+
52
+  refresh(data) {
53
+    this.Chart.init((canvas, width, height) => {
54
+      const chart = echarts.init(canvas, null, {
55
+        width: width,
56
+        height: height
57
+      });
58
+      setChartData(chart, data);
59
+      return chart;
60
+    });
61
+  }
62
+
63
+  refChart = node => (this.Chart = node);
64
+
65
+  render() {
66
+    return (
67
+      <ec-canvas
68
+        ref={this.refChart}
69
+        canvas-id="mychart-area"
70
+        ec={this.state.ec}
71
+      />
72
+    );
73
+  }
74
+}

+ 90
- 0
src/components/MoveChart.js Parādīt failu

@@ -0,0 +1,90 @@
1
+import Taro, { Component } from "@tarojs/taro";
2
+import * as echarts from "./ec-canvas/echarts";
3
+
4
+function setChartData(chart, data) {
5
+  let option = {
6
+    tooltip: {
7
+    },
8
+    color: ['#3398DB'],
9
+    xAxis : [
10
+      {
11
+        type: 'category',
12
+        data: [],
13
+        axisTick: {
14
+          alignWithLabel: true
15
+        }
16
+      }
17
+    ],
18
+    dataZoom: [
19
+      {
20
+        type: 'slider',
21
+        start: 0,
22
+        show: false,
23
+        end: 50,
24
+      },
25
+      {
26
+        type: 'inside',
27
+        start: 0,
28
+        end: 50,
29
+        filterMode: 'filter',
30
+      },
31
+    ],
32
+    yAxis : [
33
+      {
34
+        type : 'value'
35
+      }
36
+    ],
37
+    series : []
38
+  };
39
+  if (data && data.dimensions && data.measures) {
40
+    option.xAxis[0].data = data.dimensions.data
41
+    option.series = data.measures.map(item => {
42
+      return {
43
+        ...item,
44
+        type:'bar',
45
+      }
46
+    })
47
+  }
48
+  chart.setOption(option);
49
+}
50
+
51
+export default class MoveChart extends Component {
52
+  config = {
53
+    usingComponents: {
54
+      "ec-canvas": "./ec-canvas/ec-canvas"
55
+    }
56
+  };
57
+
58
+  constructor(props) {
59
+    super(props);
60
+  }
61
+
62
+  state = {
63
+    ec: {
64
+      lazyLoad: true
65
+    }
66
+  };
67
+
68
+  refresh(data) {
69
+    this.Chart.init((canvas, width, height) => {
70
+      const chart = echarts.init(canvas, null, {
71
+        width: width,
72
+        height: height
73
+      });
74
+      setChartData(chart, data);
75
+      return chart;
76
+    });
77
+  }
78
+
79
+  refChart = node => (this.Chart = node);
80
+
81
+  render() {
82
+    return (
83
+      <ec-canvas
84
+        ref={this.refChart}
85
+        canvas-id="mychart-area"
86
+        ec={this.state.ec}
87
+      />
88
+    );
89
+  }
90
+}

+ 132
- 0
src/components/ec-canvas/ec-canvas.js Parādīt failu

@@ -0,0 +1,132 @@
1
+import WxCanvas from './wx-canvas';
2
+import * as echarts from './echarts';
3
+
4
+let ctx;
5
+
6
+Component({
7
+  properties: {
8
+    canvasId: {
9
+      type: String,
10
+      value: 'ec-canvas'
11
+    },
12
+
13
+    ec: {
14
+      type: Object
15
+    }
16
+  },
17
+
18
+  data: {
19
+
20
+  },
21
+
22
+  ready: function () {
23
+    if (!this.data.ec) {
24
+      console.warn('组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" '
25
+        + 'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>');
26
+      return;
27
+    }
28
+
29
+    if (!this.data.ec.lazyLoad) {
30
+      this.init();
31
+    }
32
+  },
33
+
34
+  methods: {
35
+    init: function (callback) {
36
+      const version = wx.version.version.split('.').map(n => parseInt(n, 10));
37
+      const isValid = version[0] > 1 || (version[0] === 1 && version[1] > 9)
38
+        || (version[0] === 1 && version[1] === 9 && version[2] >= 91);
39
+      if (!isValid) {
40
+        console.error('微信基础库版本过低,需大于等于 1.9.91。'
41
+          + '参见:https://github.com/ecomfe/echarts-for-weixin'
42
+          + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82');
43
+        return;
44
+      }
45
+
46
+      ctx = wx.createCanvasContext(this.data.canvasId, this);
47
+
48
+      const canvas = new WxCanvas(ctx, this.data.canvasId);
49
+
50
+      echarts.setCanvasCreator(() => {
51
+        return canvas;
52
+      });
53
+
54
+      var query = wx.createSelectorQuery().in(this);
55
+      query.select('.ec-canvas').boundingClientRect(res => {
56
+        if (typeof callback === 'function') {
57
+          this.chart = callback(canvas, res.width, res.height);
58
+        }
59
+        else if (this.data.ec && typeof this.data.ec.onInit === 'function') {
60
+          this.chart = this.data.ec.onInit(canvas, res.width, res.height);
61
+        }
62
+        else {
63
+          this.triggerEvent('init', {
64
+            canvas: canvas,
65
+            width: res.width,
66
+            height: res.height
67
+          });
68
+        }
69
+      }).exec();
70
+    },
71
+
72
+    canvasToTempFilePath(opt) {
73
+      if (!opt.canvasId) {
74
+        opt.canvasId = this.data.canvasId;
75
+      }
76
+
77
+      ctx.draw(true, () => {
78
+        wx.canvasToTempFilePath(opt, this);
79
+      });
80
+    },
81
+
82
+    touchStart(e) {
83
+      if (this.chart && e.touches.length > 0) {
84
+        var touch = e.touches[0];
85
+        this.chart._zr.handler.dispatch('mousedown', {
86
+          zrX: touch.x,
87
+          zrY: touch.y
88
+        });
89
+        this.chart._zr.handler.dispatch('mousemove', {
90
+          zrX: touch.x,
91
+          zrY: touch.y
92
+        });
93
+        this.chart._zr.handler.proxy.processGesture(wrapTouch(e), 'start');
94
+      }
95
+    },
96
+
97
+    touchMove(e) {
98
+      if (this.chart && e.touches.length > 0) {
99
+        var touch = e.touches[0];
100
+        this.chart._zr.handler.dispatch('mousemove', {
101
+          zrX: touch.x,
102
+          zrY: touch.y
103
+        });
104
+        this.chart._zr.handler.proxy.processGesture(wrapTouch(e), 'change');
105
+      }
106
+    },
107
+
108
+    touchEnd(e) {
109
+      if (this.chart) {
110
+        const touch = e.changedTouches ? e.changedTouches[0] : {};
111
+        this.chart._zr.handler.dispatch('mouseup', {
112
+          zrX: touch.x,
113
+          zrY: touch.y
114
+        });
115
+        this.chart._zr.handler.dispatch('click', {
116
+          zrX: touch.x,
117
+          zrY: touch.y
118
+        });
119
+        this.chart._zr.handler.proxy.processGesture(wrapTouch(e), 'end');
120
+      }
121
+    }
122
+  }
123
+});
124
+
125
+function wrapTouch(event) {
126
+  for (let i = 0; i < event.touches.length; ++i) {
127
+    const touch = event.touches[i];
128
+    touch.offsetX = touch.x;
129
+    touch.offsetY = touch.y;
130
+  }
131
+  return event;
132
+}

+ 4
- 0
src/components/ec-canvas/ec-canvas.json Parādīt failu

@@ -0,0 +1,4 @@
1
+{
2
+  "component": true,
3
+  "usingComponents": {}
4
+}

+ 4
- 0
src/components/ec-canvas/ec-canvas.wxml Parādīt failu

@@ -0,0 +1,4 @@
1
+<canvas class="ec-canvas" canvas-id="{{ canvasId }}"
2
+bindinit="init"
3
+bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}">
4
+</canvas>

+ 4
- 0
src/components/ec-canvas/ec-canvas.wxss Parādīt failu

@@ -0,0 +1,4 @@
1
+.ec-canvas {
2
+  width: 100%;
3
+  height: 100%;
4
+}

+ 22
- 0
src/components/ec-canvas/echarts.js
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 97
- 0
src/components/ec-canvas/wx-canvas.js Parādīt failu

@@ -0,0 +1,97 @@
1
+export default class WxCanvas {
2
+  constructor(ctx, canvasId) {
3
+    this.ctx = ctx;
4
+    this.canvasId = canvasId;
5
+    this.chart = null;
6
+
7
+    // this._initCanvas(zrender, ctx);
8
+    this._initStyle(ctx);
9
+    this._initEvent();
10
+  }
11
+
12
+  getContext(contextType) {
13
+    if (contextType === '2d') {
14
+      return this.ctx;
15
+    }
16
+  }
17
+
18
+  // canvasToTempFilePath(opt) {
19
+  //   if (!opt.canvasId) {
20
+  //     opt.canvasId = this.canvasId;
21
+  //   }
22
+
23
+  //   return wx.canvasToTempFilePath(opt, this);
24
+  // }
25
+
26
+  setChart(chart) {
27
+    this.chart = chart;
28
+  }
29
+
30
+  attachEvent () {
31
+    // noop
32
+  }
33
+
34
+  detachEvent() {
35
+    // noop
36
+  }
37
+
38
+  _initCanvas(zrender, ctx) {
39
+    zrender.util.getContext = function () {
40
+      return ctx;
41
+    };
42
+
43
+    zrender.util.$override('measureText', function (text, font) {
44
+      ctx.font = font || '12px sans-serif';
45
+      return ctx.measureText(text);
46
+    });
47
+  }
48
+
49
+  _initStyle(ctx) {
50
+    var styles = ['fillStyle', 'strokeStyle', 'globalAlpha', 
51
+      'textAlign', 'textBaseAlign', 'shadow', 'lineWidth',
52
+      'lineCap', 'lineJoin', 'lineDash', 'miterLimit', 'fontSize'];
53
+
54
+    styles.forEach(style => {
55
+      Object.defineProperty(ctx, style, {
56
+        set: value => {
57
+          if (style !== 'fillStyle' && style !== 'strokeStyle' 
58
+            || value !== 'none' && value !== null
59
+          ) {
60
+            ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value);
61
+          }
62
+        }
63
+      });
64
+    });
65
+
66
+    ctx.createRadialGradient = () => {
67
+      return ctx.createCircularGradient(arguments);
68
+    };
69
+  }
70
+
71
+  _initEvent() {
72
+    this.event = {};
73
+    const eventNames = [{
74
+      wxName: 'touchStart',
75
+      ecName: 'mousedown'
76
+    }, {
77
+      wxName: 'touchMove',
78
+      ecName: 'mousemove'
79
+    }, {
80
+      wxName: 'touchEnd',
81
+      ecName: 'mouseup'
82
+    }, {
83
+      wxName: 'touchEnd',
84
+      ecName: 'click'
85
+    }];
86
+
87
+    eventNames.forEach(name => {
88
+      this.event[name.wxName] = e => {
89
+        const touch = e.touches[0];
90
+        this.chart._zr.handler.dispatch(name.ecName, {
91
+          zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
92
+          zrY: name.wxName === 'tap' ? touch.clientY : touch.y
93
+        });
94
+      };
95
+    });
96
+  }
97
+}

+ 30
- 0
src/pages/Line/Line.js Parādīt failu

@@ -0,0 +1,30 @@
1
+import Taro, { Component } from "@tarojs/taro";
2
+import { View } from "@tarojs/components";
3
+import LineChart from '../../components/LineChart'
4
+import "./index.scss";
5
+
6
+export default class Line extends Component {
7
+  config = {
8
+    navigationBarTitleText: "折线图示例"
9
+  };
10
+  componentDidMount() {
11
+    const chartData = {
12
+      dimensions: {
13
+        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
14
+      },
15
+      measures: [{
16
+        data: [10, 52, 200, 334, 390, 330, 220]
17
+      }]
18
+    }
19
+    this.lineChart.refresh(chartData);
20
+  }
21
+  refLineChart = (node) => this.lineChart = node
22
+
23
+  render() {
24
+    return (
25
+      <View className="line-chart">
26
+        <LineChart ref={this.refLineChart} />
27
+      </View>
28
+    );
29
+  }
30
+}

+ 4
- 0
src/pages/Line/index.scss Parādīt failu

@@ -0,0 +1,4 @@
1
+.line-chart {
2
+  width: 100%;
3
+  height: 100vh;
4
+}

+ 40
- 0
src/pages/More/More.js Parādīt failu

@@ -0,0 +1,40 @@
1
+import Taro, { Component } from "@tarojs/taro";
2
+import { View } from "@tarojs/components";
3
+import MoveChart from '../../components/MoveChart'
4
+import LineChart from '../../components/LineChart'
5
+import "./index.scss";
6
+
7
+
8
+export default class More extends Component {
9
+  config = {
10
+    navigationBarTitleText: "可移动图表示例"
11
+  };
12
+  componentDidMount() {
13
+    const chartData = {
14
+      dimensions: {
15
+        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun','Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
16
+      },
17
+      measures: [{
18
+        data: [10, 52, 200, 334, 390, 330, 220, 334, 390, 330, 220, 10, 52, 200,]
19
+      }]
20
+    }
21
+    this.moveChart.refresh(chartData);
22
+    this.lineChart.refresh(chartData);
23
+  }
24
+  refMoveChart = (node) => this.moveChart = node
25
+
26
+  refLineChart = (node) => this.lineChart = node
27
+
28
+  render() {
29
+    return (
30
+      <View className='container'>
31
+        <View className="move-chart">
32
+          <MoveChart ref={this.refMoveChart} />
33
+        </View>
34
+        <View className="move-chart">
35
+          <LineChart ref={this.refLineChart} />
36
+        </View>
37
+      </View>
38
+    );
39
+  }
40
+}

+ 7
- 0
src/pages/More/index.scss Parādīt failu

@@ -0,0 +1,7 @@
1
+.text {
2
+  text-align: center;
3
+}
4
+.move-chart {
5
+  width: 100%;
6
+  height: 50vh;
7
+}

+ 2
- 4
src/pages/news/item.scss Parādīt failu

@@ -1,6 +1,5 @@
1 1
 @import "@styles/theme.scss";
2 2
 .item {
3
-  padding: 20px 0;
4 3
   border-bottom: solid 1px $border-color-light;
5 4
   display: flex;
6 5
   justify-content: space-between;
@@ -8,10 +7,9 @@
8 7
 	margin:0 30px;
9 8
 
10 9
   &-img {
11
-    width: 400px;
12
-    height: 200px;
10
+    width: 350px;
11
+    height: 160px;
13 12
     margin-right: 30px;
14
-    border-radius: 10px;
15 13
   }
16 14
 
17 15
   &-con {

+ 58
- 0
src/pages/person/customerAnalysis/analysis.js Parādīt failu

@@ -0,0 +1,58 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import Authorize from '@components/authorize'
3
+import { View } from "@tarojs/components";
4
+import MoveChart from '../../components/MoveChart'
5
+import LineChart from '../../components/LineChart'
6
+import './index.scss'
7
+import { AtTabs, AtTabsPane } from 'taro-ui'
8
+import "taro-ui/dist/style/components/tabs.scss"
9
+import { savePoint, updatePoint } from '@services/common'
10
+import { connect } from '@tarojs/redux'
11
+
12
+
13
+@connect(({ user, city }) => ({ user, city }))
14
+export default class analysis extends Taro.Component {
15
+
16
+  config = {
17
+    navigationBarTitleText: ''
18
+  }
19
+
20
+  state = {
21
+    current: 0,
22
+    recordId: undefined, // 埋点ID
23
+  }
24
+
25
+  componentWillUnmount() {
26
+    const { recordId } = this.state
27
+    recordId && updatePoint(recordId)
28
+  }
29
+
30
+  handleClick(value) {
31
+    this.setState({
32
+      current: value
33
+    }, )
34
+  }
35
+ 
36
+
37
+  render() {
38
+
39
+    const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
40
+
41
+    return (
42
+      <View>
43
+        <AtTabs className="tab-bar" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
44
+          <AtTabsPane current={this.state.current} index={0} >
45
+            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;' >标签22页一的内容</View>
46
+          </AtTabsPane>
47
+          <AtTabsPane current={this.state.current} index={1}>
48
+            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;'>标签页二的内容</View>
49
+          </AtTabsPane>
50
+          <AtTabsPane current={this.state.current} index={2}>
51
+            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;'>标签页三的内容</View>
52
+          </AtTabsPane>
53
+        </AtTabs>
54
+
55
+      </View>
56
+    )
57
+  }
58
+}

+ 125
- 0
src/pages/person/customerAnalysis/followUpCustomer/index.js Parādīt failu

@@ -0,0 +1,125 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import Authorize from '@components/authorize'
3
+import './index.scss'
4
+import { savePoint, updatePoint } from '@services/common'
5
+import { connect } from '@tarojs/redux'
6
+import { View, Text, Picker } from '@tarojs/components';
7
+const iconImg = require('@assets/person/icon.png')
8
+
9
+@connect(({ user, city }) => ({ user, city }))
10
+export default class transactionCustomer extends Taro.Component {
11
+
12
+  config = {
13
+    navigationBarTitleText: '跟进客户'
14
+  }
15
+
16
+  state = {
17
+    list: [
18
+      { name: '刘丽丽', phone: '15852364821', sex: '1' },
19
+      { name: '邓亚平', phone: '13160056061', sex: '2' },
20
+    ],
21
+    recordId: undefined, // 埋点ID
22
+    inputValue: '',
23
+    screenVisible: true,
24
+    statusList: ['全部状态', '认筹', '到访', '签约'],
25
+    statusIndex: -1,
26
+    dateSel: '2018-04-22',
27
+  }
28
+
29
+  componentWillUnmount() {
30
+    const { recordId } = this.state
31
+    recordId && updatePoint(recordId)
32
+  }
33
+  changeInput = e => {
34
+    this.setState({
35
+      inputValue: e.detail.value
36
+    })
37
+  }
38
+  searchBtn() {
39
+    const palyload = {
40
+      inputValue: this.state.inputValue
41
+    }
42
+    console.log(this.state.inputValue, "inputValue")
43
+  }
44
+  screenShow() {
45
+    this.setState({
46
+      screenVisible: true,
47
+    })
48
+  }
49
+  chooseStatus(item, inx) {
50
+    this.setState({
51
+      statusIndex: inx,
52
+    })
53
+    console.log(item, inx, "eeeeeeeeeeee")
54
+  }
55
+  onDateChange = e => {
56
+    console.log(e.detail.value, "e.detail.value")
57
+    this.setState({
58
+      dateSel: e.detail.value
59
+    },
60
+      console.log(this.state.dateSel, "e.detail.value")
61
+    )
62
+
63
+  }
64
+  renderScreenBox() {
65
+    const { statusList, statusIndex, dateSel } = this.state
66
+    return (
67
+      <View className="mask">
68
+        <View className="content">
69
+          <View style="color:#333;font-size:14px">精准筛选</View>
70
+          <View className="status-box">
71
+            {
72
+              statusList.map((item, index) => (
73
+                <View className={index == statusIndex ? 'checked' : 'status-item'} onClick={this.chooseStatus.bind(this, item, index)}>{item}</View>
74
+              ))
75
+            }
76
+          </View>
77
+          <View>
78
+            <Picker mode='date' onChange={this.onDateChange}>
79
+              <View className='picker'>
80
+                当前选择:{dateSel}
81
+              </View>
82
+            </Picker>
83
+          </View>
84
+        </View>
85
+      </View>
86
+    )
87
+  }
88
+
89
+  render() {
90
+    const { list, screenVisible } = this.state
91
+
92
+    return (
93
+      <View>
94
+        <View className="top-screen" onClick={this.screenShow}>
95
+          精准筛选<Image src={require('@assets/person/screen.png')} className="screen-img"></Image>
96
+        </View>
97
+        {screenVisible && this.renderScreenBox()}
98
+        <View className="search-box">
99
+          <Input class="input" placeholderClass='placeholder' autoFocus onInput={this.changeInput} placeholder="请输入用户名/手机号" />
100
+          <Button className="btn" onClick={this.searchBtn} >搜索</Button>
101
+        </View>
102
+        <View style="padding:10px">
103
+          {
104
+            list.map(item => (
105
+              <View class="item">
106
+                <Image src={require('@assets/default-avatar.png')} className='img'></Image>
107
+                <View className="name">
108
+                  {item.name}
109
+                  {
110
+                    item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
111
+                  }
112
+                  {
113
+                    item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
114
+                  }
115
+                </View>
116
+                <View className="phone">{item.phone}<View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View> </View>
117
+                <View className="status">报备</View>
118
+              </View>
119
+            ))
120
+          }
121
+        </View>
122
+      </View>
123
+    )
124
+  }
125
+}

+ 124
- 0
src/pages/person/customerAnalysis/followUpCustomer/index.scss Parādīt failu

@@ -0,0 +1,124 @@
1
+@import "@styles/theme.scss";
2
+.top-screen{
3
+  height:56px;
4
+  line-height: 56px;
5
+  background:#f4f4f4;
6
+  color: #999;
7
+  font-size: 24px;
8
+  text-align: right;
9
+  padding-right: 30px;
10
+  .screen-img{
11
+    width: 24px;
12
+    height: 24px;
13
+    margin: 0 0 -4px 4px;
14
+  }
15
+}
16
+.mask {
17
+  position: fixed;
18
+  width: 100vw;
19
+  height: 100vh;
20
+  left: 0;
21
+  top: 0;
22
+  z-index: 9999;
23
+  background:rgba(0,0,0,0.22);
24
+  .content {
25
+    width: 100%;
26
+    height:538px;
27
+    position: absolute;
28
+    left: 0;
29
+    top: 0;
30
+    background-color: #fff;
31
+    padding: 20px 40px;
32
+    .status-box{
33
+      display: flex;
34
+      flex-wrap: wrap;
35
+      align-content: flex-start;
36
+      justify-content: space-between;
37
+      .status-item{
38
+        flex:0 0 23%;
39
+        margin:  20px 1%;
40
+        border: 2px solid $primary-color;
41
+        height: 56px;
42
+        line-height: 56px;
43
+        text-align: center;
44
+        border-radius: 12px;
45
+        color: $primary-color;
46
+      }
47
+      .checked{
48
+        flex:0 0 23%;
49
+        margin:  20px 1%;
50
+        border: 2px solid $primary-color;
51
+        height: 56px;
52
+        line-height: 56px;
53
+        text-align: center;
54
+        border-radius: 12px;
55
+        color: #fff;
56
+        background-color: $primary-color;
57
+      }
58
+    }
59
+  }
60
+}
61
+.search-box{
62
+  display: flex;
63
+  align-items: center;
64
+  padding: 20px 40px;
65
+  .input{
66
+    height: 56px;
67
+    line-height: 56px;
68
+    width: 84%;
69
+    background:#f4f4f4;
70
+    border-radius: 4px 0px 0px 4px;
71
+    padding: 0 20px;
72
+    font-size: 22px;
73
+  }
74
+  .placeholder{
75
+    color:#C9C9C9;
76
+  }
77
+  .btn{
78
+    height: 56px;
79
+    padding: 0;
80
+    line-height: 56px;
81
+    width: 16%;
82
+    text-align: center;
83
+    background-color: $primary-color; 
84
+    color: #fff;
85
+    font-size: 28px;
86
+    border-radius:0px 4px 4px 0px;
87
+
88
+  }
89
+}
90
+.item{
91
+  padding: 20px 0;
92
+  display: flex;
93
+  align-items: center;
94
+  position: relative;
95
+  justify-content: space-between;
96
+  box-shadow:0px 2px 0px 0px rgba(0,0,0,0.12);
97
+  .img{
98
+    width: 100px;
99
+    height: 100px;
100
+    border-radius: 50px;
101
+  }
102
+  .name{
103
+    display: flex;
104
+    align-items: center;
105
+    color: #333;
106
+    font-size: 30px;
107
+    position: absolute;
108
+    top:24px;
109
+    left:120px;
110
+  }
111
+  .phone{
112
+    color: #333;
113
+    font-size: 30px;
114
+    position: absolute;
115
+    bottom:24px;
116
+    left:120px;
117
+    display: flex;
118
+    align-items: center;
119
+  }
120
+  .status{
121
+    color:$primary-color;
122
+    font-size: 32px;
123
+  }
124
+}

+ 69
- 0
src/pages/person/customerAnalysis/index.js Parādīt failu

@@ -0,0 +1,69 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import Authorize from '@components/authorize'
3
+import './index.scss'
4
+import { AtTabs, AtTabsPane } from 'taro-ui'
5
+import "taro-ui/dist/style/components/tabs.scss"
6
+import { savePoint, updatePoint } from '@services/common'
7
+import { connect } from '@tarojs/redux'
8
+import Analysis from './analysis'
9
+
10
+@connect(({ user, city }) => ({ user, city }))
11
+export default class customer extends Taro.Component {
12
+
13
+  config = {
14
+    navigationBarTitleText: '盘客工具'
15
+  }
16
+
17
+  state = {
18
+    current: 1,
19
+    recordId: undefined, // 埋点ID
20
+  }
21
+
22
+  componentWillUnmount() {
23
+    const { recordId } = this.state
24
+    recordId && updatePoint(recordId)
25
+  }
26
+
27
+  handleClick(value) {
28
+    this.setState({
29
+      current: value
30
+    }, )
31
+  }
32
+  toTransactionCustomer() {
33
+    Taro.navigateTo({
34
+      url: `/pages/person/customerAnalysis/transactionCustomer/index`
35
+    })
36
+  }
37
+  toFollowUpCustomer() {
38
+    Taro.navigateTo({
39
+      url: `/pages/person/customerAnalysis/followUpCustomer/index`
40
+    })
41
+  }
42
+
43
+  render() {
44
+    const tabList = [{ title: '客户分析' }, { title: '我的客户' }]
45
+    return (
46
+      <AtTabs className="tab-box" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
47
+        <AtTabsPane current={this.state.current} index={0} >
48
+          <View >
49
+            <Analysis></Analysis>
50
+          </View>
51
+        </AtTabsPane>
52
+        <AtTabsPane current={this.state.current} index={1}>
53
+          <View style="padding:10px 20px; display: flex;flex-wrap: wrap;align-content: flex-start;justify-content: space-between;">
54
+            <View className="my-customer" onClick={this.toFollowUpCustomer} style="border-right:1px solid rgba(0,0,0,0.12)">
55
+              <Image mode="widthFix" src={require('@assets/person/genjin.png')} className='img'></Image>
56
+              <View className="name">跟进客户</View>
57
+              <View className="num">33人</View>
58
+            </View>
59
+            <View className="my-customer" onClick={this.toTransactionCustomer}>
60
+              <Image mode="widthFix" src={require('@assets/person/chengjiao.png')} className='img'></Image>
61
+              <View className="name">成交客户</View>
62
+              <View className="name">33人</View>
63
+            </View>
64
+          </View>
65
+        </AtTabsPane>
66
+      </AtTabs>
67
+    )
68
+  }
69
+}

+ 82
- 0
src/pages/person/customerAnalysis/index.scss Parādīt failu

@@ -0,0 +1,82 @@
1
+@import "@styles/theme.scss";
2
+
3
+.wrap {
4
+  background: white;
5
+  position: relative;
6
+  height:100vh;
7
+}
8
+
9
+.tab-box{
10
+  .at-tabs__header{
11
+    width: 86%;
12
+    background-color: #fff;
13
+    box-shadow:0px 4px 12px 0px rgba(0,0,0,0.12);
14
+    margin: 20px auto 10px auto;
15
+    border-radius: 44px;
16
+  }
17
+  .at-tabs__item{
18
+    width:50%;
19
+    flex: none;
20
+    color: #666;
21
+    font-size: 28px;
22
+  }
23
+  .at-tabs__item--active{
24
+    color: $primary-color;
25
+    background-color: #f4f4f4;
26
+    border-radius: 0 44px 44px 0;
27
+  }
28
+  .at-tabs__item-underline{
29
+    height: 0px;
30
+  }
31
+  .at-tabs__underline{
32
+    height: 0px!important;
33
+  }
34
+  .my-customer{
35
+    flex: 0 0 50%;
36
+    text-align: center;
37
+    border-bottom: 2px solid rgba(216,216,216,1);
38
+    padding: 80px 0;
39
+    
40
+    .img{
41
+      width: 76px;
42
+    }
43
+    .name{
44
+      color: #333;
45
+      font-size: 30px;
46
+      line-height: 48px;
47
+    }
48
+
49
+
50
+  }
51
+  .tab-bar{
52
+    margin-top: 50px;
53
+    .at-tabs__header{
54
+      width: 80%;
55
+      background-color: none;
56
+      box-shadow:none;
57
+      margin: 0 auto;
58
+      border-radius: 0;
59
+      border: none;
60
+    }
61
+    .at-tabs__item{
62
+      width:33.333%;
63
+      flex: none;
64
+      color: #666;
65
+      font-size: 28px;
66
+    }
67
+    .at-tabs__item--active{
68
+      color: $primary-color;
69
+      background-color: #fff;
70
+    }
71
+    .at-tabs__item-underline{
72
+      height: 2px;
73
+      background-color: $primary-color;
74
+      width: 60%;
75
+      margin-left: 20%;
76
+    }
77
+  
78
+  }
79
+
80
+
81
+}
82
+

+ 59
- 0
src/pages/person/customerAnalysis/transactionCustomer/index.js Parādīt failu

@@ -0,0 +1,59 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import Authorize from '@components/authorize'
3
+import './index.scss'
4
+import { savePoint, updatePoint } from '@services/common'
5
+import { connect } from '@tarojs/redux'
6
+// import { getThumbnail } from '@utils/tools'
7
+const iconImg = require('@assets/person/icon.png')
8
+
9
+
10
+@connect(({ user, city }) => ({ user, city }))
11
+export default class transactionCustomer extends Taro.Component {
12
+
13
+  config = {
14
+    navigationBarTitleText: '成交客户'
15
+  }
16
+
17
+  state = {
18
+    list: [
19
+      { name: '刘丽丽', phone: '15852364821', sex: '1' },
20
+      { name: '邓亚平', phone: '13160056061', sex: '2' },
21
+    ],
22
+    recordId: undefined, // 埋点ID
23
+  }
24
+
25
+  componentWillUnmount() {
26
+    const { recordId } = this.state
27
+    recordId && updatePoint(recordId)
28
+  }
29
+
30
+  render() {
31
+    const { list } = this.state
32
+
33
+    return (
34
+      <View style="padding:10px">
35
+        {
36
+
37
+          list.map(item => (
38
+            <View class="item">
39
+
40
+              <Image src={require('@assets/default-avatar.png')} className='img'></Image>
41
+              <View className="name">
42
+                {item.name}
43
+                {
44
+                  item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
45
+                }
46
+                {
47
+                  item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
48
+                }
49
+              </View>
50
+              <View className="phone">{item.phone} </View>
51
+              <View  style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View>
52
+            </View>
53
+          ))
54
+        }
55
+
56
+      </View>
57
+    )
58
+  }
59
+}

+ 30
- 0
src/pages/person/customerAnalysis/transactionCustomer/index.scss Parādīt failu

@@ -0,0 +1,30 @@
1
+@import "@styles/theme.scss";
2
+.item{
3
+  padding: 20px 0;
4
+  display: flex;
5
+  align-items: center;
6
+  position: relative;
7
+  justify-content: space-between;
8
+  box-shadow:0px 2px 0px 0px rgba(0,0,0,0.12);
9
+  .img{
10
+    width: 100px;
11
+    height: 100px;
12
+    border-radius: 50px;
13
+  }
14
+  .name{
15
+    display: flex;
16
+    align-items: center;
17
+    color: #333;
18
+    font-size: 30px;
19
+    position: absolute;
20
+    top:24px;
21
+    left:120px;
22
+  }
23
+  .phone{
24
+    color: #333;
25
+    font-size: 30px;
26
+    position: absolute;
27
+    bottom:24px;
28
+    left:120px;
29
+  }
30
+}

+ 8
- 1
src/pages/person/menus.js Parādīt failu

@@ -33,11 +33,18 @@ const menus = [
33 33
     },
34 34
     {
35 35
       name: '我的主页',
36
-      url: ({id}) => `/pages/card/index?id=${id}`,
36
+      url: ({ id }) => `/pages/card/index?id=${id}`,
37 37
       icon: icons.homepage,
38 38
       extends: undefined,
39 39
       userTypes: [CONSULTANT],
40 40
     },
41
+    {
42
+      name: '盘客工具',
43
+      url: '/pages/person/customerAnalysis/index',
44
+      icon: icons.homepage,
45
+      extends: undefined,
46
+      userTypes: [CUSTOMER, CONSULTANT],
47
+    },
41 48
     {
42 49
       name: '成为经纪人',
43 50
       url: '/pages/agent/become/index',

+ 1
- 1
src/pages/policy/index.scss Parādīt failu

@@ -7,5 +7,5 @@
7 7
   padding:0 40px;
8 8
   height:100vh;
9 9
   background:white;
10
-  margin-top:30px;
10
+  margin-top:20px;
11 11
 }

+ 7
- 5
src/pages/policy/item/item.scss Parādīt failu

@@ -1,14 +1,13 @@
1 1
 @import "@styles/theme.scss";
2 2
 .item {
3
-  padding: 50px 0;
4 3
   border-bottom: solid 1px $border-color-light;
5 4
   display: flex;
6 5
   justify-content: space-between;
7 6
   align-items: center;
8 7
 
9 8
   &-img {
10
-    width: 400px;
11
-    height: 200px;
9
+    width: 350px;
10
+    height: 160px;
12 11
     margin-right: 30px;
13 12
   }
14 13
 
@@ -21,11 +20,14 @@
21 20
 
22 21
     &__title {
23 22
       font-size: $font-size-title;
23
+      margin-top: 20px;
24 24
     }
25 25
 
26 26
     &__date {
27 27
       font-size: $font-size-content;
28
-      color: $text-color-lighter
28
+      color: $text-color-lighter;
29
+      margin-bottom: 20px;
29 30
     }
30 31
   }
31
-}
32
+}
33
+