e-video.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view>
  3. <view class="videoList">
  4. <view class="title">{{videoList[0].title}}</view>
  5. <view class="list">
  6. <!-- <view class="item" v-for="item in videoList" :key="item.id">
  7. <view class="name">{{item.videoName}}</view>
  8. <view class="icon" @click="detail(item.videoUrl,item.videoName)">
  9. <uni-icons type="videocam" size="24" color="#009FE8"></uni-icons>
  10. </view>
  11. </view> -->
  12. <view class="item" v-for="item in videoList" :key="item.id" v-if="item.videoUrl != ''">
  13. <video :poster="poster[poster_index]" :src="item.videoUrl" controls object-fit="fill" style="width: 100%;"></video>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props:[
  22. "videoList"
  23. ],
  24. data() {
  25. return {
  26. poster:[
  27. "https://img1.baidu.com/it/u=574276659,2777898124&fm=253&fmt=auto&app=138&f=JPEG?w=550&h=364"
  28. ],
  29. poster_index:0
  30. };
  31. },
  32. mounted() {
  33. // this.poster_index = Math.floor(Math.random()*10)
  34. // console.log(this.poster_index)
  35. },
  36. methods:{
  37. detail(path,name){
  38. console.log(path)
  39. uni.navigateTo({
  40. url:"../../index/record/record-video/record-video?name=" + name + "&url=" + path
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss">
  47. .videoList{
  48. .title{
  49. line-height: 30px;
  50. border-left: 4px solid #009FE8;
  51. border-radius: 4px;
  52. padding-left: 10px;
  53. margin-bottom: 10px;
  54. }.list{
  55. .item{
  56. // padding: 20rpx 25rpx;
  57. // border-bottom: 1rpx solid #f4f4f4;
  58. margin-bottom: 20rpx;
  59. border-radius: 14rpx;
  60. overflow: hidden;
  61. display: flex;
  62. justify-content: space-between;
  63. .name{
  64. white-space: nowrap;
  65. overflow: hidden;
  66. text-overflow:ellipsis;
  67. }
  68. .icon{
  69. padding-left: 50rpx;
  70. }
  71. }
  72. }
  73. }
  74. </style>