diff --git a/i18n/lang/en.json b/i18n/lang/en.json index 1fb38c4..558f0c1 100644 --- a/i18n/lang/en.json +++ b/i18n/lang/en.json @@ -42,6 +42,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 a68c0ae..8fc6fe0 100644 --- a/i18n/lang/zh-TW.json +++ b/i18n/lang/zh-TW.json @@ -42,6 +42,7 @@ "service": "客服", "toDwon": "是否前往下載頁", "toDwon1": "是否前往認證頁", + "date1": "請輸入日期", "a0": "請輸入申購碼", "a1": "複製成功", "a2": "複製失敗", diff --git a/pages/auth/primary.vue b/pages/auth/primary.vue index 6b1afda..bb4007c 100644 --- a/pages/auth/primary.vue +++ b/pages/auth/primary.vue @@ -25,8 +25,9 @@ {{$t('auth.d0')}} - + + @@ -71,7 +72,7 @@ - + {{$t('auth.SelectAreaCode')}} @@ -84,7 +85,7 @@ - + {{$t('auth.d11')}} @@ -151,6 +152,23 @@ export default { }, }, methods: { + 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; + }); + }, getAuthInfo() { Profile.getAuthInfo().then((res) => { this.detail = res.data; diff --git a/pages/reg/index.vue b/pages/reg/index.vue index 28b240a..56a0e23 100644 --- a/pages/reg/index.vue +++ b/pages/reg/index.vue @@ -68,42 +68,39 @@ - - - {{$t('homeNewText.ee6')}} - - - - + + + + {{$t('reg.a2')}} + + + + + + + + + {{$t('homeNewText.ee6')}} + + + + {{$t('reg.a6')}}