businessLicense.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="card content-box">
  3. <div class="tip-text">如需更换请联系客服</div>
  4. <div class="license-container" v-if="licenseImage">
  5. <div class="license-display">
  6. <el-image :src="licenseImage" fit="contain" class="license-image" :preview-src-list="[licenseImage]">
  7. <template #error>
  8. <div class="empty-image-box">
  9. <el-icon class="empty-icon">
  10. <Picture />
  11. </el-icon>
  12. </div>
  13. </template>
  14. </el-image>
  15. </div>
  16. </div>
  17. <div v-else class="empty-contract">
  18. <el-empty description="暂无合同图片" :image-size="100" />
  19. </div>
  20. </div>
  21. </template>
  22. <script setup lang="ts" name="businessLicense">
  23. import { ref, onMounted } from "vue";
  24. import { ElMessage } from "element-plus";
  25. import { Picture } from "@element-plus/icons-vue";
  26. import { getBusinessLicense } from "@/api/modules/licenseManagement";
  27. import { localGet } from "@/utils";
  28. const licenseImage = ref<string>("");
  29. const id = localGet("createdId");
  30. onMounted(async () => {
  31. await initData();
  32. });
  33. const initData = async () => {
  34. const params = {
  35. id: id
  36. };
  37. const res: any = await getBusinessLicense(params);
  38. if (res.code === 200) {
  39. licenseImage.value = res.data[0].imgUrl;
  40. }
  41. };
  42. </script>
  43. <style lang="scss" scoped>
  44. .page-header {
  45. margin-bottom: 20px;
  46. }
  47. .store-title {
  48. margin: 0;
  49. font-size: 28px;
  50. font-weight: 600;
  51. color: var(--el-text-color-primary);
  52. }
  53. .divider {
  54. width: 100%;
  55. height: 1px;
  56. margin-bottom: 20px;
  57. background-color: var(--el-border-color-lighter);
  58. }
  59. .tip-text {
  60. margin-top: 20px;
  61. margin-bottom: 50px;
  62. font-size: 18px;
  63. color: var(--el-text-color-regular);
  64. }
  65. .license-container {
  66. padding: 20px;
  67. background-color: var(--el-bg-color-page);
  68. border-radius: 8px;
  69. }
  70. .license-display {
  71. display: flex;
  72. align-items: center;
  73. justify-content: center;
  74. width: 700px;
  75. height: 500px;
  76. }
  77. .license-image {
  78. width: 100%;
  79. height: 100%;
  80. border-radius: 8px;
  81. box-shadow: 0 2px 12px rgb(0 0 0 / 10%);
  82. }
  83. .empty-image-box {
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. width: 100%;
  88. height: 100%;
  89. background-color: var(--el-fill-color-lighter);
  90. border-radius: 8px;
  91. .empty-icon {
  92. font-size: 64px;
  93. color: var(--el-text-color-placeholder);
  94. }
  95. }
  96. .empty-contract {
  97. display: flex;
  98. align-items: center;
  99. justify-content: center;
  100. min-height: 570px;
  101. padding: 40px 20px;
  102. }
  103. </style>