Преглед изворни кода

增加前台点击搜索功能

shicr пре 8 година
родитељ
комит
4b95de641c

+ 0 - 38
donate-service/src/main/java/com/uas/service/donate/controller/MessageSendController.java

@@ -1,38 +0,0 @@
-package com.uas.service.donate.controller;
-
-
-import com.uas.service.donate.service.MessageService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 发送消息提醒
- * Created by dongbw
- * 17/09/28 17:23.
- */
-@Controller
-@RequestMapping("/message")
-public class MessageSendController {
-
-    @Autowired
-    private MessageService messageService;
-
-    /**
-     * 发送邮件接口
-     */
-    public ResponseEntity<String> sendMail (String receivedMail, Map<String, Object> model) {
-        return messageService.sendMail(receivedMail, model);
-    }
-
-    /**
-     * 发送短信接口
-     */
-    public ResponseEntity<String> sendMessage(String receiverTel, List<Object> obj) {
-        return messageService.sendMessage(receiverTel, obj);
-    }
-}

+ 1 - 1
donate-service/src/main/java/com/uas/service/donate/dao/ProjectDao.java

@@ -63,7 +63,7 @@ public interface ProjectDao extends JpaRepository<Project,Long>,JpaSpecification
     /**
      * 查询出所有的项目分类
      */
-    @Query("select distinct(p.area) from Project p")
+    @Query("select distinct(p.area) from Project p where p.area is Not NULL")
     List<String> allArea();
 
     /**

+ 0 - 1
donate-service/src/main/java/com/uas/service/donate/model/User.java

@@ -1,6 +1,5 @@
 package com.uas.service.donate.model;
 
-import org.springframework.stereotype.Controller;
 
 import javax.persistence.*;
 import java.io.Serializable;

+ 69 - 30
donate-service/src/main/resources/templates/index.ftl

@@ -102,6 +102,10 @@
         .banner img{
             width: 100%;
         }
+        .carousel-inner>.item>a>img, .carousel-inner>.item>img, .img-responsive, .thumbnail a>img, .thumbnail>img{
+            max-width: 820px;
+            max-height: 340px;
+        }
         .banner .carousel-indicators{
             bottom: 0;
             text-align: center;
@@ -380,6 +384,20 @@
         .section2 .list-item a.donation:hover{
             background: #be3b1b;
         }
+        .section2 .list-item a.donationOver{
+            display: inline-block;
+            width: 190px;
+            height: 30px;
+            line-height: 30px;
+            font-size: 14px;
+            text-align: center;
+            background: #a0a0a0;
+            color: #fff;
+            cursor: pointer;
+        }
+        .section2 .list-item a.donationOver:hover{
+            background: #a0a0a0;
+        }
         .section2 .page{
             margin-top: 35px;
         }
@@ -422,7 +440,7 @@
             position: fixed;
             background-color: white;
             width: 480px;
-            /* height: 330px; */
+            /*height: 330px;*/
             text-align: center;
             /* border: 1px solid #e1e1e1; */
             display: none;
@@ -620,6 +638,23 @@
         .show{
             display: block;
         }
+        #kkpager {
+            margin-bottom: 130px!important;
+        }
+        #carousel-fragment li {
+            width: 12px;
+            height: 12px;
+            margin: 3px;
+        }
+        #carousel-fragment .carousel-indicators{
+            bottom: 5px;
+        }
+        .carousel-control:focus, .carousel-control:hover {
+            cursor: pointer;
+        }
+        .carousel-control:focus, .carousel-control:hover {
+            cursor: pointer;
+        }
     </style>
 </head>
 <script type="text/javascript" src="static/js/jquery-1.9.1.min.js"></script>
@@ -643,23 +678,30 @@
             <!--banner&ndash;&gt;-->
             <div class="banner">
                 <div id="myCarousel" class="carousel slide">
