123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <view v-if="activityData.length > 0" :style="'padding-top:'+mbConfig+'rpx;'" class="skeleton-rect">
- <view class="activity_count" :style="'background:'+bgColor+';margin: 0 '+prConfig+'rpx;border-radius:'+bgStyle+'rpx'">
- <view class="spike-bd">
- <view class="title">
- <image class="title-img" :src="`${domain}/static/images/topic_title.png`"></image>
- </view>
- <navigator :url="merId ? '/pages/store/home/index?id='+merId+'&type=4' : '/pages/activity/topic/index'" class="more-btn" hover-class="none">
- 进入专场
- <text class="iconfont icon-jiantou" hover-class="none"></text>
- </navigator>
- </view>
- <view v-if="activityData.length">
-
- <block v-if="activityData.length == 1">
- <view class="topic_swiper"
- v-for="(item,index) in activityData"
- :key="index"
- @click="goTopicDetail(item.info[1].value)">
- <image :src="item.img"></image>
- </view>
- </block>
- <view v-else class="topic_swiper">
- <swiper class="swiper" indicator-dots="true" :autoplay="autoplay" :circular="true" :interval="2500" :duration="duration"
- indicator-color="rgba(255,255,255,0.6)" :indicator-active-color="pointerColor" :class="[pointerStyle==1 ? 'circular' : pointerStyle==0 ? 'square' : 'noPoint',conStyle?'':'fillet','dot'+txtStyle]">
- <block v-for="(item,index) in activityData" :key="index">
- <swiper-item>
- <view @click="goTopicDetail(item.info[1].value)" class='slide-navigator acea-row row-between-wrapper'>
- <image :src="item.img" class="slide-image"></image>
- </view>
- </swiper-item>
- </block>
- </swiper>
- </view>
- </view>
-
- </view>
- </view>
- </template>
- <script>
-
-
-
-
-
-
-
-
-
- import { HTTP_REQUEST_URL } from '@/config/app';
- import {merPath} from "@/utils/index"
- export default {
- name: 'topic',
- props: {
- dataConfig: {
- type: Object,
- default: () => {}
- },
- merId: {
- type: String || Number,
- default: ''
- }
- },
- data() {
- return {
- indicatorDots: false,
- autoplay: true,
- duration: 500,
- activityData: this.dataConfig.menuConfig.list,
- bgColor: this.dataConfig.colorShow.val ? this.dataConfig.bgColor.color[0].item : 'transparent',
- pointerColor: this.dataConfig.pointerColor&&this.dataConfig.pointerColor.color&&this.dataConfig.pointerColor.color[0].item || '#ffffff',
- mbConfig: this.dataConfig.mbConfig.val*2,
- prConfig: this.dataConfig.prConfig.val*2,
- txtStyle: this.dataConfig.txtStyle.type,
- bgStyle: this.dataConfig.bgStyle.type ? 20 : 0,
- colorShow: this.dataConfig.colorShow.val,
- pointerStyle: this.dataConfig.pointerStyle.type,
- conStyle: this.dataConfig.conStyle.type,
- domain: HTTP_REQUEST_URL,
- };
- },
- created() {},
- mounted() {},
- methods: {
- goTopicDetail(url) {
- let urls = url
- urls = merPath(urls, this.merId)
- this.$util.JumpPath(urls);
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '../style/main.scss';
- .activity_count{
- margin-bottom: 20rpx;
- background: #ffffff;
- border-radius: 16rpx;
- position: relative;
- padding: 24rpx 20rpx 26rpx;
- /deep/swiper-item,uni-swiper-item,swiper{
- height: 278rpx;
- }
- /deep/uni-image,/deep/image,/deep/.easy-loadimage{
- width: 650rpx;
- height: 278rpx;
- border-radius: 16rpx;
- }
- /deep/.uni-swiper-wrapper{
- overflow: hidden;
- }
- }
- .topic_swiper{
- width: 650rpx;
- margin: 0 auto;
- line-height: 0;
- &.fillet {
- border-radius: 0;
- /deep/uni-image,/deep/image,/deep/.easy-loadimage{
- border-radius: 0;
- }
- }
- // 圆形指示点
- &.circular {
- /deep/.uni-swiper-dot {
- width: 10rpx;
- height: 10rpx;
- background: rgba(0, 0, 0, .4);
- }
- /deep/.uni-swiper-dot-active {
- background: rgba(233, 51, 35, 1);
- }
- }
- // 方形指示点
- &.square {
- /deep/.uni-swiper-dot {
- width: 20rpx;
- height: 5rpx;
- border-radius: 3rpx;
- background: rgba(0, 0, 0, .4);
- }
- /deep/.uni-swiper-dot-active {
- background: rgba(233, 51, 35, 1);
- }
- }
-
- }
- .noPoint{
- /deep/.uni-swiper-dots,/deep/.uni-swiper-dot {
- display: none!important;
- }
- }
- /deep/.dot0 .uni-swiper-dots-horizontal{
- left: 10%;
- }
- /deep/.dot1 .uni-swiper-dots-horizontal{
- left: 50%;
- }
- /deep/.dot2 .uni-swiper-dots-horizontal{
- left: 90%;
- }
- </style>
|