Parcourir la source

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

张延森 il y a 5 ans
Parent
révision
1f8fbb0aef
2 fichiers modifiés avec 21 ajouts et 8 suppressions
  1. 9
    5
      src/pages/agent/recommend/index.js
  2. 12
    3
      src/pages/project/h5Page.js

+ 9
- 5
src/pages/agent/recommend/index.js Voir le fichier

@@ -69,12 +69,16 @@ export default class Index extends Component {
69 69
       reType: type || "",
70 70
 
71 71
     }, () => {
72
-      console.log(this.state.sex, "sex")
73
-      console.log('buildingName' + this.props.proList.records[0].buildingName)
72
+      console.log(this.props.projectDetail.buildingName, "this.props.projectDetail.buildingName")
73
+
74
+      if (this.props.proLis) {
75
+        console.log('buildingName' + this.props.proList.records[0].buildingName)
76
+      }
77
+
74 78
       if (this.state.reType == 'projectDeatil') {
75 79
         this.setState({
76
-          intention: this.props.projectDetail.buildingName ? this.props.projectDetail.buildingName : this.props.proList.records[0].buildingName,
77
-          floor: this.props.projectDetail.buildingId ? this.props.projectDetail.buildingId : this.props.proList.records[0].buildingId
80
+          intention: this.props.projectDetail.buildingName || this.props.proList.records[0].buildingName,
81
+          floor: this.props.projectDetail.buildingId || this.props.proList.records[0].buildingId
78 82
         }, () => {
79 83
           if (this.state.floorID != 0 || this.state.intention) {
80 84
             this.loadCardList()
@@ -217,7 +221,7 @@ export default class Index extends Component {
217 221
     })
218 222
   }
219 223
   Alert(content, title) {
220
-    title = title ? title : "温馨提示";
224
+    title = title || "温馨提示";
221 225
     content = content.toString();
222 226
     Taro.showModal({
223 227
       title: title,

+ 12
- 3
src/pages/project/h5Page.js Voir le fichier

@@ -267,10 +267,12 @@ export default class Index extends Component {
267 267
 
268 268
   // 授权用户信息
269 269
   getUserInfo() {
270
+    console.log('好哈哈')
270 271
     const { dispatchUpdateUserInfo } = this.props
271 272
     const sessionKey = Taro.getStorageSync('sessionKey')
272 273
 
273 274
     Taro.showLoading()
275
+
274 276
     Taro.getUserInfo({
275 277
       lang: 'zh_CN',
276 278
       success: res => {
@@ -286,7 +288,9 @@ export default class Index extends Component {
286 288
       fail: (err) => {
287 289
         Taro.hideLoading()
288 290
         console.error(err)
289
-
291
+        this.setState({
292
+          avatarVisible: true,
293
+        })
290 294
         Taro.showToast({
291 295
           title: '获取用户信息失败',
292 296
           icon: 'none'
@@ -295,7 +299,12 @@ export default class Index extends Component {
295 299
       }
296 300
     })
297 301
   }
298
-
302
+  userInfoClick() {
303
+    console.log('userInfoClick')
304
+    this.setState({
305
+      avatarVisible: false,
306
+    })
307
+  }
299 308
   // 授权手机号
300 309
   getPhoneNumber(e) {
301 310
     getUserPhone(e, (phoneNumber) => {
@@ -350,7 +359,7 @@ export default class Index extends Component {
350 359
               <View className="title">授权头像,围观活动</View>
351 360
               <View className="touxiang"><open-data type="userAvatarUrl"></open-data></View>
352 361
               <View className="name"><open-data type="userNickName"></open-data></View>
353
-              <Button className="btn" open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>好</Button>
362
+              <Button className="btn" open-type="getUserInfo" lang="zh_CN" onClick={this.userInfoClick} onGetUserInfo={this.getUserInfo}>好</Button>
354 363
             </View>
355 364
           }
356 365
           {phoneVisible && h5Id &&