-                    <!-- 轮播(Carousel)指标 &ndash;&gt;-->
-                    <ol class="carousel-indicators">
-                        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
-                        <li data-target="#myCarousel" data-slide-to="1"></li>
-                        <li data-target="#myCarousel" data-slide-to="2"></li>
-                    </ol>
-                    <!-- 轮播(Carousel)项目 &ndash;&gt;-->
-                    <div class="carousel-inner">
-                        <div class="item active"><img src="static/images/index/banner01.png"/></div>
-                        <div class="item"><img src="static/images/index/banner01.png"/></div>
-                        <div class="item"><img src="static/images/index/banner01.png"/></div>
-                    </div>
-                    <!-- 轮播(Carousel)导航 &ndash;&gt;-->
-                    <a class="carousel-control left" href="#myCarousel"
-                       data-slide="prev">&lsaquo;</a>
-                    <a class="carousel-control right" href="#myCarousel"
-                       data-slide="next">&rsaquo;</a>
+                 <#--   <!-- 轮播(Carousel)指标 &ndash;&gt;-->
+                    <#--<ol class="carousel-indicators">-->
+                        <#--<li data-target="#myCarousel" data-slide-to="0" class="active"></li>-->
+                        <#--<li data-target="#myCarousel" data-slide-to="1"></li>-->
+                        <#--<li data-target="#myCarousel" data-slide-to="2"></li>-->
+                    <#--</ol>-->
+                     <#if carouselList?exists>
+                         <#list carouselList as carousel>
+                         <ol class="carousel-indicators">
+                             <li  class="active"></li>
+                         </ol>
+                             <div class="carousel-inner">
+                                 <div class="item active"><img src="${carousel.pictureUrl}"/></div>
+                                 <div class="item"><img src="${carousel.pictureUrl}"/></div>
+                             </div>
+                         </#list>
+                     </#if>
+
+                   <#--     <!-- 轮播(Carousel)导航 &ndash;&gt;-->
+                        <a class="carousel-control left" href="#myCarousel"
+                           data-slide="prev">&lsaquo;</a>
+                        <a class="carousel-control right" href="#myCarousel"
+                           data-slide="next">&rsaquo;</a>
+
                 </div>
             </div>
             <!--personal-center&ndash;&gt;-->
@@ -723,7 +765,7 @@
                 </div>
                 <div class="form-group form-groups">
                     <input type="text" class="form-control" placeholder="请输入关键词" id="search"/>
-                    <img src="static/images/index/search.png" alt=""/>
+                    <img src="static/images/index/search.png" alt="" id="searchButton"/>
                 </div>
             </div>
             <#if page?exists>
@@ -750,7 +792,7 @@
                 <!--弹出窗-->
                 <div class="pop">
                     <div class="header clearfix">
-                        <p class="fl">${project.name}</p>
+                        <p class="fl">${project.name!''}</p>
                         <div class="close fr" class="close">&times;</div>
                     </div>
                     <div class="body">
@@ -787,15 +829,6 @@
             </div>
             </#list>
             </#if>
-            <#--<div id="hover-background" style="display: none">-->
-                <#--<div class="x-floating-wrap"></div>-->
-                <#--<div class="x-floating">-->
-                    <#--<div id="item-content">-->
-                        <#--<div class="x-close-wrap"><a href="javascript:void(0);">&times;</a></div>-->
-                        <#--<div class="modal"></div>-->
-                    <#--</div>-->
-                <#--</div>-->
-            <#--</div>-->
            <#-- 分页按钮-->
             <div id="kkpager"></div>
         </div>
@@ -919,7 +952,7 @@
         window.location.href="http://lj.ubtob.com/index?area="+area+"&&status="+status;
     })
 
-    //input搜索框查询项目
+    //搜索框enter键搜索框查询项目
     $("#search").keydown(function(event){
       if(event.keyCode==13){
           var search=$("#search").val();
@@ -927,6 +960,12 @@
       }
     })
 
+    //搜索框按钮点击查询项目
+    $("#searchButton").click(function(){
+        var search=$("#search").val();
+        window.location.href="http://lj.ubtob.com/index?search="+search;
+    })
+
     //选择金额
     var money = 1;
     $('#choose-money li').on('click', function (event) {