Selaa lähdekoodia

commit -m 购物车促销活动

zhengjinyi 4 vuotta sitten
vanhempi
commit
1166f52888

+ 0 - 14
api/order.js

@@ -7,20 +7,6 @@
 import request from '@/common/config/caimeiApi.js'
 import $reg from '@/common/config/common.js'
 
-/**
- *@结算页面
- */
-export function createOrderInfo(params) {
-	return new Promise(function(resolve,reject) {
-		request.get('/order/confirm',params, res => {
-			if(res.code == 0){
-				resolve(res)
-			}else{
-				reject(res)
-			}
-		})
-	})
-}
 /**
  *@提交订单
  */

+ 2 - 2
common/config/config.js

@@ -2,9 +2,9 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.68:8008'	 //本地IP联调地址
-	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 105 - 13
components/cm-module/creatOrder/goodsList.vue

@@ -9,7 +9,7 @@
 				</view>
 				<view class="productlist" v-for="(pros,idx) in item.cartList" :key="idx">
 					<view class="goods-pros-t">
-						<view class="pros-img"><image :src="pros.image" alt="" /></view>
+						<view class="pros-img"><image :src="pros.image" alt="" /><text class="tips">赠品</text></view>
 						<view class="pros-product">
 							<view class="producttitle">{{pros.name}}</view>
 							<view class="productspec"  v-if="pros.productCategory!=2">规格:{{pros.unit}}</view>
@@ -17,12 +17,20 @@
 								<view >商品编码:{{pros.productCode}}</view>
 							</view>
 							<view class="productprice">
-								<view class="price">
-									<text>¥{{pros.price.toFixed(2)}}</text>
-								</view>
-								<view class="count">
-									<text class="small">x</text>{{pros.number}}
+								<view class="price"><text>¥{{pros.price | NumFormat}}</text></view>
+								<view class="count"><text class="small">x</text>{{pros.number}}</view>
+							</view>
+							<view v-show="pros.actStatus==1" class="floor-item-act">
+								<view v-if="PromotionsFormat(pros.promotions)"  class="floor-tags" @click.stop="clickPopupShow(pros,1)">
+									{{pros.promotions.name}}
+									<text v-if ="pros.promotions!=null">
+										:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
+									</text>
 								</view>
+								<view v-else class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>	
+							</view>
+							<view  v-if="pros.actStatus == null  &&  pros.ladderFlag == 1" class="floor-item-act">
+								<view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>	
 							</view>
 						</view>	
 					</view>
@@ -39,7 +47,14 @@
 						</view>
 				</view>
 				<view class="goods-pros-b">
-					<view class="sum">合计:<text class="money">¥{{item.totalPrice.toFixed(2)}}</text></view>
+					<view class="sum-none" v-if="(item.originalPrice - item.totalPrice)>0">
+						<text class="money-sign">¥</text>
+						<text class="money">{{ item.originalPrice | NumFormat }}</text>
+						<text class="money-reduced">
+							<text class="iconfont icon-biaoqian"></text>减<text>¥{{ (item.originalPrice - item.totalPrice) | NumFormat}}</text>
+						</text>
+					</view>
+					<view class="sum">合计:<text class="money">¥{{ item.totalPrice | NumFormat }}</text></view>
 				</view>
 			</view>
 		</view>	
@@ -62,6 +77,11 @@
 		created(){
 			
 		},
+		filters:{
+			NumFormat(value) {//处理金额
+				return Number(value).toFixed(2);
+			},
+		},	
 		watch: {
 			goodsData: {
 				handler: function (el) {//监听对象的变换使用 function,箭头函数容易出现this指向不正确
@@ -74,6 +94,16 @@
 
 		},
 		methods:{
+			PromotionsFormat(promo){//促销活动类型数据处理
+				if(promo!=null){
+					if(promo.type == 1 && promo.mode == 1){
+						return true
+					}else{
+						return false
+					}
+				}
+				return false
+			},
 			changeHandle (index) {//输入框的值被改变后
 				this.goodsData[index].note = this.remark[index]
 				this.$emit('handleGoodList',this.goodsData)
@@ -134,18 +164,33 @@
 				display: flex;
 				align-items: center;
 				width: 100%;
-				height: 217rpx;
+				height: auto;
 				padding:12rpx 0;
 				.pros-img{
 					width: 210rpx;
 					height: 100%;
 					border-radius: 10rpx;
 					margin:0 26rpx 0 0;
-					border:1px solid #f3f3f3;
+					position: relative;
+					.tips{
+						display: inline-block;
+						width: 80rpx;
+						height: 40rpx;
+						background-image: linear-gradient(214deg, #ff4500 0%, #ff5800 53%, #ff4367 100%);
+						line-height: 40rpx;
+						text-align: center;
+						font-size: $font-size-24;
+						color: #FFFFFF;
+						border-radius:10rpx 0 10rpx 0 ;
+						position: absolute;
+						top:0;
+						left: 0;
+					}
 					image{
-						width: 100%;
-						height: 100%;
+						width: 210rpx;
+						height: 210rpx;
 						border-radius: 10rpx;
+						border:1px solid #f3f3f3;
 					}
 				}
 			}
@@ -179,9 +224,8 @@
 				}
 				.productprice{
 					height: 48rpx;
-					position: absolute;
 					width: 100%;
-					bottom: 0;
+					float: left;
 					.price{
 						line-height: 48rpx;
 						font-size: $font-size-28;
@@ -198,6 +242,26 @@
 						}
 					}
 				}
+				.floor-item-act{
+					width: 100%;
+					height: 56rpx;
+					text-align: center;
+					box-sizing: border-box;
+					float: left;
+					padding:0 0 10rpx 0;
+					.floor-tags{
+						float: left;
+						height: 36rpx;
+						border-radius: 4rpx;
+						background-color: rgba(225, 86, 22, 0.1);
+						line-height: 36rpx;
+						color: $color-system;
+						text-align: center;
+						display: inline-block;
+						padding:0 16rpx;
+						font-size: $font-size-20;
+					}
+				}
 			}
 			.goods-pros-m{
 				height: 76rpx;
@@ -238,7 +302,35 @@
 			.goods-pros-b{
 				width:100%;
 				height: auto;
+				.sum-none{
+					width: 100%;
+					height: 48rpx;
+					line-height: 48rpx;
+					color: $text-color;
+					float: left;
+					text-align: right;
+					.money{
+						font-size: $font-size-26;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-sign{
+						font-size: $font-size-26;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-reduced{
+						margin-left: 10rpx;
+						font-size: $font-size-26;
+						color: #ff2a2a;
+						.iconfont{
+							font-size: $font-size-34;
+						}
+					}
+				}
 				.sum{
+					width: 100%;
+					height: 60rpx;
 					font-size: $font-size-28;
 					line-height: 60rpx;
 					color: $text-color;

+ 15 - 3
components/cm-module/listTemplate/classifyProductList.vue

@@ -11,7 +11,9 @@
 					<view class="list-details-specs" v-if="item.productCode!=''&&item.productCode!=null">商品编码:{{item.productCode}}</view>
 					<view class="list-details-price">
 						<view class="floor-item-act" v-if="item.actStatus==1">
-							<view class="floor-tags" v-if="item.promotions.type == 1 && item.promotions.mode==1">{{item.promotions.name}}<text v-if="hasLogin">:¥{{ item.price | NumFormat }}</text></view>
+							<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
+								{{item.promotions.name}}<text v-if="hasLogin">:¥{{ item.price | NumFormat }}</text>
+							</view>
 							<view class="floor-tags" v-else>{{item.promotions.name}}</view>	
 						</view>
 						<view class="floor-item-act" v-if="item.actStatus ==0  &&  item.ladderPriceFlag==1">
@@ -29,14 +31,14 @@
 									<view class="price-larger" v-if="item.price1TextFlag == '2'">
 										<text class="txt">¥价格仅会员可见</text>
 									</view>
-									<text v-else class="price-larger" :class="item.promotions.type == 1 && item.promotions.mode==1 ? 'none' : ''">¥{{item.retailPrice | NumFormat}}</text>
+									<text v-else class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">¥{{item.retailPrice | NumFormat}}</text>
 								</view>
 							</view>
 							<view v-if="userIdentity == 2">
 								<view class="price-larger" v-if="item.price1TextFlag == '1'">
 									<text class="txt">¥未公开价格</text>
 								</view>
-								<text v-else class="price-larger" :class="item.promotions.type == 1 && item.promotions.mode==1 ? 'none' : ''">¥{{item.retailPrice | NumFormat}}</text>
+								<text v-else class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">¥{{item.retailPrice | NumFormat}}</text>
 							</view>
 						</view>	
 						<view  v-else class="list-login-now">
@@ -214,6 +216,16 @@
 				this.isModallayer = true;
 				this.$api.navigateTo(`/pages/goods/product?id=${id}`);
 				this.isModallayer = false;
+			},
+			PromotionsFormat(promo){//促销活动类型数据处理
+				if(promo!=null){
+					if(promo.type == 1 && promo.mode == 1){
+						return true
+					}else{
+						return false
+					}
+				}
+				return false
 			}
 		}
 	}

+ 16 - 4
components/cm-module/listTemplate/commodityList.vue

@@ -11,7 +11,9 @@
 					<view class="list-details-specs" v-if="item.p_code!=''&&item.p_code!=null">商品编码:{{item.p_code}}</view>
 					<view class="list-details-price">
 						<view class="floor-item-act" v-if="item.actStatus==1">
-							<view class="floor-tags" v-if="item.promotions.type == 1 && item.promotions.mode==1">{{item.promotions.name}}<text v-if="hasLogin">:¥{{ item.price | NumFormat }}</text></view>
+							<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
+								{{item.promotions.name}}<text v-if="hasLogin">:¥{{ item.price | NumFormat }}</text>
+							</view>
 							<view class="floor-tags" v-else>{{item.promotions.name}}</view>	
 						</view>
 						<view class="floor-item-act" v-if="item.actStatus ==0  &&  item.ladderPriceFlag==1">
@@ -20,7 +22,7 @@
 						<view v-if="hasLogin" class="list-price">
 							<view v-if="userIdentity == 1">
 								<text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
-								<text v-else class="price-larger" :class="item.promotions.type == 1 && item.promotions.mode==1 ? 'none' : ''">¥{{ item.price | NumFormat }}</text>
+								<text v-else class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">¥{{ item.price | NumFormat }}</text>
 							</view>	
 							<view v-if="userIdentity == 4">
 								<view class="price-larger" v-if="item.p_price_flag == '1'">
@@ -31,7 +33,7 @@
 									<view class="price-larger" v-if="item.p_price_flag == '2'">
 										<text class="txt">¥价格仅会员可见</text>
 									</view>
-									<text v-else class="price-larger" :class="item.promotions.type == 1 && item.promotions.mode==1 ? 'none' : ''">¥{{item.price | NumFormat}}</text>
+									<text v-else class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">¥{{item.price | NumFormat}}</text>
 								</view>
 							</view>
 							<view v-if="userIdentity == 2">
@@ -39,7 +41,7 @@
 									<text class="txt">¥未公开价格</text>
 								</view>
 								<text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
-								<text v-else class="price-larger" :class="item.promotions.type == 1 && item.promotions.mode==1 ? 'none' : ''" >¥{{item.price | NumFormat}}</text>
+								<text v-else class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''" >¥{{item.price | NumFormat}}</text>
 							</view>
 						</view>	
 						<view  v-else class="list-login-now">
@@ -226,6 +228,16 @@
 				this.isModallayer = true;
 				this.$api.navigateTo(`/pages/goods/product?id=${id}`);
 				this.isModallayer = false;
+			},
+			PromotionsFormat(promo){//促销活动类型数据处理
+				if(promo!=null){
+					if(promo.type == 1 && promo.mode == 1){
+						return true
+					}else{
+						return false
+					}
+				}
+				return false
 			}
 		}
 	}

+ 62 - 35
components/cm-module/listTemplate/productList.vue

@@ -10,24 +10,31 @@
 						<text class="list-details-specs">规格:{{item.unit !=null ? item.unit : ''}}</text>
 						<text class="list-details-miniQuantity">起订量:{{ item.ladderPriceFlag == '1' ? item.maxBuyNumber : item.minBuyNumber}}</text>
 						<view class="list-details-price" v-if="item.price1TextFlag == 1">
-							<view class="list-none">
-								<view class="price-small">未公开价格</view>
-							</view>
+							<view class="list-none"><view class="price-small">未公开价格</view></view>
 						</view>
 						<view class="list-details-price" v-else>
 							<view class="list-shop">
-								<view class="list-price" >
-									<text class="price-view activity" v-if="item.isShowActFlg">活动价</text>
-									<text class="price-view ladder" v-if="item.ladderPriceFlag == '1'">阶梯价</text>
-									<text class="price-larger">¥{{item.retailPrice.toFixed(2)}}</text>
-								</view>
 								<view class="list-price-none" v-if="item.repurchasePriceState">
 									<text class="price-none">¥{{item.discountPrice}}</text>
 									<text class="iconfont icon-wenhao" @click.stop="repurchModel"></text>
 								</view>
+								<view class="list-price" v-else>
+									<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">¥{{item.retailPrice | NumFormat}}</text>
+								</view>
 							</view>
-							<button class="add-cart-btn" @click.stop="operationHanld(item)">数量</button>
 						</view>
+						<view class="list-details-price" v-if="item.actStatus==1">
+							<view class="floor-item-act">
+								<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
+									{{item.promotions.name}}<text v-if="hasLogin">:¥{{ item.price | NumFormat }}</text>
+								</view>
+								<view class="floor-tags" v-else>{{item.promotions.name}}</view>	
+							</view>
+							<view class="floor-item-act" v-if="item.actStatus ==0  &&  item.ladderPriceFlag==1">
+								<view class="floor-tags">阶梯价格</view>	
+							</view>
+							<button class="add-cart-btn" @click.stop="operationHanld(item)">数量</button>
+						</view>	
 					</view>
 				</view>
 				<button class="show-more-btn" v-if="showRegularBtn" @click="getListFromServer(true)">查看更多</button>
@@ -105,6 +112,11 @@
 				this.getProductAgainInfo()
 			})
 		},
+		filters: {
+			NumFormat:function(text) {//处理金额
+				return Number(text).toFixed(2);
+			},
+		},
 		computed: {
 			...mapState(['hasLogin','userInfo'])
 		},
@@ -189,6 +201,16 @@
 			repurchModel(){
 				this.$util.modal('','此商品的价格有变化,原来的购买价已不适用','知道了','',false,() =>{})
 			},
+			PromotionsFormat(promo){//促销活动类型数据处理
+				if(promo!=null){
+					if(promo.type == 1 && promo.mode == 1){
+						return true
+					}else{
+						return false
+					}
+				}
+				return false
+			},
 			btnClick() {
 				this.$api.navigateTo('/pages/goods/cart')
 			},
