|
@@ -4,13 +4,13 @@ import './index.scss'
|
4
|
4
|
import ProjectItem from './item'
|
5
|
5
|
import Banner from './banner'
|
6
|
6
|
import Newsbanner from './newsbanner'
|
7
|
|
-import HelpGroupBanner from './swiper'
|
|
7
|
+import Activity from './activity'
|
|
8
|
+import BannerTwo from './swiper'
|
8
|
9
|
// import ActivityItem from '../activity/item'
|
9
|
10
|
import ready from '@utils/ready'
|
10
|
11
|
import { getLocationCity } from '@services/map'
|
11
|
|
-
|
12
|
12
|
import { queryBanners, savePoint, updatePoint } from '@services/common'
|
13
|
|
-import { queryNewsList, queryHelpGroup } from '@services/news'
|
|
13
|
+import { queryHelpGroup } from '@services/news'
|
14
|
14
|
import { queryActivityList } from '@services/activity'
|
15
|
15
|
import { dispatchCitySelected } from '@actions/city'
|
16
|
16
|
import { ROLE_CODE, DECREASE_UNREADNUM } from '@constants/user'
|
|
@@ -79,7 +79,6 @@ export default class Index extends Component {
|
79
|
79
|
adImage: advImageOfApp,
|
80
|
80
|
bannerList: [],
|
81
|
81
|
helpGroupList: [],
|
82
|
|
- newsList: [],
|
83
|
82
|
activityList: [],
|
84
|
83
|
recordId: null,
|
85
|
84
|
visBanner: false,
|
|
@@ -187,7 +186,6 @@ export default class Index extends Component {
|
187
|
186
|
loadData() {
|
188
|
187
|
this.loadBannerList()
|
189
|
188
|
this.loadHelpGroupList()
|
190
|
|
- this.loadNewsList()
|
191
|
189
|
this.loadOpenScreenBanner()
|
192
|
190
|
// this.loadActivityList()
|
193
|
191
|
this.loadList()
|
|
@@ -259,28 +257,6 @@ export default class Index extends Component {
|
259
|
257
|
}
|
260
|
258
|
|
261
|
259
|
|
262
|
|
- loadNewsList() {
|
263
|
|
- const { curCity } = this.props
|
264
|
|
- const payload = {
|
265
|
|
- pageNumber: 1,
|
266
|
|
- pageSize: 999
|
267
|
|
- }
|
268
|
|
- if (curCity.id) {
|
269
|
|
- payload.cityId = curCity.id
|
270
|
|
- }
|
271
|
|
-
|
272
|
|
- this.setState({
|
273
|
|
- newsList: [{}]
|
274
|
|
- }, () => {
|
275
|
|
- queryNewsList(payload).then(res => {
|
276
|
|
- this.setState({
|
277
|
|
- newsList: res.records || []
|
278
|
|
- })
|
279
|
|
- })
|
280
|
|
- })
|
281
|
|
- }
|
282
|
|
-
|
283
|
|
-
|
284
|
260
|
loadList() {
|
285
|
261
|
const { keywords } = this.state
|
286
|
262
|
const { curCity } = this.props
|
|
@@ -328,7 +304,7 @@ export default class Index extends Component {
|
328
|
304
|
console.log('首页分享')
|
329
|
305
|
})
|
330
|
306
|
return {
|
331
|
|
- title: `${this.props.userInfo.miniApp.name || '橙蕉'} 精准获客平台`,//分享内容
|
|
307
|
+ title: `${this.props.userInfo.miniApp.name || '橙蕉'} 精准获客平台`,//分享内容
|
332
|
308
|
path: `/pages/project/index?from=share&recommender=${personId}`,//分享地址
|
333
|
309
|
imageUrl: this.state.shareImg
|
334
|
310
|
}
|
|
@@ -435,9 +411,7 @@ export default class Index extends Component {
|
435
|
411
|
}
|
436
|
412
|
|
437
|
413
|
handleMaskBannerClick(data) {
|
438
|
|
-
|
439
|
414
|
this.redirectTo(data)
|
440
|
|
-
|
441
|
415
|
}
|
442
|
416
|
|
443
|
417
|
handleLocationClick() {
|
|
@@ -463,25 +437,11 @@ export default class Index extends Component {
|
463
|
437
|
// DRIFT: 'drift', // 游客
|
464
|
438
|
// CUSTOMER: 'customer' // 客户
|
465
|
439
|
toRecomonedPage() {
|
466
|
|
- const {
|
467
|
|
- userInfo: { person: { personType } }
|
468
|
|
- } = this.props
|
469
|
440
|
|
470
|
|
- if (personType === ROLE_CODE['DRIFT'] || !personType) {
|
471
|
|
- // 游客或者客户 区别是否有电话
|
472
|
|
- // this.setState({
|
473
|
|
- // achieve: true
|
474
|
|
- // })
|
475
|
|
- Taro.navigateTo({
|
476
|
|
- url: `/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
|
477
|
|
- })
|
478
|
|
- } else {
|
|
441
|
+ Taro.navigateTo({
|
|
442
|
+ url: `/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
|
|
443
|
+ })
|
479
|
444
|
|
480
|
|
- Taro.navigateTo({
|
481
|
|
- url: `/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
|
482
|
|
- })
|
483
|
|
- console.log(this.props.curCity.id, "this.props.curCity.id")
|
484
|
|
- }
|
485
|
445
|
}
|
486
|
446
|
toMapHouse() {
|
487
|
447
|
Taro.navigateTo({
|
|
@@ -497,19 +457,11 @@ export default class Index extends Component {
|
497
|
457
|
url: `/pages/agent/recommend/index?type=index&cityId=` + curCity.id
|
498
|
458
|
})
|
499
|
459
|
}
|
500
|
|
- toNewsList() {
|
501
|
|
- Taro.getApp().props.projectIndex = 1
|
502
|
|
- Taro.switchTab({
|
503
|
|
- url: `/pages/activity/activity`,
|
504
|
|
- fail: res => {
|
505
|
|
- Taro.getApp().props.projectIndex = 0
|
506
|
|
- }
|
507
|
|
- })
|
508
|
|
- }
|
|
460
|
+
|
509
|
461
|
|
510
|
462
|
renderProjectList() {
|
511
|
463
|
const { proList: { records = [] } } = this.props
|
512
|
|
- const { helpGroupList } = this.state
|
|
464
|
+
|
513
|
465
|
const list = records.filter(item => item.isMain === 1)
|
514
|
466
|
console.log(records, 'proList')
|
515
|
467
|
return (
|
|
@@ -519,7 +471,7 @@ export default class Index extends Component {
|
519
|
471
|
< View className="houses" >
|
520
|
472
|
<View className="section-head">
|
521
|
473
|
<View style="display:flex;align-items:center">
|
522
|
|
- <Text className="section-head__title" onClick={this.handleProItemClick}>全部楼盘
|
|
474
|
+ <Text className="section-head__title" onClick={this.handleProItemClick}>推荐楼盘
|
523
|
475
|
</Text>
|
524
|
476
|
<Image src={require('@assets/index/map.png')} onClick={this.toMapHouse} className='map-img'></Image>
|
525
|
477
|
<Text className='map-txt' onClick={this.toMapHouse}>地图看房</Text>
|
|
@@ -542,25 +494,6 @@ export default class Index extends Component {
|
542
|
494
|
)
|
543
|
495
|
}
|
544
|
496
|
|
545
|
|
- {
|
546
|
|
- helpGroupList.length > 0 &&
|
547
|
|
- <View
|
548
|
|
- style={{
|
549
|
|
- position: 'relative', padding: '20px 15px 0 15px'
|
550
|
|
- }}>
|
551
|
|
-
|
552
|
|
- <HelpGroupBanner
|
553
|
|
- style={{
|
554
|
|
- borderRadius: '6px',
|
555
|
|
- height: '230rpx'
|
556
|
|
- }}
|
557
|
|
- indicatorDots={false}
|
558
|
|
- list={helpGroupList}
|
559
|
|
- onClick={this.handleHelpGroupClick}>
|
560
|
|
- </HelpGroupBanner>
|
561
|
|
- </View>
|
562
|
|
- }
|
563
|
|
-
|
564
|
497
|
<View className="last-text">已经到底了~</View>
|
565
|
498
|
</Block>
|
566
|
499
|
)
|
|
@@ -592,10 +525,29 @@ export default class Index extends Component {
|
592
|
525
|
url: '/pages/news/detail/index?id=' + item.newsId
|
593
|
526
|
})
|
594
|
527
|
}
|
|
528
|
+ toNewsList() {
|
|
529
|
+ Taro.getApp().props.projectIndex = 1
|
|
530
|
+ Taro.switchTab({
|
|
531
|
+ url: `/pages/activity/activity`,
|
|
532
|
+ fail: res => {
|
|
533
|
+ Taro.getApp().props.projectIndex = 0
|
|
534
|
+ }
|
|
535
|
+ })
|
|
536
|
+ }
|
|
537
|
+ toShopMallPage() {
|
|
538
|
+ Taro.switchTab({
|
|
539
|
+ url: `/pages/shop/index`
|
|
540
|
+ })
|
|
541
|
+ }
|
|
542
|
+ toPolicyPage() {
|
|
543
|
+ Taro.navigateTo({
|
|
544
|
+ url: '/pages/policy/index?from=mine',
|
|
545
|
+ })
|
|
546
|
+ }
|
595
|
547
|
|
596
|
548
|
render() {
|
597
|
549
|
const { curCity } = this.props
|
598
|
|
- const { newsList, achieve, adImage } = this.state
|
|
550
|
+ const { achieve, helpGroupList } = this.state
|
599
|
551
|
const { userInfo: { person: { personType, phone } } } = this.props
|
600
|
552
|
const { unReadNum, userInfo: { person } } = this.props
|
601
|
553
|
return (
|
|
@@ -606,18 +558,29 @@ export default class Index extends Component {
|
606
|
558
|
{!achieve && <ScrollView
|
607
|
559
|
scrollY
|
608
|
560
|
className='home'>
|
|
561
|
+ <View className="top-box">
|
|
562
|
+ <View className="search" onClick={this.handleToHouseList}>
|
|
563
|
+ <Image className="search-icon" src={require('@assets/index/search.png')} />
|
|
564
|
+ <Input className="search-input" placeholder-style="color:#B8B8B8" placeholder="输入你想查询的楼盘"></Input>
|
|
565
|
+ </View>
|
|
566
|
+ <View className="location" onClick={this.handleLocationClick}>
|
|
567
|
+ <Image className="location-icon" src={require('@assets/index/location.png')} />
|
|
568
|
+ <Text className="location-text">{curCity.id ? curCity.shortname : '正在定位'}</Text>
|
|
569
|
+ <View class="arrow_down"></View>
|
|
570
|
+ </View>
|
|
571
|
+ </View>
|
609
|
572
|
<View className="section section-top" style={{ marginTop: 0, paddingTop: 0 }}>
|
610
|
573
|
<View
|
611
|
574
|
style={{
|
612
|
|
- height: '600rpx', position: 'relative'
|
|
575
|
+ height: '464rpx', position: 'relative'
|
613
|
576
|
}}>
|
614
|
577
|
{
|
615
|
578
|
this.state.visBanner && (
|
616
|
579
|
<Banner
|
617
|
580
|
style={{
|
618
|
|
- height: '600rpx'
|
|
581
|
+ height: '464rpx'
|
619
|
582
|
}}
|
620
|
|
- indicatorDots={true}
|
|
583
|
+ indicatorDots={false}
|
621
|
584
|
list={this.state.bannerList}
|
622
|
585
|
onClick={this.handleBannerClick}
|
623
|
586
|
onChange={() => (1)}
|
|
@@ -626,18 +589,7 @@ export default class Index extends Component {
|
626
|
589
|
)
|
627
|
590
|
}
|
628
|
591
|
</View>
|
629
|
|
- <View className="top-box">
|
630
|
|
- <View className="search" onClick={this.handleToHouseList}>
|
631
|
|
- <Image className="search-icon" src={require('@assets/search.png')} />
|
632
|
|
- <Input className="search-input" placeholder-style="color:#fff" placeholder="输入你想查询的楼盘"></Input>
|
633
|
|
- </View>
|
634
|
|
- <View className="location" onClick={this.handleLocationClick}>
|
635
|
|
- <Image className="location-icon" src={require('@assets/map.png')} />
|
636
|
|
- <Text className="location-text">{curCity.id ? curCity.name : '正在定位'}</Text>
|
637
|
|
- </View>
|
638
|
|
- </View>
|
639
|
|
-
|
640
|
|
- {
|
|
592
|
+ {/* {
|
641
|
593
|
(personType !== ROLE_CODE['CONSULTANT']) && (
|
642
|
594
|
<View className='section sectionn-customer' style={newsList.length ? "padding-bottom:0rpx;" : ""} >
|
643
|
595
|
<View className='section-content' onClick={this.toRecomonedPage.bind(this, personType)}>
|
|
@@ -660,18 +612,64 @@ export default class Index extends Component {
|
660
|
612
|
</View>
|
661
|
613
|
</View>
|
662
|
614
|
)
|
663
|
|
- }
|
|
615
|
+ } */}
|
664
|
616
|
|
665
|
617
|
</View>
|
666
|
|
- <Newsbanner cityId={curCity.id} onClick={this.handleNoticeClick} onClickMore={this.toNewsList} />
|
|
618
|
+ <View className="mune-box" style={personType == ROLE_CODE['CONSULTANT'] ? "padding:0 8%" : ""}>
|
|
619
|
+ <View className="mune-item" onClick={this.toShopMallPage}>
|
|
620
|
+ <Image src={require('@assets/index/mall-icon.png')} className='icon'></Image>
|
|
621
|
+ <View className="mune-text">
|
|
622
|
+ 积分商城
|
|
623
|
+ </View>
|
|
624
|
+ </View>
|
|
625
|
+ <View className="mune-item" onClick={this.toPolicyPage}>
|
|
626
|
+ <Image src={require('@assets/index/encyclopedia-icon.png')} className='icon'></Image>
|
|
627
|
+ <View className="mune-text">
|
|
628
|
+ 购房百科
|
|
629
|
+ </View>
|
|
630
|
+ </View>
|
|
631
|
+ {
|
|
632
|
+ (personType !== ROLE_CODE['CONSULTANT']) &&
|
|
633
|
+ <View className="mune-item" onClick={this.toRecomonedPage}>
|
|
634
|
+ <Image src={require('@assets/index/recommend-icon.png')} className='icon'></Image>
|
|
635
|
+ <View className="mune-text">
|
|
636
|
+ 推荐客户
|
|
637
|
+ </View>
|
|
638
|
+ </View>
|
|
639
|
+ }
|
|
640
|
+ <View className="mune-item" onClick={this.toMapHouse}>
|
|
641
|
+ <Image src={require('@assets/index/map-icon.png')} className='icon'></Image>
|
|
642
|
+ <View className="mune-text">
|
|
643
|
+ 地图找房
|
|
644
|
+ </View>
|
|
645
|
+ </View>
|
|
646
|
+ </View>
|
|
647
|
+ <View style="border-bottom:20rpx solid #f5f5f5">
|
|
648
|
+ {
|
|
649
|
+ helpGroupList.length > 0 &&
|
|
650
|
+ <View
|
|
651
|
+ style={{
|
|
652
|
+ position: 'relative', padding: '20px 15px 0 15px'
|
|
653
|
+ }}>
|
667
|
654
|
|
|
655
|
+ <BannerTwo
|
|
656
|
+ style={{
|
|
657
|
+ borderRadius: '6px',
|
|
658
|
+ height: '230rpx'
|
|
659
|
+ }}
|
|
660
|
+ indicatorDots={false}
|
|
661
|
+ list={helpGroupList}
|
|
662
|
+ onClick={this.handleHelpGroupClick}>
|
|
663
|
+ </BannerTwo>
|
|
664
|
+ </View>
|
|
665
|
+ }
|
|
666
|
+ <Newsbanner cityId={curCity.id} onClick={this.handleNoticeClick} onClickMore={this.toNewsList} />
|
|
667
|
+ <Activity cityId={curCity.id} />
|
|
668
|
+ </View >
|
668
|
669
|
{/* 推荐楼盘 */}
|
669
|
670
|
{this.renderProjectList()}
|
670
|
|
-
|
671
|
671
|
</ScrollView>}
|
672
|
|
- {/* user={person} onSuccess={()=>this.handleAuthPhoneSuccess(curCity) */}
|
673
|
|
- {/* {achieve && <View style="width:100%;height:100%"><Authorize ></Authorize> </View>} */}
|
674
|
|
- {this.state.maskVisible && this.renderMaskBanner()}
|
|
672
|
+ {/* {this.state.maskVisible && this.renderMaskBanner()} */}
|
675
|
673
|
<View className="chat-box" onClick={this.toChatList}>
|
676
|
674
|
{unReadNum > 0 && <View className="red-dot"></View >}
|
677
|
675
|
<Image className='chat-img' src={require('@assets/person/communicate.png')}></Image>
|