chao 4 rokov pred
rodič
commit
c2c8802b45

+ 0 - 7
src/main/java/com/caimei/www/controller/RedirectController.java

@@ -13,13 +13,6 @@ import org.springframework.web.bind.annotation.RequestParam;
  */
 @Controller
 public class RedirectController {
-	/**
-	 * 商品详情【旧】
-	 */
-	@GetMapping("/product-{id}.html")
-	public String toProduct(@PathVariable("id") Integer productId) {
-		return "redirect:/product/detail.html?id=" + productId;
-	}
 	/**
 	 * 供应商首页【旧】
 	 */

+ 1 - 1
src/main/java/com/caimei/www/controller/authorized/supplier/PageController.java → src/main/java/com/caimei/www/controller/authorized/supplier/SupplierPageController.java

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping;
  * @date : 2020/8/27
  */
 @Controller
-public class PageController extends BaseController {
+public class SupplierPageController extends BaseController {
     /** 我的采美 */
 	private static final String DASHBOARD = "supplier-center/dashboard";
     /** 订单列表 */

+ 1 - 1
src/main/java/com/caimei/www/controller/authorized/user/PageController.java → src/main/java/com/caimei/www/controller/authorized/user/UserPageController.java

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping;
  * @date : 2020/8/27
  */
 @Controller
-public class PageController extends BaseController {
+public class UserPageController extends BaseController {
     /** 我的采美 */
 	private static final String DASHBOARD = "user-center/dashboard";
     /** 订单列表 */

+ 4 - 8
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -1,18 +1,14 @@
 package com.caimei.www.controller.unlimited;
 
 import com.caimei.www.controller.BaseController;
-import com.caimei.www.pojo.JsonModel;
-import com.caimei.www.pojo.order.CartItem;
 import com.caimei.www.pojo.page.ProductDetail;
-import com.caimei.www.pojo.page.ProductList;
-import com.caimei.www.pojo.page.Parameter;
 import com.caimei.www.service.ProductService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.PathVariable;
+
 
 import java.util.List;
 
@@ -45,8 +41,8 @@ public class ProductController extends BaseController {
     /**
      * 商品详情页
      */
-    @GetMapping("/product/detail.html")
-    public String detail(final Model model, @RequestParam("id") Integer productId) {
+    @GetMapping("/product-{id}.html")
+    public String detail(final Model model, @PathVariable("id") Integer productId) {
         ProductDetail detail = productService.getProductDetailById(productId);
         model.addAttribute("product", detail);
         return PRODUCT_DETAIL_PATH;

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

@@ -57,11 +57,11 @@
                     <ul class="swiper-wrapper" v-cloak>
                         <li class="swiper-slide productItem mfc" v-for="p in recommends">
                             <div class="item">
-                                <a class="image" :href="'/product/detail.html?id='+p.id" target="_blank">
+                                <a class="image" :href="'/product-'+p.id+'.html'" target="_blank">
                                     <img :src="p.image" :alt="p.name">
                                     <span v-if="p.actType==1||p.actType==2" :class="p.actType==1?'icon mIcon hot':'icon mIcon new'"></span>
                                 </a>
-                                <a class="name" :href="'/product/detail.html?id='+p.id" target="_blank">
+                                <a class="name" :href="'/product-'+p.id+'.html'" target="_blank">
                                     <span v-html="p.name"></span>
                                 </a>
                                 <div class="price mfhc">

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

@@ -107,7 +107,7 @@
                                     </br>促销时间:{{promotions.beginTime}}~{{promotions.endTime}}
                                 </p>
                                    <div class="activepro" v-for="promotions in giftData">
-                                      <a :href="'/product/detail.shtml?id='+promotions.productId" target="_blank">
+                                      <a :href="'/product-'+promotions.productId+'.html'" target="_blank">
                                            <div class="activeimg">
                                                <img :src="promotions.image">
                                            </div>
@@ -177,17 +177,6 @@
                                     <a style="color: #E15616" href="javascript:0" class="loginWithParam">购买下列商品,满1000.00,减500.00</a>
                                     </br>促销时间:{{promotions.beginTime}}~{{promotions.endTime}}
                                 </p>
-<!--                                   <div class="activepro" v-for="promotions in giftData">-->
-<!--                                      <a :href="'/product/detail.shtml?id='+promotions.productId" target="_blank">-->
-<!--                                           <div class="activeimg">-->
-<!--                                               <img :src="promotions.image">-->
-<!--                                           </div>-->
-<!--                                           <div class="activeright">-->
-<!--                                               <p>{{promotions.name}}</p>-->
-<!--                                               <p>x1</p>-->
-<!--                                           </div>-->
-<!--                                       </a>-->
-<!--                                   </div>-->
                               <button class="activeBtn" @click="activeBtn" v-show="isShow">了解</button>
                         </div>
                         <div class="activityBox" v-show="isShow"  v-if="promotions.type==2&&promotions.mode==3">
@@ -196,20 +185,9 @@
                                     <a style="color: #E15616" href="javascript:0" class="loginWithParam">购买此商品,满1000.00</a>
                                     </br>促销时间:{{promotions.beginTime}}~{{promotions.endTime}}
                                 </p>
-<!--                                   <div class="activepro" v-for="promotions in giftData">-->
-<!--                                      <a :href="'/product/detail.shtml?id='+promotions.productId" target="_blank">-->
-<!--                                           <div class="activeimg">-->
-<!--                                               <img :src="promotions.image">-->
-<!--                                           </div>-->
-<!--                                           <div class="activeright">-->
-<!--                                               <p>{{promotions.name}}</p>-->
-<!--                                               <p>x1</p>-->
-<!--                                           </div>-->
-<!--                                       </a>-->
-<!--                                   </div>-->
                                  <p  href="javascript:0" class="loginWithParam">赠送商品:</p>
                                    <div class="activepro" v-for="promotions in giftData">
-                                      <a :href="'/product/detail.shtml?id='+promotions.productId" target="_blank">
+                                      <a :href="'/product-'+promotions.productId+'.html'" target="_blank">
                                            <div class="activeimg">
                                                <img :src="promotions.image">
                                            </div>
@@ -280,7 +258,7 @@
                 <ul class="swiper-wrapper" v-cloak>
                     <li class="swiper-slide" v-for="p in recommends">
                         <div class="item">
-                            <a class="image" :href="'/product/detail.html?id='+p.id" target="_blank">
+                            <a class="image" :href="'/product-'+p.id+'.html'" target="_blank">
                                 <img :src="p.image" :alt="p.name">
                                 <span v-html="p.name"></span>
                             </a>

+ 2 - 2
src/main/resources/templates/product/list.html

@@ -102,10 +102,10 @@
         <ul class="productList clear mfw">
             <li class="productItem mfc" v-for="p in listData">
                 <div class="item">
-                    <a class="image" :href="'/product/detail.html?id='+p.id" target="_blank">
+                    <a class="image" :href="'/product-'+p.id+'.html'" target="_blank">
                         <img :src="p.image" :alt="p.name">
                     </a>
-                    <a class="name" :href="'/product/detail.html?id='+p.id" target="_blank">
+                    <a class="name" :href="'/product-'+p.id+'.html'" target="_blank">
                         <span v-html="p.name"></span>
                     </a>
                     <div class="price mfhc">

+ 2 - 2
src/main/resources/templates/shopping/cart.html

@@ -54,11 +54,11 @@
                 </div>
                 <div class="cartItem clear"  v-for="cart in supplier.cartList">
                     <div class="c0"><input class="check" type="checkbox" name="cartList"></div>
-                    <div class="c1"><a :href="'/product/detail.html?id='+cart.productId" target="_blank">
+                    <div class="c1"><a :href="'/product-'+cart.productId+'.html'" target="_blank">
                         <img class="image" :src="cart.image">
                     </a></div>
                     <div class="c2">
-                        <a class="name" :href="'/product/detail.html?id='+cart.productId" target="_blank">
+                        <a class="name" :href="'/product-'+cart.productId+'.html'" target="_blank">
                             <i v-if="cart.ladderFlag" class="priTag">阶梯价格</i>
                             <span v-text="cart.name"></span>
                         </a>

+ 4 - 4
src/main/resources/templates/supplier/index.html

@@ -49,11 +49,11 @@
                     <ul class="productList clear mfw">
                         <li class="productItem mfc" v-for="p in mainProducts">
                             <div class="item">
-                                <a class="image" :href="'/product/detail.html?id='+p.id" target="_blank">
+                                <a class="image" :href="'/product-'+p.id+'.html'" target="_blank">
                                     <img :src="p.image" :alt="p.name">
                                     <span v-if="p.actType==1||p.actType==2" :class="p.actType==1?'icon mIcon hot':'icon mIcon new'"></span>
                                 </a>
-                                <a class="name" :href="'/product/detail.html?id='+p.id" target="_blank">
+                                <a class="name" :href="'/product-'+p.id+'.html'" target="_blank">
                                     <span v-html="p.name"></span>
                                 </a>
                                 <div class="price mfhc">
@@ -86,11 +86,11 @@
                     <ul class="productList clear mfw">
                         <li class="productItem mfc" v-for="p in productLists">
                             <div class="item">
-                                <a class="image" :href="'/product/detail.html?id='+p.id" target="_blank">
+                                <a class="image" :href="'/product-'+p.id+'.html'" target="_blank">
                                     <img :src="p.image" :alt="p.name">
                                     <span v-if="p.actType==1||p.actType==2" :class="p.actType==1?'icon mIcon hot':'icon mIcon new'"></span>
                                 </a>
-                                <a class="name" :href="'/product/detail.html?id='+p.id" target="_blank">
+                                <a class="name" :href="'/product-'+p.id+'.html'" target="_blank">
                                     <span v-html="p.name"></span>
                                 </a>
                                 <div class="price mfhc">