浏览代码

no message

zpj 1 月之前
父节点
当前提交
e72affc981
共有 1 个文件被更改,包括 27 次插入 和 30 次删除
  1. 27 30
      pages/index.vue

+ 27 - 30
pages/index.vue

@@ -65,36 +65,7 @@
 			let isWeiXin = isWx();
 			if (isWeiXin) {
 				tools.wxInitialize(["chooseWXPay"]);
-			}
-			// #endif
-
-			this.headH = getNavHeight();
-			this.headPTop = getPhoneTopHeight();
-
-
-			if (data.code !== undefined) {
-				this.code = data.code
-				this.code_type = data.img_type
-			} else {
-				uni.reLaunch({
-					url: `/pages/error?msg=` + '店铺信息错误,请重新扫码。'
-				})
-				return
-			}
-			
-			payImgInfo({
-				code: this.code
-			}).then((res) => {
-				if (res.code === 1) {
-					this.shop_id = res.data.id;
-					this.shop_name = res.data.shop_name;
-					uni.setStorageSync("shopName", this.shop_name)
-				}
-			})
-		},
-		onShow() {
-			let isWeiXin = isWx()
-			if (isWeiXin){
+				
 				if (href.indexOf('?code=') > -1 || href.indexOf('&code=') > -1) {
 					const urlArr = href.split('?')
 					const rightUrlArr = urlArr[1].split('#/')
@@ -124,7 +95,33 @@
 					// 认证失败
 					tools.wxLogin();
 				}
+				
 			}
+			// #endif
+
+			this.headH = getNavHeight();
+			this.headPTop = getPhoneTopHeight();
+
+
+			if (data.code !== undefined) {
+				this.code = data.code
+				this.code_type = data.img_type
+			} else {
+				uni.reLaunch({
+					url: `/pages/error?msg=` + '店铺信息错误,请重新扫码。'
+				})
+				return
+			}
+			
+			payImgInfo({
+				code: this.code
+			}).then((res) => {
+				if (res.code === 1) {
+					this.shop_id = res.data.id;
+					this.shop_name = res.data.shop_name;
+					uni.setStorageSync("shopName", this.shop_name)
+				}
+			})
 		},
 		methods: {
 			setNum(item) {