张延森 5 years ago
parent
commit
94745eb797

+ 1
- 1
config/dev.js View File

@@ -5,7 +5,7 @@ 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"',//测试
8
+    HOST:  '"https://dev.jinchengjiaye.com"',//测试
9 9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',

+ 3
- 0
src/app.js View File

@@ -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
src/assets/person/chengjiao.png View File


BIN
src/assets/person/genjin.png View File


BIN
src/assets/person/icon.png View File


BIN
src/assets/person/screen.png View File


+ 166
- 0
src/components/AddChart.js View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

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

+ 4
- 0
src/components/ec-canvas/ec-canvas.wxml View File

@@ -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 View File

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

+ 22
- 0
src/components/ec-canvas/echarts.js
File diff suppressed because it is too large
View File


+ 97
- 0
src/components/ec-canvas/wx-canvas.js View File

@@ -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 View File

@@ -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 View File

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

+ 40
- 0
src/pages/More/More.js View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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
+

+ 22
- 8
src/pages/project/banner/index.js View File

@@ -2,8 +2,8 @@ import Taro, { Component } from '@tarojs/taro'
2 2
 import { View, Swiper, SwiperItem, Image } from '@tarojs/components'
3 3
 // import { cdn } from '@constants/api'
4 4
 import './index.scss'
5
-import emptyImg  from '@assets/empty.png'
6
-import { getThumbnail} from '@utils/tools'
5
+import emptyImg from '@assets/empty.png'
6
+import { getThumbnail } from '@utils/tools'
7 7
 
