junyuanz лет назад: 4
Родитель
Сommit
12b140e91e
4 измененных файлов с 58 добавлено и 30 удалено
  1. 1 1
      app.js
  2. 7 0
      pages/projects/project-detail/project-detail.js
  3. 1 1
      pages/start/start.js
  4. 49 28
      pages/user/all/all.js

+ 1 - 1
app.js

@@ -4,7 +4,7 @@ var utils = require('utils/util.js')
 App({
 App({
   onLaunch: function (res) {
   onLaunch: function (res) {
     console.log(res)
     console.log(res)
-    this.login()
+    // this.login()
   },
   },
   onShow: function () {
   onShow: function () {
     // this.check()
     // this.check()

+ 7 - 0
pages/projects/project-detail/project-detail.js

@@ -725,6 +725,13 @@ Page({
 	        icon: 'none',
 	        icon: 'none',
 	        duration: 2000
 	        duration: 2000
 	      })
 	      })
+		
+		setTimeout(function(){
+			wx.reLaunch({
+			  url: '/pages/user/all/all'
+			})
+		},1000)
+		
   	}
   	}
     
     
   },
   },

+ 1 - 1
pages/start/start.js

@@ -77,7 +77,7 @@ Page({
   },
   },
   getScene: function () {
   getScene: function () {
     var that = this
     var that = this
-    var url = 'v1/xcx/channel/info/' + scene
+    var url = 'v1/xcx/channel/info/' + scene 
     var params = {}
     var params = {}
     var success = function (res) {
     var success = function (res) {
       channel = res.data
       channel = res.data

+ 49 - 28
pages/user/all/all.js

@@ -88,7 +88,7 @@ Page({
 						wx.setStorageSync('lbt_session_time', Date.now())
 						wx.setStorageSync('lbt_session_time', Date.now())
 						wx.setStorageSync('lbt_token_key', res.data.token)
 						wx.setStorageSync('lbt_token_key', res.data.token)
 						console.log('nowtoken',res.data.token);
 						console.log('nowtoken',res.data.token);
-	  				  	if(res.data.wx_user){
+	  				  	if(res.data.wx_user && res.data.wx_user.full_head != ''){
 	  				  		var userInfo = res.data.wx_user;
 	  				  		var userInfo = res.data.wx_user;
 							
 							
 							that.setData({
 							that.setData({
@@ -100,8 +100,8 @@ Page({
 							  that.getmerchant()
 							  that.getmerchant()
 							}
 							}
 								//checkwxhead---start
 								//checkwxhead---start
-								console.log('that.data.checkhead',that.data.checkhead);
-	  						    if(res.data.wx_user.full_head == '' && that.data.checkhead){
+								// console.log('that.data.checkhead',that.data.checkhead);
+	  						    if(res.data.wx_user.full_head == '' ){
 									that.setData({
 									that.setData({
 										checkhead: false
 										checkhead: false
 									})
 									})
@@ -224,32 +224,49 @@ Page({
 	  console.log('tap')
 	  console.log('tap')
 	  var that = this
 	  var that = this
 
 
-	        wx.getUserProfile({
-	          desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
-	          success: (res) => {
-	        	this.setData({
-	        	  userInfo: res.userInfo,
-	        	  hasUserInfo: true
-	        	})
+	     //    wx.getUserProfile({
+	     //      desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+	     //      success: (res) => {
+	     //    	this.setData({
+	     //    	  userInfo: res.userInfo,
+	     //    	  hasUserInfo: true
+	     //    	})
 	        	
 	        	
-	        	var channel_id = 0;
-	        	invite = wx.getStorageSync('invite');
-	        	if (channel && Number(channel.parent_id) > 0) {
-	        	  channel_id = Number(channel.parent_id)
-	        	}
-	        	var that = this
-	        	console.log('res',res);
-	        	if (res.errMsg === "getUserProfile:ok") {
-	        	  wx.showLoading({
-	        	    title: '加载中'
-	        	  })
-				  res['wxlogincode'] = that.data.wxlogincode;
-	        	  _request.sendInfo(res, channel_id, invite, that)
+	     //    	var channel_id = 0;
+	     //    	invite = wx.getStorageSync('invite');
+	     //    	if (channel && Number(channel.parent_id) > 0) {
+	     //    	  channel_id = Number(channel.parent_id)
+	     //    	}
+	     //    	var that = this
+	     //    	console.log('res',res);
+	     //    	if (res.errMsg === "getUserProfile:ok") {
+	     //    	  wx.showLoading({
+	     //    	    title: '加载中'
+	     //    	  })
+				  // res['wxlogincode'] = that.data.wxlogincode;
+	     //    	  _request.sendInfo(res, channel_id, invite, that)
 	        	  
 	        	  
-	        	  that.onShow();
-	        	}
-	          }
-	        }) 
+	     //    	  that.onShow();
+	     //    	}
+	     //      }
+	     //    }) 
+			
+			
+			wx.getUserProfile({
+			  desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+			  success: function(res3) {
+			    console.log('userinfo',res3)
+			    var url = 'xcx/save_wx_user/info'
+				  var params = {
+					userinfo: JSON.stringify(res3.userInfo)
+				  }
+				  var success = function (res4) {
+						console.log('authorize',res4)
+						that.onShow()
+				  }
+				  _request.$post(url, params, success)
+				}
+			})
   },
   },
   getVersion: function (val) {
   getVersion: function (val) {
     // this.check()
     // this.check()
@@ -268,7 +285,11 @@ Page({
       })
       })
 	  console.log('untel',res.data.user.tel)
 	  console.log('untel',res.data.user.tel)
 	  
 	  
-	  
+	  if(res.data.wx_user.full_head == ''){
+		  that.setData({
+		  	    userInfo: 'nologin'
+		  	  })
+	  }
 	  if(that.data.userInfo != 'nologin' && res.data.user.tel == '' && that.data.bindTelfirst == 0){
 	  if(that.data.userInfo != 'nologin' && res.data.user.tel == '' && that.data.bindTelfirst == 0){
 		  that.setData({
 		  that.setData({
 		    bindTelfirst:1
 		    bindTelfirst:1