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

193 lines
3.6 KiB

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