<template>
  <view class="template-power tn-safe-area-inset-bottom">
    <!-- 顶部自定义导航 -->
    <tn-nav-bar fixed alpha customBack>
      <view slot="back" class='tn-custom-nav-bar__back'
        @click="goBack">
        <text class='icon tn-icon-left'></text>
        <text class='icon tn-icon-home-capsule-fill'></text>
      </view>
    </tn-nav-bar>
    
    <swiper class="card-swiper" :circular="true"
      :autoplay="true" duration="500" interval="18000" @change="cardSwiper"> 
      <swiper-item v-for="(item,index) in swiperList" :key="index" :class="cardCur==index?'cur':''">
        <view class="swiper-item image-banner">
          <image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
        </view>
        <view class="swiper-item2 image-banner">
          <image class="png-sussuspension" :src="item.pngurl" mode="heightFix" v-if="item.type=='image'"></image>
        </view>
        <view class="swiper-item-text">
          <view class="text-sussuspension">
            <view class="tn-text-xxl tn-text-bold tn-color-white">{{item.title}}</view>
            <view class="tn-text-bold tn-color-white tn-padding-top-xs" style="font-size: 60rpx;">{{item.name}}</view>
            <view class="tn-text-sm tn-text-bold tn-color-white tn-padding-top-sm tn-padding-bottom-sm">{{item.text}}</view>
          </view>
        </view>
      </swiper-item>
    </swiper>
    <view class="indication">
        <block v-for="(item,index) in swiperList" :key="index">
            <view class="spot" :class="cardCur==index?'active':''"></view>
        </block>
    </view>
    
    <view class="power-round tn-bg-white">
    </view>
    
    
    <view class="power-radius" >
      
      <!-- 方式17 start-->
      <view class="tn-flex tn-margin" style="padding: 15rpx 0 170rpx 0;">
        <view class="tn-flex-1 power-shadow power-radius tn-bg-white" style="margin-right: 15rpx;padding: 40rpx 0;">
          <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
            <view class="icon17__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-cyan tn-color-white tn-shadow-blur">
              <!-- <view class="tn-icon-shop"></view> -->
              <view class="tn-text-bold">
                借
              </view>
            </view>  
            <view class="tn-text-center">
              <view class="tn-text-ellipsis tn-text-xl tn-text-bold tn-padding-top-sm tn-color-cyan">免押金借</view>
            </view>
          </view>
        </view>
        <view class="tn-flex-1 power-shadow power-radius tn-bg-white" style="margin-left: 15rpx;padding: 40rpx 0;">
          <view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
            <view class="icon17__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-orangeyellow tn-color-white tn-shadow-blur">
              <!-- <view class="tn-icon-electromobile"></view> -->
              <view class="tn-text-bold">
                还
              </view>
            </view>  
            <view class="tn-text-center">
              <view class="tn-text-ellipsis tn-text-xl tn-text-bold tn-padding-top-sm tn-color-orangeyellow">快速归还</view>
            </view>
          </view>
        </view>
      </view>
    </view>
    
    
    <!-- 底部tabbar start-->
    <view class="tabbar footerfixed">
      <view class="action">
        <view class="bar-icon">
          <view class="tn-icon-company">
          </view>
          <!-- <image class="" src='https://resource.tuniaokj.com/images/tabbar/home_tnnew.png'></image> -->
        </view>
        <view class="tn-color-black">附近门店</view>
      </view>
      <view class="action">
        <view class="bar-circle tn-shadow-blur">
          <view class="tn-icon-scan tn-color-white">
          </view>
          <!-- <image class="" src='https://resource.tuniaokj.com/images/tabbar/information_tn.png'></image> -->
        </view>
        <view class="tn-color-gray">扫码租借</view>
      </view>
      <view class="action">
        <view class="bar-icon">
          <view class="tn-icon-my tn-color-gray--dark">
          </view>
          <!-- <image class="" src='https://resource.tuniaokj.com/images/tabbar/my_tn.png'></image> -->
        </view>
        <view class="tn-color-gray">个人中心</view>
      </view>
    </view>
    
  </view>
