Browse Source

优化用户体验。

soft5566 3 years ago
parent
commit
e9a827f20f
2 changed files with 435 additions and 405 deletions
  1. 387 383
      pages/index/index.vue
  2. 48 22
      pagesElectric/select/select.vue

+ 387 - 383
pages/index/index.vue

@@ -1,6 +1,8 @@
 <template>
 <template>
 	<view class="container">
 	<view class="container">
-		<view class="banner"><image src="../../static/images/banner2x.png" mode=""></image></view>
+		<view class="banner">
+			<image src="../../static/images/banner2x.png" mode=""></image>
+		</view>
 		<view class="nav">
 		<view class="nav">
 			<view class="menu">
 			<view class="menu">
 				<navigator :url="'/pages/reshui/reshui'" open-type="navigate" class="menu_item">
 				<navigator :url="'/pages/reshui/reshui'" open-type="navigate" class="menu_item">
@@ -30,15 +32,8 @@
 			</view>
 			</view>
 		</view>
 		</view>
 		<view v-if="showLogin">
 		<view v-if="showLogin">
-			<login
-				:ocode="ocode"
-				:appkey="appkey"
-				scope="snsapi_userinfo"
-				:visible="visible"
-				@success="login_success_callback"
-				@cancel="login_cancel_callback"
-				@fail="login_fail_callback"
-			/>
+			<login :ocode="ocode" :appkey="appkey" scope="snsapi_userinfo" :visible="visible" @success="login_success_callback" @cancel="login_cancel_callback"
+				@fail="login_fail_callback" />
 		</view>
 		</view>
 		<Popup :showPopup="showPopup" @close="showPopup = false">
 		<Popup :showPopup="showPopup" @close="showPopup = false">
 			<view class="pupup-content">
 			<view class="pupup-content">
