Ver código fonte

头像获取调整

junyuanz 5 anos atrás
pai
commit
6c86636321
1 arquivos alterados com 15 adições e 10 exclusões
  1. 15 10
      pages/user/all/all.js

+ 15 - 10
pages/user/all/all.js

@@ -17,7 +17,8 @@ Page({
     checkData: {},
     merchant: {},
     info: {},
-    show: 0
+    show: 0,
+	checkhead:true
   },
   onLoad: function () {
 ////	console.log(options)
@@ -56,9 +57,9 @@ Page({
       // this.info()
     }
     
+	that.checkLogin();
     
-    
-    
+
     
     
     //原登陆检测
@@ -78,11 +79,15 @@ Page({
 	  				  	console.log('pageLogin',res);
 	  				  	if(res.data.wx_user){
 	  				  		var userInfo = res.data.wx_user
-	  		          that.setData({
-	  		            userInfo: userInfo
-	  		          })
-	  		          //checkwxhead---start
-	  						    if(res.data.wx_user.full_head == ''){
+							that.setData({
+								userInfo: userInfo
+							})
+								//checkwxhead---start
+								console.log('that.data.checkhead',that.data.checkhead);
+	  						    if(res.data.wx_user.full_head == '' && that.data.checkhead){
+									that.setData({
+										checkhead: false
+									})
 	  						    	wx.getSetting({
 	  						      success: res => {
 	  						        var auth = res.authSetting
@@ -96,8 +101,8 @@ Page({
 	  													    userinfo: JSON.stringify(res3)
 	  													  }
 	  													  var success = function (res4) {
-	  													  	console.log('authorize',res4)
-	  													  	that.onShow()
+																console.log('authorize',res4)
+																that.onShow()
 	  													  }
 	  													  _request.$post(url, params, success)
 	  												  }