Browse Source

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-student

guhongwei 5 years ago
parent
commit
a60e9c9cb4
4 changed files with 87 additions and 2 deletions
  1. BIN
      src/assets/question.png
  2. 7 2
      src/router/index.js
  3. 0 0
      src/views/bind/bind.vue
  4. 80 0
      src/views/bind/confirm.vue

BIN
src/assets/question.png


+ 7 - 2
src/router/index.js

@@ -12,7 +12,12 @@ const routes = [
     meta: { title: '日程安排', isleftarrow: true },
     component: () => import('../views/index.vue'),
   },
-
+  {
+    path: '/confirm',
+    name: 'confirm',
+    meta: { title: '测试页', isleftarrow: true },
+    component: () => import('../views/bind/confirm.vue'),
+  },
   // 班级信息
   {
     path: '/classinfo',
@@ -22,7 +27,7 @@ const routes = [
   {
     path: '/bind',
     meta: { title: '填写信息', isleftarrow: true },
-    component: () => import('../views/bind.vue'),
+    component: () => import('../views/bind/bind.vue'),
   },
   // 班级名单
   {

src/views/bind.vue → src/views/bind/bind.vue


+ 80 - 0
src/views/bind/confirm.vue

@@ -0,0 +1,80 @@
+<template>
+  <div id="index">
+    <el-row style="padding:10px;height:100vh">
+      <el-col :span="24" class="icon">
+        <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="confirm()">确定</van-button>
+      </el-col>
+      <el-col :span="24">
+        <van-button plain style="width:100%" round @click="cancel()">取消</van-button>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions: login } = createNamespacedHelpers('login');
+export default {
+  metaInfo: { title: '培训会手机确认' },
+  name: 'index',
+  props: {},
+  components: {},
+  data: () => ({
+    question: require('@/assets/question.png'),
+  }),
+  created() {},
+  computed: {
+    openid() {
+      return this.$route.query.openid;
+    },
+    uid() {
+      return this.$route.query.uid;
+    },
+    qrcode() {
+      return this.$route.query.qrcode;
+    },
+    type() {
+      return this.$route.query.type;
+    },
+  },
+  methods: {
+    ...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, 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);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.icon {
+  height: 30vh;
+  text-align: center;
+}
+.icon .el-image {
+  width: 100px;
+  margin: 40px 0;
+}
+</style>