lrf402788946 5 tahun lalu
induk
melakukan
9add55277a
1 mengubah file dengan 19 tambahan dan 5 penghapusan
  1. 19 5
      src/views/bind/confirm.vue

+ 19 - 5
src/views/bind/confirm.vue

@@ -5,10 +5,10 @@
         <el-image :src="question"></el-image>
       </el-col>
       <el-col :span="24" style="height:10vh;text-align:center">
-        您确定将您的微信号与本平台账号绑定吗?
+        {{ type == '1' ? '您确定将您的微信号与本平台账号绑定吗?' : '您确定登陆本平台' }}
       </el-col>
       <el-col :span="24" style="height:4rem">
-        <van-button type="info" style="width:100%" round @click="toBind()">确定</van-button>
+        <van-button type="info" style="width:100%" round @click="confirm()">确定</van-button>
       </el-col>
       <el-col :span="24">
         <van-button plain style="width:100%" round @click="cancel()">取消</van-button>
@@ -21,7 +21,7 @@
 import { createNamespacedHelpers } from 'vuex';
 const { mapActions: login } = createNamespacedHelpers('login');
 export default {
-  metaInfo: { title: '用户绑定' },
+  metaInfo: { title: '培训会手机确认' },
   name: 'index',
   props: {},
   components: {},
@@ -36,17 +36,31 @@ export default {
     uid() {
       return this.$route.query.uid;
     },
+    qrcode() {
+      return this.$route.query.qrcode;
+    },
+    type() {
+      return this.$route.query.type;
+    },
   },
   methods: {
-    ...login(['userBind']),
+    ...login(['userBind', 'wxCheck']),
+    confirm() {
+      if (this.type == '1') this.toBind();
+      if (this.type == '2') this.toWxLogin();
+    },
     async toBind() {
-      const res = await this.userBind({ uid: this.uid, openid: this.openid });
+      const res = await this.userBind({ uid: this.uid, openid: this.openid, qrcode: this.qrcode, type: this.type });
       if (res.errcode === 0) {
         this.$toast({ type: 'success', message: '绑定成功' });
       } else {
         this.$toast({ type: 'fail', message: res.errmsg });
       }
     },
+    async toWxLogin() {
+      let res = await this.wxCheck({ openid: this.openid, qrcode: this.qrcode });
+      console.log(res);
+    },
     cancel() {
       window.history.go(-1);
     },