lilei 9 月之前
父节点
当前提交
ae5eecbc0c
共有 5 个文件被更改,包括 338 次插入122 次删除
  1. 3 3
      pages/index/productItem.vue
  2. 37 12
      pagesB/cart/index.vue
  3. 130 51
      pagesB/cart/productitem.vue
  4. 73 18
      pagesB/procureOrder.vue
  5. 95 38
      pagesB/shopiing/productDetail.vue

+ 3 - 3
pages/index/productItem.vue

@@ -22,13 +22,13 @@
 					<view class="price-txt" v-else>
 						¥***
 					</view>
-					<view class="flex align_center rebate-tag" v-if="index==1">
+					<view class="flex align_center rebate-tag" v-if="isLogin&&index==1">
 						返<text>5</text>元
 					</view>
-					<view class="flex align_center rebate-tag" v-if="index==2">
+					<view class="flex align_center rebate-tag" v-if="isLogin&&index==2">
 						买3赠2
 					</view>
-					<view class="flex align_center tejia-tag" v-if="index==3">
+					<view class="flex align_center tejia-tag" v-if="isLogin&&index==3">
 						特价<text>¥20</text>
 					</view>
 				</view>

+ 37 - 12
pagesB/cart/index.vue

@@ -62,16 +62,22 @@
 						</view>
 						<view class="cart-footer-right">
 							<view class="cart-footer-left-price" v-if="!editFlag && totalAmount">
-								<view class="cart-footer-left-price-text">
-									<text>合计:</text>
+								<view class="flex align_center">
+									<view class="cart-footer-left-price-text">
+										<text>合计:</text>
+									</view>
+									<view class="cart-footer-left-price-num">
+										¥<text>{{Number(totalAmount).toFixed(2)}}</text>
+									</view>
 								</view>
-								<view class="cart-footer-left-price-num">
-									<text>¥{{Number(totalAmount).toFixed(2)}}</text>
+								<view class="flex align_center">
+									<view class="cart-footer-left-price-text1">
+										<text>优惠:¥23.00</text>
+										<text>代金券:¥15.00</text>
+									</view>
 								</view>
 							</view>
-							<!-- <view class="cart-head-btton red" v-if="editFlag" @click="clearAll">
-								<text>清空购物车</text>
-							</view> -->
+							<view v-else></view>
 							<view class="cart-footer-right-button">
 								<button class="btns" :loading="loading" v-if="!editFlag" type="warn" size="mini" @click="settlement">去结算({{totalNum}})</button>
 								<button v-else class="btns" type="warn" plain size="mini" @click="batchRemove">删除({{totalSel}})</button>
@@ -650,17 +656,36 @@
 				display: flex;
 				align-items: center;
 				justify-content: space-between;
