<script setup>
import { onMounted, getCurrentInstance } from 'vue'
import { userStore } from '@/store/userInfo'
import { get } from '../../utils/request'
import Phone from '@/components/icon/phone.vue'
import Email from '@/components/icon/email.vue'

const { proxy } = getCurrentInstance()

onMounted(() => {
  updataUserInfo()
})
// 获取用户信息
const updataUserInfo = () => {
  get(
    '/pdf-tech/vppMember/getMemberInfo'
  ).then((res) => {
    if (res.data.code === 200 && res.data.msg == 'success') {
      userStore().setUserInfo(res.data.result)
      if(res.data.result.validFlag === '0'){
        proxy.$router.push('/login')
      }
    }
  })
}
</script>

<template>
  <div>
    <h1 class="leading-40px">Support</h1>
    <div
      class="
        mt-36px
        mb-16px
        leading-20px
        text-16px
        font-bold
        flex
        justify-between
      "
    >
      Contact us
    </div>
    <div class="flex flex-col">
      <div class="w-[49%] mr-24px h-116px bg-[#fff] rounded-8px flex items-center">
        <div class="ml-32px mr-24px"><Email /></div>
        <div>
            <p class="text-16px font-bold leading-20px">Email</p>
            <a href="mailto:support@pdfreaderpro.com?subject=Cooperate with PDF Technologies, Inc. " class="flex leading-20px mt-12px text-[#1460F3] underline">support@pdfreaderpro.com</a>
        </div>
      </div>
      <div class="w-[49%] mt-24px h-116px bg-[#fff] rounded-8px flex items-center">
        <div class="ml-32px mr-24px"><Phone /></div>
        <div>
            <p class="text-16px font-bold leading-20px">Admin Console Guidelines</p>
            <a  href="/download/Admin Console Guidelines.pdf" download="Admin Console Guidelines.pdf" class="flex leading-20px mt-12px text-[#1460F3] underline">Click to download</a>
        </div>
      </div>
    </div>
  </div>
</template>