let year = this.idCard.slice(6, 10) * 1, //截取身份证年份month = this.idCard.slice(10, 12) * 1,//截取身份证月份date = this.idCard.slice(12, 14) * 1,//截取身份证日期curYear = new Date().getFullYear(), //获取当前年curMonth = new Date().getMonth() + 1,//获取当月curDate = new Date().getDate()//获取当日期if (year + 18 > curYear ||(year + 18 == curYear && month < curMonth) ||(year + 18 == curYear && month == curMonth && date < curDate)) {//小于18周岁this.$dialog.toast({mes: '被保险人年龄需在18周岁~55周岁(含)',timeout: 1500,})} else if (year + 56 > curYear ||(year + 56 == curYear && month > curMonth) ||(year + 56 == curYear && month == curMonth && date > curDate)) {//大于55岁this.$dialog.toast({mes: '被保险人年龄需在18周岁~55周岁(含)',timeout: 1500,})} else { //符合要求 // this.giftGetState()this.handleShowPopup(0, 6)}