</template>

<script>
  import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
  export default {
    name: 'TemplatePower',
    mixins: [template_page_mixin],
    data(){
    return {
        cardCur: 0,
        swiperList: [{
          id: 0,
          type: 'image',
          title: '一飞充天',
          name: '图鸟充电电',
          text: '充电就是快',
          url: 'https://resource.tuniaokj.com/images/swiper/banner-animate3.png',
          pngurl: 'https://resource.tuniaokj.com/images/login/1/login_top3.png'
        }, {
          id: 1,
          type: 'image',
          title: '图鸟南南',
          name: '欢迎加入东东们',
          text: '如果你也有不错的作品',
          url: 'https://resource.tuniaokj.com/images/swiper/banner-animate2.png',
          pngurl: 'https://resource.tuniaokj.com/images/swiper/c4d1.png'
        }, {
          id: 2,
          type: 'image',
          title: '图鸟西西',
          name: '一起玩转scss',
          text: '用最少的代码做最骚的效果',
          url: 'https://resource.tuniaokj.com/images/swiper/deer.jpg',
          pngurl: 'https://resource.tuniaokj.com/images/swiper/c4d1.png'
        }, {
          id: 3,
          type: 'image',
          title: '图鸟北北',
          name: '微信号 tnkewo',
          text: '商业合作请联系作者',
          url: 'https://resource.tuniaokj.com/images/swiper/banner-animate.png',
          pngurl: 'https://resource.tuniaokj.com/images/swiper/c4d1.png'
        }, {
          id: 4,
          type: 'image',
          title: '图鸟猪猪',
          name: '努力成为大佬',
          text: '一起加油吖',
          url: 'https://resource.tuniaokj.com/images/shop/banner2.jpg',
          pngurl: 'https://resource.tuniaokj.com/images/swiper/c4d1.png'
        }]
      }
    },
    methods: {
      // cardSwiper
      cardSwiper(e) {
        this.cardCur = e.detail.current
      },
    }
  }
</script>

