From a84aa78163506d4ed27b2ffa15a93bca6ed31d5d Mon Sep 17 00:00:00 2001
From: wr1207 <wyun001@163.com>
Date: 星期二, 17 十月 2023 11:44:27 +0800
Subject: [PATCH] 移动增加查询等待的提示

---
 mobile/js/widget_search_view.js |   22 +++++++++++++++++-----
 mobile/road_search.html         |   12 ++++++++++++
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/mobile/js/widget_search_view.js b/mobile/js/widget_search_view.js
index 13a994d..57dd46a 100644
--- a/mobile/js/widget_search_view.js
+++ b/mobile/js/widget_search_view.js
@@ -129,17 +129,22 @@
         + "&pageno="+page+"&pagesize="+avgnam
         + "&userid="+localStorage.getItem('user_id_')
         + "&region="+current_selected_monitor_street;
+    var loadingdiv = document.getElementById("warning"); 
     $.ajax({
         type: "GET",
         url: backend_url,
         dataType: "json",
+        async: true,
+        beforeSend: function(){
+            loadingdiv.innerhtml = "姝e湪澶勭悊锛岃绋嶇瓑锛�"; // insert tip information
+            $("#btn").attr({disabled:"disabled"});
+            $("#regionSelect").attr({disabled:"disabled"});
+            $("#querySelect").attr({disabled:"disabled"});
+            $("#qindex_selection").attr({disabled:"disabled"});
+            loadingdiv.style.display = "block"; // display the div
+        },
         success: function (data) {
             tableData = data.data.result;
-            // if (current_selected_monitor_keyword == null) {
-            //     // haoutil.msg("璇疯緭鍏ュ叧閿瓧锛侊紒锛�")
-            //     alert('璇疯緭鍏ュ叧閿瓧锛侊紒锛�')
-            //     return;
-            // }
             if (tableData == null) {
                 // haoutil.msg("璇烽�夋嫨鏌ヨ绫诲埆锛侊紒锛�")
                 alert('璇烽�夋嫨鏌ヨ绫诲埆锛侊紒锛�')
@@ -182,6 +187,13 @@
                 '</div>';
             $("#pageID").append(content1);
             $("#page").append(content2);
+        },complete: function() {
+            loadingdiv.innerhtml = ""; 
+            loadingdiv.style.display = "none"; 
+            $("#btn").removeAttr("disabled");
+            $("#regionSelect").removeAttr("disabled");
+            $("#querySelect").removeAttr("disabled");
+            $("#qindex_selection").removeAttr("disabled");
         }
     });
 }
diff --git a/mobile/road_search.html b/mobile/road_search.html
index 706107a..ac869d2 100644
--- a/mobile/road_search.html
+++ b/mobile/road_search.html
@@ -80,6 +80,16 @@
     right: 0;
     background: #476399;
 }
+.loading{
+    display: none;
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    z-index: 99;
+    background: rgba(0, 0, 0, .6);
+}
     </style>
 </head>
 
@@ -170,6 +180,8 @@
                 </tbody>
             </table>
         </form>
+        <!-- <div id="warning"></div> -->
+        <div id="warning" style="color:#ffffff; display:none; position:absolute; top:220px; left:10em;">姝e湪澶勭悊锛岃绋嶇瓑锛�</div>
         <div class="page">
             <div id="pageID">
             </div>

--
Gitblit v1.9.1