Przeglądaj źródła

feat:意见反馈需求调整

yangfeng 2 lat temu
rodzic
commit
c3b211d9da

+ 3 - 0
src/web/staticres/site/page/helpCenter/css/feedback.css

@@ -94,4 +94,7 @@
   text-align: center;
   font-size: 16px;
   color: #fff;
+}
+.f-btn[disabled]{
+  cursor: not-allowed;
 }

+ 15 - 2
src/web/templates/site/page/helpCenter/feedback.html

@@ -72,6 +72,14 @@
         $('.entered-count').text($(this).val().length)
       })
       $('#submit').on('click',function (){
+        if ($('#textarea').val().length < 10) {
+          showToast('请至少填写10个字的反馈,谢谢')
+          $(this).attr("disabled","disabled")
+          setTimeout(function() {
+            $('#submit').removeAttr('disabled')
+          }, 2000)
+          return
+        }
         $(this).attr("disabled","disabled")
         let content=$("textarea").val()
         let mold=$("[name='type']:checked").val()
@@ -79,9 +87,14 @@
           {mold:mold,content:content},
           function (res){
             if(res.data){
-              window.history.go(-1)
+              showToast('提交成功')
+              setTimeout(function() {
+                $('#submit').removeAttr('disabled')
+                $('#textarea').val('')
+                $('#account').prop('checked', 'checked')
+              }, 2000)
             }else {
-              alert(res.error_msg)
+              showToast(res.error_msg)
             }
         })
       })