<script setup>
import { user, webInfo } from "~/store/index";
import footer_logo from "~/assets/footer_logo.png";
import kfpt_logo from "~/assets/kfptIcon.png";

function openWeb() {
  let token = user.value.token
  user.value = null
  let linkUrl =
    "https://jltweb.bozedu.net/#/home/openPlatform" +
    '?' +
    encodeURIComponent(
      "appname=" +
      "开放平台" +
      "&appicon=" +
      "" +
      "&token=" +
      token +
      "&js_code=" +
      webInfo.value?.js_code
    );
  window.open(linkUrl, "_blank");
}

const qrcode = computed(() => {
  return `${window.GLOBAL_CONFIG.oss}/${webInfo.value?.js_qrcode}`;
});
</script>

<template>
  <div class="w-full flex items-center justify-center bg-hex-171d2f">
    <div class="w-1200px flex justify-between py-6 text-white">
      <div>
        <div class="flex items-center">
          <img :src="footer_logo" alt="" class="h-28px" />
          <div class="mx-3 h-16px w-1px bg-white" />
          <div class="text-lg">智慧教育云平台</div>
        </div>
        <div class="mb-50px mt-30px flex cursor-pointer" @click="openWeb">
          <img class="mr-4 h-22px w-22px" :src="kfpt_logo" alt="" />
          <div class="text-base">开放平台</div>
        </div>
        <div class="text-base text-hex-828282" v-html="webInfo?.js_desc" />
      </div>
      <div>
        <img v-if="webInfo?.js_qrcode" :src="qrcode" alt="" class="w-110px" />
        <div v-if="webInfo?.js_qrcode" class="text-center text-sm">
          扫码关注我们
        </div>
      </div>
    </div>
  </div>
</template>
