newPageEditor.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="newPageEditor">
  3. <div style="width: 100%;">
  4. <img style="width: 100%;" :src="bannerImg" alt="">
  5. </div>
  6. <div class="indexMain">
  7. <el-breadcrumb separator="/" style="margin-bottom: 8px;">
  8. <el-breadcrumb-item>首页</el-breadcrumb-item>
  9. <el-breadcrumb-item>行业资讯</el-breadcrumb-item>
  10. <el-breadcrumb-item>详情</el-breadcrumb-item>
  11. </el-breadcrumb>
  12. <!-- 直接展示富文本 -->
  13. <div style="width: 100%;" >
  14. <div>
  15. <div class="fwbtitle">{{ formData.title }}</div>
  16. <div class="fwbtitle2">
  17. {{ formData.columnIdName }}
  18. {{ formData.time }}
  19. <div v-if="formData.bodyType=='2'">{{formData.readNum}}次播放</div>
  20. </div>
  21. </div>
  22. <div v-if="formData.bodyType=='1'" v-html="formData.content" class="right">
  23. </div>
  24. <!-- 展示视频 -->
  25. <div style="display: flex;" v-if="formData.bodyType=='2'">
  26. <div>
  27. <div class="videoBox">
  28. <video id="myVideo" v-if="videoUrl!=''" style="height:100%;width: 100%;" controls>
  29. <source :src="videoUrl"
  30. type="video/mp4">
  31. <source :src="videoUrl" type="video/ogg">
  32. 您的浏览器不支持 HTML5 video 标签。
  33. </video>
  34. </div>
  35. <div style="width: 100%">
  36. <img style="width: 100%" :src="ButtonImg" alt="">
  37. </div>
  38. </div>
  39. <div style="width: 30%">
  40. <img style="width: 100%" :src="rightImg" alt="">
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div style="width: 100%;">
  46. <img style="width: 100%;" :src="bootImg" alt="">
  47. </div>
  48. </div>
  49. </template>
  50. <script setup>
  51. import { ref,onMounted, watch } from "vue";
  52. //定义路由
  53. import {useRouter,useRoute} from 'vue-router'
  54. const router=useRouter()
  55. const route=useRoute()
  56. const bannerImg = ref('/img/viewsHead.png')
  57. const bootImg = ref('/img/viewsBoot.png')
  58. const rightImg = ref('/img/viewRight.png')
  59. const ButtonImg = ref('/img/viewButton.png')
  60. const breadcrumbImg = ref('/img/viewBreadcrumb.png')
  61. const formData = ref({
  62. content:'',
  63. columnIdName:'',
  64. time:'',
  65. title:'',
  66. bodyType:'1',
  67. readNum:'18',
  68. })
  69. watch(
  70. () => route.query,
  71. async(routeQuery) => {
  72. console.log('newRouterName222222222',routeQuery)
  73. }
  74. )
  75. const videoUrl = ref('')
  76. onMounted(async() => {
  77. formData.value = JSON.parse(localStorage.getItem('formData'))
  78. videoUrl.value = formData.value.videoList[0].fileUrl
  79. });
  80. </script>
  81. <style scoped>
  82. .newPageEditor{
  83. /* overflow: hidden;
  84. width: 100vw; */
  85. }
  86. .indexMain{
  87. width: 80vw;
  88. margin: 0 auto;
  89. padding: 20px;
  90. display: flex;
  91. background-color: #fff;
  92. min-height: 300px;
  93. overflow: auto;
  94. min-width: 900px;
  95. flex-direction: column;
  96. }
  97. .right{
  98. margin-top: 20px;
  99. }
  100. .fwbtitle{
  101. font-size: 28px;
  102. text-align: left;
  103. font-weight: bold;
  104. /* height: 60px; */
  105. line-height: 60px;
  106. }
  107. .fwbtitle2{
  108. font-size: 16px;
  109. text-align: left;
  110. color: #ccc;
  111. height: 40px;
  112. line-height: 40px;
  113. }
  114. .videoBox{
  115. /* width: 70%; */
  116. height: 450px;
  117. background-color: #000;
  118. text-align: center
  119. }
  120. </style>