周立森 5 years ago
parent
commit
82717de94e
3 changed files with 33 additions and 23 deletions
  1. 15
    1
      src/pages/agent/recommend/index.js
  2. 16
    17
      src/pages/project/index.js
  3. 2
    5
      src/pages/project/index.scss

+ 15
- 1
src/pages/agent/recommend/index.js View File

5
 import { getCardList } from '@services/card'
5
 import { getCardList } from '@services/card'
6
 import { savePoint, updatePoint } from '@services/common'
6
 import { savePoint, updatePoint } from '@services/common'
7
 
7
 
8
+import Authorize from '@components/authorize'
9
+
8
 import { connect } from '@tarojs/redux'
10
 import { connect } from '@tarojs/redux'
9
 @connect(({ user, card, project }) => ({ ...user, ...card, ...project }))
11
 @connect(({ user, card, project }) => ({ ...user, ...card, ...project }))
10
 export default class Index extends Component {
12
 export default class Index extends Component {
414
       sex: e.detail.value
416
       sex: e.detail.value
415
     })
417
     })
416
   }
418
   }
417
-  render() {
419
+  renderLogin () {
420
+    return <Authorize></Authorize>
421
+  }
422
+
423
+  renderDetail() {
418
     const { reType } = this.state
424
     const { reType } = this.state
419
     return (
425
     return (
420
       <View className='recommend__customers'>
426
       <View className='recommend__customers'>
473
       </View>
479
       </View>
474
     );
480
     );
475
   }
481
   }
482
+  render() {
483
+    const { person: { phone, tel } } = this.props.userInfo
484
+    return (
485
+      <View style="width:100%;height:100%">
486
+      {!phone && !tel ? this.renderLogin() : this.renderDetail()}
487
+    </View>
488
+    );
489
+  }
476
 }
490
 }

+ 16
- 17
src/pages/project/index.js View File

28
   state => ({ ...state.project, ...state.city, ...state.user }),
28
   state => ({ ...state.project, ...state.city, ...state.user }),
29
   { ...actions, dispatchCitySelected }
29
   { ...actions, dispatchCitySelected }
30
 )
30
 )
31
-
32
 export default class Index extends Component {
31
 export default class Index extends Component {
33
   config = {
32
   config = {
34
     navigationBarTitleText: '橙蕉'
33
     navigationBarTitleText: '橙蕉'
103
       const payload = { location: `${location.longitude},${location.latitude}` }
102
       const payload = { location: `${location.longitude},${location.latitude}` }
104
 
103
 
105
       getLocationCity(payload).then(res => {
104
       getLocationCity(payload).then(res => {
106
-        console.log(res,"!!!!!!!!!!!!!!!!!11res=========")
105
+        console.log(res, "!!!!!!!!!!!!!!!!!11res=========")
107
         let curCity = cityList.filter(item => {
106
         let curCity = cityList.filter(item => {
108
           return item.name == res.name || ''
107
           return item.name == res.name || ''
109
         })
108
         })
134
       this.updateCity(defaultCity)
133
       this.updateCity(defaultCity)
135
     })
134
     })
136
   }
135
   }
137
-  updateCity(payload) {
136
+  updateCity (payload) {
138
     const NanJing = {
137
     const NanJing = {
139
       citycode: "025",
138
       citycode: "025",
140
       id: 320100,
139
       id: 320100,
443
 
442
 
444
     if (personType === ROLE_CODE['DRIFT'] || !personType) {
443
     if (personType === ROLE_CODE['DRIFT'] || !personType) {
445
       // 游客或者客户 区别是否有电话
444
       // 游客或者客户 区别是否有电话
446
-      this.setState({
447
-        achieve: true
448
-      })
449
-      // Taro.navigateTo({
450
-      //   url: `/pages/agent/become/index`
445
+      // this.setState({
446
+      //   achieve: true
451
       // })
447
       // })
448
+      Taro.navigateTo({
449
+        url: `/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
450
+      })
452
     } else {
451
     } else {
453
-      
452
+
454
       Taro.navigateTo({
453
       Taro.navigateTo({
455
         url: `/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
454
         url: `/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
456
       })
455
       })
464
   }
463
   }
465
 
464
 
466
   handleAuthPhoneSuccess (curCity) {
465
   handleAuthPhoneSuccess (curCity) {
467
-   
468
-    console.log(curCity,'curCity')
469
-    
470
-   Taro.navigateTo({
471
-        url: `/pages/agent/recommend/index?type=index&cityId=` + curCity.id
472
-      })
466
+
467
+    console.log(curCity, 'curCity')
468
+
469
+    Taro.navigateTo({
470
+      url: `/pages/agent/recommend/index?type=index&cityId=` + curCity.id
471
+    })
473
   }
472
   }
474
 
473
 
475
 
474
 
619
               {this.renderProjectList()}
618
               {this.renderProjectList()}
620
 
619
 
621
             </ScrollView>}
620
             </ScrollView>}
622
-          {/* user={person} onSuccess={()=>this.handleAuthPhoneSuccess(curCity) */}
623
-            {achieve && <Authorize ></Authorize>}
621
+            {/* user={person} onSuccess={()=>this.handleAuthPhoneSuccess(curCity) */}
622
+            {/* {achieve && <View style="width:100%;height:100%"><Authorize ></Authorize>  </View>} */}
624
             {this.state.maskVisible && this.renderMaskBanner()}
623
             {this.state.maskVisible && this.renderMaskBanner()}
625
           </View >
624
           </View >
626
         )}
625
         )}

+ 2
- 5
src/pages/project/index.scss View File

3
 
3
 
4
 .page {
4
 .page {
5
   width: 100vw;
5
   width: 100vw;
6
-  // height: 100vh;
6
+  height: 100vh;
7
   background: #fff;
7
   background: #fff;
8
 }
8
 }
9
-.wrap{
10
-  width: 100%;
11
-  height: 100%;
12
-}
9
+
13
 .flex {
10
 .flex {
14
   display: flex;
11
   display: flex;
15
   justify-content: space-between;
12
   justify-content: space-between;