<template>
  <div class="welfare-index">
    <div class="welfare-index-header">福利中心</div>
    <div class="enter">
      <div v-for="(item, idx) in wfTypes" :key="idx" :class="`block b${idx + 1}`" @click="$router.push(item.target)">
        <span class="title">{{ item.title }}</span>
        <div class="target"><i class="icon-right-circle iconfont-welfare4"></i></div>
      </div>
    </div>
  </div>
</template>

<script>
import { wfTypes } from '@/config/mapping/common';
export default {
  name: 'Index',
  data() {
    return {
      wfTypes
    };
  },
  methods: {
    openTab(item) {
      window.open(location.origin + '/welfare' + item.target);
    }
  }
};
</script>

<style lang="scss" scoped>
@mixin b($bg1, $bg2, $color) {
	color: $color;
  background: linear-gradient(180deg,$bg1 0%, $bg2 100%);
  span.title {
    background: $color;
  }
}
.welfare-index {
  margin: -20px;
  width: 100% !important;
  background-color: initial !important;
  &-header {
    height: 50px;
    line-height: 50px;
    padding-left: 20px;
    color: #303133;
    margin-bottom: 20px;
    background-color: #fff;
    font-weight: 500;
  }
  &::after {
    height: 0 !important;
  }
}
.enter {
  min-height: calc(100vh - 120px);
  background-color: #fff;
  display: flex;
  align-content: center;
  justify-content: center;
  padding-top: 80px;
  @for $i from 1 through 4 {
    > div.b#{$i}::after {
      content: '';
      display: block;
      width: 231px;
      height: 211px;
      position: absolute;
      right: 0;
      bottom: 0;
      background: url('../assets/images/0#{$i}.png');
    }
  }
  .block:hover {
    // margin-top: -10px;
    transition: transform 0.3s ease-in-out;
    transform: translateY(-20px);
  }
  > div {
    transition: all 0.2s;
    width: 280px;
    cursor: pointer;
    position: relative;
    height: 360px;
    border-radius: 12px;
    margin-right: 28px;
    &:last-child {
      margin-right: 0;
    }
    &.b1 { @include b(#FAE5E5, #F7CECD, #EB584F); }
    &.b2 { @include b(#F8F7E4, #F7F1CB, #F1BD49); }
    &.b3 { @include b(#f1f1f9, #D9E1FA, #597EF7); }
    &.b4 { @include b(#F5E8DF, #F2D8C8, #DF7D45); }
    p.desc {
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
      margin: 20px;
      color: inherit;
    }
    .target {
      position: absolute;
      cursor: pointer;
      color: inherit;
      width: 40px;
      height: 40px;
      top: 70px;
      left: 22px;
      i {
        color: inherit;
        font-size: 32px;
      }
    }
    span.title {
      padding-left: 20px;
      width: 140px;
      display: inline-block;
      line-height: 40px;
      color: white;
      border-radius: 12px 0px 12px 0px;
      font-size: 20px;
      font-weight: 500;
    }
  }
}
</style>
