From 80d390886a0a37e2ddf20c822dfa78b9c3ca0db4 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Fri, 3 Jul 2026 14:06:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(yuyue-date):=20=E4=BF=AE=E5=A4=8D=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E8=AF=AD=E8=A8=80key=E7=9A=84=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将所有组件内的语言key从components.yuyueDate改为components.yuyue-date,统一命名格式,确保多语言配置可以正确加载对应文案。 --- components/yuyue-date/yuyue-date.js | 20 ++++++++++---------- components/yuyue-date/yuyue-date.vue | 26 +++++++++++++------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/components/yuyue-date/yuyue-date.js b/components/yuyue-date/yuyue-date.js index de0293d..2fe230a 100644 --- a/components/yuyue-date/yuyue-date.js +++ b/components/yuyue-date/yuyue-date.js @@ -39,13 +39,13 @@ export function timeStamp(time) { const hour = dates.getHours() const min = dates.getMinutes() const weekDays = [ - $lang('components.yuyueDate.weekSunday'), - $lang('components.yuyueDate.weekMonday'), - $lang('components.yuyueDate.weekTuesday'), - $lang('components.yuyueDate.weekWednesday'), - $lang('components.yuyueDate.weekThursday'), - $lang('components.yuyueDate.weekFriday'), - $lang('components.yuyueDate.weekSaturday'), + $lang('components.yuyue-date.weekSunday'), + $lang('components.yuyue-date.weekMonday'), + $lang('components.yuyue-date.weekTuesday'), + $lang('components.yuyue-date.weekWednesday'), + $lang('components.yuyue-date.weekThursday'), + $lang('components.yuyue-date.weekFriday'), + $lang('components.yuyue-date.weekSaturday'), ] return { allDate: `${year}/${strFormat(month)}/${strFormat(date)}`, @@ -63,9 +63,9 @@ export function initData(appointedDay = '') { const now = date.getTime() //获取当前日期的时间戳 let timeStr = 3600 * 24 * 1000 //一天的时间戳 let obj = { - 0: $lang('components.yuyueDate.today'), - 1: $lang('components.yuyueDate.tomorrow'), - 2: $lang('components.yuyueDate.dayAfterTomorrow') + 0: $lang('components.yuyue-date.today'), + 1: $lang('components.yuyue-date.tomorrow'), + 2: $lang('components.yuyue-date.dayAfterTomorrow') } for (let i = 0; i < 7; i++) { const timeObj = {} diff --git a/components/yuyue-date/yuyue-date.vue b/components/yuyue-date/yuyue-date.vue index b584690..8bad444 100644 --- a/components/yuyue-date/yuyue-date.vue +++ b/components/yuyue-date/yuyue-date.vue @@ -20,7 +20,7 @@
- {{ $lang('components.yuyueDate.appointedDate') }} + {{ $lang('components.yuyue-date.appointedDate') }}
@@ -191,24 +191,24 @@ disableTextI18n() { return this.disableText && this.disableText !== '已约满' ? this.disableText - : this.$lang('components.yuyueDate.fullyBooked'); + : this.$lang('components.yuyue-date.fullyBooked'); }, undisableTextI18n() { return this.undisableText && this.undisableText !== '可预约' ? this.undisableText - : this.$lang('components.yuyueDate.available'); + : this.$lang('components.yuyue-date.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'), + this.$lang('components.yuyue-date.weekSunday'), + this.$lang('components.yuyue-date.weekMonday'), + this.$lang('components.yuyue-date.weekTuesday'), + this.$lang('components.yuyue-date.weekWednesday'), + this.$lang('components.yuyue-date.weekThursday'), + this.$lang('components.yuyue-date.weekFriday'), + this.$lang('components.yuyue-date.weekSaturday'), ]; }, // 中文周几名称数组(用于与 disableWeek prop 做数据匹配,保持兼容性) @@ -241,7 +241,7 @@ let dayIndex = new Date(e).getDay(); if (this.disableWeek.indexOf(this.weekBoxCn[dayIndex]) != -1) { uni.showToast({ - title: this.$lang('components.yuyueDate.weekdayCannotBook', { weekday: this.weekBox[dayIndex] }), + title: this.$lang('components.yuyue-date.weekdayCannotBook', { weekday: this.weekBox[dayIndex] }), icon: 'none' }) return false; @@ -307,7 +307,7 @@ this.isSection && (item.isInclude = false); }); - this.orderDateTime = isFullTime ? this.$lang('components.yuyueDate.noSelection') : this.selectDate; + this.orderDateTime = isFullTime ? this.$lang('components.yuyue-date.noSelection') : this.selectDate; this.timeActive = -1; for (let i = 0, len = this.timeArr.length; i < len; i++) { if (!this.timeArr[i].disable) { @@ -327,7 +327,7 @@ let dayIndex = new Date(item.timeStamp).getDay(); if (this.disableWeek.indexOf(this.weekBoxCn[dayIndex]) != -1) { uni.showToast({ - title: this.$lang('components.yuyueDate.weekdayCannotBook', { weekday: this.weekBox[dayIndex] }), + title: this.$lang('components.yuyue-date.weekdayCannotBook', { weekday: this.weekBox[dayIndex] }), icon: 'none' }) return false;