Ver código fonte

页面类容调整

chao 3 anos atrás
pai
commit
0e069a60d1

+ 14 - 5
src/main/java/com/overseas/website/controller/PageController.java

@@ -7,10 +7,8 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -62,6 +60,7 @@ public class PageController {
             product = JSONObject.parseObject(String.valueOf(floorMap.get("data")), Map.class);
         } catch (Exception e) {
             System.out.println(e);
+            return "404";
         }
         model.addAttribute("product", product);
         return "product";
@@ -71,10 +70,10 @@ public class PageController {
      * 商品列表页面
      */
     @GetMapping("/list/{id}.html")
-    public String page(final Model model, @PathVariable("id") String pageId, @RequestParam("title") String pageTitle) {
+    public String page(final Model model, @PathVariable("id") String pageId, String title) {
         model.addAttribute("path", "list");
         model.addAttribute("pageId", pageId);
-        model.addAttribute("pageTitle", pageTitle);
+        model.addAttribute("pageTitle", title);
             try {
                 String productResult = RequestUtil.sendGet("https://core.caimei365.com/commodity/search/query/product/type?idType=1&id="+pageId);
                 Map<String, Object> productMap = JSONObject.parseObject(productResult, Map.class);
@@ -84,8 +83,18 @@ public class PageController {
                 model.addAttribute("productList", productList);
             } catch (Exception e) {
                 System.out.println(e);
-                model.addAttribute("productList", new JSONArray());
+                return "404";
             }
         return "list";
     }
+
+    /**
+     *  404
+     */
+    @GetMapping("/error")
+    public String errorPage(final Model model) {
+        model.addAttribute("msg", "404页面");
+        return "404";
+    }
+
 }

+ 5 - 0
src/main/resources/static/css/style.css

@@ -119,6 +119,11 @@ blockquote::before {
 	content: url('../image/quote-item.png');
 	display: block;
 }
+.logo {
+	font-size: 1.5em;
+	color: #dd3232;
+	font-weight: bold;
+}
 /* ==========================================================================
   1.1 FORM
 ============================================================================ */

+ 1 - 1
src/main/resources/templates/404.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <title>Dungar - Login</title>
+    <title>YMB2B - Login</title>
     <template th:replace="components/head-link"></template>
 </head>
 <body class="inblog-page">

+ 1 - 1
src/main/resources/templates/about.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <title>Dungar - About</title>
+    <title>YMB2B - About</title>
     <template th:replace="components/head-link"></template>
 </head>
 <body class="about-page">

+ 2 - 2
src/main/resources/templates/components/footer.html

@@ -1,8 +1,8 @@
 <footer class="footer style7">
     <div class="dungar-iconbox-wrapp default">
         <div class="dungar-iconbox  default center">
-            <p>Copyright © 2015-2021 CAIMEI666.com All Rights Reserved.Shenzhen Caimei E-commerce Network Information Co., Ltd.</p>
-            <p>Guangdong B1-20190322 Record number Guangdong ICP No. 16513624 Value-added telecommunications business license of the People’s Republic of China</p>
+            <p>Copyright © 2015-2021 YMB2B.COM All Rights Reserved.</p>
+            <!--<p>Guangdong B1-20190322 Record number Guangdong ICP No. 16513624 Value-added telecommunications business license of the People’s Republic of China</p>-->
         </div>
     </div>
 </footer>

+ 16 - 14
src/main/resources/templates/components/header.html

@@ -3,11 +3,11 @@
         <div class="container">
             <div class="top-bar-left">
                 <div class="header-message">
-                    Welcome to XX e-commerce platform
+                    Welcome to YMB2B.COM !
                 </div>
             </div>
             <div class="top-bar-right">
-                <div class="header-language">
+                <!--<div class="header-language">
                     <div class="dungar-language dungar-dropdown">
                         <a href="#" class="active language-toggle" data-dungar="dungar-dropdown">
                             <span>English</span>
@@ -25,10 +25,10 @@
                             </li>
                         </ul>
                     </div>
-                </div>
+                </div>-->
                 <ul class="header-user-links">
                     <li>
-                        <a href="login.html">Login or Register</a>
+                        <a href="/login.html">Login or Register</a>
                     </li>
                 </ul>
             </div>
@@ -40,7 +40,8 @@
                 <div class="col-lg-3 col-sm-4 col-md-3 col-xs-7 col-ts-12 header-element">
                     <div class="logo">
                         <a href="/index.html">
-                            <img src="/picture/logo.png" alt="img">
+                            YMB2B.COM
+                            <!--<img src="/picture/logo.png" alt="img">-->
                         </a>
                     </div>
                 </div>
@@ -61,13 +62,13 @@
                 </div>
                 <div class="col-lg-2 col-sm-12 col-md-3 col-xs-12 col-ts-12">
                     <div class="header-control">
-<!--                        <div class="block-minicart dungar-mini-cart block-header dungar-dropdown">-->
-<!--                            <a href="javascript:void(0);" class="shopcart-icon" data-dungar="dungar-dropdown">-->
-<!--                                Cart<span class="count">0</span>-->
-<!--                            </a>-->
-<!--                        </div>-->
+                        <!--<div class="block-minicart dungar-mini-cart block-header dungar-dropdown">
+                            <a href="javascript:void(0);" class="shopcart-icon" data-dungar="dungar-dropdown">
+                                Cart<span class="count">0</span>
+                            </a>
+                        </div>-->
                         <div class="block-account block-header dungar-dropdown">
-                            <a href="login.html">
+                            <a href="/login.html">
                                 <span class="flaticon-user"></span>
                             </a>
                         </div>
@@ -152,7 +153,8 @@
         <div class="item mobile-logo">
             <div class="logo">
                 <a href="/index.html">
-                    <img src="/picture/logo.png" alt="img">
+                    YMB2B.COM
+                    <!--<img src="/picture/logo.png" alt="img">-->
                 </a>
             </div>
         </div>
@@ -176,7 +178,7 @@
                 </div>
             </div>
         </div>
-        <div class="item mobile-settings-box has-sub">
+        <!--<div class="item mobile-settings-box has-sub">
             <a href="#">
                     <span class="icon">
                         <i class="fa fa-cog" aria-hidden="true"></i>
@@ -204,7 +206,7 @@
                     </form>
                 </div>
             </div>
-        </div>
+        </div>-->
         <div class="item menu-bar">
             <a class=" mobile-navigation  menu-toggle" href="#">
                 <span></span>

+ 1 - 1
src/main/resources/templates/help.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <title>Dungar - Help</title>
+    <title>YMB2B - Help</title>
     <template th:replace="components/head-link"></template>
 </head>
 <body class="about-page">

+ 1 - 1
src/main/resources/templates/index.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <title>Dungar - Home</title>
+    <title>YMB2B - Home</title>
     <template th:replace="components/head-link"></template>
 </head>
 <body class="home">

+ 1 - 1
src/main/resources/templates/list.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <title th:text="${pageTitle}"></title>
+    <title th:text="'YMB2B - '+${pageTitle}"></title>
     <template th:replace="components/head-link"></template>
 </head>
 <body class="home">

+ 1 - 1
src/main/resources/templates/login.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <title>Dungar - Login</title>
+    <title>YMB2B - Login</title>
     <template th:replace="components/head-link"></template>
 </head>
 <body class="inblog-page">

+ 3 - 3
src/main/resources/templates/product.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <title th:text="${product.get('name')}"></title>
+    <title th:text="'YMB2B - '+${product.get('name')}"></title>
     <template th:replace="components/head-link"></template>
 </head>
 <body class="inblog-page">
@@ -50,7 +50,7 @@
                                     <li>Art.No. 0755-22907771</li>
                                 </ul>
                             </div>
-                            <div class="variations">
+                            <!--<div class="variations">
                                 <div class="attribute attribute_color">
                                     <div class="color-text text-attribute">
                                         Color:
@@ -75,7 +75,7 @@
                                         <a href="#" class="">xxl</a>
                                     </div>
                                 </div>
-                            </div>
+                            </div>-->
                             <div class="group-button">
                                 <div class="yith-wcwl-add-to-wishlist">
                                     <div class="yith-wcwl-add-button">