news-recommend.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="news-recommend">
  3. <view class="news-tab">
  4. <u-tabs :active.sync="tabActive" :tabs="tabs" tab-style="default" @change="tabChange"/>
  5. </view>
  6. <view class="news-list">
  7. <template v-for="item in [1, 2, 3]">
  8. <view class="news-item">
  9. <view class="news-title">组装自动化与测试测量深度融合,赋能电子制造业高质量发展2024</view>
  10. <view class="news-time">2024年6月28日</view>
  11. <view class="news-summary">
  12. <view class="text">在人类历史长河中,工业生产一直是社会进步的重要驱动力,而自动化技术的飞速发展,使其正在经历前所未有的变革。特别是在电子生产制造领域,传统的人工操作由于易疲劳、品质不稳定以及</view>
  13. <view class="to-detail"><view>了解详情</view> <view class="arrow iconfont icon-a-righticon_huaban11"></view></view>
  14. </view>
  15. </view>
  16. </template>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import UTabs from '@/components/common/u-tabs/index.vue'
  22. export default {
  23. components: {
  24. UTabs
  25. },
  26. data() {
  27. return {
  28. tabActive: '1',
  29. tabs: [{
  30. label: '展会新闻',
  31. value: 1
  32. }, {
  33. label: '展商新闻',
  34. value: 2
  35. }]
  36. }
  37. },
  38. created() {
  39. },
  40. methods: {
  41. tabChange() {
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .news-list{
  48. display: grid;
  49. grid-template-columns: 1fr;
  50. grid-row-gap: 18rpx;
  51. margin-top: 28rpx;
  52. }
  53. .news-item{
  54. display: flex;
  55. flex-direction: column;
  56. height: 210rpx;
  57. background-color: #F6F6F6;
  58. border-radius: 10rpx;
  59. padding: 24rpx 30rpx;
  60. }
  61. .news-summary{
  62. display: flex;
  63. align-items: center;
  64. }
  65. .news-title{
  66. @extend .text-ellipsis-line;
  67. font-family: Arial, Arial;
  68. font-weight: bold;
  69. font-size: $fontSize2;
  70. line-height: 35rpx;
  71. }
  72. .news-time{
  73. font-size: $fontSize0;
  74. color: #555555;
  75. margin: 12rpx 0;
  76. }
  77. .news-summary{
  78. font-size: 18rpx;
  79. line-height: 25rpx;
  80. .text{
  81. padding-right: 30rpx;
  82. color: #555555;
  83. @extend .text-ellipsis-line;
  84. -webkit-line-clamp: 2;
  85. }
  86. .to-detail{
  87. display: flex;
  88. align-items: center;
  89. flex-shrink: 0;
  90. color: $buttonPrimaryColor;
  91. font-size: 16rpx;
  92. font-weight: bold;
  93. padding: 0 24rpx;
  94. }
  95. .arrow{
  96. margin-left: 12rpx;
  97. font-size: $fontSize0;
  98. }
  99. }
  100. .news-tab{
  101. van-button{
  102. margin-right: 13rpx;
  103. }
  104. }
  105. </style>