Files
aida_front/src/views/HomeMain.vue

1033 lines
28 KiB
Vue
Raw Normal View History

2024-03-21 10:49:21 +08:00
<template>
<div class="homeMain_max Guide_1_16_1">
<header class="homeMain_heade">
<div class="homeMain_right_content">
2024-07-29 17:30:39 +08:00
<div class="homeMain_user">
2024-08-05 16:16:08 +08:00
<div class="homeMain_user_icon" @click="openAccount">
2024-08-23 10:19:02 +08:00
<img :src="userInfo?.avatar" alt="">
2024-07-29 17:30:39 +08:00
</div>
<div class="homeMain_user_detail">
<div v-if="isTest" class="username">{{$t('Header.hello')}}@{{ $t('isTest.userName') }}</div>
2024-08-23 10:19:02 +08:00
<div v-else class="username">{{$t('Header.hello')}}@{{ cookieUserInfo?.userName }}</div>
2024-07-29 17:30:39 +08:00
<div class="homeMain_user_detail_item homeMain_user_detail_attention">
2024-08-05 16:16:08 +08:00
<div class="attention_item">
<!-- 点击事件就用下面的div -->
<!-- <div class="attention_item attention_item_active"> -->
2024-08-23 10:19:02 +08:00
<div>{{ userInfo?.followeeCount }}</div>
2024-09-03 16:39:06 +08:00
<span>{{$t('account.Follow')}}</span>
2024-07-29 17:30:39 +08:00
</div>
2024-08-05 16:16:08 +08:00
<div class="attention_item">
2024-08-23 10:19:02 +08:00
<div>{{ userInfo?.followerCount }}</div>
2024-09-03 16:39:06 +08:00
<span>{{$t('account.Fans')}}</span>
2024-07-29 17:30:39 +08:00
</div>
2024-09-03 16:39:06 +08:00
<!-- <div class="attention_item">
2024-07-29 17:30:39 +08:00
<div>22</div>
<span>作品数</span>
2024-09-03 16:39:06 +08:00
</div> -->
2024-07-29 17:30:39 +08:00
</div>
2024-08-05 16:16:08 +08:00
<div class="homeMain_user_detail_item homeMain_user_detail_setUser" @click="openAccount">
2024-07-29 17:30:39 +08:00
<i class="fi fi-rr-user"></i>
2024-09-03 16:39:06 +08:00
<div>{{$t('Header.personal')}}</div>
2024-07-29 17:30:39 +08:00
<i class="icon iconfont icon-xiala"></i>
</div>
</div>
</div>
2024-03-21 10:49:21 +08:00
<div class="homeMain_user_content">
<div v-if="isTest" class="username"><span>/</span> {{$t('Header.hello')}}@{{ $t('isTest.userName') }}</div>
2024-08-23 10:19:02 +08:00
<div v-else class="username"><span>/</span> {{$t('Header.hello')}}@{{ cookieUserInfo?.userName }}</div>
2024-03-21 10:49:21 +08:00
<div
v-if="!isMurmur"
2024-07-29 17:30:39 +08:00
2024-03-21 10:49:21 +08:00
:class="[
'icon',
'iconfont',
'icon-xiala',
isShowOperate ? 'icon_rotate' : '',
]"
@click.stop="changeShowOperateContent()"
></div>
</div>
2024-09-03 16:39:06 +08:00
2024-03-21 10:49:21 +08:00
<div
class="trialApproval button_second credits hideChecked"
>
2024-03-26 15:45:32 +08:00
{{$t('Header.Credits')}}:&nbsp;
2024-03-21 10:49:21 +08:00
<span :title="credits">
<!-- <div>{{ String(credits.value[credits.value.legnth-1]) }}</div> -->
<div class="credits_item" v-for="item in String(credits)" :style="{'transform': 'translateY('+item*-100+'%)'}">
<div v-for="numItem in 10">{{ numItem-1 }}</div>
</div>
</span>
<i @click="getCredits" class="fi fi-br-refresh" :class="[activeCredits?'active':'']"></i>
<!-- <i @click="Assignment" class="fi fi-rr-gift" title="Assignment"></i> -->
2024-03-21 10:49:21 +08:00
<i @click="UpgradePlan" title="Purchase" class="fi fi-rr-shop"></i>
</div>
2024-03-21 10:49:21 +08:00
</div>
2024-07-17 15:12:55 +08:00
<!-- <nav class="homeMain_nav_content">
2024-03-21 10:49:21 +08:00
<router-link :class="['nav_item',$route.name === 'homePage' ? 'select_nav' : '', ]" :to="`/home/homePage`">
{{$t('Header.HOME')}}
</router-link>
<router-link :class="['nav_item',$route.name === 'library' ? 'select_nav' : '', ]" :to="`/home/library`">
{{$t('Header.LIBRARY')}}
</router-link>
<router-link :class="['nav_item',$route.name === 'history' ? 'select_nav' : '', ]" :to="`/home/history`">
{{$t('Header.HISTORY')}}
</router-link>
2024-05-16 13:24:32 +08:00
<router-link :class="['nav_item',$route.name === 'works' ? 'select_nav' : '', ]" :to="`/home/works`">
2024-05-09 13:34:15 +08:00
{{$t('Header.WORKS')}}
2024-05-16 13:24:32 +08:00
</router-link>
2024-07-17 15:12:55 +08:00
</nav> -->
<navRouter :routerList="navRouterList"></navRouter>
2024-03-21 10:49:21 +08:00
<div class="homeMain_right">
2024-09-03 16:39:06 +08:00
<!-- <img
2024-03-21 10:49:21 +08:00
class="homeMain_logo"
@click="turnToNewPage('https://www.aidlab.hk/en/')"
src="@/assets/images/loginPage/aida_logo.png"
2024-09-03 16:39:06 +08:00
/> -->
<div class="trialApproval credits message">
<div class="message_iconItem">
<a-badge :count="messageNum">
<i class="fi fi-rr-envelope" @click="openMessage"></i>
</a-badge>
</div>
<div class="message_iconItem">
<a-badge :count="messageType?.newPosted">
<!-- <i class="fi fi-rr-envelope" @click="openMessage"></i> -->
<i class="fi fi-rr-bell" @click.stop="openNewPosted"></i>
</a-badge>
<div class="message_iconItem_value select_block" v-show="isNewPosted" style="width: 40rem">
<newPosted ref="newPosted"></newPosted>
</div>
</div>
</div>
2024-03-21 10:49:21 +08:00
<Habit></Habit>
</div>
<nav class="select_block" v-show="isShowOperate">
<!-- <div class="select_item" @click="showBindEmailModal()">
<span class="icon iconfont icon-youxiang"></span><span class="select_item_des">{{$t('Header.bindEmail')}}</span>
</div> -->
<div class="select_item" @click.stop="isLanguage = !isLanguage">
<span class="icon iconfont icon-yuyan"></span>
<span class="select_item_des">{{$t('Header.language')}}</span>
</div>
<!-- <div class="select_item" @click="openTask()">
2024-03-26 15:45:32 +08:00
<i class="icon iconfont icon-renwu"></i>
<span class="select_item_des">{{$t('Header.TaskList')}}</span>
</div> -->
2024-03-21 10:49:21 +08:00
<div class="select_item" @click="orderForm()">
<i class="fi fi-rs-notebook"></i>
2024-03-26 15:45:32 +08:00
<span class="select_item_des">{{$t('Header.ViewOrders')}}</span>
2024-03-21 10:49:21 +08:00
</div>
2024-09-06 13:48:16 +08:00
<router-link class="select_item" v-if="AdministratorUserIdList.indexOf(cookieUserInfo?.userId) >= 0" :to="`/administrator`">
<span class="icon iconfont icon-yonghu"></span>
<span class="select_item_des">Administrator</span>
2024-09-03 17:07:49 +08:00
</router-link>
<div class="select_item" @click="getTutorial()">
2024-07-11 17:17:40 +08:00
<span class="fi fi-rr-book-user"></span>
<span class="select_item_des">{{$t('Header.Tutorial')}}</span>
</div>
2024-03-21 10:49:21 +08:00
<div class="select_item" @click="logout()">
2024-06-17 09:39:01 +08:00
<span class="icon iconfont icon-tuichu"></span>
<span class="select_item_des">{{$t('Header.logOff')}}</span>
2024-03-21 10:49:21 +08:00
</div>
</nav>
<ul class="select_block select_list" v-show="isLanguage">
<li class="select_item" v-for="item in language" @click="setLocale(item.value)">
<span class="select_item_des">{{ item.name }}</span>
</li>
</ul>
<payOrder ref="payOrder"></payOrder>
<UpgradePlan ref="UpgradePlan"></UpgradePlan>
<TaskPage ref="TaskPage"></TaskPage>
</header>
<div class="homeMain_content_body">
2024-04-15 16:09:33 +08:00
<!-- <router-view v-slot="{ Component }" @setTask = "setTask">
<keep-alive>
<component :key="$route.name" :is="Component" v-if="$route.meta.keepAlive"/>
</keep-alive>
<component :key="$route.name" :is="Component" v-if="!$route.meta.keepAlive"/>
</router-view> -->
2024-06-17 11:32:31 +08:00
<router-view @setTask = "setTask" :getLangIsShowMark="getLangIsShowMark"></router-view>
2024-03-21 10:49:21 +08:00
</div>
<RobotAssist></RobotAssist>
<scaleVideo ref="scaleVideo"></scaleVideo>
2024-03-21 10:49:21 +08:00
</div>
</template>
<script >
2024-09-03 16:39:06 +08:00
import { defineComponent, createVNode, ref,toRefs, reactive, computed, onMounted } from "vue";
2024-03-21 10:49:21 +08:00
import { isEmail } from "@/tool/util";
2024-03-28 15:11:57 +08:00
import { setCookie, getCookie, WriteCookie,clonAllCookie } from "@/tool/cookie";
2024-03-21 10:49:21 +08:00
import payOrder from "@/component/Pay/payOrder.vue";
import VerificationCodeInput from "@/component/LoginPage/verificationCodeInput.vue";
import Habit from "@/component/Detail/habit.vue";
import TaskPage from "@/component/HomePage/TaskPage.vue";
import UpgradePlan from "@/component/HomePage/UpgradePlan.vue";
import { Https } from "@/tool/https";
import { Modal, message } from "ant-design-vue";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import RobotAssist from "@/component/HomePage/RobotAssist.vue";
import scaleVideo from "@/component/HomePage/scaleVideo.vue";
2024-09-03 16:39:06 +08:00
import newPosted from "@/component/HomePage/newPosted.vue";
2024-07-17 15:12:55 +08:00
import navRouter from "@/component/modules/navRouter.vue";
2024-03-21 10:49:21 +08:00
import { useStore } from "vuex";
import { setLang } from "@/tool/guide";
import showViewVideo from "@/tool/mount";
2024-03-21 10:49:21 +08:00
import { useI18n } from "vue-i18n";
2024-07-29 17:30:39 +08:00
import { gsap, TweenMax,TweenLite } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
2024-08-13 09:36:13 +08:00
import MyWs from "@/tool/webSocket";
2024-08-19 10:36:46 +08:00
import MyEvent from "@/tool/myEvents";
2024-03-21 10:49:21 +08:00
export default defineComponent({
components: {
VerificationCodeInput,
Habit,
RobotAssist,
scaleVideo,
2024-09-03 16:39:06 +08:00
newPosted,
2024-03-21 10:49:21 +08:00
UpgradePlan,
payOrder,
TaskPage,
2024-07-17 15:12:55 +08:00
navRouter,
2024-03-21 10:49:21 +08:00
},
setup(){
const store = useStore();
const {t} = useI18n()
const {locale} = useI18n()
2024-08-23 10:19:02 +08:00
let userInfo= computed(()=>{
return store.state.UserHabit.userInfo
})
2024-03-21 10:49:21 +08:00
let isTest = ref()
let isMurmur = ref()
let credits = computed(()=>{
return store.state.UserHabit.credits.value
})
2024-09-03 16:39:06 +08:00
2024-03-21 10:49:21 +08:00
let activeCredits = ref(false)
2024-06-17 11:32:31 +08:00
let getLangIsShowMark = ref(true)
2024-07-17 15:12:55 +08:00
let AdministratorUserIdList = [88,6,46,31,73,83,87,4]
let navRouterList = [
{
2024-07-17 17:28:02 +08:00
routerName:['homePage'],
2024-07-17 15:12:55 +08:00
router:'/home/homePage',
name:t('Header.HOME')
},{
2024-07-17 17:28:02 +08:00
routerName:['library'],
2024-07-17 15:12:55 +08:00
router:'/home/library',
name:t('Header.LIBRARY')
},{
2024-07-17 17:28:02 +08:00
routerName:['history'],
2024-07-17 15:12:55 +08:00
router:'/home/history',
name:t('Header.HISTORY')
},{
2024-07-17 17:28:02 +08:00
routerName:['works'],
2024-07-17 15:12:55 +08:00
router:'/home/works',
name:t('Header.WORKS')
},{
2024-07-18 13:19:43 +08:00
routerName:['events','eventsDetail'],
2024-07-17 15:12:55 +08:00
router:'/home/events',
name:t('Header.EVENTS')
},
]
2024-08-13 09:36:13 +08:00
let messageNum = computed(()=>{
return store.state.UserHabit.messageSystem.messageNum
})
2024-09-03 16:39:06 +08:00
let messageType = computed(()=>{
return store.state.UserHabit.messageSystem.messageType
})
let stateList = reactive({
isNewPosted:false,
isShowOperate:false,
isLanguage:false,
})
let isNewPosted = ref(false)
let isShowOperate = ref(false)
let isLanguage = ref(false)
let newPosted = ref(null)
2024-08-19 10:36:46 +08:00
let getUnreadCount = ()=>{
Https.axiosGet(Https.httpUrls.getUnreadCount).then((rv)=>{
if(rv){
store.commit('setMessageSystem',rv)
}
})
}
2024-09-30 16:07:35 +08:00
MyWs.linkWs("wss://"+MyWs.messageUrl,'message')
// MyWs.linkWs("ws://"+MyWs.messageUrl+`/${JSON.parse(getCookie("userInfo")).userId}`,'message')
2024-08-19 10:36:46 +08:00
let getWsMessage = (data)=>{
let userInfo = ['followeeCount','followerCount']
let obj = {}
let isObj = false
data.forEach(element => {
const keys = Object.keys(element)[0]
if(userInfo.indexOf(keys) > 0){
obj[keys] = element[keys]
isObj = true
}
});
if(isObj)store.commit('setUserInfo',obj)
2024-08-19 10:36:46 +08:00
store.commit('setMessageSystem',...data)
}
MyEvent.add('getMessage',getWsMessage)
// setTimeout(() => {
// MyWs.sendMessage('aaaa')
// }, 3000);
// MyWs.ws.onmessage = (data)=>{
// console.log(JSON.parse(data.data),232);
// }
2024-09-03 16:39:06 +08:00
let openNewPosted = ()=>{
stateList.isNewPosted = !stateList.isNewPosted
newPosted.value.init()
document.addEventListener(
"click",
closeShowOperateContent,
false
);
}
//点击下拉图标出现操作
let changeShowOperateContent=() =>{
stateList.isShowOperate = !stateList.isShowOperate;
document.addEventListener(
"click",
closeShowOperateContent,
false
);
}
let changeLanguage=() =>{
stateList.isLanguage = !stateList.isLanguage;
document.addEventListener(
"click",
closeShowOperateContent,
false
);
}
//关闭下拉图标
let closeShowOperateContent=() =>{
stateList.isShowOperate = false;
stateList.isLanguage = false
stateList.isNewPosted = false
document.removeEventListener("click", closeShowOperateContent);
}
2024-08-19 10:36:46 +08:00
onMounted(()=>{
getUnreadCount()
})
2024-03-21 10:49:21 +08:00
return {
store,
2024-08-23 10:19:02 +08:00
userInfo,
2024-03-21 10:49:21 +08:00
t,
locale,
isTest,
isMurmur,
credits,
activeCredits,
2024-06-17 11:32:31 +08:00
getLangIsShowMark,
AdministratorUserIdList,
2024-07-17 15:12:55 +08:00
navRouterList,
2024-08-13 09:36:13 +08:00
messageNum,
2024-09-03 16:39:06 +08:00
messageType,
...toRefs(stateList),
newPosted,
openNewPosted,
changeShowOperateContent,
changeLanguage,
closeShowOperateContent,
2024-03-21 10:49:21 +08:00
}
},
data() {
return {
bindEmailVisible: false,
isHaveBindEmail: false,
bindEmailStep: 1,
email: "",
emailCode: ["", "", "", "", "", ""], //邮箱验证码
time: 60, //60秒倒计时
timer: 0,
2024-09-03 17:07:49 +08:00
cookieUserInfo: {
userId:-1
},
2024-03-21 10:49:21 +08:00
timerOperate: null,
numTime: 30,
timerSec: null,
modalWarning: null,
language:[
{name:'English',value:'ENGLISH'},
{name:'中文',value:'CHINESE_SIMPLIFIED'},
// {name:'한국인',value:'KOREAN'},
// {name:'にほんご',value:'JAPANESE'},
// {name:'Русский',value:'RUSSIAN'},
// {name:'Français',value:'FRENCH'},
// {name:'แบบไทย',value:'THAI'},
// {name:'Tiếng Việt',value:'VIETNAMESE'},
// {name:'Italiano',value:'ITALIAN'},
],
};
},
watch: {
// credits.value(newVal,oldVal){
// console.log(String(newVal).length);
// }
},
2024-07-29 17:30:39 +08:00
directives:{
moveOpenDetal:{
mounted (el,binding) {
},
}
},
2024-03-21 10:49:21 +08:00
mounted() {
let isTest = getCookie('isTest')//获取是否是试用用户
this.isTest =JSON.parse(isTest)
let isMurmur = getCookie('isMurmur')//获取是否是试用用户
this.isMurmur =JSON.parse(isMurmur)
2024-08-23 10:19:02 +08:00
this.cookieUserInfo = JSON.parse(getCookie("userInfo"));
if (!this.cookieUserInfo) {
2024-06-17 09:39:01 +08:00
this.$router.replace("/");
2024-03-21 10:49:21 +08:00
} else {
2024-08-23 10:19:02 +08:00
this.accountIsLogin(this.cookieUserInfo);
2024-03-21 10:49:21 +08:00
}
2024-08-23 10:19:02 +08:00
this.isHaveBindEmail = this.cookieUserInfo?.email ? true : false;
2024-07-21 09:00:16 +08:00
if(!this.isMurmur){
2024-03-21 10:49:21 +08:00
this.operateClick();
document.addEventListener("click", this.operateClick);
}
this.getCredits()
this.getLang('')
2024-06-01 10:02:21 +08:00
//语言适配
2024-06-17 11:32:31 +08:00
this.store.dispatch('getLangType').then(()=>{
this.getLangIsShowMark = false
})
2024-07-29 17:30:39 +08:00
let tl1 = gsap.timeline({ paused: true });
let heradeRight = document.querySelector('.homeMain_max .homeMain_right_content')
let userDetailMax = document.querySelector('.homeMain_max .homeMain_user')
let userDetailIcon = document.querySelector('.homeMain_max .homeMain_user_icon')
let userName = document.querySelector('.homeMain_max .homeMain_user_content')
let userDetail = document.querySelector('.homeMain_max .homeMain_user_detail')
// let anmiation = TweenMax.to(userDetailMax,1, {'margin-top':'30px',opacity:1})
// anmiation.stop()
let state
tl1
.to(userDetail,.3, {opacity:1,display:'flex'})
.to(userDetailIcon,.3, {'left':'15rem',y:'25%',x:'-50%',scale:1.5,opacity:1},'-=.3')
.to(userName,.3, {opacity:0},'-=.3')
let overTime
let outTime
userDetailMax.addEventListener('mouseenter',(event)=>{
if(state && !outTime)return
clearTimeout(overTime)
clearTimeout(outTime)
overTime = setTimeout(() => {
state = true
this.isShowOperate = false
this.isLanguage = false
tl1.play()
}, 500);
})
heradeRight.addEventListener('mouseleave',(event)=>{
2024-08-05 16:16:08 +08:00
if(overTime){
clearTimeout(overTime)
}
2024-07-29 17:30:39 +08:00
if(!state)return
clearTimeout(outTime)
outTime = setTimeout(() => {
state = false
tl1.reverse()
}, 500);
})
2024-03-21 10:49:21 +08:00
},
methods: {
2024-03-27 09:48:01 +08:00
setTask(data){
this.openTask(data)
2024-03-22 12:01:11 +08:00
},
2024-03-21 10:49:21 +08:00
turnToNewPage(url) {
window.open(url);
},
turnToPage(name) {
let noRefresh = name === "home" ? true : false;
this.$router.push({ name: name, params: { noRefresh: noRefresh } });
},
UpgradePlan(){//购买积分
let UpgradePlan = this.$refs.UpgradePlan
UpgradePlan.init()
},
Assignment(){//任务
// let num = 123+this.credits
// this.store.commit('setCredits',num)
},
getCredits(){//刷新当前积分
if(!this.activeCredits){
this.activeCredits = true
this.store.dispatch('getCredits').then((rv)=>{
setTimeout(()=>{
this.activeCredits = false
},300)
})
}else{
this.activeCredits = false
}
},
2024-09-03 16:39:06 +08:00
2024-03-21 10:49:21 +08:00
2024-03-22 12:01:11 +08:00
2024-03-21 10:49:21 +08:00
//查看订单
orderForm(){
let payOrder = this.$refs.payOrder
payOrder.init()
},
//教程
getTutorial(){
2024-08-01 18:38:47 +08:00
let url = 'https://code-create.com.hk/wp-content/uploads/2024/08/aida_3.0-Manual-0705-CN.pdf'
if(this.locale == 'ENGLISH'){
2024-08-01 18:38:47 +08:00
url = 'https://code-create.com.hk/wp-content/uploads/2024/08/aida_3.0-Manual-0705-EN.pdf'
showViewVideo({url:'https://code-create.com.hk/wp-content/uploads/2024/07/AiDA-demo-video_0709_EN.webm'})
2024-07-09 19:10:01 +08:00
}else{
showViewVideo({url:'https://code-create.com.hk/wp-content/uploads/2024/07/AiDA-demo-video_0709_CN.webm'})
}
//打开视频
const a = document.createElement('a');
a.href = url;
2024-07-11 17:17:40 +08:00
a.target = '_blank';
2024-07-08 17:04:32 +08:00
a.download = 'aida_3.0-Manual.pptx'; // 下载的文件名
document.body.appendChild(a);
a.click();
},
2024-03-21 10:49:21 +08:00
//登出
async logout() {
let data = {
2024-08-23 10:19:02 +08:00
userId: this.cookieUserInfo.userId,
2024-03-21 10:49:21 +08:00
};
let isTest = getCookie('isTest')
// console.log(getCookie("token"));
if(JSON.parse(isTest)){
await Https.axiosGet(Https.httpUrls.trialUserLogout,).then((rv) => {
Https.axiosPost(Https.httpUrls.accountLogout, data).then((rv) => {
2024-06-17 09:39:01 +08:00
this.$router.replace("/");
2024-03-22 12:01:11 +08:00
// WriteCookie("token");
2024-03-21 10:49:21 +08:00
});
})
}else{
await Https.axiosPost(Https.httpUrls.accountLogout, data).then((rv) => {
2024-03-22 12:01:11 +08:00
// WriteCookie("token");
2024-03-21 10:49:21 +08:00
});
2024-06-17 09:39:01 +08:00
this.$router.replace("/");
2024-03-21 10:49:21 +08:00
}
2024-06-17 11:32:31 +08:00
this.store.commit('clearSystemUser')
2024-03-28 15:11:57 +08:00
// WriteCookie("token");
2024-08-06 10:05:50 +08:00
clonAllCookie()
2024-03-21 10:49:21 +08:00
// window.location.reload()
},
//判断是否登录
accountIsLogin(userInfo) {
let data = {
userId: userInfo.userId,
};
Https.axiosPost(Https.httpUrls.accountIsLogin, data).then((rv) => {
if (!rv) {
2024-06-17 09:39:01 +08:00
this.$router.replace("/");
2024-03-21 10:49:21 +08:00
}
});
},
//点击重置判断是否长时间五操作
operateClick() {
if (this.timer) {
clearTimeout(this.timer);
}
let _this = this;
let timeNum = 1000 * 60 * 120;
this.timer = setTimeout(() => {
this.modalWarning = Modal.warning({
title: () =>
this.t('Header.jsContent3',{numTime:_this.numTime}),
icon: createVNode(ExclamationCircleOutlined),
okText: "Ok",
centered:true,
onOk() {
_this.numTime = 30;
clearInterval(_this.timerSec);
},
});
_this.numCounter();
}, timeNum);
},
numCounter() {
this.timerSec = setInterval(() => {
if (this.numTime > 0) {
this.numTime = this.numTime - 1;
} else {
clearTimeout(this.timer);
clearInterval(this.timerSec);
this.logout();
this.modalWarning.destroy();
}
}, 1000);
},
//获取当前语言
getLang(v){
let data
Https.axiosPost(Https.httpUrls.getUserLanguage, data).then(
(rv) => {
if (rv) {
this.locale = rv
setLang(rv)
}
}
);
},
setLang(v){
Https.axiosGet(Https.httpUrls.changeUserLanguage,{params:{language:v}}).then((rv) => {
if (rv) {
if (rv) {
let token = rv;
setCookie("token", token);
this.getLang('')
// if(this.$router.currentRoute._value.path == '/home'){
// this.$router.push("/home")
// }else{
// this.$router.push("/home")
// }
this.store.commit('clearAllData')
2024-09-27 16:31:33 +08:00
// window.location.reload()
window.location.href = '/home';
2024-03-21 10:49:21 +08:00
}
}
})
},
setLocale(v){
this.setLang(v)
},
2024-03-27 09:48:01 +08:00
openTask(data){
2024-03-21 10:49:21 +08:00
let taskPage = this.$refs.TaskPage
2024-03-27 09:48:01 +08:00
taskPage.init(data)
2024-03-21 10:49:21 +08:00
},
2024-08-05 16:16:08 +08:00
openAccount(){
this.$router.push("/home/account")
},
2024-07-25 13:08:25 +08:00
openMessage(){
2024-08-05 16:16:08 +08:00
this.$router.push("/home/account/accountMessage")
2024-07-25 13:08:25 +08:00
},
2024-03-21 10:49:21 +08:00
},
});
</script>
<style lang="less" scoped>
.homeMain_max{
position: relative;
display: flex;
2024-06-01 10:02:21 +08:00
height: 100vh;
2024-03-21 10:49:21 +08:00
flex-direction: column;
.homeMain_content_body{
flex: 1;
2024-06-01 10:02:21 +08:00
height: calc(100vh - 7rem);
2024-03-21 10:49:21 +08:00
}
}
.homeMain_heade {
2024-06-01 10:02:21 +08:00
flex-shrink: 0;
2024-03-21 10:49:21 +08:00
display: flex;
justify-content: space-between;
// padding: 0 30px;
padding: 0 9rem;
width: 100%;
height: 7rem;
background: rgba(255, 255, 255, 0.2);
// border-bottom: 0.1rem solid rgba(3, 3, 3, 0.1);
position: relative;
align-items: center;
z-index: 1049;
background-color: #fff;
.homeMain_right{
width: 33%;
display: flex;
justify-content: flex-end;
align-items: center;
2024-09-03 16:39:06 +08:00
.message{
display: flex;
width: 6rem;
justify-content: space-between;
margin: 0 2rem;
// padding: 1rem;
i{
margin-left: 0rem;
border-left: none;
padding-left: 0rem;
height: auto;
font-size: 2rem;
width: 3rem;
cursor: pointer;
}
span{
overflow: initial;
align-items: center;
width: auto;
margin: auto;
height: auto;
}
.message_iconItem{
position: relative;
display: flex;
.message_iconItem_value{
padding: 1rem;
left: 50%;
transform: translateX(-50%);
top: 4rem;
}
}
}
2024-03-21 10:49:21 +08:00
}
.homeMain_logo {
width: 14.4rem;
height: 3.2rem;
margin: 2.1rem 2.8rem 0 ;
// position: absolute;
2024-07-25 13:08:25 +08:00
line-height: 2rem;
2024-03-21 10:49:21 +08:00
margin-top: 0;
}
2024-07-17 15:12:55 +08:00
2024-03-21 10:49:21 +08:00
.homeMain_right_content {
// position: absolute;
top: 0;
// right: 3.2rem;
left: 0;
display: flex;
width: 33%;
height: 100%;
align-items: center;
.homeMain_icon {
font-size: 3.6rem;
position: relative;
top: 0.3rem;
}
2024-07-29 17:30:39 +08:00
.homeMain_user{
.homeMain_user_icon{
height: 6rem;
width: 6rem;
position: relative;
transform-origin: top;
overflow: hidden;
z-index: 2;
left: 0;
border-radius: 50%;
cursor: pointer;
2024-08-23 10:19:02 +08:00
img{
width: 100%;
height: 100%;
object-fit: contain;
}
2024-07-29 17:30:39 +08:00
// transition: all .3s;
}
.homeMain_user_detail{
position: absolute;
top: calc(100% + .5rem);
background: #fff;
border-radius: 4px;
width: 30rem;
height: 30rem;
opacity: 0;
display: none;
box-shadow: 0 0px 10px 1px rgba(0, 0, 0, 0.12);
padding-top: 4rem;
text-align: center;
flex-direction: column;
align-items: center;
padding: 4rem 3rem;
.homeMain_user_detail_attention{
width: 100%;
display: flex;
justify-content: space-between;
padding: 0 2rem;
border-bottom: 1px solid #e3e5e7;
.attention_item{
display: flex;
flex-direction: column;
align-items: center;
2024-08-05 16:16:08 +08:00
}
.attention_item_active{
2024-07-29 17:30:39 +08:00
cursor: pointer;
}
.attention_item_active:hover{
color: #39215b;
span{
color: #39215b;
}
}
span{
font-size: 1.4rem;
color: #949eae;
}
}
.homeMain_user_detail_setUser{
display: flex;
align-items: center;
justify-content: flex-start;
cursor: pointer;
width: 100%;
i{
font-size: 2rem;
display: flex;
}
.fi-rr-user{
margin-right: 1rem;
}
.icon-xiala{
margin-left: auto
}
}
.homeMain_user_detail_item{
margin-top: 1rem;
padding-bottom: 1rem;
}
}
}
.username {
font-size: 1.8rem;
color: #1a1a1a;
margin: 0 0.8rem;
font-weight: 900;
span{
margin: .7rem;
}
2024-03-21 10:49:21 +08:00
}
.homeMain_user_content {
2024-07-29 17:30:39 +08:00
// transition: all .3s;
2024-03-21 10:49:21 +08:00
display: flex;
align-items: center;
position: relative;
height: 3.7rem;
2024-09-03 16:39:06 +08:00
2024-03-21 10:49:21 +08:00
&.marLeft2{
margin-left: 2rem;
}
.icon-xiala {
font-size: 1.4rem;
cursor: pointer;
transition: .3s all;
}
.icon_rotate {
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
animation-direction: 0.5s;
}
}
.credits{
font-size: 1.8rem;
color: #1a1a1a;
font-weight: 900;
width: auto;
padding: 0 1rem;
cursor: auto;
display: flex;
span{
width: 5rem;
display: inline-block;
overflow: hidden;
display: flex;
margin-right: .9rem;
.credits_item{
transition: .3s all;
2024-03-28 13:44:05 +08:00
// height: 4rem;
height: 3.2rem;
2024-03-21 10:49:21 +08:00
div{
height: 100%;
}
}
}
i{
height: 100%;
display: inline-block;
border-left: .1rem solid ;
padding-left: .9rem;
margin-left: .9rem;
font-size: 1.8rem;
cursor: pointer;
}
2024-09-03 16:39:06 +08:00
2024-03-21 10:49:21 +08:00
.fi-br-refresh{
margin-left: 0;
border-left: none;
padding-left: 0;
&.active{
transition: all .3s;
transform: rotate(360deg);
}
}
}
.trialApproval{
margin-left: 2rem;
}
}
}
.select_block {
z-index: 1050;
position: absolute;
left: 15.5rem;
top: 6rem;
width: 13.5rem;
2024-03-21 10:49:21 +08:00
background: #ffffff;
box-shadow: 0px 0.4rem 0.4rem 0px rgba(0, 0, 0, 0.1);
overflow: hidden;
border: 1px solid #000000;
2024-06-17 09:39:01 +08:00
height: auto;
2024-03-21 10:49:21 +08:00
&.select_list{
// display: none;
transform: translateX(105%);
// transform: translateX(120%);
}
.select_item {
padding-left: 1.5rem;
height: 4.1rem;
color: #4d4d4d;
display: flex;
align-items: center;
cursor: pointer;
user-select: none;
&:hover {
background: #f7f7f7;
}
2024-07-11 17:17:40 +08:00
.iconfont ,.fi-rr-book-user {
2024-03-21 10:49:21 +08:00
font-size: 1.4rem;
}
.select_item_des {
font-size: 1.3rem;
margin-left: 0.8rem;
}
}
}
.modal_component {
.skip_content {
width: 6rem;
height: 3rem;
line-height: 2.8rem;
border: 0.1rem solid #343579;
font-size: 1.4rem;
color: #343579;
position: absolute;
top: 1.8rem;
right: 1.8rem;
cursor: pointer;
}
.bind_email_content {
padding: 4.8rem 9.2rem 6rem;
.bind_email_tip {
font-size: 1.8rem;
color: #a5b0c2;
line-height: 1.9rem;
text-align: center;
}
.bind_email {
margin-top: 2rem;
font-size: 2.2rem;
font-weight: 400;
color: #030303;
text-align: center;
}
.bind_email_form_content {
.bind_email_form_title {
font-size: 2.2rem;
font-weight: bold;
color: #030303;
line-height: 2.4rem;
}
.bind_email_form_input {
width: 100%;
height: 4.6rem;
margin-top: 1rem;
border: 0.1rem solid #b4bed7;
padding-left: 2.1rem;
line-height: 4.6rem;
font-size: 1.8rem;
box-sizing: border-box;
&::placeholder {
color: #a5b0c2;
}
}
}
.bind_email_submit_button {
height: 4.6rem;
line-height: 4.6rem;
background: #343579;
font-size: 1.6rem;
font-weight: 500;
color: #ffffff;
width: 12.8rem;
text-align: center;
cursor: pointer;
margin: 3rem auto 0;
}
.icon--shangyibu {
font-size: 2.5rem;
font-weight: bold;
color: #030303;
}
.email_last_step_content {
margin-left: 1rem;
font-size: 2.2rem;
font-family: PingFang SC;
font-weight: bold;
color: #030303;
}
.tip_content {
font-size: 1.3rem;
font-weight: bold;
color: #343579;
cursor: pointer;
}
.email_last_step_des {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 2.5rem;
margin-bottom: 1.5rem;
.sent_email_content {
font-size: 1.8rem;
font-weight: bold;
color: #a5b0c2;
}
}
}
}
</style>