news.vue 2.9 KB

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