<template>
  <div id="js_home">
    <RegPhonePwd v-if="showReg" />
    <WxTips v-if="showWxTips" @onShowControl="onShowControl" />
  </div>
</template>

<script>
// 注册
import RegPhonePwd from "@/views/Home/RegPhonePwd";
// 微信提示
import WxTips from "@/components/WxTips";
export default {
  name: "Home",
  components: {
    RegPhonePwd,
    WxTips,
  },
  data() {
    return {
      showReg: false, // 显示注册
      showWxTips: false, // 显示微信内提示
    };
  },
  computed: {},
  watch: {},
  created() {
    const isWeChat = this.$utils.isWeChat();
    // 微信内
    if (isWeChat) {
      this.onShowControl({ showWxTips: true });
      return;
    }
    this.onShowControl({ showReg: true });
  },
  mounted() {},
  methods: {
    onShowControl(showObj) {
      const { showReg, showWxTips } = showObj;
      this.showReg = showReg;
      this.showWxTips = showWxTips;
    },
  },
};
</script>

<style lang="less"  scoped>
#js_home {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  background-color: rgba(0, 0, 0, 0.6);
}

// 正常横屏样式
@media all and (orientation: landscape),
  /** 伪竖屏*/all and (orientation: portrait) and (min-width: 600px) and (min-height: 800px) {
  // 横屏最大高度
  // height: 260 / @rem;
  //   overflow-y: auto;
}

// ipad 横屏
@media /** 伪竖屏*/all and (orientation: portrait) and (min-width: 600px) and (min-height: 800px),
  /**ipad伪横屏 */ all and (orientation: landscape) and (min-width: 800px) and (min-height: 600px),
  all and (min-device-aspect-ratio: 3/4) and (max-device-aspect-ratio: 4/3),
  all and (device-aspect-ratio: 4/3) {
  #js_home {
    overflow-y: auto;
  }
}
</style>