8 8
 export default class SwiperBanner extends Component {
9 9
   static defaultProps = {
@@ -12,13 +12,26 @@ export default class SwiperBanner extends Component {
12 12
     style: {
13 13
       height: '200px'
14 14
     },
15
-    onClick: function () { }
15
+    onClick: function () { },
16
+    current: 0,
16 17
   }
17 18
 
18
-  onBannerClick(item) {
19
+  changeCurrent (event) {
20
+    console.log(event.detail.current)
21
+    const current = event.detail.current
22
+    this.setState(
23
+      {
24
+        current: current
25
+      }
26
+    )
27
+    this.props.onChange(current)
28
+    // event.detail = {current, source}
29
+  }
30
+
31
+  onBannerClick (item) {
19 32
     this.props.onClick(item)
20 33
   }
21
-  render() {
34
+  render () {
22 35
     const { list, style, indicatorDots, current } = this.props
23 36
     return (
24 37
       <View className='home-banner' style={style}>
@@ -26,9 +39,10 @@ export default class SwiperBanner extends Component {
26 39
           className='home-banner__swiper'
27 40
           circular
28 41
           autoplay
42
+          onChange={this.changeCurrent.bind(this)}
29 43
           indicatorDots={indicatorDots}
30 44
           indicatorActiveColor='rgb(256,256,256)'
31
-        >
45
+        >{console.log(current)}
32 46
           {list.map((item, index) => (
33 47
             <SwiperItem
34 48
               key={index}
@@ -39,12 +53,12 @@ export default class SwiperBanner extends Component {
39 53
                 mode="widthFix"
40 54
                 style={style}
41 55
                 className='home-banner__swiper-item-img'
42
-                src={getThumbnail(item.image || item.url ||item.img||emptyImg)}
56
+                src={getThumbnail(item.image || item.url || item.img || emptyImg)}
43 57
               />
44 58
             </SwiperItem>
45 59
           ))}
46 60
         </Swiper>
47
-      </View> 
61
+      </View>
48 62
     )
49 63
   }
50 64
 }

+ 76
- 47
src/pages/project/detail/index.js View File

@@ -1,5 +1,5 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2
-
2
+import { View, Video } from '@tarojs/components'
3 3
 import './index.scss'
4 4
 import Banner from '../banner'
5 5
 import HelpGroupBanner from '../swiper'
@@ -51,10 +51,11 @@ export default class Index extends Component {
51 51
     circumOpts: [],
52 52
     curTab: 'Transport',
53 53
     recordId: null,
54
-    posterShow: 'none'
54
+    posterShow: 'none',
55
+    current: 1,
55 56
   }
56 57
 
57
-  componentWillMount() {
58
+  componentWillMount () {
58 59
     // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
59 60
     ready.queue(() => {
60 61
       const router = Taro.getStorageSync('router')
@@ -88,7 +89,7 @@ export default class Index extends Component {
88 89
     })
89 90
   }
90 91
 
91
-  componentWillUnmount() {
92
+  componentWillUnmount () {
92 93
     const { recordId } = this.state
93 94
     recordId && updatePoint(recordId)
94 95
   }
@@ -163,7 +164,7 @@ export default class Index extends Component {
163 164
     })
164 165
   }
165 166
 
166
-  loadActivityData() {
167
+  loadActivityData () {
167 168
     const { buildingId } = this.state
168 169
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
169 170
     queryActivityList(payload).then(res => {
@@ -173,7 +174,7 @@ export default class Index extends Component {
173 174
     })
174 175
   }
175 176
 
176
-  loadNewsData() {
177
+  loadNewsData () {
177 178
     const { buildingId } = this.state
178 179
     const payload = { pageSize: 2, pageNumber: 1, buildingId }
179 180
     queryNewsList(payload).then(res => {
@@ -183,11 +184,11 @@ export default class Index extends Component {
183 184
     })
184 185
   }
185 186
 
186
-  navigateTo(url) {
187
+  navigateTo (url) {
187 188
     Taro.navigateTo({ url: url })
188 189
   }
189 190
   // 海报预览图
190
-  previewImage(arr) {
191
+  previewImage (arr) {
191 192
     console.log('arr:' + arr)
192 193
     if (arr[0].length > 1) {
193 194
       Taro.previewImage({
@@ -214,7 +215,7 @@ export default class Index extends Component {
214 215
     })
215 216
   }
216 217
 
217
-  openMap() {
218
+  openMap () {
218 219
     const {
219 220
       buildingName,
220 221
       address,
@@ -241,12 +242,12 @@ export default class Index extends Component {
241 242
     })
242 243
   }
243 244
 
244
-  toViewAlbum() {
245
+  toViewAlbum () {
245 246
     const { buildingId } = this.state
246 247
     this.navigateTo(`/pages/project/album/index?id=${buildingId}`)
247 248
   }
248 249
 
249
-  onViewFans() {
250
+  onViewFans () {
250 251
     const { buildingId } = this.state
251 252
     this.navigateTo('/pages/card/fans/index?type=item&id=' + buildingId)
252 253
   }
@@ -275,7 +276,7 @@ export default class Index extends Component {
275 276
     }
276 277
   }
277 278
 
278
-  getPhoneNumber(e, item) {
279
+  getPhoneNumber (e, item) {
279 280
     getUserPhone(e, (phoneNumber) => {
280 281
       const { userInfo: { person: { personId, nickname, name } } } = this.props
281 282
       Taro.navigateTo({
@@ -284,7 +285,7 @@ export default class Index extends Component {
284 285
     })
285 286
   }
286 287
 
287
-  getPosterData() {
288
+  getPosterData () {
288 289
     return new Promise(resolve => {
289 290
       const { posterData } = this.state
290 291
       if (posterData.qrcode) {
@@ -355,14 +356,14 @@ export default class Index extends Component {
355 356
     })
356 357
   }
357 358
 
358
-  handleTelClick(item, e) {
359
+  handleTelClick (item, e) {
359 360
     e.stopPropagation()
360 361
     Taro.makePhoneCall({
361 362
       phoneNumber: item.phone
362 363
     })
363 364
   }
364 365
 
365
-  handleChatClick(item, e) {
366
+  handleChatClick (item, e) {
366 367
     e.stopPropagation()
367 368
     const { userInfo: { person: { personId, nickname, name } } } = this.props
368 369
     Taro.navigateTo({
@@ -370,24 +371,24 @@ export default class Index extends Component {
370 371
     })
371 372
   }
372 373
 
373
-  handleConsuItemClick(item) {
374
+  handleConsuItemClick (item) {
374 375
     Taro.navigateTo({
375 376
       url: `/pages/card/index?id=${item.id}`
376 377
     })
377 378
   }
378 379
 
379
-  handleMoreClick() {
380
+  handleMoreClick () {
380 381
     // App.zhuge.track('查看置业顾问列表')
381 382
     Taro.navigateTo({
382 383
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
383 384
     })
384 385
   }
385 386
 
386
-  handleStopPropagation(e) {
387
+  handleStopPropagation (e) {
387 388
     e.stopPropagation()
388 389
   }
389 390
 
390
-  toRecomonedPage() {
391
+  toRecomonedPage () {
391 392
     const {
392 393
       userInfo: { person: { personType } }
393 394
     } = this.props
@@ -403,50 +404,50 @@ export default class Index extends Component {
403 404
     }
404 405
   }
405 406
 
406
-  toHome() {
407
+  toHome () {
407 408
     Taro.switchTab({
408 409
       url: `/pages/project/index`
409 410
     })
410 411
   }
411 412
 
412
-  HandleCircumTabClick(id) {
413
+  HandleCircumTabClick (id) {
413 414
     this.setState({
414 415
       curTab: id
415 416
     })
416 417
   }
417 418
 
418
-  handleNewsMoreClick() {
419
+  handleNewsMoreClick () {
419 420
     Taro.navigateTo({
420 421
       url: `/pages/news/index?buildingId=` + this.state.buildingId
421 422
     })
422 423
   }
423 424
 
424
-  handNewsItemClick(id) {
425
+  handNewsItemClick (id) {
425 426
     Taro.navigateTo({
426 427
       url: '/pages/news/detail/index?id=' + id
427 428
     })
428 429
   }
429 430
 
430
-  handleActivityMoreClick() {
431
+  handleActivityMoreClick () {
431 432
     Taro.navigateTo({
432 433
       url: `/pages/activity/index?buildingId=` + this.state.buildingId
433 434
     })
434 435
   }
435 436
 
436
-  handActivityItemClick(id) {
437
+  handActivityItemClick (id) {
437 438
     Taro.navigateTo({
438 439
       url: '/pages/activity/detail/index?id=' + id
439 440
     })
440 441
   }
441 442
 
442
-  handlePreviewHxImage(current, urls) {
443
+  handlePreviewHxImage (current, urls) {
443 444
     Taro.previewImage({
444 445
       current,
445 446
       urls
446 447
     })
447 448
   }
448 449
 
449
-  handleFavor() {
450
+  handleFavor () {
450 451
     const { buildingId, isSaved } = this.state
451 452
     if (isSaved) {
452 453
       cancelFavorProject(buildingId).then(res => {
@@ -476,12 +477,12 @@ export default class Index extends Component {
476 477
       console.log('活动项目收藏')
477 478
     })
478 479
   }
479
-  handleToolsClick() {
480
+  handleToolsClick () {
480 481
     Taro.navigateTo({
481 482
       url: `/pages/toolKit/index`
482 483
     })
483 484
   }
484
-  moreFloor() {
485
+  moreFloor () {
485 486
     Taro.navigateTo({
486 487
       url: `/pages/project/floor/index`
487 488
     })
@@ -526,16 +527,16 @@ export default class Index extends Component {
526 527
     )
527 528
   }
528 529
 
529
-  previewHouseImage(current, urls) {
530
+  previewHouseImage (current, urls) {
530 531
     Taro.previewImage({
531 532
       current,
532 533
       urls
533 534
     })
534 535
   }
535 536
 
536
-  renderBuildingProjectTypeList() {
537
+  renderBuildingProjectTypeList () {
537 538
     const { statusOpts } = this.state
538
-    const { projectDetail: { buildingProjectType = [], status,marketStatus } } = this.props
539
+    const { projectDetail: { buildingProjectType = [], status, marketStatus } } = this.props
539 540
     return (
540 541
       <Block>
541 542
         {
@@ -587,7 +588,7 @@ export default class Index extends Component {
587 588
   }
588 589
 
589 590
 
590
-  renderPhotoAlbum() {
591
+  renderPhotoAlbum () {
591 592
     const { projectDetail: { buildingApartment } } = this.props
592 593
     const list = buildingApartment.filter(item => item.apartmentType === 'photo')
593 594
     const imgList = list.reduce((prev, cur) => {
@@ -614,7 +615,7 @@ export default class Index extends Component {
614 615
       </Block>
615 616
     )
616 617
   }
617
-  rendercircum() {
618
+  rendercircum () {
618 619
     const { curTab, circumOpts } = this.state
619 620
     const { projectDetail } = this.props
620 621
     const panel = circumOpts.filter(item => item.key === curTab)[0]
@@ -668,7 +669,7 @@ export default class Index extends Component {
668 669
     )
669 670
   }
670 671
 
671
-  renderConsuler() {
672
+  renderConsuler () {
672 673
     const { userInfo: { person: { phone } } } = this.props
673 674
     const { projectDetail: { consultants = [] } } = this.props
674 675
     return (
@@ -722,7 +723,7 @@ export default class Index extends Component {
722 723
     )
723 724
   }
724 725
 
725
-  renderStatement() {
726
+  renderStatement () {
726 727
     return (
727 728
       <View className='statement'>
728 729
         免责条款:以上价格仅供参考,具体一房一价的信息以售楼处展示为准。本网显示房屋位置、交通、医疗、教育、商业等配套信息,来源于第三方网络数据,不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。<br></br>本平台对项目周边文化教育的介绍旨在提供相关信息,并不意味着信息发布方对就学安排作出承诺。相关教育资源就学信息存在调整的可能,应以政府教育主管部门及办学颁布的政策规定为准。
@@ -731,7 +732,7 @@ export default class Index extends Component {
731 732
   }
732 733
 
733 734
 
734
-  renderHelp() {
735
+  renderHelp () {
735 736
     const { helpList } = this.state
736 737
     return (
737 738
       <Block>
@@ -752,17 +753,17 @@ export default class Index extends Component {
752 753
     )
753 754
   }
754 755
 
755
-  handleHelpClick(item) {
756
+  handleHelpClick (item) {
756 757
     Taro.navigateTo({
757 758
       url: '/pages/activity/detail/assistance?id=' + item.activityId
758 759
     })
759 760
   }
760
-  handleGroupClick(item) {
761
+  handleGroupClick (item) {
761 762
     Taro.navigateTo({
762 763
       url: '/pages/activity/detail/assemble?id=' + item.activityId
763 764
     })
764 765
   }
765
-  renderGroup() {
766
+  renderGroup () {
766 767
     const { groupList } = this.state
767 768
     return (
768 769
       <Block>
@@ -784,7 +785,7 @@ export default class Index extends Component {
784 785
     )
785 786
   }
786 787
 
787
-  renderHouseTypeList() {
788
+  renderHouseTypeList () {
788 789
     const { statusOpts } = this.state
789 790
     const { projectDetail: { buildingApartment } } = this.props
790 791
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
@@ -813,7 +814,7 @@ export default class Index extends Component {
813 814
                         )
814 815
                       }
815 816
                       <View className="rest-info">
816
-                        <View className='house-type__name'><Text style="color:#FA5431;margin-right:10px">{item.buildingArea||''}</Text>{item.apartmentName||''}</View>
817
+                        <View className='house-type__name'><Text style="color:#FA5431;margin-right:10px">{item.buildingArea || ''}</Text>{item.apartmentName || ''}</View>
817 818
                         <View className='construction__area'>
818 819
                           <Text>建面{item.buildingArea || ''}m²</Text>
819 820
                           {
@@ -832,7 +833,7 @@ export default class Index extends Component {
832 833
 
833 834
     )
834 835
   }
835
-  renderActivities() {
836
+  renderActivities () {
836 837
     const { activityList } = this.state
837 838
     return (
838 839
       <Block>
@@ -863,7 +864,7 @@ export default class Index extends Component {
863 864
       </Block>
864 865
     )
865 866
   }
866
-  renderNews() {
867
+  renderNews () {
867 868
     const { newsList } = this.state
868 869
     return (
869 870
       <Block>
@@ -895,7 +896,26 @@ export default class Index extends Component {
895 896
     )
896 897
   }
897 898
 
898
-  render() {
899
+  renderVideo () {
900
+    return (
901
+      <Video
902
+        style={{
903
+          height: '278px'
904
+        }}
905
+      ></Video>
906
+    )
907
+  }
908
+
909
+  changeCurrent (current) {
910
+    console.log('value:', current)
911
+    this.setState({
912
+      current: current + 1
913
+    })
914
+  }
915
+
916
+
917
+
918
+  render () {
899 919
     const { posterStatus, posterData, loaded } = this.state
900 920
     const { projectDetail } = this.props
901 921
     const { uvList = {} } = projectDetail
@@ -911,16 +931,25 @@ export default class Index extends Component {
911 931
               <View
912 932
                 className="pro__banner"
913 933
                 onClick={this.previewImage.bind(this, projectDetail.buildingImg)}>
914
-                <Banner
934
+                {1 && <View> <Banner
915 935
                   list={projectDetail.buildingImg}
916 936
                   indicatorDots={false}
937
+                  // current
938
+                  onChange={this.changeCurrent.bind(this)}
917 939
                   style={{
918 940
                     height: '278px'
919 941
                   }}
942
+
920 943
                 ></Banner>
921
-                <Text className="pro__banner-text">共{(projectDetail.buildingImg && projectDetail.buildingImg.length) || 0}张</Text>
944
+                  <Text className="pro__banner-text">{this.current}/{(projectDetail.buildingImg && projectDetail.buildingImg.length) || 0}</Text></View>}
945
+
946
+                <View className='media-btn'>
947
+                  <View className='video-btn' >视频</View>
948
+                  <View className='img-btn' >图片</View>
949
+                </View>
922 950
               </View>
923 951
 
952
+
924 953
               <ScrollView
925 954
                 enableBackToTop
926 955
                 className="wrap"

+ 93
- 51
src/pages/project/detail/index.scss View File

@@ -13,6 +13,37 @@
13 13
   width: 100%;
14 14
   padding-bottom: 50px;
15 15
 
16
+  .media-btn {
17
+    position: absolute;
18
+    width: 184px;
19
+    height: 64px;
20
+    background: rgba(255, 255, 255, 1);
21
+    border-radius: 12px;
22
+    top: 440px;
23
+    left: 284px;
24
+    font-size: 30px;
25
+    font-family: PingFangSC-Regular, PingFang SC;
26
+    font-weight: 400;
27
+    text-align: center;
28
+    line-height: 64px;
29
+
30
+    display: flex;;
31
+    .video-btn {
32
+      width: 92px;
33
+      height: 64px;
34
+      background: rgba(187, 156, 121, 1);
35
+      border-radius: 12px 0px 0px 12px;
36
+      color: rgba(255, 255, 255, 1);
37
+    }
38
+
39
+    .img-btn {
40
+      width: 92px;
41
+      height: 64px;
42
+      color: rgba(53, 53, 53, 1);
43
+    }
44
+  }
45
+
46
+
16 47
   .wrap {
17 48
     padding-top: 546px;
18 49
     background: transparent;
@@ -25,17 +56,20 @@
25 56
     border-top-right-radius: 28px;
26 57
   }
27 58
 }
28
-.activity{
59
+
60
+.activity {
29 61
   background: white;
30 62
   padding: 40px 0;
31 63
   margin-top: 20px;
64
+
32 65
   .title {
33 66
     font-size: 40px;
34 67
     font-weight: bold;
35 68
     margin: 10px 0 40px 35px;
36
-    
69
+
37 70
   }
38 71
 }
72
+
39 73
 .section {
40 74
   background: white;
41 75
   padding: 40px 35px;
@@ -121,8 +155,8 @@
121 155
   .map-more-btn {
122 156
     width: 100%;
123 157
     padding: 30px 0;
124
-    background:rgba(248,248,248,1);
125
-    border-radius:12px;
158
+    background: rgba(248, 248, 248, 1);
159
+    border-radius: 12px;
126 160
     text-align: center;
127 161
     color: $primary-color;
128 162
     font-weight: 500;
@@ -242,7 +276,7 @@
242 276
     line-height: 90px;
243 277
     border-radius: 8px;
244 278
     margin-right: 40px;
245
-    border:1px solid $primary-color;
279
+    border: 1px solid $primary-color;
246 280
 
247 281
     .iconfont {
248 282
       color: white;
@@ -258,7 +292,8 @@
258 292
   &__right2 {
259 293
     margin-right: 20px;
260 294
     background: $primary-color;
261
-    color:#fff;
295
+    color: #fff;
296
+
262 297
     .text {
263 298
       color: #fff;
264 299
       font-size: 34px;
@@ -366,6 +401,7 @@
366 401
       .favor-btn {
367 402
         display: flex;
368 403
         align-items: center;
404
+
369 405
         .iconfont {
370 406
           font-size: 40px;
371 407
           color: #F6B61D;
@@ -429,7 +465,7 @@
429 465
         display: flex;
430 466
         padding: 30px 4px;
431 467
       }
432
-      
468
+
433 469
 
434 470
       &__item {
435 471
         padding: 20px 86px 20px 30px;
@@ -438,19 +474,22 @@
438 474
         margin-right: 30px;
439 475
         position: relative;
440 476
         font-size: 32px;
441
-        .build-bg{
477
+
478
+        .build-bg {
442 479
           position: absolute;
443 480
           width: 100%;
444 481
           height: 100%;
445
-          top:0;
446
-          left:0;
447
-          
482
+          top: 0;
483
+          left: 0;
484
+
448 485
         }
486
+
449 487
         .row {
450 488
           margin-top: 20px;
451 489
           display: flex;
452 490
           align-items: center;
453
-          .row-right{
491
+
492
+          .row-right {
454 493
             margin: 0 50px;
455 494
           }
456 495
 
@@ -476,24 +515,27 @@
476 515
           bottom: 8%;
477 516
         }
478 517
 
479
-        .item__status{
518
+        .item__status {
480 519
           position: absolute;
481 520
           right: 0;
482 521
           top: 0%;
483
-          background:rgba(246,182,29,1);
522
+          background: rgba(246, 182, 29, 1);
484 523
           border-radius: 0 16px 0 14px;
485 524
           padding: 10px 36px;
486 525
           color: #fff;
487 526
           font-size: 26px;
488 527
         }
489
-        .sale{
490
-          background:rgba(246,182,29,1);
528
+
529
+        .sale {
530
+          background: rgba(246, 182, 29, 1);
491 531
         }
492
-        .soldout{
493
-          background:rgba(0,0,0,0.7);
532
+
533
+        .soldout {
534
+          background: rgba(0, 0, 0, 0.7);
494 535
         }
495
-        .waitsale{
496
-          background-color:$primary-color;
536
+
537
+        .waitsale {
538
+          background-color: $primary-color;
497 539
         }
498 540
       }
499 541
     }
@@ -587,8 +629,8 @@
587 629
             height: 52px;
588 630
             margin-left: -10px;
589 631
             border-radius: 50%;
590
-            box-shadow:0px 4px 4px 0px rgba(0,0,0,0.14);
591
-            border:2px solid rgba(255,255,255,1);
632
+            box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.14);
633
+            border: 2px solid rgba(255, 255, 255, 1);
592 634
           }
593 635
         }
594 636
 
@@ -604,8 +646,8 @@
604 646
     .more-btn {
605 647
       width: 100%;
606 648
       padding: 30px 0;
607
-      background:rgba(248,248,248,1);
608
-      border-radius:12px;
649
+      background: rgba(248, 248, 248, 1);
650
+      border-radius: 12px;
609 651
       text-align: center;
610 652
       font-weight: 500;
611 653
       color: $primary-color;
@@ -784,12 +826,12 @@
784 826
       .house__img-info {
785 827
         padding: 70px 30px 80px 30px;
786 828
         border-bottom: 1px solid rgba(232, 232, 232, 1);
787
-        
829
+
788 830
 
789 831
         .house__img {
790 832
           width: 100%;
791 833
           border-radius: 10px;
792
-          height: 200px!important;
834
+          height: 200px !important;
793 835
         }
794 836
       }
795 837
 
@@ -806,36 +848,36 @@
806 848
       //   font-size: 20px;
807 849
       //   border-radius: 20px;
808 850
       // }
809
-      .rest-info{
810
-        padding: 10px  26px 20px 26px;
811
-       
812
-      .house-type__name {
813
-        font-weight: bold;
814
-        margin: 10px 0;
815
-        font-size: 32px;
816
-      }
851
+      .rest-info {
852
+        padding: 10px 26px 20px 26px;
817 853
 
818
-      .house-type__price {
819
-        color: #000;
820
-        margin-bottom: 10px;
854
+        .house-type__name {
855
+          font-weight: bold;
856
+          margin: 10px 0;
857
+          font-size: 32px;
858
+        }
859
+
860
+        .house-type__price {
861
+          color: #000;
862
+          margin-bottom: 10px;
821 863
 
822
-        .price__txt {
823
-          color: #f00;
824
-          font-size: 35px;
864
+          .price__txt {
865
+            color: #f00;
866
+            font-size: 35px;
867
+          }
825 868
         }
826
-      }
827 869
 
828
-      .construction__area {
829
-        color: rgba(0, 0, 0, 0.54);
830
-        font-size: 25px;
831
-        height: 80px;
832
-        display: flex;
833
-        flex-direction: column;
834
-        font-size: 28px;
835
-        text-align: left;
870
+        .construction__area {
871
+          color: rgba(0, 0, 0, 0.54);
872
+          font-size: 25px;
873
+          height: 80px;
874
+          display: flex;
875
+          flex-direction: column;
876
+          font-size: 28px;
877
+          text-align: left;
836 878
 
879
+        }
837 880
       }
838
-    }
839 881
 
840 882
       .house-type__label {
841 883
         color: #757575;
@@ -850,7 +892,7 @@
850 892
         color: #fff;
851 893
         background: $primary-color;
852 894
         padding: 10px 36px;
853
-        border-radius:  16px 0 14px 0;
895
+        border-radius: 16px 0 14px 0;
854 896
         font-size: 24px;
855 897
       }
856 898
     }