-				
+				flex-grow:1;
 				.cart-footer-left-price{
-					display: flex;
-					align-items: center;
+					flex-grow:1;
+					> view{
+						display: flex;
+						align-items: baseline;
+						justify-content: flex-end;
+					}
 					.cart-footer-left-price-text{
-						font-size: 28rpx;
+						font-size: 24rpx;
 						color: #333333;
 					}
+					.cart-footer-left-price-text1{
+						font-size: 20rpx;
+						color: #666;
+						display: flex;
+						align-items: center;
+						margin-top: 2px;
+						text{
+							margin-right: 5px;
+						}
+					}
 					.cart-footer-left-price-num{
-						font-size: 28rpx;
+						display: flex;
+						align-items: baseline;
+						font-size: 24rpx;
 						color: #d81e06;
+						text{
+							font-size: 32rpx;
+						}
 					}
 				}
 				.red{

+ 130 - 51
pagesB/cart/productitem.vue

@@ -9,44 +9,79 @@
 				<uni-icons v-else :type="item.checked?'checkbox-filled':'circle'" size="24" :color="item.checked?'#dd0000':'#666'"></uni-icons>
 			</view>
 			 <view>
-				 <view class="choose-product-item-img">
-					<image mode="aspectFit" :src="item.productImage?item.productImage+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="width: 100%;height: 180rpx;"></image>
-					<view class="back-price xiajia" v-if="!item.status">下架</view>
-					<view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
-					<view class="choose-product-item-left-info-code">
-						<!-- <text :max-lines="1" overflow="ellipsis">{{item.productCode}}</text> -->
-					</view>
-				 </view>
-				 <view class="choose-product-item-info">
-					<view class="choose-product-item-left-info-name">
-						<text :max-lines="2" overflow="ellipsis">{{item.productName}}</text>
-					</view>
-					<view class="choose-product-item-left-info-guige">
-						<text>{{item.productCode}}</text>
-					</view>
-					<view class="choose-product-item-left-info-guige">
-						<text :max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text>
-					</view>
-					<view class="choose-product-item-left-info-price">
-						<view class="price-txt" v-if="item.status==1">¥<text>{{item.price}}</text></view>
-						<view class="price-txt" v-else></view>
-						<view>
-							<view v-if="item.status==1&&item.dealerScopeFlag==1" :style="{opacity:!item.edit?1:0,width:!item.edit?'auto':0}">
-								<view class="flex align_center qty-box">
-									<view class="qty-btn" @click="changeQty(item.qty-1,item,1)" :class="(item.qty <= 1)?'qty-disabled':''">-</view>
-									<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+10+'px'}"><input type="number" @input="inputQty(item)" @blur="changeQty(item.qty,item,0)" v-model="item.qty"/></view>
-									<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= 999)?'qty-disabled':''">+</view>
+				 <view>
+					 <view class="choose-product-item-img">
+						<image mode="aspectFit" :src="item.productImage?item.productImage+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="width: 100%;height: 100%;"></image>
+						<view class="back-price xiajia" v-if="!item.status">下架</view>
+						<view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
+					 </view>
+					 <view class="choose-product-item-info">
+						<view class="choose-product-item-left-info-name">
+							<text :max-lines="1" overflow="ellipsis">{{item.productName}}</text>
+						</view>
+						<view class="choose-product-item-left-info-guige">
+							<text :max-lines="1" overflow="ellipsis">{{item.productCode}}</text>
+							<text :max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text>
+						</view>
+						<view class="choose-product-item-left-info-price">
+							<view>
+								<view class="price-txt" v-if="item.status==1">¥<text>{{item.price}}</text></view>
+								<view class="flex align_center rebate-tag" v-if="dix==1">
+									返<text>5</text>元
+								</view>
+								<view class="flex align_center rebate-tag" v-if="dix==2">
+									买3赠2
+								</view>
+								<view class="flex align_center tejia-tag" v-if="dix==3">
+									特价<text>¥20</text>
+								</view>
+							</view>
+							<view>
+								<view v-if="item.status==1&&item.dealerScopeFlag==1" :style="{opacity:!item.edit?1:0,width:!item.edit?'auto':0}">
+									<view class="flex align_center qty-box">
+										<view class="qty-btn" @click="changeQty(item.qty-1,item,1)" :class="(item.qty <= 1)?'qty-disabled':''">-</view>
+										<view class="qty-num" :style="{width:Number(item.qty).toString().length*8+10+'px'}"><input type="number" @input="inputQty(item)" @blur="changeQty(item.qty,item,0)" v-model="item.qty"/></view>
+										<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= 999)?'qty-disabled':''">+</view>
+									</view>
+								</view>
+								<view v-if="!item.edit && (!item.status||item.dealerScopeFlag==0)" class="edit-qty">
+									X <text>{{item.qty}}</text>
+								</view>
+								<view v-if="item.edit" class="edit-qty">
+									X <text>{{item.qty}}</text>
+									<uni-icons type="minus-filled" size="24" color="#dd0000" @click="remove(item.cartSn)"></uni-icons>
 								</view>
 							</view>
