Commit 81061f2e authored by wenglk's avatar wenglk

update

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