Browse Source

【修复】跳转授权问题

程志平 4 years ago
parent
commit
9b3a225421
2 changed files with 16 additions and 6 deletions
  1. 6 0
      pages/jiaofei/jiaofei.vue
  2. 10 6
      pages/reshui/reshui.vue

+ 6 - 0
pages/jiaofei/jiaofei.vue

@@ -82,6 +82,12 @@
 		},
 		onLoad(options) {
 			// console.log(options);
+			if (typeof(options.from) != 'undefined' && options.from == 2) {
+				uni.navigateTo({
+					url: '../index/index?from=' + options.from
+				})
+				return
+			}
 			// 获取基本信息
 			this.get_base_info(options, 'onLoad')
 		},

+ 10 - 6
pages/reshui/reshui.vue

@@ -119,15 +119,19 @@
 			}
 		},
 		onLoad(options) {
-			if (typeof(options.from) != 'undefined' && options.from == 3 && typeof(options.wxminicode) != 'undefined' &&
-				typeof(options.wxminicode) != '') {
+			// console.log(options);
+			if (typeof(options) != 'undefined' && typeof(options) != '' && JSON.stringify(options) == '{}') {
+				// 获取基本信息
+				this.get_base_info(options, 'onLoad')
+			} else if (typeof(options.from) != 'undefined' && options.from != 0) {
+				uni.navigateTo({
+					url: '../index/index?from=' + options.from
+				})
+			} else {
 				// wxminicode=KB580002652
-				this.start_code = options.wxminicode
+				this.start_code = decodeURIComponent(options.q).split('=')[1]
 				// 初始化蓝牙
 				this.openBluetoothAdapter()
-			} else {
-				// 获取基本信息
-				this.get_base_info(options, 'onLoad')
 			}
 		},
 		onShow() {