浏览代码

接口对接

许静 5 年前
父节点
当前提交
e318cecea5

+ 3
- 0
src/constants/api.js 查看文件

167
 export const API_MY_CUSTOMER = resolvePath('inventory/customer/statistics')
167
 export const API_MY_CUSTOMER = resolvePath('inventory/customer/statistics')
168
 export const API_CUSTOMER_LIST = resolvePath('inventory/customer/statistics')
168
 export const API_CUSTOMER_LIST = resolvePath('inventory/customer/statistics')
169
 export const API_CUSTOMER_DETAIL = resolvePath('inventory/customer')
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 查看文件

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

+ 1
- 2
src/pages/person/customerAnalysis/item/index.js 查看文件

27
           <View className="left">
27
           <View className="left">
28
             <View className="title">{data.title}</View>
28
             <View className="title">{data.title}</View>
29
             {data.startDate &&
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
           </View>
32
           </View>
33
-
34
           {data.startDate &&
33
           {data.startDate &&
35
             <View className="time">参与时间:{`${dayjs(data.startDate).format('YYYY年MM月DD日 HH:mm:ss')}`}</View>
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 查看文件

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

+ 61
- 18
src/pages/person/customerAnalysis/myCustomer.js 查看文件

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

+ 18
- 0
src/services/person.js 查看文件

3
   API_MY_CUSTOMER,
3
   API_MY_CUSTOMER,
4
   API_CUSTOMER_LIST,
4
   API_CUSTOMER_LIST,
5
   API_CUSTOMER_DETAIL,
5
   API_CUSTOMER_DETAIL,
6
+  API_VISIT_RECORD,
7
+  API_ACTIVITY_LIST_CUSTOMER,
8
+  API_FOLLOW_LIST
6
 } from '@constants/api'
9
 } from '@constants/api'
7
 
10
 
8
 
11
 
22
  * @param {*} customerId  
25
  * @param {*} customerId  
23
  */
26
  */
24
 export const  getCustomerDetail = (customerId, payload) => fetch({ url: `${API_CUSTOMER_DETAIL}/${customerId}`, payload })
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