diff --git a/root/detail/fellow.vue b/root/detail/fellow.vue index c0bba29..add083e 100644 --- a/root/detail/fellow.vue +++ b/root/detail/fellow.vue @@ -27,7 +27,7 @@ placeholder: '请输入身份证号', type: 'slot', pColumn: 8, - require: true, + require: false, }, { icon: '', @@ -38,7 +38,7 @@ tip: 'slot-sex', type: 'slot', pColumn: 12, - require: true, + require: false, customRequire: true, }, { @@ -51,7 +51,7 @@ placeholder: '请输入年龄', type: 'slot', pColumn: 8, - require: true, + require: false, }, { icon: '', @@ -118,7 +118,7 @@ placeholder: '请输入联系电话', type: 'slot', pColumn: 8, - require: true, + require: false, }, ]" @changeMobile="handleClickMobile"> @@ -376,41 +376,27 @@ export default { }) return false } - if (!that.info.sex) { + if (!that.info.tel && !that.info.weChat) { uni.showToast({ icon: 'none', - title: '请选择性别', + title: '请输入手机号或微信', }) return false } - if (!that.info.age) { - uni.showToast({ - icon: 'none', - title: '请输入年龄', - }) - return false - } - if (!that.info.nation) { - uni.showToast({ - icon: 'none', - title: '请选择民族', - }) - return false - } - if (!that.G.setReg(that.info.tel, 'tel')) { + if (that.info.tel &&!that.G.setReg(that.info.tel, 'tel')) { uni.showToast({ icon: 'none', title: '请输入正确的手机号', }) return false } - if (!that.G.setReg(that.info.idCard, 'idcard')) { - uni.showToast({ - icon: 'none', - title: '请输入正确的身份证号', - }) - return false - } + if (that.info.idCard && !that.G.isValidIdCard(that.info.idCard)) { + uni.showToast({ + icon: "none", + title: "请输入正确的身份证号", + }); + return false; + } console.log(that.info) if (that.imgList.length > 0) { that.info.imgs = that.newAddImg.toString()