许静 пре 5 година
родитељ
комит
32f024f3b0

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

@@ -166,3 +166,4 @@ export const API_GROUP_JOIN = resolvePath('taShareChildRecord')
166 166
 //person
167 167
 export const API_MY_CUSTOMER = resolvePath('inventory/customer/statistics')
168 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,7 +1,7 @@
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 '../../components/MoveChart'
4
+import MoveChart from '../../More/More.js'
5 5
 import LineChart from '../../components/LineChart'
6 6
 import './index.scss'
7 7
 import { AtTabs, AtTabsPane, AtProgress } from 'taro-ui'

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

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

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

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

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

@@ -2,10 +2,12 @@ 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 6
 import { connect } from '@tarojs/redux'
6 7
 import './index.scss'
7 8
 import ActivityItem from './item'
8 9
 import { getActNewList } from '@services/activity'
10
+const iconImg = require('@assets/person/icon.png')
9 11
 
10 12
 @connect(({ user, city }) => ({ user, city }))
11 13
 export default class myCustomer extends Taro.Component {
@@ -24,9 +26,12 @@ export default class myCustomer extends Taro.Component {
24 26
     desc: '', //客户描述
25 27
     selectorChecked: '',
26 28
     selector: ['美国', '中国', '巴西', '日本'],
29
+    customerDetail: {},
30
+
27 31
   }
28 32
 
29 33
   componentWillUnmount() {
34
+
30 35
     const { recordId } = this.state
31 36
     recordId && updatePoint(recordId)
32 37
   }
@@ -42,6 +47,12 @@ export default class myCustomer extends Taro.Component {
42 47
     this.loadList()
43 48
   }
44 49
   loadList() {
50
+    const { customerId } = this.$router.params
51
+    getCustomerDetail(customerId).then(res => {
52
+      this.setState({
53
+        customerDetail: res || {}
54
+      })
55
+    })
45 56
     getActNewList().then(res => {
46 57
       this.setState({
47 58
         list: res.records || []
@@ -204,26 +215,34 @@ export default class myCustomer extends Taro.Component {
204 215
   render() {
205 216
 
206 217
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
207
-    const { list, followVisible, baseVisible } = this.state
218
+    const { customerDetail, list, followVisible, baseVisible } = this.state
208 219
     return (
209 220
       <View>
210 221
         {followVisible && this.renderFollowBox()}
211 222
         {baseVisible && this.renderBaseBox()}
212 223
         <View className="user_con">
213 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 236
         </View>
218 237
         <AtTabs className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
219 238
           <AtTabsPane current={this.state.current} index={0} >
220 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 246
               <View className="btn" onClick={this.perfectInformation}>完善信息</View>
228 247
             </View>
229 248
           </AtTabsPane>

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

@@ -3,7 +3,7 @@ import Authorize from '@components/authorize'
3 3
 import './index.scss'
4 4
 import { savePoint, updatePoint } from '@services/common'
5 5
 import { connect } from '@tarojs/redux'
6
-// import { getThumbnail } from '@utils/tools'
6
+import { queryCustomerList } from '@services/person'
7 7
 const iconImg = require('@assets/person/icon.png')
8 8
 
9 9
 
@@ -15,29 +15,47 @@ export default class transactionCustomer extends Taro.Component {
15 15
   }
16 16
 
17 17
   state = {
18
-    list: [
19
-      { name: '刘丽丽', phone: '15852364821', sex: '1' },
20
-      { name: '邓亚平', phone: '13160056061', sex: '2' },
21
-    ],
22 18
     recordId: undefined, // 埋点ID
19
+    customerList: [],
23 20
   }
24 21
 
25 22
   componentWillUnmount() {
26 23
     const { recordId } = this.state
27 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 45
   render() {
31
-    const { list } = this.state
46
+    const { customerList } = this.state
32 47
 
33 48
     return (
34 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 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 59
               <View className="name">
42 60
                 {item.name}
43 61
                 {
@@ -48,7 +66,7 @@ export default class transactionCustomer extends Taro.Component {
48 66
                 }
49 67
               </View>
50 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 70
             </View>
53 71
           ))
54 72
         }