video.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="container">
  3. <view class="list-icon"></view>
  4. <view class="title">{{videoName}}</view>
  5. <video class="video" id="myVideo" ref="video1" :src="videoUrl"
  6. loop=true
  7. enable-danmu danmu-btn controls enable-progress-gesture show-mute-btn
  8. ></video>
  9. <!-- <view class="video"></view> -->
  10. <view class="jieshao">{{videoDescription}}</view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. videoUrl:'',//视频链接
  18. videoDescription:'',
  19. videoName:'',//视频名
  20. id:'',
  21. list:[],//当前页面数据
  22. resultDecodeN:'',//解密后
  23. token:'',//缓存token
  24. }
  25. },
  26. onLoad(option) {
  27. // this.videoUrl=option.video
  28. // this.videoDescription=option.videoDescription
  29. // this.videoName=option.videoName
  30. this.id=option.id
  31. this.token=wx.getStorageSync('token')
  32. this.getList()
  33. },
  34. methods: {
  35. getList(){
  36. this.$axios.get('/shareVideo/api/video/video',
  37. {
  38. headers:{
  39. 'token':this.token
  40. }
  41. }
  42. ).then(res => {
  43. if (res.data.success) {
  44. console.log(res.data)
  45. var shu=res.data.data
  46. // 开始解密
  47. this.resultDecodeN = this.$fns.rsaDecode(shu[0])+
  48. this.$fns.rsaDecode(shu[1])+this.$fns.rsaDecode(shu[2])+
  49. this.$fns.rsaDecode(shu[3])+this.$fns.rsaDecode(shu[4])+
  50. this.$fns.rsaDecode(shu[5])+this.$fns.rsaDecode(shu[6])+
  51. this.$fns.rsaDecode(shu[7])+this.$fns.rsaDecode(shu[8])+
  52. this.$fns.rsaDecode(shu[9])
  53. //解析
  54. console.log(JSON.parse(this.resultDecodeN));
  55. //获取数组
  56. JSON.parse(this.resultDecodeN).forEach(data => {
  57. this.list.push(data)
  58. })
  59. var length=JSON.parse(this.resultDecodeN).length
  60. //根据id判断
  61. for(var i=0;i<length;i++){
  62. console.log(this.list[i].id)
  63. if(this.id==this.list[i].id){
  64. this.videoUrl=this.list[i].videoUrl
  65. this.videoDescription=this.list[i].videoDescription
  66. this.videoName=this.list[i].videoName
  67. }
  68. }
  69. } else {
  70. uni.showToast({ title: res.data.message, icon: 'none' });
  71. }
  72. }).catch(res =>{
  73. });
  74. },
  75. }
  76. }
  77. </script>
  78. <style>
  79. .container {
  80. /* padding: 10px 20px 20px 15px; */
  81. font-size: 16px;
  82. line-height: 24px;
  83. background-image: url('../../static/video_bg.png');
  84. width: 749rpx;
  85. height: 1211rpx;
  86. background-size: 100%;
  87. }
  88. .list-icon{
  89. position: absolute;
  90. margin-left: 120rpx;
  91. margin-top: 203px;
  92. width: 8rpx;
  93. height: 32rpx;
  94. opacity: 1;
  95. border-radius: 33rpx;
  96. background: #1682AA;
  97. }
  98. .title{
  99. font-size: 22px;
  100. position: absolute;
  101. margin-left: 141rpx;
  102. margin-top: 382rpx;
  103. font-size: 34rpx;
  104. font-family: Microsoft YaHei-3970(82674968);
  105. font-weight: 400;
  106. color: #1682AA;
  107. }
  108. .video{
  109. position: absolute;
  110. margin-left: 121rpx;
  111. margin-top: 439rpx;
  112. width: 506rpx;
  113. height: 347rpx;
  114. }
  115. .jieshao{
  116. position: absolute;
  117. margin-left: 121rpx;
  118. margin-top: 809rpx;
  119. }
  120. </style>