@@ -50,423 +45,432 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import Popup from '@/components/Popup.vue';
-export default {
-	components: {
-	    Popup
-	},
-	data() {
-		return {
-			ceshi: 'code',
-			huanjing: '部署环境', // 部署环境是key,用来获取环境
-			visible: false, // 是否授权可见
-			showLogin: true, // 是否启动授权
-			appkey: '3183DC96A6DABA8D', // 商户appkey
-			appid: 'wxd6f090391d410534', // 获取用户信息
-			ocode: '1015730314', // 获取用户信息
-			app_secret: '05742955578EC5BD29B7BC4CAC5AFACA', // 获取用户信息
-			userinfo: '', // 用户信息
-			showQR_code: false, // 显示校园卡二维码
-			validation_failed: false, // 验证失败
-			validation_times: 0, // 授权次数
-			from: 0, // 跳转参数
-			execed_onload: false,
-			showPopup: false
-		}
-	},
-	onLoad(options) {
-		// console.log(options)
-		// 测试环境
-		if (typeof options.from != 'undefined') {
-			this.from = options.from
-		}
-		// 是否是测试环境,查询数据接口中参数的值决定,方便以后测试
-		this.isTestEnvironment()
-		// 检查是否存在用户信息
-		this.has_user_info()
-
-		this.execed_onload = true
-	},
-	onShow() {
-		if (!this.execed_onload) {
-			// 检查是否存在用户信息
-			this.has_user_info()
-		}
-	},
-	methods: {
-		/**
-		 * 控制环境,test为true测试环境,false则是正式环境
-		 */
-		async isTestEnvironment() {
-			const res = await this.$myRequest({
-				host: this.ceshi,
-				url: '/HotWaters/conEnvi.action',
-				method: 'POST',
-				header: {
-					'content-type': 'application/x-www-form-urlencoded'
-				},
-				data: {
-					name: this.huanjing
-				}
-			})
-
-			// console.log(res);
-			if (res.data.mess == '返回成功') {
-				// value为0 测试环境, 为1 部署环境;amount限制启动金额
-				this.$store.state.amount = res.data.data[0].amount
-				if (res.data.data[0].value == 0) {
-					// 测试模式
-					this.$store.state.test = true
-				} else if (res.data.data[0].value == 2) {
-					// 系统正在维护...
-					this.$store.state.test = 'weihuzhong'
-
-					uni.showModal({
-						title: '提示信息',
-						content: '系统维护中...\r\n暂时请不要使用!\r\n避免造成不必要的损失!',
-						showCancel: false
-					})
-				} else {
-					// 正式模式
-					this.$store.state.test = false
-				}
-			} else {
-				uni.showToast({
-					title: res.data.mess,
-					icon: 'success'
-				})
+	import Popup from '@/components/Popup.vue';
+	export default {
+		components: {
+			Popup
+		},
+		data() {
+			return {
+				ceshi: 'code',
+				huanjing: '部署环境', // 部署环境是key,用来获取环境
+				visible: false, // 是否授权可见
+				showLogin: true, // 是否启动授权
+				appkey: '3183DC96A6DABA8D', // 商户appkey
+				appid: 'wxd6f090391d410534', // 获取用户信息
+				ocode: '1015730314', // 获取用户信息
+				app_secret: '05742955578EC5BD29B7BC4CAC5AFACA', // 获取用户信息
+				userinfo: '', // 用户信息
+				showQR_code: false, // 显示校园卡二维码
+				validation_failed: false, // 验证失败
+				validation_times: 0, // 授权次数
+				from: 0, // 跳转参数
+				execed_onload: false,
+				showPopup: false
 			}
 			}
 		},
 		},
-		/**
-		 * 是否有用户信息
-		 */
-		has_user_info() {
-			try {
-				// console.log(111111);
-				const value = uni.getStorageSync('userinfo_storage_key')
-				// console.log(value);
-				if (value == '') {
-					this.showLogin = true
-					this.visible = true
-				} else {
-					this.showLogin = false
-					this.userinfo = value
-					this.$store.state.userInfo = this.userinfo
-				}
-			} catch (e) {
-				// console.log(e)
-				uni.showToast({
-					title: '异常:' + e,
-					duration: 3000
-				})
+		onLoad(options) {
+			// console.log(options)
+			// 测试环境
+			if (typeof options.from != 'undefined') {
+				this.from = options.from;
 			}
 			}
+			// 是否是测试环境,查询数据接口中参数的值决定,方便以后测试
+			this.isTestEnvironment();
+			// 检查是否存在用户信息
+			this.has_user_info();
+
+			this.execed_onload = true;
 		},
 		},
-		/**
-		 * 授权登陆取消回调
-		 */
-		login_cancel_callback() {
-			this.reauthorization()
+		onShow() {
+			if (!this.execed_onload) {
+				// 检查是否存在用户信息
+				this.has_user_info();
+			}
 		},
 		},
-		/**
-		 * 重新授权
-		 */
-		reauthorization() {
-			this.validation_times = this.validation_times + 1
+		methods: {
+			/**
+			 * 控制环境,test为true测试环境,false则是正式环境
+			 */
+			async isTestEnvironment() {
+				const res = await this.$myRequest({
+					host: this.ceshi,
+					url: '/HotWaters/conEnvi.action',
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						name: this.huanjing
+					}
+				});
 
 
-			if (this.validation_times >= 2) {
-				this.login_fail_callback()
-			} else {
-				try {
-					// uni.removeStorageSync('userinfo_storage_key')
-					setTimeout(() => {
-						this.showLogin = false
-						this.userinfo = {}
-					}, 30)
+				// console.log(res);
+				if (res.data.mess == '返回成功') {
+					// value为0 测试环境, 为1 部署环境;amount限制启动金额
+					this.$store.state.amount = res.data.data[0].amount;
+					if (res.data.data[0].value == 0) {
+						// 测试模式
+						this.$store.state.test = true;
+					} else if (res.data.data[0].value == 2) {
+						// 系统正在维护...
+						this.$store.state.test = 'weihuzhong';
 
 
-					setTimeout(() => {
-						this.showLogin = true
-						this.visible = true
-					}, 30)
+						uni.showModal({
+							title: '提示信息',
+							content: '系统维护中...\r\n暂时请不要使用!\r\n避免造成不必要的损失!',
+							showCancel: false
+						});
+					} else {
+						// 正式模式
+						this.$store.state.test = false;
+					}
+				} else {
+					uni.showToast({
+						title: res.data.mess,
+						icon: 'success'
+					});
+				}
+			},
+			/**
+			 * 是否有用户信息
+			 */
+			has_user_info() {
+				try {
+					// console.log(111111);
+					const value = uni.getStorageSync('userinfo_storage_key');
+					// console.log(value);
+					if (value == '') {
+						this.showLogin = true;
+						this.visible = true;
+					} else {
+						this.showLogin = false;
+						this.userinfo = value;
+						this.$store.state.userInfo = this.userinfo;
+					}
 				} catch (e) {
 				} catch (e) {
-					console.log(e)
+					// console.log(e)
+					uni.showToast({
+						title: '异常:' + e,
+						duration: 3000
+					});
 				}
 				}
-			}
-		},
-		/**
-		 * 授权登陆取消回调
-		 */
-		login_fail_callback() {
-			var _this = this;
-			_this.userinfo = {}
-			if (!_this.validation_failed) {
-				_this.validation_failed = false
-				uni.showModal({
-					title: '提示',
-					content: '授权:请先领取校园卡、并激活!',
-					// cancelText: '取消',
-					confirmText: '领取',
-					success: res1 => {
-						if (res1.confirm) {
-							// 截屏,用户利用微信识别二维码添加校园卡、激活
-							_this.showPopup = true;
-						} else if (res1.cancel) {
-							// console.log('用户点击取消');
-							// uni.showToast({
-							// 	icon: 'none',
-							// 	title: '10秒后自动隐藏二维码,可重新授权调起!',
-							// 	duration: 1000,
-							// 	success: (com) => {
-							// 		this.showQR_code = true
-							// 		setTimeout(() => {
-							// 			this.showQR_code = false
-							// 		}, 10000)
-							// 	}
-							// });
-						}
+			},
+			/**
+			 * 授权登陆取消回调
+			 */
+			login_cancel_callback() {
+				this.reauthorization();
+			},
+			/**
+			 * 重新授权
+			 */
+			reauthorization() {
+				this.validation_times = this.validation_times + 1;
+
+				if (this.validation_times >= 2) {
+					this.login_fail_callback();
+				} else {
+					try {
+						// uni.removeStorageSync('userinfo_storage_key')
+						setTimeout(() => {
+							this.showLogin = false
+							this.userinfo = {}
+						}, 30);
+
+						setTimeout(() => {
+							this.showLogin = true
+							this.visible = true
+						}, 30);
+					} catch (e) {
+						console.log(e);
 					}
 					}
-				})
-			}
-		},
-		/**
-		 * 授权登陆成功回调
-		 */
-		login_success_callback: function({ detail }) {
-			const { wxcode = '' } = detail
+				}
+			},
+			/**
+			 * 授权登陆取消回调
+			 */
+			login_fail_callback() {
+				var _this = this;
+				_this.userinfo = {};
+				if (!_this.validation_failed) {
+					_this.validation_failed = false;
+					uni.showModal({
+						title: '提示',
+						content: '授权:请先领取校园卡、并激活!',
+						// cancelText: '取消',
+						confirmText: '领取',
+						success: res1 => {
+							if (res1.confirm) {
+								// 截屏,用户利用微信识别二维码添加校园卡、激活
+								_this.showPopup = true;
+							} else if (res1.cancel) {
+								// console.log('用户点击取消');
+								// uni.showToast({
+								// 	icon: 'none',
+								// 	title: '10秒后自动隐藏二维码,可重新授权调起!',
+								// 	duration: 1000,
+								// 	success: (com) => {
+								// 		this.showQR_code = true
+								// 		setTimeout(() => {
+								// 			this.showQR_code = false
+								// 		}, 10000)
+								// 	}
+								// });
+							}
+						}
+					});
+				}
+			},
+			/**
+			 * 授权登陆成功回调
+			 */
+			login_success_callback: function({
+				detail
+			}) {
+				const {
+					wxcode = ''
+				} = detail;
 
 
-			this.validation_failed = false
+				this.validation_failed = false;
 
 
-			// 屏蔽用户操作
-			uni.showLoading({
-				title: '获取数据中…',
-				mask: true
-			})
+				// 屏蔽用户操作
+				uni.showLoading({
+					title: '获取数据中…',
+					mask: true
+				});
 
 
-			setTimeout(() => {
-				uni.hideLoading()
-			}, 1000)
-			
-			// 通过wxcode换取access_token
-			this.get_access_token(wxcode)
-		},
-		/**
-		 * 通过wxcode换取access_token
-		 */
-		async get_access_token(param_wxcode) {
-			const res = await this.$myRequest({
-				host: 'wecard',
-				url: '/connect/oauth2/token',
-				method: 'POST',
-				header: {
-					'content-type': 'application/json'
-				},
-				data: {
-					wxcode: param_wxcode,
-					app_key: this.appkey,
-					app_secret: this.app_secret,
-					grant_type: 'authorization_code',
-					redirect_uri: 'mnp://' + this.appid
-				}
-			})
+				// 通过wxcode换取access_token
+				this.get_access_token(wxcode);
+			},
+			/**
+			 * 通过wxcode换取access_token
+			 */
+			async get_access_token(param_wxcode) {
+				const res = await this.$myRequest({
+					host: 'wecard',
+					url: '/connect/oauth2/token',
+					method: 'POST',
+					header: {
+						'content-type': 'application/json'
+					},
+					data: {
+						wxcode: param_wxcode,
+						app_key: this.appkey,
+						app_secret: this.app_secret,
+						grant_type: 'authorization_code',
+						redirect_uri: 'mnp://' + this.appid
+					}
+				});
 
 
-			if (res.data.refresh_token == '' || typeof res.data.refresh_token == 'undefined') {
-				uni.showToast({
-					title: '未获得token'
-				})
-			} else {
-				// 通过access_token换取用户信息
-				this.get_user_info(res.data.access_token)
-			}
-		},
-		/**
-		 * 通过access_token换取用户信息
-		 */
-		async get_user_info(param_access_token) {
-			const res = await this.$myRequest({
-				host: 'wecard',
-				url: '/connect/oauth/get-user-info',
-				method: 'POST',
-				header: {
-					'content-type': 'application/json'
-				},
-				data: {
-					access_token: param_access_token
+				if (res.data.refresh_token == '' || typeof res.data.refresh_token == 'undefined') {
+					uni.hideLoading();
+					uni.showToast({
+						title: '未获得token'
+					});
+				} else {
+					// 通过access_token换取用户信息
+					this.get_user_info(res.data.access_token);
 				}
 				}
-			});
+			},
+			/**
+			 * 通过access_token换取用户信息
+			 */
+			async get_user_info(param_access_token) {
+				const res = await this.$myRequest({
+					host: 'wecard',
+					url: '/connect/oauth/get-user-info',
+					method: 'POST',
+					header: {
+						'content-type': 'application/json'
+					},
+					data: {
+						access_token: param_access_token
+					}
+				});
 
 
-			// console.log(res);
-			if (res.data.errcode == 0 && res.data.errmsg == 'OK') {
-				try {
-					this.userinfo = res.data
-					this.$store.state.userInfo = res.data
-					
-					// 获取code,然后去检查是否存在数据库中
-					this.getCode()
-				} catch (e) {
-					console.log(e)
-				}
-			} else {
-				uni.showToast({
-					title: '未获得用户信息,请领取校园卡并激活',
-					duration: 3000
-				})
-			}
-		},
-		/**
-		 * 获得code
-		 */
-		getCode() {
-			var _this = this;
-			uni.login({
-				success: res => {
-					// console.log('reshui', res);
-					if (res.code) {
-						// 检查用户是否存在第三方库
-						_this.chk_user_is_in_db(res.code)
-					} else {
-						uni.showToast({
-							title: res.errMsg,
-							icon: 'none'
-						})
+				// console.log(res);
+				if (res.data.errcode == 0 && res.data.errmsg == 'OK') {
+					try {
+						this.userinfo = res.data;
+						this.$store.state.userInfo = res.data;
+
+						// 获取code,然后去检查是否存在数据库中
+						this.getCode();
+					} catch (e) {
+						uni.hideLoading();
+						console.log(e);
 					}
 					}
+				} else {
+					uni.hideLoading();
+					uni.showToast({
+						title: '未获得用户信息,请领取校园卡并激活',
+						duration: 3000
+					});
 				}
 				}
-			})
-		},
-		/**
-		 * 检查数据库中是否有该用户信息
-		 */
-		async chk_user_is_in_db(param_code) {
-			var _this = this;
-			const res = await _this.$myRequest({
-				// host: 'local',
-				host: _this.ceshi,
-				url: '/HotWaters/wpopenid.action',
-				method: 'POST',
-				header: {
-					'content-type': 'application/x-www-form-urlencoded'
-				},
-				data: {
-					userinfo: JSON.stringify(_this.userinfo),
-					code: param_code
-				}
-			})
-
-			// console.log(res);
-			if (res.data.code == 0 || res.data.code == 100) {
-				// 存储用户信息
-				uni.setStorageSync('userinfo_storage_key', _this.userinfo)
-				// 提示授权成功
-				uni.showToast({
-					icon: 'success',
-					title: '授权成功',
-					duration: 800,
+			},
+			/**
+			 * 获得code
+			 */
+			getCode() {
+				var _this = this;
+				uni.login({
 					success: res => {
 					success: res => {
-						if (_this.from != 0 || _this.from != '0') {
-							uni.navigateBack({
-								delta: 1
-							})
+						// console.log('reshui', res);
+						if (res.code) {
+							// 检查用户是否存在第三方库
+							_this.chk_user_is_in_db(res.code);
+						} else {
+							uni.hideLoading();
+							uni.showToast({
+								title: res.errMsg,
+								icon: 'none'
+							});
 						}
 						}
+					},
+					fail() {
+						uni.hideLoading();
+					}
+				});
+			},
+			/**
+			 * 检查数据库中是否有该用户信息
+			 */
+			async chk_user_is_in_db(param_code) {
+				var _this = this;
+				const res = await _this.$myRequest({
+					// host: 'local',
+					host: _this.ceshi,
+					url: '/HotWaters/wpopenid.action',
+					method: 'POST',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {
+						userinfo: JSON.stringify(_this.userinfo),
+						code: param_code
 					}
 					}
-				})
-			} else {
-				uni.showToast({
-					icon: 'none',
-					title: '授权失败:' + res.data.msg,
-					success: res => {}
-				})
+				});
+
+				// console.log(res);
+				if (res.data.code == 0 || res.data.code == 100) {
+					// 存储用户信息
+					uni.setStorageSync('userinfo_storage_key', _this.userinfo);
+					uni.hideLoading();
+					// 提示授权成功
+					uni.showToast({
+						icon: 'success',
+						title: '授权成功',
+						duration: 800,
+						success: res => {
+							if (_this.from != 0 || _this.from != '0') {
+								uni.navigateBack({
+									delta: 1
+								});
+							}
+						}
+					});
+				} else {
+					uni.hideLoading();
+					uni.showToast({
+						icon: 'none',
+						title: '授权失败:' + res.data.msg,
+						success: res => {}
+					});
+				}
 			}
 			}
 		}
 		}
 	}
 	}
