This commit is contained in:
clay
2022-01-22 20:45:07 +08:00
parent 72fbaed559
commit 6b2d1034c2
20 changed files with 181 additions and 149 deletions

View File

@@ -19,6 +19,7 @@
import headers from './views/header/index' import headers from './views/header/index'
import MobileHerder from './views/header/mobile_herder' import MobileHerder from './views/header/mobile_herder'
import footers from './views/footer/index' import footers from './views/footer/index'
import {setAppLanguage} from "@/utils/sist";
export default { export default {
name: 'App', name: 'App',
@@ -31,9 +32,13 @@ export default {
return { return {
iftop: false, iftop: false,
timer : true, timer : true,
lang:'cn',
width: document.documentElement.clientWidth >= 992 width: document.documentElement.clientWidth >= 992
} }
}, },
created() {
setAppLanguage(this)
},
mounted() { //监听scroll方法 mounted() { //监听scroll方法
window.addEventListener('scroll', this.handleScroll) window.addEventListener('scroll', this.handleScroll)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -5,10 +5,12 @@ import VueI18n from 'vue-i18n'
import messages from './langs' import messages from './langs'
Vue.use(VueI18n) Vue.use(VueI18n)
const i18n = new VueI18n({ const i18n = new VueI18n({
locale: localStorage.lang || 'cn', locale: localStorage.lang || 'cn',
messages messages
}) })
locale.i18n((key, value) => i18n.t(key, value)) //重点为了实现element插件的多语言切换 locale.i18n((key, value) => i18n.t(key, value)) //重点为了实现element插件的多语言切换
export default i18n export default i18n

View File

@@ -6,7 +6,11 @@ import i18n from './i18n/i18n'
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import 'element-ui/lib/theme-chalk/display.css'; import 'element-ui/lib/theme-chalk/display.css';
import en from 'element-ui/lib/locale/lang/en'
import cn from 'element-ui/lib/locale/lang/zh-CN'
i18n.mergeLocaleMessage('en', en)
i18n.mergeLocaleMessage('zh', cn)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(ElementUI) Vue.use(ElementUI)
@@ -32,6 +36,9 @@ const store = new Vuex.Store({
} }
} }
}) })
new Vue({ new Vue({
i18n, i18n,
router, router,

View File

@@ -1,6 +1,7 @@
import axios from 'axios' import axios from 'axios'
import {Notification, Message} from 'element-ui' import {Notification, Message} from 'element-ui'
import errorCode from '@/utils/errorCode' import errorCode from '@/utils/errorCode'
import {setAppLanguage} from "@/utils/sist";
//todo 显示消息处理 //todo 显示消息处理
@@ -16,6 +17,8 @@ const service = axios.create({
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
if (config.method == 'post') { if (config.method == 'post') {
config.data['sitetype'] = 'NEd5n92EMIpyyBslaNqsRgE'; config.data['sitetype'] = 'NEd5n92EMIpyyBslaNqsRgE';
let lang = sessionStorage.getItem("lang");
config.data['lang'] = lang;
} }
return config return config
}, error => { }, error => {

View File

@@ -39,3 +39,30 @@ export function getParentNode(id) {
} }
} }
export function setAppLanguage(that){
let lang = sessionStorage.getItem("lang");
if (lang != null){
that.$i18n.locale = lang
return
}
var language = window.navigator.userLanguage || window.navigator.language;
if (language == 'zh-CN'){
lang = 'cn'
}else {
lang = 'en'
}
that.$i18n.locale = lang
sessionStorage.setItem("lang",lang)
}
export function setLanguage(that){
let lang = that.$route.query && that.$route.query.lang
if (lang != undefined){
that.$i18n.locale = lang
sessionStorage.setItem("lang",lang)
}
}

View File

@@ -1,13 +1,9 @@
<template> <template>
</template> </template>
<script> <script>
export default { export default {
created() { created() {
this.$router.push("/home"); this.$router.push("/home?lang="+sessionStorage.getItem("lang"));
} }
} }
</script> </script>

View File

@@ -70,7 +70,7 @@ export default {
// mousewheel事件中的 “event.wheelDelta” 属性值:返回的如果是正值说明滚轮是向上滚动 // mousewheel事件中的 “event.wheelDelta” 属性值:返回的如果是正值说明滚轮是向上滚动
// DOMMouseScroll事件中的 “event.detail” 属性值:返回的如果是负值说明滚轮是向上滚动 // DOMMouseScroll事件中的 “event.detail” 属性值:返回的如果是负值说明滚轮是向上滚动
let delta = event.detail || (-event.wheelDelta); let delta = event.detail || (-event.wheelDelta);
console.log(delta) //console.log(delta)
// 如果当前滚动开始时间和上次滚动结束时间的差值小于1.5s,则不执行翻页动作,这样做是为了实现类似节流的效果 // 如果当前滚动开始时间和上次滚动结束时间的差值小于1.5s,则不执行翻页动作,这样做是为了实现类似节流的效果
if ((this.startTime - this.endTime) > 1) { if ((this.startTime - this.endTime) > 1) {
if (delta > 0 && window.pageYOffset < window.innerHeight) { if (delta > 0 && window.pageYOffset < window.innerHeight) {

View File

@@ -103,9 +103,9 @@ export default {
router="/" +this.value.navId+"?id="+context.id router="/" +this.value.navId+"?id="+context.id
} }
if (this.width <=992){ if (this.width <=992){
this.$router.push("/mobile/" + this.value.secondId +router); this.$router.push("/mobile/" + this.value.secondId +router+"?lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/pc/" + this.value.secondId +router); this.$router.push("/pc/" + this.value.secondId +router+"?lang="+sessionStorage.getItem("lang"));
} }
}, },
handleSizeChange(val) { handleSizeChange(val) {

View File

@@ -49,7 +49,7 @@
<el-row> <el-row>
<el-col> <el-col>
<div class="tab"> <div class="tab">
<router-link to="/">{{ $t('message.home') }}</router-link> <router-link to="/home">{{ $t('message.home') }}</router-link>
<span> > </span> <span> > </span>
<router-link to=""> <router-link to="">
<span v-if="$i18n.locale === 'cn'">{{ crumbs.one.title }}</span> <span v-if="$i18n.locale === 'cn'">{{ crumbs.one.title }}</span>
@@ -128,7 +128,7 @@ import DireData from './components/dire_data.vue'
import Details from './components/details.vue' import Details from './components/details.vue'
import FileList from './components/file_list.vue' import FileList from './components/file_list.vue'
import {handleTree} from "@/utils/ebts"; import {handleTree} from "@/utils/ebts";
import {getParentNode} from "@/utils/sist"; import {getParentNode, setLanguage} from "@/utils/sist";
export default { export default {
name: "index", name: "index",
@@ -166,7 +166,6 @@ export default {
this.navId = this.$route.params && this.$route.params.navId; this.navId = this.$route.params && this.$route.params.navId;
let id = this.$route.params && this.$route.params.secondId let id = this.$route.params && this.$route.params.secondId
this.type = this.$route.query && this.$route.query.type this.type = this.$route.query && this.$route.query.type
console.log("触发了 $route")
if (this.type == 3 || this.type == 1 || this.type == 2) { if (this.type == 3 || this.type == 1 || this.type == 2) {
this.secondId = id this.secondId = id
this.showSecond = false this.showSecond = false
@@ -203,6 +202,7 @@ export default {
} }
}, },
created() { created() {
setLanguage(this)
this.secondId = this.$route.params && this.$route.params.secondId; this.secondId = this.$route.params && this.$route.params.secondId;
this.navId = this.$route.params && this.$route.params.navId; this.navId = this.$route.params && this.$route.params.navId;
this.type = this.$route.query && this.$route.query.type this.type = this.$route.query && this.$route.query.type
@@ -312,7 +312,7 @@ export default {
//if (index != this.showIndex) { //if (index != this.showIndex) {
this.showIndex = index this.showIndex = index
this.type = nav.type this.type = nav.type
this.$router.push("/pc/" + this.secondId + "/" + nav.encodeId); this.$router.push("/pc/" + this.secondId + "/" + nav.encodeId+"?lang="+sessionStorage.getItem("lang"));
//this.getContent(nav) //this.getContent(nav)
//} //}
} }

View File

@@ -47,10 +47,10 @@
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="19" :xl="19"> <el-col :xs="24" :sm="24" :md="24" :lg="19" :xl="19">
<div class="banner"> <div class="banner">
<router-link to="/"> <router-link to="/home">
<div class="link_text"> <div class="link_text">
<div v-show="!english" style="padding: 0 1.1rem;" class="link_text_title">学院首页</div> <div v-show="$i18n.locale === 'cn'" style="padding: 0 1.1rem;" class="link_text_title">学院首页</div>
<div v-show="english" style="padding: 0 .9rem" class="link_text_title">Home</div> <div v-show="$i18n.locale === 'en'" style="padding: 0 .9rem" class="link_text_title">Home</div>
</div> </div>
</router-link> </router-link>
@@ -58,16 +58,16 @@
<a> <a>
<div class="link_text"> <div class="link_text">
<div class="link_text_title"> <div class="link_text_title">
<span style="padding: 0 1.1rem;" v-show="!english">{{ menu.title }}</span> <span style="padding: 0 1.1rem;" v-show="$i18n.locale === 'cn'">{{ menu.title }}</span>
<span style="padding: 0 .9rem" v-show="english">{{ menu.englishTitle }}</span> <span style="padding: 0 .9rem" v-show="$i18n.locale === 'en'">{{ menu.englishTitle }}</span>
<div class="secondary"> <div class="secondary">
<ul style="text-align:left;"> <ul style="text-align:left;">
<li class="menu_list" v-for="(item,i) in menu.children" :key="i" @click="menuCut(item)"> <li class="menu_list" v-for="(item,i) in menu.children" :key="i" @click="menuCut(item)">
<div class="menu_suffix"> <div class="menu_suffix">
<div> <div>
<span v-show="!english">{{ item.title }}</span> <span v-show="$i18n.locale === 'cn'">{{ item.title }}</span>
<span v-show="english">{{ item.englishTitle }}</span> <span v-show="$i18n.locale === 'en'">{{ item.englishTitle }}</span>
</div> </div>
</div> </div>
</li> </li>
@@ -115,27 +115,22 @@ export default {
sessionStorage.setItem("menu", JSON.stringify(res.data)) sessionStorage.setItem("menu", JSON.stringify(res.data))
}) })
} }
//this.$router.push("/" + menu.encodeId);
//}
}, },
methods: { methods: {
menuCut(menu) { menuCut(menu) {
console.log(menu) console.log(menu)
this.$router.push("/pc/" + menu.encodeId + "?type=" + menu.type); this.$router.push("/pc/" + menu.encodeId + "?type=" + menu.type+"&lang="+sessionStorage.getItem("lang"));
}, },
switchLang() { switchLang() {
let lang = '' let lang = ''
if (this.$i18n.locale === 'en') { if (this.$i18n.locale === 'en') {
lang = 'cn' lang = 'cn'
this.english = false;
this.$store.state.isEnglish = this.english
} else { } else {
lang = 'en' lang = 'en'
this.english = true;
this.$store.state.isEnglish = this.english
} }
this.$i18n.locale = lang; sessionStorage.setItem("lang",lang)
let fullPath = this.$route.fullPath
window.location.replace(fullPath.substr(0,fullPath.length-2)+lang)
} }
} }
} }
@@ -210,11 +205,7 @@ export default {
clear: left; clear: left;
.link_text { .link_text {
//width: 9%;
height: 100%; height: 100%;
//line-height: 8.2rem;
//padding: 0 .9rem;
//padding: 0 1.1rem;
text-align: center; text-align: center;
float: left; float: left;
font-size: 1.4rem; font-size: 1.4rem;
@@ -222,7 +213,6 @@ export default {
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
cursor: pointer; cursor: pointer;
//position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -25,28 +25,28 @@
class="el-menu-vertical-demo" class="el-menu-vertical-demo"
@open="handleOpen" @open="handleOpen"
@close="handleClose"> @close="handleClose">
<el-menu-item index="1"> <el-menu-item index="1" @click="home">
<span slot="title">学院首页</span> <span slot="title">{{ $t('message.home') }}</span>
</el-menu-item> </el-menu-item>
<el-submenu :index="menuIndex+2" v-for="(menu,menuIndex) in menuData" :key="menuIndex"> <el-submenu :index="menuIndex+2" v-for="(menu,menuIndex) in menuData" :key="menuIndex">
<template slot="title" > <template slot="title" >
<span v-if="!english">{{ menu.title }}</span> <span v-if="$i18n.locale === 'cn'">{{ menu.title }}</span>
<span v-if="english">{{ menu.title }}</span> <span v-if="$i18n.locale === 'en'">{{ menu.englishTitle }}</span>
</template> </template>
<el-submenu :index="menuIndex +'-'+itemIndex" v-for="(item,itemIndex) in menu.children" :key="itemIndex" > <el-submenu :index="menuIndex +'-'+itemIndex" v-for="(item,itemIndex) in menu.children" :key="itemIndex" >
<template slot="title" v-if="item.children.length == 0 && !english"> <template slot="title" v-if="item.children.length == 0 && $i18n.locale === 'cn'">
<span @click="clickSecondMenu(item)">{{item.title}}</span> <span @click="clickSecondMenu(item)">{{item.title}}</span>
</template> </template>
<template slot="title" v-if="item.children.length == 0&& english"> <template slot="title" v-if="item.children.length == 0&& $i18n.locale === 'en'">
<span @click="clickSecondMenu(item)">{{item.englishTitle}}</span> <span @click="clickSecondMenu(item)">{{item.englishTitle}}</span>
</template> </template>
<template slot="title" v-if="item.children.length > 0 &&!english " >{{item.title}}</template> <template slot="title" v-if="item.children.length > 0 &&$i18n.locale === 'cn' " >{{item.title}}</template>
<template slot="title" v-if="item.children.length > 0 && english" >{{item.englishTitle}}</template> <template slot="title" v-if="item.children.length > 0 && $i18n.locale === 'en'" >{{item.englishTitle}}</template>
<el-menu-item v-for="(chile ,chileIndex) in item.children" :key="chileIndex" :index="menuIndex +'-'+itemIndex +'-' +chileIndex" @click="clickMenu(chile,item)"> <el-menu-item v-for="(chile ,chileIndex) in item.children" :key="chileIndex" :index="menuIndex +'-'+itemIndex +'-' +chileIndex" @click="clickMenu(chile,item)">
<span v-if="!english">{{ chile.title }}</span> <span v-if="$i18n.locale === 'cn'">{{ chile.title }}</span>
<span v-if="english">{{ chile.title }}</span> <span v-if="$i18n.locale === 'en'">{{ chile.englishTitle }}</span>
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
</el-submenu> </el-submenu>
@@ -67,7 +67,6 @@ export default {
return { return {
drawer: false, drawer: false,
direction: 'ltr', direction: 'ltr',
english : false,
mobile:document.documentElement.clientWidth <=992, mobile:document.documentElement.clientWidth <=992,
menuData:[], menuData:[],
}; };
@@ -81,25 +80,28 @@ export default {
} }
}, },
methods: { methods: {
home(){
this.$router.push("/home?lang="+sessionStorage.getItem("lang"))
},
clickSecondMenu(menu){ clickSecondMenu(menu){
this.drawer = false this.drawer = false
this.$router.push("/mobile/" +menu.encodeId+"?type="+menu.type); this.$router.push("/mobile/" +menu.encodeId+"?type="+menu.type+"&lang="+sessionStorage.getItem("lang"));
}, },
clickMenu(menu,parent){ clickMenu(menu,parent){
this.drawer = false this.drawer = false
this.$router.push("/mobile/" +parent.encodeId+"/"+menu.encodeId); this.$router.push("/mobile/" +parent.encodeId+"/"+menu.encodeId+"&lang="+sessionStorage.getItem("lang"));
}, },
switchLang() { switchLang() {
let lang = '' let lang = ''
if (this.$i18n.locale === 'en') { if (this.$i18n.locale === 'en') {
lang = 'cn' lang = 'cn'
this.english = false;
} else { } else {
this.english = true;
lang = 'en' lang = 'en'
} }
this.$i18n.locale = lang; sessionStorage.setItem("lang",lang)
let fullPath = this.$route.fullPath
window.location.replace(fullPath.substr(0,fullPath.length-2)+lang)
}, },
handleOpen(key, keyPath) { handleOpen(key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath);

View File

@@ -1,47 +1,22 @@
<template> <template>
<div class="news_center"> <div class="news_center">
<!--title <div class="headline">
<el-row> <div class="hr_div">
<el-col :xs="1" :sm="2" :md="4" :lg="6" :xl="6"> <div class="hr_line_left">
<div class="grid-content"></div>
</el-col>
<el-col class="headline" :xs="22" :sm="20" :md="16" :lg="12" :xl="12">
<div class="title">
{{ $t('message.news_center') }}
</div> </div>
<el-row> <div class="hr_dot_left">
<el-col :span="9">
<hr class="hr">
</el-col>
<el-col :span="6">
<div class="divider_text">News Center</div>
</el-col>
<el-col :span="9">
<hr class="hr">
</el-col>
</el-row>
</el-col>
</el-row>-->
<!--title-->
<div class="headline">
<div class="hr_div">
<div class="hr_line_left">
</div>
<div class="hr_dot_left">
</div>
</div>
<div class="title">
{{ $t('message.news_ceter') }}
</div>
<div class="hr_div">
<div class="hr_line_right">
</div>
<div class="hr_dot_right">
</div>
</div> </div>
</div> </div>
<div class="title">
{{ $t('message.news_ceter') }}
</div>
<div class="hr_div">
<div class="hr_line_right">
</div>
<div class="hr_dot_right">
</div>
</div>
</div>
<!--录播图--> <!--录播图-->
@@ -52,8 +27,8 @@
<el-col :xs="22" :sm="20" :md="20" :lg="18" :xl="14"> <el-col :xs="22" :sm="20" :md="20" :lg="18" :xl="14">
<div class="slideshow"> <div class="slideshow">
<el-carousel trigger="click" height="23.3vw"> <el-carousel trigger="click" height="23.3vw">
<el-carousel-item v-for="(item,index) in bannerDate" :key="index" @click="clickTo(item.link)"> <el-carousel-item v-for="(item,index) in bannerDate" :key="index">
<div> <div v-show="$i18n.locale === 'cn'" @click="clickTo(item.link)">
<img :src="item.imgurl" alt=""> <img :src="item.imgurl" alt="">
<div class="bottom_title"> <div class="bottom_title">
<el-row> <el-row>
@@ -63,6 +38,16 @@
</el-row> </el-row>
</div> </div>
</div> </div>
<div v-show="$i18n.locale === 'en'" @click="clickTo(item.enLink)">
<img :src="item.imgurl" alt="">
<div class="bottom_title">
<el-row>
<el-col :offset="2" :span="18">
{{ item.enTitle }}
</el-col>
</el-row>
</div>
</div>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
@@ -125,25 +110,25 @@ export default {
this.getBanner() this.getBanner()
}, },
methods: { methods: {
clickTo(link){ clickTo(link) {
//console.log(link) //console.log(link)
window.location.href=link;//当前标签页 window.location.href = link;//当前标签页
}, },
lookMore(news){ lookMore(news) {
info(news.id).then(res=>{ info(news.id).then(res => {
let info = getParentNode(res.data.encodeId) let info = getParentNode(res.data.encodeId)
console.log(res) console.log(res)
if (info.three ==null){ if (info.three == null) {
if (this.width){ if (this.width) {
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
}else { } else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} }
}else { } else {
if (this.width){ if (this.width) {
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
}else { } else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} }
} }
}) })
@@ -161,9 +146,9 @@ export default {
info(news.id).then(res => { info(news.id).then(res => {
let info = getParentNode(res.data.encodeId) let info = getParentNode(res.data.encodeId)
if (this.width) { if (this.width) {
this.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id); this.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
} else { } else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id); this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
} }
}) })
}, },
@@ -176,7 +161,7 @@ export default {
} }
</script> </script>
<style> <style>
.el-carousel__indicators{ .el-carousel__indicators {
display: none; display: none;
} }
</style> </style>
@@ -231,7 +216,8 @@ export default {
border: 0.1rem solid #CAD9F3; border: 0.1rem solid #CAD9F3;
.news_context_img { .news_context_img {
height: 14rem; height: 62%;
width: 100%;
img { img {
width: 100%; width: 100%;
@@ -239,18 +225,19 @@ export default {
} }
.news_context_text { .news_context_text {
font-size: 1.6rem; height: 28%;
font-family: "微软雅黑";
font-weight: 400;
color: #262626;
margin: 1rem auto;
width: 80%; width: 80%;
//height: 4rem; font-size: 1.6rem;
overflow: hidden; //超出的文本隐藏 font-weight: 400;
text-overflow: ellipsis; //溢出用省略号显示 text-align: center;
display: -webkit-box; //作为弹性伸缩盒子模型显示。 color: #262626;
-webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列 margin: 0 auto;
-webkit-line-clamp: 3; //显示的行 padding: 1rem 0;
text-overflow: ellipsis;
overflow: hidden;
display:-webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp:3; //显示的行
} }
} }
} }

View File

@@ -138,15 +138,15 @@ export default {
console.log(res) console.log(res)
if (info.three ==null){ if (info.three ==null){
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
}else { }else {
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
} }
}) })

