video.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="video1 u-flex u-row-between u-flex-wrap">
  3. <view class="video-item" v-for="(item,index) in list" :key="index" @click="playmp4(item)">
  4. <view class="image-box">
  5. <image :src="item.logo" class="image" mode="aspectFill"></image>
  6. <image src="../../static/images/video.png" class="play" mode=""></image>
  7. <!-- <text class="text">03.25</text> -->
  8. </view>
  9. <view class="video-name u-line-1">
  10. {{item.title}}
  11. </view>
  12. <view class="time">
  13. {{item.create_at}}
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. id: '',
  23. page: 1,
  24. list: []
  25. }
  26. },
  27. onLoad(option) {
  28. this.id = option.id
  29. this.getdata()
  30. },
  31. onReachBottom() {
  32. if(this.list.length % 20 == 0){
  33. this.page++
  34. this.getdata()
  35. }
  36. },
  37. methods: {
  38. playmp4(item){
  39. uni.navigateTo({
  40. url:"/pages/video/info?mp4=" + encodeURIComponent(item.video)
  41. })
  42. },
  43. getdata() {
  44. this.$u.post('/api/Property/video_list', {
  45. id: this.id,
  46. page: this.page,
  47. page_num: 20
  48. }).then(res => {
  49. this.list = this.list.concat(res.data)
  50. })
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss">
  56. .video1 {
  57. padding: 24rpx;
  58. .video-item {
  59. width: 340rpx;
  60. margin-bottom: 18rpx;
  61. .video-name {
  62. font-size: 20rpx;
  63. font-family: PingFangSC-Regular, PingFang SC;
  64. font-weight: 400;
  65. color: #333333;
  66. margin: 14rpx 0;
  67. }
  68. .time {
  69. font-size: 20rpx;
  70. font-family: PingFangSC-Regular, PingFang SC;
  71. font-weight: 400;
  72. color: #333333;
  73. }
  74. .image-box {
  75. width: 340rpx;
  76. height: 272rpx;
  77. position: relative;
  78. .play {
  79. width: 64rpx;
  80. height: 64rpx;
  81. position: absolute;
  82. top: 50%;
  83. left: 50%;
  84. transform: translate(-50%, -50%);
  85. }
  86. .image {
  87. width: 340rpx;
  88. height: 272rpx;
  89. border-radius: 10rpx;
  90. }
  91. .text {
  92. position: absolute;
  93. z-index: 10;
  94. right: 10rpx;
  95. bottom: 10rpx;
  96. font-size: 20rpx;
  97. font-family: PingFangSC-Regular, PingFang SC;
  98. font-weight: 400;
  99. color: #FFFFFF;
  100. }
  101. }
  102. }
  103. }
  104. </style>