videoList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view class="content">
  3. <view @click="linkDetails(item)" v-for="(item,index) in newsList" :key="index" class="box" >
  4. <view class="box_img">
  5. <u--image radius='16rpx' class="" width="90vw" height="395rpx" :src="item.coverList[0].fileUrl" ></u--image>
  6. <view class="iconm_play">
  7. <u--image width="128rpx" height="128rpx" v-if="item.videoUrl" src="/static/index/iconm_play.png" ></u--image>
  8. </view>
  9. </view>
  10. <view class="box_title">
  11. {{item.title}}
  12. </view>
  13. <view class="box_bottom">
  14. <view class="box_type">
  15. <view class="flex">
  16. <u--image width="40rpx" height="40rpx" src="/static/index/iconm_shitu.png" ></u--image>
  17. <view style="margin-left:8rpx">{{ item.views || 0}}</view>
  18. </view>
  19. <view class="flex" style="margin-left:10rpx">
  20. <u--image width="40rpx" height="40rpx" src="/static/index/iconm_message.png" ></u--image>
  21. <view style="margin-left:8rpx">{{ item.num || 0}}</view>
  22. </view>
  23. </view>
  24. <view class="box_type">
  25. <view class="flex">{{item.subIdName}}</view>
  26. <!-- <view class="flex" style="margin-left:24rpx">{{ computerTime(item) }}</view> -->
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. props: {
  35. listdata: {
  36. type: Array,
  37. default: [],
  38. },
  39. },
  40. watch:{
  41. listdata: {
  42. immediate: true,
  43. handler(val) {
  44. console.log(val);
  45. this.newsList = val
  46. },
  47. }
  48. },
  49. data() {
  50. return {
  51. newsList:[]
  52. }
  53. },
  54. onLoad() {
  55. },
  56. methods: {
  57. computerTime(data){
  58. let time = data?.time || data?.createTime
  59. if (time) {
  60. return time.slice(5,10)
  61. }else{
  62. return ''
  63. }
  64. },
  65. linkDetails(e){
  66. uni.navigateTo({
  67. url: '/pages/home/ArticleDetails?id=' + e.id
  68. });
  69. }
  70. }
  71. }
  72. </script>
  73. <style>
  74. .content{
  75. width: 100vw;
  76. background-color: #FFFFFF;
  77. padding: 30rpx 0 30rpx 0;
  78. }
  79. .title{
  80. display: flex;
  81. width: 90vw;
  82. justify-content: space-between;
  83. margin: 0 auto;
  84. }
  85. .title_text{
  86. width: 128rpx;
  87. height: 45rpx;
  88. font-size: 32rpx;
  89. font-weight: bold;
  90. color: #333333;
  91. line-height: 45rpx;
  92. }
  93. .title_more{
  94. width: 80rpx;
  95. height: 40rpx;
  96. font-size: 28rpx;
  97. font-weight: 500;
  98. color: #999999;
  99. line-height: 40rpx;
  100. }
  101. .box{
  102. display: flex;
  103. margin: 20rpx auto;
  104. justify-content: flex-start;
  105. width: 90vw;
  106. flex-direction: column;
  107. align-items: center;
  108. height: 510rpx;
  109. }
  110. .box_img{
  111. width: 100%;
  112. height: 395rpx;
  113. border-radius: 16rpx;
  114. background-color: #999999;
  115. }
  116. .box_right{
  117. margin-left: 10rpx;
  118. display: flex;
  119. flex-direction: column;
  120. justify-content: space-around;
  121. }
  122. .box_title{
  123. margin-top: 24rpx;
  124. width: 100%;
  125. height: 45rpx;
  126. font-size: 32rpx;
  127. font-weight: bold;
  128. color: #333333;
  129. line-height: 45rpx;
  130. display: -webkit-box;
  131. word-break: break-all;
  132. text-overflow: ellipsis;
  133. overflow: hidden;
  134. -webkit-box-orient: vertical;
  135. -webkit-line-clamp:1;
  136. }
  137. .box_bottom{
  138. margin-top: 16rpx;
  139. display: flex;
  140. justify-content: space-between;
  141. width: 100%;
  142. }
  143. .box_type{
  144. display: flex;
  145. justify-content: space-between;
  146. font-size: 28rpx;
  147. font-weight: 500;
  148. color: #999999;
  149. line-height: 40rpx;
  150. }
  151. .iconm_play{
  152. position: relative;
  153. left: 40%;
  154. top: -260rpx;
  155. z-index: 150;
  156. width: 128rpx;
  157. }
  158. </style>