Переглянути джерело

线上支付开关,删除入驻咨询弹窗,优化二手商品详情放大镜

zhengjinyi 4 роки тому
батько
коміт
634e1c5db0

+ 3 - 2
src/main/resources/static/css/flea-market/secondDetail.css

@@ -21,7 +21,7 @@
     .preview-header .preview-banner {width: 452px;height: 545px;float: left;position: relative;}
     .preview-header .preview-info {width: 685px;float: right;opacity: 0;}
     .preview-header .preview-info.active {opacity: 1;}
-    .preview-header .preview-banner-big {width: 452px;height: 452px;float: left;}
+    .preview-header .preview-banner-big {width: 452px;height: 452px;float: left;border: 1px solid #e4e4e4;}
     .preview-header .preview-banner-big .preview-img {width: 100%;height: 100%;display: block;}
     .preview-header .preview-banner-big span {display: none;position: absolute;left: 0;top: 0;width: 215px;height: 215px;border: 1px solid #aaa;background: rgba(255, 208, 22, 0.4);opacity: .5;filter: alpha(opacity:50);cursor: move;}
     .preview-header .preview-banner-small {width: 100%;height: 98px;padding: 10px;float: left;}
@@ -48,7 +48,8 @@
     .recommended-item img {width: 100%;height: 100%;}
     .recommended-item p {color: #666666;}
     .main {width: 1184px;margin: 20px auto 0;}
-    .title {line-height: 40px;padding-left: 10px;margin: 0 auto;font-size: 16px;color: #333333;border-bottom: 1px solid #E15616;font-weight: bold;}
+    .title{ height: 40px;line-height: 40px;border-bottom: 1px solid #ffe6dc;font-size: 16px;color: #333333;background-color: #ffffff;}
+    .title .li{display: inline-block;box-sizing: border-box;min-width: 130px;text-align: center;height: 100%;padding: 0 32px;text-align: center;background: #ffe6dc;color: #e15616;font-weight: bold;}
     .mainContent {width: 100%;font-size: 0;}
     .mainContentLeft {width: 100%;display: inline-block;background-color: #fff;vertical-align: top;}
     .Disclaimer {padding: 20px 10px;background-color: #fff;}

+ 7 - 0
src/main/resources/static/css/product/detail.h5.css

@@ -14,6 +14,11 @@ li{list-style:none}
 .productBox .detailBox .tags span{display:inline-block;height:4.2vw;line-height:4.2vw;padding:0 1vw;font-size:2.6vw;color:#FFF;background:#86B2FF;border-radius:2px;margin-right:2.7vw}
 .productBox .detailBox .detail{box-sizing:border-box;padding:2.8vw;font-size:3.4vw;line-height:7.5vw;color:#93979F;background:#f3f7fe;border-radius:2px;position:relative;margin:3.5vw 0}
 .productBox .detailBox .detail hr{border:none;border-top:1px dashed #BEC2C9;margin:2vw 0}
+.productBox .detailBox .none-details{opacity: 0;box-sizing:border-box;padding:7vw;font-size:3.4vw;color:#9aa5b5;margin:10px 0;position:relative;min-height: 33.2vw;}
+.productBox .detailBox .none-details .none-image{width: 38.6vw;height: 30.5vw;display: block;margin: 0 auto;}
+.productBox .detailBox .none-details .none-text{width: 100%;height: 4vw;line-height: 4vw;text-align: center;color: #ffb496;font-size: 3.4vw;margin-top: 2vw;}
+.productBox .detailBox .none-details.show{opacity: 1;}
+
 .productBox .detailBox .row{position:relative;}
 .priceTag {position: absolute;left: 20vw;}
 .productBox .detailBox .row>i{font-style:normal;margin-right:2vw}
@@ -65,6 +70,8 @@ li{list-style:none}
 .productInfo .tabCon td{padding:1.5vw;line-height:5vw}
 .productInfo .tabCon td:nth-of-type(1){width:20%;color:#93979F}
 .productInfo .tabCon td:nth-of-type(2){width:80%;color:#4A4F58}
+.tabCon .item div p{line-height: 6vw;text-align: left;font-size:3.3vw}
+.tabCon .item div p.tl{line-height:8vw;text-align: left; font-weight: bold;}
 .productInfo .comment{color:#93979F;padding:5vw 0;    margin-right: 25px;position: relative}
 .productBox .detailBox .row .l{display: inline-block;min-width: 14.5vw;text-align-last: justify;vertical-align: top}
 .icon.comment:before{

+ 8 - 3
src/main/resources/static/css/product/detail.pc.css

@@ -24,6 +24,10 @@ li{list-style:none;}
 .productBox .detailBox .tags{padding:2px 0}
 .productBox .detailBox .tags span{display:inline-block;line-height:16px;padding: 3px 6px;font-size:12px;color: #9aa5b5;border-radius:2px;margin-right:10px;border: 1px solid #e2e7ef;}
 .productBox .detailBox .detail{box-sizing:border-box;padding:14px 20px;font-size:14px;color:#9aa5b5;background:#f3f7fe;border-radius:2px;margin:10px 0;position:relative;}
+.productBox .detailBox .none-details{opacity: 0;box-sizing:border-box;padding:70px 20px;font-size:14px;color:#9aa5b5;margin:10px 0;position:relative;min-height: 332px;}
+.productBox .detailBox .none-details .none-image{width: 179px;height: 141px;display: block;margin: 0 auto;}
+.productBox .detailBox .none-details .none-text{width: 100%;height: 40px;line-height: 40px;text-align: center;color: #ffb496;font-size: 16px;}
+.productBox .detailBox .none-details.show{opacity: 1;}
 .productBox .detailBox .detail hr{border:none;border-top:1px dashed #E2E7EF;margin:12px 0}
 .productBox .detailBox .row{padding:3px 0 3px 80px;line-height:24px;position:relative;}
 .productBox .detailBox .row .l{display:inline-block;min-width:60px;height:24px;text-align:justify;vertical-align:top;margin-left:-80px;}
@@ -74,12 +78,12 @@ li{list-style:none;}
 #productRecommend .swiper-pagination span:before{content:"";display:inline-block;width:100%;height:4px;background:#E15616;border-radius:2px}
 #productRecommend .swiper-pagination span.on{width:28px;opacity:1;}
 
-.wrap>.productInfo{float:left;box-sizing:border-box;padding:0 16px;width:884px;background:#FFF;min-height: 487px}
+.wrap>.productInfo{float:left;box-sizing:border-box;padding:0 0;width:884px;background:#FFF;min-height: 487px}
 .productInfo .tabTit{height:40px;line-height:40px;border-bottom:1px solid #ffe6dc;font-size:16px;color:#333333}
 .productInfo .tabTit span{display:inline-block;box-sizing:border-box;min-width:130px;text-align:center;height:100%;padding:0 32px;cursor:pointer}
 .productInfo .tabTit span:hover{color:#E15621}
 .productInfo .tabTit span.on,.productInfo .tabTit span.on:hover{background:#ffe6dc;color:#e15616;font-weight: bold;}
-.productInfo .tabCon{padding:16px 0;text-align:center}
+.productInfo .tabCon{padding:16px;text-align:center}
 .productInfo .tabCon img{max-width:100%;}
 .productInfo .tabCon table{width:100%;text-align:left}
 .productInfo .tabCon td{padding:10px 12px;line-height:20px}
@@ -130,4 +134,5 @@ input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appear
 .pingjia{margin-top:25px;text-align:left}
 .pingjia button{width:128px;height:40px;background-color:#4a4f58;box-shadow:0px 3px 6px 0px rgba(147,151,159,0.17);border-radius:2px;color:#ffe6dc;cursor: pointer}
 .comment-right{float:right;color:#93979f}
-.tabCon .item div p{line-height: 26px;text-align: left; text-indent: 25px}
+.tabCon .item div p{line-height: 26px;text-align: left;}
+.tabCon .item div p.tl{line-height: 40px;text-align: left; font-weight: bold;}

Різницю між файлами не показано, бо вона завелика
+ 3 - 0
src/main/resources/static/img/base/icon-none.svg


+ 13 - 0
src/main/resources/static/js/common/serviceapi/product.service.js

@@ -0,0 +1,13 @@
+/* HTTP API 商品相关业务
+ * Copyright 2020, CAIMEI365
+ * Date   2020/07/16
+ * auther xw
+ */
+var ProductApi = {
+        GetProductDdtails: function (params, callback) {//获取商品详情
+            Http.AjaxService({ url:'/product/details', type:'get', data:params, json:true})
+            .then(function(res){
+                callback(res);
+            });
+        }
+};

+ 35 - 6
src/main/resources/static/js/product/detail.js

@@ -26,7 +26,10 @@ var productDetail = new Vue({
         recommendType: 0,//相关推荐类型 0自动选择; 1手动推荐
         recommendPage: 1,
         recommends: [],
-        parameters: []
+        parameters: [],
+        tabsIndex:0,
+        disabledText:'',
+        isNoneDisabled:false
     },
     computed: {},
     methods: {
@@ -63,6 +66,27 @@ var productDetail = new Vue({
                 }
             });
         },
+        getProductDetails:function(){
+            var _self = this;
+            ProductApi.GetProductDdtails({userId:GLOBAL_USER_ID,productID:_self.productId},function (response) {
+                if(response.code == 0){
+                    var product = response.data;
+                    if(product.validFlag =='3' || product.stock == 0 ){
+                        _self.isNoneDisabled = true;
+                    }else{
+                        _self.isNoneDisabled = false;
+                    }
+                    if(product.validFlag =='3'){
+                        _self.disabledText = '下架'
+                    }
+                    if(product.stock == 0){
+                        _self.disabledText = '售罄'
+                    }
+                }else{
+                    CAIMEI.Alert(response.msg, '确定', false);
+                }
+            })
+        },
         getProductPrice:function(){
             var _self = this;
             if(_self.productId ===0){return;}
@@ -210,6 +234,10 @@ var productDetail = new Vue({
                     }
                 }
             });
+        },
+        detailsClicktab:function(index){
+            var _self = this;
+            _self.tabsIndex = index;
         }
     },
     created: function () {
@@ -219,13 +247,14 @@ var productDetail = new Vue({
     },
     mounted: function () {
         this.userId = GLOBAL_USER_ID;
+        this.getProductDetails();
         this.getProductPrice();
         this.getParameters();
         this.getRecommends();
-        $('.productInfo').slide({
-            mainCell:".tabCon"
-            ,titCell:".tabTit span"
-            ,trigger: "click"
-        });
+        // $('.productInfo').slide({
+        //     mainCell:".tabCon"
+        //     ,titCell:".tabTit span"
+        //     ,trigger: "click"
+        // });
     }
 });

+ 3 - 1
src/main/resources/templates/flea-market/detail.html

@@ -144,7 +144,9 @@
             </div>
         </div>
      <div class="main">
-        <div class="title">商品详情</div>
+        <div class="title">
+            <div class="li">商品详情</div>
+        </div>
         <div class="mainContent">
             <div class="mainContentLeft">
                 <div class="Disclaimer">

+ 20 - 13
src/main/resources/templates/product/detail.html

@@ -49,7 +49,7 @@
                 <p class="tags">
                     <span th:each="tag: *{tagList}" th:text="${tag}"></span>
                 </p>
-                <div class="detail">
+                <div class="detail" v-if="!isNoneDisabled">
                     <div class="row price"><span class="l">采美价</span><i>:</i>
                         <template v-if="GLOBAL_USER_ID && GLOBAL_USER_ID>0">
                             <!--用户身份 0、个人 1、协销 2、会员机构 3、供应商 4,普通机构-->
@@ -154,18 +154,22 @@
                         <em class="ser icon mIcon">正品保证</em>
                     </div>
                 </div>
+                <div v-else class="none-details" :class="isNoneDisabled ? 'show':''">
+                    <img class="none-image" src="/img/base/icon-none.svg" alt="">
+                    <p class="none-text">此商品已{{disabledText}},请浏览以下推荐商品~</p>
+                </div>
                 <template v-if="GLOBAL_USER_ID && GLOBAL_USER_ID>0">
                     <div  class="btnBox" v-if="priceObj.priceFlag==2 && priceObj.userIdentity==4">
                         <a class="upgrade" href="/user/setting/upgrade.html">升级会员查看价格</a>
                     </div>
                     <div class="btnBox" v-else-if="(priceObj.priceFlag==0 && priceObj.userIdentity!=3) || (priceObj.priceFlag==2 && priceObj.userIdentity==2)">
-                        <a href="javascript:void(0);" class="cart icon" @click='addShopCart()'>加入购物车</a>
-                        <a href="javascript:void(0);" class="buy" @click="buyNowSubmit()">立即购买</a>
+                        <a href="javascript:void(0);" class="cart icon" @click='addShopCart()' v-if="!isNoneDisabled">加入购物车</a>
+                        <a href="javascript:void(0);" class="buy" @click="buyNowSubmit()" v-if="!isNoneDisabled">立即购买</a>
                     </div>
                 </template>
                 <template v-else>
                     <div  class="btnBox">
-                        <a href="javascript:void(0);" class="upgrade" @click="toLogin">登录查看价格</a>
+                        <a href="javascript:void(0);" class="upgrade" @click="toLogin" v-if="!isNoneDisabled">登录查看价格</a>
                     </div>
                 </template>
             </div>
@@ -205,17 +209,16 @@
         </div>
         <div class="productInfo">
             <div class="tabTit">
-                <span class="on">产品介绍</span>
-                <span th:if="not${#arrays.isEmpty(parameters)}">相关参数</span>
-                <span th:if="not${#strings.isEmpty(product.serviceInfo)}" >服务项目</span>
-<!--                <span>评价</span>-->
+                <span :class="tabsIndex == 0 ? 'on' : ''" @click="detailsClicktab(0)">商品详情</span>
+                <span :class="tabsIndex == 1 ? 'on' : ''"v-if="parameters.length>0" @click="detailsClicktab(1)">相关参数</span>
+                <span :class="tabsIndex == 2 ? 'on' : ''" th:if="not${#strings.isEmpty(product.serviceInfo)}" @click="detailsClicktab(2)">服务项目</span>
+<!--            <span>评价</span>-->
             </div>
             <div class="tabCon">
-                <div class="item">
+                <div class="item" v-if="tabsIndex == 0">
                     <div th:utext="${product.detailInfo}"></div>
-                    <div th:utext="${product.orderInfo}"></div>
                 </div>
-                <div class="item" v-if="parameters.length>0">
+                <div class="item" v-if="tabsIndex == 1">
                     <table>
                         <tr v-for="pa in parameters">
                             <td v-text="pa.name"></td>
@@ -223,8 +226,11 @@
                         </tr>
                     </table>
                 </div>
-                <div class="item">
-                    <div class="item" th:utext="${product.serviceInfo}"></div>
+                <div class="item" v-if="tabsIndex == 2">
+                    <div><p class="tl">订购方案:</p></div>
+                    <div th:utext="${product.orderInfo}"></div>
+                    <div><p class="tl">服务详情:</p></div>
+                    <div th:utext="${product.serviceInfo}"></div>
                 </div>
 <!--                <div class="item">-->
 <!--                <div style="text-align: left;margin: 10px 0">-->
@@ -276,6 +282,7 @@
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
 <script charset="utf-8" type="text/javascript" src="/lib/magnifier.js"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/product/detail.js(v=${version})}"></script>
 </body>
 </html>

Деякі файли не було показано, через те що забагато файлів було змінено