|
@@ -12,6 +12,7 @@
|
|
|
<el-col :span="24" class="info">
|
|
|
<el-col :span="24" class="title">
|
|
|
{{ data.title }}
|
|
|
+ <img :src="qc" style="position:relative;top:15px" />
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="brief">
|
|
|
{{ data.brief }}
|
|
@@ -70,6 +71,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import QRCode from 'qrcode';
|
|
|
const _ = require('lodash');
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: answer } = createNamespacedHelpers('answer');
|
|
@@ -84,10 +86,12 @@ export default {
|
|
|
answer: {},
|
|
|
disabled: false,
|
|
|
userForm: {},
|
|
|
+ qc: '',
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.init();
|
|
|
+ this.creatQrCode();
|
|
|
},
|
|
|
methods: {
|
|
|
...answer(['create', 'findAnswer']),
|
|
@@ -169,6 +173,12 @@ export default {
|
|
|
this.$router.push({ path: './list', query: { index: this.$route.query.index } });
|
|
|
}
|
|
|
},
|
|
|
+ // 创建二维码
|
|
|
+ async creatQrCode() {
|
|
|
+ let url = `http://broadcast.waityou24.cn/platmobile/question/detail?id=${this.data.id}`; // 需要转换为二维码的内容
|
|
|
+ console.log(url);
|
|
|
+ this.qc = await QRCode.toDataURL(url, { height: 50, width: 50 });
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user', 'menuParams']),
|