程志平 3 лет назад
Родитель
Сommit
6897b98954
3 измененных файлов с 26 добавлено и 9 удалено
  1. 12 4
      pages/recharge/recharge.vue
  2. 13 4
      pages/reshui/reshui.vue
  3. 1 1
      pagesAir/addAir/addAir.vue

+ 12 - 4
pages/recharge/recharge.vue

@@ -89,16 +89,23 @@
 				const res = await this.$myRequest({
 				const res = await this.$myRequest({
 					host: 'ip',
 					host: 'ip',
 					url: '?ie=utf-8',
 					url: '?ie=utf-8',
+					// url: '/json',
 					method: 'POST'
 					method: 'POST'
 				})
 				})
 
 
-				if (res) {
+				if (res.data) {
 					// console.log(res);
 					// console.log(res);
 					const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
 					const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
 					let ip = reg.exec(res.data);
 					let ip = reg.exec(res.data);
 
 
 					// 获取code
 					// 获取code
 					this.getCode(ip[0])
 					this.getCode(ip[0])
+				} else {
+					uni.showToast({
+						title: 未获得IP地址,
+						icon: 'none',
+						duration: 2000
+					})
 				}
 				}
 			},
 			},
 			/**
 			/**
@@ -250,6 +257,7 @@
 			 * 提示
 			 * 提示
 			 */
 			 */
 			tip(param) {
 			tip(param) {
+				let _this = this;
 				if (!this.isXiaoqu) {
 				if (!this.isXiaoqu) {
 					if (param == false) {
 					if (param == false) {
 						uni.showModal({
 						uni.showModal({
@@ -265,7 +273,6 @@
 							}
 							}
 						});
 						});
 					} else {
 					} else {
-						let _this = this;
 						uni.showModal({
 						uni.showModal({
 							title: '提示',
 							title: '提示',
 							content: '目前只对【墨轩湖校区】的【热水钱包】进行充值!',
 							content: '目前只对【墨轩湖校区】的【热水钱包】进行充值!',
@@ -292,6 +299,7 @@
 			 * 调用接口实现充值功能
 			 * 调用接口实现充值功能
 			 */
 			 */
 			chongzhi() {
 			chongzhi() {
+				var _this = this;
 				if (isNaN(this.amount)) {
 				if (isNaN(this.amount)) {
 					uni.showToast({
 					uni.showToast({
 						title: '请输入正确金额',
 						title: '请输入正确金额',
@@ -309,7 +317,7 @@
 						success: (res) => {
 						success: (res) => {
 							if (res.confirm) {
 							if (res.confirm) {
 								// 获取IP
 								// 获取IP
-								this.getIP()
+								_this.getIP()
 							} else if (res.cancel) {
 							} else if (res.cancel) {
 								return
 								return
 							}
 							}
@@ -336,7 +344,7 @@
 					success: (res) => {
 					success: (res) => {
 						if (res.confirm) {
 						if (res.confirm) {
 							// 获取IP
 							// 获取IP
-							this.getIP()
+							_this.getIP()
 						} else if (res.cancel) {
 						} else if (res.cancel) {
 							return
 							return
 						}
 						}

+ 13 - 4
pages/reshui/reshui.vue

@@ -1446,10 +1446,19 @@
 						})
 						})
 					}
 					}
 				} else {
 				} else {
-					uni.showToast({
-						icon: 'none',
-						title: '字节码或学号为空!'
-					});
+					if (typeof this.byte35 == 'undefined' || this.byte35 == '') {
+						uni.showToast({
+							icon: 'none',
+							title: '字节码为空!'
+						});
+					}
+					
+					if (typeof this.stu_number == 'undefined' || this.stu_number == '') {
+						uni.showToast({
+							icon: 'none',
+							title: '学号为空!'
+						});
+					}
 					// 初始化
 					// 初始化
 					this.setInit()
 					this.setInit()
 				}
 				}

+ 1 - 1
pagesAir/addAir/addAir.vue

@@ -66,7 +66,7 @@
 											:style="{display: item3.isShow ? 'none' : ''}"></uni-icons>
 											:style="{display: item3.isShow ? 'none' : ''}"></uni-icons>
 										<uni-icons type="minus-filled" size="22" color="#2979ff"
 										<uni-icons type="minus-filled" size="22" color="#2979ff"
 											:style="{display: item3.isShow ? '' : 'none'}"></uni-icons>
 											:style="{display: item3.isShow ? '' : 'none'}"></uni-icons>
-										<view class="txt-jiaoshi">{{item3.label}}</view>
+										<view class="txt-jiaoshi">{{item3.label.split('-')[1]}}</view>
 									</view>
 									</view>
 									<uni-icons type="top" size="22" color="#2979ff"
 									<uni-icons type="top" size="22" color="#2979ff"
 										:style="{display: item3.isShow ? '' : 'none'}"></uni-icons>
 										:style="{display: item3.isShow ? '' : 'none'}"></uni-icons>