景徳镇旅游微信小程序
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.

184 lines
3.5 KiB

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