View File

@@ -175,15 +175,15 @@ export default {
console.log(res) console.log(res)
if (info.three ==null){ if (info.three ==null){
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
}else { }else {
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
} }
}) })
@@ -204,15 +204,15 @@ export default {
console.log(info) console.log(info)
if (info.three == null){ if (info.three == null){
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
}else { }else {
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id); this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id); this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
} }
} }

View File

@@ -1,14 +1,26 @@
<template> <template>
<div class="banner-card"> <div class="banner-card">
<ul class="ul"> <ul class="ul">
<li v-for="(item,index) in bannerDate" :key="index" @click="clickTo(item.link)"> <li v-for="(item,index) in bannerDate" :key="index">
<div class="card_img"> <div v-if="$i18n.locale === 'cn'" @click="clickTo(item.link)">
<img <div class="card_img" >
:src="item.imgurl" <img
alt=""/> :src="item.imgurl"
alt=""/>
</div>
<div class="card_title">
{{item.title}}
</div>
</div> </div>
<div class="card_title"> <div v-if="$i18n.locale === 'en'" @click="clickTo(item.enLink)">
{{item.title}} <div class="card_img" >
<img
:src="item.imgurl"
alt=""/>
</div>
<div class="card_title">
{{item.enTitle}}
</div>
</div> </div>
</li> </li>
</ul> </ul>

