feat: 新增多语言文案与组件国际化适配
本次提交完成了大量多语言相关的新增与优化工作: 1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案 2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包 3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案 4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持 5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
@@ -3,20 +3,20 @@
|
||||
<view class="iconfont icon-close" @click="navigateBack()"></view>
|
||||
<view class="header-wrap">
|
||||
<block v-if="stepShow == 0">
|
||||
<view class="title">请输入手机号</view>
|
||||
<view><text class="color-tip">请确认您的账号已绑定此手机号</text></view>
|
||||
<view class="title">{{ $lang('find.step0Title') }}</view>
|
||||
<view><text class="color-tip">{{ $lang('find.step0Tip') }}</text></view>
|
||||
</block>
|
||||
|
||||
<block v-if="stepShow == 1">
|
||||
<view class="title">请输入验证码</view>
|
||||
<view class="title">{{ $lang('find.step1Title') }}</view>
|
||||
<view>
|
||||
<text class="color-tip">已将验证码发送至手机号:{{ formData.mobile }}</text>
|
||||
<text class="color-tip">{{ $lang('find.step1Tip', { mobile: formData.mobile }) }}</text>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block v-if="stepShow == 2">
|
||||
<view class="title">请设置新的密码</view>
|
||||
<view><text class="color-tip">建议您的新密码以简单好记为标准</text></view>
|
||||
<view class="title">{{ $lang('find.step2Title') }}</view>
|
||||
<view><text class="color-tip">{{ $lang('find.step2Tip') }}</text></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="find-form">
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
findMode: 'mobile',
|
||||
codeText: '重新获取',
|
||||
codeText: '',
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
formData: {
|
||||
@@ -117,6 +117,7 @@ export default {
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.codeText = this.$lang('find.resendCode');
|
||||
this.getCaptcha();
|
||||
},
|
||||
onShow() {
|
||||
@@ -143,7 +144,7 @@ export default {
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
errorMsg: this.$lang('find.mobileInvalid')
|
||||
},
|
||||
{
|
||||
name: 'captcha',
|
||||
@@ -166,7 +167,7 @@ export default {
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: '该手机号未注册'
|
||||
title: this.$lang('find.mobileNotRegistered')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -185,7 +186,7 @@ export default {
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入密码'
|
||||
errorMsg: this.$lang('find.passwordRequired')
|
||||
}
|
||||
];
|
||||
if (regConfig.pwd_len > 0) {
|
||||
@@ -193,27 +194,27 @@ export default {
|
||||
name: 'password',
|
||||
checkType: 'lengthMin',
|
||||
checkRule: regConfig.pwd_len,
|
||||
errorMsg: '密码长度不能小于' + regConfig.pwd_len + '位'
|
||||
errorMsg: this.$lang('find.passwordTooShort', { length: regConfig.pwd_len })
|
||||
});
|
||||
}
|
||||
if (regConfig.pwd_complexity != '') {
|
||||
let passwordErrorMsg = '密码需包含',
|
||||
let passwordErrorMsg = this.$lang('find.passwordComplexityPrefix'),
|
||||
reg = '';
|
||||
if (regConfig.pwd_complexity.indexOf('number') != -1) {
|
||||
reg += '(?=.*?[0-9])';
|
||||
passwordErrorMsg += '数字';
|
||||
passwordErrorMsg += this.$lang('find.complexityNumber');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('letter') != -1) {
|
||||
reg += '(?=.*?[a-z])';
|
||||
passwordErrorMsg += '、小写字母';
|
||||
passwordErrorMsg += this.$lang('find.complexityLowercase');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('upper_case') != -1) {
|
||||
reg += '(?=.*?[A-Z])';
|
||||
passwordErrorMsg += '、大写字母';
|
||||
passwordErrorMsg += this.$lang('find.complexityUppercase');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('symbol') != -1) {
|
||||
reg += '(?=.*?[#?!@$%^&*-])';
|
||||
passwordErrorMsg += '、特殊字符';
|
||||
passwordErrorMsg += this.$lang('find.complexitySymbol');
|
||||
}
|
||||
rule.push({
|
||||
name: 'password',
|
||||
@@ -227,7 +228,7 @@ export default {
|
||||
if (checkRes) {
|
||||
if (this.formData.password != this.formData.rePassword) {
|
||||
this.$util.showToast({
|
||||
title: '两次密码不一致'
|
||||
title: this.$lang('find.passwordMismatch')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -283,7 +284,7 @@ export default {
|
||||
if (this.seconds == 120 && this.timer == null) {
|
||||
this.timer = setInterval(() => {
|
||||
this.seconds--;
|
||||
this.codeText = '重新获取(' + this.seconds + 's)';
|
||||
this.codeText = this.$lang('find.resendCountdown', { seconds: this.seconds });
|
||||
}, 1000);
|
||||
}
|
||||
uni.setStorageSync('forgot_password_token', data.key);
|
||||
@@ -351,7 +352,7 @@ export default {
|
||||
seconds(value) {
|
||||
if (value == 0) {
|
||||
this.seconds = 120;
|
||||
this.codeText = '重新获取';
|
||||
this.codeText = this.$lang('find.resendCode');
|
||||
this.isSend = false;
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user