video.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. import { mapState } from "vuex"
  20. export default {
  21. data() {
  22. return {
  23. id: '',
  24. page: 1,
  25. list: []
  26. }
  27. },
  28. onLoad(option) {
  29. this.id = option.id
  30. this.getdata()
  31. },
  32. computed: {
  33. ...mapState(['config', 'defaultcity'])
  34. },
  35. onReachBottom() {
  36. if (this.list.length % 20 == 0) {
  37. this.page++
  38. this.getdata()
  39. }
  40. },
  41. methods: {
  42. playmp4(item) {
  43. uni.navigateTo({
  44. url: "/pages/video/info?mp4=" + encodeURIComponent(item.video)
  45. })
  46. },
  47. getdata() {
  48. this.$u.post('/api/Property/video_list', {
  49. id: this.id,
  50. page: this.page,
  51. page_num: 20,
  52. }).then(res => {
  53. this.list = this.list.concat(res.data)
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. .video1 {
  61. padding: 24rpx;
  62. .video-item {
  63. width: 340rpx;
  64. margin-bottom: 18rpx;
  65. .video-name {
  66. font-size: 20rpx;
  67. font-family: PingFangSC-Regular, PingFang SC;
  68. font-weight: 400;
  69. color: #333333;
  70. margin: 14rpx 0;
  71. }
  72. .time {
  73. font-size: 20rpx;
  74. font-family: PingFangSC-Regular, PingFang SC;
  75. font-weight: 400;
  76. color: #333333;
  77. }
  78. .image-box {
  79. width: 340rpx;
  80. height: 272rpx;
  81. position: relative;
  82. .play {
  83. width: 64rpx;
  84. height: 64rpx;
  85. position: absolute;
  86. top: 50%;
  87. left: 50%;
  88. transform: translate(-50%, -50%);
  89. }
  90. .image {
  91. width: 340rpx;
  92. height: 272rpx;
  93. border-radius: 10rpx;
  94. }
  95. .text {
  96. position: absolute;
  97. z-index: 10;
  98. right: 10rpx;
  99. bottom: 10rpx;
  100. font-size: 20rpx;
  101. font-family: PingFangSC-Regular, PingFang SC;
  102. font-weight: 400;
  103. color: #FFFFFF;
  104. }
  105. }
  106. }
  107. }
  108. </style>