Browse Source

Merge branch 'v3.5.1' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into v3.5.1

张延森 5 years ago
parent
commit
0cfed0053a

+ 1
- 60
src/components/BackHomeBtn/index.js View File

8
   static defaultProps = {
8
   static defaultProps = {
9
     style: {}
9
     style: {}
10
   }
10
   }
11
-  state ={
12
-    buttonTop: 0,
13
-    buttonLeft: 0,
14
-    windowHeight: '',
15
-    windowWidth: ''
16
-  }
17
-  componentDidShow(){
18
-    Taro.getSystemInfo({
19
-      success: function (res) {
20
-        console.log(res,"9999999999999")
21
-        realWindowWidth = res.windowWidth
22
-        realWindowHeight = res.windowHeight
23
-      }
24
-    })
25
-  
26
-  }
27
-
28
   handleClick() {
11
   handleClick() {
29
     Taro.switchTab({
12
     Taro.switchTab({
30
       url: `/pages/project/index`
13
       url: `/pages/project/index`
31
     })
14
     })
32
   }
15
   }
33
-  buttonStart=(e)=> {
34
-    console.log(e,"eeeeeeeeeeeee")
35
-    startPoint = e.touches[0]
36
-  }
37
-  buttonMove=(e)=> {
38
-    console.log(e,"888888888888888")
39
-    var endPoint = e.touches[e.touches.length - 1]
40
-    var translateX = endPoint.clientX - startPoint.clientX
41
-    var translateY = endPoint.clientY - startPoint.clientY
42
-    startPoint = endPoint
43
-    var buttonTop = this.state.buttonTop + translateY
44
-    var buttonLeft = this.state.buttonLeft + translateX
45
-    //判断是移动否超出屏幕
46
-    if (buttonLeft+50 >= this.state.windowWidth){
47
-      buttonLeft = this.state.windowWidth-50;
48
-    }
49
-    if (buttonLeft<=0){
50
-      buttonLeft=0;
51
-    }
52
-    if (buttonTop<=0){
53
-      buttonTop=0
54
-    }
55
-    if (buttonTop + 50 >= this.state.windowHeight){
56
-      buttonTop = this.state.windowHeight-50;
57
-    }
58
-    this.setState({
59
-      buttonTop: buttonTop,
60
-      buttonLeft: buttonLeft
61
-    })
62
-  }
63
-  buttonEnd=(e)=> {
64
-
65
-  }
66
-
67
   render() {
16
   render() {
68
     return (
17
     return (
69
-      // <View className="back-home" style={this.props.style} onClick={this.handleClick}  >
70
-      //   <Image src={require('@assets/homeicon.png')} className='home-img'></Image>
71
-      //   <Text className="text">首页</Text>
72
-      // </View>
73
-      <View className="back-home"
74
-       style={this.props.style} 
75
-       style='top:{this.state.buttonTop}px;left:{this.state.buttonLeft}px'
76
-       onClick={this.handleClick} ontouchmove={this.buttonMove} ontouchstart={this.buttonStart} ontouchend={this.buttonEnd} >
77
-        {/* <Text className="iconfont icon-shouyeshouye"></Text> */}
18
+      <View className="back-home" style={this.props.style} onClick={this.handleClick}  >
78
         <Image src={require('@assets/homeicon.png')} className='home-img'></Image>
19
         <Image src={require('@assets/homeicon.png')} className='home-img'></Image>
79
         <Text className="text">首页</Text>
20
         <Text className="text">首页</Text>
80
       </View>
21
       </View>

+ 9
- 7
src/pages/person/customerAnalysis/followUpCustomer/index.js View File

42
 
42
 
43
   }
43
   }
44
 
44
 
45
-  loadList = (page) => {
45
+  loadList(pageNumber) {
46
     const payload = {
46
     const payload = {
47
       type: 'follow',
47
       type: 'follow',
48
-      pageNumber: page,
48
+      pageNumber,
49
       pageSize: 10
49
       pageSize: 10
50
     }
50
     }
51
     queryCustomerList(payload.type, payload).then(res => {
51
     queryCustomerList(payload.type, payload).then(res => {
52
-
52
+      const { records, list, total, current, pages } = res || {}
53
+      const _list = records || list || []
54
+      const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
53
       this.setState({
55
       this.setState({
54
-        customerList: res.records || [],
55
-        isEmpty: res.total == 0,
56
-        hasMore: res.current < res.page,
57
-        pageIndex: res.current >= res.pages ? res.pages : res.current
56
+        customerList: newList,
57
+        isEmpty: total == 0,
58
+        hasMore: current < pages,
59
+        pageIndex: current >= pages ? pages : current
58
       })
60
       })
59
       Taro.hideLoading()
61
       Taro.hideLoading()
60
     })
62
     })

+ 0
- 2
src/pages/person/customerAnalysis/index.scss View File

6
   height:100vh;
6
   height:100vh;
7
 }
7
 }
8
 
8
 
9
-
10
-
11
 .tab-box{
9
 .tab-box{
12
   .at-tabs__header{
10
   .at-tabs__header{
13
     width: 86%;
11
     width: 86%;

+ 181
- 72
src/pages/person/customerAnalysis/myCustomer.js View File

1
 import Taro, { Component } from '@tarojs/taro';
1
 import Taro, { Component } from '@tarojs/taro';
2
 import { AtTabs, AtTabsPane } from 'taro-ui'
2
 import { AtTabs, AtTabsPane } from 'taro-ui'
3
+import ListView from '@components/ListView'
3
 import "taro-ui/dist/style/components/tabs.scss"
4
 import "taro-ui/dist/style/components/tabs.scss"
4
 import { savePoint, updatePoint } from '@services/common'
5
 import { savePoint, updatePoint } from '@services/common'
5
 import { getCustomerDetail, getVisitRecord, getActivityList, getFollowRecord, addFollowRecord, commitCustomerInfo } from '@services/person'
6
 import { getCustomerDetail, getVisitRecord, getActivityList, getFollowRecord, addFollowRecord, commitCustomerInfo } from '@services/person'
31
     followRecord: [],
32
     followRecord: [],
32
     visitRecord: [],
33
     visitRecord: [],
33
     baseInfo: {}, // 完善信息弹框数据
34
     baseInfo: {}, // 完善信息弹框数据
34
-
35
+    hasMore: true,
36
+    isEmpty: false,
37
+    pageIndex: 1,
38
+    hasMore2: true,
39
+    isEmpty2: false,
40
+    pageIndex2: 1,
41
+    hasMore3: true,
42
+    isEmpty3: false,
43
+    pageIndex3: 1,
35
   }
44
   }
36
 
45
 
37
   componentWillUnmount() {
46
   componentWillUnmount() {
45
       current: value
54
       current: value
46
     })
55
     })
47
     if (value == 1) {
56
     if (value == 1) {
48
-      this.queryVisitRecord();
57
+      this.queryVisitRecord(1);
49
     } else if (value == 2) {
58
     } else if (value == 2) {
50
-      this.queryActivityList();
59
+      this.queryActivityList(1);
51
     } else if (value == 3) {
60
     } else if (value == 3) {
52
-      this.queryFollowRecord();
61
+      this.queryFollowRecord(1);
53
     }
62
     }
54
   }
63
   }
