i-newsList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view>
  3. <view class="title">
  4. <scroll-view scroll-x>
  5. <view class="list">
  6. <view class="item" :class="active == 1?'active':''" @click="click_item(1)">新闻</view>
  7. <view class="item" :class="active == 2?'active':''" @click="click_item(2)">矿内新闻</view>
  8. <view class="item" :class="active == 3?'active':''" @click="click_item(3)">信息监测中心动态</view>
  9. </view>
  10. </scroll-view>
  11. </view>
  12. <view class="inner">
  13. <view v-if="active == 1">
  14. <view class="item">
  15. <view class="left">
  16. <view class="title">【羊场湾煤矿】祝福祖国、真情告白</view>
  17. <view class="time">2020-10-09 13:39:18</view>
  18. </view>
  19. <view class="right">
  20. <image src="https://images.pexels.com/photos/5554235/pexels-photo-5554235.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" mode=""></image>
  21. </view>
  22. </view>
  23. <view class="item">
  24. <view class="left">
  25. <view class="title">【羊场湾煤矿】祝福祖国、真情告白</view>
  26. <view class="time">2020-10-09 13:39:18</view>
  27. </view>
  28. <view class="right">
  29. <image src="https://images.pexels.com/photos/5534634/pexels-photo-5534634.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" mode=""></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view v-if="active == 2">
  34. <view class="item">
  35. <view class="left">
  36. <view class="title">羊场湾矿职工“小改小革”劲头足</view>
  37. <view class="time">2020-10-09 13:39:18</view>
  38. </view>
  39. <view class="right">
  40. <image src="https://images.pexels.com/photos/5415837/pexels-photo-5415837.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" mode=""></image>
  41. </view>
  42. </view>
  43. </view>
  44. <view v-if="active == 3">
  45. <view class="item">
  46. <view class="left">
  47. <view class="title">羊场湾矿职工“小改小革”劲头足</view>
  48. <view class="time">2020-10-09 13:39:18</view>
  49. </view>
  50. <view class="right">
  51. <image src="https://images.pexels.com/photos/5185255/pexels-photo-5185255.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" mode=""></image>
  52. </view>
  53. </view>
  54. <view class="item">
  55. <view class="left">
  56. <view class="title">羊场湾矿职工“小改小革”劲头足</view>
  57. <view class="time">2020-10-09 13:39:18</view>
  58. </view>
  59. <view class="right">
  60. <image src="https://images.pexels.com/photos/2519216/pexels-photo-2519216.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" mode=""></image>
  61. </view>
  62. </view>
  63. <view class="item">
  64. <view class="left">
  65. <view class="title">羊场湾矿职工“小改小革”劲头足</view>
  66. <view class="time">2020-10-09 13:39:18</view>
  67. </view>
  68. <view class="right">
  69. <image src="https://images.pexels.com/photos/5415837/pexels-photo-5415837.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" mode=""></image>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. export default {
  78. data() {
  79. return {
  80. active:1,
  81. };
  82. },
  83. methods:{
  84. click_item(item){
  85. this.active = item
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .list{
  92. background-color: #f3f3f3;
  93. display: flex;
  94. .item{
  95. line-height: 60rpx;
  96. font-size: 27rpx;
  97. font-family: PingFangSC-Regular, PingFang SC;
  98. font-weight: 400;
  99. color: #232627;
  100. box-sizing: border-box;
  101. padding: 0 20rpx;
  102. }
  103. .active{
  104. color: #009FE8;
  105. border-bottom: 2rpx solid #009FE8;
  106. }
  107. }
  108. .inner{
  109. box-sizing: border-box;
  110. padding-left: 10rpx;
  111. padding-right: 10rpx;
  112. .item{
  113. margin-bottom: 10rpx;
  114. box-sizing: border-box;
  115. padding-top: 10rpx;
  116. padding-bottom: 10rpx;
  117. border-bottom: 1rpx solid #f3f3f3;
  118. display: flex;
  119. justify-content: space-between;
  120. height: 155rpx;
  121. .left{
  122. .title{
  123. width: 446rpx;
  124. font-size: 33rpx;
  125. font-family: PingFangSC-Regular, PingFang SC;
  126. font-weight: 400;
  127. color: #121212;
  128. line-height: 40rpx;
  129. text-overflow: -o-ellipsis-lastline;
  130. overflow: hidden;
  131. text-overflow: ellipsis;
  132. display: -webkit-box;
  133. -webkit-line-clamp: 2;
  134. line-clamp: 2;
  135. -webkit-box-orient: vertical;
  136. }
  137. .time{
  138. margin-top: 25rpx;
  139. width: 446rpx;
  140. height: 30rpx;
  141. line-height: 30rpx;
  142. font-size: 20rpx;
  143. font-family: PingFangSC-Regular, PingFang SC;
  144. font-weight: 400;
  145. color: #999;
  146. }
  147. }
  148. .right{
  149. margin-left: 14rpx;
  150. image{
  151. width: 270rpx;
  152. height: 135rpx;
  153. }
  154. }
  155. }
  156. }
  157. </style>