QRcodePopover.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <el-popover
  3. popper-style="
  4. border: none;
  5. padding: 0px;
  6. width: 228px;
  7. height: 308px;
  8. background: linear-gradient(rgb(238, 246, 250), rgb(125, 194, 255));
  9. "
  10. placement="bottom"
  11. trigger="hover"
  12. >
  13. <template #reference>
  14. <div class="QR-btn">
  15. <!-- <el-icon :size="18"><Download /></el-icon> -->
  16. <el-button style="background-color: rgb(24, 144, 255); border: none" type="primary"
  17. >下载APP</el-button
  18. >
  19. </div>
  20. </template>
  21. <div class="QR-body">
  22. <div class="QR-text">安全管控平台</div>
  23. <div style="display: flex; flex-direction: row; align-items: center">
  24. <img src="@/assets/images/Android.png" style="width: 16px; height: 19px" />
  25. <div class="QR-text" style="font-size: 14px; padding-left: 5px">Android客户端</div>
  26. </div>
  27. <!-- <img src="@/assets/images/QRcodeExample.png" style="width: 140px" /> -->
  28. <QrCode :value="qrCodeUrl" :width="140" />
  29. <!-- <el-button
  30. style="width: 102px; background-color: rgb(24, 144, 255); border: none"
  31. type="primary"
  32. >保存到相册
  33. </el-button> -->
  34. </div>
  35. </el-popover>
  36. </template>
  37. <script lang="ts" setup>
  38. // import { Download } from '@element-plus/icons-vue';
  39. import { QrCode } from '@/components/Qrcode/index';
  40. import { useGlobSetting } from '@/hooks/setting';
  41. import urlJoin from 'url-join';
  42. import { computed, ref } from 'vue';
  43. const globSetting = useGlobSetting();
  44. const qrCodeUrl = computed(() => {
  45. const url = globSetting.appDownloadUrl || '';
  46. if (url?.startsWith('http') || url?.startsWith('//')) {
  47. return url;
  48. }
  49. return urlJoin(window.location.origin, url);
  50. });
  51. </script>
  52. <style scoped lang="scss">
  53. .QR-btn {
  54. display: flex;
  55. align-items: center;
  56. }
  57. .QR-body {
  58. display: flex;
  59. flex-direction: column;
  60. align-items: center;
  61. justify-content: space-around;
  62. height: 100%;
  63. padding: 20px;
  64. .QR-text {
  65. font-weight: 600;
  66. font-size: 20px;
  67. color: #1890ff;
  68. line-height: 28px;
  69. text-align: center;
  70. font-style: normal;
  71. }
  72. }
  73. </style>