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

1. 替换分销等级页标题拼接的硬编码语言文本
2. 替换AI聊天页面的硬编码提示文本为多语言key
3. 新增完整的多语言翻译配置项
This commit is contained in:
2026-06-22 17:48:53 +08:00
parent cb81aad784
commit 47098bddda
3 changed files with 344 additions and 4 deletions

View File

@@ -34,6 +34,17 @@ export const lang = {
skip: "跳过", skip: "跳过",
yuan: "元", yuan: "元",
discount: "折", discount: "折",
year: "年",
month: "月",
all: "全部",
saveSuccess: "保存成功",
saveFailed: "保存失败,请稍后重试",
copySuccess: "复制成功",
collapse: "收起",
expand: "展开",
days: "天",
buildVersion: "构建版本信息",
buildVersionDesc: "提交 ID: {commitId}\n构建时间: {buildTime}",
}, },
//客服 //客服
@@ -525,6 +536,11 @@ export const lang = {
community: "社群", community: "社群",
notGetData: "未获取到创建订单所需数据!", notGetData: "未获取到创建订单所需数据!",
submitOrder: "提交订单", submitOrder: "提交订单",
inputMaxPrice: "请输入最高价",
priceNotNegative: "筛选价格不能小于0",
minNotGreaterMax: "最低价不能大于最高价",
maxNotLessMin: "最高价不能小于最低价",
exchangeWithPoints: "仅需{points}积分即可兑换",
}, },
// 商品 // 商品
@@ -567,6 +583,23 @@ export const lang = {
callOnMobile: "可在手机端拨打 {phone}", callOnMobile: "可在手机端拨打 {phone}",
copyToClipboard: "复制到剪切板", copyToClipboard: "复制到剪切板",
notConfigured: "未配置", notConfigured: "未配置",
posterGenerating: "海报生成中...",
goodsList: "商品列表",
searchResultCount: "搜索到{count}件\"{keyword}\"相关的优质商品",
inputMaxPrice: "请输入最高价",
priceNotNegative: "筛选价格不能小于0",
minNotGreaterMax: "最低价不能大于最高价",
maxNotLessMin: "最高价不能小于最低价",
couponAlreadyClaimed: "您已领取过该优惠券,快去使用吧",
couponClaimSuccess: "领取成功,快去使用吧",
shareTitle: "发现超多好物,快来看看",
cardTotalCount: "卡项内项目/商品总的可用次数为{count}",
unlimitedCount: "次数不限",
validPeriod: "有效期为",
permanent: "永久",
fullReduce: "满{atLeast}减{money}",
noThresholdUse: "无门槛使用{money}",
fullDiscount: "满{atLeast}打{discount}折",
}, },
// 营销活动 // 营销活动
@@ -966,6 +999,17 @@ export const lang = {
twoPasswordNotMatch: "两次输入的密码不一致", twoPasswordNotMatch: "两次输入的密码不一致",
getVerificationCode: "获取验证码", getVerificationCode: "获取验证码",
secondsRetry: "s后可重新获取", secondsRetry: "s后可重新获取",
riskTip: "风险提示",
confirmLogoutAccount: "确定要注销当前账号吗?",
merchantNotOpenSignin: "商家未开启会员签到",
signinNotEnabled: "签到未开启",
signinGift: "签到有礼",
signinGiftDesc: "天天签到,积分好礼送不停",
saveSuccess: "保存成功",
saveFailed: "保存失败,请稍后重试",
memberRightsTip: "专属会员权益,快来体验",
uploadAvatarFailed: "头像上传失败",
avatarModifySuccess: "头像修改成功",
}, },
// 地址 // 地址
@@ -1132,6 +1176,12 @@ export const lang = {
modifyRefund: "修改退款申请", modifyRefund: "修改退款申请",
viewRefundDetail: "查看退款详情", viewRefundDetail: "查看退款详情",
refundTypeSelect: "选择退款类型", refundTypeSelect: "选择退款类型",
cancelConfirm: "撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请。",
notCancelNow: "暂不撤销",
cancelSuccess: "撤销成功",
noRefundData: "未获取到该订单项退款信息",
noOrderGoodsInfo: "未查找到订单信息",
refundRemark: "请输入退款说明(选填)",
}, },
// 评价 // 评价
@@ -1161,6 +1211,9 @@ export const lang = {
goodReview: "好评", goodReview: "好评",
mediumReview: "中评", mediumReview: "中评",
badReview: "差评", badReview: "差评",
noOrderData: "未获取到订单数据",
notEnabled: "商家未开启商品评价功能",
contentRequired: "商品的评价不能为空哦",
}, },
// 支付 // 支付
@@ -1423,6 +1476,7 @@ export const lang = {
inputMessage: "请填写留言内容", inputMessage: "请填写留言内容",
submitSuccess: "提交成功", submitSuccess: "提交成功",
submitFail: "提交失败,请重试", submitFail: "提交失败,请重试",
videoNotFound: "视频地址不存在",
}, },
// 案例 // 案例
@@ -1476,6 +1530,15 @@ export const lang = {
saveSuccess: "保存成功", saveSuccess: "保存成功",
saveFail: "保存失败,请稍后重试", saveFail: "保存失败,请稍后重试",
downloadFail: "下载失败", downloadFail: "下载失败",
searchResult: "搜索结果",
},
// AI聊天
aiChat: {
loadingHistory: "加载历史消息中...",
loadMoreHistory: "加载更多历史消息",
copySelected: "已复制选中内容",
copySuccess: "已复制",
}, },
// 聊天 // 聊天
@@ -1589,6 +1652,11 @@ export const lang = {
invalidGoods: "失效商品", invalidGoods: "失效商品",
clear: "清空", clear: "清空",
alreadyInvalid: "已失效", alreadyInvalid: "已失效",
selectGoodsToDelete: "请选择要删除的商品",
confirmDeleteSelected: "确定要删除这些商品吗?",
confirmDeleteOne: "确定要删除该商品吗?",
confirmClearInvalid: "确定要清空这些商品吗?",
personLimit: "该商品每人限购{count}件",
}, },
// 秒杀组件 // 秒杀组件
@@ -1637,6 +1705,56 @@ export const lang = {
notice: { notice: {
title: "公告", title: "公告",
iknow: "我知道了", iknow: "我知道了",
emptyNotice: "暂无公告",
},
// 帮助
help: {
emptyHelp: "暂无帮助信息",
helpCenter: "帮助中心",
helpCenterDesc: "帮助中心使你更加方便",
},
// 文件
files: {
emptyFiles: "暂无文件",
searchPlaceholder: "请输入您要搜索的文件名称",
viewPdf: "查看PDF文件",
loading: "正在加载",
fileNotExist: "文件不存在",
},
// 文章
article: {
emptyArticle: "暂无文章",
articleList: "文章列表",
publishTime: "发表时间",
},
// 充值
recharge: {
rechargeSuccess: "充值成功",
emptyRechargeRecord: "暂无充值记录",
},
// 表单
form: {
submitSuccess: "提交成功",
noFormData: "未获取到表单信息",
fillFormInfo: "请填写表单所需信息",
paramError: "参数错误",
},
// 店铺打烊
storeclose: {
storeClosed: "该店铺已打烊...",
storeNotExist: "店铺不存在",
},
// 小程序
weapp: {
missingMerchantTradeNo: "缺少merchant_trade_no参数",
unknownError: "未知错误",
}, },
// 会员卡 // 会员卡
@@ -2108,5 +2226,227 @@ export const lang = {
confirm: "确定", confirm: "确定",
emptyCategory: "暂时没有分类哦", emptyCategory: "暂时没有分类哦",
yuan: "元", yuan: "元",
merchantNotExist: "商家不存在",
searchResultCount: "搜索到{count}件“{keyword}”相关的优质商品",
inputMaxPrice: "请输入最高价",
priceNotNegative: "筛选价格不能小于0",
minNotGreaterMax: "最低价不能大于最高价",
maxNotLessMin: "最高价不能小于最低价",
editGoods: "编辑商品",
addGoods: "添加商品",
goodsNotExist: "商品不存在",
maxCategoryLimit: "商品可以属于多个分类,最多10个",
inputGoodsName: "请输入商品名称",
subtitleMaxLength: "商品简介不能超过100个字符",
uploadGoodsImage: "请上传商品图片",
inputPrice: "请输入销售价",
inputStock: "请输入库存",
stockFormatError: "[库存]格式输入错误",
startCountFormatError: "[起售]格式输入错误",
startCountNotNegative: "起售数量不能小于0",
},
// 支付
payment: {
weekCard: "周卡",
week: "周",
monthCard: "月卡",
month: "月",
quarterCard: "季卡",
quarter: "季",
yearCard: "年卡",
year: "年",
inputMobile: "请输入预留手机",
inputCorrectMobile: "请输入正确的手机号",
noDeliveryMethod: "商家未设置配送方式",
selectAddressFirst: "请先选择您的收货地址",
noPickupStore: "没有可提货的门店,请选择其他配送方式",
selectPickupTime: "请选择提货时间",
noDeliveryStore: "没有可配送的门店,请选择其他配送方式",
selectDeliveryTime: "请选择送达时间",
inputInvoiceTitle: "请填写发票抬头",
inputTaxpayerNumber: "请填写纳税人识别号",
inputInvoiceAddress: "请填写发票邮寄地址",
inputEmail: "请填写邮箱",
inputCorrectEmail: "请填写正确的邮箱",
selectInvoiceContent: "请选择发票内容",
paperInvoice: "纸质",
eInvoice: "电子",
noInvoice: "无需发票",
alipayPay: "支付宝支付",
wechatPay: "微信支付",
},
// 订单
order: {
cancelRefundConfirm: "撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请。",
notCancelYet: "暂不撤销",
payAmountAdjusted: "商家已将支付金额调整为{amount}元,是否继续支付?",
confirmCloseOrder: "您确定要关闭该订单吗?",
cannotCloseOrder: "当前订单可能存在拼团,维权等操作,{message}不可以关闭哦!",
confirmReceived: "您确定已经收到货物了吗?",
confirmTakeDelivery: "您确定要进行收货吗?",
waitPay: "待支付",
completed: "已完成",
closed: "已关闭",
noOrderInfo: "未获取到订单信息!",
},
// 日期
date: {
today: "今天",
tomorrow: "明天",
dayAfterTomorrow: "后天",
sunday: "周日",
monday: "周一",
tuesday: "周二",
wednesday: "周三",
thursday: "周四",
friday: "周五",
saturday: "周六",
cannotReserve: "不可以预约",
month: "月",
day: "日",
},
// 优惠券
coupon: {
couponTaken: "该优惠券已抢光",
receiveSuccess: "领取成功",
receive: "领取",
useNow: "立即使用",
goUse: "去使用",
thresholdAvailable: "满{amount}可用",
noThreshold: "无门槛",
designatedGoodsAvailable: "指定商品可用",
designatedGoodsUnavailable: "指定商品不可用",
},
// 秒杀
seckill: {
activityComingSoon: "秒杀活动即将开启,敬请期待!",
},
// 视频号
channel: {
wechatOnly: "视频号仅支持在微信小程序环境中播放",
},
// 会员
member: {
bindMobileFirst: "使用会员码需先绑定手机号,是否绑定手机号?",
inputNickname: "请输入昵称",
uploadFailed: "上传失败",
avatarFetchFailed: "头像拉取失败",
},
// 分销
fenxiao: {
followSuccess: "关注成功",
confirmUnfollow: "确认取消关注该商品吗",
unfollowSuccess: "取消成功",
},
// 表单
form: {
submit: "提交",
submitSuccess: "提交成功",
submitFailed: "提交失败",
defaultForm: "默认表单",
},
// 笔记
note: {
goodsIntro: "单品介绍",
shopkeeperNote: "掌柜说",
},
// 商品
goods: {
insufficientStock: "商品库存不足",
maxBuyLimit: "该商品每人限购{max}{unit}",
},
// 分类
category: {
noGoodsInCategory: "该分类下暂无商品",
},
// 地图
map: {
oneClickNav: "一键导航",
},
// 砍价
bargain: {
continueBargain: "继续砍价",
},
// 秒杀
seckill: {
startingSoon: "即将开始",
},
// 商品
goods: {
piece: "件",
},
// 文章
article: {
viewMore: "查看更多",
},
// 隐私
privacy: {
contractName: "用户隐私保护指引",
miniAppName: "本小程序",
appName: "本应用",
termsTitle: "《隐私条款》",
serviceTerms: "《用户服务协议》",
},
// 配送
delivery: {
immediate: "立即配送",
},
// 企业微信
wxwork: {
notConfigured: "未配置企业微信客服信息",
jumpFailed: "跳转失败,请检查企业微信配置",
sdkNotInit: "企业微信SDK未初始化",
openProfileFailed: "打开用户资料失败",
jumpSuccess: "跳转成功",
},
// 客服
kefu: {
hoverNavConsult: "来自悬浮按钮的咨询",
},
// mescroll
mescroll: {
emptyTip: "空空如也",
goBrowse: "去看看",
pullRefresh: "下拉刷新",
releaseUpdate: "释放更新",
loading: "加载中 ...",
},
// 时间
time: {
justNow: "刚刚",
minutesAgo: "分钟前",
hoursAgo: "小时前",
daysAgo: "天前",
},
// 预约日期
yuyueDate: {
appointedDate: "指定日期",
full: "已约满",
available: "可预约",
noSelection: "暂无选择",
}, },
}; };

