Prechádzať zdrojové kódy

commit -m 9月版本

zhengjinyi 3 rokov pred
rodič
commit
964aa58a00

+ 1 - 1
components/cm-module/listTemplate/productList.vue

@@ -28,7 +28,7 @@
 						</view>
 						<view class="list-details-price">
 							<view class="floor-item-act" v-if="item.actStatus==1">
-								<template v-if="item.actStatus==0">
+								<template>
 									<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
 										{{item.promotions.name}}
 										<text v-if="item.priceFlag != 1">:¥{{ item.price | NumFormat }}</text>

+ 446 - 158
pages/user/collection/collection.vue

@@ -3,8 +3,8 @@
 		<view class="superv-header" v-if="!isEmpty">
 			<view class="superv-header-click">
 				<view class="oltext">共<text class="red">3</text>件商品</view>
-				<view class="ortext" @click="supervClickFn" v-if="!isSuperv">编辑</view>
-				<view class="ortext" @click="closeSupervFn" v-else>完成</view>
+				<view class="ortext" @click="showPopup(0)" v-if="!popupShow">编辑</view>
+				<view class="ortext" @click="hidePopup(0)" v-else>完成</view>
 			</view>
 		</view>
 		<view class="product-content">
@@ -15,28 +15,51 @@
 					<text class="error-text">暂无收藏商品~</text>
 				</view>
 				<!-- 列表 -->
-				<view class="tui-cart-cell  tui-mtop" v-for="(item,index) in dataList" :key="index">
+				<view class="tui-cart-cell  tui-mtop" v-for="(item,index) in productList" :key="index">
 					<view class="tui-goods-item">
-						<view class="tui-goods-checkBox" v-if="isSuperv">
-							<view class="checkbox iconfont" 
-								  :class="[item.isChecked ?'icon-yixuanze':'icon-weixuanze']" 
-								  @click="checkedSoperv(item)">
+						<view class="tui-goods-main">
+							<view class="tui-goods-checkBox" v-if="popupShow">
+								<view class="checkbox iconfont" 
+									  :class="[item.isChecked ?'icon-yixuanze':'icon-weixuanze']" 
+									  @click="checkedSoperv(item)">
+								</view>
 							</view>
-						</view>
-						<view class="tui-goods-image">
-							<image :src="item.image" class="tui-goods-img"/>
-						</view>
-						<view class="tui-goods-info" :style="{width:isSuperv ? '360rpx' : '420rpx'}"> 
-							<view class="tui-goods-title">{{ item.name }}</view>
-							<view class="tui-price-box">
-								<view class="tui-goods-price">¥{{item.price | NumFormat}}</view>
+							<view class="tui-goods-image">
+								<image :src="item.image" class="tui-goods-img"/>
 							</view>
-							<view class="tui-goods-pip">市场价:¥{{item.normalPrice | NumFormat}}</view>
-							<view class="tui-goods-pip">分类:{{ item.typeName ? item.typeName : '无' }}</view>
-						</view>
-						<view class="tui-goods-status">
-							<view class="status-text" :style="{ color: verifyColorFilter(item.validFlag)}">
-								{{ item.validFlag | verifyStatusFilter }}
+							<view class="tui-goods-info" :style="{width:popupShow ? '420rpx' : '528rpx'}"> 
+								<text class="list-details-title">{{item.name}}</text>
+								<text class="list-details-specs">规格:{{item.unit !=null ? item.unit : ''}}</text>
+								<view class="list-details-price" v-if="item.priceFlag == 1">
+									<view class="list-none"><view class="price-small">¥未公开价格</view></view>
+								</view>
+								<view class="list-details-price" v-else-if="item.priceFlag == 2">
+									<view class="list-none"><view class="price-small">¥价格仅会员可见</view></view>
+								</view>
+								<template v-else>
+									<view class="list-details-price">
+										<view class="list-price">
+											<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
+												¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat }}
+											</text>
+										</view>
+										<view class="add-cart-btn" v-if="!popupShow" @click.stop="showPopup(1,item)">数量</view>
+									</view>
+									<view class="list-details-price none">
+										<view class="floor-item-act" v-if="item.actStatus==1">
+											<template>
+												<view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
+													{{item.promotions.name}}
+													<text v-if="item.priceFlag != 1">:¥{{ item.price | NumFormat }}</text>
+												</view>
+												<view class="floor-tags" v-else>{{item.promotions.name}}</view>	
+											</template>
+										</view>
+										<view class="floor-item-act" v-if="item.actStatus==0">
+											<view class="floor-tags" v-if="item.actStatus ==0  &&  item.ladderPriceFlag==1">阶梯价格</view>	
+										</view>
+									</view>	
+								</template>
 							</view>
 						</view>
 					</view>
