refactor: 完成多语言国际化全量替换与补充
1. 新增大量中英文语言包文件,覆盖自定义组件、页面、工具类的文案 2. 替换硬编码文本为多语言调用,统一全局文案管理 3. 优化语言包结构,拆分公共模块与业务模块 4. 修复部分语言加载与国际化适配问题
This commit is contained in:
@@ -198,6 +198,23 @@
|
||||
? this.undisableText
|
||||
: this.$lang('components.yuyueDate.available');
|
||||
},
|
||||
// 周几名称数组(索引 0-6 对应周日到周六,与 Date.getDay() 返回值一致)
|
||||
// 用于显示层(Toast 等),会随语言切换
|
||||
weekBox() {
|
||||
return [
|
||||
this.$lang('components.yuyueDate.weekSunday'),
|
||||
this.$lang('components.yuyueDate.weekMonday'),
|
||||
this.$lang('components.yuyueDate.weekTuesday'),
|
||||
this.$lang('components.yuyueDate.weekWednesday'),
|
||||
this.$lang('components.yuyueDate.weekThursday'),
|
||||
this.$lang('components.yuyueDate.weekFriday'),
|
||||
this.$lang('components.yuyueDate.weekSaturday'),
|
||||
];
|
||||
},
|
||||
// 中文周几名称数组(用于与 disableWeek prop 做数据匹配,保持兼容性)
|
||||
weekBoxCn() {
|
||||
return ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
},
|
||||
},
|
||||
created(props) {
|
||||
this.selectDate = this.nowDate = currentTime().date;
|
||||
@@ -221,11 +238,10 @@
|
||||
let date = e.split("-");
|
||||
date = date[1] + "-" + date[2];
|
||||
if (this.disableWeek.length && date >= weekDate()[0] && date <= weekDate()[1]) {
|
||||
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
let index = new Date(e).getDay();
|
||||
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
|
||||
let dayIndex = new Date(e).getDay();
|
||||
if (this.disableWeek.indexOf(this.weekBoxCn[dayIndex]) != -1) {
|
||||
uni.showToast({
|
||||
title: this.$lang('components.yuyueDate.weekdayCannotBook', { weekday: weekBox[index] }),
|
||||
title: this.$lang('components.yuyueDate.weekdayCannotBook', { weekday: this.weekBox[dayIndex] }),
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
@@ -243,10 +259,9 @@
|
||||
// 判断默认是不能选择的周,则都禁止选中
|
||||
if (this.disableWeek.length && this.selectDate >= weekDate()[0] && this.selectDate <=
|
||||
weekDate()[1]) {
|
||||
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
let date = currentTime().year + '-' + this.selectDate;
|
||||
let index = new Date(date).getDay();
|
||||
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
|
||||
let dayIndex = new Date(date).getDay();
|
||||
if (this.disableWeek.indexOf(this.weekBoxCn[dayIndex]) != -1) {
|
||||
item.disable = true;
|
||||
}
|
||||
}
|
||||
@@ -309,11 +324,10 @@
|
||||
// 日期选择事件
|
||||
selectDateEvent(index, item) {
|
||||
if (this.disableWeek.length && item.date >= weekDate()[0] && item.date <= weekDate()[1]) {
|
||||
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
let index = new Date(item.timeStamp).getDay();
|
||||
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
|
||||
let dayIndex = new Date(item.timeStamp).getDay();
|
||||
if (this.disableWeek.indexOf(this.weekBoxCn[dayIndex]) != -1) {
|
||||
uni.showToast({
|
||||
title: this.$lang('components.yuyueDate.weekdayCannotBook', { weekday: weekBox[index] }),
|
||||
title: this.$lang('components.yuyueDate.weekdayCannotBook', { weekday: this.weekBox[dayIndex] }),
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user