<template>
  <div v-if="$nuxt.$route.path !== '/project/marywood'">
    <div class="rigth-aside">
      <ul class="right-aside-btns">
        <li @click="showApplyForm">
          <img src="https://zws-imgs-pub.ezijing.com/static/public/d434fa0ffd77892273e63e6d694cff0a.png" />
          <p>{{ $t('aside.apply') }}</p>
        </li>
        <li @click="showFollow">
          <img src="https://zws-imgs-pub.ezijing.com/static/public/5526b83d7526b2742f6eba7151c367db.png" />
          <p>{{ $t('aside.follow') }}</p>
        </li>
      </ul>
    </div>
    <!-- 我要报名 -->
    <van-overlay :show="applyFormVisible" @click="hideApplyForm">
      <div class="dialog-box" @click.stop>
        <apply-form @success="hideApplyForm"></apply-form>
      </div>
    </van-overlay>
    <!-- 关注我们 -->
    <van-overlay :show="followVisible" @click="followVisible = false">
      <div class="dialog-box" @click.stop>
        <h2 class="title">{{ $t('aside.follow') }}</h2>
        <div class="follow">
          <img src="https://zws-imgs-pub.ezijing.com/static/public/d2d9945d598e81c3b58aff5ce927a78a.jpg" />
          <p>{{ $t('aside.pay') }}</p>
        </div>
      </div>
    </van-overlay>
  </div>
</template>
<script>
import ApplyForm from '@/components/ApplyForm'
export default {
  components: { ApplyForm },
  data() {
    return {
      applyFormVisible: false,
      followVisible: false
    }
  },
  methods: {
    // 我要报名
    showApplyForm() {
      this.applyFormVisible = true
    },
    hideApplyForm() {
      this.applyFormVisible = false
    },
    // 关注我们
    showFollow() {
      this.followVisible = true
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .van-overlay {
  z-index: 100;
}
.rigth-aside {
  position: fixed;
  top: 50%;
  right: 16px;
  z-index: 99;
  transform: translateY(-50%);
  .right-aside-btns {
    box-shadow: 0 2px 4px 0 rgb(0 0 0 / 10%);
    li {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 0.5rem;
      height: 0.5rem;
      font-size: 0.1rem;
      color: #999;
      background-color: #fff;
      cursor: pointer;
      img {
        width: 0.23rem;
        height: 0.23rem;
      }
    }
    li + li {
      border-top: 1px solid #999;
    }
  }
}
.dialog-box {
  padding: 0.1rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 0 auto;
  width: 345px;
  height: 426px;
  background: url('https://webapp-pub.ezijing.com/www/h5/images/dialog_bg.png') no-repeat;
  background-size: cover;
  .title {
    padding: 30px 0;
    font-size: 20px;
    color: #fff;
    text-align: center;
  }
}
.follow {
  img {
    width: 182px;
    height: 182px;
  }
  p {
    margin-top: 20px;
    font-size: 12px;
    color: #fff;
    text-align: center;
  }
}
</style>
