guhongwei hace 4 años
padre
commit
33e2dd112f
Se han modificado 2 ficheros con 91 adiciones y 0 borrados
  1. 7 0
      src/router/index.js
  2. 84 0
      src/views/dockbind.vue

+ 7 - 0
src/router/index.js

@@ -12,6 +12,13 @@ const routes = [
     meta: { title: '绑定', isleftarrow: false },
     component: () => import('../views/bind.vue'),
   },
+  // 展会绑定
+  {
+    path: '/dockbind',
+    name: 'dockbind',
+    meta: { title: '展会绑定', isleftarrow: false },
+    component: () => import('../views/dockbind.vue'),
+  },
   //关注公众号
   {
     path: '/followbind',

+ 84 - 0
src/views/dockbind.vue

@@ -0,0 +1,84 @@
+<template>
+  <div id="dockbind">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-button @click="bindBtn()" type="primary">确认绑定</el-button>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: authUser } = createNamespacedHelpers('authUser');
+export default {
+  name: 'dockbind',
+  props: {},
+  components: {
+    NavBar,
+  },
+  data: () => ({
+    // 头部标题
+    title: '',
+    // meta为true
+    isleftarrow: '',
+    // 返回
+    navShow: true,
+  }),
+  created() {},
+  computed: {
+    qrcode() {
+      return this.$route.query.qrcode;
+    },
+    openid() {
+      return this.$route.query.openid;
+    },
+  },
+  methods: {
+    ...authUser(['bind']),
+    async bindBtn() {
+      let data = {};
+      data.qrcode = this.qrcode;
+      data.openid = this.openid;
+      let res = await this.bind(data);
+      if (res.errcode == '0') {
+        this.$message({
+          message: '绑定成功',
+          type: 'success',
+        });
+      }
+    },
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+  padding: 150px;
+}
+.foot {
+  position: absolute;
+  bottom: 0;
+}
+</style>