refactor: 替换多页面国际化文本为硬编码中文内容
移除项目内大部分$lang()国际化调用,替换为直接中文文本,统一前端展示文案
This commit is contained in:
@@ -53,7 +53,7 @@ export default {
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('collection.deleteSuccess')
|
||||
title: "删除成功"
|
||||
})
|
||||
let array = this.collectionList;
|
||||
let newArray = array.filter((v) => {
|
||||
|
||||
@@ -55,16 +55,16 @@ export default {
|
||||
isIphoneX: false,
|
||||
items: [{
|
||||
value: '0',
|
||||
name: this.$lang('member.unknown')
|
||||
name: '未知'
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
name: this.$lang('member.male'),
|
||||
name: '男',
|
||||
checked: 'true'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
name: this.$lang('member.female')
|
||||
name: '女'
|
||||
}
|
||||
],
|
||||
current: 0,
|
||||
@@ -109,7 +109,7 @@ export default {
|
||||
},
|
||||
onHide() {
|
||||
this.seconds = 120;
|
||||
this.formData.mobileCodeText = this.$lang('member.getDynamicCode');
|
||||
this.formData.mobileCodeText = '获取动态码';
|
||||
this.isSend = false;
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
@@ -117,7 +117,7 @@ export default {
|
||||
seconds(value) {
|
||||
if (value == 0) {
|
||||
this.seconds = 120;
|
||||
this.formData.mobileCodeText = this.$lang('member.getDynamicCode');
|
||||
this.formData.mobileCodeText = '获取动态码';
|
||||
this.isSend = false;
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ export default {
|
||||
}
|
||||
},
|
||||
setNavbarTitle() {
|
||||
let title = this.$lang('member.personalInfo');
|
||||
let title = '个人资料';
|
||||
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.$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.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.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: this.$lang('member.sameAsOriginalName')
|
||||
title: '与原真实姓名一致,无需修改'
|
||||
});
|
||||
return;
|
||||
}
|
||||
var rule = [{
|
||||
name: 'realName',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('member.realNameNotEmpty')
|
||||
errorMsg: '真实姓名不能为空'
|
||||
}];
|
||||
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: this.$lang('member.selectBirthdayTip')
|
||||
title: '请选择生日'
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -576,15 +576,15 @@ export default {
|
||||
name: 'newPassword',
|
||||
checkType: 'lengthMin',
|
||||
checkRule: regConfig.pwd_len,
|
||||
errorMsg: this.$lang('member.newPasswordTooShort') + regConfig.pwd_len + this.$lang('member.digit')
|
||||
errorMsg: '新密码长度不能小于' + regConfig.pwd_len + '位'
|
||||
});
|
||||
}
|
||||
if (regConfig.pwd_complexity) {
|
||||
let passwordErrorMsg = this.$lang('member.passwordNeedInclude'),
|
||||
let passwordErrorMsg = '密码需包含',
|
||||
reg = '';
|
||||
if (regConfig.pwd_complexity.indexOf('number') != -1) {
|
||||
reg += '(?=.*?[0-9])';
|
||||
passwordErrorMsg += this.$lang('member.digit');
|
||||
passwordErrorMsg += '数字';
|
||||
}
|
||||
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: this.$lang('member.sameAsOldPassword')
|
||||
title: '新密码不能与原密码相同'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.formData.newPassword != this.formData.confirmPassword) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('member.passwordNotMatch')
|
||||
title: '两次密码不一致'
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -657,11 +657,11 @@ export default {
|
||||
var rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('member.inputMobile')
|
||||
errorMsg: '请输入手机号'
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: this.$lang('member.inputMobileCorrect')
|
||||
errorMsg: '请输入正确的手机号'
|
||||
}];
|
||||
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.$lang('member.alreadySent') + '(' + this.seconds + 's)';
|
||||
this.formData.mobileCodeText = '已发送(' + 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 : this.$lang('member.noRepeatClick')
|
||||
title: validate.error ? validate.error : '请勿重复点击'
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -840,7 +840,7 @@ export default {
|
||||
if (this.seconds == 120 && this.timer == null) {
|
||||
this.timer = setInterval(() => {
|
||||
this.seconds--;
|
||||
this.formData.mobileCodeText = this.$lang('member.alreadySent') + '(' + this.seconds + 's)';
|
||||
this.formData.mobileCodeText = '已发送(' + this.seconds + 's)';
|
||||
}, 1000);
|
||||
}
|
||||
uni.setStorageSync('password_mobile_key', data.key);
|
||||
@@ -858,7 +858,7 @@ export default {
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('member.noRepeatClick')
|
||||
title: '请勿重复点击'
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -866,12 +866,12 @@ export default {
|
||||
var rule = [{
|
||||
name: 'fullAddress',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('member.selectRegion')
|
||||
errorMsg: '请选择所在地区'
|
||||
},
|
||||
{
|
||||
name: 'address',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('member.inputDetailAddress')
|
||||
errorMsg: '请输入详细地址'
|
||||
}
|
||||
];
|
||||
if (!rule.length) return;
|
||||
|
||||
@@ -98,12 +98,12 @@ export default {
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('member.saveSuccess')
|
||||
title: "保存成功"
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('member.saveFailed')
|
||||
title: "保存失败,请稍后重试"
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -60,8 +60,8 @@ export default {
|
||||
// 提交注销申请并清理登录态(供 assets.vue 等页面调用)
|
||||
submitCancelApply(options = {}) {
|
||||
uni.showModal({
|
||||
title: options.title || this.$lang('member.riskTip'),
|
||||
content: options.content || this.$lang('member.confirmLogoutAccount'),
|
||||
title: options.title || '风险提示',
|
||||
content: options.content || '确定要注销当前账号吗?',
|
||||
confirmColor: '#000000',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.membersignin) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('member.merchantNotOpenSignin'),
|
||||
title: '商家未开启会员签到',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
@@ -198,7 +198,7 @@ export default {
|
||||
sign() {
|
||||
if (this.signState == 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('member.signinNotEnabled')
|
||||
title: '签到未开启'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -233,8 +233,8 @@ export default {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/member/signin';
|
||||
|
||||
this.$util.setPublicShare({
|
||||
title: this.$lang('member.signinGift'),
|
||||
desc: this.$lang('member.signinGiftDesc'),
|
||||
title: '签到有礼',
|
||||
desc: '天天签到,积分好礼送不停',
|
||||
link: shareUrl,
|
||||
imgUrl: ''
|
||||
},
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
onShareAppMessage() {
|
||||
var path = '/pages_tool/member/signin';
|
||||
return {
|
||||
title: this.$lang('member.signinGift') + ',' + this.$lang('member.signinGiftDesc'),
|
||||
title: '签到有礼,天天签到,积分好礼送不停',
|
||||
imageUrl: '',
|
||||
path: path,
|
||||
success: res => {},
|
||||
|
||||
Reference in New Issue
Block a user