周立森 hace 5 años
padre
commit
13d32f390e

+ 2
- 2
config/dev.js Ver fichero

@@ -9,8 +9,8 @@ module.exports = {
9 9
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    HOST: '"http://192.168.0.170:8080"',
13
-    WSS_HOST: '"ws://192.168.0.170:8080"',
12
+    HOST: '"http://192.168.0.218:8080"',
13
+    WSS_HOST: '"ws://192.168.0.218:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 2
- 0
src/constants/api.js Ver fichero

@@ -47,6 +47,8 @@ export const API_ITEMS_LIST = resolvePath('building/list')
47 47
 export const API_ITEMS_DETAIL = resolvePath('buildingSelectId')
48 48
 export const API_ITEMS_TYPE = resolvePath('tdBuildingType')
49 49
 export const API_ACTIVITY_GROUP = resolvePath('helpActivityAndGroup')
50
+export const API_LOCATION_CITYP = resolvePath('location/city')
51
+// /wx/location/city?location=lon,lat
50 52
 
51 53
 
52 54
 // shop

+ 3
- 1
src/constants/project.js Ver fichero

@@ -1,2 +1,4 @@
1 1
 export const PROJECT_LIST = 'PROJECT_LIST'
2
-export const PROJECT_DETAIL = 'PROJECT_DETAIL'
2
+export const PROJECT_DETAIL = 'PROJECT_DETAIL'
3
+
4
+export const LOCATION_CITY = 'LOCATION_CITY'

+ 3
- 3
src/pages/agent/client/index.js Ver fichero

@@ -125,15 +125,15 @@ export default class Index extends Component {
125 125
                         </View>
126 126
                         <View className='client__top'>
127 127
                           <View className='client__infor'>
128
-                            <Text className='client__name'>{item.name}  &emsp;</Text>
128
+                            <Text className='client__name'>{item.name} </Text>
129 129
                             <Image className='sex' src={item.sex == 1 ? require('@assets/person/guest/man.png') : require('@assets/person/guest/women.png')} mode='widthFix'></Image>
130 130
                           </View>
131 131
 
132 132
 
133 133
                         </View>
134 134
 
135
-                        <View className='phone'>手机:&emsp;{item.phone}</View>
136
-                        <View className='phone'>意向楼盘:&emsp;{item.intention ? item.intention : '暂无'}</View>
135
+                        <View className='phone'>手机: {item.phone}</View>
136
+                        <View className='phone'>意向楼盘: {item.intention ? item.intention : '暂无'}</View>
137 137
 
138 138
                       </View>
139 139
                       <View className='time'>{dayjs(item.createDate).format('YYYY-MM-DD HH:mm:ss')}</View>

+ 6
- 6
src/pages/card/index.js Ver fichero

@@ -25,7 +25,7 @@ import { dispatchProjectDetail } from '@actions/project'
25 25
 
26 26
 export default class Index extends Component {
27 27
   config = {
28
-    navigationBarTitleText: '个人主页' 
28
+    navigationBarTitleText: '个人主页'
29 29
   }
30 30
   state = {
31 31
     cardId: null,
@@ -43,12 +43,12 @@ export default class Index extends Component {
43 43
       const router = Taro.getStorageSync('router')
44 44
       const id = this.$router.params.id || router.query.id || '4604a792d575eb8187711625bd88832c'
45 45
 
46
-      if(router.query.id){
46
+      if (router.query.id) {
47 47
         this.setState({
48 48
           cardId: id,
49 49
           modalStatus: true
50 50
         }, this.loadCardDetail)
51
-      }else{
51
+      } else {
52 52
         this.setState({
53 53
           cardId: id,
54 54
           modalStatus: false
@@ -464,7 +464,7 @@ export default class Index extends Component {
464 464
 
465 465
                 </View>
466 466
                 <View className='row medal'>
467
-                  <Image mode="aspectFill" className="img" src={require('@assets/person/jinpai.png')}></Image>
467
+                  <Image mode="widthFix" className="img" src={require('@assets/person/jinpai.png')}></Image>
468 468
                   <Text>金牌置业顾问</Text>
469 469
                 </View>
470 470
 
@@ -510,13 +510,13 @@ export default class Index extends Component {
510 510
                 <View className='detailed__main'>
511 511
                   <View className='detailed__tel' onClick={this.makePhoneCall}>
512 512
                     <View className='detailed__tel__txt'>
513
-                      <Text className='tel__txt' space='ensp'>手机&emsp;</Text> {cardInfo.phone}
513
+                      <Text className='tel__txt' space='ensp'>手机 </Text> {cardInfo.phone}
514 514
                     </View>
515 515
                     <Text className='iconfont icon-dianhua tel__img'></Text>
516 516
                   </View>
517 517
                   <View className='detailed__add' onClick={this.getLocation}>
518 518
                     <View className='detailed__add__txt'>
519
-                      <Text className='add__txt' space='ensp'>地址&emsp;</Text> {cardInfo.address}
519
+                      <Text className='add__txt' space='ensp'>地址 </Text> {cardInfo.address}
520 520
                     </View>
521 521
                     <Text className='iconfont icon-daohangdizhi add__img'></Text>
522 522
                   </View>

+ 7
- 2
src/pages/card/index.scss Ver fichero

@@ -49,11 +49,16 @@
49 49
 
50 50
   &__imgox {
51 51
     width: 100%;
52
-    height: 550px;
52
+    height: 750px;
53 53
     overflow: hidden;
54 54
     position: relative;
55
-  }
56 55
 
56
+    
57
+  }
58
+&__img {
59
+     width: 750px;
60
+     height: 750px;
61
+    }
57 62
   &__info {
58 63
     width: 100%;
59 64
     position: relative;

+ 7
- 5
src/pages/person/customerAnalysis/index.js Ver fichero

@@ -60,15 +60,17 @@ export default class customer extends Taro.Component {
60 60
 
61 61
   render() {
62 62
     const tabList = [{ title: '客户分析' }, { title: '我的客户' }]
63
-    const { customerNum } = this.state
63
+    const { customerNum, current } = this.state
64 64
     return (
65
-      <AtTabs className="tab-box" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
66
-        <AtTabsPane current={this.state.current} index={0} >
65
+      <AtTabs className="tab-box" current={current} tabList={tabList} onClick={this.handleClick.bind(this)}>
66
+        <AtTabsPane current={current} index={0} >
67 67
           <View >
68
-            <Analysis></Analysis>
68
+            {
69
+              current != 1 && <Analysis></Analysis>
70
+            }
69 71
           </View>
70 72
         </AtTabsPane>
71
-        <AtTabsPane current={this.state.current} index={1}>
73
+        <AtTabsPane current={current} index={1}>
72 74
           <View style="padding:10px 20px; display: flex;flex-wrap: wrap;align-content: flex-start;justify-content: space-between;">
73 75
             <View className="my-customer" onClick={this.toFollowUpCustomer} style="border-right:1px solid rgba(0,0,0,0.12)">
74 76
               <Image mode="widthFix" src={require('@assets/person/genjin.png')} className='img'></Image>

+ 6
- 4
src/pages/project/album/index.js Ver fichero

@@ -73,18 +73,20 @@ export default class Index extends Component {
73 73
                 const { apartmentName } = item || {}
74 74
                 const buildingImgList = item.buildingImgList
75 75
 
76
-                console.log(imgList, '22333333222')
77
-                return (
76
+                console.log(item, '22333333222')
77
+                return (<View>
78
+                  {buildingImgList.length>0&&
78 79
                   <View
79
-                    style={{ width: '100px' }}
80
+                    style={{ padding: '0 20px ' }}
80 81
                     key={current}
81 82
                     className={`around-tab__item ${current === index ? 'active' : ''}`}
82 83
                     onClick={() => this.setState({ current: index })}
83 84
                   >
84 85
 
85 86
                     <View>
86
-                      <View style={{ width: '100px', textAlign: 'center' }}>  {`${apartmentName}(${buildingImgList.length})`} </View>
87
+                      <View style={{  textAlign: 'center' }}>  {`${apartmentName}(${buildingImgList.length})`} </View>
87 88
                     </View>
89
+                  </View>}
88 90
                   </View>
89 91
                 )
90 92
               })}

+ 85
- 75
src/pages/project/detail/index.js Ver fichero

@@ -58,7 +58,7 @@ export default class Index extends Component {
58 58
     videoPlayShow: 'flex',
59 59
   }
60 60
 
61
-  componentWillMount() {
61
+  componentWillMount () {
62 62
     // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
63 63
 
64 64
     ready.queue(() => {
@@ -92,12 +92,12 @@ export default class Index extends Component {
92 92
     })
93 93
   }
94 94
 
95
-  componentWillUnmount() {
95
+  componentWillUnmount () {
96 96
     const { recordId } = this.state
97 97
     recordId && updatePoint(recordId)
98 98
   }
99 99
 
100
-  loadHelpGroupList() {
100
+  loadHelpGroupList () {
101 101
     const { buildingId } = this.state
102 102
 
103 103
     queryHelpGroup({ buildingId: buildingId }).then(res => {
@@ -119,7 +119,7 @@ export default class Index extends Component {
119 119
     )
120 120
   }
121 121
 
122
-  loadDetail() {
122
+  loadDetail () {
123 123
     const { buildingId } = this.state
124 124
     const { dispatchProjectDetail } = this.props
125 125
     this.setState({
@@ -147,7 +147,7 @@ export default class Index extends Component {
147 147
     })
148 148
   }
149 149
 
150
-  loadActivityData() {
150
+  loadActivityData () {
151 151
     const { buildingId } = this.state
152 152
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
153 153
     queryActivityList(payload).then(res => {
@@ -157,7 +157,7 @@ export default class Index extends Component {
157 157
     })
158 158
   }
159 159
 
160
-  loadNewsData() {
160
+  loadNewsData () {
161 161
     const { buildingId } = this.state
162 162
     const payload = { pageSize: 2, pageNumber: 1, buildingId }
163 163
     queryNewsList(payload).then(res => {
@@ -167,11 +167,11 @@ export default class Index extends Component {
167 167
     })
168 168
   }
169 169
 
170
-  navigateTo(url) {
170
+  navigateTo (url) {
171 171
     Taro.navigateTo({ url: url })
172 172
   }
173 173
   // 海报预览图
174
-  previewImage(arr) {
174
+  previewImage (arr) {
175 175
     // console.log('arr:' + arr)
176 176
     if (arr[0].length > 1) {
177 177
       Taro.previewImage({
@@ -198,7 +198,7 @@ export default class Index extends Component {
198 198
     })
199 199
   }
200 200
 
201
-  openMap() {
201
+  openMap () {
202 202
     const {
203 203
       buildingName,
204 204
       address,
@@ -225,12 +225,12 @@ export default class Index extends Component {
225 225
     })
226 226
   }
227 227
 
228
-  toViewAlbum() {
228
+  toViewAlbum () {
229 229
     const { buildingId } = this.state
230 230
     this.navigateTo(`/pages/project/album/index?id=${buildingId}`)
231 231
   }
232 232
 
233
-  onViewFans() {
233
+  onViewFans () {
234 234
     const { buildingId } = this.state
235 235
     this.navigateTo('/pages/card/fans/index?type=item&id=' + buildingId)
236 236
   }
@@ -259,7 +259,7 @@ export default class Index extends Component {
259 259
     }
260 260
   }
261 261
 
262
-  getPhoneNumber(e, item) {
262
+  getPhoneNumber (e, item) {
263 263
     getUserPhone(e, (phoneNumber) => {
264 264
       const { userInfo: { person: { personId, nickname, name } } } = this.props
265 265
       Taro.navigateTo({
@@ -268,7 +268,7 @@ export default class Index extends Component {
268 268
     })
269 269
   }
270 270
 
271
-  getPosterData() {
271
+  getPosterData () {
272 272
     return new Promise(resolve => {
273 273
       const { posterData } = this.state
274 274
       if (posterData.qrcode) {
@@ -339,14 +339,14 @@ export default class Index extends Component {
339 339
     })
340 340
   }
341 341
 
342
-  handleTelClick(item, e) {
342
+  handleTelClick (item, e) {
343 343
     e.stopPropagation()
344 344
     Taro.makePhoneCall({
345 345
       phoneNumber: item.phone
346 346
     })
347 347
   }
348 348
 
349
-  handleChatClick(item, e) {
349
+  handleChatClick (item, e) {
350 350
     e.stopPropagation()
351 351
     const { userInfo: { person: { personId, nickname, name } } } = this.props
352 352
     Taro.navigateTo({
@@ -354,24 +354,24 @@ export default class Index extends Component {
354 354
     })
355 355
   }
356 356
 
357
-  handleConsuItemClick(item) {
357
+  handleConsuItemClick (item) {
358 358
     Taro.navigateTo({
359 359
       url: `/pages/card/index?id=${item.id}`
360 360
     })
361 361
   }
362 362
 
363
-  handleMoreClick() {
363
+  handleMoreClick () {
364 364
     // App.zhuge.track('查看置业顾问列表')
365 365
     Taro.navigateTo({
366 366
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
367 367
     })
368 368
   }
369 369
 
370
-  handleStopPropagation(e) {
370
+  handleStopPropagation (e) {
371 371
     e.stopPropagation()
372 372
   }
373 373
 
374
-  toRecomonedPage() {
374
+  toRecomonedPage () {
375 375
     const {
376 376
       userInfo: { person: { personType } }
377 377
     } = this.props
@@ -387,50 +387,50 @@ export default class Index extends Component {
387 387
     }
388 388
   }
389 389
 
390
-  toHome() {
390
+  toHome () {
391 391
     Taro.switchTab({
392 392
       url: `/pages/project/index`
393 393
     })
394 394
   }
395 395
 
396
-  HandleCircumTabClick(id) {
396
+  HandleCircumTabClick (id) {
397 397
     this.setState({
398 398
       curTab: id
399 399
     })
400 400
   }
401 401
 
402
-  handleNewsMoreClick() {
402
+  handleNewsMoreClick () {
403 403
     Taro.navigateTo({
404 404
       url: `/pages/news/index?buildingId=` + this.state.buildingId
405 405
     })
406 406
   }
407 407
 
408
-  handNewsItemClick(id) {
408
+  handNewsItemClick (id) {
409 409
     Taro.navigateTo({
410 410
       url: '/pages/news/detail/index?id=' + id
411 411
     })
412 412
   }
413 413
 
414
-  handleActivityMoreClick() {
414
+  handleActivityMoreClick () {
415 415
     Taro.navigateTo({
416 416
       url: `/pages/activity/index?buildingId=` + this.state.buildingId
417 417
     })
418 418
   }
419 419
 
420
-  handActivityItemClick(id) {
420
+  handActivityItemClick (id) {
421 421
     Taro.navigateTo({
422 422
       url: '/pages/activity/detail/index?id=' + id
423 423
     })
424 424
   }
425 425
 
426
-  handlePreviewHxImage(current, urls) {
426
+  handlePreviewHxImage (current, urls) {
427 427
     Taro.previewImage({
428 428
       current,
429 429
       urls
430 430
     })
431 431
   }
432 432
 
433
-  handleFavor() {
433
+  handleFavor () {
434 434
     const { buildingId, isSaved } = this.state
435 435
     if (isSaved) {
436 436
       cancelFavorProject(buildingId).then(res => {
@@ -460,18 +460,18 @@ export default class Index extends Component {
460 460
       console.log('活动项目收藏')
461 461
     })
462 462
   }
463
-  handleToolsClick() {
463
+  handleToolsClick () {
464 464
     Taro.navigateTo({
465 465
       url: `/pages/toolKit/index`
466 466
     })
467 467
   }
468
-  moreFloor() {
468
+  moreFloor () {
469 469
     Taro.navigateTo({
470 470
       url: `/pages/project/floor/index`
471 471
     })
472 472
   }
473 473
 
474
-  renderBottomMenu() {
474
+  renderBottomMenu () {
475 475
     const { userInfo: { person: { personType } } } = this.props
476 476
     const { posterShow } = this.state
477 477
     return (
@@ -506,14 +506,14 @@ export default class Index extends Component {
506 506
     )
507 507
   }
508 508
 
509
-  previewHouseImage(current, urls) {
509
+  previewHouseImage (current, urls) {
510 510
     Taro.previewImage({
511 511
       current,
512 512
       urls
513 513
     })
514 514
   }
515 515
 
516
-  renderBuildingProjectTypeList() {
516
+  renderBuildingProjectTypeList () {
517 517
     const { statusOpts } = this.state
518 518
     const { projectDetail: { buildingProjectType = [], status, marketStatus } } = this.props
519 519
     return (
@@ -572,22 +572,22 @@ export default class Index extends Component {
572 572
   }
573 573
 
574 574
 
575
-  renderPhotoAlbum() {
575
+  renderPhotoAlbum () {
576 576
     const { projectDetail: { buildingApartment } } = this.props
577 577
     const list = buildingApartment.filter(item => item.apartmentType === 'photo')
578
-    const imgList = list.reduce((prev, cur) => {
579
-      prev = prev.concat(cur.buildingImgList)
580
-      return prev
581
-    }, [])
578
+    // const imgList = list.reduce((prev, cur) => {
579
+    //   prev = prev.concat(cur.buildingImgList)
580
+    //   return prev
581
+    // }, [])
582
+
582 583
 
583
-    const { albumCurrent } = this.state
584 584
 
585 585
 
586 586
 
587 587
     return (
588 588
 
589 589
 
590
-      <Block>
590
+      <Block> {console.log(list, 'list')}
591 591
         {list.length > 0 &&
592 592
           (
593 593
             <View className='photos__type'>
@@ -597,22 +597,32 @@ export default class Index extends Component {
597 597
 
598 598
                   <View className="around-tab">
599 599
                     {list.map((item, index) => {
600
-                      const { apartmentName } = item || {}
601
-                      const buildingImgList = item.buildingImgList
602
-
603
-
604
-                      return (
605
-                        <View
606
-                          style={{ marginRight: '8px' }}
607
-                        >
608
-                          {/* {`${label}(${num})`} */}
609
-                          <View>
610
-                            <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} ></Image>
611
-                            <View style={{ textAlign: 'center' }}>  {`${apartmentName}(${buildingImgList.length})`} </View>
612
-                          </View>
613
-                        </View>
614
-                      )
615
-                    })}
600
+                      const { apartmentName } = item
601
+                      const buildingImgList = item.buildingImgList 
602
+                      const buildingImgUrl = buildingImgList.length > 0 ? buildingImgList[0].url : null
603
+
604
+                      console.log(buildingImgUrl, 'buildingImgUrl')
605
+
606
+                      // if (buildingImgUrl != null) {
607
+                        return (<View>
608
+                         {buildingImgUrl != null&& (<View
609
+                            style={{ marginRight: '8px' }}
610
+                          >
611
+
612
+                            <View>
613
+                              <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} ></Image>
614
+                              <View style={{ textAlign: 'center', width: '218rpx', display: 'flex' }}>
615
+                                <View style={{ textAlign: 'center', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> {apartmentName}  </View>
616
+
617
+                                <View>({buildingImgList.length})</View>
618
+                              </View>
619
+                            </View>
620
+                          </View>)}</View>
621
+                        )
622
+                      // }
623
+
624
+                    })
625
+                    }
616 626
                   </View>
617 627
                 </View>
618 628
               </ScrollView>
@@ -622,7 +632,7 @@ export default class Index extends Component {
622 632
       </Block>
623 633
     )
624 634
   }
625
-  rendercircum() {
635
+  rendercircum () {
626 636
     const building = {
627 637
       ...this.props.projectDetail
628 638
     }
@@ -639,7 +649,7 @@ export default class Index extends Component {
639 649
     )
640 650
   }
641 651
 
642
-  renderConsuler() {
652
+  renderConsuler () {
643 653
     const { userInfo: { person: { phone } } } = this.props
644 654
     const { projectDetail: { consultants = [] } } = this.props
645 655
     return (
@@ -693,7 +703,7 @@ export default class Index extends Component {
693 703
     )
694 704
   }
695 705
 
696
-  renderStatement() {
706
+  renderStatement () {
697 707
     return (
698 708
       <View className='statement'>
699 709
         免责条款:以上价格仅供参考,具体一房一价的信息以售楼处展示为准。本网显示房屋位置、交通、医疗、教育、商业等配套信息,来源于第三方网络数据,不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。<br></br>本平台对项目周边文化教育的介绍旨在提供相关信息,并不意味着信息发布方对就学安排作出承诺。相关教育资源就学信息存在调整的可能,应以政府教育主管部门及办学颁布的政策规定为准。
@@ -702,7 +712,7 @@ export default class Index extends Component {
702 712
   }
703 713
 
704 714
 
705
-  renderHelp() {
715
+  renderHelp () {
706 716
     const { helpList } = this.state
707 717
     return (
708 718
       <Block>
@@ -723,17 +733,17 @@ export default class Index extends Component {
723 733
     )
724 734
   }
725 735
 
726
-  handleHelpClick(item) {
736
+  handleHelpClick (item) {
727 737
     Taro.navigateTo({
728 738
       url: '/pages/activity/detail/assistance?id=' + item.activityId
729 739
     })
730 740
   }
731
-  handleGroupClick(item) {
741
+  handleGroupClick (item) {
732 742
     Taro.navigateTo({
733 743
       url: '/pages/activity/detail/assemble?id=' + item.activityId
734 744
     })
735 745
   }
736
-  renderGroup() {
746
+  renderGroup () {
737 747
     const { groupList } = this.state
738 748
     return (
739 749
       <Block>
@@ -756,7 +766,7 @@ export default class Index extends Component {
756 766
     )
757 767
   }
758 768
 
759
-  renderHouseTypeList() {
769
+  renderHouseTypeList () {
760 770
     const { statusOpts } = this.state
761 771
     const { projectDetail: { buildingApartment } } = this.props
762 772
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
@@ -873,7 +883,7 @@ export default class Index extends Component {
873 883
       </Block>
874 884
     )
875 885
   }
876
-  renderNews() {
886
+  renderNews () {
877 887
     const { newsList } = this.state
878 888
     return (
879 889
       <Block>
@@ -915,7 +925,7 @@ export default class Index extends Component {
915 925
   }
916 926
 
917 927
   onPlay () {
918
-        console.log()
928
+    console.log()
919 929
     this.setState({
920 930
       videoPlayShow: 'none'
921 931
     })
@@ -929,7 +939,7 @@ export default class Index extends Component {
929 939
 
930 940
 
931 941
   renderVideo () {
932
-    const {videoPlayShow}  = this.state
942
+    const { videoPlayShow } = this.state
933 943
     const { projectDetail } = this.props
934 944
     const { videoImage } = projectDetail
935 945
     const imgSrc = videoImage[0].url
@@ -954,12 +964,12 @@ export default class Index extends Component {
954 964
           // initialTime='0'
955 965
           // loop={false}
956 966
           // muted={false}
957
-          
967
+
958 968
           show-mute-btn='true'
959
-          // onPlay={this.onPlay}
960
-          // show-center-play-btn='false'
961
-          // onPause= {this.onPause}
962
-       
969
+        // onPlay={this.onPlay}
970
+        // show-center-play-btn='false'
971
+        // onPause= {this.onPause}
972
+
963 973
         ></Video>
964 974
         {/* <Button className='pro__banner-btn' onClick={this.plagVideo} style={{ display: videoPlayShow  }}>
965 975
           <Image src={require('@assets/play.png')} mode='scaleToFill' className='pro__banner-btn-img'></Image>
@@ -968,22 +978,22 @@ export default class Index extends Component {
968 978
         {/* <View className='pro__banner-voice' onClick={this.plagVideo} >
969 979
           <Image src={require('@assets/voice.png')} mode='scaleToFill	' className='pro__banner-voice-img'></Image>
970 980
         </View> */}
971
-{/* 
981
+        {/* 
972 982
         <View className='pro__banner-extend' onClick={this.fullScreen} >
973 983
           <Image src={require('@assets/extend.png')} mode='scaleToFill	' className='pro__banner-extend-img'></Image>
974 984
         </View> */}
975
-      
985
+
976 986
       </View>
977 987
     )
978 988
   }
979 989
 
980
-  changeCurrent(current) {
990
+  changeCurrent (current) {
981 991
     this.setState({
982 992
       current: current + 1
983 993
     })
984 994
   }
985 995
 
986
-  render() {
996
+  render () {
987 997
     const { posterStatus, posterData, loaded, btnstate } = this.state
988 998
     const { projectDetail } = this.props
989 999
     const { uvList = {} } = projectDetail

+ 53
- 24
src/pages/project/index.js Ver fichero

@@ -8,6 +8,7 @@ import ActivityItem from '../activity/item'
8 8
 
9 9
 
10 10
 import ready from '@utils/ready'
11
+import { getLocationCity } from '@services/map'
11 12
 
12 13
 import { queryBanners, savePoint, updatePoint } from '@services/common'
13 14
 import { queryNewsList, queryHelpGroup } from '@services/news'
@@ -95,42 +96,69 @@ export default class Index extends Component {
95 96
     Taro.getLocation().then(location => {
96 97
       Taro.setStorageSync('lat', location.latitude)
97 98
       Taro.setStorageSync('lon', location.longitude)
99
+      console.log(location, 'location')
98 100
 
101
+      const payload = { location: `${location.longitude},${location.latitude}` }
102
+      console.log(payload, 'payload')
99 103
 
100
-      this.qqmapsdk.reverseGeocoder({
101
-        location,
102
-        success: (res) => {
103
-          // debugger
104
-          let city = res.result.address_component.city
104
+      getLocationCity(payload).then(res => {
105
+        let cityId = res.id
106
+        let curCity = cityList.filter(item => {
107
+          return item.id == cityId
108
+        })
109
+
110
+        Taro.showToast({
111
+          title: `当前定位城市:${res.name}`,
112
+          icon: 'none',
113
+        })
114
+
115
+        this.updateCity(curCity[0] || defaultCity[0])
116
+        console.log(curCity, 'location')
117
+
118
+
119
+        // this.qqmapsdk.getLocationCity({
120
+
121
+
122
+        //   location,
123
+        //   success: (res) => {
124
+        //     // debugger
125
+        //     let city = res.result.address_component.city
105 126
 
106
-          console.log('-----city-->', city)
107
-          console.log('-----cityList-->', cityList)
127
+        //     console.log('-----city-->', city)
128
+        //     console.log('-----cityList-->', cityList)
108 129
 
109 130
 
110
-          let curCity = cityList.filter(item => {
111
-            return item.name == city
112
-          })
131
+        //     let curCity = cityList.filter(item => {
132
+        //       return item.name == city
133
+        //     })
113 134
 
114 135
 
115 136
 
116 137
 
117
-          Taro.showToast({
118
-            title: `当前定位城市:${(curCity[0] || {}).name}`,
119
-            icon: 'none',
120
-          })
138
+        //     Taro.showToast({
139
+        //       title: `当前定位城市:${(curCity[0] || {}).name}`,
140
+        //       icon: 'none',
141
+        //     })
121 142
 
122
-          this.updateCity(curCity[0] || defaultCity[0])
123
-        },
124
-        fail: (error) => {
143
+        //     this.updateCity(curCity[0] || defaultCity[0])
144
+        //   },
145
+        //   fail: (error) => {
125 146
 
126 147
 
127
-          Taro.showToast({
128
-            title: `定位错误: ${error.message}`,
129
-            icon: 'none',
130
-          })
131
-          console.error(err)
132
-          this.updateCity(defaultCity[0])
133
-        },
148
+        //     Taro.showToast({
149
+        //       title: `定位错误: ${error.message}`,
150
+        //       icon: 'none',
151
+        //     })
152
+        //     console.error(err)
153
+        //     this.updateCity(defaultCity[0])
154
+        //   },
155
+      }).catch(err=>{
156
+               Taro.showToast({
157
+              title: `定位错误: ${error.message}`,
158
+              icon: 'none',
159
+            })
160
+            console.error(err)
161
+            this.updateCity(defaultCity[0])
134 162
       })
135 163
     }).catch(err => {
136 164
       if (err.errMsg === 'getLocation:fail auth deny') {
@@ -185,6 +213,7 @@ export default class Index extends Component {
185 213
   }
186 214
   loadBannerList () {
187 215
     const { curCity } = this.props
216
+    console.log(this.props,'this.props')
188 217
     // 获取首页banner
189 218
     const payload = {
190 219
       showPosition: 'index'

+ 2
- 6
src/pages/shop/index.js Ver fichero

@@ -36,6 +36,8 @@ export default class Shop extends Component {
36 36
     goodsBuilding: [],
37 37
     goodsList: [],
38 38
     user: {},
39
+    current: 0,
40
+    points:0
39 41
   }
40 42
 
41 43
   componentDidShow() {
@@ -245,11 +247,6 @@ export default class Shop extends Component {
245 247
         return;
246 248
     }
247 249
   }
248
-  state = {
249
-    current: 0,
250
-  }
251
-
252
-
253 250
 
254 251
   renderGoods() {
255 252
     const { goods: { records = [] } } = this.props
@@ -385,7 +382,6 @@ export default class Shop extends Component {
385 382
             <Banner list={bannerList} onClick={this.handleBannerClick} indicatorDots={false}></Banner>
386 383
           }
387 384
 
388
-
389 385
           {this.renderGoods()}
390 386
         </ScrollView>
391 387
       </View >

+ 14
- 0
src/services/map.js Ver fichero

@@ -0,0 +1,14 @@
1
+
2
+
3
+import { fetch } from '@utils/request'
4
+import {
5
+  API_LOCATION_CITYP
6
+
7
+} from '@constants/api'
8
+
9
+
10
+/**
11
+ * 获取名片列表
12
+ * @param {*} payload 
13
+ */
14
+export const getLocationCity = payload => fetch({ url: API_LOCATION_CITYP, payload })

+ 1
- 1
src/utils/request.js Ver fichero

@@ -28,7 +28,7 @@ export const setStorage = function (key, data) {
28 28
  */
29 29
 export const fetch = async (options) => {
30 30
   const { url, payload, method = 'GET', showToast = true, autoLogin = true } = options
31
-
31
+  console.log(Taro.getStorageSync('token'),'----token---')
32 32
   return Taro.request({
33 33
     url,
34 34
     method,