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

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

@@ -167,3 +167,6 @@ export const API_GROUP_JOIN = resolvePath('taShareChildRecord')
167 167
 export const API_MY_CUSTOMER = resolvePath('inventory/customer/statistics')
168 168
 export const API_CUSTOMER_LIST = resolvePath('inventory/customer/statistics')
169 169
 export const API_CUSTOMER_DETAIL = resolvePath('inventory/customer')
170
+export const API_VISIT_RECORD = resolvePath('taPersonVisitRecord')
171
+export const API_ACTIVITY_LIST_CUSTOMER = resolvePath('customer/activity/list')
172
+export const API_FOLLOW_LIST = resolvePath('taCustomerFollowUpRecord')

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

@@ -1,8 +1,8 @@
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.js'
5
-import LineChart from '../../components/LineChart'
4
+// import MoveChart from '../../More/More'
5
+// import LineChart from '../../components/LineChart'
6 6
 import './index.scss'
7 7
 import { AtTabs, AtTabsPane, AtProgress } from 'taro-ui'
8 8
 import "taro-ui/dist/style/components/tabs.scss"
@@ -44,6 +44,7 @@ export default class analysis extends Taro.Component {
44 44
         <AtTabs className="tab-bar" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
45 45
           <AtTabsPane current={this.state.current} index={0} >
46 46
             <View>
47
+              {/* <MoveChart/> */}
47 48
               {/* <View className="sex-box">
48 49
                 <View className="sex">性别</View>
49 50
                 <AtProgress percent={25} strokeWidth={6} color='#FF4949' />

+ 1
- 2
src/pages/person/customerAnalysis/item/index.js Parādīt failu

@@ -27,10 +27,9 @@ export default class Item extends Component {
27 27
           <View className="left">
28 28
             <View className="title">{data.title}</View>
29 29
             {data.startDate &&
30
-              <View className={data.activityStatus == 0 ? "status signed " : data.activityStatus == 1 ? "status nostart" : data.activityStatus == 2 ? "status fail" : "status"}>{data.activityStatus == 0 ? "立即参与" : data.activityStatus == 1 ? "未开始" : data.activityStatus == 2 ? "已结束" : "已参与"}</View>
30
+              <View className={data.jionStatus == '已签到' ? "status signed " : data.jionStatus == '成功已核销' ? "status primary" : data.jionStatus == '失败' ? "status fail" : "status"}>{data.jionStatus || ''}</View>
31 31
             }
32 32
           </View>
33
-
34 33
           {data.startDate &&
35 34
             <View className="time">参与时间:{`${dayjs(data.startDate).format('YYYY年MM月DD日 HH:mm:ss')}`}</View>
36 35
           }

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

@@ -46,7 +46,7 @@
46 46
     .title {
47 47
       font-size: 28px;
48 48
       color: #333;
49
-      width: 500px;
49
+      width: 460px;
50 50
       @include text-ellipsis;
51 51
     }
52 52
     .time {
@@ -69,7 +69,7 @@
69 69
     .signed{
70 70
       color: #F6B61D;
71 71
     }
72
-		.nostart {
72
+		.primary {
73 73
       color:$primary-color;
74 74
     }
75 75
     .fail{

+ 61
- 18
src/pages/person/customerAnalysis/myCustomer.js Parādīt failu

@@ -2,11 +2,11 @@ import Taro, { Component } from '@tarojs/taro';
2 2
 import { AtTabs, AtTabsPane } from 'taro-ui'
3 3
 import "taro-ui/dist/style/components/tabs.scss"
4 4
 import { savePoint, updatePoint } from '@services/common'
5
-import { getCustomerDetail } from '@services/person'
5
+import { getCustomerDetail, getVisitRecord, getActivityList, getFollowRecord } from '@services/person'
6 6
 import { connect } from '@tarojs/redux'
7 7
 import './index.scss'
8 8
 import ActivityItem from './item'
9
-import { getActNewList } from '@services/activity'
9
+import dayjs from 'dayjs'
10 10
 const iconImg = require('@assets/person/icon.png')
11 11
 
12 12
 @connect(({ user, city }) => ({ user, city }))
@@ -19,7 +19,7 @@ export default class myCustomer extends Taro.Component {
19 19
   state = {
20 20
     current: 0,
21 21
     recordId: undefined, // 埋点ID
22
-    list: [],
22
+    activityList: [],
23 23
     followVisible: false,
24 24
     baseVisible: false,
25 25
     message: '', //跟进内容
@@ -27,6 +27,7 @@ export default class myCustomer extends Taro.Component {
27 27
     selectorChecked: '',
28 28
     selector: ['美国', '中国', '巴西', '日本'],
29 29
     customerDetail: {},
30
+    followRecord: []
30 31
 
31 32
   }
32 33
 
@@ -37,6 +38,45 @@ export default class myCustomer extends Taro.Component {
37 38
   }
38 39
 
39 40
   handleClick(value) {
41
+    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
+      })
53
+    } 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
+      })
65
+    } 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
+        )
78
+      })
79
+    }
40 80
     this.setState({
41 81
       current: value
42 82
     }, )
@@ -53,13 +93,14 @@ export default class myCustomer extends Taro.Component {
53 93
         customerDetail: res || {}
54 94
       })
55 95
     })
56
-    getActNewList().then(res => {
57
-      this.setState({
58
-        list: res.records || []
59
-      })
60
-    })
61 96
   }
62 97
   handleItemClick(item) {
98
+    // if (item.status == 0) {
99
+    //   Taro.showToast({
100
+    //     title: '当前活动已失效',
101
+    //     icon: 'none'
102
+    //   })
103
+    // } else {
63 104
     switch (item.type) {
64 105
       case 'help':
65 106
         Taro.navigateTo({
@@ -77,6 +118,7 @@ export default class myCustomer extends Taro.Component {
77 118
         })
78 119
         return
79 120
     }
121
+    // }
80 122
   }
81 123
   addFollow() {
82 124
     this.setState({
@@ -176,9 +218,7 @@ export default class myCustomer extends Taro.Component {
176 218
                 </Picker>
177 219
               </View>
178 220
               <View className="right-icon"></View>
179
-
180 221
             </View>
181
-
182 222
           </View>
183 223
           <View className="con-item">
184 224
             <View style="font-size:14px;color:#666">
@@ -215,7 +255,7 @@ export default class myCustomer extends Taro.Component {
215 255
   render() {
216 256
 
217 257
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
218
-    const { customerDetail, list, followVisible, baseVisible } = this.state
258
+    const { customerDetail, activityList, followRecord, followVisible, baseVisible } = this.state
219 259
     return (
220 260
       <View>
221 261
         {followVisible && this.renderFollowBox()}
@@ -237,7 +277,7 @@ export default class myCustomer extends Taro.Component {
237 277
         <AtTabs className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
238 278
           <AtTabsPane current={this.state.current} index={0} >
239 279
             <View className="tab-pane1 pane">
240
-              <View className="status">{customerDetail.status==1?'报备':customerDetail.status==2?'到访':customerDetail.status==3?'认筹':'签约'}</View>
280
+              <View className="status">{customerDetail.status == 1 ? '报备' : customerDetail.status == 2 ? '到访' : customerDetail.status == 3 ? '认筹' : '签约'}</View>
241 281
               <View className="base-item">意向项目:<View className="con">{customerDetail.intention || '暂无'}</View></View>
242 282
               <View className="base-item">物业类型:<View className="con">{customerDetail.realtyManageType || '暂无'}</View></View>
243 283
               <View className="base-item">项目类型:<View className="con">{customerDetail.demandType || '暂无'}</View></View>
@@ -260,8 +300,8 @@ export default class myCustomer extends Taro.Component {
260 300
           </AtTabsPane>
261 301
           <AtTabsPane current={this.state.current} index={2}>
262 302
             <View className="tab-pane3 pane">
263
-              {list.length > 0 &&
264
-                list.map(item => (
303
+              {activityList.length > 0 &&
304
+                activityList.map(item => (
265 305
                   <ActivityItem
266 306
                     data={item}
267 307
                     key={item.id}
@@ -273,10 +313,13 @@ export default class myCustomer extends Taro.Component {
273 313
           </AtTabsPane>
274 314
           <AtTabsPane current={this.state.current} index={3}>
275 315
             <View style="padding:10px 20px 120px 20px">
276
-              <View style=" display: flex;justify-content: space-between;align-items: center;color: #333;font-size: 16px;">
277
-                <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>编辑客户信息</View>
278
-                <View classNam="time" style=" font-size: 13px;color: #999;">2019年11月11日 12:24:59</View>
279
-              </View>
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
+              } */}
280 323
               <View className="btn" onClick={this.addFollow}>添加跟进</View>
281 324
             </View>
282 325
 

+ 18
- 0
src/services/person.js Parādīt failu

@@ -3,6 +3,9 @@ import {
3 3
   API_MY_CUSTOMER,
4 4
   API_CUSTOMER_LIST,
5 5
   API_CUSTOMER_DETAIL,
6
+  API_VISIT_RECORD,
7
+  API_ACTIVITY_LIST_CUSTOMER,
8
+  API_FOLLOW_LIST
6 9
 } from '@constants/api'
7 10
 
8 11
 
@@ -22,6 +25,21 @@ export const  queryCustomerList = (type, payload) => fetch({ url: `${API_CUSTOME
22 25
  * @param {*} customerId  
23 26
  */
24 27
 export const  getCustomerDetail = (customerId, payload) => fetch({ url: `${API_CUSTOMER_DETAIL}/${customerId}`, payload })
28
+/**
29
+ * 获取访问记录
30
+ * @param {*} payload  
31
+ */
32
+export const  getVisitRecord = ( payload) => fetch({ url: API_VISIT_RECORD, payload })
33
+/**
34
+ * 获取活动信息
35
+ * @param {*} payload  
36
+ */
37
+export const  getActivityList = ( payload) => fetch({ url: API_ACTIVITY_LIST_CUSTOMER, payload })
38
+/**
39
+ * 获取跟进记录
40
+ * @param {*} payload  
41
+ */
42
+export const  getFollowRecord = ( payload) => fetch({ url: API_FOLLOW_LIST, payload })
25 43
 
26 44
 
27 45