Commit 023cdbc3 authored by 沈翠玲's avatar 沈翠玲

国际化

parent 8f4a1d6e
import i18n from '../lang/index'
import config from './config.js' import config from './config.js'
function check(param = {}) { function check(param = {}) {
// 合并默认参数 // 合并默认参数
param = Object.assign({ param = Object.assign({
title: "检测到有新版本!", title: i18n.t('检测到有新版本!'),
content: "请升级app到最新版本!", content: i18n.t('请升级app到最新版本!'),
canceltext: "暂不升级", canceltext: i18n.t('暂不升级'),
oktext: "立即升级" oktext: i18n.t('立即升级')
}, param) }, param)
plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => { plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
let platform = plus.os.name.toLocaleLowerCase() let platform = plus.os.name.toLocaleLowerCase()
...@@ -55,13 +56,13 @@ function check(param = {}) { ...@@ -55,13 +56,13 @@ function check(param = {}) {
plus.runtime.restart(); plus.runtime.restart();
}, (e) => { }, (e) => {
uni.showToast({ uni.showToast({
title: '安装升级包失败:' + JSON title: i18n.t('安装升级包失败:') + JSON
.stringify(e), .stringify(e),
icon: 'none' icon: 'none'
}) })
}); });
} else { } else {
this.tui.toast("下载升级包失败,请手动去站点下载安装,错误码: " + this.tui.toast(i18n.t('下载升级包失败,请手动去站点下载安装,错误码:') +
status); status);
} }
}); });
...@@ -74,7 +75,7 @@ function check(param = {}) { ...@@ -74,7 +75,7 @@ function check(param = {}) {
height: plus.screen.resolutionHeight height: plus.screen.resolutionHeight
}) })
view.drawText('开始下载', {}, { view.drawText(i18n.t('开始下载'), {}, {
size: '12px', size: '12px',
color: '#FFFFFF' color: '#FFFFFF'
}); });
...@@ -87,7 +88,7 @@ function check(param = {}) { ...@@ -87,7 +88,7 @@ function check(param = {}) {
let jindu = ((e.downloadedSize / e.totalSize) * let jindu = ((e.downloadedSize / e.totalSize) *
100).toFixed(2) 100).toFixed(2)
view.reset(); view.reset();
view.drawText('进度:' + jindu + '%', {}, { view.drawText(i18n.t('进度:') + jindu + '%', {}, {
size: '12px', size: '12px',
color: '#FFFFFF' color: '#FFFFFF'
}); });
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<view class="dmodel-table"> <view class="dmodel-table">
<view class="search"> <view class="search">
<u-form :model="tableParams" labelAlign="right" class="tableForm"> <u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item label="工号" label-width="60px" name="userName"> <u-form-item :label="$t('工号')" label-width="60px" name="userName">
<uni-easyinput type="text" v-model="tableParams.userName" placeholder="请输入编号" /> <uni-easyinput type="text" v-model="tableParams.userName" :placeholder="$t('请输入编号')" />
</u-form-item> </u-form-item>
<u-form-item label="姓名" label-width="60px" name="nickName"> <u-form-item :label="$t('姓名')" label-width="60px" name="nickName">
<uni-easyinput type="text" v-model="tableParams.nickName" placeholder="请输入名称" /> <uni-easyinput type="text" v-model="tableParams.nickName" :placeholder="$t('请输入名称')" />
</u-form-item> </u-form-item>
<u-form-item> <u-form-item>
<u-button class="btn" @click="handleClick" type="primary" size="medium">搜索</u-button> <u-button class="btn" @click="handleClick" type="primary" size="medium">{{$t('搜索')}}</u-button>
</u-form-item> </u-form-item>
</u-form> </u-form>
</view> </view>
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
</template> </template>
<script> <script>
import i18n from '../../lang/index'
export default { export default {
name: 'User', name: 'User',
data() { data() {
...@@ -43,12 +45,12 @@ export default { ...@@ -43,12 +45,12 @@ export default {
}, },
{ {
name: 'userName', name: 'userName',
label: '工号', label: i18n.t('工号'),
width: 160 width: 160
}, },
{ {
name: 'nickName', name: 'nickName',
label: '姓名', label: i18n.t('姓名'),
width: 200 width: 200
} }
] ]
......
...@@ -290,5 +290,11 @@ ...@@ -290,5 +290,11 @@
"暂无数据~~": "ไม่มีข้อมูลในขณะนี้ ~", "暂无数据~~": "ไม่มีข้อมูลในขณะนี้ ~",
"合计": "รวม", "合计": "รวม",
"图纸名": "ชื่อภาพวาด", "图纸名": "ชื่อภาพวาด",
"不支持查看其它格式的文件": "ไม่สนับสนุนการดูไฟล์ในรูปแบบอื่น ๆ" "不支持查看其它格式的文件": "ไม่สนับสนุนการดูไฟล์ในรูปแบบอื่น ๆ",
"安装升级包失败:": "การติดตั้งแพ็กเกจอัพเกรดล้มเหลว:",
"下载升级包失败,请手动去站点下载安装,错误码:": "ดาวน์โหลดแพคเกจอัพเกรดล้มเหลวโปรดไปที่เว็บไซต์ด้วยตนเองเพื่อดาวน์โหลดการติดตั้งรหัสข้อผิดพลาด:",
"开始下载": "เริ่มดาวน์โหลด",
"进度:": "ความคืบหน้า:",
"共": "ทั้งหมด",
"条": "บทความ"
} }
\ No newline at end of file
...@@ -290,5 +290,11 @@ ...@@ -290,5 +290,11 @@
"暂无数据~~": "暂无数据~~", "暂无数据~~": "暂无数据~~",
"合计": "合计", "合计": "合计",
"图纸名": "图纸名", "图纸名": "图纸名",
"不支持查看其它格式的文件": "不支持查看其它格式的文件" "不支持查看其它格式的文件": "不支持查看其它格式的文件",
"安装升级包失败:": "安装升级包失败:",
"下载升级包失败,请手动去站点下载安装,错误码:": "下载升级包失败,请手动去站点下载安装,错误码:",
"开始下载": "开始下载",
"进度:": "进度:",
"共": "共",
"条": "条"
} }
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</picker> </picker>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view class="uni-pagination__total is-phone-hide">{{ total }}</view> <view class="uni-pagination__total is-phone-hide">{{$t('共')}} {{ total }} {{$t('条')}}</view>
<!-- #endif --> <!-- #endif -->
<view class="uni-pagination__btn" <view class="uni-pagination__btn"
:class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'" :class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
......
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