<script setup>
import {ref, onMounted} from 'vue'
import Logo from './components/logo.vue'
import Nav from './components/nav.vue'
import QRCode from './components/QRCode.vue'
import DownloadImg from '@/components/downloadImg/index.vue'
import {ElMessage} from 'element-plus'

const imgType = ref('ios')
const showImgType = ref(false)

const handleDownloadClick = (type) => {
  if (type === 'pc') {
    ElMessage.warning('敬请期待！')
    return
  }
  imgType.value = type
  showImgType.value = true
}

onMounted(() => {})

const toMIIF = () => {
  window.open('https://beian.miit.gov.cn')
}
</script>

<template>
  <div class="page flex a-c">
    <!-- logo -->
    <Logo id="logo" />

    <!-- 内容 -->
    <Nav id="nav" @download-click="handleDownloadClick" />

    <!-- 二维码 -->
    <QRCode id="QR" />

    <div id="MIIT-Filing">
      <span class="company">
        Copyright © 2023.Rangu Technology Co.,Ltd. All rights reserved.
        燃谷科技（南京）有限公司
      </span>
      <span class="url" @click="toMIIF">苏ICP备2023030548号-1</span>
      <span class="url" @click="toMIIF">苏ICP备2023030548号-5</span>
    </div>

    <DownloadImg :type="imgType" v-model="showImgType" />
  </div>
</template>

<style lang="scss" scoped>
.page {
  background-color: $bg_color;
  $top: 58px;

  position: relative;
  #logo {
    width: 220px;
    height: 300px;
    position: absolute;
    top: 43px;
    left: 190px;
  }
  #nav {
    width: calc(100% - 410px - 550px);
    position: absolute;
    left: 410px;
    top: $top;
    padding: 0 90px 0 55px;
    box-sizing: border-box;
  }
  #QR {
    width: 320px;
    height: 150px;
    position: absolute;
    top: $top;
    right: 180px;
  }
  #MIIT-Filing {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    .company {
      color: $white;
    }
    .url {
      margin-left: 50px;
      color: #0056b3;
      cursor: pointer;
    }
  }
}
</style>