View File

@@ -218,7 +218,7 @@
} }
},1000); },1000);
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '{{ $lang('fenxiao.level') }}'); if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + this.$lang('fenxiao.level'));
if (this.storeToken) { if (this.storeToken) {
this.getFenxiaoInfo(); this.getFenxiaoInfo();

View File

@@ -1426,7 +1426,7 @@ _handleStreamError(msg) {
} }
this.isFetchingHistory = true; this.isFetchingHistory = true;
this.isLoadingHistory = true; this.isLoadingHistory = true;
this.loadingText = '加载历史消息中...'; this.loadingText = this.$lang('aiChat.loadingHistory');
try { try {
const response = await aiService.getConversationHistory({ const response = await aiService.getConversationHistory({
@@ -1480,7 +1480,7 @@ _handleStreamError(msg) {
} finally { } finally {
this.isLoadingHistory = false; this.isLoadingHistory = false;
this.isFetchingHistory = false; this.isFetchingHistory = false;
this.loadingText = '加载更多历史消息'; this.loadingText = this.$lang('aiChat.loadMoreHistory');
} }
}, },
// 显示更多工具 // 显示更多工具
@@ -1688,7 +1688,7 @@ _handleStreamError(msg) {
try { try {
if (navigator.clipboard && navigator.clipboard.writeText) { if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(finalText).then(() => { navigator.clipboard.writeText(finalText).then(() => {
uni.showToast({ title: selectedText ? '已复制选中内容' : '已复制', icon: 'success' }) uni.showToast({ title: selectedText ? this.$lang('aiChat.copySelected') : this.$lang('aiChat.copySuccess'), icon: 'success' })
}).catch(() => { }).catch(() => {
this._fallbackCopyH5(finalText) this._fallbackCopyH5(finalText)
}) })