<template>
  <div class="ebtm-menu">
    <img @click.stop="$bus.$emit('changeMenu', 'func')" :src="require(`@/assets/images/proj2022/mobile/menu_active@2x.png`)" alt="" />
    <ul>
      <li v-for="(item, i) in list" :key="i">
        <div :class="{ active: item.id == $route.params.type }" @click="onClick(item)">
          <img :src="require(`@/assets/images/proj2022/mobile/zhanxiang/${item.id}@2x.png`)" alt="" />
        </div>
      </li>
    </ul>
    <div v-if="!g_isLandscape" class="eb-next">
      <img @click="isFirstPage = !isFirstPage" :src="require(`@/assets/images/proj2022/mobile/zhanxiang/${isFirstPage ? 'next' : 'next_left'}.png`)" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  props: ["tourStatus"],
  data() {
    return {
      isFirstPage: true,
    };
  },
  computed: {
    list() {
      if (this.g_isLandscape) {
        return this.themes
      }
      return this.isFirstPage ? [...this.themes.slice(0, 5)] : [...this.themes.slice(5, 7)];
    },
  },

  methods: {
    onClick(item) {
        this.$router.push({ params: { type: item.id, isjump: "yes" } });
      // this.$bus.$emit("emitShowZX", {
      //   show: true,
      //   current: item.id,
      // });
    },
  },
};
</script>

<style lang="less" scoped>
.smenu {
  width: 100%;

  .sdaolan,
  .stoptour {
    position: fixed;
    cursor: pointer;
    bottom: 113px;
    width: 45px;
    height: 45px;
    left: 14px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    &::before {
      backdrop-filter: blur(10px) brightness(60%);
    }
    .daolan {
      position: absolute;
      top: 52%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      > img {
        width: 20px;
      }
    }
  }
  .stoptour {
    .daolan {
      position: absolute;
      top: 54%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      > img {
        width: 24px;
      }
    }
  }

  .ebtm-menu {
    position: fixed;
    bottom: 0%;
    left: 0%;
    z-index: 999;
    width: 100%;
    height: 103px;
    background-image: url("~@/assets/images/proj2022/mobile/shuping_left@2x.png");
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: bottom left;
    > img {
      position: absolute;
      top: -10px;
      right: 10px;
      width: 12%;
    }
    .brightness {
      &::before {
        backdrop-filter: blur(10px) brightness(60%);
      }
    }
    > ul {
      width: calc(100% - 40px);
      height: 50%;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      text-align: center;
      z-index: 9999;
      position: absolute;
      bottom: 10px;
      left: 0;
      > li {
        display: inline-block;
        padding: 0 0;
        width: 12vw;
        margin: 0 10px;
        flex-shrink: 0;
        > div {
          > img {
            width: 100%;
            opacity: 0.6;
          }
          > span {
            font-size: 12px;
            color: rgba(255, 255, 255, 0.6);
            transform: scale(0.9) translateY(-10px);
            display: inline-block;
          }
        }
        .active {
          position: relative;
          &::after {
            content: "";
            width: 20px;
            height: 20px;
            display: inline-block;
            position: absolute;
            background-color: #fff;
            border-radius: 50%;
            top: 10%;
            left: 50%;
            transform: translateX(-50%);
            filter: blur(7px);
          }
          > img {
            opacity: 1;
          }
          > span {
            color: rgba(255, 255, 255, 1);
          }
        }
      }
    }

    .eb-next {
      position: absolute;
      top: 50%;
      right: 10px;
    }
  }
}

/*横屏*/
@media screen and (orientation: landscape) {
  .smenu {
    width: 100%;
    .ebtm-menu {
      position: fixed;
      bottom: 0%;
      left: 0%;
      z-index: 999;
      width: 100%;
      height: 110px !important;
      background-image: url("~@/assets/images/proj2022/mobile/hengping@2x.png") !important;
      background-size: 100% auto;
      background-repeat: no-repeat;
      background-position: bottom left;
      > img {
        position: absolute;
        top: 0;
        left: 10px;
        width: 60px!important;
      }
      .brightness {
        &::before {
          backdrop-filter: blur(10px) brightness(60%);
        }
      }
      > ul {
        width: 76%!important;
        height: 50%;
        display: flex;
        justify-content: center;
        align-items: flex-end!important;
        text-align: center;
        z-index: 9999;
        position: absolute;
        bottom: 6px!important;
        left: 50%;
        transform: translateX(-50%)!important;
        > li {
          display: inline-block;
          padding: 0 0;
          width: 44px;
          margin: 0 20px;
          > div {
            > img {
              width: 100%;
              opacity: 0.6;
            }
            > span {
              font-size: 12px;
              color: rgba(255, 255, 255, 0.6);
              transform: scale(0.9) translateY(-10px);
              display: inline-block;
            }
          }
          .active {
            position: relative;
            &::after {
              content: "";
              width: 20px;
              height: 20px;
              display: inline-block;
              position: absolute;
              background-color: #fff;
              border-radius: 50%;
              top: 10%;
              left: 50%;
              transform: translateX(-50%);
              filter: blur(7px);
            }
            > img {
              opacity: 1;
            }
            > span {
              color: rgba(255, 255, 255, 1);
            }
          }
        }
      }
    }
  }
}

.likeAddAnimate-enter-active,
.likeAddAnimate-leave-active {
  transition: all 2.5s ease;
}
.likeAddAnimate-enter,
.likeAddAnimate-leave {
  transform: translate(-50%, 0) scale(0);
  opacity: 0;
}
.likeAddAnimate-enter-to,
.likeAddAnimate-leave-to {
  transform: translate(-50%, -80px) scale(1.2);
  opacity: 1;
}
.good {
  position: fixed;
  bottom: 60px;
  left: 50%;
  display: flex;
  .pic {
    width: 35px;
    > img {
      width: 100%;
      height: 100%;
    }
  }
  .num {
    margin-top: 10px;
    margin-left: 10px;
  }
}

.noshow {
  position: fixed;
  top: -100px;
  left: -100px;
  opacity: 0;
  visibility: hidden;
}
</style>