-}
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-.container {
-	display: flex;
-	flex-direction: column;
-	width: 750rpx;
-	font-family: Microsoft YaHei-3970(82674968);
-	color: #333333;
-
-	.banner {
-		width: 100%;
-		height: 360rpx;
+	.container {
+		display: flex;
+		flex-direction: column;
+		width: 750rpx;
+		font-family: Microsoft YaHei-3970(82674968);
+		color: #333333;
 
 
-		image {
+		.banner {
 			width: 100%;
 			width: 100%;
-			height: 100%;
+			height: 360rpx;
+
+			image {
+				width: 100%;
+				height: 100%;
+			}
 		}
 		}
-	}
 
 
-	.nav {
-		position: relative;
-		width: 100%;
+		.nav {
+			position: relative;
+			width: 100%;
 
 
-		.menu,
-		.reset {
-			margin: 25rpx auto;
-			width: 640rpx;
-		}
+			.menu,
+			.reset {
+				margin: 25rpx auto;
+				width: 640rpx;
+			}
 
 
-		.menu_item {
-			display: inline-flex;
-			flex-direction: column;
-			text-align: center;
-			width: 25%;
-			padding: 30rpx 0 39rpx;
-			border-radius: 20rpx;
-			font-family: Microsoft YaHei-3970(82674968);
-			color: #333333;
+			.menu_item {
+				display: inline-flex;
+				flex-direction: column;
+				text-align: center;
+				width: 25%;
+				padding: 30rpx 0 39rpx;
+				border-radius: 20rpx;
+				font-family: Microsoft YaHei-3970(82674968);
+				color: #333333;
 
 
-			image {
-				width: 90rpx;
-				height: 90rpx;
-				margin: 0 auto;
+				image {
+					width: 90rpx;
+					height: 90rpx;
+					margin: 0 auto;
+				}
+
+				text {
+					height: 29rpx;
+					line-height: 54rpx;
+					font-size: 30rpx;
+					color: #333333;
+				}
 			}
 			}
 
 
-			text {
-				height: 29rpx;
-				line-height: 54rpx;
-				font-size: 30rpx;
+			.reset {
+				position: fixed;
+				display: flex;
+				flex-direction: column;
+				align-items: flex-end;
+				right: 55rpx;
+				bottom: 55rpx;
+				font-family: Microsoft YaHei-3970(82674968);
 				color: #333333;
 				color: #333333;
+
+				.icon-zhongzhi {
+					margin: 0 auto;
+					padding-top: 20rpx;
+					color: $my-color-primary;
+					width: 90rpx;
+					height: 70rpx;
+					font-size: 80rpx;
+				}
 			}
 			}
 		}
 		}
 
 
-		.reset {
-			position: fixed;
+
+		.pupup-content {
 			display: flex;
 			display: flex;
 			flex-direction: column;
 			flex-direction: column;
-			align-items: flex-end;
-			right: 55rpx;
-			bottom: 55rpx;
-			font-family: Microsoft YaHei-3970(82674968);
-			color: #333333;
+			justify-content: center;
+			align-items: center;
+			height: 100%;
 
 
-			.icon-zhongzhi {
-				margin: 0 auto;
-				padding-top: 20rpx;
-				color: $my-color-primary;
-				width: 90rpx;
-				height: 70rpx;
-				font-size: 80rpx;
+			.pupup-title {
+				padding-bottom: 20rpx;
 			}
 			}
-		}
-	}
 
 
-		
-	.pupup-content {
-		display: flex;
-		flex-direction: column;
-		justify-content: center;
-		align-items: center;
-		height: 100%;
-		
-		.pupup-title {
-			padding-bottom: 20rpx;
-		}
-		
-		.pupup-img {
-			height: 90%;
+			.pupup-img {
+				height: 90%;
+			}
 		}
 		}
 	}
 	}
-}
-</style>
+</style>

