codeDownload.vue 1.7 KB

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