-							<view v-if="!item.edit && (!item.status||item.dealerScopeFlag==0)" class="edit-qty">
-								X <text>{{item.qty}}</text>
+						</view>
+					 </view>
+				 </view>
+				 <!-- 赠品 -->
+				 <view class="gift-box" v-if="dix==2">
+					 <view class="choose-product-item-img">
+						<image mode="aspectFit" :src="item.productImage?item.productImage+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="width: 100%;height: 100%;"></image>
+						<view class="back-price xiajia" v-if="!item.status">下架</view>
+						<view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
+					 </view>
+					 <view class="choose-product-item-info">
+						<view class="choose-product-item-left-info-name flex align_center">
+							<view class="flex align_center rebate-tag">赠品</view>
+							<text :max-lines="1" overflow="ellipsis">{{item.productName}}</text>
+						</view>
+						<view class="choose-product-item-left-info-guige">
+							<text :max-lines="1" overflow="ellipsis">{{item.productCode}}</text>
+							<text :max-lines="1" overflow="ellipsis">{{item.productOrigCode}}</text>
+						</view>
+						<view class="choose-product-item-left-info-price">
+							<view>
+								<!-- <view class="price-txt" v-if="item.status==1">¥<text>0.00</text></view> -->
 							</view>
-							<view v-if="item.edit" class="edit-qty">
-								X <text>{{item.qty}}</text>
-								<uni-icons type="minus-filled" size="24" color="#dd0000" @click="remove(item.cartSn)"></uni-icons>
+							<view>
+								<view class="edit-qty">
+									X <text>{{item.qty}}</text>
+								</view>
 							</view>
 						</view>
-					</view>
+					 </view>
 				 </view>
 			 </view>
 		</view>
