chao преди 5 години
родител
ревизия
31cba2ff7f

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

@@ -3,6 +3,7 @@ package com.caimei.www.controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestParam;
 
 /**
  * 兼容旧链接
@@ -19,6 +20,20 @@ public class RedirectController {
 	public String toProduct(@PathVariable("id") Integer productId) {
 		return "redirect:/product/detail.html?id=" + productId;
 	}
+	/**
+	 * 供应商首页【旧】
+	 */
+	@GetMapping("/supplier/prolist-{id}.html")
+	public String toSupplier(@PathVariable("id") Integer supplierId) {
+		return "redirect:/supplier/index.html?id=" + supplierId;
+	}
+	/**
+	 * 供应商商品页【旧】
+	 */
+	@GetMapping("/supplier/productlist-{id}.html")
+	public String toSupplierProduct(@PathVariable("id") Integer supplierId, @RequestParam("brandID") Integer brandId) {
+		return "redirect:/supplier/product.html?id=" + supplierId +"&brandId=" + brandId;
+	}
 	/**
 	 * 二级页面(找产品/找仪器/找项目/正品联盟)【旧】
 	 */

+ 11 - 0
src/main/java/com/caimei/www/controller/unlimited/SupplierController.java

@@ -25,6 +25,7 @@ public class SupplierController extends BaseController {
 
 	private static final String SUPPLIER_LIST_PATH = "supplier/list";
 	private static final String SUPPLIER_INDEX_PATH = "supplier/index";
+	private static final String SUPPLIER_PRODUCT_PATH = "supplier/product";
 
     private SupplierService supplierService;
     @Autowired
@@ -50,6 +51,16 @@ public class SupplierController extends BaseController {
         return SUPPLIER_INDEX_PATH;
     }
 
+    /**
+     * 供应商首页
+     */
+    @GetMapping("/supplier/product.html")
+    public String product(final Model model, @RequestParam("id") Integer supplierId, @RequestParam("brandID") Integer brandId) {
+        SupplierDetail detail = supplierService.getSupplierById(supplierId);
+        model.addAttribute("supplier", detail);
+        return SUPPLIER_PRODUCT_PATH;
+    }
+
     /**
      * 供应商-轮播图片
      * @return

+ 1 - 1
src/main/resources/static/css/single-page/promotions.css

@@ -8,7 +8,7 @@ li{list-style:none}
     .promotions a{display:block;font-size:20px;}
     .promotions img{display:block;width:100%;height:auto}
     .promotions p{position:absolute;left:0;bottom:0;width:100%;height:48px;line-height:48px;box-sizing:border-box;padding:0 360px 0 16px;background:rgba(255,255,255,.8);color:#E15616;}
-    .promotions .time{position:absolute;right:0;color:#FFF;height:48px;line-height:48px;padding:0 16px;background-color:#F94B4B;background:-webkit-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:-moz-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:-o-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:-ms-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);opacity:.8}
+    .promotions .time{position:absolute;right:0;bottom:0;color:#FFF;height:48px;line-height:48px;padding:0 16px;background-color:#F94B4B;background:-webkit-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:-moz-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:-o-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:-ms-linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);background:linear-gradient(135deg,rgba(249,75,75,1) 0%,rgba(188,60,255,1) 100%);opacity:.8}
     .promotions .finish{position:absolute;left:0;bottom:0;width:100%;height:100%;background:rgba(255,255,255,.8) url(/img/common/act-end.png) no-repeat center center}
 
 

+ 25 - 0
src/main/resources/static/js/supplier/product.js

@@ -0,0 +1,25 @@
+var supplierHome = new Vue({
+    el: "#supplierHome",
+    data: {
+        userId: 0,
+        supplierId: 0,
+        brandId: 0,
+
+    },
+    computed: {
+
+    },
+    methods: {
+
+    },
+    created: function () {
+        this.supplierId = getUrlParam("id") ? getUrlParam("id") * 1 : 0;
+        this.brandId = getUrlParam("brandId") ? getUrlParam("brandId") * 1 : 0;
+    },
+    mounted: function () {
+        var _self = this;
+        $('body').on("click", '.showSearch', function(){
+            $('.supplierTit .search').show();
+        })
+    }
+});

+ 39 - 0
src/main/resources/templates/supplier/product.html

@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="https://www.thymeleaf.org ">
+<head>
+    <title th:text="'采美365网-'+${supplier.name}">采美365网-供应商首页</title>
+    <template th:replace="components/head-link"></template>
+    <link th:href="@{/css/supplier/index.css(v=${version})}" rel="stylesheet" type="text/css">
+</head>
+<body>
+<!-- 引用头部 -->
+<template th:replace="components/header"></template>
+
+<!-- 供应商首页 -->
+<div id="supplierProduct">
+    <div class="supplierTit">
+        <div class="title">
+            <img th:src="${supplier.logo}">
+            <h1 th:text="${supplier.name}"></h1>
+            <a href="javascript:void(0);"><i class="icon mIcon shop"><em class="tips">点击查看授权牌照</em></i></a>
+        </div>
+        <div class="search">
+            <input class="keyword" type="text" placeholder="请输入商品名称(商铺内商品)">
+            <a class="searchBtn icon mIcon" href="javascript:void(0);"></a>
+        </div>
+    </div>
+
+    <!--主体内容-->
+    <div>
+
+    </div>
+
+</div>
+
+<!-- 引入底部 -->
+<template th:replace="components/footer"></template>
+<template th:replace="components/foot-link"></template>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/supplier/product.js(v=${version})}"></script>
+</body>
+</html>