codeDownload.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view :style="getHeight">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <view class="content d-flex flex-column a-center j-center">
  6. <image src="/static/image/addStaff/face_sao.png" mode="widthFix" lazy-load style="width: 500upx;"></image>
  7. <image :src="recommendImg" mode="widthFix" lazy-load style="width: 450upx;"></image>
  8. <view>微信扫描二维码,即可下载!</view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {
  14. mapState
  15. } from "vuex"
  16. import QR from "@/common/wxqrcode.js"
  17. export default {
  18. data() {
  19. return {
  20. recommendImg: ""
  21. }
  22. },
  23. computed: {
  24. ...mapState(['userInfo']),
  25. getHeight() {
  26. let height = uni.getSystemInfoSync().windowHeight;
  27. return `height: ${height}px;`;
  28. }
  29. },
  30. async onLoad() {
  31. var id = this.userInfo.sysUser.id;
  32. let pageRequest = {
  33. pageNum: 1,
  34. pageSize: 50,
  35. columnFilters: {
  36. apptype: {
  37. name: "apptype",
  38. value: "apk",
  39. }
  40. }
  41. };
  42. let getquote = await this.$http.post('/sysVersion/findPage', pageRequest);
  43. let url = getquote.data.content[0].path;
  44. this.recommendImg = QR.createQrCodeImg(url, {
  45. size: parseInt(200) //二维码大小
  46. })
  47. },
  48. methods: {
  49. }
  50. }
  51. </script>
  52. <style>
  53. .content {
  54. position: absolute;
  55. top: 50%;
  56. left: 50%;
  57. transform: translate(-50%, -60%);
  58. }
  59. .content>image {
  60. margin-top: 30upx;
  61. margin-bottom: 30upx;
  62. }
  63. .content>view {
  64. width: 400upx;
  65. color: red;
  66. text-align: center;
  67. }
  68. </style>