newVideo.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view>
  3. <view class="title" >
  4. <view class="title_text">{{info.title}}</view>
  5. <view class="title_more" @click="clicktoMore">更多></view>
  6. </view>
  7. <view v-if="menuslist.length>0">
  8. <videoList :listdata="menuslist" ></videoList>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import videoList from '@/pages/components/videoList.vue'
  14. import {moduleByFive} from '@/http/api/common.js'
  15. export default {
  16. components: {
  17. videoList,
  18. },
  19. data() {
  20. return {
  21. menuslist:[],
  22. info:{
  23. title:'最新资讯'
  24. }
  25. }
  26. },
  27. async mounted() {
  28. this.getmoduleByFive()
  29. },
  30. methods: {
  31. async getmoduleByFive(){
  32. //获取模块5
  33. let res = await moduleByFive()
  34. this.menuslist = []
  35. if (res.data.code == 200) {
  36. this.info = res.data.data
  37. if (res.data.data.articleVoList) {
  38. const arr = res.data.data.articleVoList;
  39. this.menuslist = arr.slice(0, 2);
  40. }
  41. }
  42. },
  43. clicktoMore(){
  44. if (this.info?.moreToSubId && this.info?.moreToColumnId) {
  45. let data = {
  46. curNowid:this.info?.moreToColumnId,
  47. curNowsubid:this.info?.moreToSubId,
  48. }
  49. uni.setStorageSync('curNowdata',JSON.stringify(data) );
  50. uni.switchTab({
  51. url: '/pages/home/Information',
  52. });
  53. }
  54. },
  55. }
  56. }
  57. </script>
  58. <style>
  59. .title{
  60. display: flex;
  61. width: 90vw;
  62. justify-content: space-between;
  63. margin: 0 auto;
  64. }
  65. .title_text{
  66. width: 128rpx;
  67. height: 45rpx;
  68. font-size: 32rpx;
  69. font-weight: bold;
  70. color: #333333;
  71. line-height: 45rpx;
  72. }
  73. .title_more{
  74. width: 80rpx;
  75. height: 40rpx;
  76. font-size: 28rpx;
  77. font-weight: 500;
  78. color: #999999;
  79. line-height: 40rpx;
  80. }
  81. .box{
  82. display: flex;
  83. margin: 20rpx 0;
  84. justify-content: flex-start;
  85. width: 90vw;
  86. flex-direction: column;
  87. align-items: center;
  88. }
  89. .box_img{
  90. width: 100%;
  91. height: 395rpx;
  92. border-radius: 16rpx;
  93. background-color: #999999;
  94. }
  95. .box_right{
  96. margin-left: 10rpx;
  97. display: flex;
  98. flex-direction: column;
  99. justify-content: space-around;
  100. }
  101. .box_title{
  102. width: 100%;
  103. height: 45rpx;
  104. font-size: 32rpx;
  105. font-weight: bold;
  106. color: #333333;
  107. line-height: 45rpx;
  108. display: -webkit-box;
  109. word-break: break-all;
  110. text-overflow: ellipsis;
  111. overflow: hidden;
  112. -webkit-box-orient: vertical;
  113. -webkit-line-clamp:1;
  114. }
  115. .box_bottom{
  116. display: flex;
  117. justify-content: space-between;
  118. width: 100%;
  119. }
  120. .box_type{
  121. display: flex;
  122. justify-content: space-between;
  123. font-size: 28rpx;
  124. font-weight: 500;
  125. color: #999999;
  126. line-height: 40rpx;
  127. }
  128. .iconm_play{
  129. position: relative;
  130. left: 40%;
  131. top: -260rpx;
  132. z-index: 150;
  133. }
  134. </style>