<style lang="scss" scoped>
  @import '@/static/css/templatePage/custom_nav_bar.scss';
  /* 内容布局 start*/
  .power-shadow{
    box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.07);
  }
  .power-radius{
    border-radius: 15%;
  }
  
  /* 圆角 start*/
  .power-round {
    position: relative;
    z-index: 1;
    margin-top: -40rpx;  
    height: 42rpx;
    border-radius: 80rpx 80rpx 0 0;
  }
  
  /* 悬浮 */
  .png-sussuspension{
    animation: suspension 3s ease-in-out infinite;
  }
  @keyframes suspension {
    0%, 100% {
      transform: translate(0 , 0);
    }
    50% {
      transform: translate(-0.8rem , 1rem);
    }
  }
  .text-sussuspension{
    animation: suspension2 4s ease-in-out infinite;
  }
  
  @keyframes suspension2 {
    0%, 100% {
      transform: translate(0 , 0);
    }
    50% {
      transform: translate(0rem , 1rem);
    }
  }

  
  /* 轮播视觉差 start */
  .card-swiper {
    height: 800rpx !important;
  }
    
  .card-swiper swiper-item {
    width: 750rpx !important;
    left: 0rpx;
    box-sizing: border-box;
    // padding: 0rpx 30rpx 90rpx 30rpx;
    overflow: initial;
  }
    
  .card-swiper swiper-item .swiper-item {
    width: 100%;
    display: block;
    height: 100%;
    transform: scale(1);
    transition: all 0.2s ease-in 0s;
    overflow: hidden;
  }
    
  .card-swiper swiper-item.cur .swiper-item {
    transform: none;
    transition: all 0.2s ease-in 0s;
  }
  
  .card-swiper swiper-item .swiper-item2 {
    margin-top: -540rpx;
    width: 100%;
    display: block;
    height: 100%;
    border-radius: 0rpx;
    transform: translate(140rpx, 20rpx) scale(0.3, 0.3);
    transition: all 0.6s ease 0s;
    overflow: hidden;
  }
    
  .card-swiper swiper-item.cur .swiper-item2 {
    margin-top: -620rpx;
    width: 100%;
    transform: translate(180rpx, 0rpx) scale(0.5, 0.5);
    transition: all 0.6s ease 0s;
  }
    
  .card-swiper swiper-item .swiper-item-text {
    margin-top: -520rpx;
    width: 100%;
    display: block;
    height: 50%;
    border-radius: 10rpx;
    transform: translate(100rpx, -60rpx) scale(0.9, 0.9);
    transition: all 0.6s ease 0s;
    overflow: hidden;
  }
    
  .card-swiper swiper-item.cur .swiper-item-text {
    margin-top: -580rpx;
    width: 100%;
    transform: translate(0rpx, 60rpx) scale(0.9, 0.9);
    transition: all 0.6s ease 0s;
  }
  
  .image-banner{
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .image-banner image{
    width: 100%;
    height: 100%;
  }
  
  /* 轮播指示点 start*/
  .indication{
    z-index: 9999;
    width: 100%;
    height: 36rpx;
    position: absolute;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:center;
  }
  
  .spot{
    background-color: #FFFFFF;
    opacity: 0.6;
    width: 10rpx;
    height: 10rpx;
    border-radius: 20rpx;
    top: -130rpx;
    margin: 0 8rpx !important;
    position: relative;
  }
  
  .spot.active{
    opacity: 1;
    width: 30rpx;
    background-color: #FFFFFF;
  }
  
  /* 图标容器17 start */
  .icon17 {
    &__item {
      width: 30%;
      background-color: #FFFFFF;
      border-radius: 10rpx;
      padding: 30rpx;
      margin: 20rpx 10rpx;
      transform: scale(1);
      transition: transform 0.3s linear;
      transform-origin: center center;
      
      &--icon {
        width: 200rpx;
        height: 200rpx;
        font-size: 60rpx;
        border-radius: 30%;
        margin-bottom: 18rpx;
        position: relative;
        z-index: 1;
        
        &::after {
          content: " ";
          position: absolute;
          z-index: -1;
          width: 100%;
          height: 100%;
          left: 0;
          bottom: 0;
          border-radius: inherit;
          opacity: 1;
          transform: scale(1, 1);
          background-size: 100% 100%;
          background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg5.png);
  
            
        }
      }
    }
  }
  
  /* 底部tabbar start*/
  .footerfixed{
   position: fixed;
   width: 100%;
   bottom: 0;
   z-index: 999;
   background-color: #FFFFFF;
   box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
  }
  
  .tabbar {
    display: flex;
    align-items: center;
    min-height: 110rpx;
    justify-content: space-between;
  	padding: 0;
  	height: calc(110rpx + env(safe-area-inset-bottom) / 2);
  	padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  }
  
  .tabbar .action {
  	font-size: 22rpx;
  	position: relative;
  	flex: 1;
  	text-align: center;
  	padding: 0;
  	display: block;
  	height: auto;
  	line-height: 1;
  	margin: 0;
  	overflow: initial;
  }
  
  .tabbar .action .bar-icon {
  	width: 100rpx;
  	position: relative;
  	display: block;
  	height: auto;
  	margin: 0 auto 10rpx;
  	text-align: center;
  	font-size: 42rpx;
    // line-height: 50rpx;
  }
  
  .tabbar .action .bar-icon image {
  	width: 50rpx;
  	height: 50rpx;
  	display: inline-block;
  }
  
  .tabbar .action .bar-circle {
    position: relative;
    display: block;
    margin: -60rpx auto 20rpx;
    text-align: center;
    font-size: 52rpx;
    line-height: 90rpx;
    background-color: #01BEFF;
    width: 90rpx !important;
    height: 90rpx !important;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(1, 190, 255, 0.5);
  }
  
  .tabbar .action .bar-circle image {
    width: 60rpx;
  	height: 60rpx;
  	display: inline-block;
    margin: 15rpx auto 15rpx;
  }
</style>