@@ -47,8 +70,8 @@
 				<!--加载loadding-->
 			</view>
 		</view>
-		<!-- 批量操作 -->
-		<tui-bottom-popup :radius="false" :mask="false" :show="isSuperv">
+		<!-- 取消收藏操作 -->
+		<tui-bottom-popup :radius="false" :mask="false" :show="popupShow">
 			<view class="tui-popup-box clearfix">
 				<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
 					<view class="tui-flex-1">
@@ -58,7 +81,39 @@
 								<view class="text">全选</view>
 							</view>
 						</view>
-						<view class="tui-button" :class="isProductChecked ? 'active' : ''" @click="handleAllUnder()">取消收藏</view>
+						<view class="tui-button" :class="isProductChecked ? 'active' : ''" @click="handleAllUnder">取消收藏</view>
+					</view>
+				</view>
+			</view>	
+		</tui-bottom-popup>	
+		<!-- 培训方案 -->
+		<tui-bottom-popup :radius="true" :show="popupShow1" @close="hidePopup(1)">
+			<view class="tui-popup-box clearfix">
+				<view class="tui-popup-content">
+					<view class="layer-smimg">
+						<image :src="handleData.image" mode=""></image>
+					</view>
+					<view class="layer-nunbox">
+						<view class="layer-nunbox-t">
+							<view class="layer-nunbox-text">数量:</view>
+							<view class="number-box">
+								<view  class="iconfont icon-jianhao" :class="[isQuantity==true?'disabled':'']" @click="changeCountSub()"></view>
+								<input class="btn-input" type="number" v-model="number" maxlength='4'  @blur="changeNumber($event)">
+								<view  class="iconfont icon-jiahao"  :class="[isStock==true?'disabled':'']" @click="changeCountAdd()"></view>
+							</view>
+						</view>
+						<view class="layer-nunbox-b">
+							<view class="text">单价:
+								<text class="p sm">¥</text>
+								<text class="p bg">{{buyRetailPrice.toFixed(2)}}</text>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
+					<view class="tui-flex-btn">
+						<view class="button add" @click="toConfirmation">加入购物车</view>
+						<view class="button buy" @click="getAddProductCart">立即购买</view>
 					</view>
 				</view>
 			</view>	
