123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <template>
- <view>
- <view class="banner">
- <swiper class="box" autoplay circular @animationfinish="animationfinish">
- <swiper-item v-for="(item,index) in banner" :key="index" @click="go_link(item)">
- <view class="item">
- <view class="img">
- <image :src="item.imgURL" mode="aspectFill"></image>
- </view>
- <view class="title">
- <view class="text">{{item.title}}</view>
- <view class="num">
- <!-- — <text> {{index+1}} </text> — -->
- <text>{{index+1}} / {{banner.length}}</text>
- </view>
- </view>
- </view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- </template>
- <script>
- import {goToLink} from "@/common/common.js"
- export default {
- name:"t-i-banner",
- props: [
- "banner",
- "mine_code"
- ],
- data() {
- return {
-
- }
- },
- methods:{
- go_link(item){
- if(this.mine_code != "zaoquan"){
- console.log(item.link)
-
- let item2 = {
- link:item.jumpURL
- }
-
- goToLink(item2,this.mine_code)
- }else{
- uni.navigateTo({
- url: "../../index/news/news_type/detail/detail?title=" + item.title,
- success: function(res) {
- res.eventChannel.emit('acceptDataFromOpenerPage', {
- data: item
- })
- }
- })
- }
- },
- animationfinish($event){
- this.$emit('change_top_bg_color_img',$event.detail.current)
- }
- }
- }
- </script>
- <style lang="scss">
- .banner{
- margin-top: -60rpx;
- .box{
- width: 750rpx;
- height: 430rpx;
-
- .item{
- width: 750rpx;
-
- position: relative;
- .img{
- margin: 0 auto;
- text-align: center;
- width: 700rpx;
- height: 400rpx;
- border-radius: 20rpx;
- overflow: hidden;
- image{
- margin-top: -20rpx;
- width: 700rpx;
- height: 440rpx;
- border-radius: 20rpx;
- }
- }
- .title{
- position: absolute;
- left: 0;
- bottom: 0;
-
- box-sizing: border-box;
- padding: 15rpx 50rpx;
- width: 750rpx;
-
- line-height: 1.5;
- font-size: 32rpx;
-
- display: flex;
- justify-content: space-between;
-
- .text{
- width: 520rpx;
- color: #FFFFFF;
-
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .num{
- color: #ACB0AC;
- text{
- // color: #23A2EE;
- color: #FFFFFF;
- }
- }
- }
- }
- }
- }
- </style>
|