Просмотр исходного кода

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into dev

张延森 5 лет назад
Родитель
Сommit
9ab1014305
3 измененных файлов: 29 добавлений и 7 удалений
  1. 9
    0
      .project
  2. 10
    6
      src/components/authorizationComponent/index.js
  3. 10
    1
      src/pages/news/detail/index.js

+ 9
- 0
.project Просмотреть файл

@@ -42,5 +42,14 @@
42 42
 				<arguments>1.0-name-matches-false-false-node_modules</arguments>
43 43
 			</matcher>
44 44
 		</filter>
45
+		<filter>
46
+			<id>1577260405326</id>
47
+			<name></name>
48
+			<type>26</type>
49
+			<matcher>
50
+				<id>org.eclipse.ui.ide.multiFilter</id>
51
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
52
+			</matcher>
53
+		</filter>
45 54
 	</filteredResources>
46 55
 </projectDescription>

+ 10
- 6
src/components/authorizationComponent/index.js Просмотреть файл

@@ -16,7 +16,7 @@ export default class Index extends Component {
16 16
   }
17 17
   componentWillMount() {
18 18
     const { user = {} } = this.props
19
-    // this.toggleGrantAvatar()
19
+    this.toggleGrantAvatar()
20 20
   }
21 21
 
22 22
   toggleGrantAvatar = () => {
@@ -53,7 +53,10 @@ export default class Index extends Component {
53 53
         // 用户信息保存至服务器
54 54
         dispatchUpdateUserInfo(payload).then(res => {
55 55
           console.log('更新信息')
56
-          this.setState({isLogin:true})
56
+          this.setState({
57
+          	isLogin:true,
58
+          	
59
+          })
57 60
         })
58 61
       },
59 62
       fail: (err) => {
@@ -70,6 +73,7 @@ export default class Index extends Component {
70 73
   }
71 74
 
72 75
   getPhoneNumber(e) {
76
+  	const { userInfo: { person: { personId } } } = this.props
73 77
     getUserPhone(e, (phoneNumber) => {
74 78
       const { dispatchUpdateUserInfoNew } = this.props
75 79
       if (!phoneNumber) {
@@ -79,14 +83,14 @@ export default class Index extends Component {
79 83
         })
80 84
         return
81 85
       } else {
82
-        dispatchUpdateUserInfoNew(this.state.user.id)
86
+        dispatchUpdateUserInfoNew(personId)
83 87
         this.setState({isPhone:true})
84 88
       }
85 89
     })
86 90
   }
87 91
 
88 92
   render() {
89
-    const {user}=this.state
93
+    const { userInfo: { person: { avatarurl,nickname } } } = this.props
90 94
     if (!this.state.isLogin) {
91 95
       return (
92 96
         <View className="avatar-page">
@@ -101,8 +105,8 @@ export default class Index extends Component {
101 105
     } else if (!this.state.isPhone) {
102 106
       return (
103 107
         <View className='auth-page'>
104
-          <Image className="avatar_img" src={user.avatar} />
105
-          <View className="user_name">{user.nickname}</View>
108
+          <Image className="avatar_img" src={avatarurl} />
109
+          <View className="user_name">{nickname}</View>
106 110
           <Button className='auth-btn' open-type="getPhoneNumber" onGetphonenumber={this.getPhoneNumber}>微信授权一键登录</Button>
107 111
           {/* <View className='adver-btn' onClick={this.handleLogin}><Text>我是置业顾问,立即登录~</Text></View> */}
108 112
         </View>

+ 10
- 1
src/pages/news/detail/index.js Просмотреть файл

@@ -12,6 +12,7 @@ import { getQrCodeParams } from '@utils/qrcode'
12 12
 import { getCardDetail } from '@services/card'
13 13
 import { ROLE_CODE } from '@constants/user'
14 14
 import Consultant from '@components/consultant'
15
+import authorizationComponent from '@components/authorizationComponent'
15 16
 import { reportClient } from '@services/report'
16 17
 import {
17 18
   addNewsUv,
@@ -310,7 +311,7 @@ export default class NewsDetail extends Component {
310 311
       console.info('生成资讯详情海报')
311 312
     })
312 313
   }
313
-  render() {
314
+  renderNews() {
314 315
     const { detail, loaded, isSaved, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
315 316
     const { userInfo: { person: { personId, nickname, name } } } = this.props
316 317
     return (
@@ -370,4 +371,12 @@ export default class NewsDetail extends Component {
370 371
       </Block>
371 372
     );
372 373
   }
374
+  
375
+  render(){
376
+  	return (
377
+  		<authorizationComponent>
378
+  			{this.renderNews()}
379
+  		</authorizationComponent>
380
+  	)
381
+  }
373 382
 }