Selaa lähdekoodia

维修保养part2

chao 4 vuotta sitten
vanhempi
commit
4120aabbcb

+ 15 - 1
src/main/java/com/caimei/www/controller/RedirectController.java

@@ -51,10 +51,24 @@ public class RedirectController {
 	 * 专题活动列表页【旧】
 	 */
 	@GetMapping("/cmpage/area.html")
-	public String toPpromotions() {
+	public String toPromotions() {
 		return "redirect:/promotions.html";
 	}
 
+    /**
+     * 品牌招商介绍页【旧】
+     */
+	@GetMapping("/html/InvestmentCaiMei/investmentpage.jsp")
+	public String toInvestment() {
+		return "redirect:/investment.html";
+	}
 
+    /**
+     * 维修保养介绍页【旧】
+     */
+    @GetMapping("/html/maintenance/view/mt-entry-index.jsp")
+    public String toMaintenance() {
+		return "redirect:/maintenance/index.html";
+	}
 
 }

+ 17 - 0
src/main/resources/static/css/maintenance/index.css

@@ -4,6 +4,15 @@ li{list-style:none}
  * PC端
  */
 @media screen and (min-width:768px){
+.title{height:24px;line-height:24px;padding-left:10px;border-left:4px solid #E15616;margin:32px 0 16px 0;font-size:24px;color:#4A4F58;font-weight:bold;text-align:left}
+.title .btn{float:right;width:128px;height:32px;line-height:32px;color:#FFF;background:#E15616;font-size:14px;text-align:center;font-weight:normal;margin-top:-8px}
+.title .btn:hover{opacity:.8}
+.content{width:1184px;margin:0 auto;background:#FFF}
+.content img{display:block;width:100%}
+.content .btnBox{height:214px}
+.fixedBtn{display:block;width:706px;height:214px;margin:0 auto;background:url(/img/maintenance/btn.png) no-repeat center center;cursor:pointer}
+.fixedBtn,.fixedBtn:hover{color:transparent}
+.fixedBtn.fixed{position:fixed;right:50%;margin-right:-353px;bottom:0}
 
 
 }
@@ -12,6 +21,14 @@ li{list-style:none}
 * 移动端
 */
 @media screen and (max-width:768px){
+.title{height:10vw;line-height:10vw;padding-left:10px;font-size:3.7vw;color:#4A4F58;background:#FFF;font-weight:bold;text-align:center}
+.title .btn{display:none}
+.content{width:100vw;margin:0 auto;background:#FFF}
+.content img{display:block;width:100%}
+.content .btnBox{height:21.4vw}
+.fixedBtn{display:block;width:70.6vw;height:21.4vw;margin:0 auto;background:url(/img/maintenance/btn.png) no-repeat center center;background-size:100%;cursor:pointer}
+.fixedBtn,.fixedBtn:hover{color:transparent}
+.fixedBtn.fixed{position:fixed;right:50%;margin-right:-35.3vw;bottom:0}
 
 
 }

+ 23 - 17
src/main/resources/static/js/maintenance/index.js

@@ -1,18 +1,24 @@
-var maintenance = new Vue({
-    el: "#maintenance",
-    data: {
-
-    },
-    computed: {
-
-    },
-    methods: {
-
-    },
-    created: function () {
-
-    },
-    mounted: function () {
-        var _self = this;
-    }
+$(function(){
+    if(!isPC){$('.fixedBtn').addClass("fixed");}
+    $(window).scroll(function () {
+        if($('body').attr("style") && $('body').attr("style").indexOf('fixed')>0){
+            return false;
+        }
+        var scoll = Math.max($('html').scrollTop(), $('body').scrollTop());
+        if(isPC){
+            var bottom = $("footer").offset().top - $("footer").height() - 410;
+            if(scoll>200 && scoll<bottom){
+                $('.fixedBtn').addClass("fixed");
+            }else {
+                $('.fixedBtn').removeClass("fixed");
+            }
+        }else{
+            var bottom = $("footer").offset().top - $("footer").height();
+            if(scoll<bottom){
+                $('.fixedBtn').addClass("fixed");
+            }else {
+                $('.fixedBtn').removeClass("fixed");
+            }
+        }
+    });
 });

+ 4 - 3
src/main/resources/templates/components/header.html

@@ -106,14 +106,15 @@
                 <ul class="clear">
                     <!--导航菜单-->
                     <li th:each="menu: ${topMenuList}">
-                        <a class="nav" href="javascript:void(0);" th:text="${menu.name}"></a>
+                        <a th:if="${menu.link}" class="nav" th:href="${menu.link}" th:text="${menu.name}"></a>
+                        <a th:unless="${menu.link}" class="nav" href="javascript:void(0);" th:text="${menu.name}"></a>
                         <div th:if="${not #lists.isEmpty(menu.subMenus)}">
-                            <a th:each="sub: ${menu.subMenus}" href="javascript:void(0);" th:text="${sub.name}"></a>
+                            <a th:each="sub: ${menu.subMenus}" th:href="${sub.link}" th:text="${sub.name}"></a>
                         </div>
                     </li>
                 </ul>
             </div>
-            <a class="service nav" href="/">维修</a>
+            <a class="service nav" href="/maintenance/index.html">维修</a>
         </div>
         <div id="mainClassify" class="classifyBox mFixed">
             <div v-if="!isPC" class="clsHead clear">

+ 4 - 2
src/main/resources/templates/maintenance/index.html

@@ -15,12 +15,14 @@
     <div class="wrap">
         <h1 class="title">
             <span>采美仪器维修介绍</span>
-            <a href="javascript:void(0);" class="btn">申请维修</a>
+            <a href="/maintenance/form.html" class="btn">申请维修</a>
         </h1>
         <div class="content">
             <img src="/img/maintenance/maintenance.jpg" alt="采美仪器维修介绍">
+            <div class="btnBox">
+                <a href="/maintenance/form.html" class="fixedBtn">申请维修</a>
+            </div>
         </div>
-        <div class="fixedBtn"></div>
     </div>
 </div>