topic.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view v-if="activityData.length > 0" :style="'padding-top:'+mbConfig+'rpx;'" class="skeleton-rect">
  3. <view class="activity_count" :style="'background:'+bgColor+';margin: 0 '+prConfig+'rpx;border-radius:'+bgStyle+'rpx'">
  4. <view class="spike-bd">
  5. <view class="title">
  6. <image class="title-img" :src="`${domain}/static/images/topic_title.png`"></image>
  7. </view>
  8. <navigator :url="merId ? '/pages/store/home/index?id='+merId+'&type=4' : '/pages/activity/topic/index'" class="more-btn" hover-class="none">
  9. 进入专场
  10. <text class="iconfont icon-jiantou" hover-class="none"></text>
  11. </navigator>
  12. </view>
  13. <view v-if="activityData.length">
  14. <!-- 单图模式 -->
  15. <block v-if="activityData.length == 1">
  16. <view class="topic_swiper"
  17. v-for="(item,index) in activityData"
  18. :key="index"
  19. @click="goTopicDetail(item.info[1].value)">
  20. <image :src="item.img"></image>
  21. </view>
  22. </block>
  23. <view v-else class="topic_swiper">
  24. <swiper class="swiper" indicator-dots="true" :autoplay="autoplay" :circular="true" :interval="2500" :duration="duration"
  25. indicator-color="rgba(255,255,255,0.6)" :indicator-active-color="pointerColor" :class="[pointerStyle==1 ? 'circular' : pointerStyle==0 ? 'square' : 'noPoint',conStyle?'':'fillet','dot'+txtStyle]">
  26. <block v-for="(item,index) in activityData" :key="index">
  27. <swiper-item>
  28. <view @click="goTopicDetail(item.info[1].value)" class='slide-navigator acea-row row-between-wrapper'>
  29. <image :src="item.img" class="slide-image"></image>
  30. </view>
  31. </swiper-item>
  32. </block>
  33. </swiper>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. // +----------------------------------------------------------------------
  41. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  42. // +----------------------------------------------------------------------
  43. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  44. // +----------------------------------------------------------------------
  45. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  46. // +----------------------------------------------------------------------
  47. // | Author: CRMEB Team <admin@crmeb.com>
  48. // +----------------------------------------------------------------------
  49. import { HTTP_REQUEST_URL } from '@/config/app';
  50. import {merPath} from "@/utils/index"
  51. export default {
  52. name: 'topic',
  53. props: {
  54. dataConfig: {
  55. type: Object,
  56. default: () => {}
  57. },
  58. merId: {
  59. type: String || Number,
  60. default: ''
  61. }
  62. },
  63. data() {
  64. return {
  65. indicatorDots: false,
  66. autoplay: true,
  67. duration: 500,
  68. activityData: this.dataConfig.menuConfig.list,
  69. bgColor: this.dataConfig.colorShow.val ? this.dataConfig.bgColor.color[0].item : 'transparent',
  70. pointerColor: this.dataConfig.pointerColor&&this.dataConfig.pointerColor.color&&this.dataConfig.pointerColor.color[0].item || '#ffffff',
  71. mbConfig: this.dataConfig.mbConfig.val*2, //页面间距
  72. prConfig: this.dataConfig.prConfig.val*2, //背景间距
  73. txtStyle: this.dataConfig.txtStyle.type,
  74. bgStyle: this.dataConfig.bgStyle.type ? 20 : 0,
  75. colorShow: this.dataConfig.colorShow.val,
  76. pointerStyle: this.dataConfig.pointerStyle.type, //指示点样式
  77. conStyle: this.dataConfig.conStyle.type, //内容样式
  78. domain: HTTP_REQUEST_URL,
  79. };
  80. },
  81. created() {},
  82. mounted() {},
  83. methods: {
  84. goTopicDetail(url) {
  85. let urls = url
  86. urls = merPath(urls, this.merId)
  87. this.$util.JumpPath(urls);
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. @import '../style/main.scss';
  94. .activity_count{
  95. margin-bottom: 20rpx;
  96. background: #ffffff;
  97. border-radius: 16rpx;
  98. position: relative;
  99. padding: 24rpx 20rpx 26rpx;
  100. /deep/swiper-item,uni-swiper-item,swiper{
  101. height: 278rpx;
  102. }
  103. /deep/uni-image,/deep/image,/deep/.easy-loadimage{
  104. width: 650rpx;
  105. height: 278rpx;
  106. border-radius: 16rpx;
  107. }
  108. /deep/.uni-swiper-wrapper{
  109. overflow: hidden;
  110. }
  111. }
  112. .topic_swiper{
  113. width: 650rpx;
  114. margin: 0 auto;
  115. line-height: 0;
  116. &.fillet {
  117. border-radius: 0;
  118. /deep/uni-image,/deep/image,/deep/.easy-loadimage{
  119. border-radius: 0;
  120. }
  121. }
  122. // 圆形指示点
  123. &.circular {
  124. /deep/.uni-swiper-dot {
  125. width: 10rpx;
  126. height: 10rpx;
  127. background: rgba(0, 0, 0, .4);
  128. }
  129. /deep/.uni-swiper-dot-active {
  130. background: rgba(233, 51, 35, 1);
  131. }
  132. }
  133. // 方形指示点
  134. &.square {
  135. /deep/.uni-swiper-dot {
  136. width: 20rpx;
  137. height: 5rpx;
  138. border-radius: 3rpx;
  139. background: rgba(0, 0, 0, .4);
  140. }
  141. /deep/.uni-swiper-dot-active {
  142. background: rgba(233, 51, 35, 1);
  143. }
  144. }
  145. }
  146. .noPoint{
  147. /deep/.uni-swiper-dots,/deep/.uni-swiper-dot {
  148. display: none!important;
  149. }
  150. }
  151. /deep/.dot0 .uni-swiper-dots-horizontal{
  152. left: 10%;
  153. }
  154. /deep/.dot1 .uni-swiper-dots-horizontal{
  155. left: 50%;
  156. }
  157. /deep/.dot2 .uni-swiper-dots-horizontal{
  158. left: 90%;
  159. }
  160. </style>