+ 48 - 22
pagesElectric/select/select.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view class="container">
 	<view class="container">
-		<picker class="picker-item1" @tap="clickSelect1" @change="changeSelect1" :range="array1" :value="index1">
+		<picker class="picker-item1" @tap="clickSelect1" @change="changeSelect1" :range="array1" :value="index1" :disabled="dis_num1">
 			<view class="select-item">
 			<view class="select-item">
 				<view class="picker-item-logol">
 				<view class="picker-item-logol">
 					<image class="picker-item-logo-left" src="../static/images/school.png"></image>
 					<image class="picker-item-logo-left" src="../static/images/school.png"></image>
@@ -12,7 +12,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</picker>
 		</picker>
-		<picker class="picker-item2" @tap="clickSelect2" @change="changeSelect2" :range="array2" :value="index2">
+		<picker class="picker-item2" @tap="clickSelect2" @change="changeSelect2" :range="array2" :value="index2" :disabled="dis_num2">
 			<view class="select-item">
 			<view class="select-item">
 				<view class="picker-item-logol">
 				<view class="picker-item-logol">
 					<image class="picker-item-logo-left" src="../static/images/building.png"></image>
 					<image class="picker-item-logo-left" src="../static/images/building.png"></image>
@@ -24,7 +24,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</picker>
 		</picker>
