瀏覽代碼

客户详情

许静 5 年之前
父節點
當前提交
32f024f3b0

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

166
 //person
166
 //person
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')

+ 1
- 1
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 '../../components/MoveChart'
4
+import MoveChart from '../../More/More.js'
5
 import LineChart from '../../components/LineChart'
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'

+ 65
- 36
src/pages/person/customerAnalysis/followUpCustomer/index.js 查看文件

16
 
16
 
17
 
17
 
18
   state = {
18
   state = {
19
-    list: [
20
-      { name: '刘丽丽', phone: '15852364821', sex: '1' },
21
-      { name: '邓亚平', phone: '13160056061', sex: '2' },
22
-    ],
23
     recordId: undefined, // 埋点ID
19
     recordId: undefined, // 埋点ID
24
     customerList: [],
20
     customerList: [],
25
     inputValue: '',
21
     inputValue: '',
26
     screenVisible: false,
22
     screenVisible: false,
27
-    statusList: ['全部状态', '认筹', '到访', '签约'],
23
+    statusList: ['全部状态', '报备', '到访', '认筹'],
28
     statusIndex: -1,
24
     statusIndex: -1,
29
-    visitDate: '',
30
-    visitDate2: '',
31
-    reportDate: '',
32
-    reportDate2: '',
25
+    startArrivalDate: '',
26
+    endArrivalDate: '',
27
+    startReportDate : '',
28
+    endReportDate: '',
33
   }
29
   }
34
 
30
 
35
   componentWillUnmount() {
31
   componentWillUnmount() {
47
       pageNumber: 0,
43
       pageNumber: 0,
48
       pageSize: 9999
44
       pageSize: 9999
49
     }
45
     }
50
-    queryCustomerList(payload.type,payload).then(res => {
46
+    queryCustomerList(payload.type, payload).then(res => {
51
 
47
 
52
       this.setState({
48
       this.setState({
53
-        customerList: res || {}
49
+        customerList: res.records || []
54
       })
50
       })
55
       Taro.hideLoading()
51
       Taro.hideLoading()
56
     })
52
     })
66
     // const playload = {
62
     // const playload = {
67
     //   inputValue: this.state.inputValue
63
     //   inputValue: this.state.inputValue
68
     // }
64
     // }
69
-    console.log(this.state.inputValue, "inputValue")
65
+    this.filterCustomerList();
66
+   
67
+  }
68
+  filterCustomerList(){
69
+
70
+    const payload = {
71
+      type: 'follow',
72
+      pageNumber: 0,
73
+      pageSize: 9999,
74
+      status:this.state.statusIndex!=0?this.state.statusIndex:'',
75
+      startArrivalDate:this.state.startArrivalDate,
76
+      endArrivalDate: this.state.endArrivalDate,
77
+      startReportDate : this.state.startReportDate,
78
+      endReportDate: this.state.endReportDate,
79
+    }
80
+    queryCustomerList(payload.type, payload).then(res => {
81
+
82
+      this.setState({
83
+        customerList: res.records || []
84
+      })
85
+      Taro.hideLoading()
86
+    })
87
+  }
88
+  saveBtn() {
89
+    this.filterCustomerList();
90
+    this.setState({
91
+      screenVisible: false,
92
+    })
70
   }
93
   }
