Bläddra i källkod

Merge remote-tracking branch 'origin/developerB' into developerB

zhengjinyi 4 år sedan
förälder
incheckning
70e0596c00

+ 10 - 0
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -8,6 +8,7 @@ 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;
 
 /**
  * 商品(product)
@@ -20,6 +21,7 @@ public class ProductController extends BaseController {
 
 	private static final String PRODUCT_LIST_PATH = "product/list";
 	private static final String PRODUCT_DETAIL_PATH = "product/detail";
+	private static final String PROMOTIONS_LIST_PATH = "product/promotions";
 
     private ProductService productService;
     @Autowired
@@ -35,6 +37,14 @@ public class ProductController extends BaseController {
         return PRODUCT_LIST_PATH;
     }
 
+    /**
+     * 促销活动商品列表
+     */
+    @GetMapping("/product/promotions.html")
+    public String promotions() {
+        return PROMOTIONS_LIST_PATH;
+    }
+
     /**
      * 商品详情页
      */

+ 1 - 1
src/main/resources/config/dev/application-dev.yml

@@ -52,7 +52,7 @@ logging:
 
 # 服务域名
 caimei:
-  spiServer: http://192.168.2.56:8008
+  spiServer: http://192.168.2.75:8008
   imageDomain: https://img-b.caimei365.com
   wwwDomain: https://www-b.caimei365.com
 

+ 18 - 85
src/main/resources/static/css/base/base.h5.css

