|
@@ -1,18 +1,25 @@
|
|
|
<template>
|
|
|
<div id="main-layout">
|
|
|
- <el-container style="background:#e7e8eb;">
|
|
|
- <el-header height="4rem" class="head">
|
|
|
- <heads></heads>
|
|
|
- </el-header>
|
|
|
- <el-container class="contain">
|
|
|
- <el-aside width="13rem" class="side">
|
|
|
- <newmenu></newmenu>
|
|
|
- </el-aside>
|
|
|
- <el-main class="main">
|
|
|
- <router-view />
|
|
|
- </el-main>
|
|
|
+ <el-row>
|
|
|
+ <el-container style="background:#e7e8eb;">
|
|
|
+ <el-header height="4rem" class="head">
|
|
|
+ <heads @bindBtn="bindBtn"></heads>
|
|
|
+ </el-header>
|
|
|
+ <el-container class="contain">
|
|
|
+ <el-aside width="13rem" class="side">
|
|
|
+ <newmenu></newmenu>
|
|
|
+ </el-aside>
|
|
|
+ <el-main class="main">
|
|
|
+ <router-view />
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
</el-container>
|
|
|
- </el-container>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog title="绑定" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
|
|
+ <div>
|
|
|
+ <img :src="qc" />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -20,6 +27,7 @@
|
|
|
import heads from '@/layout/layout-part/heads.vue';
|
|
|
import newmenu from '@/layout/layout-part/newmenu.vue';
|
|
|
import { mapActions, mapState } from 'vuex';
|
|
|
+import QRCode from 'qrcode';
|
|
|
export default {
|
|
|
name: 'main-layout',
|
|
|
props: {},
|
|
@@ -27,10 +35,32 @@ export default {
|
|
|
newmenu,
|
|
|
heads,
|
|
|
},
|
|
|
- data: () => ({}),
|
|
|
+ data: () => ({
|
|
|
+ dialogVisible: false,
|
|
|
+ qc: '',
|
|
|
+ }),
|
|
|
created() {},
|
|
|
- computed: {},
|
|
|
- methods: {},
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ bindBtn() {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.creatQrCode();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async creatQrCode() {
|
|
|
+ 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 });
|
|
|
+ },
|
|
|
+ // 关闭
|
|
|
+ handleClose(done) {
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -59,4 +89,7 @@ export default {
|
|
|
padding: 0;
|
|
|
background: #ffffff;
|
|
|
}
|
|
|
+/deep/.el-dialog__body {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|