景徳镇旅游微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

170 lines
3.2 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <scroll-view
  3. scroll-y="true"
  4. :style="{height: height}"
  5. @scrolltolower="loadMoreData">
  6. <view class="videoList">
  7. <view class="video-item" v-for="(item, index) in list" :key="index"
  8. @click="showVideo(item, index)">
  9. <view class="image">
  10. <image :src="item.videoImage" mode="aspectFill">
  11. </image>
  12. <view class="icon">
  13. <uv-icon size="35rpx" name="play-right-fill">
  14. </uv-icon>
  15. </view>
  16. </view>
  17. <view class="bottom">
  18. <view class="headImage">
  19. <!-- <image src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img" mode="aspectFill">
  20. </image> -->
  21. {{ item.videoTitle }}
  22. </view>
  23. <view class="like">
  24. <uv-icon size="45rpx" v-if="false" name="heart"></uv-icon>
  25. <uv-icon size="45rpx" color="#FF4340" v-else name="heart-fill"></uv-icon>
  26. {{ item.videoThumpup }}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </template>
  33. <script>
  34. import index from '../../uni_modules/uv-ui-tools'
  35. export default {
  36. props : {
  37. height : {
  38. default : 'auto'
  39. },
  40. roleId : {
  41. }
  42. },
  43. data() {
  44. return {
  45. queryParams: {
  46. pageNo: 1,
  47. pageSize: 10,
  48. },
  49. total : 0,
  50. list : [],
  51. }
  52. },
  53. methods: {
  54. showVideo(item, current){
  55. // this.$utils.hanldePreview
  56. // uni.previewMedia({
  57. // current : item.videoContent
  58. // })
  59. let sources = []
  60. this.list.forEach(n => {
  61. sources.push({
  62. url : n.videoContent,
  63. type : 'video'
  64. })
  65. })
  66. wx.previewMedia({
  67. sources, // 需要预览的资源列表
  68. current, // 当前显示的资源序号
  69. // url: url // 当前预览资源的url链接
  70. })
  71. },
  72. queryVideoList(){
  73. if(this.roleId){
  74. this.queryParams.roleInfoId = this.roleId
  75. }
  76. this.$api('queryVedioById', this.queryParams, res => {
  77. if(res.code == 200){
  78. this.list = res.result.records
  79. this.total = res.result.total
  80. }
  81. })
  82. },
  83. loadMoreData(){
  84. if(this.queryParams.pageSize < this.total){
  85. this.queryParams.pageSize += 10
  86. this.queryVideoList()
  87. }
  88. },
  89. }
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. .videoList {
  94. display: flex;
  95. flex-wrap: wrap;
  96. .video-item {
  97. margin: 20rpx;
  98. width: 335rpx;
  99. .image {
  100. position: relative;
  101. width: 100%;
  102. height: 420rpx;
  103. border-radius: 30rpx;
  104. overflow: hidden;
  105. image {
  106. width: 100%;
  107. height: 100%;
  108. }
  109. .icon {
  110. position: absolute;
  111. right: 30rpx;
  112. top: 30rpx;
  113. width: 60rpx;
  114. height: 60rpx;
  115. background-color: #ffffffaa;
  116. border-radius: 50%;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. }
  121. }
  122. .bottom {
  123. padding: 10rpx 0;
  124. font-size: 22rpx;
  125. display: flex;
  126. justify-content: space-between;
  127. .headImage {
  128. display: flex;
  129. align-items: center;
  130. image {
  131. width: 50rpx;
  132. height: 50rpx;
  133. border-radius: 50%;
  134. margin-right: 6rpx;
  135. }
  136. }
  137. .like {
  138. display: flex;
  139. align-items: center;
  140. }
  141. }
  142. }
  143. .showVideo{
  144. display: flex;
  145. justify-content: center;
  146. align-items: center;
  147. height: 100%;
  148. width: 1000%;
  149. video{
  150. // width: 100%;
  151. // height: 100%;
  152. }
  153. }
  154. }
  155. </style>