@@ -164,100 +164,33 @@
 .priceTag .tag{position:absolute;left:0;height:6.4vw;line-height:6.4vw;font-size:3vw;padding:0 6vw 0 3vw;background-color:#ffe6dc;color:#E15616;border-radius:2px;font-style:normal;white-space:nowrap;top:-6.8vw}
 .priceTag .tag:before{width:4vw;height:4vw;background-position:-51.6vw -.9vw;position:absolute;right:1.5vw;top:1.2vw}
 .priceTag .tag.on:before{background-position:-43vw -.9vw}
-.priceTag .ladder{display:none;background-color:rgba(74,79,88,.7);z-index:998}
+.priceTag .ladder,.priceTag .promotion{display:none;background-color:rgba(74,79,88,.7);z-index:998}
 .priceTag .ladder>span{display:block;box-sizing:border-box;width:74.6vw;padding:4vw 0;background:#FFF;border-radius:1.6vw;position:relative;top:50%;margin:-60vw auto 0 auto;line-height:10vw;font-size:4.2vw}
 .priceTag .ladder em{white-space:nowrap;text-align:center}
 .priceTag .ladder i{font-style:normal;display:inline-block;width:35vw;text-align:center}
 .priceTag .ladder .t{color:#627386}
 .priceTag .ladder .p{color:#f94b4b}
-.priceTag .ladder .close{display:block;width:46vw;height:10vw;line-height:10vw;text-align:center;background-color:#ffe6dc;border-radius:2px;border:1px solid #e15616;margin:6vw auto 0}
+.priceTag .close{display:block;width:46vw;height:10vw;line-height:10vw;text-align:center;background-color:#ffe6dc;border-radius:2px;border:1px solid #e15616;margin:6vw auto 0}
 
+.priceTag .promotion>div{display:block;box-sizing:border-box;width:82vw;padding:3.3vw;background:#FFF;border-radius:1.6vw;position:relative;top:50%;margin:-60vw auto 0 auto;line-height:8vw;font-size:3.7vw}
+.priceTag .promotion p{text-align:left}
+.priceTag .promotion p>em{color:#E15616;font-style:normal}
+.priceTag .promotion .p{display:block;height:12vw;padding:1vw 0 1vw 12vw;position:relative;line-height:5vw}
+.priceTag .promotion .p img{width:10vw;position:absolute;left:0;top:1vw}
+.priceTag .promotion .p span{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
+.priceTag .promotion .more{color:#f55c5c;text-decoration:underline;float:right;}
 
 
 
 
 
 
-
-
-/**/
-.activity{
-    text-align: center;
-    display: inline-block;
-    height: 6vw;
-    border: 0.25vw solid rgba(225,86,22,0.30196078431372547);
-    opacity: 1;
-    border-radius: .2vw;
-    font-size: 3vw;
-    font-family: Microsoft YaHei;
-    font-weight: 400;
-    line-height: 6vw;
-    color: rgba(225,86,22,1) !important;
-    position: relative;
-    z-index: 1;
-    cursor: pointer;
-    background: #fff;
-    padding: 0px 5vw 0 1.25vw;
- }
-.activity .icon {
-    width: 3.7vw;
-    height: 3.7vw;
-    position: absolute;
-    top: 2.5vw;
-    background: transparent url(/img/base/tubiao@2x.png) no-repeat no-repeat scroll right 1.25vw center;
-    background-position: -168px -48px;
-    right: 0
-}
-.activity  .activeicon{
-    background-position: -207px -46px;
-        top: 8px;
-}
-.activityBox{
-    border: .25vw solid rgba(225,86,22,0.30196078431372547);
-    border-radius: 0px 2px 2px 2px;
-    position: absolute;
-    background: #fff;
-    left: 0;
-    font-size: 3vw;
-    text-align: center;
-    top: 7vw;
-    padding: 2vw;
-    max-height: 31.9vw;
-    overflow: auto
-}
-.activeBtn{
-    width: 57px;
-    height: 24px;
-    background: #E15616;
-    color: #fff;
-    border-radius: 2px;
-    float: right;
-    margin-top: 10px;
-    cursor: pointer;
-}
-.btnBox a {
-    color: #fff;
-    font-size: 3vw;
-    text-align: center;
-}
-.pricebox{
-    background: #e15616;
-    width: 42.5vw;
-    height: 10.5vw;
-    line-height: 5vw;
-    display: block;
-    font-size: 3vw
-}
-.productItem .price em {
-    font-weight: bold;
-}
-.login-btn{
-    width: 14vw;
-    height: 5vw;
-    background: #FBEDE6;
-    text-align: center;
-    line-height: 5vw;
-    font-size: 3vw;
-    color: #e15616;
-    padding: 0.5vw 1.25vw
-}
+.login-btn{width:14vw;height:5vw;background:#FBEDE6;text-align:center;line-height:5vw;font-size:3vw;color:#e15616;padding:0.5vw 1.25vw}
+.activity{text-align:center;display:inline-block;height:6vw;border:0.25vw solid rgba(225,86,22,0.30196078431372547);opacity:1;border-radius:.2vw;font-size:3vw;font-family:Microsoft YaHei;font-weight:400;line-height:6vw;color:rgba(225,86,22,1) !important;position:relative;z-index:1;cursor:pointer;background:#fff;padding:0px 5vw 0 1.25vw}
+.activity .icon{width:3.7vw;height:3.7vw;position:absolute;top:2.5vw;background:transparent url(/img/base/tubiao@2x.png) no-repeat no-repeat scroll right 1.25vw center;background-position:-168px -48px;right:0}
+.activity .activeicon{background-position:-207px -46px;top:8px}
+.activityBox{border:.25vw solid rgba(225,86,22,0.30196078431372547);border-radius:0px 2px 2px 2px;position:absolute;background:#fff;left:0;font-size:3vw;text-align:center;top:7vw;padding:2vw;max-height:31.9vw;overflow:auto}
+.activeBtn{width:57px;height:24px;background:#E15616;color:#fff;border-radius:2px;float:right;margin-top:10px;cursor:pointer}
+.btnBox a{color:#fff;font-size:3vw;text-align:center}
+.pricebox{background:#e15616;width:42.5vw;height:10.5vw;line-height:5vw;display:block;font-size:3vw}
+.productItem .price em{font-weight:bold}

+ 18 - 115
src/main/resources/static/css/base/base.pc.css

@@ -270,124 +270,27 @@ header{box-shadow: 0 2px 10px #ebecef;}
 .priceTag .ladder i{font-style:normal;display:inline-block;width:120px;text-align:center}
 .priceTag .ladder .t{color:#627386}
 .priceTag .ladder .p{color:#f94b4b}
-.priceTag .ladder .close{background:#E15616;color:#fff;border-radius:2px;cursor:pointer;display:inline-block;padding:0 20px;height:30px;line-height:30px}
-.priceTag .promotion{
-    text-align: left;
-    font-size: 14px;
-    line-height: 30px;
-    padding: 8px 15px;
-    display: block;
-    width: 320px;
-}
-.priceTag .promotion p>em{
-    color:#E15616;
-    font-style: normal;
-}
-.priceTag .promotion .p{
-    display: block;
-    height:40px;
-    padding:10px 0 10px 50px;
-    position: relative;
-    line-height: 20px;
-}
-.priceTag .promotion .p img{
-    width:40px;
-    position: absolute;
-    left:0;
-    top:10px;
-}
-.priceTag .promotion .p span{
-    display: block;
-    text-overflow: ellipsis;
-    overflow: hidden;
-    white-space: nowrap;
-}
-
-
-
+.priceTag .close{background:#E15616;color:#fff;border-radius:2px;cursor:pointer;display:inline-block;padding:0 20px;height:30px;line-height:30px}
+.priceTag .promotion{font-size:14px;line-height:30px;padding:8px 15px;width:320px;}
+.priceTag .promotion p{text-align:left}
+.priceTag .promotion p>em{color:#E15616;font-style:normal}
+.priceTag .promotion .p{display:block;height:40px;padding:10px 0 10px 50px;position:relative;line-height:20px}
+.priceTag .promotion .p img{width:40px;position:absolute;left:0;top:10px}
+.priceTag .promotion .p span{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
+.priceTag .promotion p.r{text-align:right;}
+.priceTag .promotion .more{color:#f55c5c;text-decoration:underline;float:right;}
 
 
 
 
 
 
-    .login-btn{float:right;
-    margin:10px 10px 0 0;
-    padding:2px 5px;
-    border:1px solid rgba(225,86,22,0.16862745098039217);
-    color:#E15616;
-    border-radius:2px;
-    height: 24px;
-    line-height: 24px;
-    }
-    .pricebox{
-    background: #e15616;
-    width: 244px;
-    height: 44px;
-    line-height: 44px;
-    display: block;
-    text-align: center;
-    margin: 12px auto
-    }
-    .activity{
-    text-align: center;
-    display: inline-block;
-    height: 24px;
-    border: 1px solid rgba(225,86,22,0.30196078431372547);
-    opacity: 1;
-    border-radius: 2px;
-    font-size: 12px;
-    font-family: Microsoft YaHei;
-    font-weight: 400;
-    line-height: 24px;
-    color: rgba(225,86,22,1) !important;
-    position: relative;
-    z-index: 1;
-    cursor: pointer;
-    background: #fff;
-    padding: 0px 20px 0 5px;
-    margin-left: 15px;
- }
- .activitystyle{
-    border-bottom: 1px solid #fff !important;
-}
-
-.activity .icon.shaky:before{
-        width: 20px;
-        height: 20px;
-        position: absolute;
-        top: -5px;
-        right: 0;
-        background-position: -90px 6px
-}
-.activity  .activeicon{
-    background-position: -207px -46px;
-        top: 8px;
-}
-.activityBox{
-    border: 1px solid rgba(225,86,22,0.30196078431372547);
-    border-radius: 0px 2px 2px 2px;
-    position: absolute;
-    background: #fff;
-    left: 0;
-    font-size: 12px;
-    text-align: center;
-    top: 28px;
-    line-height: 40px;
-    padding:10px;
-    max-height: 319px;
-    overflow: auto;
-}
-.activeBtn{
-    width: 57px;
-    height: 24px;
-    background: #E15616;
-    color: #fff;
-    border-radius: 2px;
-    float: right;
-    margin-top: 10px;
-    cursor: pointer;
-}
-.priceicon{
-    font-weight: bold;
-}
+.login-btn{float:right;margin:10px 10px 0 0;padding:2px 5px;border:1px solid rgba(225,86,22,0.16862745098039217);color:#E15616;border-radius:2px;height:24px;line-height:24px}
+.pricebox{background:#e15616;width:244px;height:44px;line-height:44px;display:block;text-align:center;margin:12px auto}
+.activity{text-align:center;display:inline-block;height:24px;border:1px solid rgba(225,86,22,0.30196078431372547);opacity:1;border-radius:2px;font-size:12px;font-family:Microsoft YaHei;font-weight:400;line-height:24px;color:rgba(225,86,22,1) !important;position:relative;z-index:1;cursor:pointer;background:#fff;padding:0px 20px 0 5px;margin-left:15px}
+.activitystyle{border-bottom:1px solid #fff !important}
+.activity .icon.shaky:before{width:20px;height:20px;position:absolute;top:-5px;right:0;background-position:-90px 6px}
+.activity .activeicon{background-position:-207px -46px;top:8px}
+.activityBox{border:1px solid rgba(225,86,22,0.30196078431372547);border-radius:0px 2px 2px 2px;position:absolute;background:#fff;left:0;font-size:12px;text-align:center;top:28px;line-height:40px;padding:10px;max-height:319px;overflow:auto}
+.activeBtn{width:57px;height:24px;background:#E15616;color:#fff;border-radius:2px;float:right;margin-top:10px;cursor:pointer}
+.priceicon{font-weight:bold}

+ 3 - 3
src/main/resources/static/js/shopping/cart.js

@@ -45,16 +45,16 @@ var shoppingCart = new Vue({
         toggleThisLadder: function(event){
             var el = event.currentTarget;
             if($(el).hasClass("on")){
-                $(el).removeClass("on").siblings('.ladder').hide();
+                $(el).removeClass("on").siblings('.mFixed').hide();
                 if(!isPC){looseBody();}
             }else{
-                $(el).addClass("on").siblings('.ladder').show();
+                $(el).addClass("on").siblings('.mFixed').show();
                 if(!isPC){fixedBody();}
             }
         },
         hideThisLadder: function(event){
             var el = event.currentTarget;
-            $(el).parents('.priceTag').find('.tag').removeClass("on").siblings('.ladder').hide();
+            $(el).parents('.priceTag').find('.tag').removeClass("on").siblings('.mFixed').hide();
             if(!isPC){looseBody();}
         },
         ckeckSupplier: function(event, supplierChecked){

+ 31 - 0
src/main/resources/templates/product/promotions.html

@@ -0,0 +1,31 @@
+<!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>采美365网-商品列表</title>
+    <template th:replace="components/head-link"></template>
+    <link th:href="@{/css/product/list.css(v=${version})}" rel="stylesheet" type="text/css">
+</head>
+<body>
+<!-- 引用头部 -->
+<template th:replace="components/header"></template>
+
+<!-- 商品列表 -->
+<div id="promotionsList">
+    <!-- 面包屑 -->
+    <div v-else class="crumbs">
+        <a href="/">首页</a>
+        <span>&gt;</span>
+        <span>凑单商品</span>
+    </div>
+    <!-- 列表数据 -->
+    <div>
+        <h1>促单满减商品</h1>
+    </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/product/promotions.js(v=${version})}"></script>
+</body>
+</html>

+ 22 - 17
src/main/resources/templates/shopping/cart.html

@@ -77,24 +77,29 @@
                             </template>
                             <!-- 促销活动 -->
                             <div v-if="cart.actStatus==1 && cart.promotions" class="priceTag">
-                                <i v-if="cart.promotions.type==1 && cart.promotions.mode==1" class="tag icon mIcon" v-text="cart.promotions.name+':¥'+toFloat(cart.price)"></i>
-                                <i v-else class="tag icon mIcon" v-text="cart.promotions?cart.promotions.name:''"></i>
+                                <i v-if="cart.promotions.type==1 && cart.promotions.mode==1" @click="toggleThisLadder($event)" class="tag icon mIcon" v-text="cart.promotions.name+':¥'+toFloat(cart.price)"></i>
+                                <i v-else class="tag icon mIcon" @click="toggleThisLadder($event)" v-text="cart.promotions?cart.promotions.name:''"></i>
                                 <div class="promotion mFixed">
-                                    <p class="t"><em>全店铺满减:满1000.00,减500.00</em></p>
-                                    <p>促销时间:2020-06-12 ~ 2020-09-30</p>
-                                    <p>赠品:</p>
-                                    <p>
-                                        <a class="p" href="">
-                                            <img src="https://img.caimei365.com/group1/M00/00/FD/Cmis21sxr2CAA8qRAAHtVLDfGCs96.JPEG">
-                                            <span>夜猫子1一剪时光SOD金茯苓保湿塑颜面膜</span>
-                                            <span>× 1</span>
-                                        </a>
-                                        <a class="p" href="">
-                                            <img src="https://img.caimei365.com/group1/M00/00/FD/Cmis21sxr2CAA8qRAAHtVLDfGCs96.JPEG">
-                                            <span>夜猫子1一剪时光SOD金茯苓保湿塑颜面膜</span>
-                                            <span>× 1</span>
-                                        </a>
-                                    </p>
+                                    <div>
+                                        <p class="t">
+                                            <em v-if="cart.promotions.type==1 && cart.promotions.mode==1">{{cart.promotions.name+':¥'+toFloat(cart.price)}}</em>
+                                            <em v-if="cart.promotions.mode==2">{{cart.promotions.name+',满 ¥'+toFloat(cart.promotions.touchPrice)+' 减 ¥'+toFloat(cart.promotions.reducedPrice)}}</em>
+                                            <em v-if="cart.promotions.mode==3">{{cart.promotions.name+',满 ¥'+toFloat(cart.promotions.touchPrice)+' 赠送商品'}}</em>
+                                        </p>
+                                        <p>促销时间:<em v-if="cart.promotions.status==1">不限时</em><em v-else>{{cart.promotions.beginTime.substr(0,10)+' ~ '+cart.promotions.endTime.substr(0,10)}}</em></p>
+                                        <p v-if="cart.promotions.type==2" class="r"><a class="more" :href="'/product/promotions.html?id='+cart.promotions.id">更多凑单商品>>></a></p>
+                                        <template v-if="cart.promotions.mode==3">
+                                            <p>赠品:</p>
+                                            <p>
+                                                <a v-for="g in cart.promotions.giftList" class="p" href="JavaScript:void(0);">
+                                                    <img :src="g.image">
+                                                    <span v-text="g.name"></span>
+                                                    <span v-text="'× '+g.number"></span>
+                                                </a>
+                                            </p>
+                                        </template>
+                                        <p class="r"><a class="close" @click="hideThisLadder($event)" href="JavaScript:void(0);">了解</a></p>
+                                    </div>
                                 </div>
                             </div>
                             <!-- 阶梯价 -->