videoPlay.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="body">
  3. <view class="top_bg">
  4. <topBox></topBox>
  5. <view @click="backBtn" class="back">⬅返回上一级</view>
  6. </view>
  7. <view class="vdo_box">
  8. <video style="width: 80%; height: 70%" id="myVideo" :src="list.video" autoplay loop="true" controls></video>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. let that;
  14. export default {
  15. data() {
  16. return { list: [] };
  17. },
  18. onLoad(o) {
  19. console.log(o.id, '是朋友');
  20. that = this;
  21. this.getContentDetails(o);
  22. },
  23. methods: {
  24. // 详情
  25. getContentDetails(o) {
  26. this.$api.getContentDetails(
  27. {
  28. main_body_id: 5,
  29. id: o.id
  30. },
  31. function (res) {
  32. that.list = res.data;
  33. console.log(that.list, 'list');
  34. }
  35. );
  36. },
  37. backBtn() {
  38. uni.navigateBack({
  39. delta: 1
  40. });
  41. }
  42. }
  43. };
  44. </script>
  45. <style>
  46. .body {
  47. width: 100%;
  48. height: 100vh;
  49. background: url('/static/img/image5.png') no-repeat center;
  50. background-size: 100% 100%;
  51. background-attachment: fixed;
  52. position: fixed;
  53. }
  54. /deep/.uni-video-container {
  55. background-color: transparent !important;
  56. }
  57. /deep/.uni-video-cover {
  58. background-color: transparent !important;
  59. }
  60. .vdo_box {
  61. width: 100%;
  62. height: 100%;
  63. margin-top: 12%;
  64. margin-left: 10%;
  65. }
  66. .top_bg {
  67. width: 100%;
  68. /* height: 300rpx; */
  69. position: absolute;
  70. /* font-size: 48rpx; */
  71. color: #ffffff;
  72. /* letter-spacing: 0.1em; */
  73. background: linear-gradient(10deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2) 100%);
  74. }
  75. .back {
  76. width: 15%;
  77. height: 5%;
  78. margin-left: 5%;
  79. margin-top: -2%;
  80. cursor: pointer;
  81. font-size: 12px;
  82. color: #ffffff;
  83. letter-spacing: 0.3em;
  84. }
  85. </style>