Commit 81061f2e authored by wenglk's avatar wenglk

update

parent bdbe3b53
......@@ -13,7 +13,7 @@
>
<div class="flex items-center">
<img src="@/assets/images/ycclogo.png" alt="logo" width="164" />
<ul class="header_menu flex leading-normal text-sm ml-16">
<!-- <ul class="header_menu flex leading-normal text-sm ml-16">
<router-link
:to="{ path: '/home', query: { lang: $route.query.lang } }"
tag="li"
......@@ -109,7 +109,7 @@
}"
></span>
</router-link>
</ul>
</ul> -->
</div>
<div class="flex text-sm mr-1 items-center">
<p
......@@ -117,7 +117,7 @@
:class="{ 'text-white': isTop }"
:style="{ color: $route.path === '/home' ? '' : '#2545CB' }"
>
{{ $t('lang.email') }}: business@yuan.org
{{ $t("lang.email") }}: business@yuan.org
</p>
<div class="relative">
<div
......@@ -126,7 +126,7 @@
@click="showIcon = !showIcon"
>
<img class="mr-2" src="@/assets/images/header/ZH.png" alt="中文" />
<p class="text-sm">{{ $t('lang.zh') }}</p>
<p class="text-sm">{{ $t("lang.zh") }}</p>
<img
class="ml-1"
width="10"
......@@ -140,7 +140,7 @@
@click="showIcon = !showIcon"
>
<img class="mr-2" src="@/assets/images/header/EN.png" alt="英文" />
<p class="text-sm">{{ $t('lang.en') }}</p>
<p class="text-sm">{{ $t("lang.en") }}</p>
<img
class="ml-1"
width="10"
......@@ -153,7 +153,7 @@
@hidden="showIcon = false"
@selectIcon="
(v) => {
iconType = v
iconType = v;
}
"
></icon-select>
......@@ -179,7 +179,7 @@
@click="showIcon = !showIcon"
>
<img class="mr-1" src="@/assets/images/header/ZH.png" alt="中文" />
<p class="text-xs text-footer-color">{{ $t('lang.zh') }}</p>
<p class="text-xs text-footer-color">{{ $t("lang.zh") }}</p>
<img
class="mr-1"
width="10"
......@@ -193,7 +193,7 @@
@click="showIcon = !showIcon"
>
<img class="mr-1" src="@/assets/images/header/EN.png" alt="英文" />
<p class="text-xs text-footer-color">{{ $t('lang.en') }}</p>
<p class="text-xs text-footer-color">{{ $t("lang.en") }}</p>
<img
class="mr-1"
width="10"
......@@ -206,21 +206,22 @@
@hidden="showIcon = false"
@selectIcon="
(v) => {
iconType = v
iconType = v;
}
"
></icon-select>
</div>
<div
<div class="mr-6"></div>
<!-- <div
class="mr-5 w-6 h-6"
@click=";(showMenu = !showMenu), (showIcon = false)"
@click="(showMenu = !showMenu), (showIcon = false);"
>
<img
class="w-full h-full"
src="@/assets/images/header/menu.png"
alt=""
/>
</div>
</div> -->
</div>
</div>
<Menu :isShow="showMenu" v-on:close="closeMenu" :iconType="iconType"></Menu>
......@@ -228,11 +229,11 @@
</template>
<script lang="ts">
import Vue from 'vue'
import IconSelect from '@/components/iconSelect.vue'
import Menu from '@/components/mobile/menu.vue'
import { checkIsMobile } from '@/utils/utils'
import moment from 'moment'
import Vue from "vue";
import IconSelect from "@/components/iconSelect.vue";
import Menu from "@/components/mobile/menu.vue";
import { checkIsMobile } from "@/utils/utils";
import moment from "moment";
export default Vue.extend({
components: {
IconSelect,
......@@ -242,52 +243,50 @@ export default Vue.extend({
return {
isTop: true,
showIcon: false,
iconType: 'zh-CN',
iconType: "zh-CN",
showMenu: false,
}
};
},
methods: {
closeMenu(v: boolean) {
this.showMenu = !v
this.showMenu = !v;
},
},
computed: {
isMobile() {
return checkIsMobile()
return checkIsMobile();
},
},
mounted() {
const scrollY = window.scrollY
const type = this.$route.query as any
const scrollY = window.scrollY;
const type = this.$route.query as any;
this.iconType =
type.lang || window.sessionStorage.getItem('language') || 'zh-CN'
type.lang || window.sessionStorage.getItem("language") || "zh-CN";
window.sessionStorage.setItem(
'language',
window.sessionStorage.getItem('language') || this.iconType,
)
this.$i18n.locale = this.iconType === 'zh-CN' ? 'zh' : 'en'
this.isTop = scrollY < 70 ? true : false
window.addEventListener('scroll', () => {
const scrollY = window.scrollY
this.isTop = scrollY < 70 ? true : false
})
moment.locale(this.iconType === 'zh-CN' ? 'zh-cn' : 'en')
document.title = `${this.$t('lang.YUANLIAN')}YCC——${this.$t(
'lang.title',
)}`
"language",
window.sessionStorage.getItem("language") || this.iconType
);
this.$i18n.locale = this.iconType === "zh-CN" ? "zh" : "en";
this.isTop = scrollY < 70 ? true : false;
window.addEventListener("scroll", () => {
const scrollY = window.scrollY;
this.isTop = scrollY < 70 ? true : false;
});
moment.locale(this.iconType === "zh-CN" ? "zh-cn" : "en");
document.title = `${this.$t("lang.YUANLIAN")}YCC——${this.$t("lang.title")}`;
},
watch: {
$route(n, o) {
const scrollY = window.scrollY
const scrollY = window.scrollY;
this.iconType =
window.sessionStorage.getItem('language') || n.query.lang || 'zh-CN'
moment.locale(this.iconType === 'zh-CN' ? 'zh-cn' : 'en')
this.isTop = scrollY < 70 ? true : false
window.addEventListener('scroll', () => {
const scrollY = window.scrollY
this.isTop = scrollY < 70 ? true : false
})
window.sessionStorage.getItem("language") || n.query.lang || "zh-CN";
moment.locale(this.iconType === "zh-CN" ? "zh-cn" : "en");
this.isTop = scrollY < 70 ? true : false;
window.addEventListener("scroll", () => {
const scrollY = window.scrollY;
this.isTop = scrollY < 70 ? true : false;
});
},
},
})
});
</script>
......@@ -12,23 +12,23 @@ const routes: Array<RouteConfig> = [
path: "/",
name: "LayOne",
component: App,
redirect: "/home",
redirect: "/blockChainBrowser",
children: [
{
path: "/home",
name: "首页",
component: () => import(`@/views/${file}/Home.vue`),
},
{
path: "/newsList",
name: "新闻公告",
component: () => import(`@/views/${file}/newsList.vue`),
},
{
path: "/newsDetails",
name: "新闻详情",
component: () => import(`@/views/${file}/newsDetails.vue`),
},
// {
// path: "/home",
// name: "首页",
// component: () => import(`@/views/${file}/Home.vue`),
// },
// {
// path: "/newsList",
// name: "新闻公告",
// component: () => import(`@/views/${file}/newsList.vue`),
// },
// {
// path: "/newsDetails",
// name: "新闻详情",
// component: () => import(`@/views/${file}/newsDetails.vue`),
// },
{
path: "/blockChainBrowser",
name: "区块链浏览器",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment