blog-list.vue 5.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view>
  3. <view v-if="(propConfig || null) != null && (propData || null) != null && propData.length > 0">
  4. <block v-for="(floor, index) in propData" :key="index">
  5. <block v-if="floor.blog_list.length > 0 && floor.home_data_location == propLocation">
  6. <view class="spacing-nav-title">
  7. <text class="text-wrapper" :style="'color:'+(floor.color || '#333')+';'">{{floor.title}}</text>
  8. <text v-if="(floor.vice_title || null) != null" class="vice-name margin-left-lg cr-gray">{{floor.vice_title}}</text>
  9. <navigator :url="floor.more_url" hover-class="none" class="arrow-right padding-right-xxxl cr-gray fr">更多</navigator>
  10. </view>
  11. <view class="wh-auto oh pr">
  12. <view v-if="floor.keywords_arr.length > 0" class="word-list scroll-view-horizontal margin-bottom-lg">
  13. <scroll-view scroll-x>
  14. <block v-for="(kv, ki) in floor.keywords_arr" :key="ki">
  15. <navigator :url="'/pages/plugins/blog/search/search?keywords=' + kv" hover-class="none" class="word-icon dis-inline-block bg-main-light text-size-xs cr-main round padding-top-xs padding-bottom-xs padding-left padding-right">{{kv}}</navigator>
  16. </block>
  17. </scroll-view>
  18. </view>
  19. <block v-if="floor.blog_list.length > 0">
  20. <!-- 默认图文 -->
  21. <block v-if="(floor.style_type || 0) == 0">
  22. <view class="plugins-blog-list">
  23. <view v-for="(item, index) in floor.blog_list" :key="index" class="item oh padding-main border-radius-main bg-white spacing-mb">
  24. <navigator :url="item.url" hover-class="none">
  25. <image class="blog-img fl radius" :src="item.cover" mode="aspectFill"></image>
  26. <view class="base fr">
  27. <view class="single-text text-size">{{item.title}}</view>
  28. <view class="cr-grey margin-top-sm">{{item.add_time_date_cn}}</view>
  29. <view class="cr-base text-size-sm multi-text margin-top-sm">{{item.describe}}</view>
  30. </view>
  31. </navigator>
  32. </view>
  33. </view>
  34. </block>
  35. <!-- 九方格 -->
  36. <block v-else-if="floor.style_type == 1">
  37. <view class="plugins-blog-grid-list">
  38. <view v-for="(item, index) in floor.blog_list" :key="index" class="item oh border-radius-main bg-white spacing-mb">
  39. <navigator :url="item.url" hover-class="none">
  40. <image class="blog-img dis-block" :src="item.cover" mode="aspectFit"></image>
  41. <view class="base padding-horizontal-main margin-top-sm">
  42. <view class="goods-title multi-text margin-bottom-sm">{{item.title}}</view>
  43. <view class="cr-grey">{{item.add_time_date_cn}}</view>
  44. </view>
  45. </navigator>
  46. </view>
  47. </view>
  48. </block>
  49. <!-- 滚动 -->
  50. <view v-else-if="floor.style_type == 2" class="rolling-horizontal border-radius-main oh spacing-mb">
  51. <view class="plugins-blog-rolling-list scroll-view-horizontal">
  52. <swiper :vertical="false" :autoplay="(propConfig.is_home_hot_auto_play || 0) == 1" :circular="false" :display-multiple-items="floor.blog_list.length < 3 ? floor.blog_list.length : 3" interval="3000">
  53. <block v-for="(item, index) in floor.blog_list" :key="index">
  54. <swiper-item>
  55. <view class="item bg-white border-radius-main margin-right-main oh pr ht-auto pr">
  56. <navigator :url="item.url" hover-class="none">
  57. <image class="blog-img dis-block wh-auto" :src="item.cover" mode="aspectFill"></image>
  58. <view class="blog-title pa single-text cr-white padding-horizontal-main padding-top-sm padding-bottom-sm">{{item.title}}</view>
  59. </navigator>
  60. </view>
  61. </swiper-item>
  62. </block>
  63. </swiper>
  64. </view>
  65. </view>
  66. </block>
  67. </view>
  68. </block>
  69. </block>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {};
  77. },
  78. components: {},
  79. props: {
  80. propLocation: {
  81. type: [String,Number],
  82. default: 0
  83. },
  84. propConfig: {
  85. type: [String,Object],
  86. default: null
  87. },
  88. propData: {
  89. type: Array,
  90. default: []
  91. }
  92. },
  93. methods: {}
  94. };
  95. </script>
  96. <style>
  97. </style>