newsDetail.vue 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <div class="page_newsDetail">
  3. <div class="newsTitle">{{articles.title}}</div>
  4. <div class="msg" v-html="articles.content" v-show="articleshow"></div>
  5. <<<<<<< .mine
  6. <div class="video" v-show="videoshow">
  7. <video id="example_video_1" class="video-js vjs-default-skin"
  8. controls preload="auto" width="100%" height="100%"
  9. poster="http://video-js.zencoder.com/oceans-clip.png"
  10. data-setup='{"example_option":true}' ref="video">
  11. <source :src="articles.video_url" type='video/mp4' />
  12. </video>
  13. </div>
  14. =======
  15. <div class="video" v-show="videoshow">
  16. <video
  17. id="example_video_1"
  18. class="video-js vjs-default-skin"
  19. controls
  20. preload="auto"
  21. width="640"
  22. height="300"
  23. poster="http://video-js.zencoder.com/oceans-clip.png"
  24. data-setup="{"example_option":true}"
  25. ref="video"
  26. >
  27. <source :src="articles.video_url" type="video/mp4" />
  28. </video>
  29. </div>
  30. >>>>>>> .theirs
  31. </div>
  32. </template>
  33. <script>
  34. import { singleArticleInfo } from "@/api/micro/micro";
  35. export default {
  36. data() {
  37. return {
  38. articles: [],
  39. videoshow: false,
  40. articleshow: true
  41. };
  42. },
  43. methods: {
  44. singleArticleInfo(id, orgid) {
  45. singleArticleInfo(id, orgid).then(response => {
  46. if (response.data.state == 1) {
  47. var articles = response.data.data.articles;
  48. console.log("articles是什么", articles);
  49. this.articles = articles;
  50. if (articles.video_url != "") {
  51. this.articleshow = false;
  52. this.videoshow = true;
  53. this.$refs.video.src = articles.video_url;
  54. }
  55. }
  56. });
  57. }
  58. },
  59. created() {
  60. const id = this.$route.query.id;
  61. const orgid = this.$route.query.orgid;
  62. console.log("id是多少", id);
  63. console.log("orgid是多少", orgid);
  64. this.singleArticleInfo(id, orgid);
  65. }
  66. };
  67. </script>
  68. <style lang="scss" scoped>
  69. .page_newsDetail {
  70. overflow: hidden;
  71. height: 100%;
  72. overflow-y: auto;
  73. &::-webkit-scrollbar {
  74. width: 0;
  75. }
  76. }
  77. .newsTitle {
  78. width: 19.9375rem;
  79. height: 3.75rem;
  80. font-size: 1.25rem;
  81. font-weight: 600;
  82. color: rgba(7, 18, 40, 1);
  83. line-height: 1.875rem;
  84. margin: 1.3125rem 2.1875rem 0 1.3125rem;
  85. word-break: break-all;
  86. display: -webkit-box;
  87. -webkit-line-clamp: 2;
  88. -webkit-box-orient: vertical;
  89. overflow: hidden;
  90. }
  91. .msg {
  92. width: 21rem;
  93. min-height: 12.0625rem;
  94. font-size: 1rem;
  95. font-weight: 600;
  96. color: rgba(7, 18, 40, 1);
  97. line-height: 1.375rem;
  98. margin: 1.25rem 1.25rem 0 1.125rem;
  99. }
  100. .video{
  101. width: 100%;
  102. height: 250px;
  103. // border: solid 1px red;
  104. }
  105. </style>