64
+  // 访问记录上拉加载下拉刷新
65
+  onScrollToLower = async (fn) => {
66
+    const { pageIndex } = this.state;
67
+    this.queryVisitRecord(pageIndex + 1)
68
+    fn && fn();
69
+  }
70
+  onPullDownRefresh = (rest) => {
71
+    // debugger
72
+    if (this.refreshing) return
73
+    this.refreshing = true
74
+    this.queryVisitRecord(1)
75
+    rest && rest()
76
+    this.refreshing = false
77
+  }
78
+  // 活动信息上拉加载下拉刷新
79
+  onScrollToLower2 = async (fn) => {
80
+    const { pageIndex2 } = this.state;
81
+    this.queryActivityList(pageIndex2 + 1)
82
+    fn && fn();
83
+  }
84
+  onPullDownRefresh2 = (rest) => {
85
+    // debugger
86
+    if (this.refreshing) return
87
+    this.refreshing = true
88
+    this.queryActivityList(1)
89
+    rest && rest()
90
+    this.refreshing = false
91
+  }
92
+  // 跟进记录上拉加载下拉刷新
93
+  onScrollToLower3 = async (fn) => {
94
+    const { pageIndex3 } = this.state;
95
+    this.queryFollowRecord(pageIndex3 + 1)
96
+    fn && fn();
97
+  }
98
+  onPullDownRefresh3 = (rest) => {
99
+    // debugger
100
+    if (this.refreshing) return
101
+    this.refreshing = true
102
+    this.queryFollowRecord(1)
103
+    rest && rest()
104
+    this.refreshing = false
105
+  }
55
   // 获取访问记录
106
   // 获取访问记录
56
-  queryVisitRecord() {
107
+  queryVisitRecord(pageNumber) {
57
     const { customerId } = this.$router.params
108
     const { customerId } = this.$router.params
58
     const payload = {
109
     const payload = {
59
-      pageNumber: '0',
110
+      pageNumber,
60
       pageSize: '10',
111
       pageSize: '10',
61
       customerId,
112
       customerId,
62
     }
113
     }
63
     getVisitRecord(payload).then(res => {
114
     getVisitRecord(payload).then(res => {
115
+      const { records, list, total, current, pages } = res || {}
116
+      const _list = records || list || []
117
+      const newList = current <= 1 ? _list : this.state.visitRecord.concat(_list)
64
       this.setState({
118
       this.setState({
65
-        visitRecord: res.records || []
119
+        visitRecord: newList,
120
+        isEmpty: total == 0,
121
+        hasMore: current < pages,
122
+        pageIndex: current >= pages ? pages : current
66
       })
123
       })
67
     })
124
     })
68
   }
125
   }
69
   // 获取活动信息
126
   // 获取活动信息
70
-  queryActivityList() {
127
+  queryActivityList(pageNumber) {
71
     const { customerId } = this.$router.params
128
     const { customerId } = this.$router.params
72
     const payload = {
129
     const payload = {
73
-      pageNumber: '0',
130
+      pageNumber,
74
       pageSize: '10',
131
       pageSize: '10',
75
       customerId,
132
       customerId,
76
     }
133
     }
77
     getActivityList(payload).then(res => {
134
     getActivityList(payload).then(res => {
135
+      const { records, list, total, current, pages } = res || {}
136
+      const _list = records || list || []
137
+      const newList = current <= 1 ? _list : this.state.activityList.concat(_list)
78
       this.setState({
138
       this.setState({
79
-        activityList: res.records || []
139
+        activityList: newList,
140
+        isEmpty2: total == 0,
141
+        hasMore2: current < pages,
142
+        pageIndex2: current >= pages ? pages : current
80
       })
143
       })
81
     })
144
     })
82
   }
145
   }
83
   // 获取跟进记录
146
   // 获取跟进记录
