detail.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div>
  3. <div v-if="detailData.travelNotesBannerAfterConvert">
  4. <img
  5. :src="
  6. detailData.travelNotesBannerAfterConvert?.length
  7. ? detailData.travelNotesBannerAfterConvert[0]
  8. : ''
  9. "
  10. />
  11. <div class="project-detail">
  12. <div class="project-title">
  13. {{ detailData.projectTitle }}
  14. </div>
  15. <div>
  16. <div class="project-label" v-for="item in lableList" :key="item">
  17. {{ item }}
  18. </div>
  19. </div>
  20. <div class="project-concat">
  21. <div>出行天数 {{ detailData.countTimes }}</div>
  22. <div v-if="detailData.contactDescription">
  23. 专业一站式导游服务请联系{{ detailData.contactDescription }}
  24. </div>
  25. </div>
  26. <div class="richtext" v-html="detailData.tourismContent.content"></div>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script setup>
  32. import { getTravelDetail } from '@/api/travel';
  33. import { useRoute } from 'vue-router';
  34. import { computed } from 'vue';
  35. const router = useRoute();
  36. const lableList = computed(() => {
  37. return detailData.value?.projectLabel?.split('&') ?? [];
  38. });
  39. onLoad(() => {
  40. requestTravelDetail();
  41. });
  42. const detailData = ref({});
  43. async function requestTravelDetail() {
  44. const { data } = await getTravelDetail(router.query.id);
  45. detailData.value = data;
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .project-detail {
  50. padding: 10px 10px 30px 10px;
  51. }
  52. .project-title {
  53. font-size: 20px;
  54. line-height: 30px;
  55. color: #333;
  56. font-weight: bold;
  57. }
  58. .project-label {
  59. border: 1px solid #fd9a00;
  60. color: #fd9a00;
  61. padding: 0 8px;
  62. display: inline-block;
  63. height: 22px;
  64. line-height: 22px;
  65. font-size: 14px;
  66. margin-top: 15px;
  67. & + .project-label {
  68. margin-left: 10px;
  69. }
  70. }
  71. .project-concat {
  72. margin-top: 10px;
  73. color: #666666b2;
  74. div + div {
  75. margin-top: 10px;
  76. }
  77. }
  78. .richtext {
  79. margin-top: 15px;
  80. }
  81. ::v-deep p img {
  82. width: 100%;
  83. max-width: 100%;
  84. }
  85. img {
  86. width: 100%;
  87. }
  88. </style>