news-recommend.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="news-recommend">
  3. <view v-if="recommendType === 'home'" 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, index) in [1, 2, 3]">
  8. <view class="news-item" :key="index">
  9. <view class="news-title">组装自动化与测试测量深度融合,赋能电子制造业高质量发展2024</view>
  10. <view class="news-time">2024628日</view>
  11. <view class="news-summary">
  12. <view class="text">在人类历史长河中,工业生产一直是社会进步的重要驱动力,而自动化技术的飞速发展,使其正在经历前所未有的变革。特别是在电子生产制造领域,传统的人工操作由于易疲劳、品质不稳定以及</view>
  13. <view class="to-detail" @click="onClickDetail(item)"><view>了解详情</view> <view class="arrow iconfont icon-right-s"></view></view>
  14. </view>
  15. </view>
  16. </template>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. components: {
  23. },
  24. props: {
  25. recommendType: {
  26. type: String,
  27. default: 'home'
  28. }
  29. },
  30. data() {
  31. return {
  32. tabActive: '1',
  33. tabs: [{
  34. label: '展会新闻',
  35. value: 1
  36. }, {
  37. label: '展商新闻',
  38. value: 2
  39. }]
  40. }
  41. },
  42. created() {
  43. },
  44. methods: {
  45. tabChange() {
  46. },
  47. onClickDetail(item) {
  48. uni.navigateTo({
  49. url: '/pages/index/webview?url=https://www.productronicachina.com.cn/2025%E6%85%95%E5%B0%BC%E9%BB%91%E4%B8%8A%E6%B5%B7%E7%94%B5%E5%AD%90%E7%94%9F%E4%BA%A7%E8%AE%BE%E5%A4%87%E5%B1%953%E6%9C%88%E5%A5%8F%E5%93%8D%E6%96%B0%E7%AF%87%E7%AB%A0-%E6%8E%A2%E7%B4%A2%E7%94%B5%E5%AD%90%E5%88%B6%E9%80%A0%E7%9A%84%E6%97%A0%E9%99%90%E5%8F%AF%E8%83%BD'
  50. })
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .news-list{
  57. display: grid;
  58. grid-template-columns: 1fr;
  59. grid-row-gap: 18rpx;
  60. margin-top: 28rpx;
  61. }
  62. .news-item{
  63. display: flex;
  64. flex-direction: column;
  65. height: 210rpx;
  66. background-color: #F6F6F6;
  67. border-radius: 10rpx;
  68. padding: 24rpx 30rpx;
  69. }
  70. .news-summary{
  71. display: flex;
  72. align-items: center;
  73. }
  74. .news-title{
  75. @extend .text-ellipsis-line;
  76. font-family: Arial, Arial;
  77. font-weight: bold;
  78. font-size: $fontSize2;
  79. line-height: 35rpx;
  80. }
  81. .news-time{
  82. font-size: $fontSize0;
  83. color: #555555;
  84. margin: 12rpx 0;
  85. }
  86. .news-summary{
  87. font-size: 18rpx;
  88. line-height: 25rpx;
  89. .text{
  90. padding-right: 30rpx;
  91. color: #555555;
  92. @extend .text-ellipsis-line;
  93. -webkit-line-clamp: 2;
  94. }
  95. .to-detail{
  96. display: flex;
  97. align-items: center;
  98. flex-shrink: 0;
  99. color: $buttonPrimaryColor;
  100. font-size: 16rpx;
  101. font-weight: bold;
  102. padding: 0 24rpx;
  103. }
  104. .arrow{
  105. margin-left: 12rpx;
  106. font-size: $fontSize0;
  107. }
  108. }
  109. .news-tab{
  110. van-button{
  111. margin-right: 13rpx;
  112. }
  113. }
  114. </style>