Pārlūkot izejas kodu

账号登陆检测调整

junyuanz 5 gadi atpakaļ
vecāks
revīzija
0164c24763
3 mainītis faili ar 72 papildinājumiem un 67 dzēšanām
  1. 2 2
      pages/livelist/livelist.wxml
  2. 10 7
      pages/livelist/livelist.wxss
  3. 60 58
      pages/user/all/all.js

+ 2 - 2
pages/livelist/livelist.wxml

@@ -4,8 +4,8 @@
       <view class="livelist" wx:key="{{index}}" wx:for="{{projects}}"  data-val="{{item.room_id}}" bindtap="toLiveRoom">
 		  
 	   <image class="project-right" src="{{item.cover}}"></image>
-	   <view class="title">{{item.title}} <span>房间号{{item.room_id}}</span></view>
-	   <view class="startt">开播时间:</view>
+	   <view class="title">{{item.title}}</view>
+	   <view class="startt">开播时间:<span>房间号{{item.room_id}}</span></view>
 	   <view class="startt">{{item.month}}月{{item.date}}日 {{item.begin_hour}} - {{item.end_hour}}</view>
 	   <view class="status">{{item.state}}</view>
         <view class="clean"></view>

+ 10 - 7
pages/livelist/livelist.wxss

@@ -13,15 +13,16 @@
 	    max-height: 100%;
 	    width: 100%;
 	    height: 280rpx;
-		margin-bottom: 15rpx;
 }
 .livelist .title{
-	font-size: 35rpx;
+font-size: 32rpx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
 }
-.livelist .title span{
+.livelist .startt span{
 	    font-size: 20rpx;
 	    float: right;
-	    line-height: 46rpx;
 	    color: #eab86a;
 }
 .livelist .startt{
@@ -30,7 +31,9 @@
 	white-space: nowrap;
 }
 .livelist .status{
-	    position: absolute;
-	    top: 5px;
-	    color: #f00;
+    position: absolute;
+    top: 10px;
+    color: #f00;
+    right: 10px;
+    font-size: 30rpx;
 }

+ 60 - 58
pages/user/all/all.js

@@ -40,6 +40,7 @@ Page({
 //    invite = options.invite
 //  }
 //  var that = this
+	this.checkLogin();
   },
   onShow: function () {
     var that = this;
@@ -61,64 +62,65 @@ Page({
     
     
     //原登陆检测
-    
-  //2020登陆检测
-	    wx.login({
-		    success: res => {
-		      getApp().globalData.try_login = true;
-		      
-		      var url = 'xcx/login'
-				  var params = {
-				    code: res.code
-				  }
-				  var success = function (res) {
-				  	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 == ''){
-						    	wx.getSetting({
-						      success: res => {
-						        var auth = res.authSetting
-						        	if (auth['scope.userInfo']) {
-						        		console.log('wxhead none')
-									    	wx.getUserInfo({
-												  success: function(res3) {
-												    console.log('userinfo',res3)
-												    var url = 'xcx/save_wx_user/info'
-													  var params = {
-													    userinfo: JSON.stringify(res3)
-													  }
-													  var success = function (res4) {
-													  	console.log('authorize',res4)
-													  	that.onShow()
-													  }
-													  _request.$post(url, params, success)
-												  }
-												})
-											}else{
-								      	that.setData({
-											    userInfo: 'nologin'
-											  })
-							        }
-							      }
-							    })
-						    }
-						  //checkwxhead---end
-				  	}else{
-				  		that.setData({
-						    userInfo: 'nologin'
-						  })
-				  	}
-				  }
-				  _request.$get(url, params, success)
-		      
-		    }
-		  })
-        
+  },
+  checkLogin:function(){
+	  var that = this;
+	  //2020登陆检测
+	  	    wx.login({
+	  		    success: res => {
+	  		      getApp().globalData.try_login = true;
+	  		      
+	  		      var url = 'xcx/login'
+	  				  var params = {
+	  				    code: res.code
+	  				  }
+	  				  var success = function (res) {
+	  				  	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 == ''){
+	  						    	wx.getSetting({
+	  						      success: res => {
+	  						        var auth = res.authSetting
+	  						        	if (auth['scope.userInfo']) {
+	  						        		console.log('wxhead none')
+	  									    	wx.getUserInfo({
+	  												  success: function(res3) {
+	  												    console.log('userinfo',res3)
+	  												    var url = 'xcx/save_wx_user/info'
+	  													  var params = {
+	  													    userinfo: JSON.stringify(res3)
+	  													  }
+	  													  var success = function (res4) {
+	  													  	console.log('authorize',res4)
+	  													  	that.onShow()
+	  													  }
+	  													  _request.$post(url, params, success)
+	  												  }
+	  												})
+	  											}else{
+	  								      	that.setData({
+	  											    userInfo: 'nologin'
+	  											  })
+	  							        }
+	  							      }
+	  							    })
+	  						    }
+	  						  //checkwxhead---end
+	  				  	}else{
+	  				  		that.setData({
+	  						    userInfo: 'nologin'
+	  						  })
+	  				  	}
+	  				  }
+	  				  _request.$get(url, params, success)
+	  		      
+	  		    }
+	  		  })
   },
   getPoster: function (val) {
     poster = val.split('$')