CommentVideo.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <div class="video-page">
  3. <!--<div class="video-title">
  4. <h3 class="video-title-h3">12月03日直播</h3>
  5. </div>-->
  6. <div class="video-info">
  7. <div class="comment-video-src">
  8. <div>
  9. <p style=" font-size: 14px; margin-bottom: 20px;"><span class="title-header">标题 : <span class="title-content">创新实验室(学科教室)课例20190508直播</span></span> <span class="title-header">主讲人 : 林燕<span class="title-content"></span></span> <span class="liveStatus">播放成功</span></p>
  10. </div>
  11. <video-player class="video-player-box" style="width:800px;"
  12. ref="videoPlayer"
  13. :options="playerOptions"
  14. :playsinline="true">
  15. </video-player>
  16. <p class="average-score">作品当前平均分 : <span>未评</span></p>
  17. </div>
  18. <div class="comment-video-detail-info">
  19. <Tabs value="name1">
  20. <TabPane label="观课评论" name="name1">
  21. <div class="review-pane">
  22. <div class="review-list" v-for="(item,index) in commmentList" :key="index">
  23. <span class="reviewlist-title">
  24. {{item.employeeName}} :&nbsp;
  25. </span> <span class="reviewlist-content"><span>{{item.content}}</span> <span class="reviewlist-time">({{item.createTimeTip}})</span> <!----></span>
  26. </div>
  27. </div>
  28. <div style="position: relative; padding-top: 20px;"><div class="lastest-comment" style="display: none;">查看最新评论</div> <textarea placeholder="发表您的评论" maxlength="250" class="publish-review"></textarea> <span class="submit-review">提交</span></div>
  29. </TabPane>
  30. <TabPane label="专家点评" name="name2">专家点评</TabPane>
  31. </Tabs>
  32. </div>
  33. </div>
  34. <div class="video-other" style="display:none;">
  35. <h3 class="video-title-h3">推荐作品</h3>
  36. </div>
  37. <div class="videos-wrap" style="display:none;">
  38. <div class="video-item" v-for="(item , index) in videos" @click="showVideo(index)">
  39. <img src="../../assets/image/default-act.png" width="95%" />
  40. <p>{{item.title}}</p>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. import rewardList from '@/static/rewardList.json'
  47. import CList from '@/static/commentList.json'
  48. import"videojs-contrib-hls.js/src/videojs.hlsjs"
  49. export default {
  50. data() {
  51. return {
  52. playerOptions: {
  53. playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
  54. autoplay: false, //如果true,浏览器准备好时开始回放。
  55. controls: true, //控制条
  56. preload: 'auto', //视频预加载
  57. muted: false, //默认情况下将会消除任何音频。
  58. loop: false, //导致视频一结束就重新开始。
  59. language: 'zh-CN',
  60. aspectRatio: '16:9', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
  61. fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
  62. sources: [{
  63. type: 'application/x-mpegURL',
  64. src: 'https://teammodelstorage.blob.core.chinacloudapi.cn/teammodelcontest/20190517/demo/2019.m3u8'
  65. }],
  66. poster: "http://static.smartisanos.cn/pr/img/video/video_03_cc87ce5bdb.jpg", //你的封面地址
  67. width: document.documentElement.clientWidth,
  68. notSupportedMessage: '此视频暂无法播放,请稍后再试' //允许覆盖Video.js无法播放媒体源时显示的默认信息。
  69. },
  70. routerData: {},
  71. rewardDatas: [],
  72. commmentList:[],
  73. videos: [
  74. {
  75. title:'12月14日直播'
  76. },
  77. {
  78. title:'12月14日直播'
  79. },
  80. {
  81. title:'12月14日直播'
  82. },
  83. {
  84. title:'12月14日直播'
  85. },
  86. {
  87. title:'12月14日直播'
  88. },
  89. {
  90. title:'12月14日直播'
  91. },
  92. {
  93. title:'12月14日直播'
  94. },
  95. {
  96. title:'12月14日直播'
  97. }
  98. ]
  99. }
  100. },
  101. methods: {
  102. showVideo(index) {
  103. //alert(index);
  104. this.$router.push(
  105. {
  106. name: 'video',
  107. query: {
  108. rewardIndex: index
  109. }
  110. }
  111. );
  112. }
  113. },
  114. mounted() {
  115. let index = this.$route.query.rewardIndex;
  116. //alert(index);
  117. this.commmentList = CList.list;
  118. this.rewardDatas = rewardList.data.list;
  119. if (index == undefined) {
  120. this.routerData = this.rewardDatas[0];
  121. } else {
  122. this.routerData = this.rewardDatas[index];
  123. }
  124. },
  125. watch: {
  126. $route() {
  127. let index = this.$route.query.rewardIndex;
  128. //alert(index);
  129. if (index == undefined) {
  130. this.routerData = this.rewardDatas[0];
  131. } else {
  132. this.routerData = this.rewardDatas[index];
  133. }
  134. }
  135. }
  136. }
  137. </script>
  138. <style>
  139. .video-page {
  140. width: 1200px;
  141. margin: 100px auto;
  142. font-family:none;
  143. }
  144. .video-title {
  145. margin-bottom: 20px;
  146. height: 20px;
  147. }
  148. .video-title-h3 {
  149. height: 20px;
  150. font-size: 20px;
  151. line-height: 20px;
  152. border-left: 6px solid #37b1fa;
  153. padding-left: 12px;
  154. }
  155. .video-info {
  156. width: 100%;
  157. display: table;
  158. }
  159. .comment-video-detail-info {
  160. width:400px;
  161. background:#ffffff;
  162. display:table-cell;
  163. vertical-align:top;
  164. padding:20px 10px 20px 30px;
  165. position:relative;
  166. border-left: 15px solid rgb(252,252,252);
  167. }
  168. .comment-video-detail-info .ivu-form-item {
  169. margin-bottom:8px;
  170. }
  171. .comment-video-detail-info .ivu-form .ivu-form-item-label {
  172. font-size:14px;
  173. color:#999999;
  174. }
  175. .comment-video-detail-info .ivu-form-item-content {
  176. font-size: 14px;
  177. color: #ffffff;
  178. }
  179. .comment-video-src {
  180. display:table-cell;
  181. width:780px;
  182. box-sizing:border-box;
  183. padding:20px 20px;
  184. background:#FFFFFF;
  185. }
  186. .download-video {
  187. text-align:center;
  188. position:absolute;
  189. width:100%;
  190. bottom:20px;
  191. left:0;
  192. }
  193. .video-other {
  194. margin-top:20px;
  195. }
  196. .videos-wrap {
  197. margin:0px -10px 0px -10px;
  198. }
  199. .video-item {
  200. width: 25%;
  201. display: inline-block;
  202. padding: 0px 10px;
  203. margin-top:20px;
  204. cursor:pointer;
  205. }
  206. .video-item p {
  207. font-size: 16px;
  208. color: #000;
  209. margin-top: 10px;
  210. text-decoration: none;
  211. text-indent: 8px;
  212. }
  213. .title-header {
  214. color: #666;
  215. margin-right: 30px;
  216. display: inline-block;
  217. }
  218. .liveStatus {
  219. color: #33aafe;
  220. float: right;
  221. }
  222. .review-pane {
  223. height: 300px;
  224. background-color: #fff;
  225. overflow-y: auto;
  226. position: relative;
  227. }
  228. .review-list {
  229. overflow: hidden;
  230. font-size: 14px;
  231. margin: 8px 10px;
  232. padding-bottom: 8px;
  233. border-bottom: 1px solid #f6f6f6;
  234. }
  235. .reviewlist-title {
  236. float: left;
  237. width: 22%;
  238. color: #999;
  239. text-align: right;
  240. padding-right: 5px;
  241. }
  242. .reviewlist-content {
  243. float: left;
  244. color: #444;
  245. width: 76%;
  246. font-size: 14px;
  247. word-break: break-all;
  248. }
  249. .lastest-comment {
  250. position: absolute;
  251. top: -5px;
  252. right: 20px;
  253. padding: 5px;
  254. color: #666;
  255. z-index: 999;
  256. cursor: pointer;
  257. }
  258. .publish-review {
  259. padding: 10px;
  260. background-color: #f1f2f3;
  261. border: 1px solid #d7d8da;
  262. font-size: 14px;
  263. color: #333;
  264. width: 100%;
  265. height: 100px;
  266. resize: none;
  267. outline: none;
  268. box-sizing: border-box;
  269. }
  270. .submit-review {
  271. margin-top: 8px;
  272. color: #fff;
  273. background-color: #409eff;
  274. border-color: #409eff;
  275. margin-right: 10px;
  276. display: inline-block;
  277. float: right;
  278. cursor: pointer;
  279. width: 45px;
  280. text-align: center;
  281. height: 22px;
  282. line-height: 22px;
  283. border-radius: 2px;
  284. }
  285. .reviewlist-time {
  286. font-size: 12px;
  287. color: #ccc;
  288. }
  289. .average-score {
  290. margin-top: 20px;
  291. color: #666;
  292. font-size: 14px;
  293. }
  294. .average-score span {
  295. color: #fd8f45;
  296. }
  297. </style>