news.vue 2.9 KB

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