feat: i18n
This commit is contained in:
@@ -1,166 +1,195 @@
|
||||
<template>
|
||||
<div class="homeRecommend_max">
|
||||
<div class="header">
|
||||
<img
|
||||
<img
|
||||
class="homeRecommend_logo"
|
||||
@click="turnToNewPage('/')"
|
||||
src="@/assets/images/homePage/aidaIcon.png"
|
||||
/>
|
||||
<div class="gallery_btn login white" @click="setLogin">{{ t('Login.Login') }}</div>
|
||||
<div class="gallery_btn" @click="signUp">{{ t('Login.SignUp') }}</div>
|
||||
<div class="language_btn">
|
||||
<div @click="handleChangeLanguage">
|
||||
<i class="fi fi-rr-globe"></i>
|
||||
{{ isChinese ? 'CN' : 'EN' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery_btn login white" @click="setLogin">{{ t('Login.Login') }}</div>
|
||||
<div class="gallery_btn" @click="signUp">{{ t('Login.SignUp') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<img class="bg pc" src="@/assets/images/homePage/squareBg.png" alt="">
|
||||
<img class="bg mobile" src="@/assets/images/homePage/squareBgMobile.png" alt="">
|
||||
<div class="beForm">Developed by AiDLab<br />
|
||||
Commercialized by Code-Create</div>
|
||||
<div class="title">
|
||||
<img src="@/assets/images/homePage/recommendtitleMobile.png" alt="">
|
||||
<div class="text">
|
||||
AI-based Interactive Design <br />Assistant for Fashion
|
||||
</div>
|
||||
</div>
|
||||
<div class="learnMore">
|
||||
<img src="@/assets/images/homePage/learnMore.png" alt="">
|
||||
<!-- <div class="title">AiDA</div>
|
||||
<div class="content">
|
||||
<img class="bg pc" src="@/assets/images/homePage/squareBg.png" alt="" />
|
||||
<img class="bg mobile" src="@/assets/images/homePage/squareBgMobile.png" alt="" />
|
||||
<div class="beForm">
|
||||
Developed by AiDLab
|
||||
<br />
|
||||
Commercialized by Code-Create
|
||||
</div>
|
||||
<div class="title">
|
||||
<img src="@/assets/images/homePage/recommendtitleMobile.png" alt="" />
|
||||
<div class="text">
|
||||
AI-based Interactive Design
|
||||
<br />
|
||||
Assistant for Fashion
|
||||
</div>
|
||||
</div>
|
||||
<div class="learnMore">
|
||||
<img src="@/assets/images/homePage/learnMore.png" alt="" />
|
||||
<!-- <div class="title">AiDA</div>
|
||||
<div class="info">
|
||||
AI-based Interactive Design Assistant for Fashion
|
||||
</div> -->
|
||||
<!-- <div class="btn gallery_btn" @click="goLearnMore">Learn More</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="btn gallery_btn" @click="goLearnMore">Learn More</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script >
|
||||
import { defineComponent, toRefs, reactive, ref , nextTick,computed, onMounted, onBeforeUnmount } from "vue";
|
||||
import { isEmail } from "@/tool/util";
|
||||
import { setCookie, getCookie, WriteCookie,clonAllCookie } from "@/tool/cookie";
|
||||
import { Https } from "@/tool/https";
|
||||
import { Modal, message } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import { useStore } from "vuex";
|
||||
import { setLang } from "@/tool/guide";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useRouter } from 'vue-router';
|
||||
import { gsap, TweenMax } from "gsap";
|
||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||
<script>
|
||||
import {
|
||||
defineComponent,
|
||||
toRefs,
|
||||
reactive,
|
||||
ref,
|
||||
nextTick,
|
||||
computed,
|
||||
onMounted,
|
||||
onBeforeUnmount
|
||||
} from 'vue'
|
||||
import { isEmail } from '@/tool/util'
|
||||
import { setCookie, getCookie, WriteCookie, clonAllCookie } from '@/tool/cookie'
|
||||
import { Https } from '@/tool/https'
|
||||
import { Modal, message } from 'ant-design-vue'
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { setLang } from '@/tool/guide'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { gsap, TweenMax } from 'gsap'
|
||||
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
||||
export default defineComponent({
|
||||
components: {
|
||||
},
|
||||
setup(){
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
let registerModel = ref()
|
||||
let data = reactive({
|
||||
})
|
||||
let userDetail = computed(()=>{
|
||||
return store.state.UserHabit.userDetail
|
||||
})
|
||||
let setLogin = ()=>{
|
||||
router.push("/login");
|
||||
}
|
||||
let logout = ()=>{
|
||||
let userInfo = store.state.UserHabit.userDetail;
|
||||
let data = {
|
||||
userId: userInfo?.userId,
|
||||
};
|
||||
store.commit('createDetail')
|
||||
store.commit('createProbject')
|
||||
if(!data.userId) return
|
||||
Https.axiosPost(Https.httpUrls.accountLogout, data).then((rv) => {
|
||||
clonAllCookie();
|
||||
});
|
||||
}
|
||||
let goHome = ()=>{
|
||||
router.push('/home');
|
||||
}
|
||||
let time
|
||||
let updataIsMoblie = ()=>{
|
||||
clearTimeout(time)
|
||||
time = setTimeout(()=>{
|
||||
},500)
|
||||
}
|
||||
const signUp = ()=>{
|
||||
router.push('/register');
|
||||
}
|
||||
const goLearnMore = ()=>{
|
||||
window.open('https://www.aida.com.hk/Square/works', '_blank');
|
||||
}
|
||||
onMounted(()=>{
|
||||
window.addEventListener('resize',updataIsMoblie)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', updataIsMoblie);
|
||||
});
|
||||
return {
|
||||
...toRefs(data),
|
||||
userDetail,
|
||||
setLogin,
|
||||
registerModel,
|
||||
logout,
|
||||
goHome,
|
||||
signUp,
|
||||
goLearnMore,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// credits.value(newVal,oldVal){
|
||||
// console.log(String(newVal).length);
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
// nextTick().then(()=>{
|
||||
// let dom = document.querySelector('.homeRecommend_content_body')
|
||||
// let codeTween = document.querySelectorAll('.homeRecommend_content_body_recommend .content_body_img')
|
||||
// let codeTweenText = document.querySelectorAll('.homeRecommend_content_body_recommend .content_body_text')
|
||||
// for (let index = 0; index < codeTween.length; index++) {
|
||||
// gsap.from(codeTween[index],.5, {scale:.6 },);
|
||||
// gsap.registerPlugin(ScrollTrigger);
|
||||
// let tl1 = gsap.timeline();
|
||||
// tl1.to(codeTween[index],1, {y:'-30px',opacity:0},)
|
||||
// ScrollTrigger.create({
|
||||
// trigger: codeTween[index], // 触发器元素
|
||||
// start: "top 0%", // 滚动触发器的起始滚动位置
|
||||
// end: '200% 20%', // 滚动触发器的结束滚动位置
|
||||
// // markers: true, // 开启标注功能
|
||||
// scrub: true,
|
||||
// animation:tl1,
|
||||
// scroller:dom,//设置指定元素为滚动依据
|
||||
// scrub:2,
|
||||
// });
|
||||
// }
|
||||
// gsap.registerPlugin(ScrollTrigger);
|
||||
// let tl1 = gsap.timeline();
|
||||
// tl1.from(codeTweenText,1, {'margin-top':'30px',opacity:1},)
|
||||
// ScrollTrigger.create({
|
||||
// trigger: codeTweenText, // 触发器元素
|
||||
// start: "top 0%", // 滚动触发器的起始滚动位置
|
||||
// end: '200% 20%', // 滚动触发器的结束滚动位置
|
||||
// // markers: true, // 开启标注功能
|
||||
// scrub: true,
|
||||
// animation:tl1,
|
||||
// scroller:dom,//设置指定元素为滚动依据
|
||||
// scrub:2,
|
||||
// });
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
turnToWindow(url) {
|
||||
window.open(url);
|
||||
},
|
||||
},
|
||||
});
|
||||
components: {},
|
||||
setup() {
|
||||
const {t, locale} = useI18n()
|
||||
const store = useStore()
|
||||
const router = useRouter()
|
||||
let registerModel = ref()
|
||||
let data = reactive({})
|
||||
|
||||
const isChinese = ref(false)
|
||||
const handleChangeLanguage = () => {
|
||||
isChinese.value = !isChinese.value
|
||||
const lang = isChinese.value ? 'CHINESE_SIMPLIFIED' : 'ENGLISH'
|
||||
localStorage.setItem('loginLanguage', lang)
|
||||
locale.value = lang
|
||||
}
|
||||
|
||||
let userDetail = computed(() => {
|
||||
return store.state.UserHabit.userDetail
|
||||
})
|
||||
let setLogin = () => {
|
||||
router.push('/login')
|
||||
}
|
||||
let logout = () => {
|
||||
let userInfo = store.state.UserHabit.userDetail
|
||||
let data = {
|
||||
userId: userInfo?.userId
|
||||
}
|
||||
store.commit('createDetail')
|
||||
store.commit('createProbject')
|
||||
if (!data.userId) return
|
||||
Https.axiosPost(Https.httpUrls.accountLogout, data).then(rv => {
|
||||
clonAllCookie()
|
||||
})
|
||||
}
|
||||
let goHome = () => {
|
||||
router.push('/home')
|
||||
}
|
||||
let time
|
||||
let updataIsMoblie = () => {
|
||||
clearTimeout(time)
|
||||
time = setTimeout(() => {}, 500)
|
||||
}
|
||||
const signUp = () => {
|
||||
router.push('/register')
|
||||
}
|
||||
const goLearnMore = () => {
|
||||
window.open('https://www.aida.com.hk/Square/works', '_blank')
|
||||
}
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', updataIsMoblie)
|
||||
// 初始化语言设置
|
||||
const savedLang = localStorage.getItem('loginLanguage')
|
||||
if (savedLang) {
|
||||
isChinese.value = savedLang === 'CHINESE_SIMPLIFIED'
|
||||
locale.value = savedLang
|
||||
}
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', updataIsMoblie)
|
||||
})
|
||||
return {
|
||||
...toRefs(data),
|
||||
userDetail,
|
||||
setLogin,
|
||||
registerModel,
|
||||
logout,
|
||||
goHome,
|
||||
signUp,
|
||||
goLearnMore,
|
||||
isChinese,
|
||||
handleChangeLanguage,
|
||||
t
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
watch: {
|
||||
// credits.value(newVal,oldVal){
|
||||
// console.log(String(newVal).length);
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
// nextTick().then(()=>{
|
||||
// let dom = document.querySelector('.homeRecommend_content_body')
|
||||
// let codeTween = document.querySelectorAll('.homeRecommend_content_body_recommend .content_body_img')
|
||||
// let codeTweenText = document.querySelectorAll('.homeRecommend_content_body_recommend .content_body_text')
|
||||
// for (let index = 0; index < codeTween.length; index++) {
|
||||
// gsap.from(codeTween[index],.5, {scale:.6 },);
|
||||
// gsap.registerPlugin(ScrollTrigger);
|
||||
// let tl1 = gsap.timeline();
|
||||
// tl1.to(codeTween[index],1, {y:'-30px',opacity:0},)
|
||||
// ScrollTrigger.create({
|
||||
// trigger: codeTween[index], // 触发器元素
|
||||
// start: "top 0%", // 滚动触发器的起始滚动位置
|
||||
// end: '200% 20%', // 滚动触发器的结束滚动位置
|
||||
// // markers: true, // 开启标注功能
|
||||
// scrub: true,
|
||||
// animation:tl1,
|
||||
// scroller:dom,//设置指定元素为滚动依据
|
||||
// scrub:2,
|
||||
// });
|
||||
// }
|
||||
// gsap.registerPlugin(ScrollTrigger);
|
||||
// let tl1 = gsap.timeline();
|
||||
// tl1.from(codeTweenText,1, {'margin-top':'30px',opacity:1},)
|
||||
// ScrollTrigger.create({
|
||||
// trigger: codeTweenText, // 触发器元素
|
||||
// start: "top 0%", // 滚动触发器的起始滚动位置
|
||||
// end: '200% 20%', // 滚动触发器的结束滚动位置
|
||||
// // markers: true, // 开启标注功能
|
||||
// scrub: true,
|
||||
// animation:tl1,
|
||||
// scroller:dom,//设置指定元素为滚动依据
|
||||
// scrub:2,
|
||||
// });
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
turnToWindow(url) {
|
||||
window.open(url)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@@ -183,7 +212,7 @@ export default defineComponent({
|
||||
right: 0;
|
||||
@media (max-width: 768px) {
|
||||
position: relative;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 0.7rem 1.4rem;
|
||||
margin-left: auto;
|
||||
@@ -194,32 +223,11 @@ export default defineComponent({
|
||||
@media (max-width: 768px) {
|
||||
display: block;
|
||||
height: 2.5rem;
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
.language_btn {
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 2.5rem;
|
||||
>div {
|
||||
display: flex;
|
||||
>i{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 2.5rem;
|
||||
margin-right: .7rem;
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
font-size: 1.5rem;
|
||||
color: #000;
|
||||
>div {
|
||||
>i{
|
||||
font-size: 1.5rem;
|
||||
margin-right: .7rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
> .gallery_btn {
|
||||
// margin-right: 2rem;
|
||||
|
||||
@@ -15,21 +15,21 @@
|
||||
<div class="Text" v-show="!loginType">
|
||||
<img src="@/assets/images/homePage/aidaIcon.png" alt="">
|
||||
<div class="title">
|
||||
<p>Welcome to <span>AiDA</span></p>
|
||||
<p>{{ t('Login.Welcome') }} <span>{{ t('Login.AiDA') }}</span></p>
|
||||
</div>
|
||||
<div class="info">
|
||||
AiDA, a first-to-market technology that empowers fashion designers, based on their creative inspirations, to work with AI to create original designs.
|
||||
{{ t('Login.Slogan') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="loginBox" :class="{'active':loginType}">
|
||||
<div class="selectType" v-show="!loginType">
|
||||
<div class="text">Continue with one of these:</div>
|
||||
<div class="text">{{ t('Login.LoginMethod') }}</div>
|
||||
<div class="typeList">
|
||||
<div class="gallery_btn" @click="setLoginType('personal')">
|
||||
Individual
|
||||
{{ t('Login.Individual') }}
|
||||
</div>
|
||||
<div class="gallery_btn" @click="setLoginType('school')">
|
||||
Academic
|
||||
{{ t('Login.Academic') }}
|
||||
</div>
|
||||
<!-- <div class="gallery_btn" @click="setLoginType('enterprise')">
|
||||
Enterprise
|
||||
@@ -40,9 +40,9 @@
|
||||
<div class="title">
|
||||
<i class="fi fi-br-angle-left" @click="loginBack"></i>
|
||||
<!-- <i class="fi fi-rr-arrow-left" @click="()=>loginType = ''"></i> -->
|
||||
<span>Log on to AiDA 3.1</span>
|
||||
<span>{{ t('Login.LogonToAiDA') }}</span>
|
||||
</div>
|
||||
<div class="info" v-show="!loginType">Please fill your information below</div>
|
||||
<div class="info" v-show="!loginType">{{ t('Login.Infomation') }}</div>
|
||||
<personal ref="personal" v-if="loginType == 'personal'" v-model:isMask="isMask"></personal>
|
||||
<school ref="school" v-if="loginType == 'school'"></school>
|
||||
<enterprise ref="enterprise" v-if="loginType == 'enterprise'"></enterprise>
|
||||
@@ -90,9 +90,17 @@ export default defineComponent({
|
||||
props: {},
|
||||
emits: [],
|
||||
setup(props, { emit }) {
|
||||
const {t,locale} = useI18n()
|
||||
const store = useStore();
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
// 通过 provide 传递 i18n 给子组件
|
||||
provide('i18n', {
|
||||
t,
|
||||
locale
|
||||
})
|
||||
|
||||
const loginData = reactive({
|
||||
loginType: "",
|
||||
isMask: false,
|
||||
@@ -137,7 +145,7 @@ export default defineComponent({
|
||||
store.commit("upUserDetail", userid);
|
||||
if (window.innerWidth < 768) {
|
||||
message.info(
|
||||
"If you need to design, please log in using an iPad or computer."
|
||||
t('Login.Device')
|
||||
);
|
||||
turnToHomePage("/Square");
|
||||
} else {
|
||||
@@ -174,6 +182,10 @@ export default defineComponent({
|
||||
if (data?.state == "weiXin") {
|
||||
wechatLogin(data);
|
||||
}
|
||||
const savedLang = localStorage.getItem('loginLanguage')
|
||||
if (savedLang) {
|
||||
locale.value = savedLang
|
||||
}
|
||||
})
|
||||
return {
|
||||
...toRefs(dataDom),
|
||||
@@ -181,11 +193,10 @@ export default defineComponent({
|
||||
setLoginType,
|
||||
loginBack,
|
||||
toBack,
|
||||
t,
|
||||
locale
|
||||
};
|
||||
},
|
||||
provide() {
|
||||
return {};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
||||
Reference in New Issue
Block a user