index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <div class="wake-up-page">
  3. <head-component :headinfo=headinfo></head-component>
  4. <div class="page-content">
  5. <div class="content-box">
  6. <div class="box-main">
  7. <div class="box-item" v-for="(item,index) in cinemaData">
  8. <div class="video-left" @click="playVideo(item.filmPath,item.name)">
  9. <img :src= "`${baseUrl}`+ item.picPath" />
  10. <img class="pause" src="@/assets/images/wakeup/pause.png" />
  11. </div>
  12. <div class="video-right">
  13. <p class="title">{{item.name}}</p>
  14. <div class="text-box">
  15. <p class="text" v-html="item.introduce">
  16. </p>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <!-- <div class="content-bottom">-->
  23. <!-- <div class="draw draggable-ball" @mousedown="startDrag" :style="{ left: position.x + 'px', top: position.y + 'px' }">-->
  24. <!-- <img src="@/assets/images/wakeup/float-box.png" />-->
  25. <!-- </div>-->
  26. <!-- <div class="ai-rabit">-->
  27. <!-- <div class="ai-rabit-text">-->
  28. <!-- 你好,同学欢迎进入生涯学习系统-->
  29. <!-- </div>-->
  30. <!-- <img src="@/assets/images/wakeup/ai-rabit.png" />-->
  31. <!-- </div>-->
  32. <!-- </div>-->
  33. </div>
  34. <el-dialog
  35. v-model="centerDialogVisible"
  36. destroy-on-close
  37. :title="videoName"
  38. width="1832px"
  39. height="915px"
  40. center
  41. @before-close="dialogBeforeClose"
  42. align-center
  43. >
  44. <div class="video-content">
  45. <video ref="videoPlayer" video preload="auto" autoplay muted controls width="1798" height="900" >
  46. <source :src="`${videoPath}`" type="video/ogg">
  47. </video>
  48. </div>
  49. </el-dialog>
  50. </div>
  51. </template>
  52. <script setup>
  53. import { reactive, onMounted } from 'vue';
  54. import {cinemaList} from "@/api/xjc-integratedmachine/wakeup/index.js";
  55. import headComponent from '@/views/xjc-integratedmachine/components/head_component.vue'
  56. const router = useRouter()
  57. const headinfo = ref({})
  58. const cinemaData = ref({})
  59. const baseUrl = ref('https://www.shengyazhidao.com')
  60. const centerDialogVisible = ref(false)
  61. const videoPlayer = ref(null);
  62. const videoPath = ref(null);
  63. const videoName = ref(null);
  64. // const isDragging = ref(false)
  65. const offset = ref({ x: 0, y: 0 })
  66. const startX = ref(0)
  67. const startY = ref(0)
  68. function setHeadinfo(){
  69. headinfo.value = {
  70. title: '生涯影院',
  71. user: {
  72. avatar: '头像路径',
  73. nickName: '张三'
  74. },
  75. backUrl : '/xjc-integratedmachine/wakeup/index'
  76. }
  77. }
  78. function jumpTo(path) {
  79. router.push({
  80. path: path,
  81. query: {name: 123}
  82. })
  83. }
  84. onMounted(() => {
  85. getCinemaList();
  86. setHeadinfo();
  87. })
  88. //请求页面数据
  89. function getCinemaList() {
  90. cinemaList().then(res => {
  91. console.log("res",res)
  92. cinemaData.value = res.cinemaList;
  93. console.log("cinemaData.value",cinemaData.value)
  94. }).catch((err)=>{
  95. console.log("error")
  96. })
  97. }
  98. function playVideo(filmPath,name) {
  99. console.log("filmPath",filmPath)
  100. centerDialogVisible.value = true;
  101. console.log("filmPath",filmPath)
  102. videoPath.value = filmPath
  103. videoName.value = name
  104. // console.log("videoPlayer",videoPlayer.value.play);
  105. // if (videoPlayer.value) {
  106. // videoPlayer.value.play(); // 暂停视频
  107. // }
  108. }
  109. function dialogBeforeClose(){
  110. videoPath.value = null;
  111. }
  112. </script>
  113. <style scoped lang="scss">
  114. p{
  115. margin: 0;
  116. padding: 0;
  117. }
  118. .wake-up-page{
  119. background: url('@/assets/images/login/login-home-background.png') no-repeat;
  120. background-size: 1920px 1080px;
  121. z-index:10;
  122. width: 100%;
  123. height: 1080px;
  124. .page-content{
  125. width: 100%;
  126. position: absolute;
  127. top: 123px;
  128. bottom: 0;
  129. .content-box{
  130. width: 1832px;
  131. height:910px;
  132. background: #FFFFFF;
  133. background: rgba(255,255,255,0.2);
  134. border-radius: 35px 35px 35px 35px;
  135. margin: 0 auto;
  136. .box-main{
  137. width: 1810px;
  138. height:850px;
  139. overflow:auto;
  140. margin-left: 26px;
  141. scrollbar-color: #D9D9D9 #9feafa0f;
  142. scrollbar-width: thin;
  143. .box-item{
  144. margin-top: 29px;
  145. width: 1786px;
  146. height: 487px;
  147. background: white;
  148. border-radius: 35px 35px 35px 35px;
  149. display: flex;
  150. justify-content: space-around;
  151. margin-bottom: 20px;
  152. .video-left{
  153. width: 300px;
  154. height: 418px;
  155. //border: 1px solid;
  156. margin-top: 25px;
  157. position: relative;
  158. img{
  159. width: 300px;
  160. height: 418px;
  161. }
  162. .pause{
  163. width:146px;
  164. height:146px;
  165. position: absolute;
  166. top: 131px;
  167. left: 72px;
  168. }
  169. }
  170. .video-right{
  171. width: 1395px;
  172. height: 314px;
  173. .text-box{
  174. overflow:auto;
  175. scrollbar-color: #D9D9D9 #9feafa0f;
  176. scrollbar-width: thin;
  177. height: 314px;
  178. //border: 1px solid;
  179. .text{
  180. text-indent: 2em;
  181. font-weight: 400;
  182. font-size: 30px;
  183. color: #333333;
  184. line-height: 42px;
  185. }
  186. }
  187. .title{
  188. font-weight: bold;
  189. font-size: 32px;
  190. color: #333333;
  191. line-height: 52px;
  192. margin-top: 38px;
  193. }
  194. }
  195. }
  196. .box-item{
  197. scrollbar-color: #9be9fa #ffffff;
  198. }
  199. }
  200. }
  201. }
  202. .video-content{
  203. width: 1798px;
  204. height: 915px;
  205. //border: 1px solid;
  206. //background: pink;
  207. z-index:10;
  208. }
  209. ::v-deep .el-dialog__header{
  210. height: 60px;
  211. }
  212. ::v-deep .el-dialog__title{
  213. font-size: 30px;
  214. font-weight: bold;
  215. line-height: 50px;
  216. }
  217. }
  218. </style>