news.vue 2.6 KB

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