Bläddra i källkod

'页面接口调用'

yuwenjun 4 år sedan
förälder
incheckning
2ab386781d

+ 7 - 5
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -24,7 +24,7 @@ public class ProductController extends BaseController {
 	private static final String PROMOTIONS_LIST_PATH = "product/promotions";
     private static final String INSTRUMENT_PAGE_PATH = "product/instrument";
     private static final String INSTRUMENT_LIST_PATH = "product/instruelist";
-    private static final String PRODUCT_QUALITY_AUTHORIZE = "product/qualityauthorize";
+    private static final String QUALITY_AUTHORRIZE_PATH = "product/qualityauthorize";
     /** 美博会专题页 */
     private static final String BEAUTY_TOP_PATH = "product/beautytopic";
 
@@ -87,12 +87,14 @@ public class ProductController extends BaseController {
     public String beautytopic() {
         return BEAUTY_TOP_PATH;
     }
+
     /**
-     * 正品联盟授权
+     * 正品联盟品牌授权商品详情页
      */
-    @GetMapping("/product/qualityauthorize.html")
-    public String qualityauthorize() {
-        return PRODUCT_QUALITY_AUTHORIZE;
+    @GetMapping("product/auth/product-{id}.html")
+    public String authorization(final Model model, @PathVariable("id") Integer productId) {
+        model.addAttribute("productId", productId);
+        return QUALITY_AUTHORRIZE_PATH;
     }
 
 }

+ 4 - 5
src/main/resources/static/js/product/qualityauthorize.js

@@ -48,7 +48,6 @@ var qualityAuthorize = new Vue({
                 this.statementContent = '采美声明!'
             }
             this.showStatement = true;
-            console.log('代理声明...')
         }
     },
     // created:function() {
@@ -58,9 +57,9 @@ var qualityAuthorize = new Vue({
     //     })
     // }
     mounted:function () {
-        //根据hash值获取产品id
-        var hash = window.location.hash;
-        this.productId = hash.slice(1,hash.length);
-        this.initParams()
+        //根据地址获取产品id
+        var pathname = window.location.pathname;
+        this.productId = pathname.split('-')[1].split('.')[0];
+        this.initParams();
     }
 });