Pārlūkot izejas kodu

首页资讯公告、盘客工具拆分

许静 5 gadus atpakaļ
vecāks
revīzija
61aea4d0ab

+ 1
- 0
src/app.js Parādīt failu

@@ -49,6 +49,7 @@ class App extends Component {
49 49
       'pages/activity/myActivity',
50 50
       'pages/person/index',
51 51
       'pages/person/customerAnalysis/index',
52
+      'pages/person/customerAnalysis/analysis',
52 53
       'pages/person/profile/index',
53 54
       'pages/person/profile/detail/index',
54 55
       'pages/project/detail/index',

+ 1
- 1
src/pages/person/customerAnalysis/analysis.js Parādīt failu

@@ -18,7 +18,7 @@ const rand = n => Math.random().toString(36).substr(2, n)
18 18
 export default class analysis extends Taro.Component {
19 19
 
20 20
   config = {
21
-    navigationBarTitleText: ''
21
+    navigationBarTitleText: '客户分析'
22 22
   }
23 23
 
24 24
   state = {

+ 12
- 12
src/pages/person/customerAnalysis/index.js Parādīt failu

@@ -59,11 +59,11 @@ export default class customer extends Taro.Component {
59 59
   }
60 60
 
61 61
   render() {
62
-    const tabList = [{ title: '我的客户' },{ title: '客户分析' }]
62
+  
63 63
     const { customerNum, current } = this.state
64 64
     return (
65
-      <AtTabs  className="tab-box overflow-tab" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
66
-         <AtTabsPane current={current} index={0}>
65
+      // <AtTabs  className="tab-box overflow-tab" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
66
+      //    <AtTabsPane current={current} index={0}>
67 67
           <View style="padding:10px 20px; display: flex;flex-wrap: wrap;align-content: flex-start;justify-content: space-between;">
68 68
             <View className="my-customer" onClick={this.toFollowUpCustomer} style="border-right:1px solid rgba(0,0,0,0.12)">
69 69
               <Image mode="widthFix" src={require('@assets/person/genjin.png')} className='img'></Image>
@@ -76,16 +76,16 @@ export default class customer extends Taro.Component {
76 76
               <View className="name">{customerNum.clinchSum || 0}人</View>
77 77
             </View>
78 78
           </View>
79
-        </AtTabsPane>
80
-        <AtTabsPane current={current} index={1} >
81
-          <View >
82
-            {
83
-              current != 0 && <Analysis></Analysis>
84
-            }
85
-          </View>
86
-        </AtTabsPane>
79
+      //   </AtTabsPane>
80
+      //   <AtTabsPane current={current} index={1} >
81
+      //     <View >
82
+      //       {
83
+      //         current != 0 && <Analysis></Analysis>
84
+      //       }
85
+      //     </View>
86
+      //   </AtTabsPane>
87 87
        
88
-      </AtTabs>
88
+      // </AtTabs>
89 89
     )
90 90
   }
91 91
 }

+ 50
- 42
src/pages/person/customerAnalysis/index.scss Parādīt failu

@@ -5,6 +5,29 @@
5 5
   position: relative;
6 6
   height:100vh;
7 7
 }
8
+.my-customer{
9
+  flex: 0 0 50%;
10
+  text-align: center;
11
+  border-bottom: 2px solid rgba(216,216,216,1);
12
+  padding: 80px 0;
13
+  
14
+  .img{
15
+    width: 76px;
16
+  }
17
+  .name{
18
+    color: #333;
19
+    font-size: 30px;
20
+    line-height: 48px;
21
+  }
22
+
23
+}
24
+
25
+
26
+
27
+
28
+
29
+
30
+
8 31
 .daily-month{
9 32
   display: flex;
10 33
   align-items: center;
@@ -67,50 +90,35 @@
67 90
   .at-tabs__underline{
68 91
     height: 0!important;
69 92
   }
70
-  .my-customer{
71
-    flex: 0 0 50%;
72
-    text-align: center;
73
-    border-bottom: 2px solid rgba(216,216,216,1);
74
-    padding: 80px 0;
75
-    
76
-    .img{
77
-      width: 76px;
78
-    }
79
-    .name{
80
-      color: #333;
81
-      font-size: 30px;
82
-      line-height: 48px;
83
-    }
84
-
85 93
 
94
+ 
95
+}
96
+.tab-bar{
97
+  margin-top: 30px;
98
+  .at-tabs__header{
99
+    width: 80%;
100
+    background-color: none;
101
+    box-shadow:none;
102
+    margin: 0 auto;
103
+    border-radius: 0;
104
+    border: none;
86 105
   }
87
-  .tab-bar{
88
-    margin-top: 30px;
89
-    .at-tabs__header{
90
-      width: 80%;
91
-      background-color: none;
92
-      box-shadow:none;
93
-      margin: 0 auto;
94
-      border-radius: 0;
95
-      border: none;
96
-    }
97
-    .at-tabs__item{
98
-      width:33.333%;
99
-      flex: none;
100
-      color: #666;
101
-      font-size: 28px;
102
-      padding: 12px 20px;
103
-    }
104
-    .at-tabs__item--active{
105
-      color: $primary-color;
106
-      background-color: #fff;
107
-    }
108
-    .at-tabs__item-underline{
109
-      height: 4px;
110
-      background-color: $primary-color;
111
-      width: 60%;
112
-      margin-left: 20%;
113
-    }
106
+  .at-tabs__item{
107
+    width:33.333%;
108
+    flex: none;
109
+    color: #666;
110
+    font-size: 28px;
111
+    padding: 12px 20px;
112
+  }
113
+  .at-tabs__item--active{
114
+    color: $primary-color;
115
+    background-color: #fff;
116
+  }
117
+  .at-tabs__item-underline{
118
+    height: 4px;
119
+    background-color: $primary-color;
120
+    width: 60%;
121
+    margin-left: 20%;
114 122
   }
115 123
 }
116 124
 .overflow-tab{

+ 9
- 0
src/pages/person/menus.js Parādīt failu

@@ -16,6 +16,7 @@ const icons = {
16 16
   client: require('@assets/mine/client.png'),
17 17
   consultant: require('@assets/mine/consultant.png'),
18 18
   customerAnalysis: require('@assets/mine/customerAnalysis.png'),
19
+  fenxi: require('@assets/mine/fenxi.png'),
19 20
 }
20 21
 
21 22
 const DRIFT = ROLE_CODE['DRIFT']
@@ -49,6 +50,14 @@ const menus = [
49 50
       userTypes: [CONSULTANT],
50 51
       style: '',
51 52
     },
53
+    {
54
+      name: '客户分析',
55
+      url: '/pages/person/customerAnalysis/analysis',
56
+      icon: icons.fenxi,
57
+      extends: undefined,
58
+      userTypes: [CONSULTANT],
59
+      style: '',
60
+    },
52 61
     // {
53 62
     //   name: '成为经纪人',
54 63
     //   url: '/pages/agent/become/index',

+ 66
- 29
src/pages/project/index.js Parādīt failu

@@ -6,7 +6,6 @@ import Banner from './banner'
6 6
 import HelpGroupBanner from './swiper'
7 7
 import ActivityItem from '../activity/item'
8 8
 
9
-
10 9
 import ready from '@utils/ready'
11 10
 import { getLocationCity } from '@services/map'
12 11
 
@@ -51,7 +50,7 @@ export default class Index extends Component {
51 50
     achieve: false
52 51
   }
53 52
 
54
-  componentWillMount () {
53
+  componentWillMount() {
55 54
     this.qqmapsdk = new QQMapWX({
56 55
       key: 'TIIBZ-ZJG33-52T3L-Y3X4Q-NWKLV-KUB3B'
57 56
     })
@@ -74,7 +73,7 @@ export default class Index extends Component {
74 73
     })
75 74
   }
76 75
 
77
-  componentDidShow () {
76
+  componentDidShow() {
78 77
     if (this.props.curCity.id) {
79 78
       ready.queue(() => {
80 79
         this.loadData()
@@ -82,12 +81,12 @@ export default class Index extends Component {
82 81
     }
83 82
   }
84 83
 
85
-  componentWillUnmount () {
84
+  componentWillUnmount() {
86 85
     const { recordId } = this.state
87 86
     recordId && updatePoint(recordId)
88 87
   }
89 88
 
90
-  getLocation () {
89
+  getLocation() {
91 90
     const { cityList, userInfo: { person: { org } } } = this.props
92 91
     let defaultCity = cityList.filter(item => {
93 92
       return item.id == org.defaultCityId
@@ -103,7 +102,7 @@ export default class Index extends Component {
103 102
       const payload = { location: `${location.longitude},${location.latitude}` }
104 103
 
105 104
       getLocationCity(payload).then(res => {
106
-      
105
+
107 106
         let curCity = cityList.filter(item => {
108 107
           return item.name == res.name || ''
109 108
         })
@@ -134,13 +133,13 @@ export default class Index extends Component {
134 133
       this.updateCity(defaultCity)
135 134
     })
136 135
   }
137
-  updateCity (payload) {
136
+  updateCity(payload) {
138 137
     this.props.dispatchCitySelected(payload).then(res => {
139 138
       this.loadData()
140 139
     })
141 140
   }
142 141
 
143
-  loadData () {
142
+  loadData() {
144 143
     this.loadBannerList()
145 144
     this.loadHelpGroupList()
146 145
     this.loadNewsList()
@@ -148,7 +147,7 @@ export default class Index extends Component {
148 147
     this.loadList()
149 148
   }
150 149
 
151
-  loadOpenScreenBanner () {
150
+  loadOpenScreenBanner() {
152 151
     const payload = {
153 152
       // showPosition: 'index'
154 153
     }
@@ -166,7 +165,7 @@ export default class Index extends Component {
166 165
       })
167 166
     })
168 167
   }
169
-  loadBannerList () {
168
+  loadBannerList() {
170 169
     const { curCity } = this.props
171 170
     console.log(this.props, 'this.props')
172 171
     // 获取首页banner
@@ -189,7 +188,7 @@ export default class Index extends Component {
189 188
     })
190 189
   }
191 190
 
192
-  loadHelpGroupList () {
191
+  loadHelpGroupList() {
193 192
     queryHelpGroup({ cityId: this.props.curCity.id, buildingId: '' }).then(res => {
194 193
       console.log(res, "res")
195 194
       this.setState({
@@ -200,11 +199,11 @@ export default class Index extends Component {
200 199
   }
201 200
 
202 201
 
203
-  loadNewsList () {
202
+  loadNewsList() {
204 203
     const { curCity } = this.props
205 204
     const payload = {
206 205
       pageNumber: 1,
207
-      pageSize: 2
206
+      pageSize: 999
208 207
     }
209 208
     if (curCity.id) {
210 209
       payload.cityId = curCity.id
@@ -216,7 +215,7 @@ export default class Index extends Component {
216 215
     })
217 216
   }
218 217
 
219
-  loadActivityList () {
218
+  loadActivityList() {
220 219
     const { curCity } = this.props
221 220
     const payload = {
222 221
       pageNumber: 1,
@@ -234,7 +233,7 @@ export default class Index extends Component {
234 233
     })
235 234
   }
236 235
 
237
-  loadList () {
236
+  loadList() {
238 237
     const { keywords } = this.state
239 238
     const { curCity } = this.props
240 239
 
@@ -288,7 +287,7 @@ export default class Index extends Component {
288 287
     }
289 288
   }
290 289
 
291
-  onViewDetail (item) {
290
+  onViewDetail(item) {
292 291
     Taro.navigateTo({
293 292
       url: `/pages/project/detail/index?id=${item.buildingId}`
294 293
     })
@@ -299,7 +298,7 @@ export default class Index extends Component {
299 298
     this.redirectTo(item)
300 299
   }
301 300
 
302
-  redirectTo ({ targetId, contentType, buildingId } = {}) {
301
+  redirectTo({ targetId, contentType, buildingId } = {}) {
303 302
     switch (contentType) {
304 303
       // 项目
305 304
       case 'project':
@@ -344,7 +343,7 @@ export default class Index extends Component {
344 343
     }
345 344
   }
346 345
 
347
-  handleHelpGroupClick (item) {
346
+  handleHelpGroupClick(item) {
348 347
     if (item.type == 1) {
349 348
       Taro.navigateTo({
350 349
         url: '/pages/activity/detail/assistance?id=' + item.activityId
@@ -356,7 +355,7 @@ export default class Index extends Component {
356 355
     }
357 356
   }
358 357
 
359
-  handleMaskClose () {
358
+  handleMaskClose() {
360 359
     this.setState({
361 360
       maskVisible: false
362 361
     })
@@ -381,23 +380,23 @@ export default class Index extends Component {
381 380
     })
382 381
   }
383 382
 
384
-  handleMaskBannerClick (data) {
383
+  handleMaskBannerClick(data) {
385 384
     this.redirectTo(data)
386 385
   }
387 386
 
388
-  handleLocationClick () {
387
+  handleLocationClick() {
389 388
     Taro.navigateTo({
390 389
       url: `/pages/city/index`
391 390
     })
392 391
   }
393 392
 
394
-  handleToHouseList () {
393
+  handleToHouseList() {
395 394
     Taro.navigateTo({
396 395
       url: '/pages/project/list/index'
397 396
     })
398 397
   }
399 398
 
400
-  handleProItemClick () {
399
+  handleProItemClick() {
401 400
     Taro.navigateTo({
402 401
       url: '/pages/project/list/index'
403 402
     })
@@ -407,7 +406,7 @@ export default class Index extends Component {
407 406
   // CHANNEL_AGENT: 'channel agent', // 渠道经纪人
408 407
   // DRIFT: 'drift', // 游客
409 408
   // CUSTOMER: 'customer' // 客户
410
-  toRecomonedPage () {
409
+  toRecomonedPage() {
411 410
     const {
412 411
       userInfo: { person: { personType } }
413 412
     } = this.props
@@ -428,13 +427,13 @@ export default class Index extends Component {
428 427
       console.log(this.props.curCity.id, "this.props.curCity.id")
429 428
     }
430 429
   }
431
-  toMapHouse () {
430
+  toMapHouse() {
432 431
     Taro.navigateTo({
433 432
       url: `/pages/project/map/index`
434 433
     })
435 434
   }
436 435
 
437
-  handleAuthPhoneSuccess (curCity) {
436
+  handleAuthPhoneSuccess(curCity) {
438 437
 
439 438
     console.log(curCity, 'curCity')
440 439
 
@@ -444,7 +443,7 @@ export default class Index extends Component {
444 443
   }
445 444
 
446 445
 
447
-  renderProjectList () {
446
+  renderProjectList() {
448 447
     const { proList: { records = [] } } = this.props
449 448
     const { helpGroupList } = this.state
450 449
     const list = records.filter(item => item.isMain === 1)
@@ -504,7 +503,7 @@ export default class Index extends Component {
504 503
     )
505 504
   }
506 505
 
507
-  renderMaskBanner () {
506
+  renderMaskBanner() {
508 507
     const { maskBanner } = this.state
509 508
     return (
510 509
       <View className="mask-banner">
@@ -520,13 +519,18 @@ export default class Index extends Component {
520 519
       </View>
521 520
     )
522 521
   }
522
+  changeCurrent(event) {
523 523
 
524
+    const current = event.detail.current
525
+    this.props.onChange && this.props.onChange(current)
526
+  }
524 527
 
525
-  render () {
528
+  render() {
526 529
     const { curCity } = this.props
527 530
     const { newsList, achieve } = this.state
528 531
     const { userInfo: { person: { personType, phone } } } = this.props
529 532
     const { userInfo: { person } } = this.props
533
+
530 534
     return (
531 535
       <Block>
532 536
         {this.state.loaded && (
@@ -584,6 +588,39 @@ export default class Index extends Component {
584 588
 
585 589
 
586 590
               </View>
591
+              {
592
+                newsList.length &&
593
+                <View style="background-color:#fff">
594
+                  <View className="notice-box">
595
+                    <View style="  display: flex;align-items: center;">
596
+                      <Image className="notice-icon" src={require('@assets/notice.png')}></Image>
597
+                      <Swiper
598
+                        className='notice-swiper'
599
+                        circular
600
+                        autoplay
601
+                        interval="3000"
602
+                        onChange={this.changeCurrent.bind(this)}
603
+                        vertical="true"
604
+                      >
605
+                        {
606
+                          newsList.map((list, inx) => {
607
+                            return (
608
+                              <SwiperItem key={`img-${inx}`}>
609
+                                <View className="notice-text">
610
+                                  {list.newsName}
611
+                                </View>
612
+                              </SwiperItem>
613
+                            )
614
+                          })
615
+                        }
616
+                      </Swiper>
617
+                    </View>
618
+                    <View className="notice-more">
619
+                      更多 <Text className="iconfont icon-more"></Text>
620
+                    </View>
621
+                  </View>
622
+                </View>
623
+              }
587 624
 
588 625
 
589 626
               {/* 推荐楼盘 */}

+ 38
- 1
src/pages/project/index.scss Parādīt failu

@@ -101,11 +101,48 @@
101 101
     }
102 102
   }
103 103
 }
104
+.notice-box{
105
+  display: flex;
106
+  align-items: center;
107
+  justify-content: space-between;
108
+  margin: 30px;
109
+  height:80px;
110
+  background:#fff;
111
+  box-shadow:0px 2px 10px 0px rgba(0,0,0,0.12);
112
+  padding: 0 20px;
113
+  .notice-icon{
114
+    width: 40px ;
115
+    height: 32px;
116
+    margin-right: 20px;
117
+    
118
+  }
119
+  .notice-swiper{
120
+    height: 80px;
121
+    width: 500px;
122
+    line-height: 80px;
123
+    .notice-text{
124
+      font-size: 28px;
125
+      color: #888888;
126
+      width: 450px;
127
+      @include text-ellipsis;
128
+    }
129
+  }
130
+ 
131
+  .notice-more {
132
+    font-size: 26px;
133
+    color: $text-color-lighter;
134
+
135
+    .iconfont {
136
+      font-size: 26px;
137
+      color: $text-color-lighter;
138
+    }
139
+  }
140
+}
104 141
 
105 142
 .section-top {
106 143
   position: relative;
107 144
   padding: 0 0px;
108
-  box-shadow:0px 2px 12px 2px rgba(29,29,29,0.09);
145
+  // box-shadow:0px 2px 12px 2px rgba(29,29,29,0.09);
109 146
 }
110 147
 
111 148
 .sectionn-news-list {