news.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view v-if="itemNew.length" :style="'padding-top:'+mbConfig+'rpx;'">
  3. <view class='news acea-row row-between-wrapper':style="'background:'+bgColor[0].item+';margin: 0 '+prConfig+'rpx;border-radius:'+bgStyle+'rpx'">
  4. <view class='pictrue'>
  5. <image :src='logoConfig'></image>
  6. </view>
  7. <view class='swiperTxt'>
  8. <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" :duration="duration" vertical="true"
  9. circular="true">
  10. <block v-for="(item,index) in itemNew" :key='index'>
  11. <swiper-item catchtouchmove='catchTouchMove'>
  12. <view @click="goDetail(item.chiild[1].val)" class='acea-row row-between-wrapper'>
  13. <view class='text acea-row row-between-wrapper'>
  14. <view class='newsTitle line1' :style="'text-align:'+ (txtStyle==1?'center':txtStyle==2?'right':'left') +';color:'+txtColor">{{item.chiild[0].val}}</view>
  15. </view>
  16. <view class='iconfont icon-jiantou'></view>
  17. </view>
  18. </swiper-item>
  19. </block>
  20. </swiper>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. // +----------------------------------------------------------------------
  27. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  28. // +----------------------------------------------------------------------
  29. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  30. // +----------------------------------------------------------------------
  31. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  32. // +----------------------------------------------------------------------
  33. // | Author: CRMEB Team <admin@crmeb.com>
  34. // +----------------------------------------------------------------------
  35. import {merPath} from "@/utils/index"
  36. export default {
  37. name: 'news',
  38. props: {
  39. dataConfig: {
  40. type: Object,
  41. default: () => {}
  42. },
  43. merId: {
  44. type: String || Number,
  45. default: ''
  46. }
  47. },
  48. data() {
  49. return {
  50. indicatorDots: false,
  51. autoplay: true,
  52. duration: 500,
  53. itemNew: this.dataConfig.listConfig.list,
  54. logoConfig: this.dataConfig.logoConfig.url,
  55. bgColor: this.dataConfig.bgColor.color,
  56. mbConfig: this.dataConfig.mbConfig.val*2,
  57. prConfig: this.dataConfig.prConfig.val*2,
  58. txtStyle: this.dataConfig.txtStyle.type,
  59. txtColor: this.dataConfig.txtColor.color[0].item,
  60. bgStyle: this.dataConfig.bgStyle.type ? 20 : 0,
  61. };
  62. },
  63. created() {},
  64. mounted() {},
  65. methods: {
  66. goDetail(url){
  67. let urls = merPath(url, this.merId)
  68. this.$util.JumpPath(urls);
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .news {
  75. height: 77rpx;
  76. border-top: 1px 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: 1px 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: 510rpx;
  93. height: 100%;
  94. line-height: 77rpx;
  95. overflow: hidden;
  96. }
  97. .news .swiperTxt .text {
  98. width: 480rpx;
  99. }
  100. .news .swiperTxt .text .label {
  101. font-size: 20rpx;
  102. color: #ff4c48;
  103. width: 64rpx;
  104. height: 30rpx;
  105. border-radius: 40rpx;
  106. text-align: center;
  107. line-height: 28rpx;
  108. border: 2rpx solid #ff4947;
  109. }
  110. .news .swiperTxt .text .newsTitle {
  111. width: 397rpx;
  112. font-size: 24rpx;
  113. color: #666;
  114. }
  115. .news .swiperTxt .iconfont {
  116. font-size: 22rpx;
  117. color: #282828;
  118. }
  119. .news .swiperTxt swiper {
  120. height: 100%;
  121. }
  122. </style>