فهرست منبع

免切换优化

zhengkaixin 1 سال پیش
والد
کامیت
4cdcf330c2
3فایلهای تغییر یافته به همراه78 افزوده شده و 15 حذف شده
  1. 23 2
      pages/managementList/applicantsList.vue
  2. 12 10
      pages/managementList/applyAuthorisation.vue
  3. 43 3
      pages/managementList/managementList.vue

+ 23 - 2
pages/managementList/applicantsList.vue

@@ -3,6 +3,7 @@
 		<u-navbar title="申请人列表" title-color="#101010">
 			
 		</u-navbar>
+		
 		<view class="search-box">
 			<u-search  @custom="getApprovalList(true)"
 			 
@@ -15,8 +16,8 @@
 		
 		<!-- 列表 -->
 		<view class="member-list">
-			<view class="item-info"  v-for="(item,i) in list" >
-				<view class="item" >
+			<view class="item-info"  v-for="(item,i) in list" @click="infoBtn(item)" >
+				<view class="item"  >
 					<view class="infos">
 						<view class="name">
 							{{item.createByName}}
@@ -63,6 +64,7 @@
 				<view class="popup2" >
 					<view class="title">
 						{{userName}}-权限管理
+						<view class="title2">返回上一页面可继续分配权限</view>
 					</view>
 					<scroll-view scroll-y="true" style="height: 600rpx;" >
 						
@@ -140,6 +142,19 @@
 		},
 		
 		methods: {
+			
+			infoBtn(item){
+				if(0){
+					//测试用
+					this.getAuthorizedUserDetails(item.createBy)
+				}
+				if(item.status==1){
+					uni.showToast({
+						title: "返回上一页面可分配权限",
+						icon: "none"
+					})
+				}
+			},
 			vmodelremark(item){
 				var remark=(item.informationTitle?'申请授权:'+item.informationTitle:'')+
 				
@@ -422,6 +437,12 @@
   		  font-weight: bold;
   		  text-align: center;
   	  }
+	  .title2{
+	    		  color: red;
+	    		  font-size: 32rpx;
+	    		  font-weight: 400;
+	    		  text-align: center;
+	  }
   	  .content{
   		  width: 100%;
   		  margin-bottom: 24rpx;

+ 12 - 10
pages/managementList/applyAuthorisation.vue

@@ -185,16 +185,18 @@
 					openId: this.carhelp.getOpenId(),
 					
 				}).then((response) => {
+					if(response.result){
+						this.step3=true
+						
+						var token = response ? response.data.token : '';
+						this.carhelp.setToken(token);
+						this.carhelp.setPersonInfo(response.data.regUser);
+						this.carhelp.setPersonInfoPlus(response.data)
+						this.regUser=response.data.regUser
+						this.name=this.regUser.name
+						this.phone=this.regUser.phone
+					}
 					
-					this.step3=true
-					
-					var token = response ? response.data.token : '';
-					this.carhelp.setToken(token);
-					this.carhelp.setPersonInfo(response.data.regUser);
-					this.carhelp.setPersonInfoPlus(response.data)
-					this.regUser=response.data.regUser
-					this.name=this.regUser.name
-					this.phone=this.regUser.phone
 				}).catch(error => {
 					
 					uni.hideLoading();
@@ -262,7 +264,7 @@
 					uni.hideLoading();
 					//this.show=true
 					var info=res.data.applicationInfo;
-					if(info&&info.status==1||allCheck){
+					if(allCheck){
 						this.step=true
 						this.meterList=res.data.meterList
 						var  img=require('@/assets/img/controlCover.png')

+ 43 - 3
pages/managementList/managementList.vue

@@ -158,6 +158,7 @@
 
 <script>
 	import * as API from '@/apis/pagejs/managementList.js'
+	import * as API_user from '@/apis/pagejs/user.js'
 	
 	export default {
 		data() {
@@ -198,6 +199,43 @@
 			}
 		},
 		methods: {
+			loginset(response){
+				
+				var token = response ? response.data.token : '';
+				this.carhelp.setToken(token);
+				this.carhelp.setPersonInfo(response.data.regUser);
+				this.carhelp.setPersonInfoPlus(response.data)
+				
+				//this.gotoUrl("pages/user/index")
+				this.getApprovalList()
+			},
+			query(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API_user.findByOpenId({
+					noerror:true,
+					openId: this.carhelp.getOpenId(),
+					
+				}).then((response) => {
+					uni.hideLoading();
+					
+					if(response.message){
+						
+					}else{
+						this.loginset(response)
+					}
+					
+					
+				
+				}).catch(error => {
+					
+					uni.hideLoading();
+					
+				})
+			},
 			deletePopupQuery() {
 				if (this.deleteIds != '') {
 					this.deletePopup = true
@@ -325,10 +363,12 @@
 					uni.hideLoading();
 						this.list = [
 							...this.list,
-							...res.data.data
+							...res.data.authorizedUserList.data
 						];
-						this.recordsTotal = res.data.recordsTotal;
-					
+						this.recordsTotal = res.data.authorizedUserList.recordsTotal;
+					if(res.data.switchUser){
+						this.query()
+					}
 					
 				}).catch(error => {
 					uni.showToast({