Files
aida_front/src/views/Login.vue

373 lines
9.1 KiB
Vue
Raw Normal View History

2025-04-30 14:01:52 +08:00
<template>
<div class="loginPage">
<div class="left">
2025-06-30 10:53:25 +08:00
<div class="imgBox">
2025-08-22 10:27:48 +08:00
<video src="@/assets/images/homePage/login_banner.mp4" autoplay muted loop playsinline webkit-playsinline x5-playsinline></video>
</div>
<div class="fixed">Designed with AiDA</div>
<div class="mask" v-show="loginType">
<!-- <div class="bg"></div> -->
<img src="@/assets/images/homePage/maskIcon.png" alt="">
2025-06-30 10:53:25 +08:00
</div>
</div>
<div class="right">
2025-08-22 10:27:48 +08:00
<i class="fi fi-br-angle-left" @click="toBack" v-show="!loginType"></i>
<div class="Text" v-show="!loginType">
2025-08-22 10:27:48 +08:00
<img src="@/assets/images/homePage/aidaIcon.png" alt="">
2025-07-19 14:04:48 +08:00
<div class="title">
2025-08-22 10:27:48 +08:00
<p>Welcome to <span>AiDA</span></p>
2025-07-19 14:04:48 +08:00
</div>
<div class="info">
2025-06-30 10:53:25 +08:00
AiDA, a first-to-market technology that empowers fashion designers, based on their creative inspirations, to work with AI to create original designs.
</div>
</div>
2025-07-24 09:26:27 +08:00
<div class="loginBox" :class="{'active':loginType}">
<div class="selectType" v-show="!loginType">
2025-07-19 14:04:48 +08:00
<div class="text">Continue with one of these:</div>
<div class="typeList">
2025-07-19 14:04:48 +08:00
<div class="gallery_btn" @click="setLoginType('personal')">
2025-06-30 10:53:25 +08:00
Individual
</div>
2025-07-19 14:04:48 +08:00
<div class="gallery_btn" @click="setLoginType('school')">
2025-06-30 10:53:25 +08:00
Academic
</div>
2025-07-24 09:26:27 +08:00
<!-- <div class="gallery_btn" @click="setLoginType('enterprise')">
Enterprise
</div> -->
</div>
</div>
<div class="login" v-show="loginType">
<div class="title">
2025-08-22 10:27:48 +08:00
<i class="fi fi-br-angle-left" @click="loginBack"></i>
<!-- <i class="fi fi-rr-arrow-left" @click="()=>loginType = ''"></i> -->
2025-09-16 14:02:50 +08:00
<span>Log on to AiDA 3.1</span>
</div>
2025-08-22 10:27:48 +08:00
<div class="info" v-show="!loginType">Please fill your information below</div>
<personal ref="personal" v-if="loginType == 'personal'" v-model:isMask="isMask"></personal>
2025-08-22 10:27:48 +08:00
<school ref="school" v-if="loginType == 'school'"></school>
<enterprise ref="enterprise" v-if="loginType == 'enterprise'"></enterprise>
</div>
</div>
<div class="mark_loading" v-show="isMask">
<a-spin size="large" />
</div>
</div>
</div>
2025-04-30 14:01:52 +08:00
</template>
<script lang="ts">
import {
defineComponent,
computed,
ref,
provide,
nextTick,
createVNode,
toRefs,
reactive,
2025-09-08 14:50:59 +08:00
onMounted
} from "vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
2025-04-30 14:01:52 +08:00
import { Https } from "@/tool/https";
import { useStore } from "vuex";
import { useI18n } from "vue-i18n";
import md5 from "md5";
2025-04-30 14:01:52 +08:00
import Works from "@/views/HomeView/Works.vue";
import { message } from "ant-design-vue";
import { isEmail } from "@/tool/util";
import personal from "@/component/LoginPage/login/personal.vue";
2025-08-22 10:27:48 +08:00
import { useRoute,useRouter } from 'vue-router';
2025-04-30 14:01:52 +08:00
import school from "@/component/LoginPage/login/school.vue";
import enterprise from "@/component/LoginPage/login/enterprise.vue";
2025-09-08 14:50:59 +08:00
import { setCookie, WriteCookie } from "@/tool/cookie";
2025-04-30 14:01:52 +08:00
export default defineComponent({
components: {
Works,
personal,
school,
enterprise,
},
props: {},
emits: [],
setup(props, { emit }) {
const store = useStore();
2025-08-22 10:27:48 +08:00
const router = useRouter()
2025-09-08 14:50:59 +08:00
const route = useRoute()
const loginData = reactive({
loginType: "",
isMask: false,
});
2025-08-22 10:27:48 +08:00
const dataDom = reactive({
personal: null as any,
school: null as any,
enterprise: null as any,
}) as any;
const setLoginType = (str: any) => {
loginData.loginType = str;
};
2025-08-22 10:27:48 +08:00
const loginBack = ()=>{
if(dataDom?.[loginData.loginType].emailStap == 2){
dataDom[loginData.loginType].emailLastStepFun()
}else{
loginData.loginType = ''
}
}
const toBack = ()=>{
router.push('/Square')
}
2025-09-08 14:50:59 +08:00
const setSuccessLogin = (rv: any)=>{
if (rv) {
if (rv.systemUser == 4) {
rv.systemUser = 1;
}
let isTest = rv.systemUser == 3 ? true : false;
let isBeginner = rv?.isBeginner == 1 ? true : false;
let token = rv.token;
setCookie("isMurmur", false);
setCookie("token", token);
setCookie("isTest", isTest);
setCookie("isBeginner", isBeginner);
setCookie("isBeginnerNum", 0); //从第一步开始,机器人开始的话就是从第二部开始
setCookie("userInfo", JSON.stringify(rv));
let userid: any = {
ueserId: rv.userId,
systemUser: rv.systemUser,
};
if (rv.email) userid.email = rv.email;
store.commit("upUserDetail", userid);
if (window.innerWidth < 768) {
message.info(
"If you need to design, please log in using an iPad or computer."
);
turnToHomePage("/Square");
} else {
turnToHomePage("/home");
}
sessionStorage.setItem("isTimeOne", JSON.stringify(false)); //是否需要公告 提示 弹窗
let randomNum: any =
Math.floor(Math.random() * 9000000000000000) + 1000000000000000;
sessionStorage.setItem("sessionId", randomNum);
sessionStorage.setItem("record", JSON.stringify([]));
}
}
const turnToHomePage = (str: any)=>{
store.commit("clearAllData");
store.commit("clearAllCollection");
store.commit("setAllBoardDataChoose", {});
store.commit("clearShowSketchboard", {});
router.push(str);
}
const wechatLogin =(value: any)=>{
let data = {
code: value.code,
type: 2,
};
Https.axiosGet(Https.httpUrls.parseWeChatCode, { params: data })
.then((rv: any) => {
setSuccessLogin(rv);
})
.catch((res) => {
});
}
onMounted(()=>{
const data = route.query;
if (data?.state == "weiXin") {
wechatLogin(data);
}
})
return {
...toRefs(dataDom),
...toRefs(loginData),
setLoginType,
2025-08-22 10:27:48 +08:00
loginBack,
toBack,
};
},
provide() {
return {};
},
});
2025-04-30 14:01:52 +08:00
</script>
<style lang="less" scoped>
.loginPage {
width: 100%;
height: 100%;
position: relative;
display: flex;
2025-07-19 14:04:48 +08:00
background: #000;
> .left,
> .right {
height: 100%;
}
> .left {
2025-08-22 10:27:48 +08:00
width: 41%;
2025-07-19 14:04:48 +08:00
// width: 55%;
position: relative;
2025-07-19 14:04:48 +08:00
background: #000;
2025-08-22 10:27:48 +08:00
overflow: hidden;
> .mask{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(180deg, rgba(49, 49, 49, 0.3) -4.74%, rgba(0, 0, 0, 0.55) 103.32%);
}
> .fixed{
position: absolute;
bottom: 1rem;
right: 1rem;
color: #fff;
}
2025-06-30 10:53:25 +08:00
> .imgBox{
2025-07-19 14:04:48 +08:00
background: #000;
2025-06-30 10:53:25 +08:00
height: 100%;
2025-07-19 14:04:48 +08:00
width: 100%;
2025-08-22 10:27:48 +08:00
position: relative;
> video{
2025-06-30 10:53:25 +08:00
width: 100%;
2025-08-22 10:27:48 +08:00
object-fit: cover;
2025-07-19 14:04:48 +08:00
height: 100%;
2025-06-30 10:53:25 +08:00
}
}
}
> .right {
2025-08-22 10:27:48 +08:00
flex: 1;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
2025-08-22 10:27:48 +08:00
background: #fff;
2025-07-19 14:04:48 +08:00
overflow: hidden;
2025-08-22 10:27:48 +08:00
text-align: center;
position: relative;
> i{
position: absolute;
margin-right: 2.8rem;
font-size: 2rem;
cursor: pointer;
align-items: center;
width: 4.6rem;
height: 4.6rem;
border-radius: 1.2rem;
display: flex;
justify-content: center;
border: 1px solid #D8DADC;
left: 4rem;
top: 4rem;
}
> .Text {
2025-08-22 10:27:48 +08:00
width: 63rem;
text-align: center;
2025-08-22 10:27:48 +08:00
> img{
width: 12rem;
height: 12rem;
margin-bottom: 2rem;
}
> .title {
2025-07-19 14:04:48 +08:00
font-size: 6.4rem;
line-height: 1.2;
2025-08-22 10:27:48 +08:00
margin-bottom: 2.4rem;
2025-07-19 14:04:48 +08:00
p{
margin-bottom: 0;
2025-08-22 10:27:48 +08:00
font-weight: 400;
font-family: 'pingfang_regular';
> span{
font-weight: 500;
font-family: 'pingfang_medium';
}
2025-07-19 14:04:48 +08:00
}
}
> .info {
2025-08-22 10:27:48 +08:00
font-size: 2.4rem;
2025-07-19 14:04:48 +08:00
// margin-bottom: 4rem;
2025-08-22 10:27:48 +08:00
margin-bottom: 7rem;
2025-07-19 14:04:48 +08:00
font-weight: 300;
line-height: 1.2;
letter-spacing:-.5px;
2025-08-22 10:27:48 +08:00
font-family: 'satoshi_light';
}
> .continue {
> i {
margin-left: 1rem;
}
}
}
> .loginBox {
2025-08-22 10:27:48 +08:00
width: 36.9rem;
// margin-top: 7rem;
2025-07-24 09:26:27 +08:00
&.active{
2025-08-22 10:27:48 +08:00
width: 63rem;
2025-07-24 09:26:27 +08:00
}
> .selectType {
width: 100%;
text-align: center;
> .text {
2025-08-22 10:27:48 +08:00
font-size: 2.8rem;
2025-07-19 14:04:48 +08:00
font-weight: 500;
2025-08-22 10:27:48 +08:00
margin-bottom: 2.4rem;
}
> .typeList {
2025-07-19 14:04:48 +08:00
> .gallery_btn{
}
> div {
margin: 0 auto;
2025-07-19 14:04:48 +08:00
width: 100%;
background: transparent;
border-radius: 9rem;
2025-08-22 10:27:48 +08:00
border: 1.3px solid;
display: flex;
align-items: center;
justify-content: center;
2025-08-22 10:27:48 +08:00
margin-bottom: 2.4rem;
font-size: 2.4rem;
font-weight: 500;
2025-07-19 14:04:48 +08:00
color: #000;
&:hover{
background: #000;
color: #fff;
}
}
}
}
> .login {
position: relative;
> .title {
2025-08-22 10:27:48 +08:00
font-size: 3.6rem;
font-weight: 500;
display: flex;
align-items: center;
2025-08-22 10:27:48 +08:00
margin-bottom: 1.2rem;
> i {
2025-08-22 10:27:48 +08:00
margin-right: 2.8rem;
font-size: 2rem;
display: flex;
cursor: pointer;
align-items: center;
2025-08-22 10:27:48 +08:00
width: 4.6rem;
height: 4.6rem;
border-radius: 1.2rem;
display: flex;
justify-content: center;
border: 1px solid #D8DADC;
}
2025-08-22 10:27:48 +08:00
}
2025-08-22 10:27:48 +08:00
> .info{
font-weight: 500;
font-size: 1.6rem;
text-align: left;
color: #667085;
}
}
}
}
}
</style>