news.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view v-show="!isSortType">
  3. <view class='news acea-row row-middle' :class="{pageOn:bgStyle===1}" v-if="itemNew.length" :style="'margin:0 '+prConfig*2+'rpx;margin-top:'+mbConfig*2+'rpx;color:'+txtColor+';background-color:'+bgColor+';'">
  4. <view class='pictrue skeleton-rect'>
  5. <image :src='logoConfig'></image>
  6. </view>
  7. <view class='swiperTxt skeleton-rect'>
  8. <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" :duration="duration"
  9. vertical="true" circular="true">
  10. <block v-for="(item,index) in itemNew" :key='index'>
  11. <swiper-item catchtouchmove='catchTouchMove'>
  12. <navigator :url='item.chiild[1].val' class='acea-row row-between-wrapper'
  13. hover-class='none'>
  14. <view class='text acea-row row-between-wrapper'>
  15. <view class='newsTitle line1'
  16. :style="'text-align:'+ (txtStyle==1?'center':txtStyle==2?'right':'left') +';color:'+txtColor+';'">
  17. {{item.chiild[0].val}}</view>
  18. </view>
  19. <view class='iconfont icon-xiangyou'></view>
  20. </navigator>
  21. </swiper-item>
  22. </block>
  23. </swiper>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'news',
  31. props: {
  32. dataConfig: {
  33. type: Object,
  34. default: () => {}
  35. },
  36. isSortType: {
  37. type: String | Number,
  38. default: 0
  39. }
  40. },
  41. data() {
  42. return {
  43. indicatorDots: false,
  44. autoplay: true,
  45. duration: 500,
  46. itemNew: this.dataConfig.listConfig.list,
  47. logoConfig: this.dataConfig.logoConfig.url,
  48. mbConfig: this.dataConfig.mbConfig.val,
  49. txtStyle: this.dataConfig.txtStyle.type,
  50. txtColor: this.dataConfig.txtColor.color[0].item,
  51. bgColor: this.dataConfig.bgColor.color[0].item,
  52. bgStyle: this.dataConfig.bgStyle.type,
  53. prConfig: this.dataConfig.prConfig.val
  54. };
  55. },
  56. created() {},
  57. mounted() {},
  58. methods: {}
  59. }
  60. </script>
  61. <style lang="scss">
  62. .pageOn{
  63. border-radius: 12rpx!important;
  64. }
  65. .news {
  66. display: flex;
  67. align-items: center;
  68. flex-wrap: nowrap;
  69. height: 77rpx;
  70. border-top: 1rpx solid #f4f4f4;
  71. padding: 0 20rpx;
  72. box-shadow: 0 10rpx 30rpx #f5f5f5;
  73. }
  74. .news .pictrue {
  75. width: 130rpx;
  76. height: 36rpx;
  77. border-right: 1rpx solid #ddd;
  78. padding-right: 23rpx;
  79. box-sizing: content-box;
  80. }
  81. .news .pictrue image {
  82. width: 100%;
  83. height: 100%;
  84. }
  85. .news .swiperTxt {
  86. width: 523rpx;
  87. height: 100%;
  88. line-height: 77rpx;
  89. overflow: hidden;
  90. margin-left: 22rpx;
  91. }
  92. .news .swiperTxt .text {
  93. width: 89%;
  94. }
  95. .news .swiperTxt .text .label {
  96. font-size: 20rpx;
  97. color: #ff4c48;
  98. width: 64rpx;
  99. height: 30rpx;
  100. border-radius: 40rpx;
  101. text-align: center;
  102. line-height: 28rpx;
  103. border: 2rpx solid #ff4947;
  104. }
  105. .news .swiperTxt .text .newsTitle {
  106. width: 100%;
  107. font-size: 24rpx;
  108. color: #666;
  109. }
  110. .news .swiperTxt .iconfont {
  111. font-size: 28rpx;
  112. color: #888;
  113. }
  114. .news .swiperTxt swiper {
  115. height: 100%;
  116. }
  117. </style>