许静 5 vuotta sitten
vanhempi
commit
afd4d795ab

+ 112
- 49
src/pages/person/customerAnalysis/followUpCustomer/index.js Näytä tiedosto

@@ -1,10 +1,11 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import Authorize from '@components/authorize'
3
+import ListView from '@components/ListView'
3 4
 import './index.scss'
4 5
 import { savePoint, updatePoint } from '@services/common'
5 6
 import { connect } from '@tarojs/redux'
6 7
 import { View, Text, Picker } from '@tarojs/components';
7
-import { queryCustomerList } from '@services/person'
8
+import { queryCustomerList, addFollowRecord } from '@services/person'
8 9
 const iconImg = require('@assets/person/icon.png')
9 10
 
10 11
 @connect(({ user, city }) => ({ user, city }))
@@ -16,7 +17,7 @@ export default class transactionCustomer extends Taro.Component {
16 17
 
17 18
 
18 19
   state = {
19
-    recordId: undefined, // 埋点ID
20
+
20 21
     customerList: [],
21 22
     inputValue: '',
22 23
     screenVisible: false,
@@ -24,8 +25,12 @@ export default class transactionCustomer extends Taro.Component {
24 25
     statusIndex: -1,
25 26
     startArrivalDate: '',
26 27
     endArrivalDate: '',
27
-    startReportDate : '',
28
+    startReportDate: '',
28 29
     endReportDate: '',
30
+    hasMore: true,
31
+    isEmpty: false,
32
+    recordId: undefined, // 埋点ID
33
+    pageIndex: 1
29 34
   }
30 35
 
31 36
   componentWillUnmount() {
@@ -34,47 +39,66 @@ export default class transactionCustomer extends Taro.Component {
34 39
   }
35 40
   componentDidShow() {
36 41
     Taro.showLoading()
37
-    this.loadList()
42
+    this.loadList(1)
38 43
 
39 44
   }
40
-  loadList() {
45
+
46
+  loadList = (page) => {
41 47
     const payload = {
42 48
       type: 'follow',
43
-      pageNumber: 0,
44
-      pageSize: 9999
49
+      pageNumber: page,
50
+      pageSize: 10
45 51
     }
46 52
     queryCustomerList(payload.type, payload).then(res => {
47 53
 
48 54
       this.setState({
49
-        customerList: res.records || []
55
+        customerList: res.records || [],
56
+        isEmpty: res.total == 0,
57
+        hasMore: res.current < res.page,
58
+        pageIndex: res.current >= res.pages ? res.pages : res.current
50 59
       })
51 60
       Taro.hideLoading()
52 61
     })
53 62
   }
54 63
 
64
+  onScrollToLower = async (fn) => {
65
+    const { pageIndex } = this.state;
66
+    this.loadList(pageIndex + 1)
67
+    fn && fn();
68
+  }
69
+  onPullDownRefresh = (rest) => {
70
+    // debugger
71
+    if (this.refreshing) return
72
+    this.refreshing = true
73
+    this.loadList(1)
74
+    rest && rest()
75
+    this.refreshing = false
76
+  }
77
+
55 78
 
56 79
   changeInput = e => {
57 80
     this.setState({
58 81
       inputValue: e.detail.value
59 82
     })
60 83
   }
84
+  // 查询
61 85
   searchBtn() {
62
-    // const playload = {
63
-    //   inputValue: this.state.inputValue
64
-    // }
86
+
65 87
     this.filterCustomerList();
66
-   
88
+
67 89
   }
68
-  filterCustomerList(){
90
+  // 筛查跟进客户
91
+  filterCustomerList() {
69 92
 
70 93
     const payload = {
71 94
       type: 'follow',
72 95
       pageNumber: 0,
73 96
       pageSize: 9999,
74
-      status:this.state.statusIndex!=0?this.state.statusIndex:'',
75
-      startArrivalDate:this.state.startArrivalDate,
97
+      name: this.state.inputValue,
98
+      status: (this.state.statusIndex == 0 || this.state.statusIndex == -1) ? '' : this.state.statusIndex,
99
+      startArrivalDate: this.state.startArrivalDate,
76 100
       endArrivalDate: this.state.endArrivalDate,
77
-      startReportDate : this.state.startReportDate,
101
+      startReportDate: this.state.startReportDate,
78 102
       endReportDate: this.state.endReportDate,
79 103
     }
80 104
     queryCustomerList(payload.type, payload).then(res => {
@@ -91,55 +115,80 @@ export default class transactionCustomer extends Taro.Component {
91 115
       screenVisible: false,
92 116
     })
93 117
   }
118
+  // 显示筛查弹框
94 119
   screenShow() {
95 120
     this.setState({
96 121
       screenVisible: true,
97 122
     })
98 123
   }
124
+  // 选择状态
99 125
   chooseStatus(item, inx) {
100 126
     this.setState({
101 127
       statusIndex: inx,
102 128
     })
103
-    console.log(item, inx, "eeeeeeeeeeee")
104 129
   }
130
+  // 到访开始时间
105 131
   onVisitDateChange = e => {
106 132
     this.setState({
107 133
       startArrivalDate: e.detail.value
108 134
     })
109 135
   }
136
+  // 到访结束时间
110 137
   onVisitDateChange2 = e => {
111 138
     this.setState({
112 139
       endArrivalDate: e.detail.value
113 140
     })
114 141
   }
142
+  // 报备开始时间
115 143
   onReportDateChange = e => {
116 144
     this.setState({
117
-      startReportDate : e.detail.value
145
+      startReportDate: e.detail.value
118 146
     })
119 147
   }
148
+  // 报备结束时间
120 149
   onReportDateChange2 = e => {
121 150
     this.setState({
122 151
       endReportDate: e.detail.value
123 152
     })
124 153
   }
125
- 
154
+  // 取消筛查
126 155
   cancelBtn() {
127 156
     this.setState({
128 157
       screenVisible: false,
129 158
       statusIndex: -1,
130 159
       startArrivalDate: '',
131 160
       endArrivalDate: '',
132
-      startReportDate : '',
161
+      startReportDate: '',
133 162
       endReportDate: '',
134 163
     })
135 164
   }
165
+  // 跳转我的客户详情
136 166
   toMyCustomer(customerId) {
137 167
     Taro.navigateTo({
138
-      url: `/pages/person/customerAnalysis/myCustomer?customerId=`+customerId
168
+      url: `/pages/person/customerAnalysis/myCustomer?customerId=` + customerId
169
+    })
170
+  }
171
+  // 拨打电话
172
+  handleTelClick(item, e) {
173
+    e.stopPropagation()
174
+    Taro.makePhoneCall({
175
+      phoneNumber: item.phone
176
+    })
177
+    const params = {
178
+      recordType: '拨打电话',
179
+      customerSex: item.sex,
180
+      customerId: item.customerId,
181
+    }
182
+    addFollowRecord(params).then(res => {
183
+
184
+    })
185
+    this.setState({
186
+      followVisible: false,
139 187
     })
140 188
   }
189
+
141 190
   renderScreenBox() {
142
-    const { statusList, statusIndex, startArrivalDate, endArrivalDate, startReportDate , endReportDate } = this.state
191
+    const { statusList, statusIndex, startArrivalDate, endArrivalDate, startReportDate, endReportDate } = this.state
143 192
     return (
144 193
       <View className="mask">
145 194
         <View className="content">
@@ -159,7 +208,7 @@ export default class transactionCustomer extends Taro.Component {
159 208
                 {!startArrivalDate && <Text className="placeholder">起始时间</Text>}
160 209
               </View>
161 210
             </Picker>-<Picker mode='date' onChange={this.onVisitDateChange2}>
162
-              <View className='picker'> 
211
+              <View className='picker'>
163 212
                 {endArrivalDate}
164 213
                 {!endArrivalDate && <Text className="placeholder">结束时间</Text>}
165 214
               </View>
@@ -169,8 +218,8 @@ export default class transactionCustomer extends Taro.Component {
169 218
             报备时间:
170 219
               <Picker mode='date' onChange={this.onReportDateChange}>
171 220
               <View className='picker'>
172
-                {startReportDate }
173
-                {!startReportDate  && <Text className="placeholder">起始时间</Text>}
221
+                {startReportDate}
222
+                {!startReportDate && <Text className="placeholder">起始时间</Text>}
174 223
               </View>
175 224
             </Picker>-<Picker mode='date' onChange={this.onReportDateChange2}>
176 225
               <View className='picker'>
@@ -195,7 +244,7 @@ export default class transactionCustomer extends Taro.Component {
195 244
   }
196 245
 
197 246
   render() {
198
-    const { customerList, screenVisible } = this.state
247
+    const { customerList, screenVisible, isEmpty, hasMore } = this.state
199 248
 
200 249
     return (
201 250
       <View>
@@ -208,29 +257,43 @@ export default class transactionCustomer extends Taro.Component {
208 257
           <Button className="btn" onClick={this.searchBtn} >搜索</Button>
209 258
         </View>
210 259
         <View style="padding:10px">
211
-          {
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>
220
-                <View className="name">
221
-                  {item.name}
222
-                  {
223
-                    item.sex == '1' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px -20px;width: 18px;height: 18px;`}></View>
224
-                  }
225
-                  {
226
-                    item.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
227
-                  }
228
-                </View>
229
-                <View className="phone">{item.phone}<View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0px -44px;width: 22px;height: 22px;`}></View> </View>
230
-                <View className="status">报备</View>
231
-              </View>
232
-            ))
233
-          }
260
+          <ListView
261
+            className="wrap"
262
+            needInit
263
+            isEmpty={isEmpty}
264
+            emptyText="暂无活动~"
265
+            hasMore={hasMore}
266
+            onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
267
+            onScrollToLower={fn => this.onScrollToLower(fn)}
268
+          >
269
+            <View className="list">
270
+              {
271
+                !customerList.length &&
272
+                <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
273
+              }
274
+              {
275
+                customerList.length &&
276
+                customerList.map((item, index) => (
277
+                  <View class="item" key={index + 'customerList'} onClick={this.toMyCustomer.bind(this, item.customerId)}>
278
+                    <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
279
+                    <View className="name">
280
+                      {item.name}
281
+                      {
282
+                        item.sex == '1' && <View style={`margin-left:20rpx;background-image: url(${iconImg});background-size: 100%;background-position: 0rpx -40rpx;width: 36rpx;height: 36rpx;`}></View>
283
+                      }
284
+                      {
285
+                        item.sex == '2' && <View style={`margin-left:20rpx;background-image: url(${iconImg});background-size: 100%;background-position: 0rpx 0px;width: 36rpx;height: 36rpx;`}></View>
286
+                      }
287
+                    </View>
288
+                    <View className="phone" onClick={this.handleTelClick.bind(this, item)}>{item.phone}<View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0rpx -88rpx;width: 44rpx;height: 44rpx;margin-left:10rpx`}></View> </View>
289
+                    <View className="status">报备</View>
290
+                  </View>
291
+                ))
292
+              }
293
+            </View>
294
+          </ListView>
295
+
296
+
234 297
         </View>
235 298
       </View>
236 299
     )

+ 35
- 17
src/pages/person/customerAnalysis/index.scss Näytä tiedosto

@@ -84,7 +84,22 @@
84 84
     }
85 85
   }
86 86
 }
87
-
87
+.empty{
88
+  width:100%;
89
+  height:40vh;
90
+  display: flex;
91
+  flex-direction: column;
92
+  justify-content: center;
93
+  align-items: center;
94
+  &__img{
95
+    width:300px;
96
+  }
97
+  &__text{
98
+    font-size:30px;
99
+    color: $text-color-light;
100
+    margin-top: 20px;
101
+  }
102
+}
88 103
 
89 104
 .user_con{
90 105
   margin: 0 20px 40px 20px;
@@ -127,6 +142,8 @@
127 142
     position: absolute;
128 143
     bottom:76px;
129 144
     left:320px;
145
+    display: flex;
146
+    align-items: center;
130 147
   }
131 148
   }
132 149
   .my-tab{
@@ -185,22 +202,21 @@
185 202
 
186 203
     }
187 204
     .tab-pane2{
188
-      padding: 0 40px;
189
-      .date{
190
-        font-size: 26px;
191
-        color: #999;
192
-        margin-top: 30px;
193
-      }
205
+      padding: 10px 0;
194 206
       .record-item{
195
-        font-size: 30px;
196
-        margin-top: 20px;
197
-        color: #333;
198
-        display: flex;
199
-        align-items: center;
200
-        justify-content: space-between;
207
+        padding:0 30px;
208
+        background:rgba(255,255,255,1);
209
+        box-shadow:0px 1px 0px 0px rgba(0,0,0,0.08);
210
+        .title{
211
+          font-size: 30px;
212
+          color: #333;
213
+          margin-top: 20px;
214
+        }
201 215
         .time{
202 216
           font-size: 26px;
203 217
           color: #999;
218
+          text-align: right;
219
+          line-height: 46px;
204 220
         }
205 221
       }
206 222
     }
@@ -240,13 +256,13 @@
240 256
     background:rgba(0,0,0,0.22);
241 257
     .base-con{
242 258
       width: 94%;
243
-      height:610px;
259
+      height:740px;
244 260
       position: absolute;
245 261
       left: 3%;
246 262
       top: 50%;
247 263
       background-color: #fff;
248 264
       padding: 40px;
249
-      margin-top: -305px;
265
+      margin-top: -370px;
250 266
       border-radius:12px;
251 267
       .con-item{
252 268
         display: flex;
@@ -275,10 +291,12 @@
275 291
         align-items: center;
276 292
         justify-content: space-between;
277 293
         width:456px;
294
+        padding: 16px;
295
+        background-color: #f4f4f4;
278 296
       }
279 297
       .right-icon{
280
-        width:20px;
281
-        height:20px;
298
+        width:18px;
299
+        height:18px;
282 300
         border-top: 2px solid #999;
283 301
         border-right: 2px solid #999;
284 302
         transform:rotate(45deg);

+ 191
- 77
src/pages/person/customerAnalysis/myCustomer.js Näytä tiedosto

@@ -2,12 +2,13 @@ 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, getVisitRecord, getActivityList, getFollowRecord } from '@services/person'
5
+import { getCustomerDetail, getVisitRecord, getActivityList, getFollowRecord, addFollowRecord } from '@services/person'
6 6
 import { connect } from '@tarojs/redux'
7 7
 import './index.scss'
8 8
 import ActivityItem from './item'
9 9
 import dayjs from 'dayjs'
10 10
 const iconImg = require('@assets/person/icon.png')
11
+import emptyImg from '@assets/empty.png'
11 12
 
12 13
 @connect(({ user, city }) => ({ user, city }))
13 14
 export default class myCustomer extends Taro.Component {
@@ -22,12 +23,14 @@ export default class myCustomer extends Taro.Component {
22 23
     activityList: [],
23 24
     followVisible: false,
24 25
     baseVisible: false,
25
-    message: '', //跟进内容
26
+    followValue: '', //跟进内容
26 27
     desc: '', //客户描述
27
-    selectorChecked: '',
28
-    selector: ['美国', '中国', '巴西', '日本'],
28
+    selector: ['高层', '别墅', '公寓'],
29
+    sexSelector: ['男', '女'],
29 30
     customerDetail: {},
30
-    followRecord: []
31
+    followRecord: [],
32
+    visitRecord: [],
33
+    baseInfo: {}, // 完善信息弹框数据
31 34
 
32 35
   }
33 36
 
@@ -38,52 +41,60 @@ export default class myCustomer extends Taro.Component {
38 41
   }
39 42
 
40 43
   handleClick(value) {
44
+    this.setState({
45
+      current: value
46
+    })
41 47
     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
-      })
48
+      this.queryVisitRecord();
53 49
     } 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
-      })
50
+      this.queryActivityList();
65 51
     } 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
-        )
52
+      this.queryFollowRecord();
53
+    }
54
+  }
55
+  // 获取访问记录
56
+  queryVisitRecord() {
57
+    const { customerId } = this.$router.params
58
+    const payload = {
59
+      pageNumber: '0',
60
+      pageSize: '10',
61
+      customerId,
62
+    }
63
+    getVisitRecord(payload).then(res => {
64
+      this.setState({
65
+        visitRecord: res.records || []
78 66
       })
67
+    })
68
+  }
69
+  // 获取活动信息
70
+  queryActivityList() {
71
+    const { customerId } = this.$router.params
72
+    const payload = {
73
+      pageNumber: '0',
74
+      pageSize: '10',
75
+      customerId,
79 76
     }
80
-    this.setState({
81
-      current: value
82
-    }, )
77
+    getActivityList(payload).then(res => {
78
+      this.setState({
79
+        activityList: res.records || []
80
+      })
81
+    })
82
+  }
83
+  // 获取跟进记录
84
+  queryFollowRecord() {
85
+    const { customerId } = this.$router.params
86
+    const payload = {
87
+      pageNumber: '0',
88
+      pageSize: '30',
89
+      customerId,
90
+    }
91
+    getFollowRecord(payload).then(res => {
92
+      this.setState({
93
+        followRecord: res.records
94
+      })
95
+    })
83 96
   }
84
-
85 97
   componentDidShow() {
86
-
87 98
     this.loadList()
88 99
   }
89 100
   loadList() {
@@ -125,23 +136,35 @@ export default class myCustomer extends Taro.Component {
125 136
       followVisible: true,
126 137
     })
127 138
   }
128
-  saveBtn() {
139
+  followSaveBtn() {
140
+    const { customerId } = this.$router.params
141
+    const params = {
142
+      recordType: '添加跟进',
143
+      recordContent: this.state.followValue,
144
+      customerSex: this.state.customerDetail.sex,
145
+      customerId,
146
+    }
147
+    addFollowRecord(params).then(res => {
148
+      this.queryFollowRecord()
149
+    })
129 150
     this.setState({
130 151
       followVisible: false,
152
+      followValue: '',
131 153
     })
132 154
   }
133
-  cancelBtn() {
155
+  followCancelBtn() {
134 156
     this.setState({
135 157
       followVisible: false,
158
+      followValue: '',
136 159
     })
137 160
   }
138 161
   onTextareaChange(e) {
139 162
     this.setState({
140
-      message: e.target.value
163
+      followValue: e.target.value
141 164
     })
142 165
   }
143 166
   renderFollowBox() {
144
-    const { message } = this.state
167
+    const { followValue } = this.state
145 168
     return (
146 169
       <View className="mask">
147 170
         <View className="content">
@@ -151,17 +174,17 @@ export default class myCustomer extends Taro.Component {
151 174
             </View>
152 175
             <Textarea
153 176
               className="textarea"
154
-              value={message}
177
+              value={followValue}
155 178
               onInput={this.onTextareaChange}
156 179
               maxLength={150}
157 180
               placeholder='不超过150字'
158 181
             />
159 182
           </View>
160 183
           <View className="bottom-btn">
161
-            <View className="save" onClick={this.saveBtn}>
184
+            <View className="save" onClick={this.followSaveBtn}>
162 185
               保存
163 186
             </View>
164
-            <View className="cancel" onClick={this.cancelBtn}>
187
+            <View className="cancel" onClick={this.followCancelBtn}>
165 188
               取消
166 189
           </View>
167 190
           </View>
@@ -172,6 +195,7 @@ export default class myCustomer extends Taro.Component {
172 195
   perfectInformation() {
173 196
     this.setState({
174 197
       baseVisible: true,
198
+      baseInfo: this.state.customerDetail,
175 199
     })
176 200
   }
177 201
   baseSaveBtn() {
@@ -184,26 +208,88 @@ export default class myCustomer extends Taro.Component {
184 208
       baseVisible: false,
185 209
     })
186 210
   }
211
+  onPriceRangeChange(e) {
212
+    this.setState({
213
+      baseInfo: {
214
+        ...baseInfo,
215
+        priceRange: e.target.value
216
+      }
217
+    })
218
+  }
187 219
   onBaseTextareaChange(e) {
188 220
     this.setState({
189
-      desc: e.target.value
221
+      baseInfo: {
222
+        ...baseInfo,
223
+        describe: e.target.value
224
+      }
190 225
     })
191 226
   }
192 227
   onChange = e => {
193 228
     this.setState({
194
-      selectorChecked: this.state.selector[e.detail.value]
229
+      baseInfo: {
230
+        ...baseInfo,
231
+        sex: this.state.selector[e.detail.value]
232
+      }
233
+    })
234
+  }
235
+  onSexChange = e => {
236
+    console, log(e, "eeeeeeeeeeeeeee")
237
+    this.setState({
238
+      baseInfo: {
239
+        ...baseInfo,
240
+        sex: this.state.sexSelector[e.detail.value]
241
+      }
242
+    })
243
+  }
244
+  // 拨打电话
245
+  handleTelClick(customer, e) {
246
+    e.stopPropagation()
247
+    Taro.makePhoneCall({
248
+      phoneNumber: customer.phone
249
+    })
250
+    const params = {
251
+      recordType: '拨打电话',
252
+      customerSex: customer.sex,
253
+      customerId: customer.customerId,
254
+    }
255
+    addFollowRecord(params).then(res => {
256
+      this.queryFollowRecord()
257
+    })
258
+    this.setState({
259
+      followVisible: false,
195 260
     })
196 261
   }
197 262
   renderBaseBox() {
198
-    const { desc, selector, selectorChecked } = this.state
263
+    const { baseInfo, desc, selector, selectorChecked, sexSelector, sexSelectorChecked } = this.state
199 264
     return (
200 265
       <View className="mask">
201 266
         <View className="base-con">
267
+          <View className="con-item">
268
+            <View style="font-size:14px;color:#666">
269
+              姓名:
270
+            </View>
271
+            <Input className="input" value={baseInfo.name} onInput={this.onNameChange} placeholder='' />
272
+          </View>
273
+          <View className="con-item">
274
+            <View style="font-size:14px;color:#666">
275
+              性别:
276
+            </View>
277
+            <View className="con-picker" >
278
+              <View>
279
+                <Picker mode='selector' range={sexSelector} onChange={this.onSexChange}>
280
+                  <View className='picker'>
281
+                    {baseInfo.sex == '1' ? '男' : baseInfo.sex == '1' ? '女' : ''}
282
+                  </View>
283
+                </Picker>
284
+              </View>
285
+              <View className="right-icon"></View>
286
+            </View>
287
+          </View>
202 288
           <View className="con-item">
203 289
             <View style="font-size:14px;color:#666">
204 290
               物业类型:
205 291
             </View>
206
-            <Input className="input" value={desc} onInput={this.onBaseTextareaChange} placeholder='' />
292
+            <Input className="input" value={baseInfo.realtyManageType} onInput={this.onManageTypeChange} placeholder='' />
207 293
           </View>
208 294
           <View className="con-item">
209 295
             <View style="font-size:14px;color:#666">
@@ -213,7 +299,7 @@ export default class myCustomer extends Taro.Component {
213 299
               <View>
214 300
                 <Picker mode='selector' range={selector} onChange={this.onChange}>
215 301
                   <View className='picker'>
216
-                    当前选择:{selectorChecked}
302
+                    {baseInfo.demandType || ''}
217 303
                   </View>
218 304
                 </Picker>
219 305
               </View>
@@ -224,7 +310,7 @@ export default class myCustomer extends Taro.Component {
224 310
             <View style="font-size:14px;color:#666">
225 311
               价格区间:
226 312
             </View>
227
-            <Input className="input" value={desc} onInput={this.onBaseTextareaChange} placeholder='' />
313
+            <Input className="input" value={baseInfo.priceRange} onInput={this.onPriceRangeChange} placeholder='' />
228 314
           </View>
229 315
           <View style="display:flex;justify-content: space-between;">
230 316
             <View style="font-size:14px;color:#666">
@@ -232,10 +318,10 @@ export default class myCustomer extends Taro.Component {
232 318
             </View>
233 319
             <Textarea
234 320
               className="textarea"
235
-              value={desc}
321
+              value={baseInfo.describe}
236 322
               onInput={this.onBaseTextareaChange}
237 323
               maxLength={150}
238
-              placeholder='不超过150字'
324
+              placeholder=''
239 325
             />
240 326
           </View>
241 327
           <View className="bottom-btn">
@@ -255,7 +341,7 @@ export default class myCustomer extends Taro.Component {
255 341
   render() {
256 342
 
257 343
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
258
-    const { customerDetail, activityList, followRecord, followVisible, baseVisible } = this.state
344
+    const { customerDetail, visitRecord, activityList, followRecord, followVisible, baseVisible, } = this.state
259 345
     return (
260 346
       <View>
261 347
         {followVisible && this.renderFollowBox()}
@@ -272,7 +358,7 @@ export default class myCustomer extends Taro.Component {
272 358
               customerDetail.sex == '2' && <View style={`margin-left:10px;background-image: url(${iconImg});background-size: 100%;background-position: 0px 0px;width: 18px;height: 18px;`}></View>
273 359
             }
274 360
           </View>
275
-          <View className='user__left__phone'>{customerDetail.phone}</View>
361
+          <View onClick={this.handleTelClick.bind(this, customerDetail)} className='user__left__phone'>{customerDetail.phone}<View style={`background-image: url(${iconImg});background-size: 100%;background-position: 0rpx -88rpx;width: 44rpx;height: 44rpx;margin-left:10rpx`}></View></View>
276 362
         </View>
277 363
         <AtTabs className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
278 364
           <AtTabsPane current={this.state.current} index={0} >
@@ -288,19 +374,31 @@ export default class myCustomer extends Taro.Component {
288 374
           </AtTabsPane>
289 375
           <AtTabsPane current={this.state.current} index={1}>
290 376
             <View className="tab-pane2 pane">
291
-              <View className="date">2019年11月11日</View>
292
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
293
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
294
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
295
-              <View className="date">2019年11月11日</View>
296
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
297
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
298
-              <View className="record-item"><View >查看项目详情:银城悦见山</View><View className="time">12:30:00</View> </View>
377
+              {visitRecord.length && visitRecord.map(item => (
378
+                <View className="record-item">
379
+                  <View className="title" >{item.activity}</View>
380
+                  <View className="time">{dayjs(item.visitTime).format('YYYY年MM月DD日 HH:mm:ss') || ''}</View>
381
+                </View>
382
+              ))
383
+              }
384
+              {!visitRecord.length &&
385
+                <View className="empty">
386
+                  <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
387
+                  <View className="empty__text">暂无访问记录~</View>
388
+                </View>
389
+              }
390
+
299 391
             </View>
300 392
           </AtTabsPane>
301 393
           <AtTabsPane current={this.state.current} index={2}>
302 394
             <View className="tab-pane3 pane">
303
-              {activityList.length > 0 &&
395
+              {!activityList.length &&
396
+                <View className="empty">
397
+                  <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
398
+                  <View className="empty__text">暂无活动信息~</View>
399
+                </View>
400
+              }
401
+              {activityList.length &&
304 402
                 activityList.map(item => (
305 403
                   <ActivityItem
306 404
                     data={item}
@@ -313,13 +411,29 @@ export default class myCustomer extends Taro.Component {
313 411
           </AtTabsPane>
314 412
           <AtTabsPane current={this.state.current} index={3}>
315 413
             <View style="padding:10px 20px 120px 20px">
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
-              } */}
414
+              {followRecord.length && followRecord.map(item => (
415
+                <View>
416
+                  <View style=" display:flex;justify-content: space-between;align-items: center;color: #333;font-size: 16px; margin-bottom:20rpx;">
417
+                    <View style=" display: flex;align-items: center;"><View style="width:8px;height:8px;margin-right:20rpx;display:inline-block;background:rgba(246,182,29,1);border-radius: 50%;"></View>{item.recordType}</View>
418
+                    <View classNam="time" style=" font-size: 26rpx;color: #999;">{dayjs(item.createDate).format('YYYY年MM月DD日 HH:mm:ss') || ''}</View>
419
+                  </View>
420
+                  {
421
+                    item.recordContent &&
422
+                    <View style="font-size:28rpx;color:#666;padding-left:32rpx;margin-bottom:20rpx;">
423
+                      {item.recordContent}
424
+                    </View>
425
+                  }
426
+
427
+                </View>
428
+              ))
429
+              }
430
+              {!followRecord.length &&
431
+                <View className="empty">
432
+                  <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
433
+                  <View className="empty__text">暂无跟进记录~</View>
434
+                </View>
435
+              }
436
+
323 437
               <View className="btn" onClick={this.addFollow}>添加跟进</View>
324 438
             </View>
325 439
 

+ 10
- 5
src/services/person.js Näytä tiedosto

@@ -19,27 +19,32 @@ export const queryMyCustomer = payload => fetch({ url: API_MY_CUSTOMER, payload
19 19
  * 获取客户列表
20 20
  * @param {*} type  
21 21
  */
22
-export const  queryCustomerList = (type, payload) => fetch({ url: `${API_CUSTOMER_LIST}/${type}`, payload })
22
+export const queryCustomerList = (type, payload) => fetch({ url: `${API_CUSTOMER_LIST}/${type}`, payload })
23 23
 /**
24 24
  * 获取客户列表
25 25
  * @param {*} customerId  
26 26
  */
27
-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 28
 /**
29 29
  * 获取访问记录
30 30
  * @param {*} payload  
31 31
  */
32
-export const  getVisitRecord = ( payload) => fetch({ url: API_VISIT_RECORD, payload })
32
+export const getVisitRecord = (payload) => fetch({ url: API_VISIT_RECORD, payload })
33 33
 /**
34 34
  * 获取活动信息
35 35
  * @param {*} payload  
36 36
  */
37
-export const  getActivityList = ( payload) => fetch({ url: API_ACTIVITY_LIST_CUSTOMER, payload })
37
+export const getActivityList = (payload) => fetch({ url: API_ACTIVITY_LIST_CUSTOMER, payload })
38 38
 /**
39 39
  * 获取跟进记录
40 40
  * @param {*} payload  
41 41
  */
42
-export const  getFollowRecord = ( payload) => fetch({ url: API_FOLLOW_LIST, payload })
42
+export const getFollowRecord = (payload) => fetch({ url: API_FOLLOW_LIST, payload })
43
+/**
44
+ * 添加跟进记录
45
+ * @param {*} payload  
46
+ */
47
+export const addFollowRecord = (payload) => fetch({ url: API_FOLLOW_LIST, payload, method: 'POST' })
43 48
 
44 49
 
45 50