diff --git a/src/i18n/en.json b/src/i18n/en.json index 6232546..ba7ea36 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -845,7 +845,8 @@ "clickToVerify1": "Completed", "tips1": "Primary Certification: To withdraw cash,you need to complete advanced certification.", "tips2": "Advanced Certification: Up to 500k USDT 24-hour withdrawal limit. For more withdrawal amount,please contact customer service", - "tips3": "Congratulations, you have passed the advanced certification!" + "tips3": "Congratulations, you have passed the advanced certification!", + "date1": "Please enter the date." }, "setting": { "smsVer": "SMS Verification", diff --git a/src/i18n/tw.json b/src/i18n/tw.json index 948f216..de90e83 100644 --- a/src/i18n/tw.json +++ b/src/i18n/tw.json @@ -787,7 +787,8 @@ "clickToVerify1": "已完成", "tips1": "初級認證:要選取現金,您需要完成高級認證。", "tips2": "高級認證:最高5000USDT 24小時提款限額。 如需更多取款金額,請聯系客服", - "tips3": "恭喜您,高級認證已通過!" + "tips3": "恭喜您,高級認證已通過!", + "date1": "請輸入日期" }, "setting": { "smsVer": "簡訊驗證", diff --git a/src/views/profile/certification.vue b/src/views/profile/certification.vue index 091b5a6..685fb05 100644 --- a/src/views/profile/certification.vue +++ b/src/views/profile/certification.vue @@ -32,13 +32,21 @@
- + > --> +
@@ -330,6 +338,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()