Showing
1 changed file
with
7 additions
and
2 deletions
@@ -224,7 +224,7 @@ | @@ -224,7 +224,7 @@ | ||
224 | this.province.showList = this.city.showList = this.area.showList = false; | 224 | this.province.showList = this.city.showList = this.area.showList = false; |
225 | this.province.titleActive = this.city.titleActive = this.street.titleActive = false; | 225 | this.province.titleActive = this.city.titleActive = this.street.titleActive = false; |
226 | break; | 226 | break; |
227 | - case 9: // 一定要返回结果了 | 227 | + case 9: |
228 | this.street.id = id; | 228 | this.street.id = id; |
229 | if (caption.length > 5) { | 229 | if (caption.length > 5) { |
230 | this.street.title = caption.substring(0, 2) + '...' + caption.substring(caption.length - 2); | 230 | this.street.title = caption.substring(0, 2) + '...' + caption.substring(caption.length - 2); |
@@ -253,6 +253,8 @@ | @@ -253,6 +253,8 @@ | ||
253 | $.get('/home/getaddress.json', { | 253 | $.get('/home/getaddress.json', { |
254 | id: id | 254 | id: id |
255 | }, resultData => { | 255 | }, resultData => { |
256 | + | ||
257 | + /* 结果返回 */ | ||
256 | if (resultData.length < 1) { | 258 | if (resultData.length < 1) { |
257 | areaCode.val(id); | 259 | areaCode.val(id); |
258 | area.val(this.province.title + ' ' | 260 | area.val(this.province.title + ' ' |
@@ -286,12 +288,15 @@ | @@ -286,12 +288,15 @@ | ||
286 | 288 | ||
287 | /* 关闭地址选择组件 */ | 289 | /* 关闭地址选择组件 */ |
288 | closeAddBox() { | 290 | closeAddBox() { |
291 | + this.show = false; | ||
292 | + if (areaCode.val().length > 5) { | ||
293 | + return; | ||
294 | + } | ||
289 | areaCode.val(this.street.id || this.area.id || this.city.id || this.province.id); | 295 | areaCode.val(this.street.id || this.area.id || this.city.id || this.province.id); |
290 | area.val(this.province.title + ' ' | 296 | area.val(this.province.title + ' ' |
291 | + this.city.title + ' ' | 297 | + this.city.title + ' ' |
292 | + this.area.title + ' ' | 298 | + this.area.title + ' ' |
293 | + this.street.title); | 299 | + this.street.title); |
294 | - this.show = false; | ||
295 | }, | 300 | }, |
296 | 301 | ||
297 | /* 点击地址标题时的处理 */ | 302 | /* 点击地址标题时的处理 */ |
-
Please register or login to post a comment