-		<picker class="picker-item2" @tap="clickSelect3" @change="changeSelect3" :range="array3" :value="index3">
+		<picker class="picker-item2" @tap="clickSelect3" @change="changeSelect3" :range="array3" :value="index3" :disabled="dis_num3">
 			<view class="select-item">
 			<view class="select-item">
 				<view class="picker-item-logol">
 				<view class="picker-item-logol">
 					<image class="picker-item-logo-left" src="../static/images/floor.png"></image>
 					<image class="picker-item-logo-left" src="../static/images/floor.png"></image>
@@ -36,7 +36,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</picker>
 		</picker>
-		<picker class="picker-item2" @tap="clickSelect4" @change="changeSelect4" :range="array4" :value="index4">
+		<picker class="picker-item2" @tap="clickSelect4" @change="changeSelect4" :range="array4" :value="index4" :disabled="dis_num4">
 			<view class="select-item">
 			<view class="select-item">
 				<view class="picker-item-logol">
 				<view class="picker-item-logol">
 					<image class="picker-item-logo-left" src="../static/images/room.png"></image>
 					<image class="picker-item-logo-left" src="../static/images/room.png"></image>
@@ -55,7 +55,6 @@
 </template>
 </template>
 
 
 <script>
 <script>
-	// import sortdata from '../../static/test.js'
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -80,6 +79,10 @@
 				add_class2: 0,
 				add_class2: 0,
 				add_class3: 0,
 				add_class3: 0,
 				add_class4: 0,
 				add_class4: 0,
