Explorar o código

Update留言墙优化

YueYunyun %!s(int64=2) %!d(string=hai) anos
pai
achega
6ed9563c98

+ 8 - 7
YZXYH2017/YZXYH2017/Views/MessageWall/Index.cshtml

@@ -67,13 +67,14 @@
             height: 50px;
             padding: 5px 10px;
         }
-        .item .avatar {
-            width: 35px;
-            height: 35px;
-            border-radius: 50%;
-            display: block;
-            float: left;
-        }
+            .item .avatar {
+                width: 35px;
+                height: 35px;
+                border-radius: 50%;
+                display: block;
+                float: left;
+                background-size: 100%;
+            }
         .item .name {
             margin-left: 15px;
             display: block;

+ 13 - 1
YZXYH2017/YZXYH2017/Views/MessageWall/Write.cshtml

@@ -163,7 +163,7 @@
     </div>
     <script src="~/Content/js/content.min.js"></script>
 
-    <script>
+<script>
     var nickName = "@(nickName)",msgType=0;
     $(function() {
         $('#isHide').on("change",function() {
@@ -208,6 +208,8 @@
         "hideMethod": "fadeOut"
     }
     function WriteMsg() {
+        $('#Save').prop("disabled", true);
+     
         var formData= new FormData();
         formData.append('MsgContent' , $('#msgContent').val());
         formData.append('Mobile' , $('#mobile').val());
@@ -249,6 +251,16 @@
                 window.toastr["error"]("留言失败");
             }
         });
+        var delay = 10;
+        var timer = setInterval(function df() {
+            delay--;
+            $('#Save').html("等待 " +delay+ "s")
+            if (delay == 0) {
+                $('#Save').html("发布留言")
+                $('#Save').prop("disabled", false);
+                clearInterval(timer);
+            } 
+        }, 1000)
     }
     </script>