From e9483e26e5f2e68a2c3137f09b7470a2abd5f7bd Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Mon, 22 Jun 2026 18:08:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(i18n):=20=E6=9B=BF=E6=8D=A2=E7=A1=AC?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E6=96=87=E6=9C=AC=E4=B8=BA=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 删除冗余的语言文件 contenr.js 2. 将页面内硬编码字符串替换为$this.lang()调用 3. 整理common.js内的多语言词条,归类移动旧有配置到正确分组 --- lang/zh-cn/agreement/contenr.js | 1 - lang/zh-cn/common.js | 76 +++++++++++++++++-------- pages_order/public/js/orderMethod.js | 8 +-- pages_promotion/merch/public/edit.js | 32 +++++------ pages_promotion/merch/public/js/list.js | 2 +- 5 files changed, 73 insertions(+), 46 deletions(-) delete mode 100644 lang/zh-cn/agreement/contenr.js diff --git a/lang/zh-cn/agreement/contenr.js b/lang/zh-cn/agreement/contenr.js deleted file mode 100644 index e9f3538..0000000 --- a/lang/zh-cn/agreement/contenr.js +++ /dev/null @@ -1 +0,0 @@ -export const lang = {} \ No newline at end of file diff --git a/lang/zh-cn/common.js b/lang/zh-cn/common.js index 037bebf..f554a2d 100644 --- a/lang/zh-cn/common.js +++ b/lang/zh-cn/common.js @@ -1550,16 +1550,35 @@ export const lang = { // 预约时间 yuyueDate: { appointedDate: "指定日期", + full: "已约满", + available: "可预约", + noSelection: "暂无选择", }, // 企业微信 wxwork: { jumpSuccess: "跳转成功", + notConfigured: "未配置企业微信客服信息", + sdkNotInit: "企业微信SDK未初始化", + jumpFailed: "跳转失败,请检查企业微信配置", + openProfileFailed: "打开用户资料失败", }, // 隐私协议 privacy: { noAgreementTip: "未同意隐私协议,无法使用相关功能", + title: "用户隐私保护指引", + thanks: "感谢使用", + beforeUse: "在使用前,请您仔细阅读", + agreeTip: "我们将通过", + functionTip: "为您提供相关服务", + disagree: "不同意", + agreeAndContinue: "同意并继续", + contractName: "用户隐私保护指引", + miniAppName: "本小程序", + appName: "本应用", + termsTitle: "《隐私条款》", + serviceTerms: "《用户服务协议》", }, // 优惠券组件 @@ -2390,6 +2409,19 @@ export const lang = { // 商品 goods: { piece: "件", + buy: "购买", + givePoints: "送{points}积分", + giveDiscountCoupon: "送{num}张{discount}折优惠券", + andGiveDiscountCoupon: "、送{num}张{discount}折优惠券", + giveMoneyCoupon: "送{num}张{money}元优惠券", + andGiveMoneyCoupon: "、送{num}张{money}元优惠券", + spendLimit: "满{limit}{unit}", + semicolonSpend: ";", + spendLimitFreeShipping: "满{limit}{unit}包邮", + semicolonSpendLimitFreeShipping: ";满{limit}{unit}包邮", + searchResultCount: "搜索结果共{count}件商品", + insufficientStock: "商品库存不足", + maxBuyLimit: "该商品每人限购{max}{unit}", }, // 文章 @@ -2397,13 +2429,26 @@ export const lang = { viewMore: "查看更多", }, - // 隐私 - privacy: { - contractName: "用户隐私保护指引", - miniAppName: "本小程序", - appName: "本应用", - termsTitle: "《隐私条款》", - serviceTerms: "《用户服务协议》", + // 商户 + merch: { + grounding: "下架", + listing: "上架", + sameDay: "当日达", + nextDay: "次日达", + dayAfter: "隔日达", + autoDeliver: "自动发货", + manualDeliver: "手动发货", + storeVerify: "到店核销", + autoReceive: "自动收货", + buyerConfirm: "买家确认收货", + permanent: "永久", + validDays: "购买后几日有效", + expireDate: "指定过期日期", + addCarmi: "添加卡密", + singleLimit: "单次限购", + longLimit: "长期限购", + editGoods: "编辑商品", + addGoods: "添加商品", }, // 配送 @@ -2411,15 +2456,6 @@ export const lang = { immediate: "立即配送", }, - // 企业微信 - wxwork: { - notConfigured: "未配置企业微信客服信息", - jumpFailed: "跳转失败,请检查企业微信配置", - sdkNotInit: "企业微信SDK未初始化", - openProfileFailed: "打开用户资料失败", - jumpSuccess: "跳转成功", - }, - // 客服 kefu: { hoverNavConsult: "来自悬浮按钮的咨询", @@ -2441,12 +2477,4 @@ export const lang = { hoursAgo: "小时前", daysAgo: "天前", }, - - // 预约日期 - yuyueDate: { - appointedDate: "指定日期", - full: "已约满", - available: "可预约", - noSelection: "暂无选择", - }, }; diff --git a/pages_order/public/js/orderMethod.js b/pages_order/public/js/orderMethod.js index 6241992..75122fb 100644 --- a/pages_order/public/js/orderMethod.js +++ b/pages_order/public/js/orderMethod.js @@ -140,8 +140,8 @@ export default { }) } else { uni.showModal({ - title: '提示', - content: '您确定已经收到货物了吗?', + title: this.$lang('common.tip'), + content: this.$lang('order.confirmReceived'), success: res => { if (res.confirm) { this.$api.sendRequest({ @@ -234,8 +234,8 @@ export default { }) } else { uni.showModal({ - title: '提示', - content: '您确定要进行收货吗?', + title: this.$lang('common.tip'), + content: this.$lang('order.confirmTakeDelivery'), success: res => { if (res.confirm) { this.$api.sendRequest({ diff --git a/pages_promotion/merch/public/edit.js b/pages_promotion/merch/public/edit.js index e2fd66b..13595a5 100644 --- a/pages_promotion/merch/public/edit.js +++ b/pages_promotion/merch/public/edit.js @@ -53,54 +53,54 @@ export default { begin_time:'',//团购开始时间 end_time:''//团购结束时间 }, - groundingArray: ['下架', '上架'], + groundingArray: [this.$lang('merch.grounding'), this.$lang('merch.listing')], - pickuptypeArray: ['当日达', '次日达', '隔日达'],//, '自定义' + pickuptypeArray: [this.$lang('merch.sameDay'), this.$lang('merch.nextDay'), this.$lang('merch.dayAfter')],//, '自定义' currCategory: 0, // 当前所设置的商品分类 virtualDeliverArray: [{ - name: '自动发货', + name: this.$lang('merch.autoDeliver'), value: 'auto_deliver', }, { - name: '手动发货', + name: this.$lang('merch.manualDeliver'), value: 'artificial_deliver', }, { - name: '到店核销', + name: this.$lang('merch.storeVerify'), value: 'verify', } ], virtualDeliverValue: { - 'auto_deliver': '自动发货', - 'artificial_deliver': '手动发货', - 'verify': '到店核销' + 'auto_deliver': this.$lang('merch.autoDeliver'), + 'artificial_deliver': this.$lang('merch.manualDeliver'), + 'verify': this.$lang('merch.storeVerify') }, virtualReceiveArray: [{ - name: '自动收货', + name: this.$lang('merch.autoReceive'), value: 'auto_receive', }, { - name: '买家确认收货', + name: this.$lang('merch.buyerConfirm'), value: 'artificial_receive', }, ], virtualReceiveValue: { - 'auto_receive': '自动收货', - 'artificial_receive': '买家确认收货', + 'auto_receive': this.$lang('merch.autoReceive'), + 'artificial_receive': this.$lang('merch.buyerConfirm'), }, - validityTypeArray: ['永久', '购买后几日有效', '指定过期日期'], + validityTypeArray: [this.$lang('merch.permanent'), this.$lang('merch.validDays'), this.$lang('merch.expireDate')], virtualIndate: 0, minDate: '', - carmiLength: '添加卡密', + carmiLength: this.$lang('merch.addCarmi'), limitLength: [ //限购 { - name: '单次限购', + name: this.$lang('merch.singleLimit'), value: '1' }, { - name: '长期限购', + name: this.$lang('merch.longLimit'), value: '2' } ], diff --git a/pages_promotion/merch/public/js/list.js b/pages_promotion/merch/public/js/list.js index 7367153..04a3427 100644 --- a/pages_promotion/merch/public/js/list.js +++ b/pages_promotion/merch/public/js/list.js @@ -39,7 +39,7 @@ export default { fontWeight: false, padding: 0, cartEvent: "detail", - text: "购买", + text: this.$lang('goods.buy'), textColor: "#FFFFFF", theme: "default", aroundRadius: 25,