+				dis_num1: 1, //选择器disable属性,是否禁用
+				dis_num2: 1,
+				dis_num3: 1,
+				dis_num4: 1,
 				allData: [], //所有数据
 				allData: [], //所有数据
 				storage: {}, //存放选择数据
 				storage: {}, //存放选择数据
 				ceshi: 'code',
 				ceshi: 'code',
@@ -121,6 +124,8 @@
 					for (var i = 0; i < this.nschool; i++) {
 					for (var i = 0; i < this.nschool; i++) {
 						this.array1.push(tmpData[i].school);
 						this.array1.push(tmpData[i].school);
 					}
 					}
+
+					this.dis_num1 = 0;
 				} else {
 				} else {
 					uni.showToast({
 					uni.showToast({
 						title: '未获得校区',
 						title: '未获得校区',
@@ -171,15 +176,14 @@
 
 
 					this.sel1(this.arr1, true);
 					this.sel1(this.arr1, true);
 
 
-					this.add_class1 = 1;
-					this.add_class2 = 1;
-					this.add_class3 = 1;
-					this.add_class4 = 1;
+					this.checkNull();
+
+					this.dis_num2 = 0;
+					this.dis_num3 = 0;
+					this.dis_num4 = 0;
 				}
 				}
 			},
 			},
 			clickSelect1() {
 			clickSelect1() {
-				this.checkNull();
-				
 				if (this.array1.length == 0) {
 				if (this.array1.length == 0) {
 					uni.showToast({
 					uni.showToast({
 						title: '未获得校区,可能网络异常',
 						title: '未获得校区,可能网络异常',
@@ -228,25 +232,26 @@
 				}
 				}
 
 
 				this.add_class1 = 1;
 				this.add_class1 = 1;
+				this.dis_num2 = 0;
 			},
 			},
 			// 检测对应的下拉列表是否为空,空为红色,非空黑色
 			// 检测对应的下拉列表是否为空,空为红色,非空黑色
 			checkNull() {
 			checkNull() {
-				if (this.array1.length === 0) {
+				if (this.array1.length == 0) {
 					this.add_class1 = 0;
 					this.add_class1 = 0;
 				} else {
 				} else {
 					this.add_class1 = 1;
 					this.add_class1 = 1;
 				}
 				}
-				if (this.array2.length === 0) {
+				if (this.array2.length == 0) {
 					this.add_class2 = 0;
 					this.add_class2 = 0;
 				} else {
 				} else {
 					this.add_class2 = 1;
 					this.add_class2 = 1;
 				}
 				}
-				if (this.array3.length === 0) {
+				if (this.array3.length == 0) {
 					this.add_class3 = 0;
 					this.add_class3 = 0;
 				} else {
 				} else {
 					this.add_class3 = 1;
 					this.add_class3 = 1;
 				}
 				}
-				if (this.array4.length === 0) {
+				if (this.array4.length == 0) {
 					this.add_class4 = 0;
 					this.add_class4 = 0;
 				} else {
 				} else {
 					this.add_class4 = 1;
 					this.add_class4 = 1;
@@ -292,10 +297,10 @@
 				}
 				}
 
 
 				this.checkNull();
 				this.checkNull();
+
+				this.chgDisable();
 			},
 			},
 			clickSelect2() {
 			clickSelect2() {
-				this.checkNull();
-				
 				if (this.array2.length == 0) {
 				if (this.array2.length == 0) {
 					uni.showToast({
 					uni.showToast({
 						title: '未获得楼栋,该校区没有楼栋',
 						title: '未获得楼栋,该校区没有楼栋',
@@ -336,6 +341,7 @@
 				}
 				}
 
 
 				this.add_class2 = 1;
 				this.add_class2 = 1;
+				this.dis_num3 = 0;
 			},
 			},
 			/**
 			/**
 			 * 获取楼层
 			 * 获取楼层
@@ -377,10 +383,10 @@
 				}
 				}
 
 
 				this.checkNull();
 				this.checkNull();
+				
+				this.chgDisable();
 			},
 			},
 			clickSelect3() {
 			clickSelect3() {
-				this.checkNull();
-				
 				if (this.array3.length == 0) {
 				if (this.array3.length == 0) {
 					uni.showToast({
 					uni.showToast({
 						title: '未获得楼层,请选择楼栋',
 						title: '未获得楼层,请选择楼栋',
@@ -417,6 +423,7 @@
 				}
 				}
 
 
 				this.add_class3 = 1;
 				this.add_class3 = 1;
+				this.dis_num4 = 0;
 			},
 			},
 			/**
 			/**
 			 * 获取房间
 			 * 获取房间
@@ -457,12 +464,12 @@
 						icon: 'none'
 						icon: 'none'
 					});
 					});
 				}
 				}
-
+				
 				this.checkNull();
 				this.checkNull();
+
+				this.chgDisable();
 			},
 			},
 			clickSelect4() {
 			clickSelect4() {
-				this.checkNull();
-				
 				if (this.array4.length == 0) {
 				if (this.array4.length == 0) {
 					uni.showToast({
 					uni.showToast({
 						title: '未获得房间,请选择楼层',
 						title: '未获得房间,请选择楼层',
@@ -498,6 +505,25 @@
 				this.room = this.array1[this.index1] + this.array4[this.index4];
 				this.room = this.array1[this.index1] + this.array4[this.index4];
 			},
 			},
 			/**
 			/**
+			 * 下拉框变量数组为空,就禁用
+			 */
+			chgDisable() {
+				setTimeout(() => {
+					if (this.array1.length == 0) {
+						this.dis_num1 = 1;
+					}
+					if (this.array2.length == 0) {
+						this.dis_num2 = 1;
+					}
+					if (this.array3.length == 0) {
+						this.dis_num3 = 1;
+					}
+					if (this.array4.length == 0) {
+						this.dis_num4 = 1;
+					}
+				}, 300);
+			},
+			/**
 			 * 跳转缴费页面
 			 * 跳转缴费页面
 			 * @param {Object} e
 			 * @param {Object} e
 			 */
 			 */