Commit 03618e14 authored by 黄媛媛's avatar 黄媛媛

国际化

parent ba2ae980
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
</script> </script>
<style> <style>
@import "//at.alicdn.com/t/font_1635628_xspbsio88z.css"; @import "//at.alicdn.com/t/font_1635628_7cg9x5d0v7.css";
@import "./assets/css/common.css"; @import "./assets/css/common.css";
@import './assets/global/font.css'; @import './assets/global/font.css';
@import "./assets/css/reset.css"; @import "./assets/css/reset.css";
......
export const pub={
account:"アカウント",
passwd:'パスワード',
login:'ログイン',
manasystem:'管理システム',
qsrzh:'口座に入力してください',
qsrmm:'暗証番号を入力してください',
xgzl:'資料を修正する',
tcdl:'ログアウト',
qhyy:'言語を切り替える',
hello:'こんにちは',
home:'トップページ',
hotelList:'ホテル一覧',
hotelorder:'ホテル予約',
}
\ No newline at end of file
export const pub={
account:"账号",
passwd:'密码',
login:'登录',
manasystem:'管理系统',
qsrzh:'请输入账户',
qsrmm:'请输入密码',
xgzl:'修改资料',
tcdl:'退出登录',
qhyy:'切换语言',
hello:'你好',
home:'首页',
hotelList:'酒店列表',
hotelorder:'酒店订单',
}
\ No newline at end of file
<template> <template>
<div class="login"> <div class="login">
<div class="loginContent"> <div class="loginContent">
<p class="f40 bold c11">SCM管理システム</p> <p class="f40 bold c11">SCM{{$t('pub.manasystem')}}</p>
<div style="margin:60px 0 50px 0"> <div style="margin:60px 0 50px 0">
<p title="账号"> <p title="账号">
<img style="width:16px;height:14px" src="../../assets/img/user.png" alt=""> <img style="width:16px;height:14px" src="../../assets/img/user.png" alt="">
アカウント</p> {{$t('pub.account')}}</p>
<el-input v-model="userInfo.EmAccount" placeholder="口座に入力してください"></el-input> <el-input v-model="userInfo.EmAccount" :placeholder="$t('pub.qsrzh')"></el-input>
</div> </div>
<div> <div>
<p title="密码"> <p title="密码">
<img style="width:16px;height:14px;margin-right:4px" src="../../assets/img/passwd.png" alt="">パスワード</p> <img style="width:16px;height:14px;margin-right:4px" src="../../assets/img/passwd.png" alt="">
<el-input type="password" v-model="userInfo.EmPassword" placeholder="暗証番号を入力してください"></el-input> {{$t('pub.passwd')}}
</p>
<el-input type="password" v-model="userInfo.EmPassword" :placeholder="$t('pub.qsrmm')"></el-input>
</div> </div>
<div class="loginDiv"> <div class="loginDiv">
<span v-loading="btnLoading" @click="Login" title="登录">ログイン</span> <span v-loading="btnLoading" @click="Login" title="登录">{{$t('pub.login')}}</span>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -6,11 +6,25 @@ ...@@ -6,11 +6,25 @@
<ul> <ul>
<li @click="showUpdateBoard()" style="cursor: pointer;margin-top:12px" title="修改资料"> <li @click="showUpdateBoard()" style="cursor: pointer;margin-top:12px" title="修改资料">
<i style="color:#FFA475" class="iconfont iconxiugaiziliao"></i> <i style="color:#FFA475" class="iconfont iconxiugaiziliao"></i>
<span style="margin-left:6px">資料を修正する</span> <span style="margin-left:6px">{{$t('pub.xgzl')}}</span>
</li> </li>
<li @click="LoginOut" style="cursor: pointer;margin-top:12px" title="退出登录"> <li @click="LoginOut" style="cursor: pointer;margin-top:12px" title="退出登录">
<i style="color:#FFA475" class="iconfont icontuichudenglu"></i> <i style="color:#FFA475" class="iconfont icontuichudenglu"></i>
<span style="margin-left:6px">ログアウト</span> <span style="margin-left:6px">{{$t('pub.tcdl')}}</span>
</li>
<li style="cursor: pointer;margin-top:12px">
<el-dropdown>
<span class="el-dropdown-link">
<i style="color:#FFA475" class="iconfont iconyuyan"></i>
<span style="margin-left:6px">{{$t('pub.qhyy')}}</span>
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="ChangeLan('Japanese')">日语 <i v-if="language=='Japanese'" class="iconfont icongou"></i></el-dropdown-item>
<el-dropdown-item @click.native="ChangeLan('zh-CN')">中文 <i v-if="language=='zh-CN'" class="iconfont icongouu"></i></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li> </li>
</ul> </ul>
<span slot="reference" style="display: inline-flex;align-items: center;cursor: pointer;"> <span slot="reference" style="display: inline-flex;align-items: center;cursor: pointer;">
...@@ -20,7 +34,7 @@ ...@@ -20,7 +34,7 @@
</span> </span>
</el-popover> </el-popover>
<br /> <br />
<span class="f14"><span style="color:#BEBEBE">こんにちは</span>,{{scmAccount.Name}}</span> <span class="f14"><span style="color:#BEBEBE">{{$t('pub.hello')}}</span>,{{scmAccount.Name}}</span>
</div> </div>
</div> </div>
<div class="BigmenuDiv" :style='{"height":menuheight+"px"}'> <div class="BigmenuDiv" :style='{"height":menuheight+"px"}'>
...@@ -28,20 +42,20 @@ ...@@ -28,20 +42,20 @@
<el-menu-item index="0" route="/home" title="首页"> <el-menu-item index="0" route="/home" title="首页">
<div @click="goHome" class="menuDiv"> <div @click="goHome" class="menuDiv">
<i class="iconfont icon-shouye"></i> <i class="iconfont icon-shouye"></i>
<span slot="title">トップページ</span> <span slot="title">{{$t('pub.hello')}}</span>
</div> </div>
</el-menu-item> </el-menu-item>
<el-menu-item index="1" title="酒店列表"> <el-menu-item index="1" title="酒店列表">
<div @click="goUrl('HotelList')" class="menuDiv"> <div @click="goUrl('HotelList')" class="menuDiv">
<i class="iconfont icon-shouye"></i> <i class="iconfont icon-shouye"></i>
<span slot="title">ホテル一覧 <span slot="title">{{$t('pub.hotelList')}}
</span> </span>
</div> </div>
</el-menu-item> </el-menu-item>
<el-menu-item index="2" title="酒店订单"> <el-menu-item index="2" title="酒店订单">
<div @click="goUrl('HotelOrder')" class="menuDiv"> <div @click="goUrl('HotelOrder')" class="menuDiv">
<i class="iconfont icon-shouye"></i> <i class="iconfont icon-shouye"></i>
<span slot="title">ホテル予約</span> <span slot="title">{{$t('pub.hotelorder')}}</span>
</div> </div>
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
...@@ -60,6 +74,7 @@ ...@@ -60,6 +74,7 @@
scmAccount: {}, //SCM账号信息 scmAccount: {}, //SCM账号信息
defaultHeadImg: 'this.src="' + require("../../assets/img/defaultperson.png") + '"', defaultHeadImg: 'this.src="' + require("../../assets/img/defaultperson.png") + '"',
menuheight: 0, menuheight: 0,
language:'zh-CN',
} }
}, },
created() { created() {
...@@ -94,6 +109,11 @@ ...@@ -94,6 +109,11 @@
}, },
}, },
methods: { methods: {
ChangeLan(str){
this.language=str;
this.$i18n.locale = str;
localStorage.language = str;
},
LoginOut() { LoginOut() {
localStorage.removeItem("scmAccount"); localStorage.removeItem("scmAccount");
location.href = '/' location.href = '/'
......
...@@ -96,6 +96,14 @@ ...@@ -96,6 +96,14 @@
} }
}, },
created() { created() {
let language = localStorage.language
if (!language) {
this.language = 'zh-CN';
this.$i18n.locale = 'zh-CN';
} else {
this.language = language
this.$i18n.locale = language;
}
this.minHeight = document.body.clientHeight; this.minHeight = document.body.clientHeight;
if (!this.getLocalStorage()) { if (!this.getLocalStorage()) {
this.$router.push({ this.$router.push({
......
...@@ -7,6 +7,8 @@ import plug from './plugins/index' ...@@ -7,6 +7,8 @@ import plug from './plugins/index'
import moment from 'moment' import moment from 'moment'
import axios from 'axios' import axios from 'axios'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n) // 通过插件的形式挂载
import vueQuillEditor from 'vue-quill-editor' import vueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css' import 'quill/dist/quill.core.css'
...@@ -56,10 +58,20 @@ Vue.filter("YMDHMS", function (date) { ...@@ -56,10 +58,20 @@ Vue.filter("YMDHMS", function (date) {
return moment(date).format("YYYY-MM-DD HH:mm:ss"); return moment(date).format("YYYY-MM-DD HH:mm:ss");
}) })
const i18n = new VueI18n({
locale: 'zh-CN', // 语言标识
//this.$i18n.locale // 通过切换locale的值来实现语言切换
messages: {
'zh-CN': require('./assets/common/zh'), // 中文语言包
'Japanese' : require('./assets/common/jp') // 日本语言包
}
})
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',
router, router,
i18n,
components: { App }, components: { App },
template: '<App/>' template: '<App/>'
}) })
...@@ -11,12 +11,13 @@ export default { ...@@ -11,12 +11,13 @@ export default {
}, },
//域名管理对象 //域名管理对象
Vue.prototype.domainManager = function () { Vue.prototype.domainManager = function () {
var domainUrl = "http://127.0.0.1"; //主域名 // var domainUrl = "http://127.0.0.1"; //主域名
var domainUrl = "http://testapi.oytour.com"; //主域名
let locationName = window.location.hostname; let locationName = window.location.hostname;
if (this.isOnline()) { if (this.isOnline()) {
if (window.location.host.indexOf('testzcyx.oytour.com') != -1) { if (window.location.host.indexOf('testzcyx.oytour.com') != -1) {
domainUrl = "http://127.0.0.1" // domainUrl = "http://127.0.0.1"
//domainUrl = "http://testapi.oytour.com" domainUrl = "http://testapi.oytour.com"
} else if (window.location.host.indexOf('oytour.com') != -1) } else if (window.location.host.indexOf('oytour.com') != -1)
domainUrl = "http://reborn.oytour.com" domainUrl = "http://reborn.oytour.com"
} }
......
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