84
-  queryFollowRecord() {
147
+  queryFollowRecord(pageNumber) {
85
     const { customerId } = this.$router.params
148
     const { customerId } = this.$router.params
86
     const payload = {
149
     const payload = {
87
-      pageNumber: '0',
88
-      pageSize: '30',
150
+      pageNumber,
151
+      pageSize: '10',
89
       customerId,
152
       customerId,
90
     }
153
     }
91
     getFollowRecord(payload).then(res => {
154
     getFollowRecord(payload).then(res => {
155
+      const { records, list, total, current, pages } = res || {}
156
+      const _list = records || list || []
157
+      const newList = current <= 1 ? _list : this.state.followRecord.concat(_list)
92
       this.setState({
158
       this.setState({
93
-        followRecord: res.records
159
+        followRecord: newList,
160
+        isEmpty3: total == 0,
161
+        hasMore3: current < pages,
162
+        pageIndex3: current >= pages ? pages : current
94
       })
163
       })
95
     })
164
     })
96
   }
165
   }
97
   componentDidShow() {
166
   componentDidShow() {
98
     this.loadList()
167
     this.loadList()
168
+    // Taro.getSystemInfo({
169
+    //   success: function (res) {
170
+    //     console.log(res, "9999999999999")
171
+    //     this.setState({
172
+    //       tabHeight: res.screenHeight - 380 + 'px'
173
+    //     })
174
+    //   },
175
+    // })
176
+
99
   }
177
   }
100
   loadList() {
178
   loadList() {
101
     const { customerId } = this.$router.params
179
     const { customerId } = this.$router.params
145
       customerId,
223
       customerId,
146
     }
224
     }
147
     addFollowRecord(params).then(res => {
225
     addFollowRecord(params).then(res => {
148
-      this.queryFollowRecord()
226
+      this.queryFollowRecord(1)
149
     })
227
     })
150
     this.setState({
228
     this.setState({
151
       followVisible: false,
229
       followVisible: false,
251
       }
329
       }
252
     })
330
     })
253
   }
331
   }
254
-
255
-
256
-
257
   onChange = e => {
332
   onChange = e => {
258
     this.setState({
333
     this.setState({
259
       baseInfo: {
334
       baseInfo: {
262
       }
337
       }
263
     })
338
     })
264
   }
339
   }
