i-news-list.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <view class="news_box">
  3. <view class="news_box_title">
  4. <view class="title">
  5. <view class="icon"></view>
  6. <view class="name">
  7. <text>新闻动态</text>
  8. </view>
  9. </view>
  10. <view class="more" @click="go_newsList()">
  11. <text>更多</text>
  12. </view>
  13. </view>
  14. <view class="news_inner">
  15. <view class="inner_list">
  16. <view class="item" v-for="item in newsList" :key="item.id">
  17. <view class="item_img">
  18. <image :src="item.main_img"></image>
  19. </view>
  20. <view class="item_title">
  21. <text>{{item.title}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. props:[
  31. "newsList"
  32. ],
  33. data() {
  34. return {
  35. };
  36. },
  37. methods:{
  38. go_newsList(){
  39. uni.navigateTo({
  40. url:"../../i-newsList/i-newsList",
  41. animationType:"fade-in",
  42. animationDuration:300
  43. })
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss">
  49. .news_box{
  50. margin-top: 19rpx;
  51. box-sizing: border-box;
  52. padding-left: 44rpx;
  53. padding-right: 41rpx;
  54. .news_box_title{
  55. display: flex;
  56. justify-content: space-between;
  57. .title{
  58. display: flex;
  59. .icon{
  60. width: 52rpx;
  61. height: 52rpx;
  62. background-image: url(icon/icon_news.png);
  63. background-size: cover;
  64. background-repeat: no-repeat;
  65. }
  66. .name{
  67. margin-left: 16rpx;
  68. height: 52rpx;
  69. font-size: 38rpx;
  70. font-family: PingFangSC-Regular, PingFang SC;
  71. font-weight: 400;
  72. color: #121212;
  73. line-height: 52rpx;
  74. }
  75. }
  76. .more{
  77. margin-top: 12rpx;
  78. height: 34rpx;
  79. font-size: 25rpx;
  80. font-family: PingFangSC-Regular, PingFang SC;
  81. font-weight: 400;
  82. color: #6C6F74;
  83. line-height: 34rpx;
  84. }
  85. }
  86. .news_inner{
  87. margin-top: 23rpx;
  88. padding-bottom: 10rpx;
  89. .inner_list{
  90. .item{
  91. margin-bottom: 24rpx;
  92. display: flex;
  93. justify-content: space-between;
  94. .item_img{
  95. width: 188rpx;
  96. height: 105rpx;
  97. border-radius: 2rpx;
  98. image{
  99. width: 188rpx;
  100. height: 105rpx;
  101. }
  102. }
  103. .item_title{
  104. padding-top: 18rpx;
  105. width: 456rpx;
  106. height: 62rpx;
  107. font-size: 23rpx;
  108. font-family: PingFangSC-Regular, PingFang SC;
  109. font-weight: 400;
  110. color: #121212;
  111. line-height: 31rpx;
  112. text-overflow: -o-ellipsis-lastline;
  113. overflow: hidden;
  114. text-overflow: ellipsis;
  115. display: -webkit-box;
  116. -webkit-line-clamp: 2;
  117. line-clamp: 2;
  118. -webkit-box-orient: vertical;
  119. }
  120. }
  121. }
  122. }
  123. }
  124. </style>