Commit fe3a4d80 by fanx

中英文机制

1 parent 3d4f3c05
......@@ -160,12 +160,6 @@ section {
justify-content: space-between;
}
}
.bgImgClass {
background: url(../assets/icon/bg_login.png) !important;
background-repeat: no-repeat;
background-size: 100% !important;
background-position: center center;
}
.nav_left {
display: flex;
align-items: center;
......
const buttonEn = {
ok: 'Ok', // 确定
cancel: 'Cancel', // 取消
reset: 'Reset', // 重置
login: 'Login', // 登录
}
const buttonZn = {
ok: '确定',
cancel: '取消',
reset: '重置',
login: '登录',
}
export default {
buttonEn,
buttonZn
};
\ No newline at end of file
export default {
lang: "English",
message: {
hello: 'hello world'
},
setting: {
newMsgTip: "newMessageTip"
}
}
\ No newline at end of file
import zh from './zh'
import en from './en'
// 全局公用模块
import button from './button/index'
import placeholder from './placeholder/index'
import toast from './toast/index'
// 单独页面模块
import title from './title/index'
import user from './user/index'
const messages = {
zh,
en,
en: {
lang: 'English',
...button.buttonEn,
...placeholder.placeholderEn,
...toast.toastEn,
...title.titleEn,
...user.userEn,
},
zh: {
lang: "中文",
...button.buttonZn,
...placeholder.placeholderZn,
...toast.toastZn,
...title.titleZn,
...user.userZh,
}
}
export default messages
\ No newline at end of file
const placeholderEn = {
userName: 'please input username',
}
const placeholderZn = {
userName: '请输入用户名',
}
export default {
placeholderEn,
placeholderZn
};
\ No newline at end of file
const titleEn = {
home: 'Home',
}
const titleZn = {
home: '首页',
}
export default {
titleEn,
titleZn
};
\ No newline at end of file
const toastEn = {
userName: 'please input username',
phone: 'pleace input correct phone format',
email: 'pleace input correct email format',
}
const toastZn = {
userName: '请输入用户名',
phone: '请输入正确的手机格式',
email: '请输入正确的邮箱格式',
}
export default {
toastEn,
toastZn
};
\ No newline at end of file
const userEn = {
setting: {
language: 'Language', // 多语言
bindWechat: 'Binding Wechat', // 绑定微信
resetPassword: 'Reset Password', // 重置密码
privacyPolicy: 'Privacy Policy', //隐私政策
serviceAgreement: 'Service Agreement', // 服务协议
chinese: 'Chinese',
english: 'English',
}
}
const userZh = {
setting: {
language: '多语言',
bindWechat: '绑定微信',
resetPassword: '重置密码',
privacyPolicy: '隐私政策',
serviceAgreement: '服务协议',
chinese: '中文',
english: '英文',
}
}
export default {
userEn,
userZh
};
\ No newline at end of file
export default {
lang: "中文",
message: {
hello: '你好'
},
setting: {
newMsgTip: "新消息提醒"
}
}
\ No newline at end of file
<template>
<div class="setting_container">
<NafmHeader />
<NafmHeader navClass="nafmii-head-bg3" />
<div class="setting_list">
<!--
<van-cell :title="$t('setting.newMsgTip')" center value-class="right_content">
<template #default>
<van-switch v-model="msgChecked" @click="changeMsgStatus" size="20px" />
</template>
</van-cell>
<van-cell title="多语言" center is-link @click="controllZhEn(true)" value-class="right_content">
</van-cell>
-->
<van-cell :title="$t('setting.language')" center is-link @click="controllZhEn(true)" value-class="right_content">
<template #default>
{{$t("lang")}}
</template>
</van-cell>
<van-cell title="微信绑定" center is-link @click="unbundling" value-class="right_content">
<van-cell :title="$t('setting.bindWechat')" center is-link @click="unbundling" value-class="right_content">
<template #default>
含笑一过
</template>
</van-cell>
<van-cell title="重置密码" center is-link @click="jumpResetPage" value-class="right_content" />
<van-cell :title="$t('setting.resetPassword')" center is-link @click="jumpResetPage" value-class="right_content" />
<!--
<van-cell title="指纹ID解锁" center value-class="right_content">
<template #default>
<van-switch v-model="fingerprintChecked" @click="changeFingerprintStatus" size="20px" />
......@@ -27,11 +30,12 @@
<template #default>
<van-switch v-model="faceIdChecked" @click="changeFaceIdStatus" size="20px" />
</template>
</van-cell>
</van-cell>
-->
</div>
<div class="agreement_list">
<van-cell title="隐私协议" center is-link @click="jumpPrivacyPage" value-class="right_content" />
<van-cell title="服务协议" center is-link @click="jumpServicePage" value-class="right_content" />
<van-cell :title="$t('setting.privacyPolicy')" center is-link @click="jumpPrivacyPage" value-class="right_content" />
<van-cell :title="$t('setting.serviceAgreement')" center is-link @click="jumpServicePage" value-class="right_content" />
</div>
<van-button type="primary" plain color="#a4a4a4" class="logout_btn">退出登录</van-button>
......@@ -47,7 +51,6 @@ export default {
return {
msgChecked: false, //新消息提醒
showZhEn: false, // 弹出中英文设置
actions: [{ name: '中文', key: 'zh' }, { name: '英文', key: 'en' }], // 中英文切换选项
fingerprintChecked: false, // 指纹ID解锁状态
faceIdChecked: false, // 面容ID解锁状态
}
......@@ -55,6 +58,12 @@ export default {
mounted() {
this.msgChecked = true
},
computed: {
// 中英文切换 切换 tab
actions() {
return [{ name: this.$t('setting.chinese'), key: 'zh' }, { name: this.$t('setting.english'), key: 'en' }] // 中英文切换选项
}
},
methods: {
// 切换消息操作
changeMsgStatus() {
......@@ -109,10 +118,9 @@ export default {
},
// 跳转到服务协议页面
jumpServicePage() {
// this.$router.push({
// path: '/user/service'
// })
this.$router.replace('/user/service')
this.$router.push({
path: '/user/service'
})
},
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!