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