luyanDetail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div id="eduDetail" style="background-color: #F5F5F54f;">
  3. <div class="w_0100">
  4. <div class="w_1200">
  5. <div class="detailmain">
  6. <div class="detailtop">
  7. <span>{{ detailinfo.title }}</span>
  8. </div>
  9. <div class="detailtopleft">
  10. <span>时间:{{ detailinfo.publish_time }}&nbsp;&nbsp;&nbsp;&nbsp;来源:{{ detailinfo.orgin }}</span>
  11. </div>
  12. <div class="detailimage" v-if="detailinfo.picture">
  13. <img :src="detailinfo.picture" class="detailimg" />
  14. </div>
  15. <div class="detailVideo">
  16. <video :src="detailinfo.filepath" controls="controls">
  17. 您的浏览器不支持 video 标签。
  18. </video>
  19. </div>
  20. <div class="detailcontext">
  21. <p v-html="detailinfo.content"></p>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import { mapState, createNamespacedHelpers } from 'vuex';
  30. const { mapActions: news } = createNamespacedHelpers('news');
  31. const { mapActions: newsroadshow } = createNamespacedHelpers('newsroadshow');
  32. export default {
  33. name: 'eduDetail',
  34. props: {
  35. newsid: null,
  36. },
  37. components: {},
  38. data: () => {
  39. return {
  40. img: {
  41. top_bg: require('@/assets/live/top_bg.png'),
  42. logo: require('@/assets/live/logo.png'),
  43. img1: require('@/assets/live/1.jpg'),
  44. },
  45. detailinfo: {},
  46. videoUrl: require('@/assets/video.mp4'),
  47. };
  48. },
  49. created() {
  50. this.search();
  51. },
  52. methods: {
  53. ...newsroadshow(['fetch']),
  54. async search() {
  55. const res = await this.fetch(this.newsid);
  56. this.$set(this, `detailinfo`, res.data);
  57. },
  58. },
  59. computed: {
  60. id() {
  61. return this.$route.query.id;
  62. },
  63. ...mapState(['user']),
  64. pageTitle() {
  65. return `${this.$route.meta.title}`;
  66. },
  67. },
  68. metaInfo() {
  69. return { title: this.$route.meta.title };
  70. },
  71. };
  72. </script>
  73. <style lang="less" scoped>
  74. @import '~@/style/style.css';
  75. .w_1200 {
  76. width: 95%;
  77. margin: 0 auto;
  78. }
  79. .detailmain {
  80. min-height: 500px;
  81. }
  82. .detailtop {
  83. padding: 20px 0px;
  84. font-size: 18px;
  85. line-height: 40px;
  86. font-weight: normal;
  87. text-align: left;
  88. margin: 0;
  89. text-align: center;
  90. color: #005293;
  91. }
  92. .detailtopleft {
  93. text-align: center;
  94. padding: 0 0 10px 0;
  95. border-bottom: 1px solid #ccc;
  96. font-size: 16px;
  97. color: #666666;
  98. }
  99. .detailimage {
  100. text-align: center;
  101. padding: 20px 0 0 0;
  102. }
  103. .detailVideo {
  104. float: left;
  105. width: 100%;
  106. text-align: center;
  107. height: 400px;
  108. overflow: hidden;
  109. margin: 20px 0;
  110. }
  111. .detailVideo video {
  112. height: 400px;
  113. width: 50%;
  114. border: 1px dashed #ccc;
  115. }
  116. .detailimg {
  117. width: 500px;
  118. height: 300px;
  119. }
  120. .detailcontext {
  121. padding: 20px 0;
  122. }
  123. </style>