WechatLoginPage.vue 2.51 KB
<template>
  <div class="auth-bg">
    <div class="auth-container">
      <!-- 返回按钮 -->
      <div class="back-button" @click="goBack">
        <img src="/zuo.svg" alt="goBack" class="input-icon-svg" />
      </div>

      <!-- 头部Logo与标题 -->
      <div class="auth-header">
        <div class="logo-container">
          <img src="/newLogo.png" alt="Logo" class="logo-img" />
        </div>
        <h1 class="auth-title">{{ $t("login.wechatLogin") }}</h1>
        <p class="auth-subtitle">{{ $t("login.wechatLoginTip") }}</p>
      </div>

      <!-- 内嵌二维码登录组件 -->
      <WechatLogin />
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter, useRoute } from "vue-router";
import WechatLogin from "@/components/auth/WechatLogin.vue";
import { useI18n } from "vue-i18n";

const { t } = useI18n();
const router = useRouter();
const route = useRoute();
const goBack = () => {
  const mode = (route.query["mode"] as string | undefined) || undefined;
  if (mode === "bind") {
    router.replace({ path: "/app/settings", query: { tab: "profile" } });
  } else {
    router.push("/auth");
  }
};
</script>

<style scoped lang="scss">
.auth-bg {
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.auth-container {
  background: var(--color-bg);
  border-radius: 20px;
  padding: 40px 32px 32px 32px;
  max-width: 420px;
  width: 92vw;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 1;
}

.back-button {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);

  &:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
  }

  .input-icon-svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 16px;
}

.logo-container {
  width: auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.logo-img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e6fff;
  line-height: 1.3;
}

.auth-subtitle {
  font-size: 13px;
  color: #909399;
}
</style>