@@ -228,7 +250,7 @@
 		}
 	}
 	.all-type-list-content {
-		height: 240rpx;
+		height: auto;
 		padding: 24rpx;
 		background: #fff;
 		margin-bottom: 2rpx;
@@ -271,9 +293,25 @@
 	}
 	.list-details-price {
 		width: 100%;
-		display: flex;
-		flex-direction: row;
-		justify-content: space-between;		
+		.floor-item-act{
+			height: 54rpx;
+			text-align: center;
+			box-sizing: border-box;
+			float: left;
+			.floor-tags{
+				float: left;
+				height: 36rpx;
+				border-radius: 4rpx;
+				background-color: rgba(225, 86, 22, 0.1);
+				line-height: 36rpx;
+				color: $color-system;
+				text-align: center;
+				display: inline-block;
+				padding:0 16rpx;
+				margin-top: 9rpx;
+				font-size: $font-size-20;
+			}
+		}
 		.price-icon {
 			width: 22rpx;
 			height: 28rpx;
@@ -323,22 +361,9 @@
 					margin-top: 20rpx;
 					font-size: $font-size-30;
 					display: inline-block;
-				}
-				.price-view{
-					display: inline-block;
-					width: 78rpx;
-					border-radius: 18rpx;
-					font-size: $font-size-20;
-					text-align: center;
-					color: #FFFFFF;
-					height: 36rpx;
-					line-height: 36rpx;
-					margin-right: 8rpx;
-					&.ladder{
-						background: linear-gradient(135deg,rgba(255,0,0,1) 0%,rgba(242,143,49,1) 100%);
-					}
-					&.activity{
-						background: linear-gradient(135deg,rgba(128,0,255,1) 0%,rgba(242,49,153,1) 100%);
+					&.none{
+						text-decoration: line-through;
+						color: #999999;
 					}
 				}
 			}
@@ -358,14 +383,16 @@
 		}
 		.add-cart-btn {
 			flex: 4;
-			width: 156rpx;
-			height: 64rpx;
-			line-height: 64rpx;
-			border-radius: 32rpx;
+			width: 140rpx;
+			height: 54rpx;
+			line-height: 54rpx;
+			border-radius: 27rpx;
 			color: #fff;
-			font-size: 26rpx;
+			font-size: 24rpx;
 			margin-right: 0;
-			background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
+			background:#FFFFFF;
+			border: 1px solid #C9C9C9;
+			color: $text-color;
 		}
 	}
 </style>

+ 1513 - 1308
pages/goods/cart.vue

