123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <view class="banner">
- <view class="swiper-banner-msg">
- <view class="content">
- <view class="item le">
- <view class="item-icon">
- <text class="iconfont icon-zhengpin1"></text>
- </view>
- <view class="item-sm">
- <text>正品保证</text>
- </view>
- </view>
- <view class="item ce">
- <view class="item-icon">
- <text class="iconfont icon-jigou1"></text>
- </view>
- <view class="item-sm">
- <text>12000+机构</text>
- </view>
- </view>
- <view class="item ri">
- <view class="item-sm">
- <text>100+供应商</text>
- </view>
- <view class="item-icon">
- <text class="iconfont icon-gongyingshang1"></text>
- </view>
- </view>
- </view>
- </view>
- <view class="tui-rolling-view">
- <view class="tui-rolling-content">
- <view class="tui-rolling-news">
- <text class="tui-roll-label">公告:</text>
- <swiper vertical autoplay circular interval="3500" class="tui-swiper">
- <swiper-item v-for="(item, index) in list" :key="index" class="tui-swiper-item">
- <view class="tui-news-item" @tap="detail(item)">
- <text class="news-dot"></text> {{ item.title }}
- </view>
- </swiper-item>
- </swiper>
- <view class="tui-roll-more" @tap="newsList(item)">
- 更多<text class="iconfont icon-xiayibu"></text>
- </view>
- </view>
- </view>
- </view>
- <view class="swiper-banner-content">
- <view class="swiper-banner-box">
- <swiper
- class="tui-banner-swiper tui-banner tui-skeleton-fillet"
- :autoplay="true"
- :interval="5000"
- :duration="500"
- @change="swiperChange"
- :circular="true"
- >
- <swiper-item v-for="(item, index) in list" :key="index" @click.stop="NavToDetailPage(item)">
- <image :src="item.image" class="tui-slide-image" mode="scaleToFill" />
- </swiper-item>
- </swiper>
- <view class="swiper__dots-box" v-if="list.length > 1">
- <view
- v-for="(item, idx) in list"
- :key="idx"
- :class="[idx === current ? 'swiper__dots-long' : 'none']"
- :data-index="current"
- class="swiper__dots-item"
- >
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import cmsMixins from '@/mixins/cmsMixins.js'
- export default {
- mixins: [cmsMixins],
- name: 'banner',
- props: {
- list: {
- type: Array
- },
- newsList: {
- type: Array
- }
- },
- data() {
- return {
- current: 0,
- StatusBar: this.StatusBar
- }
- },
- created() {},
- computed: {},
- methods: {
- detail(item){// 跳转公告详情
- this.$api.navigateTo(`/pages/service/news-detailes?id=${item.id}`)
- },
- newsList(){// 公告列表
- this.$api.navigateTo('/pages/service/news-list')
- },
- swiperChange(e) {
- //轮播图切换
- const index = e.detail.current
- this.current = index
- },
- NavToDetailPage(item) {
- //跳转
- this.cmsSysStatistics(1, item.id)
- this.$api.FlooryNavigateTo(item)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .banner {
- margin-top: 50px;
- background: #f7f7f7;
- }
- .swiper-banner-content {
- width: 100%;
- height: auto;
- position: relative;
- background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%);
- }
- .swiper-banner-box {
- width: 100%;
- height: 360rpx;
- position: relative;
- background-size: cover;
- display: flex;
- opacity: 1;
- background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%);
- }
- .tui-banner-swiper {
- width: 700rpx;
- margin: 0 auto;
- height: 340rpx;
- border-radius: 16rpx;
- overflow: hidden;
- transform: translateY(0);
- background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%);
- .banner-item {
- border-radius: 16rpx;
- }
- .tui-slide-image {
- width: 100%;
- height: 340rpx;
- display: block;
- }
- }
- .swiper__dots-box {
- position: absolute;
- bottom: 30rpx;
- left: 0;
- right: 0;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex: 1;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- .swiper__dots-item {
- width: 8rpx;
- height: 8rpx;
- border-radius: 100%;
- margin-left: 6px;
- background-color: rgba(255, 255, 255, 0.7);
- }
- .swiper__dots-long {
- width: 35rpx;
- height: 8rpx;
- border-radius: 4rpx;
- background-color: #ffff;
- transition: all 0.4s;
- }
- }
- .swiper-banner-msg {
- width: 100%;
- height: 48rpx;
- box-sizing: border-box;
- background-color: #ff5b00;
- padding: 0 24rpx;
- .content {
- width: 100%;
- height: 48rpx;
- box-sizing: border-box;
- padding: 0 24rpx;
- border-radius: 16rpx;
- .item {
- width: 30%;
- height: 48rpx;
- float: left;
- .item-icon{
- height: 48rpx;
- line-height: 48rpx;
- float: left;
- margin-right: 2px;
- .iconfont {
- color: #ffffff;
- font-size: $font-size-28;
- }
- }
- .item-sm{
- line-height: 48rpx;
- font-size: $font-size-22;
- color: #ffffff;
- float: left;
- }
- &.le {
- width: 37%;
- text-align: left;
- }
- &.ce {
- width: 25%;
- text-align: center;
- }
- &.ri {
- width: 37%;
- .item-icon{
- float: right;
- }
- .item-sm{
- float: right;
- }
- }
- }
- }
- }
- .tui-rolling-view {
- width: 100%;
- height: 96rpx;
- background-color: #FF5B00;
- }
- .tui-rolling-content{
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- padding: 20rpx 24rpx;
- border-radius: 24rpx 24rpx 0 0;
- background-color: #FFFFFF;
- }
- .tui-rolling-news {
- width: 100%;
- padding: 0 20rpx;
- border-radius: 8rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-wrap: nowrap;
- line-height: 56rpx;
- background: #fff7f3;
- background-size: cover;
- .tui-roll-label {
- font-weight: bold;
- font-size: $font-size-26;
- color: #ff5b00;
- }
- .tui-roll-more {
- font-size: $font-size-24;
- color: #999999;
- .icon-xiayibu {
- font-size: $font-size-22;
- }
- }
- }
- .tui-swiper {
- font-size: 28rpx;
- height: 50rpx;
- flex: 1;
- }
- .tui-swiper-item {
- display: flex;
- align-items: center;
- }
- .tui-news-item {
- width: 480rpx;
- line-height: 28rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: $font-size-24;
- color: #666666;
- .news-dot {
- display: inline-block;
- width: 10rpx;
- height: 10rpx;
- background-color: #999999;
- border-radius: 50%;
- margin-right: 8rpx;
- float: left;
- margin-top: 10rpx;
- }
- }
- </style>
|