Browse Source

【修复】学工号不一致修复!

程志平 4 years ago
parent
commit
86df156d4f
1 changed files with 7 additions and 3 deletions
  1. 7 3
      pages/reshui/reshui.vue

+ 7 - 3
pages/reshui/reshui.vue

@@ -226,8 +226,8 @@
 				// console.log(res);
 				if (res.data.mess == '返回成功') {
 					// 判断存储的stu_number与返回的stu_number是否一致
-					// if (res.data.info[0].stu_number == this.$store.state.userInfo.card_number) {
-					if (res.data.info[0].card_number == this.$store.state.userInfo.card_number) {
+					let cardNumber = res.data.info[0].card_number
+					if (typeof(cardNumber) != 'undefined' && cardNumber != '' && JSON.stringify(cardNumber) != '{}') {
 						// 学号
 						this.stu_number = res.data.info[0].stu_number
 						// 剩余金额
@@ -245,9 +245,13 @@
 						}
 					} else {
 						uni.showToast({
-							title: '学工号不一致!',
+							title: '未获取到学号!',
 							icon: 'success'
 						});
+
+						uni.navigateTo({
+							url: '../index/index?from=' + options.from
+						})
 					}
 				} else if (res.data.mess == '未查询到用户信息') {
 					if (options && typeof(options.from) != 'undefined' && typeof(options.from) != '') {