LivePage.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <el-row class="movie-list">
  3. <el-col :md="15">
  4. <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
  5. <el-card class="box-card">
  6. <div slot="header" class="clearfix">
  7. <el-row>
  8. <h3 v-html="video.title" />
  9. </el-row>
  10. <el-row style="color: #999;font-size: 16px;padding-top: 0px;">
  11. <span><i class="el-icon-video-play">{{ video.view }}</i></span>
  12. </el-row>
  13. </div>
  14. <div class="text item">
  15. <live-player :video-prop="video"/>
  16. </div>
  17. </el-card>
  18. </el-row>
  19. <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
  20. <el-card class="box-card">
  21. <div slot="header" class="clearfix">
  22. <div class="video-data-row">
  23. <el-button
  24. type="danger"
  25. size="mini"
  26. icon="el-icon-collection"
  27. :disabled="isCollected"
  28. @click="collection(video.videoId)"
  29. >
  30. <span>收藏 {{ video.favorite }}</span>
  31. </el-button>
  32. <el-button
  33. type="danger"
  34. size="mini"
  35. icon="el-icon-thumb"
  36. :disabled="isCollected"
  37. @click="collection(video.videoId)"
  38. >
  39. <span>喜欢 {{ video.thumbUp }}</span>
  40. </el-button>
  41. <el-button
  42. type="danger"
  43. size="mini"
  44. icon="el-icon-share"
  45. :disabled="isCollected"
  46. @click="collection(video.videoId)"
  47. >
  48. <span>分享 {{ video.share }}</span>
  49. </el-button>
  50. <el-button
  51. type="danger"
  52. size="mini"
  53. icon="el-icon-download"
  54. @click="getDownloadUrl(video.videoId)"
  55. >
  56. <span>下载</span>
  57. </el-button>
  58. </div>
  59. </div>
  60. <div class="text item">
  61. <!--视频描述行-->
  62. <span class="description" v-html="video.description"/>
  63. </div>
  64. </el-card>
  65. </el-row>
  66. </el-col>
  67. <el-col :md="9">
  68. <el-row>
  69. <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
  70. <user-avatar-card :userAvatar="user" />
  71. </el-row>
  72. <el-row v-if="showPlaylist" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
  73. <el-card class="box-card">
  74. <div slot="header" class="clearfix">
  75. <el-row>
  76. <h3>播放列表</h3>
  77. </el-row>
  78. <el-row>
  79. <span>自动播放 <el-switch v-model="autoPlay"/></span>
  80. </el-row>
  81. </div>
  82. <div class="text item">
  83. <el-table
  84. :data="similarVideos"
  85. style="width: 100%"
  86. >
  87. <el-table-column
  88. prop="title">
  89. <template slot-scope="scope">
  90. <router-link target="_blank" :to="`/video/${scope.row.videoId}`">
  91. <span>{{scope.row.videoId}}</span>
  92. </router-link>
  93. </template>
  94. </el-table-column>
  95. <el-table-column
  96. prop="coverUrl">
  97. <template slot-scope="scope">
  98. <span>10:00</span>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. </div>
  103. </el-card>
  104. </el-row>
  105. <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
  106. <el-card class="box-card">
  107. <div slot="header" class="clearfix">
  108. <el-row>
  109. <h3>推荐直播</h3>
  110. </el-row>
  111. </div>
  112. <div class="text item">
  113. <el-row v-for="(item,index) in similarVideos" :key="index" class="item">
  114. <video-card :video="item" />
  115. </el-row>
  116. </div>
  117. </el-card>
  118. </el-row>
  119. </el-row>
  120. </el-col>
  121. </el-row>
  122. </template>
  123. <script>
  124. import LivePlayer from 'components/LivePlayer'
  125. import Comment from 'components/comment/Comment'
  126. import VideoCard from 'components/card/VideoCard'
  127. import UserAvatarCard from '@/components/card/UserAvatarCard'
  128. export default {
  129. name: 'LivePage',
  130. components: { Comment, VideoCard, LivePlayer, UserAvatarCard },
  131. data() {
  132. return {
  133. video: {
  134. videoId: 'jk1024',
  135. title: '我的直播',
  136. description: '我的直播',
  137. view: 10,
  138. favorite: 10,
  139. },
  140. user: {
  141. userId: 10001,
  142. screenName: '浩',
  143. avatarUrl: '',
  144. following: 1024,
  145. follower: 1024,
  146. },
  147. videoProp: {
  148. info: null,
  149. autoPlay: false,
  150. playlist: []
  151. },
  152. similarVideos: [],
  153. isCollected: false,
  154. showErrorReportDialog: false,
  155. errorReportForm: {
  156. videoId: null,
  157. errorCode: null
  158. },
  159. showPlaylist: false,
  160. autoPlay: false,
  161. }
  162. },
  163. watch: {
  164. // 地址栏 url 发生变化时重新加载本页面
  165. $route(){
  166. this.$router.go()
  167. }
  168. },
  169. created() {
  170. const id = this.$route.params.id
  171. },
  172. methods: {
  173. // 用户点击收藏
  174. collection(videoId) {
  175. },
  176. getDownloadUrl(videoId) {
  177. },
  178. }
  179. }
  180. </script>
  181. <style scoped>
  182. /*处于手机屏幕时*/
  183. @media screen and (max-width: 768px) {
  184. .movie-list {
  185. padding-top: 8px;
  186. padding-left: 0.5%;
  187. padding-right: 0.5%;
  188. }
  189. }
  190. .movie-list {
  191. padding-top: 15px;
  192. padding-left: 5%;
  193. padding-right: 5%;
  194. }
  195. .clearfix:before,
  196. .clearfix:after {
  197. display: table;
  198. content: "";
  199. }
  200. .clearfix:after {
  201. clear: both;
  202. }
  203. </style>