haibao.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view>
  3. <!-- <u-button type="primary" @click="share_qrcode()">生成海报</u-button> -->
  4. <!-- <xq-generate-poster ref="draw" /> -->
  5. <XQ-GeneratePoster ref="draw" />
  6. </view>
  7. </template>
  8. <script>
  9. // import XqGeneratePoster from '@/components/XQGeneratePoster.vue';
  10. // import XqGeneratePoster from '@/uni_modules/XQ-GeneratePoster/components/XQ-GeneratePoster/XQ-GeneratePoster.vue';
  11. export default {
  12. // components: { XqGeneratePoster },
  13. data() {
  14. return {
  15. option: {
  16. //绘制海报内容
  17. codeUrl: 'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg', //小程序太阳码
  18. coverUrl: 'https://pic1.zhimg.com/80/v2-2714df42147132464a71af391ed04be4_720w.jpg', //题库图片
  19. headUrl: 'https://pic1.zhimg.com/80/v2-b9df1fdfe67f2177d5c84af90dcadfc1_720w.jpg?source=1940ef5c', //头像
  20. bgUrl: 'https://pic3.zhimg.com/v2-8fbde0f9ac6a19a23aa839e73394618a_b.jpg', //图片背景填充,和 fillStyle 只能传一个,bgUrl 优先级高于 fillStyle
  21. fillStyle: '#0688ff', //纯色背景填充颜色
  22. nickName: 'UNDEFINED', //授权登录的用户名
  23. miniName: '答题考试助手', //小程序名称
  24. tkName: '题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称题库名称~~', //题库名称
  25. tkAuthor: '题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者题库作者', //题库作者
  26. tkType: '考试', //题库类型
  27. cost: '免费', //是否需要收费 免费/付费
  28. isPub: '公开' //公开 还是 私有
  29. }
  30. };
  31. },
  32. onShow() {
  33. this.$nextTick(() => {
  34. this.share_qrcode()
  35. })
  36. },
  37. methods: {
  38. share_qrcode() {
  39. this.$refs.draw.share_qrcode(this.option);
  40. }
  41. }
  42. };
  43. </script>
  44. <style lang="scss" scoped>
  45. @import url('./haibao.scss');
  46. </style>