265
-
266
   onBaseTextareaChange(e) {
340
   onBaseTextareaChange(e) {
267
     this.setState({
341
     this.setState({
268
       baseInfo: {
342
       baseInfo: {
283
       customerId: customer.customerId,
357
       customerId: customer.customerId,
284
     }
358
     }
285
     addFollowRecord(params).then(res => {
359
     addFollowRecord(params).then(res => {
286
-      this.queryFollowRecord()
360
+      this.queryFollowRecord(1)
287
     })
361
     })
288
     this.setState({
362
     this.setState({
289
       followVisible: false,
363
       followVisible: false,
371
   render() {
445
   render() {
372
 
446
 
373
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
447
     const tabList = [{ title: '基本信息' }, { title: '访问记录' }, { title: '活动信息' }, { title: '跟进记录' }]
374
-    const { customerDetail, visitRecord, activityList, followRecord, followVisible, baseVisible, } = this.state
448
+    const { customerDetail, visitRecord, activityList, followRecord, followVisible, baseVisible, isEmpty, hasMore, isEmpty2, hasMore2, isEmpty3, hasMore3 } = this.state
375
     return (
449
     return (
376
       <View>
450
       <View>
377
         {followVisible && this.renderFollowBox()}
451
         {followVisible && this.renderFollowBox()}
390
           </View>
464
           </View>
391
           <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>
465
           <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>
392
         </View>
466
         </View>
393
-        <AtTabs className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
467
+        <AtTabs height="calc(100vh - 400rpx)" className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
394
           <AtTabsPane current={this.state.current} index={0} >
468
           <AtTabsPane current={this.state.current} index={0} >
395
             <View className="tab-pane1 pane">
469
             <View className="tab-pane1 pane">
396
               <View className="status">{customerDetail.status == 1 ? '报备' : customerDetail.status == 2 ? '到访' : customerDetail.status == 3 ? '认筹' : '签约'}</View>
470
               <View className="status">{customerDetail.status == 1 ? '报备' : customerDetail.status == 2 ? '到访' : customerDetail.status == 3 ? '认筹' : '签约'}</View>
404
           </AtTabsPane>
478
           </AtTabsPane>
405
           <AtTabsPane current={this.state.current} index={1}>
479
           <AtTabsPane current={this.state.current} index={1}>
406
             <View className="tab-pane2 pane">
480
             <View className="tab-pane2 pane">
407
-              {visitRecord.length && visitRecord.map(item => (
408
-                <View className="record-item">
409
-                  <View className="title" >{item.activity}</View>
410
-                  <View className="time">{dayjs(item.visitTime).format('YYYY年MM月DD日 HH:mm:ss') || ' '}</View>
411
-                </View>
412
-              ))
413
-              }
414
-              {!visitRecord.length &&
415
-                <View className="empty">
416
-                  <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
417
-                  <View className="empty__text">暂无访问记录~</View>
481
+              <ListView
482
+                className="wrap"
483
+                style="height:calc(100vh - 400rpx)"
484
+                needInit
485
+                isEmpty={isEmpty}
486
+                emptyText="暂无访问记录~"
487
+                hasMore={hasMore}
488
+                onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
489
+                onScrollToLower={fn => this.onScrollToLower(fn)}
490
+              >
491
+                <View className="list">
492
+                  {visitRecord.length && visitRecord.map((item, index) => (
493
+                    <View className="record-item" key={index + 'follow'}>
494
+                      <View className="title" >{item.activity}</View>
495
+                      <View className="time">{dayjs(item.visitTime).format('YYYY年MM月DD日 HH:mm:ss') || ' '}</View>
496
+                    </View>
497
+                  ))
498
+                  }
499
+                  {!visitRecord.length &&
500
+                    <View className="empty">
501
+                      {/* <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
502
+                  <View className="empty__text">暂无访问记录~</View> */}
503
+                    </View>
504
+                  }
418
                 </View>
505
                 </View>
419
-              }
420
-
506
+              </ListView>
421
             </View>
507
             </View>
422
           </AtTabsPane>
508
           </AtTabsPane>
423
           <AtTabsPane current={this.state.current} index={2}>
509
           <AtTabsPane current={this.state.current} index={2}>
424
             <View className="tab-pane3 pane">
510
             <View className="tab-pane3 pane">
425
-              {!activityList.length &&
426
-                <View className="empty">
427
-                  <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
428
-                  <View className="empty__text">暂无活动信息~</View>
511
+              <ListView
512
+                className="wrap"
513
+                style="height:calc(100vh - 400rpx)"
514
+                needInit
515
+                isEmpty={isEmpty2}
516
+                emptyText="暂无活动信息~"
517
+                hasMore={hasMore2}
518
+                onPullDownRefresh={fn => this.onPullDownRefresh2(fn)}
519
+                onScrollToLower={fn => this.onScrollToLower2(fn)}
520
+              >
521
+                <View className="list">
522
+                  {!activityList.length &&
523
+                    <View className="empty">
524
+                      {/* <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
525
+                  <View className="empty__text">暂无活动信息~</View> */}
526
+                    </View>
527
+                  }
528
+                  {activityList.length &&
529
+                    activityList.map(item => (
530
+                      <ActivityItem
531
+                        data={item}
532
+                        key={item.id + 'activity'}
533
+                        onClick={this.handleItemClick}>
534
+                      </ActivityItem>
535
+                    ))
536
+                  }
429
                 </View>
537
                 </View>
430
-              }
431
-              {activityList.length &&
432
-                activityList.map(item => (
433
-                  <ActivityItem
434
-                    data={item}
435
-                    key={item.id}
436
-                    onClick={this.handleItemClick}>
437
-                  </ActivityItem>
438
-                ))
439
-              }
538
+              </ListView>
440
             </View>
539
             </View>
441
           </AtTabsPane>
540
           </AtTabsPane>
442
           <AtTabsPane current={this.state.current} index={3}>
541
           <AtTabsPane current={this.state.current} index={3}>
443
-            <View style="padding:10px 20px 120px 20px">
444
-              {followRecord.length && followRecord.map(item => (
445
-                <View>
446
-                  <View style=" display:flex;justify-content: space-between;align-items: center;color: #333;font-size: 16px; margin-bottom:20rpx;">
447
-                    <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>
448
-                    <View classNam="time" style=" font-size: 26rpx;color: #999;">{dayjs(item.createDate).format('YYYY年MM月DD日 HH:mm:ss') || ' '}</View>
449
-                  </View>
450
-                  {
451
-                    item.recordContent &&
452
-                    <View style="font-size:28rpx;color:#666;padding-left:32rpx;margin-bottom:20rpx;">
453
-                      {item.recordContent}
542
+            <View style="padding:10px 20px 20px 20px">
543
+              <ListView
544
+                className="wrap"
545
+                needInit
546
+                style="height:calc(100vh - 600rpx)"
547
+                isEmpty={isEmpty3}
548
+                emptyText="暂无跟进记录~"
549
+                hasMore={hasMore3}
550
+                onPullDownRefresh={fn => this.onPullDownRefresh3(fn)}
551
+                onScrollToLower={fn => this.onScrollToLower3(fn)} >
552
+                <View className="list">
553
+                  {followRecord.length && followRecord.map(item => (
554
+                    <View key={item.followUpRecordId + 'follow'}>
555
+                      <View style=" display:flex;justify-content: space-between;align-items: center;color: #333;font-size: 16px; margin-bottom:20rpx;">
556
+                        <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>
557
+                        <View classNam="time" style=" font-size: 26rpx;color: #999;">{dayjs(item.createDate).format('YYYY年MM月DD日 HH:mm:ss') || ' '}</View>
558
+                      </View>
559
+                      {
560
+                        item.recordContent &&
561
+                        <View style="font-size:28rpx;color:#666;padding-left:32rpx;margin-bottom:20rpx;">
562
+                          {item.recordContent}
563
+                        </View>
564
+                      }
565
+
566
+                    </View>
567
+                  ))
568
+                  }
569
+                  {!followRecord.length &&
570
+                    <View className="empty">
571
+                      {/* <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
572
+                  <View className="empty__text">暂无跟进记录~</View> */}
454
                     </View>
573
                     </View>
455
                   }
574
                   }
456
-
457
-                </View>
458
-              ))
459
-              }
460
-              {!followRecord.length &&
461
-                <View className="empty">
462
-                  <Image className="empty__img" mode="widthFix" src={emptyImg}></Image>
463
-                  <View className="empty__text">暂无跟进记录~</View>
464
                 </View>
575
                 </View>
465
-              }
466
-
467
-              <View className="btn" onClick={this.addFollow}>添加跟进</View>
576
+              </ListView>
577
+              <View className="btn" style="margin:40rpx auto;" onClick={this.addFollow}>添加跟进</View>
468
             </View>
578
             </View>
469
-
470
           </AtTabsPane>
579
           </AtTabsPane>
471
         </AtTabs>
580
         </AtTabs>
472
       </View>
581
       </View>

+ 12
- 9
src/pages/person/customerAnalysis/transactionCustomer/index.js View File

29
   }
29
   }
30
   componentDidShow() {
30
   componentDidShow() {
31
     Taro.showLoading()
31
     Taro.showLoading()
32
-    this.loadList()
32
+    this.loadList(1)
33
 
33
 
34
   }
34
   }
35
-  loadList() {
35
+  loadList(pageNumber) {
36
     const payload = {
36
     const payload = {
37
       type: 'clinch',
37
       type: 'clinch',
38
-      pageNumber: 0,
38
+      pageNumber,
39
       pageSize: 9999
39
       pageSize: 9999
40
     }
40
     }
41
     queryCustomerList(payload.type, payload).then(res => {
41
     queryCustomerList(payload.type, payload).then(res => {
42
+      const { records, list, total, current, pages } = res || {}
43
+      const _list = records || list || []
44
+      const newList = current <= 1 ? _list : this.state.customerList.concat(_list)
42
       this.setState({
45
       this.setState({
43
-        customerList: res.records || [],
44
-        isEmpty: res.total == 0,
45
-        hasMore: res.current < res.page,
46
-        pageIndex: res.current >= res.pages ? res.pages : res.current
46
+        customerList: newList,
47
+        isEmpty: total == 0,
48
+        hasMore: current < pages,
49
+        pageIndex: current >= pages ? pages : current
47
       })
50
       })
48
       Taro.hideLoading()
51
       Taro.hideLoading()
49
     })
52
     })
84
             }
87
             }
85
             {
88
             {
86
               customerList.length &&
89
               customerList.length &&
87
-              customerList.map(item => (
88
-                <View class="item">
90
+              customerList.map((item, index) => (
91
+                <View class="item" key={index + 'transaction'}>
89
                   <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
92
                   <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
90
                   <View className="name">
93
                   <View className="name">
91
                     {item.name}
94
                     {item.name}

+ 67
- 62
src/pages/project/detail/index.js View File

57
     albumCurrent: 0,
57
     albumCurrent: 0,
58
   }
58
   }
59
 
59
 
60
-  componentWillMount () {
60
+  componentWillMount() {
61
     // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
61
     // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
62
     ready.queue(() => {
62
     ready.queue(() => {
63
       const router = Taro.getStorageSync('router')
63
       const router = Taro.getStorageSync('router')
90
     })
90
     })
91
   }
91
   }
92
 
92
 
93
-  componentWillUnmount () {
93
+  componentWillUnmount() {
94
     const { recordId } = this.state
94
     const { recordId } = this.state
95
     recordId && updatePoint(recordId)
95
     recordId && updatePoint(recordId)
96
   }
96
   }
97
 
97
 
98
-  loadHelpGroupList () {
98
+  loadHelpGroupList() {
99
     const { buildingId } = this.state
99
     const { buildingId } = this.state
100
     queryHelpGroup({ buildingId: buildingId }).then(res => {
100
     queryHelpGroup({ buildingId: buildingId }).then(res => {
101
       console.log(res, "buildingId")
101
       console.log(res, "buildingId")
116
     )
116
     )
117
   }
117
   }
118
 
118
 
119
-  loadDetail () {
119
+  loadDetail() {
120
     const { buildingId } = this.state
120
     const { buildingId } = this.state
121
     const { dispatchProjectDetail } = this.props
121
     const { dispatchProjectDetail } = this.props
122
     this.setState({
122
     this.setState({
144
     })
144
     })
145
   }
145
   }
146
 
146
 
147
-  loadActivityData () {
147
+  loadActivityData() {
148
     const { buildingId } = this.state
148
     const { buildingId } = this.state
149
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
149
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
150
     queryActivityList(payload).then(res => {
150
     queryActivityList(payload).then(res => {
154
     })
154
     })
155
   }
155
   }
156
 
156
 
157
-  loadNewsData () {
157
+  loadNewsData() {
158
     const { buildingId } = this.state
158
     const { buildingId } = this.state
159
     const payload = { pageSize: 2, pageNumber: 1, buildingId }
159
     const payload = { pageSize: 2, pageNumber: 1, buildingId }
160
     queryNewsList(payload).then(res => {
160
     queryNewsList(payload).then(res => {
164
     })
164
     })
165
   }
165
   }
166
 
166
 
167
-  navigateTo (url) {
167
+  navigateTo(url) {
168
     Taro.navigateTo({ url: url })
168
     Taro.navigateTo({ url: url })
169
   }
169
   }
170
   // 海报预览图
170
   // 海报预览图
171
-  previewImage (arr) {
171
+  previewImage(arr) {
172
     // console.log('arr:' + arr)
172
     // console.log('arr:' + arr)
173
     if (arr[0].length > 1) {
173
     if (arr[0].length > 1) {
174
       Taro.previewImage({
174
       Taro.previewImage({
195
     })
195
     })
196
   }
196
   }
197
 
197
 
198
-  openMap () {
198
+  openMap() {
199
     const {
199
     const {
200
       buildingName,
200
       buildingName,
201
       address,
201
       address,
222
     })
222
     })
223
   }
223
   }
224
 
224
 
225
-  toViewAlbum () {
225
+  toViewAlbum() {
226
     const { buildingId } = this.state
226
     const { buildingId } = this.state
227
     this.navigateTo(`/pages/project/album/index?id=${buildingId}`)
227
     this.navigateTo(`/pages/project/album/index?id=${buildingId}`)
228
   }
228
   }
229
 
229
 
230
-  onViewFans () {
230
+  onViewFans() {
231
     const { buildingId } = this.state
231
     const { buildingId } = this.state
232
     this.navigateTo('/pages/card/fans/index?type=item&id=' + buildingId)
232
     this.navigateTo('/pages/card/fans/index?type=item&id=' + buildingId)
233
   }
233
   }
256
     }
256
     }
257
   }
257
   }
258
 
258
 
259
-  getPhoneNumber (e, item) {
259
+  getPhoneNumber(e, item) {
260
     getUserPhone(e, (phoneNumber) => {
260
     getUserPhone(e, (phoneNumber) => {
261
       const { userInfo: { person: { personId, nickname, name } } } = this.props
261
       const { userInfo: { person: { personId, nickname, name } } } = this.props
262
       Taro.navigateTo({
262
       Taro.navigateTo({
265
     })
265
     })
266
   }
266
   }
267
 
267
 
268
-  getPosterData () {
268
+  getPosterData() {
269
     return new Promise(resolve => {
269
     return new Promise(resolve => {
270
       const { posterData } = this.state
270
       const { posterData } = this.state
271
       if (posterData.qrcode) {
271
       if (posterData.qrcode) {
336
     })
336
     })
337
   }
337
   }
338
 
338
 
339
-  handleTelClick (item, e) {
339
+  handleTelClick(item, e) {
340
     e.stopPropagation()
340
     e.stopPropagation()
341
     Taro.makePhoneCall({
341
     Taro.makePhoneCall({
342
       phoneNumber: item.phone
342
       phoneNumber: item.phone
343
     })
343
     })
344
   }
344
   }
345
 
345
 
346
-  handleChatClick (item, e) {
346
+  handleChatClick(item, e) {
347
     e.stopPropagation()
347
     e.stopPropagation()
348
     const { userInfo: { person: { personId, nickname, name } } } = this.props
348
     const { userInfo: { person: { personId, nickname, name } } } = this.props
349
     Taro.navigateTo({
349
     Taro.navigateTo({
351
     })
351
     })
352
   }
352
   }
353
 
353
 
354
-  handleConsuItemClick (item) {
354
+  handleConsuItemClick(item) {
355
     Taro.navigateTo({
355
     Taro.navigateTo({
356
       url: `/pages/card/index?id=${item.id}`
356
       url: `/pages/card/index?id=${item.id}`
357
     })
357
     })
358
   }
358
   }
359
 
359
 
360
-  handleMoreClick () {
360
+  handleMoreClick() {
361
     // App.zhuge.track('查看置业顾问列表')
361
     // App.zhuge.track('查看置业顾问列表')
362
     Taro.navigateTo({
362
     Taro.navigateTo({
363
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
363
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
364
     })
364
     })
365
   }
365
   }
366
 
366
 
367
-  handleStopPropagation (e) {
367
+  handleStopPropagation(e) {
368
     e.stopPropagation()
368
     e.stopPropagation()
369
   }
369
   }
370
 
370
 
371
-  toRecomonedPage () {
371
+  toRecomonedPage() {
372
     const {
372
     const {
373
       userInfo: { person: { personType } }
373
       userInfo: { person: { personType } }
374
     } = this.props
374
     } = this.props
384
     }
384
     }
385
   }
385
   }
386
 
386
 
387
-  toHome () {
387
+  toHome() {
388
     Taro.switchTab({
388
     Taro.switchTab({
389
       url: `/pages/project/index`
389
       url: `/pages/project/index`
390
     })
390
     })
391
   }
391
   }
392
 
392
 
393
-  HandleCircumTabClick (id) {
393
+  HandleCircumTabClick(id) {
394
     this.setState({
394
     this.setState({
395
       curTab: id
395
       curTab: id
396
     })
396
     })
397
   }
397
   }
398
 
398
 
399
-  handleNewsMoreClick () {
399
+  handleNewsMoreClick() {
400
     Taro.navigateTo({
400
     Taro.navigateTo({
401
       url: `/pages/news/index?buildingId=` + this.state.buildingId
401
       url: `/pages/news/index?buildingId=` + this.state.buildingId
402
     })
402
     })
403
   }
403
   }
404
 
404
 
405
-  handNewsItemClick (id) {
405
+  handNewsItemClick(id) {
406
     Taro.navigateTo({
406
     Taro.navigateTo({
407
       url: '/pages/news/detail/index?id=' + id
407
       url: '/pages/news/detail/index?id=' + id
408
     })
408
     })
409
   }
409
   }
410
 
410
 
411
-  handleActivityMoreClick () {
411
+  handleActivityMoreClick() {
412
     Taro.navigateTo({
412
     Taro.navigateTo({
413
       url: `/pages/activity/index?buildingId=` + this.state.buildingId
413
       url: `/pages/activity/index?buildingId=` + this.state.buildingId
414
     })
414
     })
415
   }
415
   }
416
 
416
 
417
-  handActivityItemClick (id) {
417
+  handActivityItemClick(id) {
418
     Taro.navigateTo({
418
     Taro.navigateTo({
419
       url: '/pages/activity/detail/index?id=' + id
419
       url: '/pages/activity/detail/index?id=' + id
420
     })
420
     })
421
   }
421
   }
422
 
422
 
423
-  handlePreviewHxImage (current, urls) {
423
+  handlePreviewHxImage(current, urls) {
424
     Taro.previewImage({
424
     Taro.previewImage({
425
       current,
425
       current,
426
       urls
426
       urls
427
     })
427
     })
428
   }
428
   }
429
 
429
 
430
-  handleFavor () {
430
+  handleFavor() {
431
     const { buildingId, isSaved } = this.state
431
     const { buildingId, isSaved } = this.state
432
     if (isSaved) {
432
     if (isSaved) {
433
       cancelFavorProject(buildingId).then(res => {
433
       cancelFavorProject(buildingId).then(res => {
457
       console.log('活动项目收藏')
457
       console.log('活动项目收藏')
458
     })
458
     })
459
   }
459
   }
460
-  handleToolsClick () {
460
+  handleToolsClick() {
461
     Taro.navigateTo({
461
     Taro.navigateTo({
462
       url: `/pages/toolKit/index`
462
       url: `/pages/toolKit/index`
463
     })
463
     })
464
   }
464
   }
465
-  moreFloor () {
465
+  moreFloor() {
466
     Taro.navigateTo({
466
     Taro.navigateTo({
467
       url: `/pages/project/floor/index`
467
       url: `/pages/project/floor/index`
468
     })
468
     })
469
   }
469
   }
470
 
470
 
471
-  renderBottomMenu () {
471
+  renderBottomMenu() {
472
     const { userInfo: { person: { personType } } } = this.props
472
     const { userInfo: { person: { personType } } } = this.props
473
     const { posterShow } = this.state
473
     const { posterShow } = this.state
474
     return (
474
     return (
503
     )
503
     )
504
   }
504
   }
505
 
505
 
506
-  previewHouseImage (current, urls) {
506
+  previewHouseImage(current, urls) {
507
     Taro.previewImage({
507
     Taro.previewImage({
508
       current,
508
       current,
509
       urls
509
       urls
510
     })
510
     })
511
   }
511
   }
512
 
512
 
513
-  renderBuildingProjectTypeList () {
513
+  renderBuildingProjectTypeList() {
514
     const { statusOpts } = this.state
514
     const { statusOpts } = this.state
515
     const { projectDetail: { buildingProjectType = [], status, marketStatus } } = this.props
515
     const { projectDetail: { buildingProjectType = [], status, marketStatus } } = this.props
516
     return (
516
     return (
535
                         {/* <Icon className="iconfont icon-jinrongxianxingge-" onClick={this.handleToolsClick}></Icon> */}
535
                         {/* <Icon className="iconfont icon-jinrongxianxingge-" onClick={this.handleToolsClick}></Icon> */}
536
                         <View className='row' style="margin-top:0">
536
                         <View className='row' style="margin-top:0">
537
                           <Text className='row-label'>项目类型:</Text>
537
                           <Text className='row-label'>项目类型:</Text>
538
-                          <Text className='row-txt black'>{item.buildingTypeName}</Text>
538
+                          <Text className='row-txt black'>{item.buildingTypeName || ' '}</Text>
539
                         </View>
539
                         </View>
540
                         <View className='row'>
540
                         <View className='row'>
541
                           <Text className='row-label'>项目参考价格:</Text>
541
                           <Text className='row-label'>项目参考价格:</Text>
545
                         </View>
545
                         </View>
546
                         <View className='row'>
546
                         <View className='row'>
547
                           <Text className='row-label'>产权:</Text>
547
                           <Text className='row-label'>产权:</Text>
548
-                          <Text className='row-txt'>{item.rightsYear}年</Text>
548
+                          {item.rightsYear ?
549
+                            <Text className='row-txt'>{item.rightsYear}年</Text>
550
+                            :
551
+                            <Text className='row-txt'>暂无</Text>
552
+                          }
553
+
549
                           <View className='row-right'>
554
                           <View className='row-right'>
550
                             <Text className='row-label'>装修:</Text>
555
                             <Text className='row-label'>装修:</Text>
551
-                            <Text className='row-txt'>{item.decoration}</Text>
556
+                            <Text className='row-txt'>{item.decoration || '暂无'}</Text>
552
                           </View>
557
                           </View>
553
                         </View>
558
                         </View>
554
                       </View>
559
                       </View>
564
   }
569
   }
565
 
570
 
566
 
571
 
567
-  renderPhotoAlbum () {
572
+  renderPhotoAlbum() {
568
     const { projectDetail: { buildingApartment } } = this.props
573
     const { projectDetail: { buildingApartment } } = this.props
569
     const list = buildingApartment.filter(item => item.apartmentType === 'photo')
574
     const list = buildingApartment.filter(item => item.apartmentType === 'photo')
570
     const imgList = list.reduce((prev, cur) => {
575
     const imgList = list.reduce((prev, cur) => {
574
 
579
 
575
     const { albumCurrent } = this.state
580
     const { albumCurrent } = this.state
576
 
581
 
577
-  
578
-  
582
+
583
+
579
     return (
584
     return (
580
 
585
 
581
-   
586
+
582
       <Block>
587
       <Block>
583
-        { list.length > 0 &&
588
+        {list.length > 0 &&
584
           (
589
           (
585
             <View className='photos__type'>
590
             <View className='photos__type'>
586
               <View className='photos__type__title'>相册</View>
591
               <View className='photos__type__title'>相册</View>
587
               <ScrollView scrollX>
592
               <ScrollView scrollX>
588
                 <View className='photos__type__content' onClick={this.toViewAlbum}>
593
                 <View className='photos__type__content' onClick={this.toViewAlbum}>
589
-          
594
+
590
                   <View className="around-tab">
595
                   <View className="around-tab">
591
                     {list.map((item, index) => {
596
                     {list.map((item, index) => {
592
-                      const { apartmentName} = item || {}
593
-                      const  buildingImgList = item.buildingImgList
594
-                     
595
-                    
597
+                      const { apartmentName } = item || {}
598
+                      const buildingImgList = item.buildingImgList
599
+
600
+
596
                       return (
601
                       return (
597
                         <View
602
                         <View
598
-                          style={{ marginRight: '8px' }}                  
603
+                          style={{ marginRight: '8px' }}
599
                         >
604
                         >
600
                           {/* {`${label}(${num})`} */}
605
                           {/* {`${label}(${num})`} */}
601
                           <View>
606
                           <View>
614
       </Block>
619
       </Block>
615
     )
620
     )
616
   }
621
   }
617
-  rendercircum () {
622
+  rendercircum() {
618
     const building = {
623
     const building = {
619
       ...this.props.projectDetail
624
       ...this.props.projectDetail
620
     }
625
     }
631
     )
636
     )
632
   }
637
   }
633
 
638
 
634
-  renderConsuler () {
639
+  renderConsuler() {
635
     const { userInfo: { person: { phone } } } = this.props
640
     const { userInfo: { person: { phone } } } = this.props
636
     const { projectDetail: { consultants = [] } } = this.props
641
     const { projectDetail: { consultants = [] } } = this.props
637
     return (
642
     return (
685
     )
690
     )
686
   }
691
   }
687
 
692
 
688
-  renderStatement () {
693
+  renderStatement() {
689
     return (
694
     return (
690
       <View className='statement'>
695
       <View className='statement'>
691
         免责条款:以上价格仅供参考,具体一房一价的信息以售楼处展示为准。本网显示房屋位置、交通、医疗、教育、商业等配套信息,来源于第三方网络数据,不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。<br></br>本平台对项目周边文化教育的介绍旨在提供相关信息,并不意味着信息发布方对就学安排作出承诺。相关教育资源就学信息存在调整的可能,应以政府教育主管部门及办学颁布的政策规定为准。
696
         免责条款:以上价格仅供参考,具体一房一价的信息以售楼处展示为准。本网显示房屋位置、交通、医疗、教育、商业等配套信息,来源于第三方网络数据,不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。<br></br>本平台对项目周边文化教育的介绍旨在提供相关信息,并不意味着信息发布方对就学安排作出承诺。相关教育资源就学信息存在调整的可能,应以政府教育主管部门及办学颁布的政策规定为准。
694
   }
699
   }
695
 
700
 
696
 
701
 
697
-  renderHelp () {
702
+  renderHelp() {
698
     const { helpList } = this.state
703
     const { helpList } = this.state
699
     return (
704
     return (
700
       <Block>
705
       <Block>
715
     )
720
     )
716
   }
721
   }
717
 
722
 
718
-  handleHelpClick (item) {
723
+  handleHelpClick(item) {
719
     Taro.navigateTo({
724
     Taro.navigateTo({
720
       url: '/pages/activity/detail/assistance?id=' + item.activityId
725
       url: '/pages/activity/detail/assistance?id=' + item.activityId
721
     })
726
     })
722
   }
727
   }
723
-  handleGroupClick (item) {
728
+  handleGroupClick(item) {
724
     Taro.navigateTo({
729
     Taro.navigateTo({
725
       url: '/pages/activity/detail/assemble?id=' + item.activityId
730
       url: '/pages/activity/detail/assemble?id=' + item.activityId
726
     })
731
     })
727
   }
732
   }
728
-  renderGroup () {
733
+  renderGroup() {
729
     const { groupList } = this.state
734
     const { groupList } = this.state
730
     return (
735
     return (
731
       <Block>
736
       <Block>
747
     )
752
     )
748
   }
753
   }
749
 
754
 
750
-  renderHouseTypeList () {
755
+  renderHouseTypeList() {
751
     const { statusOpts } = this.state
756
     const { statusOpts } = this.state
752
     const { projectDetail: { buildingApartment } } = this.props
757
     const { projectDetail: { buildingApartment } } = this.props
753
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
758
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
795
 
800
 
796
     )
801
     )
797
   }
802
   }
798
-  renderActivities () {
803
+  renderActivities() {
799
     const { activityList } = this.state
804
     const { activityList } = this.state
800
     return (
805
     return (
801
       <Block>
806
       <Block>
826
       </Block>
831
       </Block>
827
     )
832
     )
828
   }
833
   }
829
-  renderNews () {
834
+  renderNews() {
830
     const { newsList } = this.state
835
     const { newsList } = this.state
831
     return (
836
     return (
832
       <Block>
837
       <Block>
858
     )
863
     )
859
   }
864
   }
860
 
865
 
861
-  renderVideo () {
866
+  renderVideo() {
862
     const { projectDetail } = this.props
867
     const { projectDetail } = this.props
863
     return (
868
     return (
864
       <View
869
       <View
876
           }}
881
           }}
877
           controls={true}
882
           controls={true}
878
           autoplay={false}
883
           autoplay={false}
879
-        
884
+
880
           initialTime='0'
885
           initialTime='0'
881
           id='video'
886
           id='video'
882
           loop={false}
887
           loop={false}
887
     )
892
     )
888
   }
893
   }
889
 
894
 
890
-  changeCurrent (current) {
895
+  changeCurrent(current) {
891
     this.setState({
896
     this.setState({
892
       current: current + 1
897
       current: current + 1
893
     })
898
     })
895
 
900
 
896
 
901
 
897
 
902
 
898
-  render () {
903
+  render() {
899
     const { posterStatus, posterData, loaded, btnstate } = this.state
904
     const { posterStatus, posterData, loaded, btnstate } = this.state
900
     const { projectDetail } = this.props
905
     const { projectDetail } = this.props
901
     const { uvList = {} } = projectDetail
906
     const { uvList = {} } = projectDetail
928
 
933
 
929
               {btnstate === 1 && projectDetail.videoUrl != null && this.renderVideo()}
934
               {btnstate === 1 && projectDetail.videoUrl != null && this.renderVideo()}
930
 
935
 
931
-        
936
+
932
               {btnstate === 1 && projectDetail.videoUrl != null && (<View className='media-btn'>
937
               {btnstate === 1 && projectDetail.videoUrl != null && (<View className='media-btn'>
933
                 <View className='video-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }} >视频</View>
938
                 <View className='video-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }} >视频</View>
934
                 <View className='img-btn' onClick={() => this.setState({ btnstate: 0 })}>图片</View>
939
                 <View className='img-btn' onClick={() => this.setState({ btnstate: 0 })}>图片</View>
967
                       <View className='row project__addr'>
972
                       <View className='row project__addr'>
968
                         <Text className="label">楼盘地址:</Text>
973
                         <Text className="label">楼盘地址:</Text>
969
                         <View className='address'>
974
                         <View className='address'>
970
-                          <Text className="address__text">{projectDetail.address}</Text>
975
+                          <Text className="address__text">{projectDetail.address || '暂无'}</Text>
971
                           {/* <Text className='iconfont icon-jingzhundaohang-copy' onClick={this.openMap.bind(this)}></Text> */}
976
                           {/* <Text className='iconfont icon-jingzhundaohang-copy' onClick={this.openMap.bind(this)}></Text> */}
972
                         </View>
977
                         </View>
973
                       </View>
978
                       </View>