@@ -138,7 +173,6 @@
 	}
 	.choose-product-item{
 		display: flex;
-		align-items: center;
 		justify-content: space-between;
 		padding: 10px;
 		background: #fff;
@@ -147,31 +181,38 @@
 		.price-txt{
 			color: red;
 			display: flex;
-			align-items: center;
+			align-items: baseline;
+			font-size: 12px;
 			text{
-				font-size: 36rpx;
+				font-size: 32rpx;
 			}
 		}
 		> view{
-			 display: flex;
-			 align-items: center;
-			 justify-content: space-between;
 			 &:last-child{
 				 flex-grow: 1;
 				 width: 80%;
+				 >view{
+					 width: 100%;
+					 display: flex;
+					 align-items: center;
+					 justify-content: space-between;
+				 }
 			 }
 		}
 		.choose-product-item-check{
-			padding: 0 20rpx 0 0;
+			padding: 0 10rpx 0 0;
 			width: 24px;
+			margin-top: 33px;
 		}
 		.choose-product-item-img{
 			margin-right: 20rpx;
-			width: 30%;
+			width: 90px;
+			height: 90px;
 			position: relative;
 			overflow: hidden;
 			border: 1px solid #eee;
-			padding: 10rpx;
+			padding: 3rpx;
+			border-radius: 10rpx;
 			.back-price{
 				zoom: calc(0.8);
 				padding: 6rpx 65rpx;
@@ -212,34 +253,72 @@
 				align-items:center;
 				justify-content: space-between;
 				>view{
-					&:last-child{
-						display: flex;
-						align-items:center;
-					}
+					display: flex;
+					align-items:center;
 				}
 				.edit-qty{
 					display: flex;
 					align-items:center;
 					justify-content: space-between;
 					color: #999;
-					font-size: 12px;
+					font-size: 10px;
 					> text{
 						color: #666;
 						font-size: 14px;
-						margin-right: 20px;
+						margin-left: 5px;
+						margin-right: 10px;
 					}
 				}
 			}
+			.rebate-tag{
+				background: #ffe7df;
+				color: #E91E63;
+				padding: 2px 5px;
+				font-size: 10px;
+				border-radius: 3px;
+				margin-left: 6px;
+			}
+			.tejia-tag{
+				color: #E91E63;
+				margin-left: 6px;
+				font-size: 10px;
+				text{
+					font-size: 10px;
+					color: #999;
+					margin-left: 5px;
+				}
+			}
 			.choose-product-item-left-info-name{
 				font-size: 28rpx;
-				color: #666;
+				color: #333;
 			}
 			.choose-product-item-left-info-guige{
-				color: #2196F3;
 				margin: 10rpx 0;
 				font-size: 12px;
 				text{
-					margin-right: 10rpx;
+					color: #666;
+					&:last-child{
+						color: #2196F3;
+					}
+				}
+			}
+		}
+		.gift-box{
+			margin-top: 10px;
+			border-top: 1px solid #ececec;
+			padding-top: 10px;
+			.choose-product-item-img{
+				width: 70px;
+				height: 70px;
+				margin-left: 20px;
+			}
+			.choose-product-item-info .choose-product-item-left-info-name{
+				font-size: 24rpx;
+				.rebate-tag{
+					margin: 0 5px 0 0;
+					background: #ff0000;
+					color: #fff;
+					width: 30px;
 				}
 			}
 		}

+ 73 - 18
pagesB/procureOrder.vue

@@ -22,23 +22,37 @@
 						共<text class="redText">{{total}}</text>款
 					</view>
 				</view>
-				<view v-for="item in partList" :key="item.id" class="flex align-center item-list">
-					<view style="height: 150rpx;">
-						<u-image :src="item.product.images+'?x-oss-process=image/resize,p_50'" border-radius="16" width="200" height="150" bg-color="#EBEBEB" ></u-image>
-						<view class="back-price" v-if="item.giveAmount">返<text>{{item.giveAmount}}</text>元</view>
+				<view v-for="(item,dix) in partList" :key="item.id" class="flex align-center item-list">
+					<view style="height: 160rpx;width: 160rpx;">
+						<u-image :src="item.product.images+'?x-oss-process=image/resize,p_50'" border-radius="16" width="160" height="160" bg-color="#EBEBEB" ></u-image>
+						<!-- <view class="back-price" v-if="item.giveAmount">返<text>{{item.giveAmount}}</text>元</view> -->
 					</view>
 					<view>
 						<view class="item-name">
 						  <text>{{item.product.productName}}</text>
 						</view>
+						<view class="item-nums">
+							<text>{{item.product.code}}</text>
+						</view>
 						<view class="item-nums">
 							<text>{{item.product.origCode}}</text>
 						</view>
 						<view class="item-head">
+							<view class="flex align_baseline">
+								<view class="price-txt">¥<text>{{item.price}}</text></view>
+								<view class="flex align_center rebate-tag" v-if="dix==0">
+									返<text>5</text>元
+								</view>
+								<view class="flex align_center rebate-tag" v-if="dix==1">
+									买3赠2
+								</view>
+								<view class="flex align_center tejia-tag" v-if="dix==2">
+									特价<text>¥20</text>
+								</view>
+							</view>
 							<view>
-								数量:<text class="redText">{{item.qty}}</text>{{item.product&&item.product.unit||''}}
+								X <text class="redText">{{item.qty}}</text>{{item.product&&item.product.unit||''}}
 							</view>
-							<view><text class="redText">¥{{item.price}}</text></view>
 						</view>
 					</view>
 				</view>
@@ -48,14 +62,18 @@
 				</view>
 			</view>
 			<view class="info" v-if="info">
-				<view class="infoList" v-if="state=='FINISH'">
-					<text>代金券</text>
-					<text class="redText">¥{{info.totalGiveAmount}}</text>
-				</view>
 				<view class="infoList">
 					<text>总金额</text>
 					<text class="redText">¥{{info.totalAmount}}</text>
 				</view>
+				<view class="infoList">
+					<text>总优惠</text>
+					<text class="cText">¥{{info.totalAmount}}</text>
+				</view>
+				<view class="infoList" v-if="state=='FINISH'">
+					<text>代金券</text>
+					<text class="cText">¥{{info.totalGiveAmount}}</text>
+				</view>
 			</view>
 			<view class="info" v-if="info">
 				<view class="infoList">
@@ -189,6 +207,12 @@
 		height: 100%;
 		.redText{
 			color: #FB1E1E;
+			margin: 0 10rpx;
+		}
+		.cText{
+			color: #666;
+			margin: 0 10rpx;
+			font-size: 14px;
 		}
 		.order-body{
 			flex-grow: 1;
@@ -258,7 +282,10 @@
 						margin-top: 18rpx;
 						position: relative;
 						overflow: hidden;
-						width: 200rpx;
+						width: 160rpx;
+						height: 160rpx;
+						border-radius: 6px;
+						border: 1px solid #eee;
 					}
 					.back-price{
 						zoom: calc(0.8);
@@ -286,16 +313,16 @@
 				}
 				.item-name{
 					word-wrap: break-word;
-					font-size: 32rpx;
+					font-size: 30rpx;
 					color: #333;
 					font-weight: bold;
 					margin-top: 10rpx;
 				}
 				.item-nums{
-					padding: 10rpx 0;
+					padding: 5rpx 0;
 					text{
-						font-size: 32rpx;
-						color: #222222;
+						font-size: 28rpx;
+						color: #666;
 					}
 				}
 				.item-head{
@@ -303,13 +330,41 @@
 					align-items: center;
 					justify-content: space-between;
 					color: #666;
-					> view{
-						font-size: 28rpx;
+					> view:last-child{
+						font-size: 24rpx;
 						text{
-							margin-right: 10rpx;
+							margin: 0 10rpx;
+							font-size: 28rpx;
 						}
 					}
 				}
+				.price-txt{
+					color: red;
+					display: flex;
+					align-items: baseline;
+					font-size: 12px;
+					text{
+						font-size: 32rpx;
+					}
+				}
+				.rebate-tag{
+					background: #ffe7df;
+					color: #E91E63;
+					padding: 2px 5px;
+					font-size: 10px;
+					border-radius: 3px;
+					margin-left: 6px;
+				}
+				.tejia-tag{
+					color: #E91E63;
+					margin-left: 6px;
+					font-size: 12px;
+					text{
+						font-size: 12px;
+						color: #999;
+						margin-left: 5px;
+					}
+				}
 			}
 		}
 		.footer{

+ 95 - 38
pagesB/shopiing/productDetail.vue

@@ -95,7 +95,6 @@
 		:round="true"
 		:z-index="100"
 		position="bottom" 
-		custom-style="height:30%;"
 		@afterleave="closePopu">
 			<view class="popu-content" v-if="detail">
 				<view class="popu-close" @click="showPopu=false">
@@ -103,15 +102,48 @@
 				</view>
 				<view class="pupu-box">
 					<view class="popu-content-img">
-						<image style="width: 100px; height: 100px;" mode="aspectFit" :src="detail.productMsg||'/static/def_imgs.png'"></image>
+						<image style="width: 80px; height: 80px;" mode="aspectFit" :src="detail.productMsg||'/static/def_imgs.png'"></image>
 					</view>
 					<view class="popu-content-info">
-						<view class="popu-content-info-title">{{detail.productName}}</view>
+						<view class="popu-content-info-title">
+							<text class="ellipsis-one">{{detail.productName}}</text>
+						</view>
 						<view class="popu-content-box">
-							<view class="popu-content-price">¥<text class="price-red">{{hasLogin?detail.price:'***'}}</text></view>
+							<view class="popu-content-price" v-if="hasLogin">
+								¥<text>{{Number(detail.price).toFixed(2).toString().split('.')[0]}}</text>.{{Number(detail.price).toFixed(2).toString().split('.')[1]}}
+							</view>
+							<view class="popu-content-price" v-else>¥***</view>
+							<view class="flex align_center rebate-tag" v-if="detail.price==30">
+								返<text>5</text>元
+							</view>
+							<view class="flex align_center rebate-tag" v-if="detail.price==24">
+								买3赠2
+							</view>
+							<view class="flex align_center tejia-tag" v-if="detail.price==21">
+								特价<text>¥20</text>
+							</view>
+						</view>
+						<view class="popu-content-num flex align_center justify_end">
+							<text>数量</text>
+							<uni-number-box v-model="qty" :min="1" :max="999999"></uni-number-box>
+						</view>
+					</view>
+				</view>
+				<view class="pupu-box gift-box">
+					<view class="popu-content-img">
+						<image style="width: 50px; height: 50px;" mode="aspectFit" :src="detail.productMsg||'/static/def_imgs.png'"></image>
+					</view>
+					<view class="popu-content-info">
+						<view class="popu-content-info-title flex align_center">
+							<view class="flex align_center rebate-tag">
+								赠品
+							</view>
+							<text class="ellipsis-one">{{detail.productName}}</text>
+						</view>
+						<view class="popu-content-box justify_between">
+							<view></view>
 							<view class="popu-content-num flex align_center">
-								<text style="margin-right: 10px;">数量</text>
-								<uni-number-box v-model="qty" :min="1" :max="999999"></uni-number-box>
+								<text>X</text> 1
 							</view>
 						</view>
 					</view>
@@ -447,24 +479,6 @@
 									font-size: 38rpx;
 								}
 							}
