zhangshuangnan лет назад: 7
Родитель
Сommit
999273ee97
1 измененных файлов с 21 добавлено и 7 удалено
  1. 21 7
      WebChat/html/myTouSu.html

+ 21 - 7
WebChat/html/myTouSu.html

@@ -373,6 +373,8 @@
373 373
 //      })
374 374
         
375 375
         function getArea(arrType,ids){
376
+        	townList = [];
377
+        	villageList = [];
376 378
         	$.ajax({
377 379
                     type: "get",
378 380
                     url: huayi.config.callcenter_url + 'Web/GetWebAreaListById',
@@ -473,15 +475,20 @@
473 475
                 var showCityPickerButton = doc.getElementById('showCityPicker3');
474 476
                 var cityResult3 = doc.getElementById('cityResult3');
475 477
                 showCityPickerButton.addEventListener('tap', function (event) {
476
-                    if (areaList.length > 0) {
478
+//                  if (areaList.length > 0) {
477 479
                         cityPicker3.show(function (items) {
478
-                            cityResult3.value = items[0].text;
480
+                            cityResult3.value = (items[0].text ? items[0].text : "");
479 481
                             cityResult3.setAttribute("data-index", items[0].value);
480 482
                             //返回 false 可以阻止选择框的关闭
481 483
                             //return false;
482 484
                              getArea(2,items[0].value);
485
+                              if (townList.length == 0) {
486
+		                            doc.getElementById('town').value="暂无数据";
487
+		                        } else {
488
+		                            doc.getElementById('town').setAttribute("placeholder", "请选择街道");
489
+		                        }
483 490
                         });
484
-                    }
491
+//                  }
485 492
                 }, false);
486 493
                 //街道
487 494
                		townPicker= new $.PopPicker({
@@ -493,11 +500,18 @@
493 500
                 townPickerPickerButton.addEventListener('tap', function (event) {
494 501
                     if (areaList.length > 0) {
495 502
                         townPicker.show(function (items) {
496
-                            townResult.value = items[0].text;
503
+                            townResult.value = (items[0].text ? items[0].text : "");
497 504
                             townResult.setAttribute("data-index", items[0].value);
498 505
                             //返回 false 可以阻止选择框的关闭
499 506
                             //return false;
500 507
                             getArea(3,items[0].value);
508
+                            if (villageList.length == 0) {
509
+		                            doc.getElementById('village').value="暂无数据";
510
+//		                            doc.getElementById('village').setAttribute("placeholder", "暂无数据");
511
+		                        } else {
512
+		                        	doc.getElementById('village').value="";
513
+		                            doc.getElementById('village').setAttribute("placeholder", "请选择村庄");
514
+		                        }
501 515
                         });
502 516
                     }
503 517
                 }, false);
@@ -509,14 +523,14 @@
509 523
                 var villagePickerPickerButton = doc.getElementById('showvillage');
510 524
                 var villageResult = doc.getElementById('village');
511 525
                 villagePickerPickerButton.addEventListener('tap', function (event) {
512
-                    if (areaList.length > 0) {
526
+//                  if (townList.length > 0) {
513 527
                         villagePicker.show(function (items) {
514
-                            villageResult.value = items[0].text;
528
+                            villageResult.value = (items[0].text ? items[0].text : "");
515 529
                             villageResult.setAttribute("data-index", items[0].value);
516 530
                             //返回 false 可以阻止选择框的关闭
517 531
                             //return false;
518 532
                         });
519
-                    }
533
+//                  }
520 534
                 }, false);
521 535
 
522 536
             })