Sfoglia il codice sorgente

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

# Conflicts:
#	website/src/main/resources/templates/index.html
5 anni fa
parent
commit
366ee3f0ed

+ 0 - 2
website/src/main/java/com/hssx/website/controller/ArticleController.java

@@ -2,10 +2,8 @@ package com.hssx.website.controller;
 
 
 import com.hssx.website.entity.Comment;
-import com.hssx.website.entity.Cooperations;
 import com.hssx.website.service.ArticleService;
 import com.hssx.website.service.CommentService;
-import com.hssx.website.service.CooperationsService;
 import com.hssx.website.until.HttpRespMsg;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;

+ 33 - 4
website/src/main/resources/templates/about.html

@@ -209,7 +209,7 @@
                             </div>
                         </div>
                         <div class="col-md-8 mx-auto">
-                            <form>
+                            <!--<form>-->
                                 <div class="row">
                                     <div class="col-sm-6">
                                         <div class="form-group">
@@ -230,10 +230,11 @@
                                         </div>
                                     </div>
                                     <div class="col-sm-12 text-center">
-                                        <button type="submit" class="btn btn-template-outlined"><i class="fa fa-envelope-o"></i> 发送</button>
+                                        <button id="sub" class="btn btn-template-outlined">
+                                            <i class="fa fa-envelope-o"></i> 发送</button>
                                     </div>
                                 </div>
-                            </form>
+                            <!--</form>-->
                         </div>
                     </div>
                 </section>
@@ -281,6 +282,34 @@
         <script src="vendor/bootstrap-select/js/bootstrap-select.min.js"></script>
         <script src="vendor/jquery.scrollto/jquery.scrollTo.min.js"></script>
         <script src="js/front.js"></script>
-    <script></script>
+    <script>
+        $(function(){
+            //按钮单击时执行
+            $("#sub").click(function(){
+                //Ajax调用处理
+                console.log(1111)
+                var name = $("#name").val();
+                var phone = $("#phone").val();
+                var comment = $("#message").val();
+                $.ajax({
+                    type: "POST",
+                    url: "/add",
+                    data: {name:name,phone:phone,comment:comment},
+                    dataType: "json",
+                    success: function(result){
+                        if(name == "" || phone == ""){
+                            alert("姓名和手机号不可为空!");
+                            return;
+                        }
+                        if(result.code == "ok"){
+                            console.log(result.data)
+                                alert("添加成功!");
+                        }
+                    }
+                });
+
+            });
+        });
+    </script>
     </body>
 </html>

+ 2 - 2
website/src/main/resources/templates/index.html

@@ -260,7 +260,7 @@
             <div class="row">
                 <div class="col-lg-3" th:each="item : ${articles}">
                     <div class="home-blog-post">
-                        <div class="image" style="text-align: center"><img th:src="${{item.imageUrl}}" src="img/portfolio-4.jpg" alt="..."
+                        <div class="image" style="text-align: center"><img  src="img/portfolio-4.jpg" alt="..."
                                                                            class="img-fluid">
                             <!--<div class="overlay d-flex align-items-center justify-content-center">-->
                             <!--<a href="#" class="btn btn-template-outlined-white">-->
@@ -272,7 +272,7 @@
                                 <!--By <a href="#">John Snow</a> in <a href="blog.html">Webdesign</a>-->
                             </p>
                             <!--这里的 th:utext 是对html标签进行转译 -->
-                            <p class="intro" th:utext="${{item.content}}">Fifth abundantly made Give sixth hath. Cattle
+                            <p class="intro" th:utext="${{item.introduction}}">Fifth abundantly made Give sixth hath. Cattle
                                 creature i be don't them behold green moved fowl Moved life us beast good yielding. Have
                                 bring.</p>
                             <!--<a href="#" class="btn btn-template-outlined">Continue Reading</a>-->

+ 0 - 2
website/src/main/resources/templates/js/front.js

@@ -9,11 +9,9 @@ $(function () {
         if ($(window).scrollTop() > ($('.top-bar').outerHeight())) {
             $('header.nav-holder.make-sticky').addClass('sticky');
             $('body').css('padding-top', '' + $('#navbar').outerHeight() + 'px');
-            console.log(11111)
         } else {
             $('header.nav-holder.make-sticky').removeClass('sticky');
             $('body').css('padding-top', '0');
-            console.log(2)
         }
         console.log($(window).scrollTop())
         if($(window).scrollTop() >= $('.owl-stage').height() - 10) {