Fix:5272 【商城小程序】身份证号末尾输入小写“x”,应提示格式错误

This commit is contained in:
linxi
2026-05-14 09:44:35 +08:00
parent fe442424b0
commit 3a214a3b9d
+5 -3
View File
@@ -112,7 +112,9 @@ export default {
uni.showToast({ title: '请输入真实姓名', icon: 'none' }) uni.showToast({ title: '请输入真实姓名', icon: 'none' })
return return
} }
if (!/^\d{15}$|^\d{17}[\dXx]$/.test(this.form.idCard)) { const idCard = String(this.form.idCard || '').trim().toUpperCase()
this.form.idCard = idCard
if (!/^\d{15}$|^\d{17}[\dX]$/.test(idCard)) {
uni.showToast({ title: '请输入正确身份证号', icon: 'none' }) uni.showToast({ title: '请输入正确身份证号', icon: 'none' })
return return
} }
@@ -124,7 +126,7 @@ export default {
try { try {
const res = await submitDrawRealname({ const res = await submitDrawRealname({
realName: this.form.realName, realName: this.form.realName,
idCard: this.form.idCard, idCard,
phone: this.form.phone phone: this.form.phone
}) })
const data = (res && res.data) || {} const data = (res && res.data) || {}
@@ -149,7 +151,7 @@ export default {
icon: 'none' icon: 'none'
}) })
} finally { } finally {
uni.hideLoading() // uni.hideLoading()
} }
} }
} }