diff --git a/pages/pages_zhentou/form/form.vue b/pages/pages_zhentou/form/form.vue index 4e9657a..3a7f563 100644 --- a/pages/pages_zhentou/form/form.vue +++ b/pages/pages_zhentou/form/form.vue @@ -249,9 +249,9 @@ { validateFunction: function(rule, value, data, callback) { // const moblie = /^(0{1}|[1-9]\d{0,3}|.{0})$/; - const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/ + const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{0})?$/ if (!moblie.test(value)) { - callback('请填写正确的身高'); + callback('身高应为大于10的整数'); } else { return true; } @@ -268,7 +268,7 @@ validateFunction: function(rule, value, data, callback) { const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/; if (!moblie.test(value)) { - callback('请填写正确的体重'); + callback('体重应大于10斤且小数点最多为两位'); } else { return true; } @@ -279,7 +279,8 @@ neckShoulderWidth:{ rules:[{ validateFunction: function(rule, value, data, callback) { - const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/; + // const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/; + const moblie = /^(\d|([1-9]\d+))(\.\d{1,2})?$/; if (!moblie.test(value)) { callback('请填写正确的肩颈宽度'); } else { @@ -291,7 +292,7 @@ neckLength:{ rules:[{ validateFunction: function(rule, value, data, callback) { - const moblie = /^(\[1-9]|([1-9]\d+))(\.\d{1,2})?$/; + const moblie = /^(\d|([1-9]\d+))(\.\d{1,2})?$/; if (!moblie.test(value)) { callback('请填写正确的颈椎长度'); } else { @@ -549,8 +550,11 @@ }, handlePrev() { this.currentNum = this.currentNum - 1; - this.alreadyForm = JSON.parse(JSON.stringify(this.valiFormData)) ; - this.valiFormData = this.orderData[this.currentNum - 1]; + // this.valiFormData = this.orderData[this.currentNum - 1]; + if(this.currentNum == this.orderData.length){ + this.alreadyForm = JSON.parse(JSON.stringify(this.valiFormData)) ; + } + if (!this.valiFormData) { this.valiFormData = {}; this.$nextTick(() =>{ @@ -589,13 +593,36 @@ icon:'none' }) }else{ - this.currentNum = this.currentNum + 1 - this.isDisabled = false; - if(JSON.stringify(this.alreadyForm) == '{}'){ - this.valiFormData = this.valiFormData + this.currentNum = this.currentNum + 1; + console.log('this.alreadyForm ==>',this.alreadyForm) + console.log('currentNum==>',this.currentNum) + if(this.currentNum > this.orderData.length){ + this.valiFormData = JSON.parse(JSON.stringify(this.orderData[this.currentNum - 2])); + this.valiFormData.id = ''; + this.isDisabled = false; + console.log('123') + if(JSON.stringify(this.alreadyForm) == '{}'){ + console.log('456') + this.valiFormData = this.valiFormData + }else{ + this.valiFormData = this.alreadyForm + } }else{ - this.valiFormData = this.alreadyForm + this.valiFormData = JSON.parse(JSON.stringify(this.orderData[this.currentNum - 1])); + this.isDisabled = true; } + // this.valiFormData = this.orderData[this.currentNum - 1]; + // if (!this.valiFormData) { + + // }else{ + // this.isDisabled = true; + // } + + // if(JSON.stringify(this.alreadyForm) == '{}'){ + // this.valiFormData = this.valiFormData + // }else{ + // this.valiFormData = this.alreadyForm + // } } // console.log(this.currentNum) // this.currentNum = this.currentNum + 1 @@ -804,6 +831,7 @@ icon: 'none' }); this.valiFormData = {}, + this.alreadyForm = {} this.multiIndex[0, 0, 0]; this.city = '' this.province = '';