Browse Source

授权登录

liyuan 1 month ago
parent
commit
38d8f32df5
1 changed files with 11 additions and 6 deletions
  1. 11 6
      pages/login/index.vue

+ 11 - 6
pages/login/index.vue

@@ -53,14 +53,11 @@
 				checked: false,
 				lifeData: {},
 				checkboxValue1: [],
+        storeId: '',
 			}
 		},
 		onLoad(options) {
-      uni.showToast({
-        title: 'scene: ' + JSON.stringify(options),
-        icon: 'none',
-        duration: 5000
-      });
+      this.storeId = options.scene
       console.info('options----', options)
 			if (options) {
 				uni.setStorageSync('QRcodeDate', options);
@@ -91,6 +88,14 @@
 					position: "bottom",
 					mask: true
 				})
+        if (!this.storeId) {
+          return uni.showToast({
+            icon: 'none',
+            title: '请扫描门店二维码进行注册登录',
+            position: "bottom",
+            mask: true
+          })
+        }
 				if (e.detail.errMsg == 'getPhoneNumber:ok') {
 					wx.login({
 						success(res) {
@@ -112,7 +117,7 @@
 												phone: rest.data.phoneNumber,
 												union_id: rest.data.unionid,
 												open_id: rest.data.openid,
-												storeId: '1995319740020559873',
+												storeId: this.storeId,
 												applets_id: uni.getAccountInfoSync().miniProgram.appId,
 												// password: md5('123456')
 											}).then(data => {