From 960ff13fa12d49b006090965b18d0d0d7482ced0 Mon Sep 17 00:00:00 2001 From: liaoxinyu Date: Tue, 2 Jun 2026 11:40:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E7=BA=A7=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E6=97=A5=E6=9C=9F=E4=B8=BA=E8=BE=93=E5=85=A5=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/lang/en.json | 1 + i18n/lang/zh-TW.json | 1 + pages/auth/primary.vue | 27 ++++++++++++++++++++++++--- pages/reg/index.vue | 3 ++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/i18n/lang/en.json b/i18n/lang/en.json index 07ffd49..5e98e6a 100644 --- a/i18n/lang/en.json +++ b/i18n/lang/en.json @@ -82,6 +82,7 @@ "service": "Service", "toDwon": "Do you want to go to the download page", "toDwon1": "Do you want to go to the authentication page", + "date1": "Please enter the date.", "a0": "Please enter the purchase code", "a1": "Copy succeeded", "a2": "Copy failed", diff --git a/i18n/lang/zh-TW.json b/i18n/lang/zh-TW.json index cde85f5..8d3003f 100644 --- a/i18n/lang/zh-TW.json +++ b/i18n/lang/zh-TW.json @@ -82,6 +82,7 @@ "service": "客服", "toDwon": "是否前往下載頁", "toDwon1": "是否前往認證頁", + "date1": "請輸入日期", "a0": "請輸入申購碼", "a1": "複製成功", "a2": "複製失敗", diff --git a/pages/auth/primary.vue b/pages/auth/primary.vue index 98f0c7a..75278fe 100644 --- a/pages/auth/primary.vue +++ b/pages/auth/primary.vue @@ -11,10 +11,11 @@ - {{$t('auth.c5')}} + {{$t('auth.c5')}}(YYYY-MM-DD) - + + @@ -122,6 +123,23 @@ export default { this.detail = res.data; }); }, + formatDateInput(e) { + let value = e.target.value; + // 1. 移除非数字和横线 + value = value.replace(/[^\d-]/g, ''); + // 2. 自动添加横线(4位年份后加横线,7位后加横线) + if (/^\d{4}$/.test(value)) { + value = value + '-'; + } else if (/^\d{4}-\d{2}$/.test(value)) { + value = value + '-'; + } + // 3. 限制长度不超过10 + if (value.length > 10) value = value.slice(0, 10); + // 4. 更新模型(避免光标跳动问题,可使用 nextTick) + this.$nextTick(() => { + this.form.birthday = value; + }); + }, // 获取区号 getCountryCode() { Member.getCountryCode() @@ -276,4 +294,7 @@ export default { ::v-deep uni-input{ border: 1px solid #e5e5e5; } +::v-deep .uni-select__input-placeholder{ + font-size: 14px !important; +} \ No newline at end of file diff --git a/pages/reg/index.vue b/pages/reg/index.vue index 434fdf7..91a310d 100644 --- a/pages/reg/index.vue +++ b/pages/reg/index.vue @@ -125,7 +125,8 @@ {{$t('reg.c6')}} --> - + + {{$t('reg.c6')}}