-							.rebate-tag{
-								background: #ffe7df;
-								color: #E91E63;
-								padding: 2px 5px;
-								font-size: 10px;
-								border-radius: 3px;
-								margin-left: 6px;
-							}
-							.tejia-tag{
-								color: #E91E63;
-								margin-left: 6px;
-								font-size: 12px;
-								text{
-									font-size: 12px;
-									color: #999;
-									margin-left: 5px;
-								}
-							}
 							.product-info-nums{
 								font-size: 12px;
 								color: #999999;
@@ -523,6 +537,24 @@
 					line-height: 28px;
 				}
 		}
+		.rebate-tag{
+			background: #ffe7df;
+			color: #E91E63;
+			padding: 2px 5px;
+			font-size: 10px;
+			border-radius: 3px;
+			margin-left: 6px;
+		}
+		.tejia-tag{
+			color: #E91E63;
+			margin-left: 6px;
+			font-size: 12px;
+			text{
+				font-size: 12px;
+				color: #999;
+				margin-left: 5px;
+			}
+		}
 		.scrollPage-footer{
 			background-color: #FFFFFF;
 			width: 100%;
@@ -594,7 +626,7 @@
 				display: flex;
 				flex-direction: column;
 				align-items: center;
-				padding: 10px;
+				padding: 10px 15px;
 				.popu-close{
 					padding: 10px;
 					position: absolute;
@@ -605,35 +637,60 @@
 					display: flex;
 					align-items: center;
 					justify-content: space-between;
-					margin-top: 25px;
+					margin-top: 35px;
+					width: 100%;
 				}
 				.popu-content-img{
-					border-radius: 10px;
+					border-radius: 6px;
 					border: 1px solid #eee;
+					overflow: hidden;
 				}
 				.popu-content-info{
 					padding: 0 0 0 10px;
+					flex-grow: 1;
+					overflow: hidden;
+					width: 80%;
 					.popu-content-info-title{
 						font-size: 14px;
-						font-weight: bold;
+					}
+				}
+				.gift-box{
+					padding-left: 8%;
+					margin-top: 10px;
+					border-top: 1px solid #eee;
+					padding-top: 10px;
+					.popu-content-info-title{
+						font-size: 12px;
+						color: #666;
+					}
+					.rebate-tag{
+						margin: 0 5px 0 0;
+						background: #ff0000;
+						color: #fff;
+						width: 30px;
 					}
 				}
 				.popu-content-box{
 					display: flex;
-					align-items: center;
-					justify-content: space-between;
+					align-items: baseline;
 					margin-top: 10px;
 					.popu-content-price{
-						font-size: 14px;
-						color: #d50e0e;
-						.price-red{
-							font-size: 24px;
+						color: red;
+						display: flex;
+						align-items: baseline;
+						font-size: 12px;
+						text{
+							font-size: 38rpx;
 						}
 					}
-					.popu-content-num{
-						font-size: 12px;
-						color: #999999;
-						padding: 0 10px;
+				}
+				.popu-content-num{
+					font-size: 12px;
+					color: #999999;
+					padding: 0 10px;
+					> text{
+						margin-right: 10px;
+						font-size: 10px;
 					}
 				}
 				.popu-content-btn{