|
|
|
@ -84,7 +84,7 @@ |
|
|
|
|
this.handleDefaultRegion(region) |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
console.log(region) |
|
|
|
|
// console.log(region) |
|
|
|
|
console.warn('defaultRegion非有效格式') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -150,7 +150,7 @@ |
|
|
|
|
this.$emit('getRegion',address) |
|
|
|
|
}, |
|
|
|
|
handleDefaultRegion(region){ |
|
|
|
|
console.log(region,"region") |
|
|
|
|
// console.log(region,"region") |
|
|
|
|
const isCode = !Array.isArray(region) |
|
|
|
|
this.isInitMultiArray = false; |
|
|
|
|
let children = this.CHINA_REGIONS; |
|
|
|
@ -160,11 +160,11 @@ |
|
|
|
|
let condition; |
|
|
|
|
if(i==2){ |
|
|
|
|
condition = isCode?String(children[j].code).slice(0)==region.slice(0):children[j].name.includes(region[i]); |
|
|
|
|
console.log(String(children[j].code).slice(0),region.slice(0)) |
|
|
|
|
// console.log(String(children[j].code).slice(0),region.slice(0)) |
|
|
|
|
}else{ |
|
|
|
|
condition = isCode?String(children[j].code).slice(0,(i+1)*2)==region.slice(0,(i+1)*2):children[j].name.includes(region[i]); |
|
|
|
|
// console.log(String(children[j].code).slice(0,(i+1)*2)==region.slice(0,(i+1)*2)) |
|
|
|
|
console.log(String(children[j].code).slice(0,(i+1)*2),region.slice(0,(i+1)*2)) |
|
|
|
|
// console.log(String(children[j].code).slice(0,(i+1)*2),region.slice(0,(i+1)*2)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(condition){ |
|
|
|
@ -194,7 +194,7 @@ |
|
|
|
|
break; |
|
|
|
|
}else{ |
|
|
|
|
// 首次匹配失败就用默认的初始化 |
|
|
|
|
console.log(i,j,children.length-1,"匹配失败"); |
|
|
|
|
// console.log(i,j,children.length-1,"匹配失败"); |
|
|
|
|
if(i==0 && j==(children.length-1)){ |
|
|
|
|
this.isInitMultiArray = true; |
|
|
|
|
} |
|
|
|
|