许静 5 years ago
parent
commit
11c73049c8

+ 27
- 20
src/pages/person/customerAnalysis/myCustomer.js View File

@@ -9,7 +9,7 @@ import './index.scss'
9 9
 import ActivityItem from './item'
10 10
 import dayjs from 'dayjs'
11 11
 const iconImg = require('@assets/person/icon.png')
12
-import {getThumbnail } from '@utils/tools'
12
+import { getThumbnail } from '@utils/tools'
13 13
 import emptyImg from '@assets/empty.png'
14 14
 
15 15
 @connect(({ user, city }) => ({ user, city }))
@@ -217,29 +217,36 @@ export default class myCustomer extends Taro.Component {
217 217
   }
218 218
   addFollowRecord
219 219
   followSaveBtn() {
220
-    const { customerId } = this.$router.params
221
-    const params = {
222
-      recordType: '添加跟进',
223
-      recordContent: this.state.followValue,
224
-      customerSex: this.state.customerDetail.sex,
225
-      customerId,
226
-    }
227
-    addFollowRecord(params).then(res => {
228
-      this.queryFollowRecord(1)
220
+    if (this.state.followValue == "") {
229 221
       Taro.showToast({
230
-        title: '添加跟进成功',
222
+        title: '跟进内容不能为空',
231 223
         icon: 'none'
232 224
       })
233
-    }).catch(err => {
234
-      Taro.showToast({
235
-        title: '添加跟进失败',
236
-        icon: 'none'
225
+    } else {
226
+      const { customerId } = this.$router.params
227
+      const params = {
228
+        recordType: '添加跟进',
229
+        recordContent: this.state.followValue,
230
+        customerSex: this.state.customerDetail.sex,
231
+        customerId,
232
+      }
233
+      addFollowRecord(params).then(res => {
234
+        this.queryFollowRecord(1)
235
+        Taro.showToast({
236
+          title: '添加跟进成功',
237
+          icon: 'none'
238
+        })
239
+      }).catch(err => {
240
+        Taro.showToast({
241
+          title: '添加跟进失败',
242
+          icon: 'none'
243
+        })
237 244
       })
238
-    })
239
-    this.setState({
240
-      followVisible: false,
241
-      followValue: '',
242
-    })
245
+      this.setState({
246
+        followVisible: false,
247
+        followValue: '',
248
+      })
249
+    }
243 250
   }
244 251
   followCancelBtn() {
245 252
     this.setState({

+ 7
- 1
src/pages/person/customerAnalysis/transactionCustomer/index.js View File

@@ -64,6 +64,12 @@ export default class transactionCustomer extends Taro.Component {
64 64
     rest && rest()
65 65
     this.refreshing = false
66 66
   }
67
+  // 跳转我的客户详情
68
+  toMyCustomer(customerId) {
69
+    Taro.navigateTo({
70
+      url: `/pages/person/customerAnalysis/myCustomer?customerId=` + customerId
71
+    })
72
+  }
67 73
 
68 74
   render() {
69 75
     const { customerList, isEmpty, hasMore } = this.state
@@ -88,7 +94,7 @@ export default class transactionCustomer extends Taro.Component {
88 94
             {
89 95
               customerList.length &&
90 96
               customerList.map((item, index) => (
91
-                <View class="item" key={index + 'transaction'}>
97
+                <View class="item" key={index + 'transaction'} onClick={this.toMyCustomer.bind(this, item.customerId)}>
92 98
                   <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
93 99
                   <View className="name">
94 100
                     {item.name}

BIN
xiangsong.zip View File