浏览代码

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

zhengjinyi 4 年之前
父节点
当前提交
6da6128bfc

+ 37 - 1
src/main/resources/static/css/base/base.pc.css

@@ -264,13 +264,49 @@ header{box-shadow: 0 2px 10px #ebecef;}
 .priceTag .tag{display:inline-block;height:24px;line-height:24px;border:1px solid #ffe6dc;border-radius:2px;font-size:12px;color:#E15616;cursor:pointer;background:#fff;padding:0 24px 0 10px;position:relative;font-style:normal}
 .priceTag .tag:before{width:24px;height:24px;background-position:-88px 3px;position:absolute;right:0;top:0}
 .priceTag .tag.on:before{background-position:-117px 3px}
-.priceTag .ladder{position:absolute;background:#fff;box-shadow:0 3px 6px 0 #d7dfec;border-radius:2px;line-height:42px;left:0;top:25px;z-index:9;transition:all .8s;display:none}
+.priceTag .ladder,.priceTag .promotion{position:absolute;background:#fff;box-shadow:0 3px 6px 0 #d7dfec;border-radius:2px;line-height:42px;left:0;top:28px;z-index:9;transition:all .8s;display:none}
 .priceTag .ladder>span{padding:0 20px 20px;}
 .priceTag .ladder em{white-space:nowrap}
 .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;
+}
+
+
+
+
+
 
 
 

+ 1 - 1
src/main/resources/static/css/base/init.css

@@ -22,7 +22,7 @@ table,td,th{border: 1px solid #EBECEF;}
 input[type=checkbox]{width:16px;height:16px;text-align:center;outline:none;cursor:copy;}
 input[type=checkbox]:focus{outline:none}
 input[type=checkbox]:after{width:100%;height:100%;top:0;content:" ";background-color:#FFF;color:#E15616;display:inline-block;visibility:visible;border:1px solid #b8bfca;border-radius:2px;}
-input[type=checkbox]:checked:after{/*content:"\2713";*/font-size:12px;background: url("/img/cart/gouxuan.png");border: 1px solid #E15616;}
+input[type=checkbox]:checked:after{content:"\2713";font-size:12px;background:#E15616;border: 1px solid #E15616;color:#FFF;}
 input[type=checkbox][disabled=disabled]:after{width:100%;height:100%;top:0;content:" ";background-color:#f1f0f5;color:#FFF;display:inline-block;visibility:visible;border-radius:2px;border:1px solid #B8BFCA}
 input[type=checkbox][disabled=disabled]{cursor:default;}
 /* 定义动画效果 */

+ 18 - 75
src/main/resources/static/css/shopping/cart.css

@@ -4,6 +4,8 @@ li{list-style:none}
  * PC端
  */
 @media screen and (min-width:768px){
+    input[type="number"]{-moz-appearance:none;-webkit-appearance: none;}
+    input::-webkit-outer-spin-button,input::-webkit-inner-spin-button {-webkit-appearance:none;}
     .loading{box-sizing:border-box;padding:200px 0;text-align:center}
     .empty{box-sizing:border-box;padding:100px 0;text-align:center;color:#4A4F58;line-height:30px;font-size:16px}
     .empty img{width:180px;height:180px}
@@ -23,10 +25,15 @@ li{list-style:none}
     .listWrap{width:1184px}
     .listWrap .cartTit,.listWrap .supplierItem{box-sizing:border-box;padding:0 14px;text-align:center;width:100%;background:#FFF;margin-bottom:8px;box-shadow:0px 3px 6px rgba(0,0,0,0.07)}
     .listWrap .supplierItem.disable{background:#f1f0f5}
-    .listWrap .cartTit,.listWrap .supplierInfo{height:60px;line-height:60px}
+    .listWrap .supplierItem em{font-style: normal}
+    .listWrap .supplierTit{border-bottom:1px solid #F7F7F7;height:60px;line-height:60px;text-align: left;}
+    .listWrap .supplierTit .img{width:auto;height:32px;border:1px solid #F7F7F7;margin-right:10px}
+    .listWrap .supplierTit .name{color:#9aa5b5}
+    .listWrap .cartTit,.listWrap .supplierBtn{height:60px;line-height:60px}
     .listWrap .cartTit{color:#333333}
-    .listWrap .supplierItem,.listWrap .supplierInfo{color:#22272E}
-    .listWrap .supplierInfo{border-top:1px solid #F5F5F5}
+    .listWrap .supplierItem,.listWrap .supplierBtn{color:#22272E}
+    .listWrap .supplierBtn{border-top:1px solid #F5F5F5;text-align:right;}
+    .listWrap .supplierBtn em {color:#f55c5c;font-size:16px;}
     .listWrap .cartItem{width:100%;height:100px;line-height:100px;margin-top:10px;padding:14px 0;font-size: 16px}
     .listWrap .cartItem:first-child{margin-top:0}
     .listWrap .cartItem .c2{text-align:left}
@@ -41,15 +48,14 @@ li{list-style:none}
     .listWrap .c6{float:left;width:142px}
     .listWrap .c7{float:right;width:118px}
     .listWrap .c10{float:left;width:495px}
-    .listWrap .supplierInfo .c2{text-align:left;width:800px}
     .listWrap .check{width:16px;height:16px;line-height:14px;vertical-align:middle}
     .listWrap .image{display:block;width:100px;height:100px;border:1px solid #F7F7F7}
     .listWrap .name, .listWrap .unit{line-height:20px;display:inline-block;max-height:100px;overflow:hidden;vertical-align:middle}
     .listWrap .cartItem .name{padding-left:14px}
     .listWrap .cartItem .name .tag{display: inline-block;background:#f94b4b;color:#FFF;font-size:12px;padding:0 6px;height:20px;line-height:20px;border-radius:2px;font-style:normal;margin-right:5px}
     .listWrap .c7 em,.listWrap .c10 em{color:#f94b4b;font-style:normal}
-    .listWrap .number{display:inline-block;width:96px;line-height:24px;height:24px;box-sizing:border-box;border:1px solid #EFEFEF;border-radius:2px;font-size:0;white-space:nowrap;text-align:center;overflow:hidden;vertical-align:top}
-    .listWrap .number>em{display:inline-block;width:24px;height:22px;background:#EFEFEF;font-size:20px;font-style:normal;line-height:20px;vertical-align:top;cursor:pointer}
+    .listWrap .number{display:inline-block;width:96px;line-height:24px;height:24px;box-sizing:border-box;border:1px solid #FFE6DC;border-radius:2px;font-size:0;white-space:nowrap;text-align:center;overflow:hidden;vertical-align:top}
+    .listWrap .number>em{display:inline-block;width:24px;height:22px;background:#FFE6DC;font-size:20px;font-style:normal;line-height:20px;vertical-align:top;cursor:pointer}
     .listWrap .number input{width:48px;border:none;line-height:22px;font-size:14px;vertical-align:top;text-align:center;color:#E15616}
     .listWrap .del{color: #9AA5B5;font-size:20px;position:relative;cursor:pointer;display:inline-block;height:40px;line-height:40px;width:30px}
     .listWrap .del .tips{position:absolute;top:40px;left:4px;opacity:0;white-space:nowrap;background-color:#f94b4b;color:#FFF;border-radius:3px;line-height:30px;font-size:12px;text-align:center;display:inline-block;transition:all .8s;padding:0 10px;font-style:normal}
@@ -57,7 +63,8 @@ li{list-style:none}
     .listWrap .del:hover{color:#f94b4b}
     .listWrap .del:hover .tips{opacity:1}
     .listWrap .price{position:relative;display:inline-block;line-height:24px;}
-    .listWrap .price em{font-style:normal;font-size: 16px}
+    .listWrap .price>em{font-style:normal;font-size:16px;display:inline-block;width:100%;}
+    .listWrap .price>del{font-size:16px;display:inline-block;width:100%;}
     .invalidTit{height:44px;line-height:44px;padding-top:16px;font-size:16px}
     .invalidTit .tit{color:#22272e;float:left}
     .invalidTit .delAll{color:#e15616;float:right;cursor:pointer;}
@@ -74,73 +81,8 @@ li{list-style:none}
     .summaryWrap .summary .submit{display:inline-block;width:232px;height:50px;line-height:50px;text-align:center;background-color:#e15616;border-radius:2px;color:#FFF}
     .summaryWrap.fixed{position:fixed;bottom:0;left:0;margin:0;z-index:99999;box-shadow:20px 20px 102px rgba(0,0,0,0.1)}
     .pageTitle .step label.line{width: 50px;height: 1px;background: #707070;display: inline-block; margin: 0px 10px}
-    .supplierInfo.top{border-bottom: 1px solid #F5F5F5}
-    input[type="number"]{
-    -moz-appearance: none;
-    -webkit-appearance: none;
-    }
-    input::-webkit-outer-spin-button,
-    input::-webkit-inner-spin-button {
-    -webkit-appearance: none;
-    }
-    .colorprice{color: #9AA5B5}
-    .gouxuan{background: url("/img/cart/gouxuan.png");}
-    .tips-text{
-        bottom:10px;
-        height: 24px;
-        line-height: 24px;
-        position: absolute;
-        color: #E15616;
-        font-size: 12px;
-        text-align: center;
-        width: 190px
-    }
-    .Boxtext{
-    text-align: left;
-    line-height: 25px;
-    color: #333333;
-    padding-bottom: 5px;
-}
-.item-tips{
-    width: 312px;
-    height: auto;
-    padding: 12px;
-    border: 1px solid rgba(225,86,22,0.30196078431372547);
-    background: #ffffff;
-    position: absolute;
-    top: 28px;
-    left: 93px;
-}
-.tip-tr{
-    width: 100%;
-    height: 42px;
-    border-bottom: 1px solid rgba(225,86,22,0.30196078431372547);
-}
-.tips-content{
-    width: 294px;
-    height: auto;
-    border: 1px solid rgba(225,86,22,0.30196078431372547);
-    border-radius: 5px;
-    margin: auto;
-}
-.tip-td{
-    width: 146px;
-    height: 100%;
-    float: left;
-    line-height: 42px;
-    font-size: 14px;
-    color: #E15616;
-    text-align: center;
-}
-.tip-tr:last-child{
-    border-bottom: none;
-}
-.tip-td:nth-child(1){
-    border-right: 1px solid rgba(225,86,22,0.30196078431372547);
-}
-.active{
-    display: block;
-}
+
+
 
 
 }
@@ -169,7 +111,8 @@ li{list-style:none}
     .listWrap .supplierItem em{font-style: normal}
     .listWrap .supplierTit{border-bottom:1px solid #F7F7F7;height:7.4vw;line-height:7.4vw;padding:1.3vw 3.3vw;}
     .listWrap .cartItem{padding:2.2vw 3.3vw;height:24vw;line-height:24vw;position:relative;}
-    .listWrap .supplierInfo{border-top:1px solid #F7F7F7;width:93vw;margin:0 auto;height:10.6vw;line-height:10.6vw;color:#22272e;font-size:3.4vw;text-align:right;}
+    .listWrap .supplierBtn{border-top:1px solid #F7F7F7;width:93vw;margin:0 auto;height:10.6vw;line-height:10.6vw;color:#22272e;font-size:3.4vw;text-align:right;}
+    .listWrap .supplierBtn em {color: #f55c5c;}
     .listWrap .supplierItem .c0{float:left;width:9.6vw;text-align:center}
     .listWrap .check{width:3.5vw;height:3.5vw;line-height:3.5vw;vertical-align:middle}
     .listWrap .supplierItem .c1{float:left;width:24vw}

+ 179 - 0
src/main/resources/static/css/supplier-center/dashboard.css

@@ -0,0 +1,179 @@
+/*左侧导航*/
+.left {
+    float: left;
+    width: 200px;
+    line-height: 50px;
+    white-space: nowrap;
+    text-indent: 16px;
+    font-size: 16px;
+    background: #FFF;
+}
+#dashboard.left .title{color:#22272e;font-weight:bold;border-bottom:1px solid #f5f5f5}
+ .navList .tab{display:block;color:#22272e;position:relative}
+ .navList .tab:before{content:'\276F';font-weight:normal;position:absolute;right:10px;top:0;transform:rotate(90deg);width:32px;height:32px;line-height:32px;text-align:center;color:#bec2c9}
+ .navList .con{position:relative;}
+ .navList .con:before,.navLayout .navList .con:after{content:'';position:absolute;width:168px;border-top:1px solid #f5f5f5;left:16px}
+ .navList .con:before{top:0}
+ .navList .con:after{bottom:0}
+ .navList .con a{display:block;font-size:14px;color:#627386;text-indent:32px}
+ .navList.on .tab:before{top:18px;transform:rotate(270deg);color:#e15616}
+ .navList.on .tab{color:#e15616}
+ .navList .con a.on{color:#e15616;background-color:#ffe6dc}
+ .right{float:right;width:968px}
+.pageContent{background:#FFF;padding:16px}
+.pageContent form{
+    width: 498px;
+    margin: 0 auto;
+    padding: 50px 0;
+}
+.right{
+    float: right;
+    width: 968px;
+}
+
+
+/**/
+#dashboard li{
+    list-style: none;
+}
+.information{
+    background: #fff;
+    padding: 20px;
+    overflow: hidden;
+    box-shadow: 0px 3px 6px 0px
+		rgba(0, 0, 0, 0.07);
+}
+.head{
+    width: 112px;
+	height: 80px;
+	border-radius: 2px;
+	border: solid 1px #f5f5f5;
+	float: left;
+    margin-right: 10px;
+}
+.head img{
+    width: 100%;
+    height: 100%;
+}
+.info_main{
+    float: left;
+}
+.username{
+    color: #627386;
+    font-size: 12px;
+    margin: 10px 0;
+}
+.perfect{
+    width: 64px;
+	height: 22px;
+	background-color: #627386;
+	border-radius: 2px;
+	color: #ffffff;
+	font-size: 12px;
+	line-height: 22px;
+	text-align: center;
+	display: inline-block;
+}
+.ziliao{
+	font-size: 14px;
+    color: #22272e;
+}
+.ziliao span{
+    color: #f94b4b;
+}
+.message{
+    float: right;
+    width: 30px;
+    height: 30px;
+    cursor: pointer;
+}
+.msg_num{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    display: block;
+    background: red;
+    border-radius: 50%;
+    color: #fff;
+    font-size: 10px;
+    text-align: center;
+    position: relative;
+    top: 10px;
+    right: 9px;
+}
+.icon.msg:before{
+    width: 25px;
+    height: 25px;
+    background-position: -240px -371px
+}
+.product{
+    margin: 20px 0;
+}
+.product p{
+    font-size: 16px;
+	font-weight: normal;
+	font-stretch: normal;
+	line-height: 21px;
+	letter-spacing: 0px;
+	color: #22272e;
+	padding: 10px;
+}
+.product ul{
+	height: 50px;
+    line-height: 80px;
+    background-color: #ffffff;
+    box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.07);
+    padding: 15px;
+}
+.product li{
+
+    display: inline-block;
+    margin-right: 20px;
+    width: 110px;
+    text-align: center;
+    color: #333333;
+    position: relative;
+    cursor: pointer;
+}
+.icon.confirm:before{
+    width: 34px;
+    height: 35px;
+    background-position: -266px -371px;
+    position: absolute
+}
+.icon.other:before{
+    background-position: -300px -371px;
+}
+.rank_top p{
+   font-size: 16px;
+   color: #22272e;
+   display: inline-block;
+}
+.rank_top span{
+    color: #627386;
+    font-size: 16px;
+}
+.rank_top a{
+    float: right;
+    color: #333333;
+    cursor: pointer
+}
+.sales-ranke ul li{
+    display: inline-block;
+    width: 10%;
+}
+.sales-ranke ul li:nth-child(2){
+    width: 79%;
+}
+.sales-ranke{
+    height: 54px;
+    background: #fff;
+    line-height: 54px;
+    color: #627386;
+}
+.sales-ranke ul{
+    padding: 0 15px;
+}
+.rank_top{
+    padding: 10px;
+}

二进制
src/main/resources/static/img/base/icon.png


+ 6 - 3
src/main/resources/static/js/base.js

@@ -363,7 +363,7 @@ function tokenAjax(type, url, params, callback){
         },
         data: params,
         headers:{
-            'Content-Type':'application/json;charset=utf8',
+            'Content-Type': type=='post'?'application/x-www-form-urlencoded':'application/json;charset=utf8',
             'X-Token':REV_TOKEN_DEV
         },
         success : function (res) {
@@ -513,7 +513,7 @@ function verifyCheack(ele) {
 }
 
 // 公共信息提示弹框
-function alertInfo(txt) {
+function alertInfo(txt,callback) {
     $.confirm({
         useBootstrap: false,
         boxWidth: (isPC?'300px':'70%'),
@@ -526,7 +526,10 @@ function alertInfo(txt) {
         buttons: {
             close: {
                 text: '确定',
-                btnClass: 'btn-confirm'
+                btnClass: 'btn-confirm',
+                action: function () {
+                    callback()
+                }
             }
         }
     });

+ 7 - 0
src/main/resources/static/js/common/serviceapi/supplier.service.js

@@ -156,5 +156,12 @@ var SupplierApi = {
                 .then(function(res){
                     callback(res);
                 });
+        },
+        homePageData: function (params, callback) {//供应商 首页个人中心
+            Http.AjaxService({ url:'/supplier/homePageData', type:'get', data:params, json:false, mask:true,replace:true})
+                .then(function(res){
+                    callback(res);
+                });
         }
+
 };

+ 1 - 1
src/main/resources/static/js/help/help.js

@@ -44,7 +44,7 @@ var helpSuggestion = new Vue({
                 };
                 console.log(JSON.stringify(params));
                 $.post("/help/suggestion", params, function(res){
-                    alertInfo(res.msg);
+                     alertInfo(res.msg);
                     _self.btnLoading = false;
                 });
             });

+ 124 - 115
src/main/resources/static/js/shopping/cart.js

@@ -6,20 +6,12 @@ var shoppingCart = new Vue({
         userToken: '',
         listLoading: true,
         listData: [],
-        cartList:[],
         invalidData: [],
-        totalSize: 0,
+        kindCount: 0,
         totalCount: 0,
         totalPrice: 0,
-        ischecked:false,
-        isCheckAll:false,
-        isStock:'',
-        allPrice:0,//每个店铺下的总价
-        tipsName:false,
-        fromMessage:'',//提示文字
-        isShow:false,
-        ladderPriceslist:[],//阶梯价
-        showIndex:''
+        allChecked: true,
+        submitIds: [],//去结算商品Ids
 
     },
     computed: {
@@ -33,9 +25,19 @@ var shoppingCart = new Vue({
                 if (r.code === 0 && r.data) {
                     _self.listData = r.data.list;
                     _self.invalidData = r.data.invalid;
-                    _self.totalSize = r.data.totalSize;
+                    _self.kindCount = r.data.kindCount;
                     _self.totalCount = r.data.totalCount;
                     _self.totalPrice = r.data.totalPrice;
+                    // 默认全选
+                    _self.listData.forEach(function(supplier){
+                        supplier.checked = true;
+                        if(supplier.cartList.length>0){
+                            supplier.cartList.forEach(function(cartItem){
+                                _self.submitIds.push(cartItem.productId);
+                            })
+                        }
+                    });
+                    _self.allChecked = true;
                 }
                 _self.listLoading = false;
             });
@@ -55,111 +57,118 @@ var shoppingCart = new Vue({
             $(el).parents('.priceTag').find('.tag').removeClass("on").siblings('.ladder').hide();
             if(!isPC){looseBody();}
         },
-        changeCountAdd:function(item,pros){//商品数量加加
-         var _this = this;
-        console.log(item,pros)
-				if(pros.step === 2){
-					pros.isStep = false;
-					pros.number += pros.min;
-					_this.isStock = false
-				}else{
-					pros.number++;
-					_this.isStock = false
-				}
-			   _this.totalPeice(item)
-			},
-		changeCountSub:function(item,pros){//商品数量减减
-		        var _this = this;
-				if(pros.number<=pros.min){
-					pros.number= pros.min;
-					_this.tipsName = true;
-					_this.fromMessage = '该商品最小起批量为'+pros.min;
-					 setTimeout(function(){
-                         _this.tipsName = false;
-                    },1000);
-					return
-				}else{
-					if(pros.step === 2){
-						pros.isStep = false;
-						pros.number -= pros.min
-					}else{
-						pros.number--
-					}
-					 _this.tipsName = false;
-					 _this.totalPeice(item)
-				}
-			},
-	 totalPeice:function(item){	//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
-				var prosPrice=0;
-				var productsList=item.cartList;
-				productsList.forEach(function(pros){
-					prosPrice+=pros.price*pros.number;
-					item.allPrice = prosPrice;
-				})
-			},
-	changeNnmber:function($event,item,pros){//输入商品数量更新
-				var _value = event.target.value;
-				var _this = this;
-				if(!_value){
-					pros.number = pros.min;
-				}else if(_value < pros.min){
-				    _this.tipsName = true;
-					_this.fromMessage = '该商品最小起批量为'+pros.min;
-					setTimeout(function(){
-                     _this.tipsName = false;
-                },1000);
-					pros.number = pros.min;
-				}else{
-				    _this.tipsName = false;
-					pros.number = parseInt(_value)
-				}
-				_this.totalPeice(item)
-			},
-        checkShop:function (item) {
-        var _this = this;
-          item.checked = !item.checked;
-          _this.setProductChecked(item);
-          _this.updateCheckAllBtn();
-            console.log(item)
+        ckeckSupplier: function(event, supplierChecked){
+            var el = event.currentTarget;
+            var _self = this;
+            var cartList = $(el).parents('.supplierItem').find('input[name=cartList]');
+            this.$nextTick(function(){
+                if (supplierChecked) {
+                    $.each(cartList, function (index, item) {
+                        if (!_self.submitIds.includes(item.value*1)){
+                            _self.submitIds.push(item.value*1);
+                        }
+                    });
+                }else{
+                    $.each(cartList, function (index, item) {
+                        var loc = _self.submitIds.indexOf(item.value*1);
+                        if(loc >=0 ){
+                            _self.submitIds.splice(loc, 1);
+                            _self.allChecked = false;
+                        }
+                    });
+                }
+                _self.computedPrice();
+            });
+        },
+        ckeckAll: function(){
+            var _self = this;
+            this.$nextTick(function(){
+                if (_self.allChecked) {
+                    _self.submitIds = [];
+                    _self.listData.forEach(function(supplier){
+                        supplier.checked = true;
+                        if(supplier.cartList.length>0){
+                            supplier.cartList.forEach(function(cartItem){
+                                _self.submitIds.push(cartItem.productId);
+                            })
+                        }
+                    });
+                }else{
+                    _self.submitIds = [];
+                    _self.listData.forEach(function(supplier){
+                        supplier.checked = false;
+                    });
+                }
+                _self.computedPrice();
+            });
+        },
+        computedPrice: function(){
+            var _self = this;
+            this.$nextTick(function(){
+                var totalPrice = 0;
+                var kindCount = 0;
+                var totalCount = 0;
+                _self.listData.forEach(function(supplier){
+                    var supplierPrice = 0;
+                    if(supplier.cartList.length>0){
+                        supplier.cartList.forEach(function(cart){
+                            if (_self.submitIds.includes(cart.productId*1)){
+                                supplierPrice += cart.price*cart.number;
+                                kindCount += 1;
+                                totalCount += cart.number;
+                            }
+                        })
+                    }
+                    supplier.totalPrice = supplierPrice;
+                    totalPrice += supplier.totalPrice;
+                });
+                _self.totalPrice = totalPrice;
+                _self.kindCount = kindCount;
+                _self.totalCount = totalCount;
+            });
+        },
+        cartNumberSub: function(cart){
+            cart.number -= cart.step;
+            if (cart.number<cart.min){
+                cart.number = cart.min;
+            }
+            this.numberChange(cart);
+        },
+        cartNumberAdd: function(cart){
+            cart.number += cart.step;
+            this.numberChange(cart);
         },
-        setProductChecked:function(item) {
-				var products = item.cartList;
-				products.forEach(function (pros){
-					if(item.checked) {
-						// 有效
-						pros.productsChecked = true;
-					} else {
-						pros.productsChecked = false;
-					}
-				})
-			},
-		updateCheckAllBtn:function() {// 全选勾选判断
-		        var _this = this;
-				var goodsCheckedLength = 0,
-					disabledListLength = 0,
-					goodsList = _this.listData;
-				goodsList.forEach(function(item) {
-					if(item.checked) {
-						goodsCheckedLength++;
-					}
-				})
-				console.log(goodsCheckedLength)
-				_this.isCheckAll = goodsCheckedLength === goodsList.length - disabledListLength;
-				console.log(_this.isCheckAll)
-			},
-     showladder:function(index){
-         var _this = this;
-         _this.showIndex = index;
-         console.log(index)
-          _this.isShow = !_this.isShow;
-     },
-	 activity:function () {
-           var _this = this;
-           _this.isShow = !_this.isShow;
+        cartNumberChange: function(cart){
+            cart.number = Math.ceil(cart.number/cart.step)*cart.step;
+            this.numberChange(cart);
+        },
+        numberChange: function(cart){
+            if(cart.ladderFlag){
+                cart.ladderPrices.forEach(function(ladder){
+                    if(cart.number>=ladder.buyNum){
+                        cart.price = ladder.buyPrice;
+                    }
+                });
+            }
+            // 计算价格
+            this.computedPrice();
+            // 更新购物车
+            var _self = this;
+            this.$nextTick(function(){
+                tokenAjax("post", "/shoppingCart/update", {
+                    userID: this.userId,
+                    productID: cart.productId,
+                    productCount: cart.number
+                },function (res) {
+                    console.log(res);
+                });
+            });
         },
-    activeBtn:function () {
-           var _this = this;
-            _this.isShow = false;
+        deleteCart: function(cartId){
+            alertInfo("确定要删除该商品?",function(){
+                // 删除逻辑
+                alert("test")
+            })
         },
 
     },

+ 66 - 0
src/main/resources/static/js/supplier-center/dashboard.js

@@ -0,0 +1,66 @@
+jqMultipleShow("click", ".navList", ".tab", ".con");
+var dashboard = new Vue({
+    el:'#dashboard',
+    data:{
+        Tab:[
+            {title:'我的交易',
+            List:[
+                {name:'我的首页',path:'/supplier/dashboard.html'},
+                {name:'我的订单',path:'/supplier/order/list.html'},
+                {name:'结算管理',path:'/supplier/order/settlement.html'},
+                {name:'评价管理',path:''},
+            ]},
+            {title:'我的店铺',
+            List:[
+                {name:'查看店铺',path:''},
+                {name:'装扮主页',path:'/supplier/decoration.html'},
+                {name:'发布商品',path:'/supplier/release.html'},
+                {name:'我的商品',path:'/supplier/goods.html'},
+                {name:'品牌管理',path:''},
+            ]},
+            {title:'管理中心',
+             List:[
+                {name:'资料信息',path:'/supplier/setting/information.html'},
+                {name:'员工管理',path:'/supplier/operation/list.html'},
+             ]
+            },
+            {title:'账户设置',List:[
+                {name:'重置密码',path:'/supplier/setting/password.html'},
+                {name:'更换手机',path:'/supplier/setting/phone.html'},
+            ]},
+        ],
+        userId:'',
+        homeData:'',
+        shopinfo:{},
+        promotions:{},
+        msgFlag:false,
+
+    },
+     methods: {
+
+    },
+    mounted:function () {
+        var _this = this;
+        var userInfo = CAIMEI.Storage.getItem('userInfo');
+        _this.userId =JSON.parse(userInfo).userId
+        console.log(_this.userId)
+        SupplierApi.homePageData({userId:_this.userId},function (res) {
+        if(res.code==0){
+             _this.homeData = res.data;
+             _this.shopinfo = res.data.shop;
+             _this.promotions = res.data.promotions;
+             if (res.data.unReadMessageCount>99){
+                 res.data.unReadMessageCount = '99+';
+                 _this.msgFlag = true
+             }else if(res.data.unReadMessageCount == 0){
+                 _this.msgFlag = false
+             }else {
+               _this.msgFlag = true
+             }
+             console.log(res)
+        }
+
+
+        })
+    }
+})

+ 51 - 30
src/main/resources/templates/shopping/cart.html

@@ -37,7 +37,7 @@
         </div>
         <div class="listWrap">
             <div v-if="isPC" class="cartTit clear">
-                <div class="c0"><input class="check" type="checkbox"></div>
+                <div class="c0"><input class="check" type="checkbox" @change="ckeckAll()" v-model="allChecked"></div>
                 <div class="c1">全选</div>
                 <div class="c2">商品信息</div>
                 <div class="c4">单价(元)</div>
@@ -46,19 +46,19 @@
                 <div class="c7">操作</div>
             </div>
             <div class="supplierItem" v-for="supplier,index in listData">
-                <div  class="supplierInfo  top">
-                    <div v-if="isPC" class="c0"><input class="check"  type="checkbox" @click.stop="checkShop(supplier)" ></div>
-                    <div v-if="isPC" class="c2"><a class="name" :href="'/supplier/index.html?id='+supplier.id" v-text="supplier.name" target="_blank"></a></div>
-                </div>
-                <div v-if="!isPC" class="supplierTit">
-                    <div class="c0"><input class="check" type="checkbox"></div>
+                <div class="supplierTit">
+                    <div class="c0">
+                        <input class="check" type="checkbox" @change="ckeckSupplier($event, supplier.checked)" v-model="supplier.checked">
+                    </div>
                     <a  :href="'/supplier/index.html?id='+supplier.id" target="_blank">
                         <img class="img" :src="supplier.logo">
                         <span class="name" v-text="supplier.name"></span>
                     </a>
                 </div>
                 <div class="cartItem clear"  v-for="cart in supplier.cartList" >
-                    <div class="c0"><input class="check" type="checkbox" name="cartList"></div>
+                    <div class="c0">
+                        <input class="check" type="checkbox" name="cartList" :value="cart.productId" v-model="submitIds" @change="computedPrice()">
+                    </div>
                     <div class="c1"><a :href="'/product-'+cart.productId+'.html'" target="_blank">
                         <img class="image" :src="cart.image">
                     </a></div>
@@ -68,16 +68,39 @@
                         </a>
                     </div>
                     <div class="c4">
-                        <span class="price">
-                            <em v-text="'¥'+toFloat(cart.price)"></em>
-                            <!-- 促销活动 -->
-                            <template v-if="cart.actStatus==1">
-                                 <span class="activity" style="margin: auto;" @click="activity" :class="isShow?'activitystyle':''" >{{cart.promotions.name}}<i class="icon" :class="isShow?'activeicon':''"></i></span>
+                        <div class="price">
+                            <template v-if="cart.actStatus==1 && cart.promotions && cart.promotions.type==1 && cart.promotions.mode==1">
+                                <del v-text="'¥'+toFloat(cart.originalPrice)"></del>
+                            </template>
+                            <template v-else>
+                                <em v-text="'¥'+toFloat(cart.price)"></em>
                             </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>
+                                <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>
+                            </div>
                             <!-- 阶梯价 -->
-                            <span v-else-if="cart.ladderFlag" class="priceTag">
+                            <div v-else-if="cart.ladderFlag" class="priceTag">
                                 <i class="tag icon mIcon" @click="toggleThisLadder($event)">阶梯价格</i>
-                                <span class="ladder mFixed">
+                                <div class="ladder mFixed">
                                     <span>
                                         <em class="t"><i>价格</i><i>起订量</i></em>
                                         <em v-for="l in cart.ladderPrices">
@@ -86,26 +109,25 @@
                                         </em>
                                         <em @click="hideThisLadder($event)" class="close">了解</em>
                                     </span>
-                                </span>
-                            </span>
-                        </span>
+                                </div>
+                            </div>
+                        </div>
                     </div>
                     <div class="c5">
                         <span class="number">
-                            <em class="sub"@click="changeCountSub(supplier,cart)">-</em>
-                            <input type="number" :value="cart.number" v-model="cart.number" @blur="changeNnmber($event,supplier,cart)">
-                            <em class="add" @click="changeCountAdd(supplier,cart)">+</em>
+                            <em class="sub" @click="cartNumberSub(cart)">-</em>
+                            <input type="number" :value="cart.number" v-model="cart.number" @change="cartNumberChange(cart)">
+                            <em class="add" @click="cartNumberAdd(cart)">+</em>
                         </span>
-                        <p class="tips-text" v-if="tipsName">{{fromMessage}}</p>
                         <input type="hidden" :value="cart.step"></div>
                         <div v-if="isPC" class="c6"><span v-text="'¥'+toFloat(cart.price*cart.number)"></span></div>
-                        <div v-if="isPC" class="c7"><span class="del">×<em class="tips">删除</em></span></div>
-                </div>
-                <div class="supplierInfo">
-                    <div class="c7"style="width: 100%;text-align: right"><span>合计:<em v-text="'¥'+toFloat(supplier.allPrice)"></em></span></div>
+                        <div v-if="isPC" class="c7"><span class="del" @click="deleteCart(cart.id)">×<em class="tips">删除</em></span></div>
+                    </div>
+                <div class="supplierBtn">
+                    <span>合计:<em v-text="'¥'+toFloat(supplier.totalPrice)"></em></span>
                 </div>
             </div>
-            <div class="invalidTit">
+            <div class="invalidTit" v-if="invalidData.length>0">
                 <div class="tit">失效商品 <em v-text="invalidData.length"></em> 件</div>
                 <span class="delAll">清空失效商品</span>
             </div>
@@ -137,18 +159,17 @@
         <div class="summary">
             <div class="left mfbt">
                 <div class="item">
-                    <input class="check" type="checkbox">
+                    <input class="check" type="checkbox" @change="ckeckAll()" v-model="allChecked">
                     <span>全选</span>
                     <a class="delete" href="javascript:void(0);">删除</a>
                 </div>
-                <div class="item">商品种类:<em v-text="totalSize"></em></div>
+                <div class="item">商品种类:<em v-text="kindCount"></em></div>
                 <div class="item">商品数量:<em v-text="totalCount"></em></div>
             </div>
             <div class="right mfbt">
                 <div class="item">总价:<em v-text="'¥'+toFloat(totalPrice)"></em></div>
                 <a class="submit" href="javascript:void(0);">去结算</a>
             </div>
-
         </div>
     </div>
 </div>

+ 83 - 3
src/main/resources/templates/supplier-center/dashboard.html

@@ -4,20 +4,100 @@
 <head>
     <title>采美365网-中国美业全方位线上交易服务互动平台,做美业,上采美</title>
     <template th:replace="components/head-link"></template>
-
+    <link th:if="${pageId==1026}" th:href="@{/css/base/form.css(v=${version})}" rel="stylesheet" type="text/css">
+    <link th:href="@{/css/supplier-center/dashboard.css(v=${version})}" rel="stylesheet" type="text/css">
 </head>
 <body>
 <!-- 引用头部 -->
 <template th:replace="components/header"></template>
 
 <!-- 我的采美 -->
-<div>
+<div id="dashboard">
+    <div class="crumbs">
+        <span>我的交易</span>
+        <span>&gt;</span>
+        <span>我的首页</span>
+    </div>
+    <div class="wrap clear mf">
+        <div class="left">
+            <div class="title">我的交易</div>
+                <div class="navList" v-for="(tab,index) in Tab">
+                <span class="tab">{{tab.title}}</span>
+                <div class="con">
+                    <a :href="item.path" v-for="(item,index) in tab.List">{{item.name}}</a>
+                </div>
+            </div>
+        </div>
+        <div class="right">
+            <div class="information">
+                <div class="head">
+                    <img src="">
+                </div>
+                <div class="info_main">
+                    <div class="">
+                         <h3>{{shopinfo.sname}}</h3>
+                         <span></span>
+                    </div>
+                    <p class="username">用户名:{{shopinfo.name}}</p>
+                    <span class="perfect">立即完善</span>
+                    <span class="ziliao">资料完整度:<span>{{homeData.dataIntegrity}}</span></span>
+                </div>
+                <div class="message">
+                    <span class="msg_num" v-if="msgFlag">{{homeData.unReadMessageCount}}</span>
+                    <span class="icon mIcon msg"></span>
+                </div>
+            </div>
+            <div class="product">
+                <p>商品数据</p>
+                 <ul>
+                     <li class="icon confirm">
+                         <a>待确认</a>
+                     </li>
+                      <li class="icon other confirm">
+                         <a>待付款</a>
+                     </li>
+                     <li class="icon other confirm">
+                         <a>待发货</a>
+                     </li>
+                     <li class="icon other confirm">
+                         <a>已发货</a>
+                     </li>
+                     <li class="icon other confirm">
+                         <a>退货/款</a>
+                     </li>
+                 </ul>
+            </div>
+            <div class="ranking">
+                <div class="rank_top">
+                    <p>单品销售排名</p>
+                    <span>(统计标准:已确认的订单)</span>
+                    <a>查看全部 > </a>
+                </div>
+                <div class="sales-ranke">
+                <ul>
+                    <li>排名</li>
+                    <li>商品信息</li>
+                    <li>销量</li>
+                </ul>
+            </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/common/ajax.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/supplier.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/utils.service.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/supplier-center/dashboard.js(v=${version})}"></script>
 </body>
 </html>