瀏覽代碼

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

张延森 5 年之前
父節點
當前提交
1f8fbb0aef
共有 2 個檔案被更改,包括 21 行新增8 行删除
  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 查看文件

69
       reType: type || "",
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
       if (this.state.reType == 'projectDeatil') {
78
       if (this.state.reType == 'projectDeatil') {
75
         this.setState({
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
           if (this.state.floorID != 0 || this.state.intention) {
83
           if (this.state.floorID != 0 || this.state.intention) {
80
             this.loadCardList()
84
             this.loadCardList()
217
     })
221
     })
218
   }
222
   }
219
   Alert(content, title) {
223
   Alert(content, title) {
220
-    title = title ? title : "温馨提示";
224
+    title = title || "温馨提示";
221
     content = content.toString();
225
     content = content.toString();
222
     Taro.showModal({
226
     Taro.showModal({
223
       title: title,
227
       title: title,

+ 12
- 3
src/pages/project/h5Page.js 查看文件

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