diff --git a/static/js/CommonFunction.js b/static/js/CommonFunction.js index 63a6635..d09b79c 100644 --- a/static/js/CommonFunction.js +++ b/static/js/CommonFunction.js @@ -60,6 +60,11 @@ Vue.prototype.IsMail = code => { return pattern.test(code); } +// 判断数字 +Vue.prototype.IsNumber = num => { + return /^[0-9]+.?[0-9]*$/.test(num); +} + // 图片显示判断 Vue.prototype.showImg = img => { if(!img) return; diff --git a/subPackages/user/infoFilling.vue b/subPackages/user/infoFilling.vue index b1a547f..cc909b8 100644 --- a/subPackages/user/infoFilling.vue +++ b/subPackages/user/infoFilling.vue @@ -109,7 +109,8 @@ - + + diff --git a/subPackages/user/register.vue b/subPackages/user/register.vue index 77de90b..5127e9e 100644 --- a/subPackages/user/register.vue +++ b/subPackages/user/register.vue @@ -373,6 +373,10 @@ uni.showToast({title: "请输入工作年限",icon: 'none'}) return; } + if (!this.IsNumber(this.info.duration)) { + uni.showToast({title: "请输入正确的工作年限",icon: 'none'}) + return; + } if (!this.info.lingo_ids || this.info.lingo_idsFileList.length<=0) { uni.showToast({title: "请选择语言能力并上传证明材料",icon: 'none'}) return;