zjj
2025-05-16 65897d713fe067744326e9b0a6bbac98f495838c
#i18n
5个文件已修改
6个文件已添加
463 ■■■■ 已修改文件
locale/en.json 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/ja.json 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/uni-app.ja.json 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/zh-Hans.json 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/zh-Hant.json 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/index.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.vue 259 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
locale/en.json
New file
@@ -0,0 +1,36 @@
{
  "app.name": "ZoneYung WMS",
  "locale.auto": "System",
  "locale.en": "English",
  "locale.zh-hans": "简体中文",
  "locale.zh-hant": "繁体中文",
  "locale.ja": "日语",
  "index.title": "Hello i18n",
  "page.login":"Login",
  "page.index":"Index",
  "login":{
      "login": "login",
      "loging": "loging",
      "user": "user",
      "pwd": "pwd",
      "inputUser": "Please enter your account",
      "inputPwd":"Please enter your password",
    "remPwd":"remember password"
  },
  "index":{
      "GR": "Goods Receipt",
      "palletizing": "Palletizing",
    "palletBuilding":"Pallet Building",
    "inspectionRequest":"Inspection Request",
    "qualityInspection":"Quality Inspection",
    "defectiveMarking":"Defective Marking",
    "manualPutaway":"Manual Putaway",
    "stationBinding":"Station Binding",
    "inboundInitiation":"Inbound Initiation",
    "stationUnbinding":"Station Unbinding",
    "bindAndInbound":"Binding And Inbound",
    "outLogin":"Login Out"
  }
}
locale/index.js
New file
@@ -0,0 +1,10 @@
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
import ja from './ja.json'
export default {
    en,
    'zh-Hans': zhHans,
    'zh-Hant': zhHant,
    ja
}
locale/ja.json
New file
@@ -0,0 +1,23 @@
{
  "locale.auto": "システム",
  "locale.en": "英語",
  "locale.zh-hans": "简体中文",
  "locale.zh-hant": "繁体中文",
  "locale.ja": "日语",
  "index.title": "Hello i18n",
  "index.home": "ホーム",
  "index.component": "コンポーネント",
  "index.api": "API",
  "index.schema": "Schema",
  "index.demo": "uni-app globalization",
  "index.demo-description": "ユニフレームワーク、manifest.json、pages.json、タブバー、ページ、コンポーネント、APIを含める、Schema",
  "index.detail": "詳細",
  "index.language": "言語",
  "index.language-info": "設定",
  "index.system-language": "システム言語",
  "index.application-language": "アプリケーション言語",
  "index.language-change-confirm": "この設定を適用すると、アプリが再起動します",
  "api.message": "メッセージ",
  "schema.add": "追加",
  "schema.add-success": "成功を追加"
}
locale/uni-app.ja.json
New file
@@ -0,0 +1,36 @@
{
  "common": {
    "uni.app.quit": "もう一度押すと、アプリケーションが終了します",
    "uni.async.error": "サーバーへの接続がタイムアウトしました。画面をクリックして再試行してください",
    "uni.showActionSheet.cancel": "キャンセル",
    "uni.showToast.unpaired": "使用するには、showToastとhideToastをペアにする必要があることに注意してください",
    "uni.showLoading.unpaired": "使用するには、showLoadingとhideLoadingをペアにする必要があることに注意してください",
    "uni.showModal.cancel": "キャンセル",
    "uni.showModal.confirm": "OK",
    "uni.chooseImage.cancel": "キャンセル",
    "uni.chooseImage.sourceType.album": "アルバムから選択",
    "uni.chooseImage.sourceType.camera": "カメラ",
    "uni.chooseVideo.cancel": "キャンセル",
    "uni.chooseVideo.sourceType.album": "アルバムから選択",
    "uni.chooseVideo.sourceType.camera": "カメラ",
    "uni.previewImage.cancel": "キャンセル",
    "uni.previewImage.button.save": "画像を保存",
    "uni.previewImage.save.success": "画像をアルバムに正常に保存します",
    "uni.previewImage.save.fail": "画像をアルバムに保存できませんでした",
    "uni.setClipboardData.success": "コンテンツがコピーされました",
    "uni.scanCode.title": "スキャンコード",
    "uni.scanCode.album": "アルバム",
    "uni.scanCode.fail": "認識に失敗しました",
    "uni.scanCode.flash.on": "タッチして点灯",
    "uni.scanCode.flash.off": "タップして閉じる",
    "uni.startSoterAuthentication.authContent": "指紋認識...",
    "uni.picker.done": "完了",
    "uni.picker.cancel": "キャンセル",
    "uni.video.danmu": "「弾幕」",
    "uni.video.volume": "ボリューム",
    "uni.button.feedback.title": "質問のフィードバック",
    "uni.button.feedback.send": "送信"
  },
  "ios": {},
  "android": {}
}
locale/zh-Hans.json
New file
@@ -0,0 +1,39 @@
{
    "app.name": "中扬 WMS",
    "locale.auto": "系统",
    "locale.en": "English",
    "locale.zh-hans": "简体中文",
    "locale.zh-hant": "繁体中文",
    "locale.ja": "日语",
    "index.title": "Hello i18n",
    "index.home": "主页",
    "page.login":"登录",
    "page.index":"首页",
    "login":{
        "login": "登录",
        "loging": "登录中",
        "user": "账号",
        "pwd": "密码",
        "inputUser": "请输入账号",
        "inputPwd":"请输入密码",
        "remPwd":"记住密码"
    },
    "index":{
        "GR": "单据收货",
        "palletizing": "单据组托",
        "palletBuilding":"组托解绑",
        "inspectionRequest":"报检",
        "qualityInspection":"质检",
        "defectiveMarking":"不良标记",
        "manualPutaway":"人工上架",
        "stationBinding":"站点绑定",
        "inboundInitiation":"启动入库",
        "stationUnbinding":"站点解绑",
        "bindAndInbound":"绑定&入库",
        "outLogin":"退出登录"
    }
}
locale/zh-Hant.json
New file
@@ -0,0 +1,10 @@
{
  "locale.auto": "系統",
  "locale.en": "English",
  "locale.zh-hans": "简体中文",
  "locale.zh-hant": "繁體中文",
  "locale.ja": "日语",
  "index.title": "Hello i18n",
  "index.home": "主頁",
  "login.login": "登录"
}
main.js
@@ -1,7 +1,17 @@
import App from './App'
import messages from './locale/index'
let i18nConfig = {
  locale: uni.getLocale(),// 获取已设置的语言
  messages
}
// #ifndef VUE3
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
const i18n = new VueI18n(i18nConfig)
Vue.config.productionTip = false
import '@/common/bluetooth.js';
@@ -13,6 +23,7 @@
Vue.prototype.$Mock = Mock;
App.mpType = 'app'
try {
  function isPromise(obj) {
@@ -43,6 +54,7 @@
} catch (error) { }
const app = new Vue({
    i18n,
  ...App
})
app.$mount()
@@ -50,8 +62,11 @@
// #ifdef VUE3
import { createSSRApp } from 'vue'
import { createI18n } from 'vue-i18n'
const i18n = createI18n(i18nConfig)
export function createApp() {
  const app = createSSRApp(App)
  app.use(i18n)
  return {
    app
  }
manifest.json
@@ -1,5 +1,5 @@
{
    "name" : "中扬WMS",
    "name" : "%app.name%",
    "appid" : "__UNI__DA5854D",
    "description" : "",
    "versionName" : "20250225A",
pages.json
@@ -3,13 +3,13 @@
        {
            "path": "pages/login/login",
            "style": {
                "navigationBarTitleText": "登 录"
                "navigationBarTitleText": "%page.login%"
            }
        },
        {
            "path": "pages/home/index",
            "style": {
                "navigationBarTitleText": "首页"
                "navigationBarTitleText": "%page.index%"
            }
        },
        {
pages/home/index.vue
@@ -31,7 +31,7 @@
                <navigator hover-class='none' url="/pages/rece/other" navigateTo>
                    <view class="cuIcon-taoxiaopu text-blue">
                    </view>
                    <text>单据收货</text>
                    <text>{{$t('index.GR')}}</text>
                </navigator>
            </view>
@@ -46,7 +46,7 @@
                <navigator hover-class='none' url="/pages/listing/matnrPalletising" navigateTo>
                    <view class="cuIcon-cardboard text-blue">
                    </view>
                    <text>单据组托</text>
                    <text>{{$t('index.palletizing')}}</text>
                </navigator>
            </view>
@@ -54,7 +54,7 @@
                <navigator hover-class='none' url="/pages/listing/unPakin" navigateTo>
                    <view class="cuIcon-cardboardforbid text-blue">
                    </view>
                    <text>组托解绑</text>
                    <text>{{$t('index.palletBuilding')}}</text>
                </navigator>
            </view>
@@ -62,7 +62,7 @@
                <navigator hover-class='none' url="/pages/inspect/report" navigateTo>
                    <view class="cuIcon-edit text-blue">
                    </view>
                    <text>报检</text>
                    <text>{{$t('index.inspectionRequest')}}</text>
                </navigator>
            </view>
@@ -70,7 +70,7 @@
                <navigator hover-class='none' url="/pages/inspect/check" navigateTo>
                    <view class="cuIcon-warn text-blue">
                    </view>
                    <text>质检</text>
                    <text>{{$t('index.qualityInspection')}}</text>
                </navigator>
            </view>
@@ -78,7 +78,7 @@
                <navigator hover-class='none' url="/pages/inspect/bad" navigateTo>
                    <view class="cuIcon-appreciate text-blue">
                    </view>
                    <text>不良标记</text>
                    <text>{{$t('index.defectiveMarking')}}</text>
                </navigator>
            </view>
@@ -87,7 +87,7 @@
                <navigator hover-class='none' url="/pages/listing/labour" navigateTo>
                    <view class="cuIcon-friendadd text-blue">
                    </view>
                    <text>人工上架</text>
                    <text>{{$t('index.manualPutaway')}}</text>
                </navigator>
            </view>
            
@@ -104,28 +104,28 @@
                <navigator hover-class='none' url="/pages/AGV/AGVStaBind" navigateTo>
                    <view class="cuIcon-punch text-blue">
                    </view>
                    <text>站点绑定</text>
                    <text>{{$t('index.stationBinding')}}</text>
                </navigator>
            </view>
            <view class="cu-item">
                <navigator hover-class='none' url="/pages/AGV/StartInTask" navigateTo>
                    <view class="cuIcon-punch text-blue">
                    </view>
                    <text>绑定入库</text>
                    <text>{{$t('index.inboundInitiation')}}</text>
                </navigator>
            </view>
            <view class="cu-item">
                <navigator hover-class='none' url="/pages/AGV/StaUnBind" navigateTo>
                    <view class="cuIcon-punch text-blue">
                    </view>
                    <text>站点解绑</text>
                    <text>{{$t('index.stationUnbinding')}}</text>
                </navigator>
            </view>
            <view class="cu-item">
                <navigator hover-class='none' url="/pages/AGV/BindAndInTask" navigateTo>
                    <view class="cuIcon-punch text-blue">
                    </view>
                    <text>绑定&入库</text>
                    <text>{{$t('index.bindAndInbound')}}</text>
                </navigator>
            </view>
        
@@ -149,7 +149,7 @@
        </view>
        <view class="padding flex flex-direction">
            <view class="cu-btn bg-red margin-tb-sm lg round" @click="equit">退出登录</view>
            <view class="cu-btn bg-red margin-tb-sm lg round" @click="equit">{{$t('index.outLogin')}}</view>
        </view>
    </view>
    </view>
@@ -164,7 +164,10 @@
                }
            }
        },
        onShow() {
        onShow() {
            this.user = uni.getStorageSync('userData');            
        },
        methods: {
pages/login/login.vue
@@ -1,11 +1,11 @@
<template>
    <view>
        <!-- 设置 -->
        <!-- <view class="settings">
        <view class="settings">
            <view class="settings-btn">
                <uni-icons type="gear" size="30" color="#707070" @click="settings"></uni-icons>
            </view>
        </view> -->
        </view>
        <!-- logo -->
        <view class="logo">
            <view class="logo-box">
@@ -13,14 +13,27 @@
            </view>
        </view>
        <view class="content">
            <!-- 语言选择下拉菜单 -->
            <view class="language-dropdown">
                <view class="selected-language" @click="toggleLanguageDropdown">
                    <text>{{getCurrentLanguageText()}}</text>
                    <uni-icons type="bottom" size="14" color="#707070"></uni-icons>
                </view>
                <view class="language-options" v-if="showLanguageDropdown">
                    <view class="language-option" v-for="(item, index) in locales" :key="index" @click="onLocaleChange(item)">
                        <text>{{item.text}}</text>
                        <uni-icons type="checkmarkempty" size="14" color="#007AFF" v-if="item.code == applicationLocale"></uni-icons>
                    </view>
                </view>
            </view>
            <!-- 账号 -->
            <view class="box shadow-warp">
                <view class="box-icon">
                    <uni-icons type="person" size="20" color="#707070"></uni-icons>
                </view>
                <view class="box-text">账号:</view>
                <view class="box-text">{{$t('login.user')}}:</view>
                <view class="box-input">
                    <input type="text" placeholder="请输入账号" v-model="user.userName"
                    <input type="text" :placeholder="$t('login.inputUser')" v-model="user.userName"
                        placeholder-style="font-size:14px;color:#ccc;">
                </view>
                <view class="box-show"></view>
@@ -30,9 +43,9 @@
                <view class="box-icon">
                    <uni-icons type="locked" size="20" color="#707070"></uni-icons>
                </view>
                <view class="box-text">密码:</view>
                <view class="box-text">{{$t('login.pwd')}}:</view>
                <view class="box-input">
                    <input :password="!showPassword" placeholder="请输入密码" v-model="user.password"
                    <input :password="!showPassword" :placeholder="$t('login.inputPwd')" v-model="user.password"
                        placeholder-style="font-size:14px;color:#ccc;">
                </view>
                <view class="box-show">
@@ -45,7 +58,7 @@
            <!-- 记住密码 -->
            <view class="check">
                <view class="check-left">
                    <view>记住密码</view>
                    <view>{{$t('login.remPwd')}}</view>
                </view>
                <view class="check-right">
                    <switch :checked='remberPassword' color="#FFCC33" style="zoom:.5" @change="remberChange" />
@@ -55,9 +68,9 @@
        <!-- 登录按钮 -->
        <view class="submit">
            <view class="" style="width: 400rpx;">
                <button type="primary" @click="onLogin()" :loading="load.loading">{{load.btnText}}</button>
                <button type="primary" @click="onLogin()" :loading="loading">{{btnText}}</button>
            </view>
        </view>
        <!-- 设置弹窗区域 -->
@@ -77,7 +90,7 @@
                    <view class="popup-item">
                        <view class="popup-item-left">项目:</view>
                        <view class="popup-item-right"><input type="text" v-model="url.project"></view>
                    </view>
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="close">取消</view>
                        <view class="btn-right" @click="settingConfirm">确认</view>
@@ -110,7 +123,9 @@
    } from '../../common/request.js'
    export default {
        data() {
            return {
            return {
                systemLocale: '',
                applicationLocale: '',
                version: '',
                showPassword: false,
                value: '',
@@ -125,20 +140,55 @@
                    userName: '',
                    password: '',
                },
                load: {
                    loading: false,
                    btnText: '登录'
                },
                loading: false,
                msgType: 'success',
                filename: '',
                dialogContent: '',
                elements: [],
                colorList: ['cyan', 'blue', 'purple', 'mauve', 'pink', 'brown', 'red', 'orange', 'yellow', 'olive',
                    'olive', 'grey'
                ]
                ],
                showLanguageDropdown: false,
                loginButton: 'login.login'
            }
        },
        computed:{
          locales() {
            return [{
                text: this.$t('locale.auto'),
                code: 'auto'
              }, {
                text: this.$t('locale.en'),
                code: 'en'
              },
              {
                text: this.$t('locale.zh-hans'),
                code: 'zh-Hans'
              },
              {
                text: this.$t('locale.zh-hant'),
                code: 'zh-Hant'
              },
              {
                text: this.$t('locale.ja'),
                code: 'ja'
              }
            ]
          },
          btnText() {
                  return this.$t(this.loginButton);
            }
        },
        onLoad() {
            let systemInfo = uni.getSystemInfoSync();
            this.systemLocale = systemInfo.language;
            this.applicationLocale = uni.getLocale();
            this.isAndroid = systemInfo.platform.toLowerCase() === 'android';
            uni.onLocaleChange((e) => {
              this.applicationLocale = e.locale;
            })
            this.user = uni.getStorageSync('user')
            this.url = uni.getStorageSync('url')
            this.baseUrl = uni.getStorageSync('baseUrl')
@@ -155,11 +205,56 @@
                    project: ''
                }
            }
        },
        },
        onShow() {
            this.getVersion()
        },
        methods: {
            localChange() {
                console.log(this.local)
              if (this.isAndroid) {
                uni.showModal({
                  content: this.$t('index.language-change-confirm'),
                  success: (res) => {
                    if (res.confirm) {
                      uni.setLocale(this.local.value);
                    }
                  }
                })
              } else {
                uni.setLocale(this.local.value);
                this.$i18n.locale = this.local.value;
              }
            },
            // 切换语言下拉菜单显示状态
            toggleLanguageDropdown() {
                this.showLanguageDropdown = !this.showLanguageDropdown;
            },
            // 获取当前选择的语言文本
            getCurrentLanguageText() {
                const currentLocale = this.locales.find(item => item.code === this.applicationLocale);
                return currentLocale ? currentLocale.text : this.$t('locale.auto');
            },
            // 语言选择改变
            onLocaleChange(e) {
                if (this.isAndroid) {
                    uni.showModal({
                        content: this.$t('index.language-change-confirm'),
                        success: (res) => {
                            if (res.confirm) {
                                uni.setLocale(e.code);
                                this.showLanguageDropdown = false;
                            }
                        }
                    })
                } else {
                    uni.setLocale(e.code);
                    this.$i18n.locale = e.code;
                    this.showLanguageDropdown = false;
                }
            },
            // 显示/隐藏密码
            changePassword() {
                this.showPassword = !this.showPassword;
@@ -169,7 +264,7 @@
            },
            // 设置窗口开启按钮
            settings() {
                this.$refs.inputDialog.open()
                this.$refs.inputDialog.open('')
            },
            // 设置窗口确认修改按钮
            dialogInputConfirm() {
@@ -197,8 +292,8 @@
                    password: this.user.password,
                })
                if (code === 200) {
                    this.load.loading = true;
                    this.load.btnText = '登录中';
                    this.loading = true;
                    this.loginButton = 'login.loging';
                    uni.setStorageSync('token', data.accessToken);    
                    uni.setStorageSync('userData', data.user);                
                    if (this.remberPassword) {                        
@@ -413,7 +508,8 @@
</script>
<style>
    @import url('../../static/css/wms.css/wms.css');
    /* 设置区域 */
    .settings {
        min-height: 100rpx;
@@ -466,8 +562,7 @@
        text-align: center;
    }
    .box-text {
        width: 100rpx;
    .box-text {
        text-align: center;
    }
@@ -512,22 +607,6 @@
        font-size: 12px;
        color: #909399;
    }
    /* ------ */
    .shadow-warp {
@@ -553,4 +632,104 @@
        left: auto;
        transform: rotate(3deg);
    }
</style>
    /* 语言选择下拉菜单 */
    .language-dropdown {
        position: relative;
        margin-bottom: 20rpx;
        z-index: 10;
    }
    .selected-language {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15rpx 20rpx;
        background-color: #f8f8f8;
        border-radius: 8rpx;
        border: 1px solid #e0e0e0;
    }
    .language-options {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #ffffff;
        border-radius: 8rpx;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border: 1px solid #e0e0e0;
        margin-top: 5rpx;
    }
    .language-option {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15rpx 20rpx;
        border-bottom: 1px solid #f0f0f0;
    }
    .language-option:last-child {
        border-bottom: none;
    }
    .language-option:active {
        background-color: #f5f5f5;
    }
    /* 其他样式 */
    .check {
        width: 78%;
        display: flex;
        font-size: 12px;
        color: #606266;
        margin-top: 10rpx;
    }
    .check-right {
        margin-left: auto;
    }
    .submit {
        display: flex;
        justify-content: center;
        position: fixed;
        width: 100%;
        bottom: 100rpx;
    }
    .version {
        position: fixed;
        width: 100%;
        bottom: 0;
        text-align: center;
        font-size: 12px;
        color: #909399;
    }
    /* ------ */
    .shadow-warp {
        position: relative;
        box-shadow: 0 0 10upx rgba(0, 0, 0, 0.1);
    }
    .shadow-warp:before,
    .shadow-warp:after {
        position: absolute;
        content: "";
        top: 20upx;
        bottom: 30upx;
        left: 20upx;
        width: 50%;
        box-shadow: 0 30upx 20upx rgba(0, 0, 0, 0.2);
        transform: rotate(-3deg);
        z-index: -1;
    }
    .shadow-warp:after {
        right: 20upx;
        left: auto;
        transform: rotate(3deg);
    }
</style>