周立森 пре 5 година
родитељ
комит
4970cc9e38

+ 19
- 0
src/app.scss Прегледај датотеку

@@ -39,4 +39,23 @@
39 39
     transform: translateY(0);
40 40
     opacity: 1;
41 41
   }
42
+}
43
+.at-progress{
44
+  display: flex;
45
+  align-items: center;
46
+  margin-top:20px;
47
+  .at-progress__outer{
48
+    width: 480px;
49
+    background-color: #f5f5f5;
50
+    border-radius:8px;
51
+    height: 12px;
52
+    margin-right: 20px;
53
+    .at-progress__outer-inner-background{
54
+      border-radius:8px;
55
+    }
56
+    .at-progress__content{
57
+      font-size: 32px;
58
+      color: #666;
59
+    }
60
+  }
42 61
 }

+ 0
- 166
src/components/AddChart.js Прегледај датотеку

@@ -1,166 +0,0 @@
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
-}

+ 1
- 60
src/components/BackHomeBtn/index.js Прегледај датотеку

@@ -8,73 +8,14 @@ export default class Index extends Component {
8 8
   static defaultProps = {
9 9
     style: {}
10 10
   }
11
-  state ={
12
-    buttonTop: 0,
13
-    buttonLeft: 0,
14
-    windowHeight: '',
15
-    windowWidth: ''
16
-  }
17
-  componentDidShow(){
18
-    Taro.getSystemInfo({
19
-      success: function (res) {
20
-        console.log(res,"9999999999999")
21
-        realWindowWidth = res.windowWidth
22
-        realWindowHeight = res.windowHeight
23
-      }
24
-    })
25
-  
26
-  }
27
-
28 11
   handleClick() {
29 12
     Taro.switchTab({
30 13
       url: `/pages/project/index`
31 14
     })
32 15
   }
33
-  buttonStart=(e)=> {
34
-    console.log(e,"eeeeeeeeeeeee")
35
-    startPoint = e.touches[0]
36
-  }
37
-  buttonMove=(e)=> {
38
-    console.log(e,"888888888888888")
39
-    var endPoint = e.touches[e.touches.length - 1]
40
-    var translateX = endPoint.clientX - startPoint.clientX
41
-    var translateY = endPoint.clientY - startPoint.clientY
42
-    startPoint = endPoint
43
-    var buttonTop = this.state.buttonTop + translateY
44
-    var buttonLeft = this.state.buttonLeft + translateX
45
-    //判断是移动否超出屏幕
46
-    if (buttonLeft+50 >= this.state.windowWidth){
47
-      buttonLeft = this.state.windowWidth-50;
48
-    }
49
-    if (buttonLeft<=0){
50
-      buttonLeft=0;
51
-    }
52
-    if (buttonTop<=0){
53
-      buttonTop=0
54
-    }
55
-    if (buttonTop + 50 >= this.state.windowHeight){
56
-      buttonTop = this.state.windowHeight-50;
57
-    }
58
-    this.setState({
59
-      buttonTop: buttonTop,
60
-      buttonLeft: buttonLeft
61
-    })
62
-  }
63
-  buttonEnd=(e)=> {
64
-
65
-  }
66
-
67 16
   render() {
68 17
     return (
69
-      // <View className="back-home" style={this.props.style} onClick={this.handleClick}  >
70
-      //   <Image src={require('@assets/homeicon.png')} className='home-img'></Image>
71
-      //   <Text className="text">首页</Text>
72
-      // </View>
73
-      <View className="back-home"
74
-       style={this.props.style} 
75
-       style='top:{this.state.buttonTop}px;left:{this.state.buttonLeft}px'
76
-       onClick={this.handleClick} ontouchmove={this.buttonMove} ontouchstart={this.buttonStart} ontouchend={this.buttonEnd} >
77
-        {/* <Text className="iconfont icon-shouyeshouye"></Text> */}
18
+      <View className="back-home" style={this.props.style} onClick={this.handleClick}  >
78 19
         <Image src={require('@assets/homeicon.png')} className='home-img'></Image>
79 20
         <Text className="text">首页</Text>
80 21
       </View>

+ 0
- 74
src/components/LineChart.js Прегледај датотеку

@@ -1,74 +0,0 @@
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
-}

+ 0
- 90
src/components/MoveChart.js Прегледај датотеку

@@ -1,90 +0,0 @@
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
-}

+ 94
- 0
src/components/charts/Line.js Прегледај датотеку

@@ -0,0 +1,94 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import echarts from '../ec-canvas/echarts'
3
+import './style.scss'
4
+
5
+function initChart(callback, options) {
6
+  return function (canvas, width, height) {
7
+    const chart = echarts.init(canvas, null, {
8
+      width: width,
9
+      height: height
10
+    });
11
+    canvas.setChart(chart);
12
+    chart.setOption(options);
13
+    callback && callback(chart);
14
+    return chart;
15
+  }
16
+}
17
+
18
+/**
19
+ * 传入 source 的格式为 [{ name: xxx, value: xxx }, {}]
20
+ */
21
+export default class LineChart extends Component {
22
+  config = {
23
+    usingComponents: {
24
+      "ec-canvas": "../ec-canvas/ec-canvas"
25
+    }
26
+  }
27
+
28
+  // this.echart
29
+  echart = null
30
+  ecComponent = null
31
+
32
+  state = {
33
+    ec: { lazyLoad: true },
34
+  }
35
+
36
+  // 禁止 props 变更时渲染
37
+  shouldComponentUpdate(nextProps) {
38
+    if (nextProps.source && nextProps.source.length) {
39
+      this.refreshChart(this.props.source)
40
+    }
41
+
42
+    return false
43
+  }
44
+
45
+  handleEcComponent (ref) {
46
+    this.ecComponent = ref
47
+  }
48
+
49
+  handleChart(chart) {
50
+    this.echart = chart
51
+  }
52
+
53
+  createOptions(source = []) {
54
+    const defaultOpt = {
55
+      color: ['#BB9C79', '#666666'],
56
+      xAxis: { type: 'category' },
57
+      yAxis: { type: 'value' },
58
+      series: [],
59
+    }
60
+
61
+    return {
62
+      ...defaultOpt,
63
+      dataset: { source },
64
+      series: [{
65
+        type: 'line',
66
+        areaStyle: {},
67
+        dimensions: ['name', 'value'],
68
+      }],
69
+    }
70
+  }
71
+
72
+  refreshChart(source) {    
73
+    const options = this.createOptions(source)
74
+
75
+    if (!this.echart) {
76
+      if (this.ecComponent) {
77
+        const initFunc = initChart(this.handleChart.bind(this), options)
78
+        this.ecComponent.init(initFunc)
79
+      } else {
80
+        console.warn('echart componet not ready')
81
+      }
82
+    } else {
83
+      this.echart.setOption(options)
84
+    }
85
+  }
86
+
87
+  render() {
88
+    return (
89
+      <View className="map-container">
90
+        <ec-canvas ref={this.handleEcComponent} ec={this.state.ec}></ec-canvas>
91
+      </View>
92
+    )
93
+  }
94
+}

+ 19
- 0
src/components/charts/style.scss Прегледај датотеку

@@ -0,0 +1,19 @@
1
+.map-container {
2
+  position: absolute;
3
+  top: 0;
4
+  bottom: 0;
5
+  left: 1vw;
6
+  right: 0;
7
+  width:98vw;
8
+  height:600px;
9
+  display: flex;
10
+  flex-direction: column;
11
+  align-items: center;
12
+  justify-content: space-between;
13
+  box-sizing: border-box;
14
+
15
+  ec-canvas {
16
+    width: 100%;
17
+    height: 100%;
18
+  }
19
+}

+ 11
- 8
src/components/ec-canvas/ec-canvas.js Прегледај датотеку

@@ -82,41 +82,44 @@ Component({
82 82
     touchStart(e) {
83 83
       if (this.chart && e.touches.length > 0) {
84 84
         var touch = e.touches[0];
85
-        this.chart._zr.handler.dispatch('mousedown', {
85
+        var handler = this.chart.getZr().handler;
86
+        handler.dispatch('mousedown', {
86 87
           zrX: touch.x,
87 88
           zrY: touch.y
88 89
         });
89
-        this.chart._zr.handler.dispatch('mousemove', {
90
+        handler.dispatch('mousemove', {
90 91
           zrX: touch.x,
91 92
           zrY: touch.y
92 93
         });
93
-        this.chart._zr.handler.proxy.processGesture(wrapTouch(e), 'start');
94
+        handler.processGesture(wrapTouch(e), 'start');
94 95
       }
95 96
     },
96 97
 
97 98
     touchMove(e) {
98 99
       if (this.chart && e.touches.length > 0) {
99 100
         var touch = e.touches[0];
100
-        this.chart._zr.handler.dispatch('mousemove', {
101
+        var handler = this.chart.getZr().handler;
102
+        handler.dispatch('mousemove', {
101 103
           zrX: touch.x,
102 104
           zrY: touch.y
103 105
         });
104
-        this.chart._zr.handler.proxy.processGesture(wrapTouch(e), 'change');
106
+        handler.processGesture(wrapTouch(e), 'change');
105 107
       }
106 108
     },
107 109
 
108 110
     touchEnd(e) {
109 111
       if (this.chart) {
110 112
         const touch = e.changedTouches ? e.changedTouches[0] : {};
111
-        this.chart._zr.handler.dispatch('mouseup', {
113
+        var handler = this.chart.getZr().handler;
114
+        handler.dispatch('mouseup', {
112 115
           zrX: touch.x,
113 116
           zrY: touch.y
114 117
         });
115
-        this.chart._zr.handler.dispatch('click', {
118
+        handler.dispatch('click', {
116 119
           zrX: touch.x,
117 120
           zrY: touch.y
118 121
         });
119
-        this.chart._zr.handler.proxy.processGesture(wrapTouch(e), 'end');
122
+        handler.processGesture(wrapTouch(e), 'end');
120 123
       }
121 124
     }
122 125
   }

+ 37409
- 1
src/components/ec-canvas/echarts.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 1
- 1
src/components/ec-canvas/wx-canvas.js Прегледај датотеку

@@ -87,7 +87,7 @@ export default class WxCanvas {
87 87
     eventNames.forEach(name => {
88 88
       this.event[name.wxName] = e => {
89 89
         const touch = e.touches[0];
90
-        this.chart._zr.handler.dispatch(name.ecName, {
90
+        this.chart.getZr().handler.dispatch(name.ecName, {
91 91
           zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
92 92
           zrY: name.wxName === 'tap' ? touch.clientY : touch.y
93 93
         });

+ 20
- 43
src/components/formIdCollector/index.js Прегледај датотеку

@@ -15,6 +15,10 @@ import { postFormId } from '@services/card'
15 15
  * ```
16 16
  */
17 17
 export default class Index extends Component {
18
+  static options = {
19
+    addGlobalClass: true,
20
+  };
21
+  
18 22
   static defaultProps = {
19 23
     count: 7,
20 24
     disabled: false,
@@ -26,55 +30,28 @@ export default class Index extends Component {
26 30
   }
27 31
 
28 32
   handleCollect = e => {
29
-    let { formIds } = this.state
30
-    const { onCollect, count } = this.props
31
-    formIds.push(e.detail.formId)
32
-    if (formIds.length === count) {
33
-      onCollect(formIds.slice())
34
-
35
-      // 发送到服务器
36
-      postFormId({ formids: formIds })
37
-      formIds = []
38
-    }
39
-    this.setState({
40
-      formIds
41
-    })
33
+    // 发送到服务器
34
+    postFormId({ formids: [e.detail.formId] })
42 35
   }
43 36
 
44 37
   render() {
45
-    const { count, disabled } = this.props
46
-    const finalCount = Math.min(count, 7)
38
+    const { disabled } = this.props
47 39
 
48
-    return (disabled || finalCount === 0) ? this.props.children : (
40
+    return disabled ? this.props.children : (
49 41
       <Block>
50
-        <Label for='button_6'>
51
-          <Label for='button_5'>
52
-            <Label for='button_4'>
53
-              <Label for='button_3'>
54
-                <Label for='button_2'>
55
-                  <Label for='button_1'>
56
-                    <Label for='button_0'>
57
-                      {this.props.children}
58
-                    </Label>
59
-                  </Label>
60
-                </Label>
61
-              </Label>
62
-            </Label>
63
-          </Label>
42
+        <Label for='button_0'>
43
+          {this.props.children}
64 44
         </Label>
65
-        {[1,2,3,4].map(i => (
66
-          <Form
67
-            key={i}
68
-            className='m-form-id-collector_form'
69
-            reportSubmit={true}
70
-            onSubmit={this.handleCollect}>
71
-            <Button
72
-              id={`button_${i}`}
73
-              formType='submit'
74
-            />
75
-          </Form>
76
-        ))}
45
+        <Form
46
+          className='m-form-id-collector_form'
47
+          reportSubmit={true}
48
+          onSubmit={this.handleCollect}>
49
+          <Button
50
+            id={`button_0`}
51
+            formType='submit'
52
+          />
53
+        </Form>
77 54
       </Block>
78 55
     )
79 56
   }
80
-}
57
+}

+ 1
- 0
src/constants/api.js Прегледај датотеку

@@ -174,3 +174,4 @@ export const API_CUSTOMER_DETAIL = resolvePath('inventory/customer')
174 174
 export const API_VISIT_RECORD = resolvePath('taPersonVisitRecord')
175 175
 export const API_ACTIVITY_LIST_CUSTOMER = resolvePath('customer/activity/list')
176 176
 export const API_FOLLOW_LIST = resolvePath('taCustomerFollowUpRecord')
177
+export const API_SEX_INFO = resolvePath('genderStatistic')

+ 0
- 30
src/pages/Line/Line.js Прегледај датотеку

@@ -1,30 +0,0 @@
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
-}

+ 0
- 4
src/pages/Line/index.scss Прегледај датотеку

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

+ 0
- 40
src/pages/More/More.js Прегледај датотеку

@@ -1,40 +0,0 @@
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
-}

+ 0
- 7
src/pages/More/index.scss Прегледај датотеку

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

+ 3
- 2
src/pages/activity/activity.js Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import Authorize from '@components/authorize'
3
+import FormIdCollector from '@components/formIdCollector'
3 4
 import './index.scss'
4 5
 import { AtTabs, AtTabsPane } from 'taro-ui'
5 6
 import "taro-ui/dist/style/components/tabs.scss"
@@ -61,9 +62,9 @@ export default class active extends Component {
61 62
       <View style="height:100vh">
62 63
         <AtTabs className="tab-box" scroll current={this.state.current} tabList={[{ title: '热门活动' }, { title: '最新资讯' }]} onClick={this.handleClick.bind(this)}>
63 64
           <AtTabsPane current={this.state.current} index={0} >
64
-            <View >
65
+            <FormIdCollector>
65 66
               <Activity ></Activity >
66
-            </View>
67
+            </FormIdCollector>
67 68
           </AtTabsPane>
68 69
           <AtTabsPane current={this.state.current} index={1}>
69 70
             <View >

+ 14
- 5
src/pages/activity/detail/assemble.js Прегледај датотеку

@@ -4,6 +4,7 @@ import Notice from '@components/Notice'
4 4
 import BackHomeBtn from '@components/BackHomeBtn'
5 5
 import AchievePhone from '@components/achievePhone'
6 6
 import Poster from '@components/Poster'
7
+import FormIdCollector from '@components/formIdCollector'
7 8
 import dayjs from 'dayjs'
8 9
 // import WxParse from '@components/wxParse/wxParse'
9 10
 // import getUserPhone from '@utils/getUserPhone'
@@ -617,16 +618,20 @@ export default class Detail extends Component {
617 618
                 <View className="btn-fixed">
618 619
                   {
619 620
                     actState === ActBeforeStart &&
620
-                    (<Button className="nostart-btn" style="margin: auto">未开始</Button>)
621
+                    (<View className="nostart-btn"><FormIdCollector><Button className="nostart-btn" style="margin: auto">未开始</Button></FormIdCollector></View>)
621 622
                   }
622 623
                   {
623 624
                     isStarter && actState === ActInProcess && groupState === GroupInProcess &&
624
-                    (<Button className="assistance-btn" style="margin: auto" onClick={this.groupBuyInvite}>邀请好友拼团</Button>)
625
+                    (<View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" style="margin: auto" onClick={this.groupBuyInvite}>邀请好友拼团</Button></FormIdCollector></View>)
625 626
                   }
626 627
                   {
627 628
                     !isStarter && actState === ActInProcess && groupState != GroupInProcess &&
628 629
 
629
-                    <Button className={groupState === GroupInProcess ? "set-btn" : "assistance-btn"} onClick={this.startMine}>发起我的拼团</Button>
630
+                    <View className={groupState === GroupInProcess ? "set-btn" : "assistance-btn"}>
631
+                      <FormIdCollector>
632
+                        <Button className={groupState === GroupInProcess ? "set-btn" : "assistance-btn"} onClick={this.startMine}>发起我的拼团</Button>
633
+                      </FormIdCollector>
634
+                    </View>
630 635
                   }
631 636
                   {
632 637
                     !isStarter && actState === ActInProcess && groupState === GroupInProcess &&
@@ -634,9 +639,13 @@ export default class Detail extends Component {
634 639
                     <View className="btn-box" style="margin: auto; padding: 0;">
635 640
                       {
636 641
                         (groupState === GroupInProcess && !isJoin) &&
637
-                        (<Button className="assistance-btn" onClick={this.joinGroup}>立即参团</Button>)
642
+                        (<View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.joinGroup}>立即参团</Button></FormIdCollector></View>)
638 643
                       }                      
639
-                      <Button className={groupState === GroupInProcess && !isJoin ? "set-btn" : "assistance-btn"} onClick={this.startMine}>发起我的拼团</Button>
644
+                      <View className={groupState === GroupInProcess && !isJoin ? "set-btn" : "assistance-btn"}>
645
+                        <FormIdCollector>
646
+                          <Button className={groupState === GroupInProcess && !isJoin ? "set-btn" : "assistance-btn"} onClick={this.startMine}>发起我的拼团</Button>
647
+                        </FormIdCollector>
648
+                      </View>
640 649
                     </View>
641 650
 
642 651
                   }

+ 9
- 4
src/pages/activity/detail/assistance.js Прегледај датотеку

@@ -4,6 +4,7 @@ import Notice from '@components/Notice'
4 4
 import BackHomeBtn from '@components/BackHomeBtn'
5 5
 import AchievePhone from '@components/achievePhone'
6 6
 import Poster from '@components/Poster'
7
+import FormIdCollector from '@components/formIdCollector'
7 8
 import dayjs from 'dayjs'
8 9
 // import WxParse from '@components/wxParse/wxParse'
9 10
 // import getUserPhone from '@utils/getUserPhone'
@@ -589,11 +590,11 @@ export default class Detail extends Component {
589 590
                 <View style="display:flex;justify-content: space-between;padding:0 15px">
590 591
                   {
591 592
                     actState === ActBeforeStart &&
592
-                    (<Button className="nostart-btn">未开始</Button>)
593
+                    (<View className="nostart-btn"><FormIdCollector><Button className="nostart-btn">未开始</Button></FormIdCollector></View>)
593 594
                   }
594 595
                   {
595 596
                     isStarter && actState === ActInProcess && helpState === HelpInProcess &&
596
-                    (<Button className="assistance-btn" onClick={this.askForHelp}>邀请好友助力</Button>)
597
+                    (<View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.askForHelp}>邀请好友助力</Button></FormIdCollector></View>)
597 598
                   }
598 599
                   {
599 600
                     !isStarter && actState === ActInProcess &&
@@ -603,9 +604,13 @@ export default class Detail extends Component {
603 604
 
604 605
                         {
605 606
                           (helpState === HelpInProcess && !isJoin) &&
606
-                          (<Button className="assistance-btn" onClick={this.handleHelp}>立即助力好友</Button>)
607
+                          (<View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.handleHelp}>立即助力好友</Button></FormIdCollector></View>)
607 608
                         }
608
-                        <Button className={(helpState === HelpInProcess && !isJoin) ? "set-btn" : "assistance-btn"} onClick={this.startMine}>发起我的助力</Button>
609
+                        <View className={(helpState === HelpInProcess && !isJoin) ? "set-btn" : "assistance-btn"}>
610
+                          <FormIdCollector>
611
+                            <Button className={(helpState === HelpInProcess && !isJoin) ? "set-btn" : "assistance-btn"} onClick={this.startMine}>发起我的助力</Button>
612
+                          </FormIdCollector>
613
+                        </View>
609 614
                       </View>
610 615
                     )
611 616
                   }

+ 87
- 10
src/pages/person/customerAnalysis/analysis.js Прегледај датотеку

@@ -1,14 +1,14 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import Authorize from '@components/authorize'
3 3
 import { View } from "@tarojs/components";
4
-// import MoveChart from '../../More/More'
5
-// import LineChart from '../../components/LineChart'
6 4
 import './index.scss'
7 5
 import { AtTabs, AtTabsPane, AtProgress } from 'taro-ui'
8 6
 import "taro-ui/dist/style/components/tabs.scss"
9 7
 import "taro-ui/dist/style/components/progress.scss";
10 8
 import { savePoint, updatePoint } from '@services/common'
9
+import { querySexInfo } from '@services/person'
11 10
 import { connect } from '@tarojs/redux'
11
+import LineChart from "../../../components/charts/Line";
12 12
 
13 13
 
14 14
 @connect(({ user, city }) => ({ user, city }))
@@ -21,6 +21,16 @@ export default class analysis extends Taro.Component {
21 21
   state = {
22 22
     current: 0,
23 23
     recordId: undefined, // 埋点ID
24
+    sexInfo: [],
25
+    chartInfo: [
26
+      { name: '周一', value: '26' },
27
+      { name: '周二', value: '84' },
28
+      { name: '周三', value: '107' },
29
+      { name: '周四', value: '93' },
30
+      { name: '周五', value: '127' },
31
+      { name: '周六', value: '64' },
32
+      { name: '周日', value: '94' },
33
+    ]
24 34
   }
25 35
 
26 36
   componentWillUnmount() {
@@ -29,33 +39,100 @@ export default class analysis extends Taro.Component {
29 39
   }
30 40
 
31 41
   handleClick(value) {
42
+    if (value == '0') {
43
+      querySexInfo('new').then(res => {
44
+        this.setState({
45
+          sexInfo: res || []
46
+        })
47
+      })
48
+    } else if (value == '1') {
49
+      querySexInfo('follow').then(res => {
50
+        this.setState({
51
+          sexInfo: res || []
52
+        })
53
+      })
54
+    } else {
55
+      querySexInfo('visite ').then(res => {
56
+        this.setState({
57
+          sexInfo: res || []
58
+        })
59
+      })
60
+    }
61
+
32 62
     this.setState({
33 63
       current: value
34
-    }, )
64
+    })
65
+
35 66
   }
36 67
 
68
+  componentDidMount() {
69
+    querySexInfo('new').then(res => {
70
+      this.setState({
71
+        sexInfo: res || []
72
+      })
73
+    })
74
+    const chartData = [
75
+      { value: 335, name: '直接访问' },
76
+      { value: 310, name: '邮件营销' },
77
+      { value: 234, name: '联盟广告' },
78
+      { value: 135, name: '视频广告' },
79
+      { value: 1548, name: '搜索引擎' }
80
+    ];
81
+
82
+  }
37 83
 
38 84
   render() {
39 85
 
40 86
     const tabList = [{ title: '新增客户' }, { title: '跟进客户' }, { title: '到访客户' }]
87
+    const { sexInfo, chartInfo } = this.state
41 88
 
42 89
     return (
43 90
       <View>
44 91
         <AtTabs className="tab-bar" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
45 92
           <AtTabsPane current={this.state.current} index={0} >
46 93
             <View>
47
-              {/* <MoveChart/> */}
48
-              {/* <View className="sex-box">
49
-                <View className="sex">性别</View>
50
-                <AtProgress percent={25} strokeWidth={6} color='#FF4949' />
51
-              </View> */}
94
+              <View style="width:90vw;height:600rpx">
95
+                <LineChart source={chartInfo} />
96
+              </View>
97
+
98
+              <View style="height:20rpx;background:#f5f5f5;"> </View>
99
+              <View style="padding: 40rpx;">
100
+                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
101
+                {
102
+                  sexInfo.map((item, index) => (
103
+                    <View key={index + 'sex3'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
104
+                  ))
105
+                }
106
+              </View>
52 107
             </View>
53 108
           </AtTabsPane>
54 109
           <AtTabsPane current={this.state.current} index={1}>
55
-            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;'>标签页二的内容</View>
110
+            <View>
111
+              <LineChart />
112
+              <View style="height:20rpx;background:#f5f5f5;"> </View>
113
+              <View style="padding: 40rpx;">
114
+                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
115
+                {
116
+                  sexInfo.map((item, index) => (
117
+                    <View key={index + 'sex3'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
118
+                  ))
119
+                }
120
+              </View>
121
+            </View>
56 122
           </AtTabsPane>
57 123
           <AtTabsPane current={this.state.current} index={2}>
58
-            <View style='padding: 100px 50px;background-color: #FAFBFC;text-align: center;'>标签页三的内容</View>
124
+            <View>
125
+              <LineChart />
126
+              <View style="height:20rpx;background:#f5f5f5;"> </View>
127
+              <View style="padding: 40rpx;">
128
+                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
129
+                {
130
+                  sexInfo.map((item, index) => (
131
+                    <View key={index + 'sex3'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
132
+                  ))
133
+                }
134
+              </View>
135
+            </View>
59 136
           </AtTabsPane>
60 137
         </AtTabs>
61 138
       </View>

+ 113
- 48
src/pages/person/customerAnalysis/followUpCustomer/index.js Прегледај датотеку

@@ -1,10 +1,11 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import Authorize from '@components/authorize'
3
+import ListView from '@components/ListView'
3 4
 import './index.scss'
4 5
 import { savePoint, updatePoint } from '@services/common'
5 6
 import { connect } from '@tarojs/redux'
6 7
 import { View, Text, Picker } from '@tarojs/components';
7
-import { queryCustomerList } from '@services/person'
8
+import { queryCustomerList, addFollowRecord } from '@services/person'
8 9
 const iconImg = require('@assets/person/icon.png')
9 10
 
10 11
 @connect(({ user, city }) => ({ user, city }))
@@ -24,8 +25,11 @@ export default class transactionCustomer extends Taro.Component {
24 25
     statusIndex: -1,
25 26
     startArrivalDate: '',
26 27
     endArrivalDate: '',
27
-    startReportDate : '',
28
+    startReportDate: '',
28 29
     endReportDate: '',
30
+    hasMore: true,
31
+    isEmpty: false,
32
+    pageIndex: 1
29 33
   }
30 34
 
31 35
   componentWillUnmount() {
@@ -34,47 +38,68 @@ export default class transactionCustomer extends Taro.Component {
34 38
   }
35 39
   componentDidShow() {
36 40
     Taro.showLoading()
37
-    this.loadList()
41
+    this.loadList(1)
38 42
 
39 43
   }
40
-  loadList() {
44
+
45
+  loadList(pageNumber) {
41 46
     const payload = {
42 47
       type: 'follow',
43
-      pageNumber: 0,
44
-      pageSize: 9999
48
+      pageNumber,
49
+      pageSize: 10
45 50
     }
46 51
     queryCustomerList(payload.type, payload).then(res => {
47
-
52
+      const { records, list, total, current, pages } = res || {}
53
+      const _list = records || list || []
54
+      const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
48 55
       this.setState({
49
-        customerList: res.records || []
56
+        customerList: newList,
57
+        isEmpty: total == 0,
58
+        hasMore: current < pages,
59
+        pageIndex: current >= pages ? pages : current
50 60
       })
51 61
       Taro.hideLoading()
52 62
     })
53 63
   }
54 64
 
65
+  onScrollToLower = async (fn) => {
66
+    const { pageIndex } = this.state;
67
+    this.loadList(pageIndex + 1)
68
+    fn && fn();
69
+  }
70
+  onPullDownRefresh = (rest) => {
71
+    // debugger
72
+    if (this.refreshing) return
73
+    this.refreshing = true
74
+    this.loadList(1)
75
+    rest && rest()
76
+    this.refreshing = false
77
+  }
78
+
55 79
 
56 80
   changeInput = e => {
57 81
     this.setState({
58 82
       inputValue: e.detail.value
59 83
     })
60 84
   }
85
+  // 查询
61 86
   searchBtn() {
62
-    // const playload = {
63
-    //   inputValue: this.state.inputValue
64
-    // }
87
+
65 88
     this.filterCustomerList();
66
-   
89
+
67 90
   }
68
-  filterCustomerList(){
91
+  // 筛查跟进客户
92
+  filterCustomerList() {
69 93
 
70 94
     const payload = {
71 95
       type: 'follow',
72 96
       pageNumber: 0,
73 97
       pageSize: 9999,
74
-      status:this.state.statusIndex!=0?this.state.statusIndex:'',
75
-      startArrivalDate:this.state.startArrivalDate,
98
+      name: this.state.inputValue,
99
+      status: (this.state.statusIndex == 0 || this.state.statusIndex == -1) ? '' : this.state.statusIndex,
100
+      startArrivalDate: this.state.startArrivalDate,
76 101
       endArrivalDate: this.state.endArrivalDate,
77
-      startReportDate : this.state.startReportDate,
102
+      startReportDate: this.state.startReportDate,
78 103
       endReportDate: this.state.endReportDate,
79 104
     }
80 105
     queryCustomerList(payload.type, payload).then(res => {
@@ -91,55 +116,80 @@ export default class transactionCustomer extends Taro.Component {
91 116
       screenVisible: false,
92 117
     })
93 118
   }
119
+  // 显示筛查弹框
94 120
   screenShow() {
95 121
     this.setState({
96 122
       screenVisible: true,
97 123
     })
98 124
   }
125
+  // 选择状态
99 126
   chooseStatus(item, inx) {
100 127
     this.setState({
101 128
       statusIndex: inx,
102 129
     })
103
-    console.log(item, inx, "eeeeeeeeeeee")
104 130
   }
131
+  // 到访开始时间
105 132
   onVisitDateChange = e => {
106 133
     this.setState({
107 134
       startArrivalDate: e.detail.value
108 135
     })
109 136
   }
137
+  // 到访结束时间
110 138
   onVisitDateChange2 = e => {
111 139
     this.setState({
112 140
       endArrivalDate: e.detail.value
113 141
     })
114 142
   }
143
+  // 报备开始时间
115 144
   onReportDateChange = e => {
116 145
     this.setState({
117
-      startReportDate : e.detail.value
146
+      startReportDate: e.detail.value
118 147
     })
119 148
   }
149
+  // 报备结束时间
120 150
   onReportDateChange2 = e => {
121 151
     this.setState({
122 152
       endReportDate: e.detail.value
123 153
     })
124 154
   }
125
- 
155
+  // 取消筛查
126 156
   cancelBtn() {
127 157
     this.setState({
128 158
       screenVisible: false,
129 159
       statusIndex: -1,
130 160
       startArrivalDate: '',
131 161
       endArrivalDate: '',
132
-      startReportDate : '',
162
+      startReportDate: '',
133 163
       endReportDate: '',
134 164
     })
135 165
   }
166
+  // 跳转我的客户详情
136 167
   toMyCustomer(customerId) {
137 168
     Taro.navigateTo({
138
-      url: `/pages/person/customerAnalysis/myCustomer?customerId=`+customerId
169
+      url: `/pages/person/customerAnalysis/myCustomer?customerId=` + customerId
139 170
     })
140 171
   }
172
+  // 拨打电话
173
+  handleTelClick(item, e) {
174
+    e.stopPropagation()
175
+    Taro.makePhoneCall({
176
+      phoneNumber: item.phone
177
+    })
178
+    const params = {
179
+      recordType: '拨打电话',
180
+      customerSex: item.sex,
181
+      customerId: item.customerId,
182
+    }
183
+    addFollowRecord(params).then(res => {
184
+
185
+    })
186
+    this.setState({
187
+      followVisible: false,
188
+    })
189
+  }
190
+
141 191
   renderScreenBox() {
142
-    const { statusList, statusIndex, startArrivalDate, endArrivalDate, startReportDate , endReportDate } = this.state
192
+    const { statusList, statusIndex, startArrivalDate, endArrivalDate, startReportDate, endReportDate } = this.state
143 193
     return (
144 194
       <View className="mask">
145 195
         <View className="content">
@@ -169,8 +219,8 @@ export default class transactionCustomer extends Taro.Component {
169 219
             报备时间:
170 220
               <Picker mode='date' onChange={this.onReportDateChange}>
171 221
               <View className='picker'>
172
-                {startReportDate }
173
-                {!startReportDate  && <Text className="placeholder">起始时间</Text>}
222
+                {startReportDate}
223
+                {!startReportDate && <Text className="placeholder">起始时间</Text>}
174 224
               </View>
175 225
             </Picker>-<Picker mode='date' onChange={this.onReportDateChange2}>
176 226
               <View className='picker'>
@@ -195,7 +245,7 @@ export default class transactionCustomer extends Taro.Component {
195 245
   }
196 246
 
197 247
   render() {
198
-    const { customerList, screenVisible } = this.state
248
+    const { customerList, screenVisible, isEmpty, hasMore } = this.state
199 249
 
200 250
     return (
201 251
       <View>
@@ -208,29 +258,44 @@ export default class transactionCustomer extends Taro.Component {
208 258
           <Button className="btn" onClick={this.searchBtn} >搜索</Button>
209 259
         </View>
210 260
         <View style="padding:10px">
211
-          {
212
-            !customerList.length &&
213
-            <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
214
-          }
215
-          {
216
-            customerList.length &&
217
-            customerList.map((item, index) => (
218
-              <View class="item" key={index + 'customerList'} onClick={this.toMyCustomer.bind(this,item.customerId)}>
219
-                <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
220
-                <View className="name">
221
-                  {item.name}
222
-                  {
223
-                    item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
224
-                  }
225
-                  {
226
-                    item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
227
-                  }
228
-                </View>
229
-                <View className="phone">{item.phone}<View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View> </View>
230
-                <View className="status">报备</View>
231
-              </View>
232
-            ))
233
-          }
261
+          <ListView
262
+            className="wrap"
263
+            needInit
264
+            isEmpty={isEmpty}
265
+            emptyText="暂无跟进客户~"
266
+            hasMore={hasMore}
267
+            onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
268
+            onScrollToLower={fn => this.onScrollToLower(fn)}
269
+          >
270
+            <View className="list">
271
+              {
272
+                !customerList.length &&
273
+                <View></View>
274
+                // <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
275
+              }
276
+              {
277
+                customerList.length &&
278
+                customerList.map((item, index) => (
279
+                  <View class="item" key={index + 'customerList'} onClick={this.toMyCustomer.bind(this, item.customerId)}>
280
+                    <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
281
+                    <View className="name">
282
+                      {item.name}
283
+                      {
284
+                        item.sex == '1' && <View style={`margin-left:20rpx;background-image: url(${iconImg});background-size: 100%;background-position: 0rpx -40rpx;width: 36rpx;height: 36rpx;`}></View>
285
+                      }
286
+                      {
287
+                        item.sex == '2' && <View style={`margin-left:20rpx;background-image: url(${iconImg});background-size: 100%;background-position: 0rpx 0px;width: 36rpx;height: 36rpx;`}></View>
288
+                      }
289
+                    </View>
290
+                    <View className="phone" onClick={this.handleTelClick.bind(this, item)}>{item.phone}<View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0rpx -88rpx;width: 44rpx;height: 44rpx;margin-left:10rpx`}></View> </View>
291
+                    <View className="status">报备</View>
292
+                  </View>
293
+                ))
294
+              }
295
+            </View>
296
+          </ListView>
297
+
298
+
234 299
         </View>
235 300
       </View>
236 301
     )

+ 42
- 23
src/pages/person/customerAnalysis/index.scss Прегледај датотеку

@@ -6,8 +6,6 @@
6 6
   height:100vh;
7 7
 }
8 8
 
9
-
10
-
11 9
 .tab-box{
12 10
   .at-tabs__header{
13 11
     width: 86%;
@@ -84,6 +82,22 @@
84 82
     }
85 83
   }
86 84
 }
85
+.empty{
86
+  width:100%;
87
+  height:40vh;
88
+  display: flex;
89
+  flex-direction: column;
90
+  justify-content: center;
91
+  align-items: center;
92
+  &__img{
93
+    width:300px;
94
+  }
95
+  &__text{
96
+    font-size:30px;
97
+    color: $text-color-light;
98
+    margin-top: 20px;
99
+  }
100
+}
87 101
 
88 102
 
89 103
 .user_con{
@@ -127,6 +141,8 @@
127 141
     position: absolute;
128 142
     bottom:76px;
129 143
     left:320px;
144
+    display: flex;
145
+    align-items: center;
130 146
   }
131 147
   }
132 148
   .my-tab{
@@ -185,22 +201,21 @@
185 201
 
186 202
     }
187 203
     .tab-pane2{
188
-      padding: 0 40px;
189
-      .date{
190
-        font-size: 26px;
191
-        color: #999;
192
-        margin-top: 30px;
193
-      }
204
+      padding: 10px 0;
194 205
       .record-item{
195
-        font-size: 30px;
196
-        margin-top: 20px;
197
-        color: #333;
198
-        display: flex;
199
-        align-items: center;
200
-        justify-content: space-between;
206
+        padding:0 30px;
207
+        background:rgba(255,255,255,1);
208
+        box-shadow:0px 1px 0px 0px rgba(0,0,0,0.08);
209
+        .title{
210
+          font-size: 30px;
211
+          color: #333;
212
+          margin-top: 20px;
213
+        }
201 214
         .time{
202 215
           font-size: 26px;
203 216
           color: #999;
217
+          text-align: right;
218
+          line-height: 46px;
204 219
         }
205 220
       }
206 221
     }
@@ -240,13 +255,13 @@
240 255
     background:rgba(0,0,0,0.22);
241 256
     .base-con{
242 257
       width: 94%;
243
-      height:610px;
258
+      height:740px;
244 259
       position: absolute;
245 260
       left: 3%;
246 261
       top: 50%;
247 262
       background-color: #fff;
248 263
       padding: 40px;
249
-      margin-top: -305px;
264
+      margin-top: -370px;
250 265
       border-radius:12px;
251 266
       .con-item{
252 267
         display: flex;
@@ -275,13 +290,21 @@
275 290
         align-items: center;
276 291
         justify-content: space-between;
277 292
         width:456px;
293
+        height:48px ;
294
+        line-height: 48px;
295
+        padding: 0 16px;
296
+        background-color: #f4f4f4;
297
+        .picker{
298
+          width: 400px;
299
+        }
278 300
       }
279 301
       .right-icon{
280
-        width:20px;
281
-        height:20px;
302
+        width:18px;
303
+        height:18px;
282 304
         border-top: 2px solid #999;
283 305
         border-right: 2px solid #999;
284 306
         transform:rotate(45deg);
307
+        float: right;
285 308
       }
286 309
       .bottom-btn{
287 310
         margin: 30px auto 0 auto;
@@ -360,10 +383,6 @@
360 383
           border-radius:12px;
361 384
           border:2px solid $primary-color;
362 385
         }
363
-      }
364
-      
386
+      } 
365 387
     }
366
-  
367
-  
368
-   
369 388
   }

+ 353
- 91
src/pages/person/customerAnalysis/myCustomer.js Прегледај датотеку

@@ -1,13 +1,15 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import { AtTabs, AtTabsPane } from 'taro-ui'
3
+import ListView from '@components/ListView'
3 4
 import "taro-ui/dist/style/components/tabs.scss"
4 5
 import { savePoint, updatePoint } from '@services/common'
5
-import { getCustomerDetail, getVisitRecord, getActivityList, getFollowRecord } from '@services/person'
6
+import { getCustomerDetail, getVisitRecord, getActivityList, getFollowRecord, addFollowRecord, commitCustomerInfo } from '@services/person'
6 7
 import { connect } from '@tarojs/redux'
7 8
 import './index.scss'
8 9
 import ActivityItem from './item'
9 10
 import dayjs from 'dayjs'
10 11
 const iconImg = require('@assets/person/icon.png')
12
+import emptyImg from '@assets/empty.png'
11 13
 
12 14
 @connect(({ user, city }) => ({ user, city }))
13 15
 export default class myCustomer extends Taro.Component {
@@ -22,13 +24,23 @@ export default class myCustomer extends Taro.Component {
22 24
     activityList: [],
23 25
     followVisible: false,
24 26
     baseVisible: false,
25
-    message: '', //跟进内容
27
+    followValue: '', //跟进内容
26 28
     desc: '', //客户描述
27
-    selectorChecked: '',
28
-    selector: ['美国', '中国', '巴西', '日本'],
29
+    selector: ['高层', '别墅', '公寓'],
30
+    sexSelector: ['男', '女'],
29 31
     customerDetail: {},
30
-    followRecord: []
31
-
32
+    followRecord: [],
33
+    visitRecord: [],
34
+    baseInfo: {}, // 完善信息弹框数据
35
+    hasMore: true,
36
+    isEmpty: false,
37
+    pageIndex: 1,
38
+    hasMore2: true,
39
+    isEmpty2: false,
40
+    pageIndex2: 1,
41
+    hasMore3: true,
42
+    isEmpty3: false,
43
+    pageIndex3: 1,
32 44
   }
33 45
 
34 46
   componentWillUnmount() {
@@ -38,53 +50,130 @@ export default class myCustomer extends Taro.Component {
38 50
   }
39 51
 
40 52
   handleClick(value) {
53
+    this.setState({
54
+      current: value
55
+    })
41 56
     if (value == 1) {
42
-      const { customerId } = this.$router.params
43
-      const payload = {
44
-        pageNumber: '0',
45
-        pageSize: '10',
46
-        customerId,
47
-      }
48
-      getVisitRecord(payload).then(res => {
49
-        // this.setState({
50
-        //   customerDetail: res || {}
51
-        // })
52
-      })
57
+      this.queryVisitRecord(1);
53 58
     } else if (value == 2) {
54
-      const { customerId } = this.$router.params
55
-      const payload = {
56
-        pageNumber: '0',
57
-        pageSize: '10',
58
-        customerId,
59
-      }
60
-      getActivityList(payload).then(res => {
61
-        this.setState({
62
-          activityList: res.records || []
63
-        })
64
-      })
59
+      this.queryActivityList(1);
65 60
     } else if (value == 3) {
66
-      const { customerId } = this.$router.params
67
-      const payload = {
68
-        pageNumber: '0',
69
-        pageSize: '10',
70
-        customerId,
71
-      }
72
-      getFollowRecord(payload).then(res => {
73
-        console.log(res.records,"res")
74
-        this.setState({
75
-          followRecord: res.records 
76
-        }, console.log(this.state.followRecord, "followRecord")
77
-        )
61
+      this.queryFollowRecord(1);
62
+    }
63
+  }
64
+  // 访问记录上拉加载下拉刷新
65
+  onScrollToLower = async (fn) => {
66
+    const { pageIndex } = this.state;
67
+    this.queryVisitRecord(pageIndex + 1)
68
+    fn && fn();
69
+  }
70
+  onPullDownRefresh = (rest) => {
71
+    // debugger
72
+    if (this.refreshing) return
73
+    this.refreshing = true
74
+    this.queryVisitRecord(1)
75
+    rest && rest()
76
+    this.refreshing = false
77
+  }
78
+  // 活动信息上拉加载下拉刷新
79
+  onScrollToLower2 = async (fn) => {
80
+    const { pageIndex2 } = this.state;
81
+    this.queryActivityList(pageIndex2 + 1)
82
+    fn && fn();
83
+  }
84
+  onPullDownRefresh2 = (rest) => {
85
+    // debugger
86
+    if (this.refreshing) return
87
+    this.refreshing = true
88
+    this.queryActivityList(1)
89
+    rest && rest()
90
+    this.refreshing = false
91
+  }
92
+  // 跟进记录上拉加载下拉刷新
93
+  onScrollToLower3 = async (fn) => {
94
+    const { pageIndex3 } = this.state;
95
+    this.queryFollowRecord(pageIndex3 + 1)
96
+    fn && fn();
97
+  }
98
+  onPullDownRefresh3 = (rest) => {
99
+    // debugger
100
+    if (this.refreshing) return
101
+    this.refreshing = true
102
+    this.queryFollowRecord(1)
103
+    rest && rest()
104
+    this.refreshing = false
105
+  }
106
+  // 获取访问记录
107
+  queryVisitRecord(pageNumber) {
108
+    const { customerId } = this.$router.params
109
+    const payload = {
110
+      pageNumber,
111
+      pageSize: '10',
112
+      customerId,
113
+    }
114
+    getVisitRecord(payload).then(res => {
115
+      const { records, list, total, current, pages } = res || {}
116
+      const _list = records || list || []
117
+      const newList = current <= 1 ? _list : this.state.visitRecord.concat(_list)
118
+      this.setState({
119
+        visitRecord: newList,
120
+        isEmpty: total == 0,
121
+        hasMore: current < pages,
122
+        pageIndex: current >= pages ? pages : current
123
+      })
124
+    })
125
+  }
126
+  // 获取活动信息
127
+  queryActivityList(pageNumber) {
128
+    const { customerId } = this.$router.params
129
+    const payload = {
130
+      pageNumber,
131
+      pageSize: '10',
132
+      customerId,
133
+    }
134
+    getActivityList(payload).then(res => {
135
+      const { records, list, total, current, pages } = res || {}
136
+      const _list = records || list || []
137
+      const newList = current <= 1 ? _list : this.state.activityList.concat(_list)
138
+      this.setState({
139
+        activityList: newList,
140
+        isEmpty2: total == 0,
141
+        hasMore2: current < pages,
142
+        pageIndex2: current >= pages ? pages : current
78 143
       })
144
+    })
145
+  }
146
+  // 获取跟进记录
147
+  queryFollowRecord(pageNumber) {
148
+    const { customerId } = this.$router.params
149
+    const payload = {
150
+      pageNumber,
151
+      pageSize: '10',
152
+      customerId,
79 153
     }
80
-    this.setState({
81
-      current: value
82
-    }, )
154
+    getFollowRecord(payload).then(res => {
155
+      const { records, list, total, current, pages } = res || {}
156
+      const _list = records || list || []
157
+      const newList = current <= 1 ? _list : this.state.followRecord.concat(_list)
158
+      this.setState({
159
+        followRecord: newList,
160
+        isEmpty3: total == 0,
161
+        hasMore3: current < pages,
162
+        pageIndex3: current >= pages ? pages : current
163
+      })
164
+    })
83 165
   }
84
-
85 166
   componentDidShow() {
86
-
87 167
     this.loadList()
168
+    // Taro.getSystemInfo({
169
+    //   success: function (res) {
170
+    //     console.log(res, "9999999999999")
171
+    //     this.setState({
172
+    //       tabHeight: res.screenHeight - 380 + 'px'
173
+    //     })
174
+    //   },
175
+    // })
176
+
88 177
   }
89 178
   loadList() {
90 179
     const { customerId } = this.$router.params
@@ -125,23 +214,44 @@ export default class myCustomer extends Taro.Component {
125 214
       followVisible: true,
126 215
     })
127 216
   }
128
-  saveBtn() {
217
+  followSaveBtn() {
218
+    const { customerId } = this.$router.params
219
+    const params = {
220
+      recordType: '添加跟进',
221
+      recordContent: this.state.followValue,
222
+      customerSex: this.state.customerDetail.sex,
223
+      customerId,
224
+    }
225
+    addFollowRecord(params).then(res => {
226
+      this.queryFollowRecord(1)
227
+      Taro.showToast({
228
+        title: '添加跟进成功',
229
+        icon: 'none'
230
+      })
231
+    }).catch(err => {
232
+      Taro.showToast({
233
+        title: '添加跟进失败',
234
+        icon: 'none'
235
+      })
236
+    })
129 237
     this.setState({
130 238
       followVisible: false,
239
+      followValue: '',
131 240
     })
132 241
   }
133
-  cancelBtn() {
242
+  followCancelBtn() {
134 243
     this.setState({
135 244
       followVisible: false,
245
+      followValue: '',
136 246
     })
137 247
   }
138 248
   onTextareaChange(e) {
139 249
     this.setState({
140
-      message: e.target.value
250
+      followValue: e.target.value
141 251
     })
142 252
   }
143 253
   renderFollowBox() {
144
-    const { message } = this.state
254
+    const { followValue } = this.state
145 255
     return (
146 256
       <View className="mask">
147 257
         <View className="content">
@@ -151,17 +261,17 @@ export default class myCustomer extends Taro.Component {
151 261
             </View>
152 262
             <Textarea
153 263
               className="textarea"
154
-              value={message}
264
+              value={followValue}
155 265
               onInput={this.onTextareaChange}
156 266
               maxLength={150}
157 267
               placeholder='不超过150字'
158 268
             />
159 269
           </View>
160 270
           <View className="bottom-btn">
161
-            <View className="save" onClick={this.saveBtn}>
271
+            <View className="save" onClick={this.followSaveBtn}>
162 272
               保存
163 273
             </View>
164
-            <View className="cancel" onClick={this.cancelBtn}>
274
+            <View className="cancel" onClick={this.followCancelBtn}>
165 275
               取消
166 276
           </View>
167 277
           </View>
@@ -172,38 +282,127 @@ export default class myCustomer extends Taro.Component {
172 282
   perfectInformation() {
173 283
     this.setState({
174 284
       baseVisible: true,
285
+      baseInfo: this.state.customerDetail,
175 286
     })
176 287
   }
288
+  // 保存
177 289
   baseSaveBtn() {
290
+    const { customerId } = this.$router.params
291
+    const { baseInfo } = this.state
292
+    commitCustomerInfo(customerId, baseInfo).then(res => {
293
+      this.setState({
294
+        customerDetail: res || {}
295
+      })
296
+    })
178 297
     this.setState({
179 298
       baseVisible: false,
180 299
     })
181 300
   }
301
+  // 取消
182 302
   baseCancelBtn() {
183 303
     this.setState({
184 304
       baseVisible: false,
185 305
     })
186 306
   }
187
-  onBaseTextareaChange(e) {
307
+  onNameChange(e) {
308
+    this.setState({
309
+      baseInfo: {
310
+        ...this.state.baseInfo,
311
+        name: e.target.value
312
+      }
313
+    })
314
+  }
315
+  onSexChange = e => {
316
+
317
+    let sex = e.detail.value == '0' ? '1' : e.detail.value == '1' ? '2' : ''
318
+    this.setState({
319
+      baseInfo: {
320
+        ...this.state.baseInfo,
321
+        sex,
322
+      }
323
+    })
324
+  }
325
+  onManageTypeChange(e) {
326
+    this.setState({
327
+      baseInfo: {
328
+        ...this.state.baseInfo,
329
+        realtyManageType: e.target.value
330
+      }
331
+    })
332
+  }
333
+  onPriceRangeChange(e) {
188 334
     this.setState({
189
-      desc: e.target.value
335
+      baseInfo: {
336
+        ...this.state.baseInfo,
337
+        priceRange: e.target.value
338
+      }
190 339
     })
191 340
   }
192 341
   onChange = e => {
193 342
     this.setState({
194
-      selectorChecked: this.state.selector[e.detail.value]
343
+      baseInfo: {
344
+        ...this.state.baseInfo,
345
+        demandType: this.state.selector[e.detail.value]
346
+      }
347
+    })
348
+  }
349
+  onBaseTextareaChange(e) {
350
+    this.setState({
351
+      baseInfo: {
352
+        ...this.state.baseInfo,
353
+        describe: e.target.value
354
+      }
355
+    })
356
+  }
357
+  // 拨打电话
358
+  handleTelClick(customer, e) {
359
+    e.stopPropagation()
360
+    Taro.makePhoneCall({
361
+      phoneNumber: customer.phone
362
+    })
363
+    const params = {
364
+      recordType: '拨打电话',
365
+      customerSex: customer.sex,
366
+      customerId: customer.customerId,
367
+    }
368
+    addFollowRecord(params).then(res => {
369
+      this.queryFollowRecord(1)
370
+    })
371
+    this.setState({
372
+      followVisible: false,
195 373
     })
196 374
   }
197 375
   renderBaseBox() {
198
-    const { desc, selector, selectorChecked } = this.state
376
+    const { baseInfo, desc, selector, sexSelector } = this.state
199 377
     return (
200 378
       <View className="mask">
201 379
         <View className="base-con">
380
+          <View className="con-item">
381
+            <View style="font-size:14px;color:#666">
382
+              姓名:
383
+            </View>
384
+            <Input className="input" value={baseInfo.name} onInput={this.onNameChange} placeholder='' />
385
+          </View>
386
+          <View className="con-item">
387
+            <View style="font-size:14px;color:#666">
388
+              性别:
389
+            </View>
390
+            <View className="con-picker" >
391
+              <View>
392
+                <Picker mode='selector' range={sexSelector} onChange={this.onSexChange}>
393
+                  <View className='picker'>
394
+                    {baseInfo.sex == '1' ? '男' : baseInfo.sex == '2' ? '女' : ' '}
395
+                  </View>
396
+                </Picker>
397
+              </View>
398
+              <View className="right-icon"></View>
399
+            </View>
400
+          </View>
202 401
           <View className="con-item">
203 402
             <View style="font-size:14px;color:#666">
204 403
               物业类型:
205 404
             </View>
206
-            <Input className="input" value={desc} onInput={this.onBaseTextareaChange} placeholder='' />
405
+            <Input className="input" value={baseInfo.realtyManageType} onInput={this.onManageTypeChange} placeholder='' />
207 406
           </View>
208 407
           <View className="con-item">
209 408
             <View style="font-size:14px;color:#666">
@@ -213,7 +412,7 @@ export default class myCustomer extends Taro.Component {
213 412
               <View>
214 413
                 <Picker mode='selector' range={selector} onChange={this.onChange}>
215 414
                   <View className='picker'>
216
-                    当前选择:{selectorChecked}
415
+                    {baseInfo.demandType || ' '}
217 416
                   </View>
218 417
                 </Picker>
219 418
               </View>
@@ -224,7 +423,7 @@ export default class myCustomer extends Taro.Component {
224 423
             <View style="font-size:14px;color:#666">
225 424
               价格区间:
226 425
             </View>
227
-            <Input className="input" value={desc} onInput={this.onBaseTextareaChange} placeholder='' />
426
+            <Input className="input" value={baseInfo.priceRange} onInput={this.onPriceRangeChange} placeholder='' />
228 427
           </View>
229 428
           <View style="display:flex;justify-content: space-between;">
230 429
             <View style="font-size:14px;color:#666">
@@ -232,10 +431,10 @@ export default class myCustomer extends Taro.Component {
232 431
             </View>
233 432
             <Textarea
234 433
               className="textarea"
235
-              value={desc}
434
+              value={baseInfo.describe}
236 435
               onInput={this.onBaseTextareaChange}
237 436
               maxLength={150}
238
-              placeholder='不超过150字'
437
+              placeholder=''
239 438
             />
240 439
           </View>
241 440
           <View className="bottom-btn">
@@ -255,7 +454,7 @@ export default class myCustomer extends Taro.Component {
255 454
   render() {
256 455
 
257 456
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
258
-    const { customerDetail, activityList, followRecord, followVisible, baseVisible } = this.state
457
+    const { customerDetail, visitRecord, activityList, followRecord, followVisible, baseVisible, isEmpty, hasMore, isEmpty2, hasMore2, isEmpty3, hasMore3 } = this.state
259 458
     return (
260 459
       <View>
261 460
         {followVisible && this.renderFollowBox()}
@@ -272,9 +471,9 @@ export default class myCustomer extends Taro.Component {
272 471
               customerDetail.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
273 472
             }
274 473
           </View>
275
-          <View className='user__left__phone'>{customerDetail.phone}</View>
474
+          <View onClick={this.handleTelClick.bind(this, customerDetail)} className='user__left__phone'>{customerDetail.phone}<View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0rpx -88rpx;width: 44rpx;height: 44rpx;margin-left:10rpx`}></View></View>
276 475
         </View>
277
-        <AtTabs className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
476
+        <AtTabs height="calc(100vh - 400rpx)" className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
278 477
           <AtTabsPane current={this.state.current} index={0} >
279 478
             <View className="tab-pane1 pane">
280 479
               <View className="status">{customerDetail.status == 1 ? '报备' : customerDetail.status == 2 ? '到访' : customerDetail.status == 3 ? '认筹' : '签约'}</View>
@@ -288,41 +487,104 @@ export default class myCustomer extends Taro.Component {
288 487
           </AtTabsPane>
289 488
           <AtTabsPane current={this.state.current} index={1}>
290 489
             <View className="tab-pane2 pane">
291
-              <View className="date">2019年11月11日</View>
292
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
293
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
294
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
295
-              <View className="date">2019年11月11日</View>
296
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
297
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
298
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
490
+              <ListView
491
+                className="wrap"
492
+                style="height:calc(100vh - 400rpx)"
493
+                needInit
494
+                isEmpty={isEmpty}
495
+                emptyText="暂无访问记录~"
496
+                hasMore={hasMore}
497
+                onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
498
+                onScrollToLower={fn => this.onScrollToLower(fn)}
499
+              >
500
+                <View className="list">
501
+                  {visitRecord.length && visitRecord.map((item, index) => (
502
+                    <View className="record-item" key={index + 'follow'}>
503
+                      <View className="title" >{item.activity}</View>
504
+                      <View className="time">{dayjs(item.visitTime).format('YYYY年MM月DD日 HH:mm:ss') || ' '}</View>
505
+                    </View>
506
+                  ))
507
+                  }
508
+                  {!visitRecord.length &&
509
+                    <View className="empty">
510
+                      {/* <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
511
+                  <View className="empty__text">暂无访问记录~</View> */}
512
+                    </View>
513
+                  }
514
+                </View>
515
+              </ListView>
299 516
             </View>
300 517
           </AtTabsPane>
301 518
           <AtTabsPane current={this.state.current} index={2}>
302 519
             <View className="tab-pane3 pane">
303
-              {activityList.length > 0 &&
304
-                activityList.map(item => (
305
-                  <ActivityItem
306
-                    data={item}
307
-                    key={item.id}
308
-                    onClick={this.handleItemClick}>
309
-                  </ActivityItem>
310
-                ))
311
-              }
520
+              <ListView
521
+                className="wrap"
522
+                style="height:calc(100vh - 400rpx)"
523
+                needInit
524
+                isEmpty={isEmpty2}
525
+                emptyText="暂无活动信息~"
526
+                hasMore={hasMore2}
527
+                onPullDownRefresh={fn => this.onPullDownRefresh2(fn)}
528
+                onScrollToLower={fn => this.onScrollToLower2(fn)}
529
+              >
530
+                <View className="list">
531
+                  {!activityList.length &&
532
+                    <View className="empty">
533
+                      {/* <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
534
+                  <View className="empty__text">暂无活动信息~</View> */}
535
+                    </View>
536
+                  }
537
+                  {activityList.length &&
538
+                    activityList.map(item => (
539
+                      <ActivityItem
540
+                        data={item}
541
+                        key={item.id + 'activity'}
542
+                        onClick={this.handleItemClick}>
543
+                      </ActivityItem>
544
+                    ))
545
+                  }
546
+                </View>
547
+              </ListView>
312 548
             </View>
313 549
           </AtTabsPane>
314 550
           <AtTabsPane current={this.state.current} index={3}>
315
-            <View style="padding:10px 20px 120px 20px">
316
-              {/* {followRecord.map(item => {
317
-                <View style=" display: flex;justify-content: space-between;align-items: center;color: #333;font-size: 16px;"> */}
318
-                  {/* <View style=" display: flex;align-items: center;"><View style="width:8px;height:8px;margin-right:10px;display:inline-block;background:rgba(246,182,29,1);border-radius: 50%;"></View>{item.recordType}</View>
319
-                    <View classNam="time" style=" font-size: 13px;color: #999;">{dayjs(item.createDate).format('YYYY-MM-DD') || ''}</View> */}
320
-                {/* </View>
321
-              })
322
-              } */}
323
-              <View className="btn" onClick={this.addFollow}>添加跟进</View>
324
-            </View>
551
+            <View style="padding:10px 20px 20px 20px">
552
+              <ListView
553
+                className="wrap"
554
+                needInit
555
+                style="height:calc(100vh - 600rpx)"
556
+                isEmpty={isEmpty3}
557
+                emptyText="暂无跟进记录~"
558
+                hasMore={hasMore3}
559
+                onPullDownRefresh={fn => this.onPullDownRefresh3(fn)}
560
+                onScrollToLower={fn => this.onScrollToLower3(fn)} >
561
+                <View className="list">
562
+                  {followRecord.length && followRecord.map(item => (
563
+                    <View key={item.followUpRecordId + 'follow'}>
564
+                      <View style=" display:flex;justify-content: space-between;align-items: center;color: #333;font-size: 16px; margin-bottom:20rpx;">
565
+                        <View style=" display: flex;align-items: center;"><View style="width:8px;height:8px;margin-right:20rpx;display:inline-block;background:rgba(246,182,29,1);border-radius: 50%;"></View>{item.recordType}</View>
566
+                        <View classNam="time" style=" font-size: 26rpx;color: #999;">{dayjs(item.createDate).format('YYYY年MM月DD日 HH:mm:ss') || ' '}</View>
567
+                      </View>
568
+                      {
569
+                        item.recordContent &&
570
+                        <View style="font-size:28rpx;color:#666;padding-left:32rpx;margin-bottom:20rpx;">
571
+                          {item.recordContent}
572
+                        </View>
573
+                      }
325 574
 
575
+                    </View>
576
+                  ))
577
+                  }
578
+                  {!followRecord.length &&
579
+                    <View className="empty">
580
+                      {/* <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
581
+                  <View className="empty__text">暂无跟进记录~</View> */}
582
+                    </View>
583
+                  }
584
+                </View>
585
+              </ListView>
586
+              <View className="btn" style="margin:40rpx auto;" onClick={this.addFollow}>添加跟进</View>
587
+            </View>
326 588
           </AtTabsPane>
327 589
         </AtTabs>
328 590
       </View>

+ 65
- 28
src/pages/person/customerAnalysis/transactionCustomer/index.js Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import Authorize from '@components/authorize'
3
+import ListView from '@components/ListView'
3 4
 import './index.scss'
4 5
 import { savePoint, updatePoint } from '@services/common'
5 6
 import { connect } from '@tarojs/redux'
@@ -17,6 +18,9 @@ export default class transactionCustomer extends Taro.Component {
17 18
   state = {
18 19
     recordId: undefined, // 埋点ID
19 20
     customerList: [],
21
+    hasMore: true,
22
+    isEmpty: false,
23
+    pageIndex: 1
20 24
   }
21 25
 
22 26
   componentWillUnmount() {
@@ -25,51 +29,84 @@ export default class transactionCustomer extends Taro.Component {
25 29
   }
26 30
   componentDidShow() {
27 31
     Taro.showLoading()
28
-    this.loadList()
32
+    this.loadList(1)
29 33
 
30 34
   }
31
-  loadList() {
35
+  loadList(pageNumber) {
32 36
     const payload = {
33 37
       type: 'clinch',
34
-      pageNumber: 0,
38
+      pageNumber,
35 39
       pageSize: 9999
36 40
     }
37 41
     queryCustomerList(payload.type, payload).then(res => {
42
+      const { records, list, total, current, pages } = res || {}
43
+      const _list = records || list || []
44
+      const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
38 45
       this.setState({
39
-        customerList: res.records || []
46
+        customerList: newList,
47
+        isEmpty: total == 0,
48
+        hasMore: current < pages,
49
+        pageIndex: current >= pages ? pages : current
40 50
       })
41 51
       Taro.hideLoading()
42 52
     })
43 53
   }
54
+  onScrollToLower = async (fn) => {
55
+    const { pageIndex } = this.state;
56
+    this.loadList(pageIndex + 1)
57
+    fn && fn();
58
+  }
59
+  onPullDownRefresh = (rest) => {
60
+    // debugger
61
+    if (this.refreshing) return
62
+    this.refreshing = true
63
+    this.loadList(1)
64
+    rest && rest()
65
+    this.refreshing = false
66
+  }
44 67
 
45 68
   render() {
46
-    const { customerList } = this.state
69
+    const { customerList, isEmpty, hasMore } = this.state
47 70
 
48 71
     return (
49 72
       <View style="padding:10px">
50
-        {
51
-          !customerList.length &&
52
-          <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
53
-        }
54
-        {
55
-          customerList.length &&
56
-          customerList.map(item => (
57
-            <View class="item">
58
-              <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
59
-              <View className="name">
60
-                {item.name}
61
-                {
62
-                  item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
63
-                }
64
-                {
65
-                  item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
66
-                }
67
-              </View>
68
-              <View className="phone">{item.phone} </View>
69
-              <View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View>
70
-            </View>
71
-          ))
72
-        }
73
+        <ListView
74
+          className="wrap"
75
+          needInit
76
+          isEmpty={isEmpty}
77
+          emptyText="暂无成交客户~"
78
+          hasMore={hasMore}
79
+          onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
80
+          onScrollToLower={fn => this.onScrollToLower(fn)}
81
+        >
82
+          <View className="list">
83
+            {
84
+              !customerList.length &&
85
+              <View></View>
86
+              // <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无成交客户~</View>
87
+            }
88
+            {
89
+              customerList.length &&
90
+              customerList.map((item, index) => (
91
+                <View class="item" key={index + 'transaction'}>
92
+                  <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
93
+                  <View className="name">
94
+                    {item.name}
95
+                    {
96
+                      item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
97
+                    }
98
+                    {
99
+                      item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
100
+                    }
101
+                  </View>
102
+                  <View className="phone">{item.phone} </View>
103
+                  <View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View>
104
+                </View>
105
+              ))
106
+            }
107
+          </View>
108
+        </ListView>
109
+
73 110
 
74 111
       </View>
75 112
     )

+ 53
- 48
src/pages/project/detail/index.js Прегледај датотеку

@@ -58,7 +58,7 @@ export default class Index extends Component {
58 58
     videoPlayShow: 'flex',
59 59
   }
60 60
 
61
-  componentWillMount () {
61
+  componentWillMount() {
62 62
     // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
63 63
 
64 64
     ready.queue(() => {
@@ -92,12 +92,12 @@ export default class Index extends Component {
92 92
     })
93 93
   }
94 94
 
95
-  componentWillUnmount () {
95
+  componentWillUnmount() {
96 96
     const { recordId } = this.state
97 97
     recordId && updatePoint(recordId)
98 98
   }
99 99
 
100
-  loadHelpGroupList () {
100
+  loadHelpGroupList() {
101 101
     const { buildingId } = this.state
102 102
 
103 103
     queryHelpGroup({ buildingId: buildingId }).then(res => {
@@ -119,7 +119,7 @@ export default class Index extends Component {
119 119
     )
120 120
   }
121 121
 
122
-  loadDetail () {
122
+  loadDetail() {
123 123
     const { buildingId } = this.state
124 124
     const { dispatchProjectDetail } = this.props
125 125
     this.setState({
@@ -147,7 +147,7 @@ export default class Index extends Component {
147 147
     })
148 148
   }
149 149
 
150
-  loadActivityData () {
150
+  loadActivityData() {
151 151
     const { buildingId } = this.state
152 152
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
153 153
     queryActivityList(payload).then(res => {
@@ -157,7 +157,7 @@ export default class Index extends Component {
157 157
     })
158 158
   }
159 159
 
160
-  loadNewsData () {
160
+  loadNewsData() {
161 161
     const { buildingId } = this.state
162 162
     const payload = { pageSize: 2, pageNumber: 1, buildingId }
163 163
     queryNewsList(payload).then(res => {
@@ -167,11 +167,11 @@ export default class Index extends Component {
167 167
     })
168 168
   }
169 169
 
170
-  navigateTo (url) {
170
+  navigateTo(url) {
171 171
     Taro.navigateTo({ url: url })
172 172
   }
173 173
   // 海报预览图
174
-  previewImage (arr) {
174
+  previewImage(arr) {
175 175
     // console.log('arr:' + arr)
176 176
     if (arr[0].length > 1) {
177 177
       Taro.previewImage({
@@ -198,7 +198,7 @@ export default class Index extends Component {
198 198
     })
199 199
   }
200 200
 
201
-  openMap () {
201
+  openMap() {
202 202
     const {
203 203
       buildingName,
204 204
       address,
@@ -225,12 +225,12 @@ export default class Index extends Component {
225 225
     })
226 226
   }
227 227
 
228
-  toViewAlbum () {
228
+  toViewAlbum() {
229 229
     const { buildingId } = this.state
230 230
     this.navigateTo(`/pages/project/album/index?id=${buildingId}`)
231 231
   }
232 232
 
233
-  onViewFans () {
233
+  onViewFans() {
234 234
     const { buildingId } = this.state
235 235
     this.navigateTo('/pages/card/fans/index?type=item&id=' + buildingId)
236 236
   }
@@ -259,7 +259,7 @@ export default class Index extends Component {
259 259
     }
260 260
   }
261 261
 
262
-  getPhoneNumber (e, item) {
262
+  getPhoneNumber(e, item) {
263 263
     getUserPhone(e, (phoneNumber) => {
264 264
       const { userInfo: { person: { personId, nickname, name } } } = this.props
265 265
       Taro.navigateTo({
@@ -268,7 +268,7 @@ export default class Index extends Component {
268 268
     })
269 269
   }
270 270
 
271
-  getPosterData () {
271
+  getPosterData() {
272 272
     return new Promise(resolve => {
273 273
       const { posterData } = this.state
274 274
       if (posterData.qrcode) {
@@ -339,14 +339,14 @@ export default class Index extends Component {
339 339
     })
340 340
   }
341 341
 
342
-  handleTelClick (item, e) {
342
+  handleTelClick(item, e) {
343 343
     e.stopPropagation()
344 344
     Taro.makePhoneCall({
345 345
       phoneNumber: item.phone
346 346
     })
347 347
   }
348 348
 
349
-  handleChatClick (item, e) {
349
+  handleChatClick(item, e) {
350 350
     e.stopPropagation()
351 351
     const { userInfo: { person: { personId, nickname, name } } } = this.props
352 352
     Taro.navigateTo({
@@ -354,24 +354,24 @@ export default class Index extends Component {
354 354
     })
355 355
   }
356 356
 
357
-  handleConsuItemClick (item) {
357
+  handleConsuItemClick(item) {
358 358
     Taro.navigateTo({
359 359
       url: `/pages/card/index?id=${item.id}`
360 360
     })
361 361
   }
362 362
 
363
-  handleMoreClick () {
363
+  handleMoreClick() {
364 364
     // App.zhuge.track('查看置业顾问列表')
365 365
     Taro.navigateTo({
366 366
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
367 367
     })
368 368
   }
369 369
 
370
-  handleStopPropagation (e) {
370
+  handleStopPropagation(e) {
371 371
     e.stopPropagation()
372 372
   }
373 373
 
374
-  toRecomonedPage () {
374
+  toRecomonedPage() {
375 375
     const {
376 376
       userInfo: { person: { personType } }
377 377
     } = this.props
@@ -387,50 +387,50 @@ export default class Index extends Component {
387 387
     }
388 388
   }
389 389
 
390
-  toHome () {
390
+  toHome() {
391 391
     Taro.switchTab({
392 392
       url: `/pages/project/index`
393 393
     })
394 394
   }
395 395
 
396
-  HandleCircumTabClick (id) {
396
+  HandleCircumTabClick(id) {
397 397
     this.setState({
398 398
       curTab: id
399 399
     })
400 400
   }
401 401
 
402
-  handleNewsMoreClick () {
402
+  handleNewsMoreClick() {
403 403
     Taro.navigateTo({
404 404
       url: `/pages/news/index?buildingId=` + this.state.buildingId
405 405
     })
406 406
   }
407 407
 
408
-  handNewsItemClick (id) {
408
+  handNewsItemClick(id) {
409 409
     Taro.navigateTo({
410 410
       url: '/pages/news/detail/index?id=' + id
411 411
     })
412 412
   }
413 413
 
414
-  handleActivityMoreClick () {
414
+  handleActivityMoreClick() {
415 415
     Taro.navigateTo({
416 416
       url: `/pages/activity/index?buildingId=` + this.state.buildingId
417 417
     })
418 418
   }
419 419
 
420
-  handActivityItemClick (id) {
420
+  handActivityItemClick(id) {
421 421
     Taro.navigateTo({
422 422
       url: '/pages/activity/detail/index?id=' + id
423 423
     })
424 424
   }
425 425
 
426
-  handlePreviewHxImage (current, urls) {
426
+  handlePreviewHxImage(current, urls) {
427 427
     Taro.previewImage({
428 428
       current,
429 429
       urls
430 430
     })
431 431
   }
432 432
 
433
-  handleFavor () {
433
+  handleFavor() {
434 434
     const { buildingId, isSaved } = this.state
435 435
     if (isSaved) {
436 436
       cancelFavorProject(buildingId).then(res => {
@@ -460,18 +460,18 @@ export default class Index extends Component {
460 460
       console.log('活动项目收藏')
461 461
     })
462 462
   }
463
-  handleToolsClick () {
463
+  handleToolsClick() {
464 464
     Taro.navigateTo({
465 465
       url: `/pages/toolKit/index`
466 466
     })
467 467
   }
468
-  moreFloor () {
468
+  moreFloor() {
469 469
     Taro.navigateTo({
470 470
       url: `/pages/project/floor/index`
471 471
     })
472 472
   }
473 473
 
474
-  renderBottomMenu () {
474
+  renderBottomMenu() {
475 475
     const { userInfo: { person: { personType } } } = this.props
476 476
     const { posterShow } = this.state
477 477
     return (
@@ -506,14 +506,14 @@ export default class Index extends Component {
506 506
     )
507 507
   }
508 508
 
509
-  previewHouseImage (current, urls) {
509
+  previewHouseImage(current, urls) {
510 510
     Taro.previewImage({
511 511
       current,
512 512
       urls
513 513
     })
514 514
   }
515 515
 
516
-  renderBuildingProjectTypeList () {
516
+  renderBuildingProjectTypeList() {
517 517
     const { statusOpts } = this.state
518 518
     const { projectDetail: { buildingProjectType = [], status, marketStatus } } = this.props
519 519
     return (
@@ -538,7 +538,7 @@ export default class Index extends Component {
538 538
                         {/* <Icon className="iconfont icon-jinrongxianxingge-" onClick={this.handleToolsClick}></Icon> */}
539 539
                         <View className='row' style="margin-top:0">
540 540
                           <Text className='row-label'>项目类型:</Text>
541
-                          <Text className='row-txt black'>{item.buildingTypeName}</Text>
541
+                          <Text className='row-txt black'>{item.buildingTypeName || ' '}</Text>
542 542
                         </View>
543 543
                         <View className='row'>
544 544
                           <Text className='row-label'>项目参考价格:</Text>
@@ -548,10 +548,15 @@ export default class Index extends Component {
548 548
                         </View>
549 549
                         <View className='row'>
550 550
                           <Text className='row-label'>产权:</Text>
551
-                          <Text className='row-txt'>{item.rightsYear}年</Text>
551
+                          {item.rightsYear ?
552
+                            <Text className='row-txt'>{item.rightsYear}年</Text>
553
+                            :
554
+                            <Text className='row-txt'>暂无</Text>
555
+                          }
556
+
552 557
                           <View className='row-right'>
553 558
                             <Text className='row-label'>装修:</Text>
554
-                            <Text className='row-txt'>{item.decoration}</Text>
559
+                            <Text className='row-txt'>{item.decoration || '暂无'}</Text>
555 560
                           </View>
556 561
                         </View>
557 562
                       </View>
@@ -567,7 +572,7 @@ export default class Index extends Component {
567 572
   }
568 573
 
569 574
 
570
-  renderPhotoAlbum () {
575
+  renderPhotoAlbum() {
571 576
     const { projectDetail: { buildingApartment } } = this.props
572 577
     const list = buildingApartment.filter(item => item.apartmentType === 'photo')
573 578
     const imgList = list.reduce((prev, cur) => {
@@ -617,7 +622,7 @@ export default class Index extends Component {
617 622
       </Block>
618 623
     )
619 624
   }
620
-  rendercircum () {
625
+  rendercircum() {
621 626
     const building = {
622 627
       ...this.props.projectDetail
623 628
     }
@@ -634,7 +639,7 @@ export default class Index extends Component {
634 639
     )
635 640
   }
636 641
 
637
-  renderConsuler () {
642
+  renderConsuler() {
638 643
     const { userInfo: { person: { phone } } } = this.props
639 644
     const { projectDetail: { consultants = [] } } = this.props
640 645
     return (
@@ -688,7 +693,7 @@ export default class Index extends Component {
688 693
     )
689 694
   }
690 695
 
691
-  renderStatement () {
696
+  renderStatement() {
692 697
     return (
693 698
       <View className='statement'>
694 699
         免责条款:以上价格仅供参考,具体一房一价的信息以售楼处展示为准。本网显示房屋位置、交通、医疗、教育、商业等配套信息,来源于第三方网络数据,不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。<br></br>本平台对项目周边文化教育的介绍旨在提供相关信息,并不意味着信息发布方对就学安排作出承诺。相关教育资源就学信息存在调整的可能,应以政府教育主管部门及办学颁布的政策规定为准。
@@ -697,7 +702,7 @@ export default class Index extends Component {
697 702
   }
698 703
 
699 704
 
700
-  renderHelp () {
705
+  renderHelp() {
701 706
     const { helpList } = this.state
702 707
     return (
703 708
       <Block>
@@ -718,17 +723,17 @@ export default class Index extends Component {
718 723
     )
719 724
   }
720 725
 
721
-  handleHelpClick (item) {
726
+  handleHelpClick(item) {
722 727
     Taro.navigateTo({
723 728
       url: '/pages/activity/detail/assistance?id=' + item.activityId
724 729
     })
725 730
   }
726
-  handleGroupClick (item) {
731
+  handleGroupClick(item) {
727 732
     Taro.navigateTo({
728 733
       url: '/pages/activity/detail/assemble?id=' + item.activityId
729 734
     })
730 735
   }
731
-  renderGroup () {
736
+  renderGroup() {
732 737
     const { groupList } = this.state
733 738
     return (
734 739
       <Block>
@@ -751,7 +756,7 @@ export default class Index extends Component {
751 756
     )
752 757
   }
753 758
 
754
-  renderHouseTypeList () {
759
+  renderHouseTypeList() {
755 760
     const { statusOpts } = this.state
756 761
     const { projectDetail: { buildingApartment } } = this.props
757 762
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
@@ -868,7 +873,7 @@ export default class Index extends Component {
868 873
       </Block>
869 874
     )
870 875
   }
871
-  renderNews () {
876
+  renderNews() {
872 877
     const { newsList } = this.state
873 878
     return (
874 879
       <Block>
@@ -977,7 +982,7 @@ export default class Index extends Component {
977 982
     )
978 983
   }
979 984
 
980
-  changeCurrent (current) {
985
+  changeCurrent(current) {
981 986
     this.setState({
982 987
       current: current + 1
983 988
     })
@@ -985,7 +990,7 @@ export default class Index extends Component {
985 990
 
986 991
 
987 992
 
988
-  render () {
993
+  render() {
989 994
     const { posterStatus, posterData, loaded, btnstate } = this.state
990 995
     const { projectDetail } = this.props
991 996
     const { uvList = {} } = projectDetail
@@ -1057,7 +1062,7 @@ export default class Index extends Component {
1057 1062
                       <View className='row project__addr'>
1058 1063
                         <Text className="label">楼盘地址:</Text>
1059 1064
                         <View className='address'>
1060
-                          <Text className="address__text">{projectDetail.address}</Text>
1065
+                          <Text className="address__text">{projectDetail.address || '暂无'}</Text>
1061 1066
                           {/* <Text className='iconfont icon-jingzhundaohang-copy' onClick={this.openMap.bind(this)}></Text> */}
1062 1067
                         </View>
1063 1068
                       </View>

+ 7
- 5
src/pages/project/index.js Прегледај датотеку

@@ -1,4 +1,5 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2
+import FormIdCollector from '@components/formIdCollector'
2 3
 import './index.scss'
3 4
 import ProjectItem from './item'
4 5
 import Banner from './banner'
@@ -465,11 +466,12 @@ export default class Index extends Component {
465 466
               </View>
466 467
               <View className="section-content">
467 468
                 {records.map(item => (
468
-                  <ProjectItem
469
-                    key={item.buildingId}
470
-                    onClick={this.onViewDetail.bind(this, item)}
471
-                    data={item}
472
-                  />
469
+                  <FormIdCollector key={item.buildingId}>
470
+                    <ProjectItem
471
+                      onClick={this.onViewDetail.bind(this, item)}
472
+                      data={item}
473
+                    />
474
+                  </FormIdCollector>
473 475
                 ))}
474 476
               </View>
475 477
             </View >

+ 24
- 7
src/services/person.js Прегледај датотеку

@@ -5,10 +5,17 @@ import {
5 5
   API_CUSTOMER_DETAIL,
6 6
   API_VISIT_RECORD,
7 7
   API_ACTIVITY_LIST_CUSTOMER,
8
-  API_FOLLOW_LIST
8
+  API_FOLLOW_LIST,
9
+  API_SEX_INFO,
9 10
 } from '@constants/api'
10 11
 
11 12
 
13
+/**
14
+ * 获取客户分析性别数据
15
+ * @param {*} type
16
+ */
17
+export const querySexInfo = (type, payload) => fetch({ url: `${API_SEX_INFO}/${type}`, payload })
18
+
12 19
 /**
13 20
  * 获取我的客户数据
14 21
  * @param {*} payload
@@ -19,27 +26,37 @@ export const queryMyCustomer = payload => fetch({ url: API_MY_CUSTOMER, payload
19 26
  * 获取客户列表
20 27
  * @param {*} type  
21 28
  */
22
-export const  queryCustomerList = (type, payload) => fetch({ url: `${API_CUSTOMER_LIST}/${type}`, payload })
29
+export const queryCustomerList = (type, payload) => fetch({ url: `${API_CUSTOMER_LIST}/${type}`, payload })
23 30
 /**
24
- * 获取客户列表
31
+ * 获取客户详情
32
+ * @param {*} customerId  
33
+ */
34
+export const getCustomerDetail = (customerId, payload) => fetch({ url: `${API_CUSTOMER_DETAIL}/${customerId}`, payload })
35
+/**
36
+ * 完善客户信息
25 37
  * @param {*} customerId  
26 38
  */
27
-export const  getCustomerDetail = (customerId, payload) => fetch({ url: `${API_CUSTOMER_DETAIL}/${customerId}`, payload })
39
+export const commitCustomerInfo = (customerId, payload) => fetch({ url: `${API_CUSTOMER_DETAIL}/${customerId}`, payload, method: 'PUT' })
28 40
 /**
29 41
  * 获取访问记录
30 42
  * @param {*} payload  
31 43
  */
32
-export const  getVisitRecord = ( payload) => fetch({ url: API_VISIT_RECORD, payload })
44
+export const getVisitRecord = (payload) => fetch({ url: API_VISIT_RECORD, payload })
33 45
 /**
34 46
  * 获取活动信息
35 47
  * @param {*} payload  
36 48
  */
37
-export const  getActivityList = ( payload) => fetch({ url: API_ACTIVITY_LIST_CUSTOMER, payload })
49
+export const getActivityList = (payload) => fetch({ url: API_ACTIVITY_LIST_CUSTOMER, payload })
38 50
 /**
39 51
  * 获取跟进记录
40 52
  * @param {*} payload  
41 53
  */
42
-export const  getFollowRecord = ( payload) => fetch({ url: API_FOLLOW_LIST, payload })
54
+export const getFollowRecord = (payload) => fetch({ url: API_FOLLOW_LIST, payload })
55
+/**
56
+ * 添加跟进记录
57
+ * @param {*} payload  
58
+ */
59
+export const addFollowRecord = (payload) => fetch({ url: API_FOLLOW_LIST, payload, method: 'POST' })
43 60
 
44 61
 
45 62