play2.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="view">
  3. <view class="top es es-ac es-h-80" :style="'top:'+top+'px'">
  4. <image src="/static/images/other/ret-white.png" @tap="close"></image>
  5. <view class="es-ml-40"><text class="es-c-white es-fw-500 es-fs-34">名字</text></view>
  6. </view>
  7. <view class="center es es-ac es-pc">
  8. <view class="es-icon-52 es-icon-play-last"></view>
  9. <view class="es-icon-88 es-icon-play-stop es-ml-30 es-mr-30"></view>
  10. <view class="es-icon-52 es-icon-play-next"></view>
  11. </view>
  12. <view class="bottom">
  13. <view class="es-view-w-x">
  14. <view class="es es-fs-22 es-c-white">
  15. <view class="">00:37</view>
  16. <view class="es-p-r load-con es-f1 es-h-30 es-ml-12 es-mr-12">
  17. <view class="es es-ac">
  18. <view class="es-h-4 es-f1 es-br"></view>
  19. </view>
  20. <view class="es es-ac">
  21. <view class="es-h-4 es-br es-p-r" :style="'width: '+video.percent+'%;'"></view>
  22. </view>
  23. <view class="es es-ac">
  24. <view :style="'width: '+video.percent+'%;'"></view>
  25. <view class="white-bloack"></view>
  26. </view>
  27. </view>
  28. <view class="">00:37</view>
  29. </view>
  30. <view class="es-pt-40 es es-fs-22 es-c-white">
  31. <view class="es es-ver es-ac es-pc es-mr-50">
  32. <view class="es-icon-41 es-icon-play-1"></view>
  33. <view class="">写评论</view>
  34. </view>
  35. <view class="es es-ver es-ac es-pc es-mr-50">
  36. <view class="es-icon-41 es-icon-play-2"></view>
  37. <view class="">收藏</view>
  38. </view>
  39. <view class="es es-ver es-ac es-pc es-mr-50">
  40. <view class="es-icon-41 es-icon-play-3"></view>
  41. <view class="">分享</view>
  42. </view>
  43. <view class="es es-ac es-pc es-mr-50">
  44. <view class="es-icon-33 es-w-63 es-icon-play-dan"></view>
  45. </view>
  46. <view class="es es-ac">
  47. <view class="es-f1 es-h-40 es-bc-white es-br" style="width: 400rpx;">
  48. <text class="es-c-99 es-ml-30">发个弹幕见证下</text>
  49. </view>
  50. </view>
  51. <view class="es-f1"></view>
  52. <view class="es-fs-28 es es-ac">
  53. <text>选集</text>
  54. <text class="es-ml-30">4K·全网独家</text>
  55. </view>
  56. </view>
  57. <view class="es-pt-41 es-auto-bottom"></view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. top: 0,
  67. video: {
  68. percent: 10,
  69. }
  70. }
  71. },
  72. onLoad(options) {
  73. console.log('play2',options);
  74. this.spin(1);
  75. setTimeout(e=>{
  76. uni.$emit('initVideo')
  77. },150)
  78. },
  79. onUnload: function() {
  80. },
  81. methods: {
  82. // 1-横屏 2-恢复
  83. spin:function(type=1){
  84. if(type == 1)
  85. {
  86. //满足条件转换为横屏
  87. setTimeout(e => {
  88. //#ifdef APP-PLUS
  89. plus.screen.lockOrientation("landscape-primary");
  90. //#endif
  91. uni.getSystemInfo({
  92. success: (res) => {
  93. this.top = res.safeArea.top;
  94. }
  95. });
  96. })
  97. }else{
  98. //#ifdef APP-PLUS
  99. plus.screen.lockOrientation('portrait-primary');
  100. //#endif
  101. }
  102. },
  103. close: function() {
  104. console.log('关闭页面');
  105. // uni.navigateBack();
  106. // uni.navigateTo({
  107. // url:'/pages/course/video/playClose'
  108. // })
  109. this.view = false;
  110. uni.redirectTo({
  111. url: '/pages/course/video/playClose'
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style>
  118. page {
  119. background-color: rgba(0, 0, 0, 0);
  120. }
  121. .view {
  122. width: 100%;
  123. height: 100%;
  124. position: fixed;
  125. left: 0;
  126. top: 0;
  127. /* background-color: #000; */
  128. }
  129. video {
  130. width: 100%;
  131. height: 100%;
  132. }
  133. .top {
  134. position: absolute;
  135. top: 0;
  136. left: 0;
  137. z-index: 2;
  138. }
  139. .top image {
  140. width: 18rpx;
  141. height: 31rpx;
  142. margin-left: 30rpx;
  143. }
  144. .bottom {
  145. position: absolute;
  146. left: 0;
  147. bottom: 0;
  148. width: 100%;
  149. z-index: 2;
  150. /* background-color: red; */
  151. }
  152. .load-con>view {
  153. position: absolute;
  154. left: 0;
  155. top: 0;
  156. height: 30rpx;
  157. width: 100%;
  158. }
  159. .load-con>view:nth-child(1)>view {
  160. background-color: rgba(255, 255, 255, 0.3);
  161. }
  162. .load-con>view:nth-child(2)>view {
  163. background-color: #FC8957;
  164. }
  165. .white-bloack {
  166. background-color: #F45510;
  167. width: 24rpx;
  168. height: 10rpx;
  169. margin-left: -12rpx;
  170. border-radius: 100rpx;
  171. box-shadow: 2px 6px 10px 0px rgba(153, 153, 153, 0.22);
  172. }
  173. .center {
  174. width: 100%;
  175. height: 100%;
  176. position: fixed;
  177. position: absolute;
  178. left: 0;
  179. top: 0;
  180. z-index: 1;
  181. }
  182. .es-icon-play-1 {
  183. background-image: url(/static/images/other/video/1.png);
  184. }
  185. .es-icon-play-2 {
  186. background-image: url(/static/images/other/video/2.png);
  187. }
  188. .es-icon-play-3 {
  189. background-image: url(/static/images/other/video/3.png);
  190. }
  191. .es-icon-play-last {
  192. background-image: url(/static/images/other/video/play-last.png);
  193. }
  194. .es-icon-play-stop {
  195. background-image: url(/static/images/other/video/play-stop.png);
  196. }
  197. .es-icon-play-next {
  198. background-image: url(/static/images/other/video/play-next.png);
  199. }
  200. .es-icon-play-dan {
  201. background-image: url(/static/images/other/video/dan.png);
  202. }
  203. </style>