@@ -1,1309 +1,1514 @@
-<template>
-	<view class="container cart clearfix" v-if="hasLogin" :style="{paddingTop:CustomBar+'px'}"> 	
-		<headerNavbar :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :page='1'></headerNavbar>
-		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
-		<view class="container-cart-main tui-skeleton">
-			<view v-if="!isEmpty" class="container-cart">
-				<view class="cart-content" :style="{paddingBottom :isIphoneX ? (68+100)+'rpx' : '100rpx'}">
-					<view class="goods-list">
-						<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
-							<view class="shoptitle">
-								<!--选择商店的全部商品"-->
-								<view class="checkbox-box" @click.stop="checkShop(item)">
-									<button class="checkbox iconfont" 
-											:class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']" 									
-											:disabled="item.isDisabled && !isshowDelbtn">
-									</button>
-								</view>
-								<view class="text">{{item.name}}</view> 
-							</view>
-							<view class="productlist">
-								<view 	class="goods-pros" v-for="(pros,idx) in item.productsList" :key="idx" >
-									<view class="goods-pros-t">
-										<!--选择商品-->
-										<view class="checkbox-box" @click.stop="ischeck(item,pros)" :class="[pros.validFlag == '3' && !isshowDelbtn ?'disabled' : '']">
-											<button class="checkbox iconfont" 
-													:disabled="pros.validFlag == '3' && !isshowDelbtn"
-													:class="[pros.productsChecked ?'icon-gouxuanl':'icon-weigouxuan']">
-											</button>
-										</view>
-										<view class="pros-img" @click.stop="navToListPage(pros.productID)"	><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
-										<view class="pros-product">
-											<view class="producttitle" @click.stop="navToListPage(pros.productID)"	>
-												<text v-if="pros.validFlag == '3'" class="no-text">商品已下架</text>{{pros.name}}
-											</view>
-											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
-											<view class="productprice">
-												<!--使用过滤器对总价改变-->
-												<view class="price" :class="[pros.validFlag == '3' ?'disabled' : '']">
-													<text :class="[pros.validFlag == '3' ?'disabled' : 'money-sign']">¥</text>
-													{{pros.retailPrice?pros.retailPrice.toFixed(2):''}}
-												</view>
-												<view class="count" v-if="pros.validFlag == '2'"  :class="[isshowDelbtn ? 'none':'show']">
-													<text class="count-tips" v-if="pros.productCount<pros.minBuyNumber">起订量:{{pros.minBuyNumber}}</text>
-													<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
-													<view class="number-box">
-														<view  class="iconfont icon-jianhao" :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountSub(item,pros)"></view>
-														<input class="btn-input" type="number" maxlength='4' v-model="pros.productCount" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
-														<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == '3'?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
-													</view>
-												</view>
-											</view>
-										</view>	
-									</view>
-								</view>
-							</view>	
-							<view class="goods-pros-b" :class="[isshowDelbtn ? 'none':'show']" >
-								<view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice.toFixed(2)}}</text></view>
-							</view>
-						</view>
-					</view>	
-					<view class="failure-list" v-if="failureList.length>0">
-						<view class="failure-title">
-							<view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
-							<view class="title-btn" @click.stop="deletefailureList">清空失效商品</view>
-						</view>
-						<view class="productlist">
-							<view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
-								<view class="goods-pros-t" @click.stop="failureToProduct(failure)">
-									<!--选择商品-->
-									<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
-										<button class="checkbox iconfont" 
-												:class="[ failure.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
-										</button>
-									</view>
-									<view class="pros-img">
-										<image :src="failure.mainImage ? failure.mainImage:''" alt="" />
-										<text class="img-tip">失效</text>
-									</view>
-									<view class="pros-product">
-										<view class="producttitle">{{failure.name}}</view>
-										<view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
-										<view class="productstate">{{failureStateText(failure.failureState)}}</view>
-									</view>
-									<view class="pros-marks" v-if="failure.isFailureLayer"></view>
-								</view>
-							</view>
-						</view>	
-					</view>
-				</view>
-				<!-- 脚部菜单 -->
-				<view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
-					<view class="footer-le">
-						<view class="foot-check checkbox-box" @tap.stop="checkAll()">
-							<button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button> 
-							<view class="text">全选</view>
-						</view>
-						<view class="foot-check-delbtn">
-							<button class="delBtn" @tap.stop="showDelManager">删除</button>
-						</view>
-						<view class="sum">总价:<text class="money-sign">¥</text><text class="money">{{allPrice.toFixed(2)}}</text></view>
-					</view>
-					<view v-if="!isshowDelbtn" class="footer-ri" >
-						<view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
-					</view>
-					<view v-else class="footer-del">
-						<view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
-						<view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
-					</view>
-				</view>
-			</view>
-			<view v-else class="cart-content empty">
-				<view  class="empty-container">
-					<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
-					<text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
-					<view class="login-btn"  @click="goIndex">去商城</view>
-				</view>
-			</view>
-		</view>
-		<!-- 透明模态层 -->
-		<modal-layer v-if='modallayer'></modal-layer>
-	</view>
-</template>
-<script>
-	import authorize from '@/common/config/authorize.js'
-	import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
-	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
-	import tuiNomore from "@/components/tui-components/nomore/nomore"
-	import headerNavbar from "@/components/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
-	import modalLayer from "@/components/modal-layer"
-	import { mapState,mapMutations } from 'vuex';
-	
-	export default{
-		components:{
-			tuiSkeleton,
-			tuiLoadmore,
-			tuiNomore,
-			modalLayer,
-			headerNavbar
-		},
-		data(){
-			return{
-				nvabarData: {//顶部自定义导航
-					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
-					showSearch: 0,
-					title: '购物车', // 导航栏 中间的标题
-				},
-				headerBtnPosi:this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
-				systeminfo:this.setSysteminfo(),		 //获取设备信息
-				CustomBar:this.CustomBar,// 顶部导航栏高度
-				isIphoneX:this.$store.state.isIphoneX,
-				userID:'',
-				alertType:'',
-				isStock:'',
-				failureList:[],	//失效商品列表
-				goodsList:[],	//购物车的商品
-				delGoodsList:'',//要删除的商品
-				setGoodData:'', //确认订单的商品
-				isCheckAll:false,//是否全选
-				allPrice:0,//所有价格
-				allCount:0,//被选中的产品数量
-				isNnder:true,
-				isModallayer:false,
-				skeletonShow:true,
-				isshowDelbtn:false,
-				isDisabled: false, // 供应商/店铺全选是否禁用状态
-				isNoConfim:false,
-				isEmpty:false,//显示空购物车
-				scrollHeight: 'auto',
-				nomoreText: '上拉显示更多',
-				hasNextPage: false,
-				loadding: false,
-				pullUpOn: true,
-				pullFlag: true,
-				pageSize: 10,
-				pageNum: 1,
-			}
-		},
-		onLoad(){
-			this.setScrollHeight();
-		},
-		computed: {
-			...mapState(['hasLogin','userInfo'])
-		},
-		filters:{//单件商品的价格 × 数量
-		    totalprice(val,count){
-		        return (val * count).toFixed(2)
-		    }
-		},	
-		methods:{
-			initData(){
-				this.isModallayer = false //遮罩层 防止多次点击
-				this.skeletonShow = true //预加载圆圈
-				this.isCheckAll=false//是否全选
-				this.$api.getStorage().then((resolve) => {
-					this.userID = resolve.userID;
-					this.initGetCartGoodsList();
-				})	
-			},
-			initLogin(){
-				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
-					if(wxResponse == 1){
-						this.$api.redirectTo('/pages/login/login?type=4')
-					}else{
-						this.$api.navigateTo('/pages/authorization/authorization?type=1')
-					}
-				})	
-			},
-			setScrollHeight() {
-				// 窗口高度-footer高度
-				const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
-				setTimeout(()=> {
-					const query = uni.createSelectorQuery().in(this);
-					query.selectAll('.footer').boundingClientRect();
-					query.exec(res => {
-						this.windowHeight = windowHeight;
-						if(res[0][0]) {
-							this.scrollHeight = windowHeight - res[0][0].height;
-						}
-					})
-				}, 500)
-			},
-			initGetCartGoodsList(){//初始化购物车 index:1
-				let params = {userID:this.userID}
-				this.ProductService.queryShoppingCartList(params).then(response =>{
-					this.skeletonShow = false
-					this.$store.commit('updateAllNum',response.data.cartQuantity)
-					const responseData = response.data
-					if(responseData.pageDate.length > 0 || responseData.failureList.length > 0){
-						this.isEmpty =false
-					}else{
-						this.isEmpty =true
-					}
-					if(responseData.pageDate && responseData.pageDate.length > 0 ){
-						this.goodsList = responseData.pageDate;
-						this.goodsList.forEach((item,index) => {
-							let productsListLength = item.productsList.length,
-								invalidLength = 0;
-							item.productsList.forEach(pros => {
-								pros.shopID = item.shopID;
-								pros.isStep = false
-								if(pros.validFlag == '3' ) {invalidLength++;}
-								if(pros.step === 2){
-									if(pros.productCount % pros.minBuyNumber != 0){
-										pros.productCount = pros.minBuyNumber
-										this.totalShopPeice()
-										this.updateShoppogNum(pros)
-									}
-								}
-							})
-							item.isDisabled = invalidLength === productsListLength;
-						})
-					} else {
-						this.goodsList = [];
-					}
-					if( responseData.failureList && responseData.failureList.length > 0){
-						let newFailureList = [],isFailureLayer;
-						responseData.failureList.forEach((failure,index) => {
-							if(failure.failureState == 1 || failure.failureState == 2) {
-								isFailureLayer = true
-							}else{
-								isFailureLayer = false
-							}
-							newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
-						})
-						this.failureList = newFailureList
-					} else {
-						this.failureList = [];
-					}
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			},		
-			getOnReachBottomData(){//上拉加载
-				this.pageNum+=1
-				let params = {userID:this.userID,pageNum:this.pageNum,pageSize:this.pageSize}
-				this.ProductService.queryShoppingCartList(params).then(response =>{
-					let resultsData = response.data.pageDate
-					this.hasNextPage = resultsData.hasNextPage;
-					this.goodsList = this.goodsList.concat(resultsData.results)
-					this.goodsList.forEach((item,index) => {
-						let productsListLength = item.productsList.length,
-							invalidLength = 0;
-						item.productsList.forEach(pros => {
-							pros.shopID = item.shopID;
-							pros.isStep = false
-							if(pros.validFlag == '3' ) {invalidLength++;}
-							if(pros.step === 2){
-								if(pros.productCount % pros.minBuyNumber != 0){
-									pros.productCount = pros.minBuyNumber
-									this.totalShopPeice()
-									this.updateShoppogNum(pros)
-								}
-							}
-						})
-						item.isDisabled = invalidLength === productsListLength;
-					})
-					this.pullFlag = false;// 防上拉暴滑
-					setTimeout(()=>{this.pullFlag = true;},500)
-					if(this.hasNextPage){
-						this.pullUpOn = false
-						this.nomoreText = '上拉显示更多'
-					}else{
-						this.loadding = false
-						this.pullUpOn = false
-						this.nomoreText = '已至底部'
-					}
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			},
-			ischeckFailure(failure){
-				failure.productsChecked = !failure.productsChecked
-				this.updateCheckAllBtn()
-			},
-			ischeck(item,pro){//为未选中的时候改变为true,反之为true
-				pro.productsChecked = !pro.productsChecked;
-				this.updateProductCheckedAllBtn(item);
-				this.updateCheckAllBtn();
-			},
-			updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
-				let productsList = item.productsList,
-					productsCheckedLength = 0,
-					disabledLength = 0;
-				if(this.isshowDelbtn) {
-					productsList.forEach(pros => {
-						if(pros.productsChecked) {
-							productsCheckedLength++;
-						}
-					})
-				} else {
-					productsList.forEach(pros => {
-						if(pros.productsChecked && pros.validFlag != '3') {
-							productsCheckedLength++;
-						}
-						if(pros.validFlag == '3') {disabledLength++;}
-					})
-				}
-				item.checked = productsCheckedLength === productsList.length - disabledLength;
-			},
-			updateCheckAllBtn() {// 全选勾选判断
-				let goodsCheckedLength = 0,
-					disabledListLength = 0,
-					goodsList = this.goodsList,
-					failureList = this.failureList;
-				goodsList.forEach(item => {
-					if(item.checked) {
-						goodsCheckedLength++;
-					}
-					if(item.isDisabled && !this.isshowDelbtn) {
-						disabledListLength++;
-					}
-				})
-				failureList.forEach(failureItem=>{
-					if(failureItem.productsChecked){
-						goodsCheckedLength++;
-					}
-				})
-				this.isCheckAll = goodsCheckedLength === goodsList.length+failureList.length - disabledListLength;
-			},
-			checkShop(item){//与单选商品类似
-				item.checked = !item.checked;
-				this.setProductChecked(item);
-				this.updateCheckAllBtn();
-			},
-			setProductChecked(item) {
-				let products = item.productsList;
-				products.forEach(pros=>{
-					if(item.checked) {
-						if(pros.validFlag =='3'){
-							// 无效
-							this.isNnder = true;
-							pros.productsChecked = this.isshowDelbtn ?true :false;
-						}else{
-							// 有效
-							this.isNnder = false;
-							pros.productsChecked = true;
-						}
-					} else {
-						pros.productsChecked = false;
-					}
-				})
-				
-			},
-			updateBothCheckBtn() {
-				if(this.isshowDelbtn) {
-					// 当管理删除按钮出现时,失效的商品可被选择
-					this.goodsList.forEach((item)=>{
-						item.checked = this.isCheckAll;
-						this.setProductChecked(item);
-					})
-					//删除按钮 全选包括失效商品勾选
-					this.failureList.forEach(failureItem=>{
-						failureItem.productsChecked = this.isCheckAll;
-					})
-				} else {
-					this.goodsList.forEach((item)=>{
-						item.checked = this.isCheckAll && !item.isDisabled;
-						this.setProductChecked(item);
-					})
-				}
-			},
-			checkAll(){//全选方法内调用方法
-			    this.isCheckAll = !this.isCheckAll;
-				this.updateBothCheckBtn();     
-			},
-			totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
-				let prosPrice=0;
-				let validPrice =0;
-				let validList=[];
-				let productsList=[];
-				this.goodsList.map((item,index)=>{
-					productsList=item.productsList;
-					prosPrice=productsList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
-					productsList.forEach(pros =>{
-						if(pros.validFlag =='3'){
-							validList.push(pros)
-							validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
-							item.totalPrice = prosPrice - validPrice
-						}else{
-							item.totalPrice = prosPrice
-						}
-					})
-				})
-			},
-			totalPeice(){	//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
-			    this.allPrice = 0
-				let prosPrice=0;
-				let validPrice=0;
-				let validList =[];
-				let productsList =[];
-			    this.goodsList.forEach((item,index)=>{
-					productsList=item.productsList;
-					productsList.forEach(pros=>{	
-						if(pros.productsChecked){
-							prosPrice+=pros.retailPrice*pros.productCount;
-							if(pros.validFlag =='3'){
-								validList.push(pros)
-								validPrice = validList.reduce((p,e)=>p+e.retailPrice*e.productCount,0);
-								this.allPrice = prosPrice - validPrice
-							}else{
-								this.allPrice = prosPrice
-							}
-						}	
-					})
-			    })
-			},
-			totalCount(){//计算总数量
-			    this.allCount = 0
-				let prosAllCount=0
-				let validCount = 0
-				let validList =[];
-				let productsList =[];
-			    this.goodsList.forEach(item=>{
-					productsList = item.productsList
-					productsList.forEach(pros=>{
-						if(pros.productsChecked){
-							prosAllCount+=parseInt(pros.productCount);
-							if(pros.validFlag =='3'){
-								validList.push(pros)
-								validList.forEach(val =>{
-									validCount += val.productCount
-								})
-								this.allCount = prosAllCount - validCount
-							}else{
-								this.allCount = prosAllCount
-							}
-						}
-					})
-			    })
-			},		
-			changeCountAdd(item,pros){//商品数量加加
-				if(pros.step === 2){
-					pros.productCount += pros.minBuyNumber
-					this.processActivityPrice(pros)
-					this.isStock = false
-				}else{
-					pros.productCount++
-					this.processActivityPrice(pros)
-					this.isStock = false
-				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
-			},
-			changeCountSub(item,pros){//商品数量减减
-				if(pros.productCount<=pros.minBuyNumber){
-					pros.productCount= pros.minBuyNumber
-					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
-					return
-				}else{
-					if(pros.step === 2){
-						pros.productCount -= pros.minBuyNumber
-					}else{
-						pros.productCount--
-					}
-					this.processActivityPrice(pros)
-				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
-			},
-			changeInput(pros){//输入商品数量更新
-				pros.isStep = false
-			},
-			changeNnmber(e,item,pros){//输入商品数量更新
-				let _value = e.detail.value;
-				if(!this.$api.isNumber(_value)){
-					pros.productCount = pros.minBuyNumber
-				}else if(_value < pros.minBuyNumber){	
-					this.$util.msg(`该商品最小起订量为${pros.minBuyNumber}`,2000);
-					pros.productCount = pros.minBuyNumber
-				}else if(_value % pros.minBuyNumber != 0){
-					pros.isStep = true
-					pros.productCount = pros.minBuyNumber
-				}else{
-					pros.isStep = false
-					pros.productCount = e.detail.value
-					this.processActivityPrice(pros)
-				}
-				this.updateShoppogNum(pros)
-				this.totalShopPeice();
-			},
-			processActivityPrice(pros){//单独处理活动价格和阶梯价格
-				let ladderPriceList = pros.ladderPriceList;
-				if(pros.ladderPriceFlag == '0' || pros.actStatus == 1){
-					pros.retailPrice = pros.retailPrice
-				}else{
-					ladderPriceList.forEach((item,index)=>{
-						if(pros.productCount>=item.buyNum){
-							pros.retailPrice = item.buyPrice
-						}
-					})
-				}
-			},
-			updateShoppogNum(pros){//加减购物车商品更新到后台
-				let params ={userID:this.userID,productID:pros.productID,productCount:pros.productCount}
-				this.ProductService.shoppingCartUpdate(params).then(response =>{
-					this.isshowDelbtn = false;
-					this.initGetCartGoodsList();
-				}).catch(error =>{
-					this.$util.msg(error.msg,2000);
-				})
-			 },
-			toConfirmation(){//跳转确认订单页面
-				let setGoodsList=[];
-				this.goodsList.forEach(res=>{
-					let products = res.productsList
-					products.forEach(pros=>{
-						if(pros.productsChecked){
-						    setGoodsList.push(pros.productID)
-						}
-					})
-				})
-				if(setGoodsList == ''){
-					this.$util.msg("请先选择结算商品~",2000);
-					return
-				}else{
-					this.isNoConfim = false
-					this.goodsList.forEach(el=>{
-						el.productsList.forEach(pros=>{
-							if(pros.productsChecked){
-							   if(pros.productCount<pros.minBuyNumber){
-								   this.isNoConfim = true
-							   }
-							}
-						})
-					})
-					if(this.isNoConfim){
-						this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
-						return;
-					}
-					let productID = '';
-					this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
-						el.productsList.forEach(pros=>{
-							if(pros.productsChecked){
-							   productID += pros.productID+','
-							}
-						})
-					})
-					let cartPramsData={
-							allPrice:this.allPrice,
-							allCount:this.allCount,
-							productID:productID.substring(0,productID.lastIndexOf(',')),
-							productCount:''
-						}
-					this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
-				}
-			},
-			showDelManager(){//显示删除商品管理
-				this.isshowDelbtn = true;
-				this.isNnder = true;
-				if(this.isCheckAll) {
-					this.updateBothCheckBtn();	
-				} else {
-					this.goodsList.forEach(item => {
-						if(item.checked) {
-							item.productsList.forEach(pros => {
-								pros.productsChecked = true;
-							})
-						}
-					})
-					this.updateCheckAllBtn();
-				}
-				// 失效也被勾选
-				this.failureList.forEach(failureItem => {
-					if(failureItem.isFailureLayer){
-						failureItem.isFailureLayer = false
-					}
-				})
-			},
-			hideDelManage(){//隐藏删除商品管理			
-				this.isshowDelbtn = false;
-				let isFailureLayer,newFailureList =[];
-				if(this.isCheckAll) {
-					this.updateBothCheckBtn();	
-				} else {
-					// 失效商品取消勾选
-					this.goodsList.forEach(item => {
-						if(item.isDisabled) {
-							item.checked = false;
-						}
-						item.productsList.forEach(pros => {
-							if(pros.validFlag == '3') {
-								pros.productsChecked = false;
-							}
-						})
-					})
-					this.updateCheckAllBtn();
-				}
-				this.failureList.forEach((failure,index) => {
-					if(failure.failureState == 1 || failure.failureState == 2) {
-						isFailureLayer = true
-					}else{
-						isFailureLayer = false
-					}
-					newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
-				})
-				this.failureList = newFailureList;
-			},		
-			deleteList(){//删除购物车商品	
-				this.delGoodsList=[];
-				this.goodsList.forEach(delitem=>{
-					let products = delitem.productsList
-					products.forEach(pros=>{
-						if(pros.productsChecked){
-						    this.delGoodsList += pros.productID+','
-						}
-					})
-				})
-				this.failureList.forEach(failure=>{
-					if(failure.productsChecked){
-						this.delGoodsList += failure.productID+','
-					}
-				})
-				if(this.delGoodsList.length == 0){
-					this.$util.msg("请选择要删除的商品~",2000);
-					return
-				}else{			
-					this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
-						this.ProductService.shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
-							this.$util.msg('删除成功',2000);
-							setTimeout(()=>{
-								this.isshowDelbtn = false;
-								this.initGetCartGoodsList();
-							},2000)
-						}).catch(error =>{
-							this.$util.msg(error.msg,2000)
-						})
-					})
-				}
-			},
-			deletefailureList(){
-				this.failureList.forEach(failure=>{ this.delGoodsList += failure.productID+',' })
-				this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
-					this.ProductService.shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
-						this.$util.msg('删除成功',2000);
-						setTimeout(()=>{
-							this.isshowDelbtn = false;
-							this.initGetCartGoodsList();
-						},2000)
-					}).catch(error =>{
-						this.$util.msg(error.msg,2000)
-					})
-				})
-			},
-			goIndex(){
-				uni.switchTab({
-				    url: '/pages/tabBar/home/home'
-				});
-			},
-			goNavto(url){
-				uni.navigateTo ({
-					url
-				})
-			},
-			navToListPage(id){
-				this.isModallayer = true;
-				this.$api.navigateTo(`/pages/goods/product?id=${id}`)
-			},
-			failureToProduct(failure){
-				if(failure.failureState == 1){
-					this.$util.msg('商品已丢失,不能查看',2000)
-					return
-				}else if(failure.failureState == 2){
-					this.$util.msg('商品已停售,不能查看',2000)
-					return
-				}else{
-					this.isModallayer = true;
-					this.$api.navigateTo(`/pages/goods/product?id=${failure.productID}`)
-				}
-			},
-			failureStateText(state){
-				let stateText = '',
-					stateTextObject={
-						1:'商品已丢失',
-						2:'商品已停售',
-						3:'商品已下架',
-						4:'商品已售罄',
-						5:'价格仅会员可见,您不能购买',
-						6:'未公开价格',
-						7:'库存不足'
-					}
-				Object.keys(stateTextObject).forEach(key => {
-					if(key == state){
-						stateText = stateTextObject[key]
-					}
-				})
-				return stateText;
-			},
-			setHeaderBtnPosi(){
-				// 获得胶囊按钮位置信息
-				let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
-				return headerBtnPosi
-			},
-			setSysteminfo(){
-				let systeminfo;
-				uni.getSystemInfo({ // 获取设备信息
-					success: (res) => {
-						systeminfo = res
-					},
-				})
-				return systeminfo
-			}
-		},
-		watch:{//深度监听所有数据,每次改变重新计算总价和总数
-		    goodsList:{
-		        deep:true,
-		        handler(val,oldval){
-		            this.totalPeice()
-		            this.totalCount()
-		        }
-		    }
-		},
-		onPullDownRefresh() {//下拉刷新
-			this.initGetCartGoodsList()
-			uni.stopPullDownRefresh()
-		},
-		onShow(){
-			if(this.hasLogin){
-				this.initData()
-			}else{
-				this.initLogin()
-			}
-		},
-	}
-</script>
-
-<style lang="scss">
-	page{
-		background: #f7f7f7;
-		height: auto;
-	}
-	.cart-content{
-		position: relative;
-	}
-	.container-cart-main.none{
-		display: none;
-	}
-	.container-cart-main.show{
-		display: block;
-	}
-	.cart-content.empty.none{
-		display: none;
-	}
-	.cart-content.empty.show{
-		display: block;
-	}
-	.container-cart.show{
-		display: block;
-	}
-	.container-cart.none{
-		display: none;
-	}
-	.empty-container.none{
-		display: none;
-	}
-	.empty-container.show{
-		display: flex;
-	}
-	.checkbox-box{
-		display: flex;
-		align-items: center;
-		.checkbox{
-			display: flex;
-			margin: 0;
-			padding: 0;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			box-sizing: border-box;
-			text-align: center;
-			text-decoration: none;
-			border-radius: 0;
-			-webkit-tap-highlight-color: transparent;
-			overflow: hidden;
-			background-color:#FFFFFF;
-			font-size: 36rpx;
-			color:$color-system;
-		}
-		&.disabled{
-			.checkbox{
-				color:#999999
-			}
-		}
-		.text{
-			font-size: $font-size-24;
-			margin-left: 10rpx;
-		}
-	}
-	.goods-list{
-		width: 100%;
-		height: auto;
-		background-color: #F7F7F7;
-		.goods-item{
-			width: 702rpx;
-			padding: 0 24rpx;
-			background: #FFFFFF;
-			margin-bottom: 24rpx;
-		}
-		.shoptitle{
-			display: flex;
-			align-items: center;
-			height: 80rpx;
-			// border-bottom: 1px solid #EBEBEB;
-			line-height: 80rpx;
-			.checkbox-box{
-				padding: 10rpx;
-			}
-			.text{
-				display: block;
-				overflow: hidden;
-				text-overflow:ellipsis;
-				white-space: nowrap;
-				text-align: right;
-				margin-left: 37rpx;
-				font-size: $font-size-28;
-				color: $text-color;
-				text-align: left;
-				font-weight: bold;
-			}
-		}
-		.goods-pros{
-			width: 100%;
-			height: auto;
-		}	
-		.goods-pros-t{
-			display: flex;
-			align-items: center;
-			width: 100%;
-			height: 210rpx;
-			padding:0 0 26rpx 0;
-			.checkbox-box{
-				padding: 10rpx;
-			}
-			.pros-img{
-				width: 210rpx;
-				height: 100%;
-				border-radius: 10rpx;
-				margin:0 20rpx;
-				border:1px solid #f3f3f3;
-				image{
-					width: 100%;
-					height: 100%;
-					border-radius: 10rpx;
-				}
-			}
-		}
-		.goods-pros-b{
-			width:622rpx;
-			margin-left: 84rpx;
-			height: 40rpx;
-			padding:0 0 26rpx 0;
-			// border-top: 1px solid #EBEBEB;
-			&.show{
-				display: block;
-			}
-			&.none{
-				display: none;
-			}
-			.sum{
-				font-size: $font-size-28;
-				line-height: 40rpx;
-				color: $text-color;
-				display: flex;
-				justify-content: flex-end;
-				.money{
-					color: #FF2A2A;
-					font-size: $font-size-28;
-				}
-				.money-sign{
-					font-size: $font-size-24;
-					color: #FF2A2A;
-				}
-			}
-		}
-		.pros-product{
-			width: 402rpx;
-			height: 100%;
-			line-height: 36rpx;
-			font-size: $font-size-28;	
-			position: relative;
-			.producttitle{
-				width: 100%;
-				display: inline-block;
-				height: auto;							
-				text-overflow:ellipsis;
-				display: -webkit-box;
-				word-break: break-all;
-				-webkit-box-orient: vertical;
-				-webkit-line-clamp: 2;
-				overflow: hidden;
-				margin-bottom: 8rpx;
-				.no-text{
-					display: inline-block;
-					height:36rpx;
-					padding: 0 12rpx;
-					line-height: 36rpx;
-					background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
-					border-radius:18rpx;
-					text-align: center;
-					color: #FFFFFF;
-					font-size:$font-size-28;
-					margin-right: 24rpx;
-				}
-			}
-			.productspec{
-				height: 36rpx;
-				color: #999999;
-				font-size: $font-size-26;
-			}
-			.productprice{
-				height: 48rpx;
-				position: absolute;
-				width: 100%;
-				bottom: 0;
-				.price{
-					line-height: 48rpx;
-					font-size: $font-size-28;
-					width: 48%;
-					color: #FF2A2A;
-					float: left;
-					&.disabled{
-						color: #999999;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-				}
-				.count{
-					height: 100%;
-					float: right;
-					position: relative;
-					&.show{
-						display: block;
-					}
-					&.none{
-						display: none;
-					}
-					.number-box{
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						.iconfont{
-							font-size: $font-size-24;
-							padding:0 20rpx;
-							color: $text-color;
-							text-align: center;
-							line-height: 48rpx;
-							font-weight: bold;
-						}
-						.btn-input{
-							width: 62rpx;
-							height: 48rpx;
-							line-height: 48rpx;
-							background: #F8F8F8;
-							border-radius: 4rpx;
-							text-align: center;
-							font-size: $font-size-24;
-						}
-					}
-					.uni-numbox{
-						position: absolute;
-						left: 45rpx;
-						bottom: 0;
-						.uni-numbox-minus, .uni-numbox-plus{
-							width: 50rpx;
-							line-height: 40rpx;
-						}
-						.uni-numbox-value {
-							font-size: $font-size-28;
-							width: 60rpx;
-						}
-					}
-				}
-			}
-		}
-	}
-	.failure-list{
-		width: 702rpx;
-		height: auto;
-		padding: 0 24rpx;
-		margin-top: 20rpx;
-		background: #FFFFFF;
-		.failure-title{
-			width: 100%;
-			height: 80rpx;
-			line-height: 80rpx;
-			font-size: $font-size-28;
-			border-bottom: 1px solid #EBEBEB;
-			.title-txt{
-				float: left;
-				color: $text-color;
-				text-align: left;
-			}
-			.title-btn{
-				float: right;
-				color: $color-system;
-				text-align: right;
-			}
-		}
-		.productlist{
-			padding-top: 10rpx;
-			.goods-pros{
-				width: 100%;
-				height: auto;
-				padding: 20rpx 0;
-			}	
-			.goods-pros-t{
-				display: flex;
-				align-items: center;
-				width: 100%;
-				height: 210rpx;
-				position: relative;
-				.checkbox-box{
-					padding: 10rpx;
-				}
-				.pros-img{
-					width: 210rpx;
-					height: 100%;
-					border-radius: 10rpx;
-					margin:0 20rpx;
-					border:1px solid #f3f3f3;
-					position: relative;
-					.img-tip{
-						display: block;
-						width: 72rpx;
-						height: 36rpx;
-						line-height: 36rpx;
-						font-size: $font-size-24;
-						text-align: center;
-						color: #FFFFFF;
-						border-radius: 10rpx 0 10rpx 0;
-						background:linear-gradient(34deg,rgba(255,149,42,1) 0%,rgba(225,86,22,1) 100%);
-						position: absolute;
-						left: 0;
-						top: 0;
-					}
-					image{
-						width: 100%;
-						height: 100%;
-						border-radius: 10rpx;
-					}
-				}
-				.pros-marks{
-					width: 722rpx;
					height: 250rpx;
-					z-index: 90;
-					background: rgba(0,0,0,.05);
-					position: absolute;
-					left:0;
-					top: -20rpx;
-				}
-			}
-			.goods-pros-b{
-				width:622rpx;
-				margin-left: 84rpx;
-				height: 40rpx;
-				padding:0 0 26rpx 0;
-				// border-top: 1px solid #EBEBEB;
-				&.show{
-					display: block;
-				}
-				&.none{
-					display: none;
-				}
-				.sum{
-					font-size: $font-size-28;
-					line-height: 40rpx;
-					color: $text-color;
-					display: flex;
-					justify-content: flex-end;
-					.money{
-						color: #FF2A2A;
-						font-size: $font-size-28;
-					}
-					.money-sign{
-						font-size: $font-size-24;
-						color: #FF2A2A;
-					}
-				}
-			}
-			.pros-product{
-				width: 402rpx;
-				height: 100%;
-				line-height: 36rpx;
-				font-size: $font-size-28;	
-				position: relative;
-				.producttitle{
-					width: 100%;
-					display: inline-block;
-					height: auto;							
-					text-overflow:ellipsis;
-					display: -webkit-box;
-					word-break: break-all;
-					-webkit-box-orient: vertical;
-					-webkit-line-clamp: 2;
-					overflow: hidden;
-					margin-bottom: 8rpx;
-					.no-text{
-						display: inline-block;
-						height:36rpx;
-						padding: 0 12rpx;
-						line-height: 36rpx;
-						background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
-						border-radius:18rpx;
-						text-align: center;
-						color: #FFFFFF;
-						font-size: $font-size-28;
-						margin-right: 24rpx;
-					}
-				}
-				.productspec{
-					height: 36rpx;
-					color: #999999;
-					font-size: $font-size-26;
-				}
-				.productstate{
-					font-size: $font-size-28;
-					height: 44rpx;
-					color: #FF2A2A;
-					position: absolute;
-					bottom: 0;
-					left: 0;
-				}
-			}
-		}
-	}
-	.footer{
-		width: 100%;
-		background-color: #FFFFFF;
-		height: 110rpx;
-		position: fixed;
-		bottom: 0rpx;
-		z-index: 100;
-		.footer-le{
-			width: 490rpx;
-			height: 100%;
-			padding:0 30rpx;
-			float: left;
-			.text{
-				font-weight: bold;
-			}
-			.foot-check{
-				width: 100rpx;
-				float: left;
-				line-height: 110rpx;
-				font-size: $font-size-24;
-				.checkbox{
-					width: 40rpx;
-					text-align: center;
-				}
-				.text{
-					width: 60rpx;
-					float: right;
-				}
-			}
-			.foot-check-delbtn{
-				float: left;
-				.delBtn{
-					margin: 0;
-					padding: 0;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-					box-sizing: border-box;
-					font-size: $font-size-24;
-					text-align: center;
-					text-decoration: none;
-					border-radius: 0;
-					-webkit-tap-highlight-color: transparent;
-					overflow: hidden;
-					background-color:#FFFFFF;
-					color: #FF2A2A;
-					padding: 0 24rpx;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					line-height: 110rpx;
-					font-weight: bold;
-					&.none{
-						display: none;	
-					}
-				}
-			}
-			.sum{
-				font-size: $font-size-28;
-				line-height: 110rpx;
-				color: $text-color;
-				display: flex;
-				justify-content: flex-end;
-				.money{
-					color: #FF2A2A;
-				}
-				.money-sign{
-					font-size: $font-size-24;
-					color: #FF2A2A;
-				}
-			}
-		}
-		.footer-ri{
-			width: 200rpx;
-			height: 100%;
-			background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
-			float: right;
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			z-index: 999;
-			&.none{
-				display: none;
-			}
-			.btn{
-				width: 200rpx;
-				height: 100%;
-				font-size: $font-size-28;
-				line-height: 110rpx;
-				color: #FFFFFF;
-				display: flex;
-				justify-content: center;
-				align-items: center;
-			}
-		}
-		.footer-del{
-			width: 400rpx;
-			height: 110rpx;
-			position: absolute;
-			padding-left: 200rpx;
-			background: #FFFFFF;
-			right: 0;
-			top: 0;
-			z-index: 1000;
-			&.show{
-				animation: showDelbtn 0s linear both;
-			}
-			&.none{
-				animation: hideDelbtn 0s linear both;
-			}
-			.btn{
-				width: 50%;
-				height: 100%;
-				line-height: 110rpx;
-				font-size: $font-size-28;
-				color: #FFFFFF;
-				text-align: center;
-				float: left;
-			}
-			.btn.btn-cancel{
-				background:#EEC1AB;
-			}
-			.btn.btn-confirm{
-				background:#FF2A2A;
-			}
-			@keyframes showDelbtn {
-				0% {
-					transform: translateX(0);
-				}
-				100% {
-					transform: translateX(-100%);
-				}
-			}
-			@keyframes hideDelbtn {
-				0% {
-					transform: translateX(-100%);
-				}
-				100% {
-					transform: translateX(0);
-				}
-			}
-		}
-	}
+<template>
+	<view class="container cart clearfix" v-if="hasLogin" :style="{paddingTop:CustomBar+'px'}"> 	
+		<headerNavbar :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :page='1'></headerNavbar>
+		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
+		<view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
+			<view class="foot-check-delbtn" v-if="!isshowDelbtn" :style="{top:CustomBar+'px'}">
+				<view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
+				<view class="delBtn" @tap.stop="showDelManager">删除</view>
+			</view>
+			<view v-if="!isEmpty" class="container-cart">
+				<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
+					<view class="goods-list">
+						<view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
+							<view class="shoptitle">
+								<!--选择商店的全部商品"-->
+								<view class="checkbox-box" @click.stop="checkShop(item)">
+									<view class="checkbox iconfont" :class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"></view>
+								</view>
+								<view v-if="item.promotions" class="floor-item-act">
+									<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>	
+								</view>
+								<view class="text">{{item.name}}</view> 
+							</view>
+							<view class="productlist">
+								<view 	class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
+									<view class="goods-pros-t">
+										<!--选择商品-->
+										<view class="checkbox-box" @click.stop="ischeck(item,pros)">
+											<view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
+											</view>
+										</view>
+										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.image ? pros.image:''" alt="" /></view>
+										<view class="pros-product">
+											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>{{pros.name}}</view>
+											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
+											<view class="productprice">
+												<!--使用过滤器对总价改变-->
+												<view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
+													<text>¥</text>{{pros.price | NumFormat}}
+												</view>
+												<view class="count" v-if="pros.validFlag == 2 "  :class="[isshowDelbtn ? 'none':'show']">
+													<text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
+													<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
+													<view class="number-box">
+														<view  class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
+														<input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
+														<view  class="iconfont icon-jiahao"  @click="changeCountAdd(item,pros)"></view>
+													</view>
+												</view>
+											</view>
+											<view v-show="pros.actStatus==1" class="floor-item-act">
+												<view v-if="PromotionsFormat(pros.promotions)"  class="floor-tags" @click.stop="clickPopupShow(pros,1)">
+													{{pros.promotions.name}}
+													<text v-if ="pros.promotions!=null">
+														:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
+													</text>
+												</view>
+												<view v-else class="floor-tags" @click.stop="clickPopupShow(pros,2)">{{pros.promotions.name}}</view>	
+											</view>
+											<view  v-if="pros.actStatus == null  &&  pros.ladderFlag == 1" class="floor-item-act">
+												<view class="floor-tags" @click.stop="clickPopupShow(pros,2)">阶梯价格</view>	
+											</view>
+										</view>	
+									</view>
+								</view>
+							</view>	
+							<view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
+								<view class="sum-none" v-if="item.reducedPrice>0">
+									<text class="money-sign">¥</text>
+									<text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
+									<text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
+								</view>
+								<view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
+							</view>
+						</view>
+					</view>	
+					<view class="failure-list" v-if="failureList.length>0">
+						<view class="failure-title">
+							<view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
+							<view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
+						</view>
+						<view class="productlist">
+							<view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
+								<view class="goods-pros-t" @click.stop="failureToProduct(failure)">
+									<!--选择商品-->
+									<view class="checkbox-box" @click.stop="ischeckFailure(failure)" v-if="isshowDelbtn">
+										<button class="checkbox iconfont" 
+												:class="[ failure.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
+										</button>
+									</view>
+									<view class="pros-img">
+										<image :src="failure.image ? failure.image:''" alt="" />
+										<text class="img-tip">失效</text>
+									</view>
+									<view class="pros-product">
+										<view class="producttitle">{{failure.name}}</view>
+										<view class="productspec">规格:{{failure.unit ? failure.unit : ''}}</view>
+										<view class="productstate">{{failureStateText(failure.failureState)}}</view>
+									</view>
+									<view class="pros-marks" v-if="failure.isFailureLayer"></view>
+								</view>
+							</view>
+						</view>	
+					</view>
+				</view>
+				<!-- 脚部菜单 -->
+				<view class="footer" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
+					<view class="footer-le">
+						<view class="foot-check checkbox-box" @tap.stop="checkAll()">
+							<button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button> 
+							<view class="text">全选</view>
+						</view>
+			
+						<view class="sum">
+							<view class="sum-none">
+								<template v-if="reducedPrice>0">
+									<text class="money-sign">¥</text>
+									<text class="money">{{ totalOriginalPrice | NumFormat }}</text>
+									<text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
+								</template>
+							</view>
+							<view class="sum-price">
+								总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
+							</view>
+						</view>
+					</view>
+					<view v-if="!isshowDelbtn" class="footer-ri" >
+						<view class="btn hanld-btn" @tap="toConfirmation">去结算({{allCount}})</view>
+					</view>
+					<view v-else class="footer-del">
+						<view class="btn btn-cancel" @tap.stop="hideDelManage">取消</view>
+						<view class="btn btn-confirm" @tap.stop="deleteList">删除</view>
+					</view>
+				</view>
+			</view>
+			<view v-else class="cart-content empty">
+				<view  class="empty-container">
+					<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AWdWzAAGlgAP0das422.png" mode="aspectFit"></image>
+					<text class="error-text">购物车空空如也,快去商城逛逛吧~</text>
+					<view class="login-btn"  @click="goIndex">去商城</view>
+				</view>
+			</view>
+		</view>
+		<!-- 促销活动弹窗 -->
+		<activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
+		<!-- 透明模态层 -->
+		<modal-layer v-if='modallayer'></modal-layer>
+	</view>
+</template>
+<script>
+	import authorize from '@/common/config/authorize.js'
+	import tuiSkeleton from "@/components/tui-skeleton/tui-skeleton"
+	import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
+	import tuiNomore from "@/components/tui-components/nomore/nomore"
+	import headerNavbar from "@/components/cm-module/headerNavbar/headerNavbar.vue" //顶部自定义胶囊'
+	import modalLayer from "@/components/modal-layer"
+	import { mapState,mapMutations } from 'vuex';
+	
+	export default{
+		components:{
+			tuiSkeleton,
+			tuiLoadmore,
+			tuiNomore,
+			modalLayer,
+			headerNavbar
+		},
+		data(){
+			return{
+				nvabarData: {//顶部自定义导航
+					showCapsule: 1, // 是否显示左上角图标  1表示显示  0表示不显示,
+					showSearch: 0,
+					title: '购物车', // 导航栏 中间的标题
+				},
+				headerBtnPosi:this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
+				systeminfo:this.setSysteminfo(),		 //获取设备信息
+				CustomBar:this.CustomBar,// 顶部导航栏高度
+				isIphoneX:this.$store.state.isIphoneX,
+				userID:'',
+				alertType:'',
+				isStock:'',
+				popupShow:false,
+				handlerPros:{},//监听单挑促销商品
+				failureList:[],	//失效商品列表
+				goodsList:[],	//购物车的商品
+				promotionsList:[],//促销列表
+				delGoodsList:'',//要删除的商品
+				setGoodData:'', //确认订单的商品
+				isCheckAll:false,//是否全选
+				kindCount:0,//购物车宝贝数量
+				allPrice:0,//所有价格
+				totalOriginalPrice:0,//所有原价价
+				reducedPrice:0,//满减
+				allCount:0,//被选中的产品数量
+				isModallayer:false,
+				skeletonShow:true,
+				isshowDelbtn:false,
+				isDisabled: false, // 供应商/店铺全选是否禁用状态
+				isNoConfim:false,
+				isEmpty:false,//显示空购物车
+				scrollHeight: 'auto',
+				nomoreText: '上拉显示更多',
+				hasNextPage: false,
+				loadding: false,
+				pullUpOn: true,
+				pullFlag: true,
+				pageSize: 10,
+				pageNum: 1,
+			}
+		},
+		onLoad(){
+			this.setScrollHeight();
+		},
+		computed: {
+			...mapState(['hasLogin','userInfo'])
+		},
+		filters:{
+			NumFormat(value) {//处理金额
+				return Number(value).toFixed(2);
+			},
+		    totalprice(val,count){//单件商品的价格 × 数量
+		        return (val * count).toFixed(2)
+		    }
+		},
+		methods:{
+			initData(){
+				this.isModallayer = false //遮罩层 防止多次点击
+				this.skeletonShow = true //预加载圆圈
+				this.isCheckAll=false//是否全选
+				this.$api.getStorage().then((resolve) => {
+					this.userID = resolve.userID;
+					this.initGetCartGoodsList();
+				})	
+			},
+			initLogin(){
+				authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
+					if(wxResponse == 1){
+						this.$api.redirectTo('/pages/login/login?type=4')
+					}else{
+						this.$api.navigateTo('/pages/authorization/authorization?type=0')
+					}
+				})	
+			},
+			clickPopupShow(pros,type){
+				this.popupShow = true;
+				this.handlerPros = pros;
+			},
+			setScrollHeight() {
+				// 窗口高度-footer高度
+				const {windowHeight, pixelRatio} = uni.getSystemInfoSync();
+				setTimeout(()=> {
+					const query = uni.createSelectorQuery().in(this);
+					query.selectAll('.footer').boundingClientRect();
+					query.exec(res => {
+						this.windowHeight = windowHeight;
+						if(res[0][0]) {
+							this.scrollHeight = windowHeight - res[0][0].height;
+						}
+					})
+				}, 500)
+			},
+			initGetCartGoodsList(){//初始化购物车 index:1
+				this.ProductService.queryShoppingCartList({userId:this.userID}).then(response =>{
+					this.skeletonShow = false
+					let data = response.data
+					this.kindCount = data.kindCount
+					this.promotionsList = data.promotions
+					this.$store.commit('updateAllNum',data.kindCount)
+					if( data.list.length > 0 || data.invalid.length > 0){
+						this.isEmpty =false
+					}else{
+						this.isEmpty =true
+					}
+					if(data.list && data.list.length > 0 ){
+						this.goodsList = data.list;
+						this.goodsList.forEach((item,index) => {
+							item.cartList.forEach(pros => {
+								pros.shopID = item.shopID;
+								pros.isStep = false
+								if(pros.step === 2){ 
+									if(pros.number % pros.min != 0){
+										pros.number = pros.min
+										this.totalShopPeice()
+										this.updateShoppogNum(pros)
+									}
+								}
+							})
+						})
+						this.totalShopPeice()
+					} else {
+						this.goodsList = [];
+					}
+					if( data.invalid && data.invalid.length > 0){
+						let newFailureList = [],isFailureLayer;
+						data.invalid.forEach((failure,index) => {
+							if(failure.status == 1 || failure.status == 2) {
+								isFailureLayer = true
+							}else{
+								isFailureLayer = false
+							}
+							newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
+						})
+						this.failureList = newFailureList
+					} else {
+						this.failureList = [];
+					}
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			},		
+			ischeckFailure(failure){
+				failure.productsChecked = !failure.productsChecked
+				this.updateCheckAllBtn()
+			},
+			ischeck(item,pro){//为未选中的时候改变为true,反之为true
+				pro.productsChecked = !pro.productsChecked;
+				this.updateProductCheckedAllBtn(item);
+				this.updateCheckAllBtn();
+				
+			},
+			updateProductCheckedAllBtn(item) {// 单独每个供应商的勾选判断
+				let productsList = item.cartList,
+					productsCheckedLength = 0,
+					disabledLength = 0;
+				if(this.isshowDelbtn) {
+					productsList.forEach(pros => {
+						if(pros.productsChecked) {
+							productsCheckedLength++;
+						}
+					})
+				} else {
+					productsList.forEach(pros => {
+						if(pros.productsChecked) {
+							productsCheckedLength++;
+						}
+					})
+				}
+				item.checked = productsCheckedLength === productsList.length;
+			},
+			updateCheckAllBtn() {// 全选勾选判断
+				let goodsCheckedLength = 0,
+					goodsList = this.goodsList,
+					failureList = this.failureList;
+				goodsList.forEach(item => {
+					if(item.checked) {
+						goodsCheckedLength++;
+					}
+				})
+				failureList.forEach(failureItem=>{
+					if(failureItem.productsChecked){
+						goodsCheckedLength++;
+					}
+				})
+				if(this.isshowDelbtn){
+					this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
+				}else{
+					this.isCheckAll = goodsCheckedLength === goodsList.length;
+				}
+			},
+			checkShop(item){//与单选商品类似
+				item.checked = !item.checked;
+				this.setProductChecked(item);
+				this.updateCheckAllBtn();
+			},
+			setProductChecked(item) {
+				item.cartList.forEach(pros=>{
+					if(item.checked) {
+						pros.productsChecked = true;
+					} else {
+						pros.productsChecked = false;
+					}
+				})
+			},
+			updateBothCheckBtn() {
+				if(this.isshowDelbtn) {
+					// 当管理删除按钮出现时,失效的商品可被选择
+					this.goodsList.forEach((item)=>{
+						item.checked = this.isCheckAll;
+						this.setProductChecked(item);
+					})
+					//删除按钮 全选包括失效商品勾选
+					this.failureList.forEach(failureItem=>{
+						failureItem.productsChecked = this.isCheckAll;
+					})
+				} else {
+					this.goodsList.forEach((item)=>{
+						item.checked = this.isCheckAll && !item.isDisabled;
+						this.setProductChecked(item);
+					})
+				}
+			},
+			checkAll(){//全选方法内调用方法
+			    this.isCheckAll = !this.isCheckAll;
+				this.updateBothCheckBtn();     
+			},
+			totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
+				let prosPrice=0;
+				let touchPrice = 0; 
+				let reducedPrice = 0;//商铺合计满减价
+				let totalOriginalPrice = 0;//商铺合计原价
+				let productsList=[];
+				this.goodsList.map((item,index)=>{
+					productsList = item.cartList;
+					//计算店铺满减后店铺合计
+					if(item.promotions && item.promotions.mode == 2){
+						productsList.forEach(pros=>{
+							prosPrice += pros.price*pros.number
+							totalOriginalPrice+= pros.price*pros.number;
+							if(prosPrice >= item.promotions.touchPrice){
+								item.totalPrice = prosPrice - item.promotions.reducedPrice  
+								item.reducedPrice = item.promotions.reducedPrice
+								item.totalOriginalPrice = totalOriginalPrice
+							}else{
+								item.totalPrice = prosPrice
+							}
+						})
+					}else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
+						let _totalPrice = 0;
+						let _reducedPrice = 0;
+						let _totalOriginalPrice =0;
+						productsList.forEach(pros=>{
+							let _price = pros.price*pros.number
+							_totalOriginalPrice += pros.price*pros.number;
+							if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
+								if(_price >= pros.promotions.touchPrice){
+									_price = _price - pros.promotions.reducedPrice
+									_reducedPrice += pros.promotions.reducedPrice
+								}
+								_totalPrice +=  _price
+							}else{
+								_totalPrice += pros.price*pros.number;
+							}
+						})
+						item.reducedPrice = _reducedPrice
+						item.totalOriginalPrice = _totalOriginalPrice
+						item.totalPrice = _totalPrice
+					}
+				})
+			},
+			totalPeice(){	//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
+			    this.allPrice = 0
+				let productsList =[];
+				//店铺满减
+				let prosPrice=0;
+				let totalPrice = 0;
+				let reducedPrice=0;//促销满减
+				let totalOriginalPrice=0;//促销原价
+				//凑单满减.单品满减
+				let _totalPrice = 0;
+				let _reducedPrice = 0;
+				let _totalOriginalPrice =0;
+				// 正常商品
+				let _totalNonePrice = 0;
+				/*
+				*originalPrice:商品原价
+				*price:商品现价
+				*mode:促销商品满减计算 促销方式mode为 2 的单独做计算 当mode == 2时商品promotions字段为促销活动内容,
+				*touchPrice 为需要满金额 
+				*reducedPrice 为满减金额
+				**/ 
+			    this.goodsList.forEach((item,index)=>{
+					item.cartList.forEach(pros=>{	
+						if(pros.productsChecked){
+							if(item.promotions && item.promotions.mode == 2){
+								prosPrice = pros.price*pros.number
+								if(prosPrice >= item.promotions.touchPrice){
+									totalPrice += prosPrice - item.promotions.reducedPrice  
+									totalOriginalPrice += pros.originalPrice*pros.number
+									reducedPrice += item.promotions.reducedPrice
+								}else{
+									totalPrice += prosPrice
+								}
+							}else if(pros.promotions && pros.promotions.mode == 2){//以下为计算除店铺满减以外的单品满减以及正常商品
+								let _price = pros.price*pros.number
+								_totalOriginalPrice += pros.originalPrice*pros.number;
+								if(_price >= pros.promotions.touchPrice){
+									_price = _price - pros.promotions.reducedPrice
+									_reducedPrice += pros.promotions.reducedPrice
+								}
+								_totalPrice +=  _price
+							}else{
+								_totalNonePrice += pros.price*pros.number;
+							}
+						}	
+					})
+					this.totalOriginalPrice = totalOriginalPrice + _totalOriginalPrice;
+					this.reducedPrice = reducedPrice +_reducedPrice;
+					this.allPrice = totalPrice + _totalPrice + _totalNonePrice;
+			    })
+			},
+			totalCount(){//计算总数量
+			    this.allCount = 0
+				let prosAllCount=0
+				let validCount = 0
+				let validList =[];
+				let productsList =[];
+			    this.goodsList.forEach(item=>{
+					productsList = item.cartList
+					productsList.forEach(pros=>{
+						if(pros.productsChecked){
+							prosAllCount+=parseInt(pros.number);
+							this.allCount = prosAllCount
+						}
+					})
+			    })
+			},		
+			changeCountAdd(item,pros){//商品数量加加
+				if(pros.step === 2){
+					pros.isStep = false
+					pros.number += pros.min
+					this.processActivityPrice(pros)
+					this.isStock = false
+				}else{
+					pros.number++
+					this.processActivityPrice(pros)
+					this.isStock = false
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			changeCountSub(item,pros){//商品数量减减
+				if(pros.number<=pros.min){
+					pros.number= pros.min
+					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
+					return
+				}else{
+					if(pros.step === 2){
+						pros.isStep = false
+						pros.number -= pros.min
+					}else{
+						pros.number--
+					}
+					this.processActivityPrice(pros)
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			changeInput(pros){//输入商品数量更新
+				pros.isStep = false
+			},
+			changeNnmber(e,item,pros){//输入商品数量更新
+				let _value = Number(e.detail.value);
+				if(!this.$api.isNumber(_value)){
+					pros.number = pros.min
+				}else if(_value < pros.min){	
+					this.$util.msg(`该商品最小起订量为${pros.min}`,2000);
+					pros.number = pros.min
+				}else if(_value % pros.min != 0){
+					pros.isStep = true
+					pros.number = pros.min
+				}else{
+					pros.isStep = false
+					pros.number = e.detail.value
+					this.processActivityPrice(pros)
+				}
+				this.updateShoppogNum(pros)
+				this.totalShopPeice();
+			},
+			processActivityPrice(pros){//单独处理活动价格和阶梯价格
+				let ladderPriceList = pros.ladderPrices;
+				if(pros.ladderFlag == '0' || pros.actStatus == 1){
+					pros.price = pros.price
+				}else{
+					ladderPriceList.forEach((item,index)=>{
+						if(pros.number>=item.buyNum){
+							pros.price = item.buyPrice
+						}
+					})
+				}
+			},
+			updateShoppogNum(pros){//加减购物车商品更新到后台
+				let params ={userID:this.userID,productID:pros.productId,productCount:pros.number}
+				this.ProductService.shoppingCartUpdate(params).then(response =>{
+					this.isshowDelbtn = false;
+					this.initGetCartGoodsList();
+				}).catch(error =>{
+					this.$util.msg(error.msg,2000);
+				})
+			 },
+			toConfirmation(){//跳转确认订单页面
+				let setGoodsList=[];
+				this.goodsList.forEach(res=>{
+					let products = res.cartList
+					products.forEach(pros=>{
+						if(pros.productsChecked){
+						    setGoodsList.push(pros.productId)
+						}
+					})
+				})
+				if(setGoodsList == ''){
+					this.$util.msg("请先选择结算商品~",2000);
+					return
+				}else{
+					this.isNoConfim = false
+					this.goodsList.forEach(el=>{
+						el.cartList.forEach(pros=>{
+							if(pros.productsChecked){
+							   if(pros.number<pros.min){
+								   this.isNoConfim = true
+							   }
+							}
+						})
+					})
+					if(this.isNoConfim){
+						this.$util.modal('','有商品的购买量没达到最小起订量,请修改数量后再次提交结算','去修改','',false,() =>{})
+						return;
+					}
+					let productID = '';
+					this.goodsList.forEach(el=>{//获取勾选的商品ID拼接字符串逗号隔开,最后一个逗号去掉
+						el.cartList.forEach(pros=>{
+							if(pros.productsChecked){
+							   productID += pros.productId+','
+							}
+						})
+					})
+					let cartPramsData={
+							allPrice:this.allPrice,
+							allCount:this.allCount,
+							productID:productID.substring(0,productID.lastIndexOf(',')),
+							productCount:''
+						}
+					this.$api.navigateTo(`/pages/user/order/create-order?data=${JSON.stringify({data:cartPramsData})}`)
+				}
+			},
+			showDelManager(){//显示删除商品管理
+				this.isshowDelbtn = true;
+				if(this.isCheckAll) {
+					this.updateBothCheckBtn();	
+				} else {
+					this.goodsList.forEach(item => {
+						if(item.checked) {
+							item.cartList.forEach(pros => {
+								pros.productsChecked = true;
+							})
+						}
+					})
+					this.updateCheckAllBtn();
+				}
+				// 失效也被勾选
+				this.failureList.forEach(failureItem => {
+					if(failureItem.isFailureLayer){
+						failureItem.isFailureLayer = false
+					}
+				})
+			},
+			hideDelManage(){//隐藏删除商品管理			
+				this.isshowDelbtn = false;
+				let isFailureLayer,newFailureList =[];
+				if(this.isCheckAll) {
+					this.updateBothCheckBtn();	
+				} else {
+					// 失效商品取消勾选
+					this.goodsList.forEach(item => {
+						if(item.isDisabled) {
+							item.checked = false;
+						}
+						item.cartList.forEach(pros => {
+							if(pros.validFlag == 3) {
+								pros.productsChecked = false;
+							}
+						})
+					})
+					this.updateCheckAllBtn();
+				}
+				this.failureList.forEach((failure,index) => {
+					if(failure.failureState == 1 || failure.failureState == 2) {
+						isFailureLayer = true
+					}else{
+						isFailureLayer = false
+					}
+					newFailureList.push(Object.assign({},failure,{isFailureLayer:isFailureLayer}))
+				})
+				this.failureList = newFailureList;
+			},		
+			deleteList(){//删除购物车商品	
+				this.delGoodsList=[];
+				this.goodsList.forEach(delitem=>{
+					let products = delitem.cartList
+					products.forEach(pros=>{
+						if(pros.productsChecked){
+						    this.delGoodsList += pros.productId+','
+						}
+					})
+				})
+				this.failureList.forEach(failure=>{
+					if(failure.productsChecked){
+						this.delGoodsList += failure.productId+','
+					}
+				})
+				if(this.delGoodsList.length == 0){
+					this.$util.msg("请选择要删除的商品~",2000);
+					return
+				}else{			
+					this.$util.modal('','确定删除选中的商品吗?','确定','取消',true,() =>{
+						this.ProductService.shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
+							this.$util.msg('删除成功',2000);
+							setTimeout(()=>{
+								this.isshowDelbtn = false;
+								this.initGetCartGoodsList();
+							},2000)
+						}).catch(error =>{
+							this.$util.msg(error.msg,2000)
+						})
+					})
+				}
+			},
+			deletefailureList(){
+				this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
+				this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
+					this.ProductService.shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
+						this.$util.msg('删除成功',2000);
+						setTimeout(()=>{
+							this.isshowDelbtn = false;
+							this.initGetCartGoodsList();
+						},2000)
+					}).catch(error =>{
+						this.$util.msg(error.msg,2000)
+					})
+				})
+			},
+			goIndex(){
+				uni.switchTab({
+				    url: '/pages/tabBar/home/home'
+				});
+			},
+			goNavto(url){
+				uni.navigateTo ({
+					url
+				})
+			},
+			navToListPage(id){
+				this.isModallayer = true;
+				this.$api.navigateTo(`/pages/goods/product?id=${id}`)
+			},
+			failureToProduct(failure){
+				if(failure.status == 1){
+					this.$util.msg('商品已丢失,不能查看',2000)
+					return
+				}else if(failure.status == 2){
+					this.$util.msg('商品已停售,不能查看',2000)
+					return
+				}else{
+					this.isModallayer = true;
+					this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
+				}
+			},
+			failureStateText(state){
+				let stateText = '',
+					stateTextObject={
+						1:'商品已丢失',
+						2:'商品已停售',
+						3:'商品已下架',
+						4:'商品已售罄',
+						5:'价格仅会员可见,您不能购买',
+						6:'未公开价格',
+						7:'库存不足'
+					}
+				Object.keys(stateTextObject).forEach(key => {
+					if(key == state){
+						stateText = stateTextObject[key]
+					}
+				})
+				return stateText;
+			},
+			setHeaderBtnPosi(){
+				// 获得胶囊按钮位置信息
+				let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
+				return headerBtnPosi
+			},
+			setSysteminfo(){
+				let systeminfo;
+				uni.getSystemInfo({ // 获取设备信息
+					success: (res) => {
+						systeminfo = res
+					},
+				})
+				return systeminfo
+			},
+			PromotionsFormat(promo){//促销活动类型数据处理
+				if(promo!=null){
+					if(promo.type == 1 && promo.mode == 1){
+						return true
+					}else{
+						return false
+					}
+				}
+				return false
+			}
+		},
+		watch:{//深度监听所有数据,每次改变重新计算总价和总数
+		    goodsList:{
+		        deep:true,
+		        handler(val,oldval){
+		            this.totalPeice()
+		            this.totalCount()
+		        }
+		    }
+		},
+		onPullDownRefresh() {//下拉刷新
+			this.initGetCartGoodsList()
+			uni.stopPullDownRefresh()
+		},
+		onShow(){
+			if(this.hasLogin){
+				this.initData()
+			}else{
+				this.initLogin()
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	page{
+		background: #f7f7f7;
+		height: auto;
+	}
+	.cart-content{
+		position: relative;
+	}
+	.container-cart-main.none{
+		display: none;
+	}
+	.container-cart-main.show{
+		display: block;
+	}
+	.cart-content.empty.none{
+		display: none;
+	}
+	.cart-content.empty.show{
+		display: block;
+	}
+	.container-cart.show{
+		display: block;
+	}
+	.container-cart.none{
+		display: none;
+	}
+	.empty-container.none{
+		display: none;
+	}
+	.empty-container.show{
+		display: flex;
+	}
+	.foot-check-delbtn{
+		width: 100%;
+		height: 80rpx;
+		position: fixed;
+		top: 0;
+		left: 0;
+		box-sizing: border-box;
+		padding: 15rpx 24rpx;
+		background-color: #F7F7F7;
+		z-index: 9999;
+		.foot-text{
+			font-size: $font-size-26;
+			height: 50rpx;
+			line-height: 50rpx;
+			color: $text-color;
+			float: left;
+			padding-left: 10rpx;
+			text{
+				color: $color-system;
+				margin: 0 6rpx;
+			}
+		}
+		.delBtn{
+			width: 100rpx;
+			display: inline-block;
+			padding: 0 15rpx;
+			font-size: $font-size-26;
+			height: 50rpx;
+			line-height: 50rpx;
+			border-radius: 30rpx;
+			background:#FFFFFF;
+			border: 1px solid #C9C9C9;
+			color: #999999;
+			float: right;
+			text-align: center;
+			&.none{
+				display: none;	
+			}
+		}
+	}
+	.checkbox-box{
+		display: flex;
+		align-items: center;
+		.checkbox{
+			display: flex;
+			margin: 0;
+			padding: 0;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			box-sizing: border-box;
+			text-align: center;
+			text-decoration: none;
+			border-radius: 0;
+			-webkit-tap-highlight-color: transparent;
+			overflow: hidden;
+			background-color:#FFFFFF;
+			font-size: 36rpx;
+			color:$color-system;
+		}
+		&.disabled{
+			.checkbox{
+				color:#999999
+			}
+		}
+		.text{
+			font-size: $font-size-24;
+			margin-left: 10rpx;
+		}
+	}
+	.goods-list{
+		width: 100%;
+		height: auto;
+		background-color: #F7F7F7;
+		.goods-item{
+			width: 702rpx;
+			padding: 0 24rpx;
+			background: #FFFFFF;
+			margin-bottom: 24rpx;
+		}
+		.shoptitle{
+			display: flex;
+			align-items: center;
+			height: 80rpx;
+			line-height: 80rpx;
+			.checkbox-box{
+				padding: 10rpx;
+			}
+			.text{
+				width: 450rpx;
+				display: block;
+				overflow: hidden;
+				text-overflow:ellipsis;
+				white-space: nowrap;
+				margin-left: 20rpx;
+				font-size: $font-size-28;
+				color: $text-color;
+				text-align: left;
+				font-weight: bold;
+			}
+			.floor-item-act{
+				height: 56rpx;
+				text-align: center;
+				box-sizing: border-box;
+				float: left;
+				padding:10rpx 0;
+				margin-left: 20rpx;
+				.floor-tags{
+					float: right;
+					height: 36rpx;
+					border-radius: 4rpx;
+					background-color: rgba(225, 86, 22, 0.1);
+					line-height: 36rpx;
+					color: $color-system;
+					text-align: center;
+					display: inline-block;
+					padding:0 16rpx;
+					font-size: $font-size-20;
+				}
+			}
+		}
+		.goods-pros{
+			width: 100%;
+			height: auto;
+		}	
+		.goods-pros-t{
+			display: flex;
+			align-items: center;
+			width: 100%;
+			height: 210rpx;
+			padding:0 0 26rpx 0;
+			.checkbox-box{
+				padding: 10rpx;
+			}
+			.pros-img{
+				width: 210rpx;
+				height: 100%;
+				border-radius: 10rpx;
+				margin:0 20rpx;
+				border:1px solid #f3f3f3;
+				image{
+					width: 100%;
+					height: 100%;
+					border-radius: 10rpx;
+				}
+			}
+		}
+		.goods-pros-b{
+			width:100%;
+			height: auto;
+			padding:0 0 24rpx 0;
+			box-sizing: border-box;
+			&.show{
+				display: block;
+			}
+			&.none{
+				display: none;
+			}
+			.sum-none{
+				width: 100%;
+				height: 48rpx;
+				line-height: 48rpx;
+				color: $text-color;
+				float: left;
+				text-align: right;
+				.money{
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-sign{
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-reduced{
+					margin-left: 10rpx;
+					font-size: $font-size-26;
+					color: $color-system;
+					.iconfont{
+						font-size: $font-size-34;
+					}
+				}
+			}
+			.sum{
+				width: 100%;
+				height: 40rpx;
+				font-size: $font-size-28;
+				line-height: 40rpx;
+				color: $text-color;
+				float: left;
+				display: flex;
+				justify-content: flex-end;
+				.money{
+					color: #FF2A2A;
+					font-size: $font-size-28;
+				}
+				.money-sign{
+					font-size: $font-size-24;
+					color: #FF2A2A;
+				}
+			}
+		}
+		.pros-product{
+			width: 402rpx;
+			height: 100%;
+			line-height: 36rpx;
+			font-size: $font-size-28;	
+			position: relative;
+			.producttitle{
+				width: 100%;
+				display: inline-block;
+				height: auto;							
+				text-overflow:ellipsis;
+				display: -webkit-box;
+				word-break: break-all;
+				-webkit-box-orient: vertical;
+				-webkit-line-clamp: 2;
+				overflow: hidden;
+				margin-bottom: 8rpx;
+				.no-text{
+					display: inline-block;
+					height:36rpx;
+					padding: 0 12rpx;
+					line-height: 36rpx;
+					background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
+					border-radius:18rpx;
+					text-align: center;
+					color: #FFFFFF;
+					font-size:$font-size-28;
+					margin-right: 24rpx;
+				}
+			}
+			.productspec{
+				height: 36rpx;
+				color: #999999;
+				font-size: $font-size-26;
+			}
+			.productprice{
+				width: 100%;
+				height: 48rpx;
+				margin: 10rpx 0 0 0;
+				.price{
+					line-height: 48rpx;
+					font-size: $font-size-28;
+					width: 48%;
+					color: #FF2A2A;
+					float: left;
+					&.disabled{
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: #FF2A2A;
+					}
+				}
+				.count{
+					height: 100%;
+					float: right;
+					position: relative;
+					&.show{
+						display: block;
+					}
+					&.none{
+						display: none;
+					}
+					.count-tips{
+						width: auto;
+						display: inline-block;
+						padding: 0 15rpx;
+						line-height: 44rpx;
+						height: 44rpx;
+						border-radius: 22rpx;
+						background: $btn-confirm;
+						font-size: $font-size-24;
+						text-align: center;
+						color: #FFFFFF;
+						position: absolute;
+						top:-60rpx;
+						left: -5rpx; 
+						z-index: 5;
+						&.step{
+							left:-217rpx
+						}
+						&::before{
+							content: "";
+							position: absolute;
+							bottom: -30rpx;
+							right: 15rpx;
+							z-index:1;
+							width: 0; 
+							height: 0;
+							border-width: 18rpx;
+							border-style: solid;
+							border-color:$color-system transparent transparent transparent;
+						}
+					}
+					.number-box{
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						.iconfont{
+							font-size: $font-size-24;
+							padding:0 20rpx;
+							color: $text-color;
+							text-align: center;
+							line-height: 48rpx;
+							font-weight: bold;
+						}
+						.btn-input{
+							width: 62rpx;
+							height: 48rpx;
+							line-height: 48rpx;
+							background: #F8F8F8;
+							border-radius: 4rpx;
+							text-align: center;
+							font-size: $font-size-24;
+						}
+					}
+					.uni-numbox{
+						position: absolute;
+						left: 45rpx;
+						bottom: 0;
+						.uni-numbox-minus, .uni-numbox-plus{
+							width: 50rpx;
+							line-height: 40rpx;
+						}
+						.uni-numbox-value {
+							font-size: $font-size-28;
+							width: 60rpx;
+						}
+					}
+				}
+			}
+			.floor-item-act{
+				width: 100%;
+				height: 56rpx;
+				text-align: center;
+				box-sizing: border-box;
+				float: left;
+				padding:0 0 10rpx 0;
+				margin-left: 10rpx;
+				.floor-tags{
+					float: left;
+					height: 36rpx;
+					border-radius: 4rpx;
+					background-color: rgba(225, 86, 22, 0.1);
+					line-height: 36rpx;
+					color: $color-system;
+					text-align: center;
+					display: inline-block;
+					padding:0 16rpx;
+					font-size: $font-size-20;
+				}
+			}
+		}
+	}
+	.failure-list{
+		width: 702rpx;
+		height: auto;
+		padding: 0 24rpx;
+		margin-top: 20rpx;
+		background: #FFFFFF;
+		.failure-title{
+			width: 100%;
+			height: 80rpx;
+			line-height: 80rpx;
+			font-size: $font-size-28;
+			border-bottom: 1px solid #EBEBEB;
+			.title-txt{
+				float: left;
+				color: $text-color;
+				text-align: left;
+			}
+			.title-btn{
+				float: right;
+				color: $color-system;
+				text-align: right;
+				line-height: 80rpx;
+				.butto{
+					display: inline-block;
+					padding: 0 15rpx;
+					font-size: $font-size-26;
+					height: 50rpx;
+					line-height: 50rpx;
+					border-radius: 30rpx;
+					background:#FFFFFF;
+					border: 1px solid #C9C9C9;
+					color: #999999;
+					margin-top: 15rpx;
+				}
+			}
+		}
+		.productlist{
+			padding-top: 10rpx;
+			.goods-pros{
+				width: 100%;
+				height: auto;
+				padding: 20rpx 0;
+			}	
+			.goods-pros-t{
+				display: flex;
+				align-items: center;
+				width: 100%;
+				height: 210rpx;
+				position: relative;
+				.checkbox-box{
+					padding: 10rpx;
+				}
+				.pros-img{
+					width: 210rpx;
+					height: 100%;
+					border-radius: 10rpx;
+					margin:0 20rpx;
+					border:1px solid #f3f3f3;
+					position: relative;
+					.img-tip{
+						display: block;
+						width: 72rpx;
+						height: 36rpx;
+						line-height: 36rpx;
+						font-size: $font-size-24;
+						text-align: center;
+						color: #FFFFFF;
+						border-radius: 10rpx 0 10rpx 0;
+						background:linear-gradient(34deg,rgba(255,149,42,1) 0%,rgba(225,86,22,1) 100%);
+						position: absolute;
+						left: 0;
+						top: 0;
+					}
+					image{
+						width: 100%;
+						height: 100%;
+						border-radius: 10rpx;
+					}
+				}
+				.pros-marks{
+					width: 750rpx;
+					height: 250rpx;
+					z-index: 90;
+					background: rgba(0,0,0,.05);
+					position: absolute;
+					left:-20rpx;
+					top: -20rpx;
+				}
+			}
+			.goods-pros-b{
+				width:622rpx;
+				margin-left: 84rpx;
+				height: 40rpx;
+				padding:0 0 26rpx 0;
+				// border-top: 1px solid #EBEBEB;
+				&.show{
+					display: block;
+				}
+				&.none{
+					display: none;
+				}
+				.sum{
+					font-size: $font-size-28;
+					line-height: 40rpx;
+					color: $text-color;
+					display: flex;
+					justify-content: flex-end;
+					.money{
+						color: #FF2A2A;
+						font-size: $font-size-28;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: #FF2A2A;
+					}
+				}
+			}
+			.pros-product{
+				width: 402rpx;
+				height: 100%;
+				line-height: 36rpx;
+				font-size: $font-size-28;	
+				position: relative;
+				.producttitle{
+					width: 100%;
+					display: inline-block;
+					height: auto;							
+					text-overflow:ellipsis;
+					display: -webkit-box;
+					word-break: break-all;
+					-webkit-box-orient: vertical;
+					-webkit-line-clamp: 2;
+					overflow: hidden;
+					margin-bottom: 8rpx;
+					.no-text{
+						display: inline-block;
+						height:36rpx;
+						padding: 0 12rpx;
+						line-height: 36rpx;
+						background:linear-gradient(315deg,rgba(231,0,0,1) 0%,rgba(255,104,1,1) 100%);
+						border-radius:18rpx;
+						text-align: center;
+						color: #FFFFFF;
+						font-size: $font-size-28;
+						margin-right: 24rpx;
+					}
+				}
+				.productspec{
+					height: 36rpx;
+					color: #999999;
+					font-size: $font-size-26;
+				}
+				.productstate{
+					font-size: $font-size-28;
+					height: 44rpx;
+					color: #FF2A2A;
+					position: absolute;
+					bottom: 0;
+					left: 0;
+				}
+			}
+		}
+	}
+	.footer{
+		width: 100%;
+		background-color: #FFFFFF;
+		height: 110rpx;
+		position: fixed;
+		bottom: 0rpx;
+		z-index: 100;
+		.footer-le{
+			width: 490rpx;
+			height: 100%;
+			padding:0 30rpx;
+			float: left;
+			.text{
+				font-weight: bold;
+			}
+			.foot-check{
+				width: 100rpx;
+				float: left;
+				line-height: 110rpx;
+				font-size: $font-size-24;
+				.checkbox{
+					width: 40rpx;
+					text-align: center;
+				}
+				.text{
+					width: 60rpx;
+					float: right;
+				}
+			}
+			.sum{
+				width: 380rpx;
+				height: 110rpx;
+				float: right;
+				.sum-none{
+					width: 100%;
+					height: 55rpx;
+					line-height: 55rpx;
+					color: $text-color;
+					float: left;
+					text-align: right;
+					.money{
+						font-size: $font-size-26;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-sign{
+						font-size: $font-size-26;
+						color: #999999;
+						text-decoration: line-through;
+					}
+					.money-reduced{
+						margin-left: 10rpx;
+						font-size: $font-size-26;
+						color: $color-system;
+						.iconfont{
+							font-size: $font-size-34;
+						}
+					}
+				}
+				.sum-price{
+					text-align: right;
+					width: 100%;
+					height: 55rpx;
+					line-height: 55rpx;
+					font-size: $font-size-30;
+					color: $text-color;
+					float: left;
+					font-weight: bold;
+					.money{
+						color: #FF2A2A;
+					}
+					.money-sign{
+						font-size: $font-size-24;
+						color: #FF2A2A;
+					}
+				}
+			}
+		}
+		.footer-ri{
+			width: 200rpx;
+			height: 100%;
+			background:linear-gradient(135deg,rgba(242,143,49,1) 0%,rgba(225,86,22,1) 100%);
+			float: right;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			z-index: 999;
+			&.none{
+				display: none;
+			}
+			.btn{
+				width: 200rpx;
+				height: 100%;
+				font-size: $font-size-28;
+				line-height: 110rpx;
+				color: #FFFFFF;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+		}
+		.footer-del{
+			width: 400rpx;
+			height: 110rpx;
+			position: absolute;
+			padding-left: 200rpx;
+			background: #FFFFFF;
+			right: 0;
+			top: 0;
+			z-index: 1000;
+			&.show{
+				animation: showDelbtn 0s linear both;
+			}
+			&.none{
+				animation: hideDelbtn 0s linear both;
+			}
+			.btn{
+				width: 50%;
+				height: 100%;
+				line-height: 110rpx;
+				font-size: $font-size-28;
+				color: #FFFFFF;
+				text-align: center;
+				float: left;
+			}
+			.btn.btn-cancel{
+				background:#EEC1AB;
+			}
+			.btn.btn-confirm{
+				background:#FF2A2A;
+			}
+			@keyframes showDelbtn {
+				0% {
+					transform: translateX(0);
+				}
+				100% {
+					transform: translateX(-100%);
+				}
+			}
+			@keyframes hideDelbtn {
+				0% {
+					transform: translateX(-100%);
+				}
+				100% {
+					transform: translateX(0);
+				}
+			}
+		}
+	}
 </style>

+ 218 - 131
pages/tabBar/cart/cart.vue

@@ -1,18 +1,19 @@
 <template>
 	<view class="container cart clearfix" v-if="hasLogin"> 	
 		<tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading	="true" :loadingType="5"></tui-skeleton>
-		<view class="container-cart-main tui-skeleton">
+		<view class="container-cart-main tui-skeleton" :style="{paddingTop:isshowDelbtn ? '0rpx':'80rpx'}">
+			<view class="foot-check-delbtn" v-if="!isshowDelbtn">
+				<view class="foot-text">共<text>{{kindCount}}</text>件商品</view>
+				<view class="delBtn" @tap.stop="showDelManager">删除</view>
+			</view>
 			<view v-if="!isEmpty" class="container-cart">
 				<view class="cart-content" :style="{paddingBottom :isIphoneX ? '130rpx' : '100rpx'}">
 					<view class="goods-list">
-						<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
+						<view v-for="(item, index) in goodsList" :key="index" class="goods-item clearfix">
 							<view class="shoptitle">
 								<!--选择商店的全部商品"-->
 								<view class="checkbox-box" @click.stop="checkShop(item)">
-									<view class="checkbox iconfont" 
-											:class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']" 									
-											:disabled="item.isDisabled && !isshowDelbtn">
-									</view>
+									<view class="checkbox iconfont" :class="[item.checked ?'icon-gouxuanl':'icon-weigouxuan']"></view>
 								</view>
 								<view v-if="item.promotions" class="floor-item-act">
 									<view class="floor-tags" @click.stop="clickPopupShow(item,2)">{{item.promotions.name}}</view>	
@@ -23,37 +24,31 @@
 								<view 	class="goods-pros" v-for="(pros,idx) in item.cartList" :key="idx" >
 									<view class="goods-pros-t">
 										<!--选择商品-->
-										<view class="checkbox-box" @click.stop="ischeck(item,pros)" :class="[pros.validFlag == 3 && !isshowDelbtn ?'disabled' : '']">
-											<view class="checkbox iconfont" 
-												  :disabled="pros.validFlag == 3 && !isshowDelbtn"
-												  :class="[pros.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
+										<view class="checkbox-box" @click.stop="ischeck(item,pros)">
+											<view class="checkbox iconfont" :class="[pros.productsChecked ? 'icon-gouxuanl':'icon-weigouxuan']">
 											</view>
 										</view>
 										<view class="pros-img" @click.stop="navToListPage(pros.productId)"	><image :src="pros.image ? pros.image:''" alt="" /></view>
 										<view class="pros-product">
-											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>
-												<text v-if="pros.validFlag == 3" class="no-text">商品已下架</text>{{pros.name}}
-											</view>
+											<view class="producttitle" @click.stop="navToListPage(pros.productId)"	>{{pros.name}}</view>
 											<view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
 											<view class="productprice">
 												<!--使用过滤器对总价改变-->
-												<view class="price" 
-													  :class="[pros.validFlag == 3 || promotionsFn(pros.promotions) ?'disabled' : '']">
-													<text :class="[pros.validFlag == 3 || promotionsFn(pros.promotions) ?'disabled' : 'money-sign']">¥</text>
-													{{pros.price | NumFormat}}
+												<view class="price" :class="PromotionsFormat(pros.promotions) ? 'disabled' : ''">
+													<text>¥</text>{{pros.price | NumFormat}}
 												</view>
-												<view class="count" v-if="pros.validFlag == 2"  :class="[isshowDelbtn ? 'none':'show']">
+												<view class="count" v-if="pros.validFlag == 2 "  :class="[isshowDelbtn ? 'none':'show']">
 													<text class="count-tips" v-if="pros.number<pros.min">起订量:{{pros.min}}</text>
 													<text class="count-tips step" v-if="pros.isStep">购买量必须为起订量的整数倍</text>
 													<view class="number-box">
-														<view  class="iconfont icon-jianhao" :class="[pros.validFlag == 3 ?'disabled':'']" @click="changeCountSub(item,pros)"></view>
+														<view  class="iconfont icon-jianhao" @click="changeCountSub(item,pros)"></view>
 														<input class="btn-input" type="number" maxlength='4' v-model="pros.number" @blur="changeNnmber($event,item,pros)" @focus="changeInput(pros)">
-														<view  class="iconfont icon-jiahao"  :class="[pros.validFlag == 3 ?'disabled':'']" @click="changeCountAdd(item,pros)"></view>
+														<view  class="iconfont icon-jiahao"  @click="changeCountAdd(item,pros)"></view>
 													</view>
 												</view>
 											</view>
 											<view v-show="pros.actStatus==1" class="floor-item-act">
-												<view v-if="promotionsFn(pros.promotions)"  class="floor-tags" @click.stop="clickPopupShow(pros,1)">
+												<view v-if="PromotionsFormat(pros.promotions)"  class="floor-tags" @click.stop="clickPopupShow(pros,1)">
 													{{pros.promotions.name}}
 													<text v-if ="pros.promotions!=null">
 														:¥{{ pros.promotions == null ? '0.00' : pros.promotions.touchPrice | NumFormat}}
@@ -68,7 +63,12 @@
 									</view>
 								</view>
 							</view>	
-							<view class="goods-pros-b" :class="[isshowDelbtn ? 'none':'show']" >
+							<view class="goods-pros-b clearfix" :class="[isshowDelbtn ? 'none':'show']" >
+								<view class="sum-none" v-if="item.reducedPrice>0">
+									<text class="money-sign">¥</text>
+									<text class="money">{{ item.totalOriginalPrice | NumFormat }}</text>
+									<text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ item.reducedPrice | NumFormat}}</text></text>
+								</view>
 								<view class="sum">合计:<text class="money"><text class="money-sign">¥</text>{{item.totalPrice | NumFormat}}</text></view>
 							</view>
 						</view>
@@ -76,7 +76,7 @@
 					<view class="failure-list" v-if="failureList.length>0">
 						<view class="failure-title">
 							<view class="title-txt">失效商品<text>{{failureList.length}}件</text></view>
-							<view class="title-btn" @click.stop="deletefailureList">清空失效商品</view>
+							<view class="title-btn" @click.stop="deletefailureList"><text class="butto">清空失效商品</text></view>
 						</view>
 						<view class="productlist">
 							<view class="goods-pros" v-for="(failure,failureIdx) in failureList" :key="failureIdx" >
@@ -109,14 +109,14 @@
 							<button class="checkbox iconfont" :class="[isCheckAll?'icon-gouxuan':'icon-weigouxuan']"></button> 
 							<view class="text">全选</view>
 						</view>
-						<view class="foot-check-delbtn">
-							<button class="delBtn" @tap.stop="showDelManager">删除</button>
-						</view>
+	
 						<view class="sum">
-							<view class="sum-none" v-if="reducedPrice>0">
-								<text class="money-sign">¥</text>
-								<text class="money">{{ totalOriginalPrice | NumFormat }}</text>
-								<text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
+							<view class="sum-none">
+								<template v-if="reducedPrice>0">
+									<text class="money-sign">¥</text>
+									<text class="money">{{ totalOriginalPrice | NumFormat }}</text>
+									<text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
+								</template>
 							</view>
 							<view class="sum-price">
 								总价:<text class="money-sign">¥</text><text class="money">{{allPrice | NumFormat}}</text>
@@ -174,14 +174,15 @@
 				handlerPros:{},//监听单挑促销商品
 				failureList:[],	//失效商品列表
 				goodsList:[],	//购物车的商品
+				promotionsList:[],//促销列表
 				delGoodsList:'',//要删除的商品
 				setGoodData:'', //确认订单的商品
 				isCheckAll:false,//是否全选
+				kindCount:0,//购物车宝贝数量
 				allPrice:0,//所有价格
 				totalOriginalPrice:0,//所有原价价
 				reducedPrice:0,//满减
 				allCount:0,//被选中的产品数量
-				isNnder:true,
 				isModallayer:false,
 				skeletonShow:true,
 				isshowDelbtn:false,
@@ -253,6 +254,8 @@
 				this.ProductService.queryShoppingCartList({userId:this.userID}).then(response =>{
 					this.skeletonShow = false
 					let data = response.data
+					this.kindCount = data.kindCount
+					this.promotionsList = data.promotions
 					this.$store.commit('updateAllNum',data.kindCount)
 					if( data.list.length > 0 || data.invalid.length > 0){
 						this.isEmpty =false
@@ -262,14 +265,9 @@
 					if(data.list && data.list.length > 0 ){
 						this.goodsList = data.list;
 						this.goodsList.forEach((item,index) => {
-							let productsListLength = item.cartList.length,
-								invalidLength = 0;
-								item.checked = false;
 							item.cartList.forEach(pros => {
 								pros.shopID = item.shopID;
 								pros.isStep = false
-								pros.productsChecked = false
-								if(pros.validFlag == 3 ) {invalidLength++;}
 								if(pros.step === 2){ 
 									if(pros.number % pros.min != 0){
 										pros.number = pros.min
@@ -278,8 +276,8 @@
 									}
 								}
 							})
-							item.isDisabled = invalidLength === productsListLength;
 						})
+						this.totalShopPeice()
 					} else {
 						this.goodsList = [];
 					}
@@ -323,33 +321,32 @@
 					})
 				} else {
 					productsList.forEach(pros => {
-						if(pros.productsChecked && pros.validFlag != 3) {
+						if(pros.productsChecked) {
 							productsCheckedLength++;
 						}
-						if(pros.validFlag == 3) {disabledLength++;}
 					})
 				}
-				item.checked = productsCheckedLength === productsList.length - disabledLength;
+				item.checked = productsCheckedLength === productsList.length;
 			},
 			updateCheckAllBtn() {// 全选勾选判断
 				let goodsCheckedLength = 0,
-					disabledListLength = 0,
 					goodsList = this.goodsList,
 					failureList = this.failureList;
 				goodsList.forEach(item => {
 					if(item.checked) {
 						goodsCheckedLength++;
 					}
-					if(item.isDisabled && !this.isshowDelbtn) {
-						disabledListLength++;
-					}
 				})
 				failureList.forEach(failureItem=>{
 					if(failureItem.productsChecked){
 						goodsCheckedLength++;
 					}
 				})
-				this.isCheckAll = goodsCheckedLength === goodsList.length+failureList.length - disabledListLength;
+				if(this.isshowDelbtn){
+					this.isCheckAll = goodsCheckedLength === goodsList.length + failureList.length;
+				}else{
+					this.isCheckAll = goodsCheckedLength === goodsList.length;
+				}
 			},
 			checkShop(item){//与单选商品类似
 				item.checked = !item.checked;
@@ -359,15 +356,7 @@
 			setProductChecked(item) {
 				item.cartList.forEach(pros=>{
 					if(item.checked) {
-						if(pros.validFlag == 3){
-							// 无效
-							this.isNnder = true;
-							pros.productsChecked = this.isshowDelbtn ?true :false;
-						}else{
-							// 有效
-							this.isNnder = false;
-							pros.productsChecked = true;
-						}
+						pros.productsChecked = true;
 					} else {
 						pros.productsChecked = false;
 					}
@@ -397,43 +386,97 @@
 			},
 			totalShopPeice(){//每次所属会所下的商品增减重新计算合计价格&减去含有下架的商品
 				let prosPrice=0;
-				let validPrice =0;
-				let validList=[];
+				let touchPrice = 0; 
+				let reducedPrice = 0;//商铺合计满减价
+				let totalOriginalPrice = 0;//商铺合计原价
 				let productsList=[];
 				this.goodsList.map((item,index)=>{
-					productsList=item.cartList;
-					prosPrice=productsList.reduce((p,e)=>p+e.price*e.number,0);
-					productsList.forEach(pros =>{
-						if(pros.validFlag ==3){
-							validList.push(pros)
-							validPrice = validList.reduce((p,e)=>p+e.price*e.number,0);
-							item.totalPrice = prosPrice - validPrice
-						}else{
-							item.totalPrice = prosPrice
-						}
-					})
+					productsList = item.cartList;
+					//计算店铺满减后店铺合计
+					if(item.promotions && item.promotions.mode == 2){
+						productsList.forEach(pros=>{
+							prosPrice += pros.price*pros.number
+							totalOriginalPrice+= pros.price*pros.number;
+							if(prosPrice >= item.promotions.touchPrice){
+								item.totalPrice = prosPrice - item.promotions.reducedPrice  
+								item.reducedPrice = item.promotions.reducedPrice
+								item.totalOriginalPrice = totalOriginalPrice
+							}else{
+								item.totalPrice = prosPrice
+							}
+						})
+					}else{//以下为计算除店铺满减以外的单品满减以及正常商品合计
+						let _totalPrice = 0;
+						let _reducedPrice = 0;
+						let _totalOriginalPrice =0;
+						productsList.forEach(pros=>{
+							let _price = pros.price*pros.number
+							_totalOriginalPrice += pros.price*pros.number;
+							if(pros.promotions && pros.promotions.type != 2 && pros.promotions.mode == 2){
+								if(_price >= pros.promotions.touchPrice){
+									_price = _price - pros.promotions.reducedPrice
+									_reducedPrice += pros.promotions.reducedPrice
+								}
+								_totalPrice +=  _price
+							}else{
+								_totalPrice += pros.price*pros.number;
+							}
+						})
+						item.reducedPrice = _reducedPrice
+						item.totalOriginalPrice = _totalOriginalPrice
+						item.totalPrice = _totalPrice
+					}
 				})
 			},
 			totalPeice(){	//计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
 			    this.allPrice = 0
-				let prosPrice=0;
-				let validPrice=0;
-				let validList =[];
 				let productsList =[];
+				//店铺满减
+				let prosPrice=0;
+				let totalPrice = 0;
+				let reducedPrice=0;//促销满减
+				let totalOriginalPrice=0;//促销原价
+				//凑单满减.单品满减
+				let _totalPrice = 0;
+				let _reducedPrice = 0;
+				let _totalOriginalPrice =0;
+				// 正常商品
+				let _totalNonePrice = 0;
+				/*
+				*originalPrice:商品原价
+				*price:商品现价
+				*mode:促销商品满减计算 促销方式mode为 2 的单独做计算 当mode == 2时商品promotions字段为促销活动内容,
+				*touchPrice 为需要满金额 
+				*reducedPrice 为满减金额
+				**/ 
 			    this.goodsList.forEach((item,index)=>{
-					productsList=item.cartList;
-					productsList.forEach(pros=>{	
+					item.cartList.forEach(pros=>{	
 						if(pros.productsChecked){
-							prosPrice+=pros.price*pros.number;
-							if(pros.validFlag ==3){
-								validList.push(pros)
-								validPrice = validList.reduce((p,e)=>p+e.price*e.number,0);
-								this.allPrice = prosPrice - validPrice
+							if(item.promotions && item.promotions.mode == 2){
+								prosPrice = pros.price*pros.number
+								if(prosPrice >= item.promotions.touchPrice){
+									totalPrice += prosPrice - item.promotions.reducedPrice  
+									totalOriginalPrice += pros.originalPrice*pros.number
+									reducedPrice += item.promotions.reducedPrice
+								}else{
+									totalPrice += prosPrice
+								}
+							}else if(pros.promotions && pros.promotions.mode == 2){//以下为计算除店铺满减以外的单品满减以及正常商品
+								let _price = pros.price*pros.number
+								_totalOriginalPrice += pros.originalPrice*pros.number;
+								if(_price >= pros.promotions.touchPrice){
+									_price = _price - pros.promotions.reducedPrice
+									_reducedPrice += pros.promotions.reducedPrice
+								}
+								_totalPrice +=  _price
 							}else{
-								this.allPrice = prosPrice
+								_totalNonePrice += pros.price*pros.number;
 							}
 						}	
 					})
+					this.totalOriginalPrice = totalOriginalPrice + _totalOriginalPrice;
+					this.reducedPrice = reducedPrice +_reducedPrice;
+					this.allPrice = totalPrice + _totalPrice + _totalNonePrice;
 			    })
 			},
 			totalCount(){//计算总数量
@@ -447,15 +490,7 @@
 					productsList.forEach(pros=>{
 						if(pros.productsChecked){
 							prosAllCount+=parseInt(pros.number);
-							if(pros.validFlag ==3){
-								validList.push(pros)
-								validList.forEach(val =>{
-									validCount += val.number
-								})
-								this.allCount = prosAllCount - validCount
-							}else{
-								this.allCount = prosAllCount
-							}
+							this.allCount = prosAllCount
 						}
 					})
 			    })
@@ -495,7 +530,6 @@
 				pros.isStep = false
 			},
 			changeNnmber(e,item,pros){//输入商品数量更新
-				
 				let _value = Number(e.detail.value);
 				if(!this.$api.isNumber(_value)){
 					pros.number = pros.min
@@ -581,7 +615,6 @@
 			},
 			showDelManager(){//显示删除商品管理
 				this.isshowDelbtn = true;
-				this.isNnder = true;
 				if(this.isCheckAll) {
 					this.updateBothCheckBtn();	
 				} else {
@@ -663,7 +696,7 @@
 				}
 			},
 			deletefailureList(){
-				this.failureList.forEach(failure=>{ this.delGoodsList += failure.productID+',' })
+				this.failureList.forEach(failure=>{ this.delGoodsList += failure.productId+',' })
 				this.$util.modal('','确定清空全部失效商品吗?','确定','取消',true,() =>{
 					this.ProductService.shoppingCartDelete({userID:this.userID,productIDs:this.delGoodsList}).then(response =>{
 						this.$util.msg('删除成功',2000);
@@ -734,7 +767,7 @@
 				})
 				return systeminfo
 			},
-			promotionsFn(promo){//处理数据
+			PromotionsFormat(promo){//促销活动类型数据处理
 				if(promo!=null){
 					if(promo.type == 1 && promo.mode == 1){
 						return true
@@ -800,6 +833,46 @@
 	.empty-container.show{
 		display: flex;
 	}
+	.foot-check-delbtn{
+		width: 100%;
+		height: 80rpx;
+		position: fixed;
+		top: 0;
+		left: 0;
+		box-sizing: border-box;
+		padding: 15rpx 24rpx;
+		background-color: #F7F7F7;
+		z-index: 9999;
+		.foot-text{
+			font-size: $font-size-26;
+			height: 50rpx;
+			line-height: 50rpx;
+			color: $text-color;
+			float: left;
+			padding-left: 10rpx;
+			text{
+				color: $color-system;
+				margin: 0 6rpx;
+			}
+		}
+		.delBtn{
+			width: 100rpx;
+			display: inline-block;
+			padding: 0 15rpx;
+			font-size: $font-size-26;
+			height: 50rpx;
+			line-height: 50rpx;
+			border-radius: 30rpx;
+			background:#FFFFFF;
+			border: 1px solid #C9C9C9;
+			color: #999999;
+			float: right;
+			text-align: center;
+			&.none{
+				display: none;	
+			}
+		}
+	}
 	.checkbox-box{
 		display: flex;
 		align-items: center;
@@ -866,7 +939,7 @@
 				box-sizing: border-box;
 				float: left;
 				padding:10rpx 0;
-				margin-left: 10rpx;
+				margin-left: 20rpx;
 				.floor-tags{
 					float: right;
 					height: 36rpx;
@@ -908,21 +981,49 @@
 			}
 		}
 		.goods-pros-b{
-			width:622rpx;
-			margin-left: 84rpx;
-			height: 40rpx;
-			padding:0 0 26rpx 0;
-			// border-top: 1px solid #EBEBEB;
+			width:100%;
+			height: auto;
+			padding:0 0 24rpx 0;
+			box-sizing: border-box;
 			&.show{
 				display: block;
 			}
 			&.none{
 				display: none;
 			}
+			.sum-none{
+				width: 100%;
+				height: 48rpx;
+				line-height: 48rpx;
+				color: $text-color;
+				float: left;
+				text-align: right;
+				.money{
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-sign{
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-reduced{
+					margin-left: 10rpx;
+					font-size: $font-size-26;
+					color: $color-system;
+					.iconfont{
+						font-size: $font-size-34;
+					}
+				}
+			}
 			.sum{
+				width: 100%;
+				height: 40rpx;
 				font-size: $font-size-28;
 				line-height: 40rpx;
 				color: $text-color;
+				float: left;
 				display: flex;
 				justify-content: flex-end;
 				.money{
@@ -973,7 +1074,7 @@
 			.productprice{
 				width: 100%;
 				height: 48rpx;
-				margin: 10rpx 0;
+				margin: 10rpx 0 0 0;
 				.price{
 					line-height: 48rpx;
 					font-size: $font-size-28;
@@ -1068,14 +1169,15 @@
 				}
 			}
 			.floor-item-act{
+				width: 100%;
 				height: 56rpx;
 				text-align: center;
 				box-sizing: border-box;
 				float: left;
-				padding:10rpx 0;
+				padding:0 0 10rpx 0;
 				margin-left: 10rpx;
 				.floor-tags{
-					float: right;
+					float: left;
 					height: 36rpx;
 					border-radius: 4rpx;
 					background-color: rgba(225, 86, 22, 0.1);
@@ -1110,6 +1212,19 @@
 				float: right;
 				color: $color-system;
 				text-align: right;
+				line-height: 80rpx;
+				.butto{
+					display: inline-block;
+					padding: 0 15rpx;
+					font-size: $font-size-26;
+					height: 50rpx;
+					line-height: 50rpx;
+					border-radius: 30rpx;
+					background:#FFFFFF;
+					border: 1px solid #C9C9C9;
+					color: #999999;
+					margin-top: 15rpx;
+				}
 			}
 		}
 		.productlist{
@@ -1156,11 +1271,11 @@
 					}
 				}
 				.pros-marks{
-					width: 722rpx;
					height: 250rpx;
+					width: 750rpx;
					height: 250rpx;
 					z-index: 90;
 					background: rgba(0,0,0,.05);
 					position: absolute;
-					left:0;
+					left:-20rpx;
 					top: -20rpx;
 				}
 			}
@@ -1267,36 +1382,8 @@
 					float: right;
 				}
 			}
-			.foot-check-delbtn{
-				float: left;
-				.delBtn{
-					margin: 0;
-					padding: 0;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-					box-sizing: border-box;
-					font-size: $font-size-24;
-					text-align: center;
-					text-decoration: none;
-					border-radius: 0;
-					-webkit-tap-highlight-color: transparent;
-					overflow: hidden;
-					background-color:#FFFFFF;
-					color: #FF2A2A;
-					padding: 0 24rpx;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					line-height: 110rpx;
-					font-weight: bold;
-					&.none{
-						display: none;	
-					}
-				}
-			}
 			.sum{
-				width: 280rpx;
+				width: 380rpx;
 				height: 110rpx;
 				float: right;
 				.sum-none{

+ 59 - 12
pages/user/order/create-order.vue

@@ -52,7 +52,12 @@
 					<text>共{{allCount}}件商品</text>
 				</view>
 				<view class="footer-price">
-					<text>总价:<text class="price">¥{{payAllPrice.toFixed(2)}}</text></text>
+					<view class="sum-none" v-if="reducedPrice>0">
+						<text class="money-sign">¥</text>
+						<text class="money">{{ totalOriginalPrice | NumFormat }}</text>
+						<text class="money-reduced"><text class="iconfont icon-biaoqian"></text>减<text>¥{{ reducedPrice | NumFormat}}</text></text>
+					</view>
+					<view class="sum">总价:<text class="price">¥{{payAllPrice | NumFormat}}</text></view>
 				</view>
 			</view>
 			<view class="footer-submit" @click.stop="orderSubmitMit">提交订单</view>
@@ -68,7 +73,7 @@
 	import freightAlert from '@/components/cm-module/modelAlert/freightAlert'
 	import modalLayer from "@/components/modal-layer"
 	import { queryAddressList } from "@/api/cart.js"
-	import { createOrderInfo,createOrderSubmit,getOrderPostage } from "@/api/order.js"
+	import { createOrderSubmit,getOrderPostage } from "@/api/order.js"
 
 	export default {
 		components:{
@@ -91,6 +96,8 @@
 				submitState:'',  		  //提交状态
 				balanceDeductionFlag:2,   //勾选余额的状态(1使用,2不使用)
 				allCount:1,				  //订单提交总数量
+				totalOriginalPrice:0,	  //订单总原价(划线部分)
+				reducedPrice:0,			  //满减金额
 				payAllPrice:0.00,		  //订单提交总金额
 				allPrice:0.00,			  //订单总金额
 				surplusMoney:0.00,		  //显示勾选后的剩余抵扣
@@ -117,9 +124,6 @@
 		},
 		onLoad(option){//商品数据
 			let data = JSON.parse(option.data);
-			this.allPrice = data.data.allPrice;
-			this.allCount = data.data.allCount;
-			this.payAllPrice = this.allPrice;
 			if(option.type =='prodcut'){
 				this.cartType = 2
 				this.productCount = data.data.productCount
@@ -134,14 +138,22 @@
 				this.getInitCrearOrder(option);
 			})
 		},
+		filters:{
+			NumFormat(value) {//处理金额
+				return Number(value).toFixed(2);
+			},
+		},	
 		methods: {
 			getInitCrearOrder(option){//获取订单商品信息
 				let params ={userId:this.userID,count:this.productCount,productIds:this.productIds}
-				createOrderInfo(params).then(response =>{
+				this.OrderService.CreateOrderInfo(params).then(response =>{
 					let resData = response.data
 					this.isRequest = true
 					this.goodsData = resData.list
 					this.userMoney = resData.userMoney
+					this.reducedPrice = resData.reducedPrice
+					this.allPrice = this.payAllPrice = resData.totalPrice
+					this.totalOriginalPrice = resData.totalOriginalPrice
 					this.rechargeGoods = resData.rechargeGoods
 				}).catch(error =>{
 					this.$util.msg(error.msg,2000)
@@ -275,7 +287,7 @@
 					let productInfo = [];
 					el.cartList.forEach(item => {
 						productInfo.push({
-							productId:item.id,
+							productId:item.productId,
 							productNum:item.number,
 							presentNum:0,
 							productType:item.productType
@@ -472,18 +484,53 @@
 		.footer-count{
 			float: left;
 			padding-left: 24rpx;
-			font-weight: bold;
+			width: 200rpx;
+			box-sizing: border-box;
 		}
 		.footer-price{
+			width: 350rpx;
 			float: right;
 			text-align: right;
 			color: $text-color;
-			font-weight: bold;
 			padding-right: 24rpx;
-			.price{
-				font-size: $font-size-32;
-				color: #FF2A2A;
+			box-sizing: border-box;
+			.sum-none{
+				width: 100%;
+				height: 55rpx;
+				line-height: 55rpx;
+				color: $text-color;
+				float: left;
+				text-align: right;
+				.money{
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-sign{
+					font-size: $font-size-26;
+					color: #999999;
+					text-decoration: line-through;
+				}
+				.money-reduced{
+					margin-left: 10rpx;
+					font-size: $font-size-26;
+					color: #ff2a2a;
+					.iconfont{
+						font-size: $font-size-34;
+					}
+				}
+			}
+			.sum{
+				width: 100%;
+				height: 55rpx;
+				line-height: 55rpx;
+				float: left;
+				.price{
+					font-size: $font-size-32;
+					color: #FF2A2A;
+				}
 			}
+			
 		}
 		.footer-submit{
 			display:flex;

+ 2 - 2
services/ajax.env.js

@@ -2,9 +2,9 @@ let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
 	// URL_CONFIG = 'http://192.168.2.68:8008'	 //本地IP联调地址
-	// URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
+	URL_CONFIG = 'http://192.168.2.67:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.2.75:8008'	 //超超联调地址
-    URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
+    // URL_CONFIG = 'https://spi-b.caimei365.com'	 //采美测试地址
 	// URL_CONFIG = 'https://spi.caimei365.com'
 }else{
     // 生产环境

+ 12 - 4
services/order.service.js

@@ -6,9 +6,14 @@ export default class OrderService {
 		Object.assign(this, { AjaxService })
 		this.name = 'OrderService'
 	}
-	/* 分享订单初始化查询 orderId 订单ID */
-	OrderCommodityData (data = {}) {
-		return this.AjaxService.get({ url:'/order/commodityData', data, isLoading: true })
+	/**
+	 *@机构-确认订单初始化数据
+	 *@param userId 用户ID
+	 *@param count	商品数量
+	 *@param productIds 商品IDs
+	 */
+	CreateOrderInfo (data = {}) {
+		return this.AjaxService.get({ url:'/order/confirm', data, isLoading: false })
 	}
 	/* 订单支付,效验付款规则 orderId 订单ID */
 	OrderPaymentValidation (data = {}) {
@@ -18,5 +23,8 @@ export default class OrderService {
 	OrderBalanceDeduction (data = {}) {
 		return this.AjaxService.post({ url:'/order/balanceDeduction', data, isLoading: false })
 	}
-	
+	/* 分享订单初始化查询 orderId 订单ID */
+	OrderCommodityData (data = {}) {
+		return this.AjaxService.get({ url:'/order/commodityData', data, isLoading: true })
+	}
 }