news-recommend.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 newsList">
  8. <news-item :item="item" :key="index" />
  9. </template>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import UTabs from '@/components/common/u-tabs'
  15. import NewsItem from '@/pages/news/components/news-item.vue'
  16. export default {
  17. components: {
  18. UTabs,
  19. NewsItem
  20. },
  21. props: {
  22. recommendType: {
  23. type: String,
  24. default: 'home'
  25. }
  26. },
  27. data() {
  28. return {
  29. tabActive: '1',
  30. tabs: [{
  31. label: '展会新闻',
  32. value: 1
  33. }, {
  34. label: '展商新闻',
  35. value: 2
  36. }],
  37. newsList: [{}, {}, {}]
  38. }
  39. },
  40. created() {
  41. },
  42. methods: {
  43. tabChange() {
  44. },
  45. onClickDetail(item) {
  46. uni.navigateTo({
  47. 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'
  48. })
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .news-list{
  55. display: grid;
  56. grid-template-columns: 1fr;
  57. grid-row-gap: 18rpx;
  58. margin-top: 28rpx;
  59. }
  60. </style>