rjy 4 년 전
부모
커밋
b298590ede
3개의 변경된 파일51개의 추가작업 그리고 0개의 파일을 삭제
  1. 41 0
      src/views/superAdminCenter/bindWx/index.vue
  2. 3 0
      src/views/superAdminCenter/index.vue
  3. 7 0
      src/views/superAdminCenter/menuInfo.vue

+ 41 - 0
src/views/superAdminCenter/bindWx/index.vue

@@ -0,0 +1,41 @@
+<template>
+  <div id="index">
+    <img :src="qc" />
+  </div>
+</template>
+
+<script>
+import dataTable from '@/components/data-table.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+import QRCode from 'qrcode';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: () => ({
+    qc: '',
+  }),
+  created() {
+    this.creatQrCode();
+  },
+  methods: {
+    async creatQrCode() {
+      console.log(this.user);
+      let url = `http://free.liaoningdoupo.com/api/auth/wxchat?redirect_uri=http://free.liaoningdoupo.com/platmobile/bind/&type=1&uid=${this.user.uid}`; // 需要转换为二维码的内容
+      let el = document.getElementById('qrCodeUrl');
+      this.qc = await QRCode.toDataURL(url, { height: 200, width: 200 });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 3 - 0
src/views/superAdminCenter/index.vue

@@ -44,8 +44,10 @@ import guestInter from './guestInter/index.vue';
 import dictionary from './dictionary/index.vue';
 import business from './business/index.vue';
 import manager from './manager/index.vue';
+import bindWx from './bindWx/index.vue';
 import heads from '@/layout/userCenter/heads.vue';
 import foot from '@/layout/live/foot.vue';
+
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'index',
@@ -67,6 +69,7 @@ export default {
     dictionary,
     business,
     manager,
+    bindWx,
     menus,
     top,
   },

+ 7 - 0
src/views/superAdminCenter/menuInfo.vue

@@ -8,6 +8,7 @@
         </el-col>
         <el-col :span="24">
           <el-menu :default-active="active" @select="setRight" text-color="#999" active-text-color="#044b79">
+            <el-menu-item index="20">绑定微信</el-menu-item>
             <template v-for="(i, index) in menuList">
               <el-menu-item :key="index" :index="`${index}`" v-if="i.cpt">
                 <template slot="title">
@@ -67,8 +68,14 @@ export default {
       });
       return data;
     },
+
     // 菜单跳转
+
     setRight(index) {
+      if (index == 20) {
+        let r = { cpt: 'bindWx', name: '绑定微信' };
+        if (r) this.$emit('setRight', r);
+      }
       let r = this.menuList[index];
       if (r) this.$emit('setRight', r);
     },