refactor: replace hardcoded text with language package entries
Replace all inline hardcoded Chinese strings in multiple Vue pages with corresponding language package keys, to unify text management and support multi-language switching.
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.inputMobile') }}</view>
|
||||
<view><text class="color-tip">{{ $lang('find.confirmMobileBound') }}</text></view>
|
||||
</block>
|
||||
|
||||
<block v-if="stepShow == 1">
|
||||
<view class="title">请输入验证码</view>
|
||||
<view class="title">{{ $lang('find.inputCaptcha') }}</view>
|
||||
<view>
|
||||
<text class="color-tip">已将验证码发送至手机号:{{ formData.mobile }}</text>
|
||||
<text class="color-tip">{{ $lang('find.captchaSentTo') }}{{ 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.setNewPassword') }}</view>
|
||||
<view><text class="color-tip">{{ $lang('find.newPasswordTip') }}</text></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="find-form">
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
findMode: 'mobile',
|
||||
codeText: '重新获取',
|
||||
codeText: this.$lang('find.reget'),
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
formData: {
|
||||
@@ -143,7 +143,7 @@ export default {
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
errorMsg: this.$lang('find.mobileFormatError')
|
||||
},
|
||||
{
|
||||
name: 'captcha',
|
||||
@@ -166,7 +166,7 @@ export default {
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: '该手机号未注册'
|
||||
title: this.$lang('find.mobileNotRegistered')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ export default {
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入密码'
|
||||
errorMsg: this.$lang('find.inputPassword')
|
||||
}
|
||||
];
|
||||
if (regConfig.pwd_len > 0) {
|
||||
@@ -193,27 +193,27 @@ export default {
|
||||
name: 'password',
|
||||
checkType: 'lengthMin',
|
||||
checkRule: regConfig.pwd_len,
|
||||
errorMsg: '密码长度不能小于' + regConfig.pwd_len + '位'
|
||||
errorMsg: this.$lang('find.passwordLengthError') + regConfig.pwd_len + this.$lang('find.passwordLengthErrorSuffix')
|
||||
});
|
||||
}
|
||||
if (regConfig.pwd_complexity != '') {
|
||||
let passwordErrorMsg = '密码需包含',
|
||||
let passwordErrorMsg = this.$lang('find.passwordNeedContain'),
|
||||
reg = '';
|
||||
if (regConfig.pwd_complexity.indexOf('number') != -1) {
|
||||
reg += '(?=.*?[0-9])';
|
||||
passwordErrorMsg += '数字';
|
||||
passwordErrorMsg += this.$lang('find.digit');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('letter') != -1) {
|
||||
reg += '(?=.*?[a-z])';
|
||||
passwordErrorMsg += '、小写字母';
|
||||
passwordErrorMsg += this.$lang('find.lowercaseLetter');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('upper_case') != -1) {
|
||||
reg += '(?=.*?[A-Z])';
|
||||
passwordErrorMsg += '、大写字母';
|
||||
passwordErrorMsg += this.$lang('find.uppercaseLetter');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('symbol') != -1) {
|
||||
reg += '(?=.*?[#?!@$%^&*-])';
|
||||
passwordErrorMsg += '、特殊字符';
|
||||
passwordErrorMsg += this.$lang('find.specialChar');
|
||||
}
|
||||
rule.push({
|
||||
name: 'password',
|
||||
@@ -227,7 +227,7 @@ export default {
|
||||
if (checkRes) {
|
||||
if (this.formData.password != this.formData.rePassword) {
|
||||
this.$util.showToast({
|
||||
title: '两次密码不一致'
|
||||
title: this.$lang('find.passwordNotMatch')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -283,7 +283,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.regetWithTime').replace('{seconds}', this.seconds);
|
||||
}, 1000);
|
||||
}
|
||||
uni.setStorageSync('forgot_password_token', data.key);
|
||||
@@ -351,7 +351,7 @@ export default {
|
||||
seconds(value) {
|
||||
if (value == 0) {
|
||||
this.seconds = 120;
|
||||
this.codeText = '重新获取';
|
||||
this.codeText = this.$lang('find.reget');
|
||||
this.isSend = false;
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user