71
   screenShow() {
94
   screenShow() {
72
     this.setState({
95
     this.setState({
81
   }
104
   }
82
   onVisitDateChange = e => {
105
   onVisitDateChange = e => {
83
     this.setState({
106
     this.setState({
84
-      visitDate: e.detail.value
107
+      startArrivalDate: e.detail.value
85
     })
108
     })
86
   }
109
   }
87
   onVisitDateChange2 = e => {
110
   onVisitDateChange2 = e => {
88
     this.setState({
111
     this.setState({
89
-      visitDate2: e.detail.value
112
+      endArrivalDate: e.detail.value
90
     })
113
     })
91
   }
114
   }
92
   onReportDateChange = e => {
115
   onReportDateChange = e => {
93
     this.setState({
116
     this.setState({
94
-      reportDate: e.detail.value
117
+      startReportDate : e.detail.value
95
     })
118
     })
96
   }
119
   }
97
   onReportDateChange2 = e => {
120
   onReportDateChange2 = e => {
98
     this.setState({
121
     this.setState({
99
-      reportDate2: e.detail.value
100
-    })
101
-  }
102
-  saveBtn() {
103
-    this.setState({
104
-      screenVisible: false,
122
+      endReportDate: e.detail.value
105
     })
123
     })
106
   }
124
   }
125
+ 
107
   cancelBtn() {
126
   cancelBtn() {
108
     this.setState({
127
     this.setState({
109
       screenVisible: false,
128
       screenVisible: false,
129
+      statusIndex: -1,
130
+      startArrivalDate: '',
131
+      endArrivalDate: '',
132
+      startReportDate : '',
133
+      endReportDate: '',
110
     })
134
     })
111
   }
135
   }
112
-  toMyCustomer() {
136
+  toMyCustomer(customerId) {
113
     Taro.navigateTo({
137
     Taro.navigateTo({
114
-      url: `/pages/person/customerAnalysis/myCustomer`
138
+      url: `/pages/person/customerAnalysis/myCustomer?customerId=`+customerId
115
     })
139
     })
116
   }
140
   }
117
   renderScreenBox() {
141
   renderScreenBox() {
118
-    const { statusList, statusIndex, visitDate, visitDate2, reportDate, reportDate2 } = this.state
142
+    const { statusList, statusIndex, startArrivalDate, endArrivalDate, startReportDate , endReportDate } = this.state
119
     return (
143
     return (
120
       <View className="mask">
144
       <View className="mask">
121
         <View className="content">
145
         <View className="content">
131
             到访时间:
155
             到访时间:
132
               <Picker mode='date' onChange={this.onVisitDateChange}>
156
               <Picker mode='date' onChange={this.onVisitDateChange}>
133
               <View className='picker'>
157
               <View className='picker'>
134
-                {visitDate}
135
-                {!visitDate && <Text className="placeholder">起始时间</Text>}
158
+                {startArrivalDate}
159
+                {!startArrivalDate && <Text className="placeholder">起始时间</Text>}
136
               </View>
160
               </View>
137
             </Picker>-<Picker mode='date' onChange={this.onVisitDateChange2}>
161
             </Picker>-<Picker mode='date' onChange={this.onVisitDateChange2}>
138
               <View className='picker'>
162
               <View className='picker'>
139
-                {visitDate2}
140
-                {!visitDate2 && <Text className="placeholder">结束时间</Text>}
163
+                {endArrivalDate}
164
+                {!endArrivalDate && <Text className="placeholder">结束时间</Text>}
141
               </View>
165
               </View>
142
             </Picker>
166
             </Picker>
143
           </View>
167
           </View>
145
             报备时间:
169
             报备时间:
146
               <Picker mode='date' onChange={this.onReportDateChange}>
170
               <Picker mode='date' onChange={this.onReportDateChange}>
147
               <View className='picker'>
171
               <View className='picker'>
148
-                {reportDate}
149
-                {!reportDate && <Text className="placeholder">起始时间</Text>}
172
+                {startReportDate }
173
+                {!startReportDate  && <Text className="placeholder">起始时间</Text>}
150
               </View>
174
               </View>
151
             </Picker>-<Picker mode='date' onChange={this.onReportDateChange2}>
175
             </Picker>-<Picker mode='date' onChange={this.onReportDateChange2}>
152
               <View className='picker'>
176
               <View className='picker'>
153
-                {reportDate2}
154
-                {!reportDate2 && <Text className="placeholder">结束时间</Text>}
177
+                {endReportDate}
178
+                {!endReportDate && <Text className="placeholder">结束时间</Text>}
155
               </View>
179
               </View>
156
             </Picker>
180
             </Picker>
157
           </View>
181
           </View>
171
   }
195
   }
172
 
196
 
173
   render() {
197
   render() {
174
-    const { list, screenVisible } = this.state
198
+    const { customerList, screenVisible } = this.state
175
 
199
 
176
     return (
200
     return (
177
       <View>
201
       <View>
185
         </View>
209
         </View>
186
         <View style="padding:10px">
210
         <View style="padding:10px">
187
           {
211
           {
188
-            list.map((item, index) => (
189
-              <View class="item" key={index + 'list'} onClick={this.toMyCustomer}>
190
-                <Image src={require('@assets/default-avatar.png')} className='img'></Image>
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>
191
                 <View className="name">
220
                 <View className="name">
192
                   {item.name}
221
                   {item.name}
193
                   {
222
                   {

+ 3
- 0
src/pages/person/customerAnalysis/index.scss 查看文件

117
     position: absolute;
117
     position: absolute;
118
     top:76px;
118
     top:76px;
119
     left:320px;
119
     left:320px;
120
+    display: flex;
121
+    align-items: center;
122
+    max-width: 200px;
120
   }
123
   }
121
   .user__left__phone{
124
   .user__left__phone{
122
     font-size:32px;
125
     font-size:32px;

+ 29
- 10
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 { connect } from '@tarojs/redux'
6
 import { connect } from '@tarojs/redux'
6
 import './index.scss'
7
 import './index.scss'
7
 import ActivityItem from './item'
8
 import ActivityItem from './item'
8
 import { getActNewList } from '@services/activity'
9
 import { getActNewList } from '@services/activity'
10
+const iconImg = require('@assets/person/icon.png')
9
 
11
 
10
 @connect(({ user, city }) => ({ user, city }))
12
 @connect(({ user, city }) => ({ user, city }))
11
 export default class myCustomer extends Taro.Component {
13
 export default class myCustomer extends Taro.Component {
24
     desc: '', //客户描述
26
     desc: '', //客户描述
25
     selectorChecked: '',
27
     selectorChecked: '',
26
     selector: ['美国', '中国', '巴西', '日本'],
28
     selector: ['美国', '中国', '巴西', '日本'],
29
+    customerDetail: {},
30
+
27
   }
31
   }
28
 
32
 
29
   componentWillUnmount() {
33
   componentWillUnmount() {
34
+
30
     const { recordId } = this.state
35
     const { recordId } = this.state
31
     recordId && updatePoint(recordId)
36
     recordId && updatePoint(recordId)
32
   }
37
   }
42
     this.loadList()
47
     this.loadList()
43
   }
48
   }
44
   loadList() {
49
   loadList() {
50
+    const { customerId } = this.$router.params
51
+    getCustomerDetail(customerId).then(res => {
52
+      this.setState({
53
+        customerDetail: res || {}
54
+      })
55
+    })
45
     getActNewList().then(res => {
56
     getActNewList().then(res => {
46
       this.setState({
57
       this.setState({
47
         list: res.records || []
58
         list: res.records || []
204
   render() {
215
   render() {
205
 
216
 
206
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
217
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
207
-    const { list, followVisible, baseVisible } = this.state
218
+    const { customerDetail, list, followVisible, baseVisible } = this.state
208
     return (
219
     return (
209
       <View>
220
       <View>
210
         {followVisible && this.renderFollowBox()}
221
         {followVisible && this.renderFollowBox()}
211
         {baseVisible && this.renderBaseBox()}
222
         {baseVisible && this.renderBaseBox()}
212
         <View className="user_con">
223
         <View className="user_con">
213
           <Image className="bg" src={require('@assets/shop/background.jpg')} ></Image>
224
           <Image className="bg" src={require('@assets/shop/background.jpg')} ></Image>
214
-          <Image className="user__left__headimg" src={require('@assets/default-avatar.png')} />
215
-          <View className='user__left__name'>客户姓名</View>
216
-          <View className='user__left__phone'>175 1562 8701</View>
225
+          <Image className="user__left__headimg" src={customerDetail.picture || require('@assets/default-avatar.png')} />
226
+          <View className='user__left__name'>
227
+            {customerDetail.name}
228
+            {
229
+              customerDetail.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
230
+            }
231
+            {
232
+              customerDetail.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
233
+            }
234
+          </View>
235
+          <View className='user__left__phone'>{customerDetail.phone}</View>
217
         </View>
236
         </View>
218
         <AtTabs className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
237
         <AtTabs className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
219
           <AtTabsPane current={this.state.current} index={0} >
238
           <AtTabsPane current={this.state.current} index={0} >
220
             <View className="tab-pane1 pane">
239
             <View className="tab-pane1 pane">
221
-              <View className="status">到访</View>
222
-              <View className="base-item">意向项目:<View className="con">银城悦见山</View></View>
223
-              <View className="base-item">物业类型:<View className="con">自住</View></View>
224
-              <View className="base-item">项目类型:<View className="con">高层</View></View>
225
-              <View className="base-item">价格区间:<View className="con">{desc || '暂无'}</View></View>
226
-              <View className="base-item">客户描述:<View className="con">{desc || '暂无'}</View></View>
240
+              <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>
242
+              <View className="base-item">物业类型:<View className="con">{customerDetail.realtyManageType || '暂无'}</View></View>
243
+              <View className="base-item">项目类型:<View className="con">{customerDetail.demandType || '暂无'}</View></View>
244
+              <View className="base-item">价格区间:<View className="con">{customerDetail.priceRange || '暂无'}</View></View>
245
+              <View className="base-item">客户描述:<View className="con">{customerDetail.describe || '暂无'}</View></View>
227
               <View className="btn" onClick={this.perfectInformation}>完善信息</View>
246
               <View className="btn" onClick={this.perfectInformation}>完善信息</View>
228
             </View>
247
             </View>
229
           </AtTabsPane>
248
           </AtTabsPane>

+ 29
- 11
src/pages/person/customerAnalysis/transactionCustomer/index.js 查看文件

3
 import './index.scss'
3
 import './index.scss'
4
 import { savePoint, updatePoint } from '@services/common'
4
 import { savePoint, updatePoint } from '@services/common'
5
 import { connect } from '@tarojs/redux'
5
 import { connect } from '@tarojs/redux'
6
-// import { getThumbnail } from '@utils/tools'
6
+import { queryCustomerList } from '@services/person'
7
 const iconImg = require('@assets/person/icon.png')
7
 const iconImg = require('@assets/person/icon.png')
8
 
8
 
9
 
9
 
15
   }
15
   }
16
 
16
 
17
   state = {
17
   state = {
18
-    list: [
19
-      { name: '刘丽丽', phone: '15852364821', sex: '1' },
20
-      { name: '邓亚平', phone: '13160056061', sex: '2' },
21
-    ],
22
     recordId: undefined, // 埋点ID
18
     recordId: undefined, // 埋点ID
19
+    customerList: [],
23
   }
20
   }
24
 
21
 
25
   componentWillUnmount() {
22
   componentWillUnmount() {
26
     const { recordId } = this.state
23
     const { recordId } = this.state
27
     recordId && updatePoint(recordId)
24
     recordId && updatePoint(recordId)
28
   }
25
   }
26
+  componentDidShow() {
27
+    Taro.showLoading()
28
+    this.loadList()
29
+
30
+  }
31
+  loadList() {
32
+    const payload = {
33
+      type: 'clinch',
34
+      pageNumber: 0,
35
+      pageSize: 9999
36
+    }
37
+    queryCustomerList(payload.type, payload).then(res => {
38
+      this.setState({
39
+        customerList: res.records || []
40
+      })
41
+      Taro.hideLoading()
42
+    })
43
+  }
29
 
44
 
30
   render() {
45
   render() {
31
-    const { list } = this.state
46
+    const { customerList } = this.state
32
 
47
 
33
     return (
48
     return (
34
       <View style="padding:10px">
49
       <View style="padding:10px">
35
         {
50
         {
36
-
37
-          list.map(item => (
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 => (
38
             <View class="item">
57
             <View class="item">
39
-
40
-              <Image src={require('@assets/default-avatar.png')} className='img'></Image>
58
+              <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
41
               <View className="name">
59
               <View className="name">
42
                 {item.name}
60
                 {item.name}
43
                 {
61
                 {
48
                 }
66
                 }
49
               </View>
67
               </View>
50
               <View className="phone">{item.phone} </View>
68
               <View className="phone">{item.phone} </View>
51
-              <View  style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View>
69
+              <View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View>
52
             </View>
70
             </View>
53
           ))
71
           ))
54
         }
72
         }