|
@@ -1,22 +1,9 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
<el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-col :span="24" class="leftTop"> <span>|</span> <span>基本信息</span> </el-col>
|
|
|
- <el-col :span="24" class="info">
|
|
|
- <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
|
|
- <el-form-item label="用户名" prop="adminuser">
|
|
|
- <el-input v-model="form.name" placeholder="请输入用户名"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="手机号" prop="phone">
|
|
|
- <el-input v-model="form.phone" placeholder="请输入用户名" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="submitForm('form')">保存</el-button>
|
|
|
- <el-button @click="resetForm('form')">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-col>
|
|
|
+ <el-col :span="24" class="leftTop"> <span>|</span> <span>绑定微信</span> </el-col>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <img :src="qc" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -24,67 +11,22 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions: dock } = createNamespacedHelpers('dock');
|
|
|
-const { mapActions: authUser } = createNamespacedHelpers('authUser');
|
|
|
+import QRCode from 'qrcode';
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {},
|
|
|
data: function() {
|
|
|
return {
|
|
|
- form: {},
|
|
|
- rules: {
|
|
|
- adminuser: [{ required: false, message: '请输入用户名', trigger: 'blur' }],
|
|
|
- phone: [{ required: false, message: '请输入手机号', trigger: 'blur' }],
|
|
|
- },
|
|
|
+ qc: '',
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- this.searchInfo();
|
|
|
- },
|
|
|
+ created() {},
|
|
|
methods: {
|
|
|
- ...dock({ dockQuery: 'query', dockFetch: 'fetch', dockUpdate: 'update' }),
|
|
|
- ...authUser({ authUserFetch: 'fetch', authUserUpdate: 'update' }),
|
|
|
- async searchInfo() {
|
|
|
- if (this.user.uid) {
|
|
|
- let data = {
|
|
|
- name: this.user.name,
|
|
|
- phone: this.user.phone,
|
|
|
- };
|
|
|
- this.$set(this, `form`, data);
|
|
|
- }
|
|
|
- },
|
|
|
- async submitForm() {
|
|
|
- this.form.id = this.user.uid;
|
|
|
- let res = await this.authUserUpdate(this.form);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$message({
|
|
|
- message: '修改信息成功',
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
- }
|
|
|
- // let res = await this.dockUpdate(this.form);
|
|
|
- // if (this.$checkRes(res)) {
|
|
|
- // let data = {};
|
|
|
- // data.id = this.user.uid;
|
|
|
- // data.name = this.form.adminuser;
|
|
|
- // let arr = await this.authUserUpdate(data);
|
|
|
- // if (this.$checkRes(arr)) {
|
|
|
- // this.$message({
|
|
|
- // message: '修改信息成功',
|
|
|
- // type: 'success',
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // this.$message({
|
|
|
- // message: '修改信息失败',
|
|
|
- // type: 'error',
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
- this.searchInfo();
|
|
|
- },
|
|
|
- resetForm() {
|
|
|
- this.form.adminuser = '';
|
|
|
+ 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 });
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
@@ -93,6 +35,9 @@ export default {
|
|
|
return `${this.$route.meta.title}`;
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.creatQrCode();
|
|
|
+ },
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
|
},
|
|
@@ -113,6 +58,6 @@ export default {
|
|
|
color: #22529a;
|
|
|
}
|
|
|
.info {
|
|
|
- padding: 0 40px 0 0;
|
|
|
+ padding: 0 40px 0 10px;
|
|
|
}
|
|
|
</style>
|