|
@@ -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
|
{/* 推荐楼盘 */}
|