@@ -104,12 +159,86 @@
 			return{	
 				StaticUrl:this.$Static,
 				cartQuantity:0,
-				isSuperv:false,
+				popupShow:false,
+				popupShow1:false,
 				isProductChecked:false,
 				listQuery:Object.assign({}, defaultListQuery),
-				dataList: [],
+				productList: [
+					{
+						image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
+						name:'ET-SPACE全身热疗系统(生物热能太空舱)',
+						unit:'台',
+						ladderPriceFlag:0,
+						priceFlag:1,
+						maxBuyNumber:2,
+						minBuyNumber:1,
+						originalPrice:100,
+						price:50,
+						actStatus:0,
+						promotions:null,
+						isChecked:false,
+						productIds:1000
+					},
+					{
+						image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
+						name:'ET-SPACE全身热疗系统(生物热能太空舱)',
+						unit:'台',
+						ladderPriceFlag:1,
+						priceFlag:2,
+						maxBuyNumber:2,
+						minBuyNumber:1,
+						originalPrice:100,
+						price:50,
+						actStatus:1,
+						promotions:{
+							type:1,
+							mode:1,
+							name:'优惠价'
+						},
+						isChecked:false,
+						productIds:1001
+					},
+					{
+						image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
+						name:'ET-SPACE全身热疗系统(生物热能太空舱)',
+						unit:'台',
+						ladderPriceFlag:1,
+						priceFlag:0,
+						maxBuyNumber:2,
+						minBuyNumber:1,
+						originalPrice:100,
+						price:50,
+						actStatus:1,
+						promotions:{
+							type:0,
+							mode:0,
+							name:'单品满减'
+						},
+						isChecked:false,
+						productIds:1002
+					},
+					{
+						image:'https://img.caimei365.com/group1/M00/00/10/rB-lGGCHqP-AIE9-AAEQHiqWjQY981.png',
+						name:'ET-SPACE全身热疗系统(生物热能太空舱)',
+						unit:'台',
+						ladderPriceFlag:1,
+						priceFlag:0,
+						maxBuyNumber:2,
+						minBuyNumber:1,
+						originalPrice:100,
+						price:50,
+						actStatus:0,
+						promotions:null,
+						isChecked:false,
+						productIds:1003
+					}
+				],
+				handleData:{},
+				number:0,
+				buyRetailPrice:0,
+				isQuantity:false,
 				scrollTop: 0,
-				isEmpty: true,
+				isEmpty: false,
 				isAllChecked:false,
 				loadding: false,
 				pullUpOn: true,
@@ -240,47 +369,24 @@
 			},
 			handleAllUnder(){//批量下架操作
 				let checkedArray = [];
-				let isValidFlag = false;
 				this.productIds = '';
 				if(this.isProductChecked){
-					this.dataList.forEach(el => {
+					this.productList.forEach(el => {
 						if(el.isChecked) { 
 							checkedArray.push(el)						
 						}
 					})
 					checkedArray.forEach(el =>{
-						if(el.validFlag == 2){
-							this.productIds += el.productId+','
-						}
-						if(el.validFlag != 2){
-							isValidFlag = true; 
-						}	
+						this.productIds += el.productId+','
 					})
-					if(isValidFlag){
-						this.$util.modal('','部分选中的商品暂未上架,不能进行下架操作','确定','',false,() =>{})
-						return;
-					}
 					this.OperationType = 'allunder'
 					this.modal = true;
-					this.contentModalText = '确定下架选中的商品吗?';												
+					this.contentModalText = '确定要取消收藏吗?';												
 				}
 			},
-			handleClick(e) {//弹窗提示用户操作
+			handleClick(e) {//取消收藏
 				if(e.index == 1){
-					switch(this.OperationType){
-						case 'delete'://删除主页推荐
-							this.SupplierDeleteSwitchFeatured(this.handlerProduct)
-							break;
-						case 'add'://添加主页推荐
-							this.SupplierAddSwitchFeatured(this.handlerProduct)
-							break;
-						case 'under'://下架商品
-							this.SupplierSoldOutProduct(this.handlerProduct)
-							break;
-						case 'allunder'://批量下架
-							this.SupplierAllSoldOutProduct(this.productIds)
-							break;
-					}
+					this.SupplierDeleteSwitchFeatured(this.handlerProduct)
 				}
 				this.modal = false;
 			},
@@ -330,10 +436,10 @@
 			},
 			updateCheckAllBtn() {//勾选单个判断全选
 				let goodsCheckedLength = 0
-				this.dataList.forEach(item => {
+				this.productList.forEach(item => {
 					if(item.isChecked) { goodsCheckedLength++; }
 				})
-				this.isAllChecked = goodsCheckedLength === this.dataList.length;
+				this.isAllChecked = goodsCheckedLength === this.productList.length;
 				if(goodsCheckedLength>0){
 					this.isProductChecked = true
 				}else{
@@ -341,7 +447,7 @@
 				}
 			},
 			updateBothCheckBtn() {//全选勾选判断
-				this.dataList.forEach((item)=>{
+				this.productList.forEach((item)=>{
 					item.isChecked = this.isAllChecked				
 				})
 			},
@@ -359,14 +465,46 @@
 				console.log(item)
 				this.updateCheckAllBtn()
 			},
-			supervClickFn(){//管理全选
-				this.isSuperv = true
+			PromotionsFormat(promo){//促销活动类型数据处理
+				if(promo!=null){
+					if(promo.type == 1 && promo.mode == 1){
+						return true
+					}else{
+						return false
+					}
+				}
+				return false
+			},
+			showPopup(index,pros){// 弹窗显示
+				switch(index){
+					case 0:
+						this.popupShow = true
+						break;
+					case 1:
+						this.popupShow1 = true
+						this.handleData = pros
+						console.log(this.handleData)
+						this.buyRetailPrice = this.handleData.price
+						if(this.handleData.ladderPriceFlag == 1){
+							this.number = this.handleData.maxBuyNumber
+						}else{
+							this.number = this.handleData.minBuyNumber
+						}
+						break;
+				}
 			},
-			closeSupervFn(){
-				this.isSuperv = false
+			hidePopup(index){// 弹窗隐藏
+				switch(index){
+					case 0:
+						this.popupShow = false
+						break;
+					case 1:
+						this.popupShow1 = false
+						break;
+				}
 			},
 			btnClick() {
-				this.$emit('goCartPage')
+				this.$api.switchTabTo('/pages/tabBar/cart/index')
 			},
 			btnTouchstart() {
 				// console.log('btnTouchstart');
@@ -482,11 +620,16 @@
 		}
 	}	
 	.tui-goods-item {
-		display: flex;
-		padding: 30rpx 20rpx;
+		padding: 30rpx 20rpx 0 20rpx;
 		box-sizing: border-box;
-		border-bottom: 1px solid #EBEBEB;
 		position: relative;
+		.tui-goods-main{
+			display: flex;
+			width: 100%;
+			height: 100%;
+			border-bottom: 1px solid #EBEBEB;
+			padding-bottom: 24rpx;
+		}
 	}
 	.tui-goods-checkBox{
 		display: flex;
@@ -528,109 +671,229 @@
 	}
 	.tui-goods-info {
 		padding-left: 20rpx;
-		display: flex;
-		flex-direction: column;
-		align-items: flex-start;
-		justify-content: space-between;
 		box-sizing: border-box;
-		overflow: hidden;
 		position: relative;
-	}
-	.tui-goods-status{
-		width: 160rpx;
-		position: absolute;
-		right: 0;
-		.status-text{
-			font-size: $font-size-24;
-			line-height: 44rpx;
-			text-align: center;
-			color: #666666;
+		.list-details-title {
+			line-height: 38rpx;
+			text-overflow: ellipsis;
+			overflow: hidden;
+			display: -webkit-box;
+			-webkit-line-clamp: 2;
+			line-clamp: 2;
+			-webkit-box-orient: vertical;
+			font-size: 26rpx;
+			color: #333333;
 		}
-	}
-	.tui-goods-title {
-		white-space: normal;
-		word-break: break-all;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: -webkit-box;
-		-webkit-box-orient: vertical;
-		-webkit-line-clamp: 2;
-		font-size: 26rpx;
-		color: #333;
-		line-height: 44rpx;
-	}
-	.tui-goods-pip{
-		white-space: normal;
-		word-break: break-all;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: -webkit-box;
-		-webkit-box-orient: vertical;
-		-webkit-line-clamp: 2;
-		font-size: 24rpx;
-		color: #999;
-		line-height: 44rpx;
-	}
-	.tui-goods-ediet{
-		width: 60rpx;
-		height: 60rpx;
-		background: linear-gradient(90deg,rgba(122,165,250,1) 0%,rgba(87,110,250,1) 100%);
-		border-radius: 50%;
-		line-height: 60rpx;
-		text-align: center;
-		position: absolute;
-		right: 0;
-		top: 50%;
-		.icon-bianji1 {
-			flex-shrink: 0;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			color: #FFFFFF;
+		.list-details-specs {
+			width: 100%;
+			display: inline-block;
+			margin-top: 8rpx;
+			color: #999999;
 			font-size: 24rpx;
+		}
+		.list-details-price {
+			width: 100%;
+			line-height: 54rpx;
+			float: left;
+			&.none{
+				height: 32rpx;
+				line-height: 32rpx;
+			}
+			.floor-item-act{
+				height: 54rpx;
+				text-align: center;
+				box-sizing: border-box;
+				float: left;
+				.coupon-tags{
+					height: 32rpx;
+					box-sizing: border-box;
+					border-radius: 8rpx;
+					background-color: #fff1eb;
+					line-height: 28rpx;
+					color: #f94b4b;
+					text-align: center;
+					display: inline-block;
+					padding:0 10rpx;
+					font-size: $font-size-20;
+					border: 1px solid #f94b4b;
+					float: left;
+					margin-right: 12rpx;
+				}
+				.floor-tags{
+					height: 32rpx;
+					box-sizing: border-box;
+					border-radius: 8rpx;
+					background-color: #FFFFFF;
+					line-height: 28rpx;
+					color: $color-system;
+					text-align: center;
+					display: inline-block;
+					padding:0 16rpx;
+					font-size: $font-size-20;
+					border: 1px solid #E15616;
+					float: left;
+				}
+			}
+			.price-icon {
+				width: 22rpx;
+				height: 28rpx;
+				vertical-align: middle;
+				margin-right: 10rpx;
+			}
+			.price-icon + text {
+				font-size: 25rpx;
+				vertical-align: middle;
+			}
+			.list-login-now {
+				width: 375rpx;
+				color: #F8C499;
+				position: absolute;
+				bottom: 0;
+				.p-no{
+					float: left;
+					font-size: $font-size-24;
+					color: $color-system;
+					margin-right: 10rpx;
+				}
+			}
+			.login-now {
+				padding: 10rpx 10rpx 10rpx 0;
+			}
+			.list-none{
+				margin-top: 20rpx;
+				.price-small{
+					font-size:$font-size-26;
+					line-height: 40rpx;
+					color: #FF2A2A;
+				}
+			}
+			.list-price {
+				color: #FF2A2A;
+				float: left;
+				line-height:54rpx ;
+				align-items: center;
+				justify-content: center;
+				.price-larger {
+					font-size: $font-size-30;
+					display: inline-block;
+					&.none{
+						text-decoration: line-through;
+						color: #999999;
+					}
+				}
+			}
+			.add-cart-btn {
+				float: right;
+				width: 140rpx;
+				height: 54rpx;
+				line-height: 54rpx;
+				border-radius:30rpx;
+				color: #fff;
+				font-size: 24rpx;
+				margin-right: 0;
+				background:#FFFFFF;
+				border: 1px solid #C9C9C9;
+				color: $text-color;
+				text-align: center;
+			}
 		}	
 	}
-	.tui-goods-model {
-		max-width: 100%;
-		color: #FFFFFF;
-		background: #4688fa;
-		border-radius: 40rpx;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		padding: 0 20rpx;
-		box-sizing: border-box;
-		margin-top: 10rpx;
-	}
-	
-	.tui-model-text {
-		max-width: 100%;
-		transform: scale(0.9);
-		transform-origin: 0 center;
-		font-size: 24rpx;
-		line-height: 40rpx;
-		white-space: nowrap;
-		overflow: hidden;
-		text-overflow: ellipsis;
-	}
-	
-	.tui-price-box {
-		width: 100%;
-		display: flex;
-		align-items: flex-end;
-		justify-content: space-between;
-	}
-	
-	.tui-goods-price {
-		font-size: $font-size-28;
-		font-weight: 500;
-		color: #FF201F;
-	}
 	.tui-popup-box {
 		position: relative;
 		box-sizing: border-box;
 		min-height: 200rpx;
 		padding:6rpx 24rpx;
+		.tui-popup-content{
+			padding-top: 30rpx;
+		}
+	}
+	.layer-smimg{
+		width: 114rpx;
+		height: 114rpx;
+		float: left;
+		border-radius: 10rpx;
+		margin-right: 24rpx;
+		image{
+			width: 114rpx;
+			height: 114rpx;	
+			border-radius: 10rpx;
+		}
+	}
+	.layer-nunbox{
+		justify-content: space-between;
+		align-items: center;
+		width: 536rpx;
+		height: 88rpx;
+		padding: 13rpx 0 0 0;
+		float: left;
+		.layer-nunbox-t{
+			width: 100%;
+			height:44rpx;
+			position:relative;
+			display: flex;
+			.layer-nunbox-text{
+				line-height: 44rpx;
+				font-size: $font-size-28;
+			}
+			.number-box{
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				border: 2rpx solid #ffe6dc;
+				border-radius: 30rpx;
+				height: 48rpx;
+				margin-left: 20rpx;
+				.iconfont{
+					font-size: $font-size-24;
+					padding:0 18rpx;
+					color: #999999;
+					text-align: center;
+					line-height: 48rpx;
+					font-weight: bold;
+					background: #fef6f3;
+					&.icon-jianhao{
+						border-radius: 30rpx 0 0 30rpx;
+					}
+					&.icon-jiahao{
+						border-radius: 0 30rpx 30rpx 0;
+					}
+				}
+				.btn-input{
+					width: 62rpx;
+					height: 48rpx;
+					line-height: 48rpx;
+					background: #FFFFFF;
+					border-radius: 4rpx;
+					text-align: center;
+					font-size: $font-size-28;
+				}
+			}
+			.product-step{
+				position: absolute;
+				left: 45rpx;
+				bottom: 0;
+				height: 44rpx;
+				background: #FFFFFF;
+			}
+		}
+		.layer-nunbox-b{
+			width: 100%;
+			height:44rpx;
+			margin-top: 13rpx;
+		}
+		.text{
+			line-height: 44rpx;
+			font-size: $font-size-28;
+			.p{
+				color: #FF2A2A;
+			}
+			.p:first-child{
+				margin-left: 30rpx;
+			}
+			.p.sm{
+				font-size: $font-size-24;
+			}
+		}
 	}
 	.tui-popup-btn {
 		width: 100%;
@@ -691,5 +954,30 @@
 				background: $btn-confirm;
 			}
 		}
+		.tui-flex-btn {
+			width: 100%;
+			height: 88rpx;
+			display: flex;
+			box-sizing: border-box;
+			padding: 0 34rpx;
+			.button {
+				width: 280rpx;
+				height: 88rpx;
+				color: #fff;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				font-size: $font-size-28;
+				border-radius: 44rpx;
+				&.buy{
+					background: $btn-confirm;
+					margin-left: 78rpx;
+				}
+				&.add{
+					background: #FFE6DC;
+					color: #E15616;
+				}
+			}
+		}
 	}
 </style>

+ 1 - 1
services/ajax.service.js

@@ -17,7 +17,7 @@ class AjaxService {
 		const REV_COOKIE_ENV = uni.getStorageSync('sessionid') ? uni.getStorageSync('sessionid') : 'sessionid';
 		header['Accept'] = 'application/json'
 		header['Content-Type'] = 'application/x-www-form-urlencoded'
-		// header['X-Token'] = REV_TOKEN_ENV
+		header['X-Token'] = REV_TOKEN_ENV
 		header['cookie'] = REV_COOKIE_ENV
 		return header
 	}