c 3 年之前
父節點
當前提交
a6a4b8328f
共有 3 個文件被更改,包括 36 次插入0 次删除
  1. 13 0
      whepi-ui/templates/home/frag.head.ftl
  2. 9 0
      whepi-ui/templates/home/ribao.ftl
  3. 14 0
      whepi-ui/templates/home/ribao.js

+ 13 - 0
whepi-ui/templates/home/frag.head.ftl

@@ -243,6 +243,19 @@
             -webkit-align-items:center;
             align-items:center
         }
+        .cx-reset-ribao .weui-dialog, .weui-toast {
+            -webkit-transition-duration: .2s;
+            transition-duration: .2s;
+            opacity: 1;
+            -webkit-transform: translate(-50%, -50%);
+            transform: translate(-50%, -50%);
+            -webkit-transform-origin: 0 0;
+            transform-origin: 0 0;
+            visibility: visible;
+            margin: 0;
+            top: 45%;
+            z-index: 2000
+        }
     </style>
 </head>
 <span hidden="hidden" id="id"></span>

+ 9 - 0
whepi-ui/templates/home/ribao.ftl

@@ -799,6 +799,15 @@
 
 
                 </div>
+
+                <!-- loading toast -->
+                <div id="loadingToast" style="display: none;">
+                    <div class="weui-mask_transparent"></div>
+                    <div class="weui-toast">
+                        <i class="weui-loading weui-icon_toast"></i>
+                        <p class="weui-toast__content">数据处理中</p>
+                    </div>
+                </div>
             </div>
         </div>
     </div>

+ 14 - 0
whepi-ui/templates/home/ribao.js

@@ -2930,6 +2930,7 @@ function inoculateVacc() {
         $.alert("请选择是否接种新冠疫苗")
         return;
     }
+    loadingShow()
     $.ajax({
         url: '/home/addVaccine',
         type: "post",
@@ -2937,13 +2938,26 @@ function inoculateVacc() {
         contentType: "application/json",
         data: JSON.stringify(date),
         success: function (data) {
+            loadingHide()
             if (data.success) {
                 $.alert("提交成功");
             }
         },
+        error: function(){
+            loadingHide()
+            $.alert("提交失败,请重试");
+        }
     });
 }
 
+function loadingShow() {
+    $('#loadingToast').fadeIn(100);
+}
+
+function loadingHide() {
+    $('#loadingToast').fadeOut(100);
+}
+
 Date.prototype.format = function (fmt) {
     var o = {
         "M+": this.getMonth() + 1,                 //月份