View File

@@ -98,15 +98,15 @@ export default {
console.log(res) console.log(res)
if (info.three ==null){ if (info.three ==null){
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
}else { }else {
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
} }
}) })
@@ -130,15 +130,15 @@ export default {
console.log(info) console.log(info)
if (info.three == null){ if (info.three == null){
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type); this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type); this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
} }
}else { }else {
if (this.width){ if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id); this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
}else { }else {
this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id); this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
} }
} }

View File

@@ -48,6 +48,7 @@ import SlideshowCard from './components/slideshow_card.vue'
import TeachingStudent from './components/teaching_student.vue' import TeachingStudent from './components/teaching_student.vue'
import Bottom from './components/bottom.vue' import Bottom from './components/bottom.vue'
import {getConfig} from "@/api"; import {getConfig} from "@/api";
import {setAppLanguage, setLanguage} from "@/utils/sist";
export default { export default {
name: "index", name: "index",
@@ -71,6 +72,7 @@ export default {
window.removeEventListener('scroll', this.handleScroll) window.removeEventListener('scroll', this.handleScroll)
}, },
created() { created() {
setLanguage(this)
getConfig("sist_bg").then(res=>{ getConfig("sist_bg").then(res=>{
this.imageUrl = res.data this.imageUrl = res.data
}) })
@@ -92,7 +94,6 @@ export default {
methods: { methods: {
handleScroll() { handleScroll() {
this.iftop = window.pageYOffset > 400 this.iftop = window.pageYOffset > 400
console.log(window.pageYOffset)
this.$emit("input", window.pageYOffset) this.$emit("input", window.pageYOffset)
}, },
backTop() { backTop() {

View File

@@ -57,7 +57,7 @@ import DireData from '@/views/content/components/dire_data.vue'
import Details from '@/views/content/components/details.vue' import Details from '@/views/content/components/details.vue'
import FileList from '@/views/content/components/file_list.vue' import FileList from '@/views/content/components/file_list.vue'
import {handleTree} from "@/utils/ebts"; import {handleTree} from "@/utils/ebts";
import {getParentNode} from "@/utils/sist"; import {getParentNode, setLanguage} from "@/utils/sist";
export default { export default {
name: "index", name: "index",
@@ -115,13 +115,13 @@ export default {
} }
}, },
created() { created() {
setLanguage(this)
this.secondId = this.$route.params && this.$route.params.secondId; this.secondId = this.$route.params && this.$route.params.secondId;
this.navId = this.$route.params && this.$route.params.navId; this.navId = this.$route.params && this.$route.params.navId;
this.type = this.$route.query && this.$route.query.type this.type = this.$route.query && this.$route.query.type
setTimeout(() => { setTimeout(() => {
this.init() this.init()
}, 200); }, 200);
}, },
methods: { methods: {
init(){ init(){