refactor(i18n): 替换硬编码文本为多语言配置

1.  删除冗余的语言文件 contenr.js
2.  将页面内硬编码字符串替换为$this.lang()调用
3.  整理common.js内的多语言词条,归类移动旧有配置到正确分组
This commit is contained in:
2026-06-22 18:08:03 +08:00
parent b30ba914b9
commit e9483e26e5
5 changed files with 73 additions and 46 deletions

View File

@@ -1 +0,0 @@
export const lang = {}

View File

@@ -1550,16 +1550,35 @@ export const lang = {
// 预约时间 // 预约时间
yuyueDate: { yuyueDate: {
appointedDate: "指定日期", appointedDate: "指定日期",
full: "已约满",
available: "可预约",
noSelection: "暂无选择",
}, },
// 企业微信 // 企业微信
wxwork: { wxwork: {
jumpSuccess: "跳转成功", jumpSuccess: "跳转成功",
notConfigured: "未配置企业微信客服信息",
sdkNotInit: "企业微信SDK未初始化",
jumpFailed: "跳转失败,请检查企业微信配置",
openProfileFailed: "打开用户资料失败",
}, },
// 隐私协议 // 隐私协议
privacy: { privacy: {
noAgreementTip: "未同意隐私协议,无法使用相关功能", noAgreementTip: "未同意隐私协议,无法使用相关功能",
title: "用户隐私保护指引",
thanks: "感谢使用",
beforeUse: "在使用前,请您仔细阅读",
agreeTip: "我们将通过",
functionTip: "为您提供相关服务",
disagree: "不同意",
agreeAndContinue: "同意并继续",
contractName: "用户隐私保护指引",
miniAppName: "本小程序",
appName: "本应用",
termsTitle: "《隐私条款》",
serviceTerms: "《用户服务协议》",
}, },
// 优惠券组件 // 优惠券组件
@@ -2390,6 +2409,19 @@ export const lang = {
// 商品 // 商品
goods: { goods: {
piece: "件", 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: "查看更多", viewMore: "查看更多",
}, },
// 隐私 // 商户
privacy: { merch: {
contractName: "用户隐私保护指引", grounding: "下架",
miniAppName: "本小程序", listing: "上架",
appName: "本应用", sameDay: "当日达",
termsTitle: "《隐私条款》", nextDay: "次日达",
serviceTerms: "《用户服务协议》", dayAfter: "隔日达",
autoDeliver: "自动发货",
manualDeliver: "手动发货",
storeVerify: "到店核销",
autoReceive: "自动收货",
buyerConfirm: "买家确认收货",
permanent: "永久",
validDays: "购买后几日有效",
expireDate: "指定过期日期",
addCarmi: "添加卡密",
singleLimit: "单次限购",
longLimit: "长期限购",
editGoods: "编辑商品",
addGoods: "添加商品",
}, },
// 配送 // 配送
@@ -2411,15 +2456,6 @@ export const lang = {
immediate: "立即配送", immediate: "立即配送",
}, },
// 企业微信
wxwork: {
notConfigured: "未配置企业微信客服信息",
jumpFailed: "跳转失败,请检查企业微信配置",
sdkNotInit: "企业微信SDK未初始化",
openProfileFailed: "打开用户资料失败",
jumpSuccess: "跳转成功",
},
// 客服 // 客服
kefu: { kefu: {
hoverNavConsult: "来自悬浮按钮的咨询", hoverNavConsult: "来自悬浮按钮的咨询",
@@ -2441,12 +2477,4 @@ export const lang = {
hoursAgo: "小时前", hoursAgo: "小时前",
daysAgo: "天前", daysAgo: "天前",
}, },
// 预约日期
yuyueDate: {
appointedDate: "指定日期",
full: "已约满",
available: "可预约",
noSelection: "暂无选择",
},
}; };

View File

@@ -140,8 +140,8 @@ export default {
}) })
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: this.$lang('common.tip'),
content: '您确定已经收到货物了吗?', content: this.$lang('order.confirmReceived'),
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
this.$api.sendRequest({ this.$api.sendRequest({
@@ -234,8 +234,8 @@ export default {
}) })
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: this.$lang('common.tip'),
content: '您确定要进行收货吗?', content: this.$lang('order.confirmTakeDelivery'),
success: res => { success: res => {
if (res.confirm) { if (res.confirm) {
this.$api.sendRequest({ this.$api.sendRequest({

View File

@@ -53,54 +53,54 @@ export default {
begin_time:'',//团购开始时间 begin_time:'',//团购开始时间
end_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, // 当前所设置的商品分类 currCategory: 0, // 当前所设置的商品分类
virtualDeliverArray: [{ virtualDeliverArray: [{
name: '自动发货', name: this.$lang('merch.autoDeliver'),
value: 'auto_deliver', value: 'auto_deliver',
}, },
{ {
name: '手动发货', name: this.$lang('merch.manualDeliver'),
value: 'artificial_deliver', value: 'artificial_deliver',
}, },
{ {
name: '到店核销', name: this.$lang('merch.storeVerify'),
value: 'verify', value: 'verify',
} }
], ],
virtualDeliverValue: { virtualDeliverValue: {
'auto_deliver': '自动发货', 'auto_deliver': this.$lang('merch.autoDeliver'),
'artificial_deliver': '手动发货', 'artificial_deliver': this.$lang('merch.manualDeliver'),
'verify': '到店核销' 'verify': this.$lang('merch.storeVerify')
}, },
virtualReceiveArray: [{ virtualReceiveArray: [{
name: '自动收货', name: this.$lang('merch.autoReceive'),
value: 'auto_receive', value: 'auto_receive',
}, },
{ {
name: '买家确认收货', name: this.$lang('merch.buyerConfirm'),
value: 'artificial_receive', value: 'artificial_receive',
}, },
], ],
virtualReceiveValue: { virtualReceiveValue: {
'auto_receive': '自动收货', 'auto_receive': this.$lang('merch.autoReceive'),
'artificial_receive': '买家确认收货', 'artificial_receive': this.$lang('merch.buyerConfirm'),
}, },
validityTypeArray: ['永久', '购买后几日有效', '指定过期日期'], validityTypeArray: [this.$lang('merch.permanent'), this.$lang('merch.validDays'), this.$lang('merch.expireDate')],
virtualIndate: 0, virtualIndate: 0,
minDate: '', minDate: '',
carmiLength: '添加卡密', carmiLength: this.$lang('merch.addCarmi'),
limitLength: [ //限购 limitLength: [ //限购
{ {
name: '单次限购', name: this.$lang('merch.singleLimit'),
value: '1' value: '1'
}, },
{ {
name: '长期限购', name: this.$lang('merch.longLimit'),
value: '2' value: '2'
} }
], ],

View File

@@ -39,7 +39,7 @@ export default {
fontWeight: false, fontWeight: false,
padding: 0, padding: 0,
cartEvent: "detail", cartEvent: "detail",
text: "购买", text: this.$lang('goods.buy'),
textColor: "#FFFFFF", textColor: "#FFFFFF",
theme: "default", theme: "default",
aroundRadius: 25, aroundRadius: 25,