introduction.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div>
  3. <h4>公司简介</h4>
  4. <div v-if="props.info.enterprise.introduce" class="requirement" v-html="props.info.enterprise.introduce.replace(/\n/g, '</br>')"></div>
  5. <div v-else>暂无</div>
  6. <v-divider class="my-3"></v-divider>
  7. <div>
  8. <h4>公司地址</h4>
  9. <div v-if="props.info?.business?.address" class="mt-1">
  10. <v-icon size="25" color="primary">mdi-map-marker</v-icon>
  11. <span style="color: var(--color-666);font-size: 15px;">{{ props.info.business.address }}</span>
  12. </div>
  13. <div v-else class="mt-1">暂无</div>
  14. </div>
  15. <v-divider class="my-3"></v-divider>
  16. <div>
  17. <h4>公司相册</h4>
  18. <v-slide-group v-if="props.info.enterprise.albumList" :show-arrows="true" class="mt-3 img-box cursor-pointer">
  19. <v-slide-group-item v-for="(val, i) in props.info.enterprise.albumList" :key="i">
  20. <div>
  21. <v-img v-if="checkIsImage(val)" class="mr-3" width="200" height="115" :src="val" cover rounded @click.stop="handleClick(i)"></v-img>
  22. <video v-else class="videos-radius mr-3" :src="val" controls height="118" width="200" preload="preload" @click.stop="handleClick(i)"></video>
  23. </div>
  24. </v-slide-group-item>
  25. </v-slide-group>
  26. <div v-else>暂无</div>
  27. </div>
  28. <PreviewImage v-if="showPreview" :initialIndex="current" :urlList="props.info.enterprise.albumList" @close="showPreview = !showPreview" />
  29. </div>
  30. </template>
  31. <script setup>
  32. defineOptions({ name: 'enterprise-introduction'})
  33. import { checkIsImage } from '@/utils'
  34. import { ref } from 'vue'
  35. const props = defineProps({
  36. info: {
  37. type: Object,
  38. default: () => {}
  39. }
  40. })
  41. // 预览
  42. const showPreview = ref(false)
  43. const current = ref(0)
  44. const handleClick = (index) => {
  45. showPreview.value = !showPreview.value
  46. current.value = index
  47. }
  48. </script>
  49. <style scoped lang="scss">
  50. .requirement {
  51. white-space: pre-wrap;
  52. word-break: break-all;
  53. line-height: 28px;
  54. color: var(--color-333);
  55. font-size: 15px;
  56. text-align: justify;
  57. letter-spacing: 0;
  58. }
  59. .videos-radius {
  60. border-radius: 8px;
  61. }
  62. </style>