eduDetail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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="videoUrl" controls="controls">
  17. 您的浏览器不支持 video 标签。
  18. </video>
  19. </div>
  20. <div class="detailcontext">
  21. {{ detailinfo.content }}
  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. export default {
  32. name: 'eduDetail',
  33. props: {},
  34. components: {},
  35. data: () => {
  36. return {
  37. img: {
  38. top_bg: require('@/assets/live/top_bg.png'),
  39. logo: require('@/assets/live/logo.png'),
  40. img1: require('@/assets/live/1.jpg'),
  41. },
  42. detailinfo: {},
  43. videoUrl: require('@/assets/video.mp4'),
  44. };
  45. },
  46. created() {
  47. this.search();
  48. },
  49. methods: {
  50. ...news(['fetch']),
  51. async search() {
  52. console.log(this.id);
  53. const res = await this.fetch(this.id);
  54. this.$set(this, `detailinfo`, res.data);
  55. },
  56. },
  57. computed: {
  58. id() {
  59. return this.$route.query.id;
  60. },
  61. ...mapState(['user']),
  62. pageTitle() {
  63. return `${this.$route.meta.title}`;
  64. },
  65. },
  66. metaInfo() {
  67. return { title: this.$route.meta.title };
  68. },
  69. };
  70. </script>
  71. <style lang="less" scoped>
  72. @import '~@/style/style.css';
  73. .detailmain {
  74. margin: 15px 0 15px 0;
  75. box-shadow: 0 0 10px #2d64b3;
  76. border-radius: 10px;
  77. min-height: 800px;
  78. }
  79. .detailtop {
  80. padding: 20px 0px;
  81. font-size: 18px;
  82. line-height: 40px;
  83. font-weight: normal;
  84. text-align: left;
  85. margin: 0;
  86. text-align: center;
  87. color: #005293;
  88. }
  89. .detailtopleft {
  90. text-align: center;
  91. padding: 0 0 10px 0;
  92. border-bottom: 1px solid #ccc;
  93. font-size: 16px;
  94. color: #666666;
  95. }
  96. .detailimage {
  97. text-align: center;
  98. padding: 20px 0 0 0;
  99. }
  100. .detailVideo {
  101. float: left;
  102. width: 100%;
  103. text-align: center;
  104. height: 400px;
  105. overflow: hidden;
  106. margin: 20px 0;
  107. }
  108. .detailVideo video {
  109. height: 400px;
  110. width: 50%;
  111. border: 1px dashed #ccc;
  112. }
  113. .detailimg {
  114. width: 500px;
  115. height: 300px;
  116. }
  117. .detailcontext {
  118. padding: 20px 40px 60px 40px;
  119. }
  120. </style>