From cb81aad78482987b4c1464f8eccbd170c172e025 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Mon, 22 Jun 2026 16:20:59 +0800
Subject: [PATCH] refactor(fenxiao,member): replace hardcoded strings with i18n
translations
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
standardize all hardcoded text across分销 and member pages to use language packs, fix template syntax errors in level.vue, and unify text display logic
---
pages_promotion/fenxiao/apply.vue | 2 +-
pages_promotion/fenxiao/index.vue | 56 ++++++++++----------
pages_promotion/fenxiao/level.vue | 6 +--
pages_promotion/fenxiao/order.vue | 30 +++++------
pages_promotion/fenxiao/order_detail.vue | 26 ++++-----
pages_promotion/fenxiao/promote.vue | 18 +++----
pages_promotion/fenxiao/promote_code.vue | 26 ++++-----
pages_tool/member/public/js/info.js | 50 ++++++++---------
pages_tool/member/public/js/member-public.js | 4 +-
9 files changed, 109 insertions(+), 109 deletions(-)
diff --git a/pages_promotion/fenxiao/apply.vue b/pages_promotion/fenxiao/apply.vue
index 6d9d07d..fa6f3ab 100644
--- a/pages_promotion/fenxiao/apply.vue
+++ b/pages_promotion/fenxiao/apply.vue
@@ -207,7 +207,7 @@
async onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
- if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '申请');
+ if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + this.$lang('fenxiao.apply'));
if (this.storeToken) {
this.applyStatus();
diff --git a/pages_promotion/fenxiao/index.vue b/pages_promotion/fenxiao/index.vue
index 1c3daf9..3a3448a 100644
--- a/pages_promotion/fenxiao/index.vue
+++ b/pages_promotion/fenxiao/index.vue
@@ -19,28 +19,28 @@
alt="" class="level-icon">{{ info.level_name }}
{{ $lang('fenxiao.parentAgent') }}:{{ info.parent_name ? info.parent_name : $lang('fenxiao.mainStore') }}
- {{ $lang('fenxiao.invitedSuccess') }}:{{ teamNum.num }}人{{ $lang('fenxiao.invitedSuccess') }}:{{ teamNum.num }}{{ $lang('fenxiao.people') }}
- 可{{ fenxiaoWords.withdraw }}(元)
+ {{ $lang('fenxiao.can') }}{{ fenxiaoWords.withdraw }}({{ $lang('fenxiao.yuan') }})
{{ $lang('fenxiao.withdrawalDetail') }}
@@ -52,22 +52,22 @@
- {{ $lang('fenxiao.withdrawing') }}(元){{ $lang('fenxiao.withdrawing') }}({{ $lang('fenxiao.yuan') }})
{{ info.account_withdraw_apply | moneyFormat }}
- {{ $lang('fenxiao.pendingEntry') }}(元){{ $lang('fenxiao.pendingEntry') }}({{ $lang('fenxiao.yuan') }})
{{ info.in_progress_money | moneyFormat }}
@@ -82,7 +82,7 @@
style="width: 100%;border-radius:24rpx" show-menu-by-longpress/>
-
+
-->
@@ -190,8 +190,8 @@
- 我的粉丝
- {{ teamNum.num }}人
+ {{ $lang('fenxiao.myFans') }}
+ {{ teamNum.num }}{{ $lang('fenxiao.people') }}
@@ -202,7 +202,7 @@
{{ fenxiaoWords.fenxiao_name }}
- {{ teamNum.fenxiao_num }}人
+ {{ teamNum.fenxiao_num }}{{ $lang('fenxiao.people') }}
@@ -290,7 +290,7 @@ export default {
},
mixins: [fenxiaoWords],
onShow() {
- if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + '中心');
+ if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + this.$lang('fenxiao.center'));
if (this.storeToken) {
this.checkFenxiaoIsStart();
diff --git a/pages_promotion/fenxiao/level.vue b/pages_promotion/fenxiao/level.vue
index e5372b4..9143710 100644
--- a/pages_promotion/fenxiao/level.vue
+++ b/pages_promotion/fenxiao/level.vue
@@ -1,4 +1,4 @@
-
+
@@ -218,7 +218,7 @@
}
},1000);
- if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '等级');
+ if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '{{ $lang('fenxiao.level') }}');
if (this.storeToken) {
this.getFenxiaoInfo();
@@ -231,7 +231,7 @@
},
methods: {
/**
- * 获取分销等级信息
+ * 获取分销{{ $lang('fenxiao.level') }}信息
*/
getFenxiaoLevel() {
this.$api.sendRequest({
diff --git a/pages_promotion/fenxiao/order.vue b/pages_promotion/fenxiao/order.vue
index 2aef62a..dab027e 100644
--- a/pages_promotion/fenxiao/order.vue
+++ b/pages_promotion/fenxiao/order.vue
@@ -14,10 +14,10 @@
@click="toDetail(orderItem.fenxiao_order_id)">
@@ -30,7 +30,7 @@
{{ orderItem.sku_name }}
- 返{{ fenxiaoWords.account }}
+ {{ $lang('fenxiao.commission') }}
{{
$lang('common.currencySymbol') }}
{{
@@ -66,7 +66,7 @@
{{ $lang('common.currencySymbol') }}{{ orderItem.commission }} -->
- 合计:
+ {{ $lang('fenxiao.total') }}:
{{ $lang('common.currencySymbol') }}
{{
parseFloat(orderItem.real_goods_money).toFixed(2).split(".")[0] }}
@@ -78,13 +78,13 @@
-
-
-
-
@@ -108,22 +108,22 @@ export default {
category: [
{
id: 0,
- name: '全部',
+ name: this.$lang('fenxiao.all'),
number: 2
},
{
id: 1,
- name: '待结算',
+ name: this.$lang('fenxiao.pendingSettlement'),
number: 0
},
{
id: 2,
- name: '已结算',
+ name: this.$lang('fenxiao.settled'),
number: 0
},
{
id: 3,
- name: '已退款',
+ name: this.$lang('fenxiao.refunded'),
number: 0
}
],
@@ -142,7 +142,7 @@ export default {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
- title: '商家未开启分销',
+ title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
@@ -152,7 +152,7 @@ export default {
}
}, 1000);
- if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + '订单');
+ if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + this.$lang('fenxiao.order'));
if (!this.storeToken) {
this.$nextTick(() => {
diff --git a/pages_promotion/fenxiao/order_detail.vue b/pages_promotion/fenxiao/order_detail.vue
index 7c50602..60847fc 100644
--- a/pages_promotion/fenxiao/order_detail.vue
+++ b/pages_promotion/fenxiao/order_detail.vue
@@ -1,14 +1,14 @@
-
+
@@ -37,27 +37,27 @@
- 订单编号:
+ {{ $lang('fenxiao.orderNo') }}:
{{ orderData.order_no }}
- 分佣层级:
- {{ orderData.commission_level }}级
+ {{ $lang('fenxiao.commissionLevel') }}:
+ {{ orderData.commission_level }}$lang('fenxiao.level')
- 返佣金额:
+ {{ $lang('fenxiao.commissionAmountDetail') }}:
¥
{{ parseFloat(orderData.commission).toFixed(2).split(".")[0] }}
@@ -100,7 +100,7 @@ export default {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
- title: '商家未开启分销',
+ title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
@@ -133,7 +133,7 @@ export default {
this.orderData = res.data;
} else {
this.$util.showToast({
- title: '未获取到订单信息!'
+ title: this.$lang('fenxiao.noOrderInfo')
});
setTimeout(() => {
this.$util.redirectTo('/pages_promotion/fenxiao/order', {}, 'redirectTo');
diff --git a/pages_promotion/fenxiao/promote.vue b/pages_promotion/fenxiao/promote.vue
index 1b3255a..598ce72 100644
--- a/pages_promotion/fenxiao/promote.vue
+++ b/pages_promotion/fenxiao/promote.vue
@@ -10,16 +10,16 @@
- 累计收益
+ {{ $lang('fenxiao.totalEarnings') }}
{{ detailData.total_commission }}
- 元
+ {{ $lang('fenxiao.yuan') }}
- 已邀请好友
- 已下单好友
+ {{ $lang('fenxiao.invitedFriends') }}
+ {{ $lang('fenxiao.orderedFriends') }}
@@ -32,7 +32,7 @@
- 暂无已邀请好友,快去邀请吧
+ {{ $lang('fenxiao.emptyInvite') }}
@@ -41,9 +41,9 @@
mode="aspectFit" show-menu-by-longpress>
- 暂无活动规则
+ {{ $lang('fenxiao.emptyActivityRules') }}
-
+
@@ -79,7 +79,7 @@ export default {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
- title: '商家未开启分销',
+ title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
@@ -384,7 +384,7 @@ export default {
border-radius: 50rpx;
color: #985400;
// P0: 推广页金色按钮 → var(--promote-grad-start/end)
- // 兼容: 微信小程序 / 鸿蒙元服务 — linear-gradient 嵌套 var() 现代 runtime 支持
+ // 兼容: 微信小程序 / 鸿蒙{{ $lang('fenxiao.yuan') }}服务 — linear-gradient 嵌套 var() 现代 runtime 支持
background: #ffe2ac; // 兜底
background: linear-gradient(45deg, var(--promote-grad-start, #ffe2ac) 0%, var(--promote-grad-end, #fdc174) 100%);
}
diff --git a/pages_promotion/fenxiao/promote_code.vue b/pages_promotion/fenxiao/promote_code.vue
index 7b032b9..8ff806d 100644
--- a/pages_promotion/fenxiao/promote_code.vue
+++ b/pages_promotion/fenxiao/promote_code.vue
@@ -1,4 +1,4 @@
-
+
@@ -11,22 +11,22 @@
- 长按识别图中二维码
+ {{ $lang('fenxiao.longPressQrTip') }}
- 保存海报
+ {{ $lang('fenxiao.saveImage') }}
@@ -95,7 +95,7 @@ export default {
filePath: res.tempFilePath,
success: () => {
this.$util.showToast({
- title: '保存成功'
+ title: this.$lang('fenxiao.saveSuccess')
});
},
fail: res => {
@@ -104,20 +104,20 @@ export default {
this.$refs.popupDialog.open();
} else {
this.$util.showToast({
- title: '保存失败,请稍后重试'
+ title: this.$lang('fenxiao.saveFailed')
});
}
}
});
} else {
this.$util.showToast({
- title: '下载失败'
+ title: this.$lang('fenxiao.downloadFailed')
});
}
},
fail: res => {
this.$util.showToast({
- title: '下载失败'
+ title: this.$lang('fenxiao.downloadFailed')
});
}
});
@@ -136,7 +136,7 @@ export default {
});
} catch {
this.$util.showToast({
- title: '海报生成失败'
+ title: this.$lang('fenxiao.posterGenerateFailed')
});
}
},
@@ -149,7 +149,7 @@ export default {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
- title: '商家未开启分销',
+ title: this.$lang('fenxiao.merchantNotOpenFenxiao'),
mask: true,
duration: 2000
});
diff --git a/pages_tool/member/public/js/info.js b/pages_tool/member/public/js/info.js
index b0764e4..e75be83 100644
--- a/pages_tool/member/public/js/info.js
+++ b/pages_tool/member/public/js/info.js
@@ -55,16 +55,16 @@ export default {
isIphoneX: false,
items: [{
value: '0',
- name: '未知'
+ name: this.$lang('member.unknown')
},
{
value: '1',
- name: '男',
+ name: this.$lang('member.male'),
checked: 'true'
},
{
value: '2',
- name: '女'
+ name: this.$lang('member.female')
}
],
current: 0,
@@ -109,7 +109,7 @@ export default {
},
onHide() {
this.seconds = 120;
- this.formData.mobileCodeText = '获取动态码';
+ this.formData.mobileCodeText = this.$lang('member.getDynamicCode');
this.isSend = false;
clearInterval(this.timer);
},
@@ -117,7 +117,7 @@ export default {
seconds(value) {
if (value == 0) {
this.seconds = 120;
- this.formData.mobileCodeText = '获取动态码';
+ this.formData.mobileCodeText = this.$lang('member.getDynamicCode');
this.isSend = false;
clearInterval(this.timer);
}
@@ -154,7 +154,7 @@ export default {
}
},
setNavbarTitle() {
- let title = '个人资料';
+ let title = this.$lang('member.personalInfo');
switch (this.indent) {
case 'name':
title = this.$lang('modifyNickname');
@@ -184,9 +184,9 @@ export default {
this.memberInfoformData.userHeadImg = this.memberInfo.headimg;
this.memberInfoformData.number = this.memberInfo.username; //账号
this.memberInfoformData.nickName = this.memberInfo.nickname; //昵称
- this.memberInfoformData.realName = this.memberInfo.realname ? this.memberInfo.realname : '请输入真实姓名'; //真实姓名
- this.memberInfoformData.sex = this.memberInfo.sex == 0 ? '未知' : this.memberInfo.sex == 1 ? '男' : '女'; //性别
- this.memberInfoformData.birthday = this.memberInfo.birthday ? this.$util.timeStampTurnTime(this.memberInfo.birthday, 'YYYY-MM-DD') : '请选择生日'; //生日
+ this.memberInfoformData.realName = this.memberInfo.realname ? this.memberInfo.realname : this.$lang('member.inputRealName'); //真实姓名
+ this.memberInfoformData.sex = this.memberInfo.sex == 0 ? this.$lang('member.unknown') : this.memberInfo.sex == 1 ? this.$lang('member.male') : this.$lang('member.female'); //性别
+ this.memberInfoformData.birthday = this.memberInfo.birthday ? this.$util.timeStampTurnTime(this.memberInfo.birthday, 'YYYY-MM-DD') : this.$lang('member.selectBirthdayTip'); //生日
this.memberInfoformData.mobile = this.memberInfo.mobile; //手机号
this.formData.username = this.memberInfo.username; //用户名
@@ -401,14 +401,14 @@ export default {
modifyRealName() {
if (this.formData.realName == this.memberInfo.realname && this.memberInfo.realname) {
this.$util.showToast({
- title: '与原真实姓名一致,无需修改'
+ title: this.$lang('member.sameAsOriginalName')
});
return;
}
var rule = [{
name: 'realName',
checkType: 'required',
- errorMsg: '真实姓名不能为空'
+ errorMsg: this.$lang('member.realNameNotEmpty')
}];
if (!rule.length) return;
var checkRes = validate.check(this.formData, rule);
@@ -498,7 +498,7 @@ export default {
modifyBirthday() {
if (this.formData.birthday.length == 0) {
this.$util.showToast({
- title: '请选择生日'
+ title: this.$lang('member.selectBirthdayTip')
});
return;
}
@@ -576,15 +576,15 @@ export default {
name: 'newPassword',
checkType: 'lengthMin',
checkRule: regConfig.pwd_len,
- errorMsg: '新密码长度不能小于' + regConfig.pwd_len + '位'
+ errorMsg: this.$lang('member.newPasswordTooShort') + regConfig.pwd_len + this.$lang('member.digit')
});
}
if (regConfig.pwd_complexity) {
- let passwordErrorMsg = '密码需包含',
+ let passwordErrorMsg = this.$lang('member.passwordNeedInclude'),
reg = '';
if (regConfig.pwd_complexity.indexOf('number') != -1) {
reg += '(?=.*?[0-9])';
- passwordErrorMsg += '数字';
+ passwordErrorMsg += this.$lang('member.digit');
}
if (regConfig.pwd_complexity.indexOf('letter') != -1) {
reg += '(?=.*?[a-z])';
@@ -609,13 +609,13 @@ export default {
if (checkRes) {
if (this.formData.currentPassword == this.formData.newPassword) {
this.$util.showToast({
- title: '新密码不能与原密码相同'
+ title: this.$lang('member.sameAsOldPassword')
});
return;
}
if (this.formData.newPassword != this.formData.confirmPassword) {
this.$util.showToast({
- title: '两次密码不一致'
+ title: this.$lang('member.passwordNotMatch')
});
return;
}
@@ -657,11 +657,11 @@ export default {
var rule = [{
name: 'mobile',
checkType: 'required',
- errorMsg: '请输入手机号'
+ errorMsg: this.$lang('member.inputMobile')
}, {
name: 'mobile',
checkType: 'phoneno',
- errorMsg: '请输入正确的手机号'
+ errorMsg: this.$lang('member.inputMobileCorrect')
}];
var checkRes = validate.check(this.formData, rule);
if (!checkRes) {
@@ -723,7 +723,7 @@ export default {
if (this.seconds == 120 && this.timer == null) {
this.timer = setInterval(() => {
this.seconds--;
- this.formData.mobileCodeText = '已发送(' + this.seconds + 's)';
+ this.formData.mobileCodeText = this.$lang('member.alreadySent') + '(' + this.seconds + 's)';
}, 1000);
}
uni.setStorageSync('mobile_key', data.key);
@@ -741,7 +741,7 @@ export default {
});
} else {
this.$util.showToast({
- title: validate.error ? validate.error : '请勿重复点击'
+ title: validate.error ? validate.error : this.$lang('member.noRepeatClick')
});
}
},
@@ -840,7 +840,7 @@ export default {
if (this.seconds == 120 && this.timer == null) {
this.timer = setInterval(() => {
this.seconds--;
- this.formData.mobileCodeText = '已发送(' + this.seconds + 's)';
+ this.formData.mobileCodeText = this.$lang('member.alreadySent') + '(' + this.seconds + 's)';
}, 1000);
}
uni.setStorageSync('password_mobile_key', data.key);
@@ -858,7 +858,7 @@ export default {
});
} else {
this.$util.showToast({
- title: '请勿重复点击'
+ title: this.$lang('member.noRepeatClick')
});
}
},
@@ -866,12 +866,12 @@ export default {
var rule = [{
name: 'fullAddress',
checkType: 'required',
- errorMsg: '请选择所在地区'
+ errorMsg: this.$lang('member.selectRegion')
},
{
name: 'address',
checkType: 'required',
- errorMsg: '请输入详细地址'
+ errorMsg: this.$lang('member.inputDetailAddress')
}
];
if (!rule.length) return;
diff --git a/pages_tool/member/public/js/member-public.js b/pages_tool/member/public/js/member-public.js
index 5a736b4..91ebb2e 100644
--- a/pages_tool/member/public/js/member-public.js
+++ b/pages_tool/member/public/js/member-public.js
@@ -60,8 +60,8 @@ export default {
// 提交注销申请并清理登录态(供 assets.vue 等页面调用)
submitCancelApply(options = {}) {
uni.showModal({
- title: options.title || '风险提示',
- content: options.content || '确定要注销当前账号吗?',
+ title: options.title || this.$lang('member.riskTip'),
+ content: options.content || this.$lang('member.confirmLogoutAccount'),
confirmColor: '#000000',
success: res => {
if (res.confirm) {