shish 2 mēneši atpakaļ
vecāks
revīzija
41bf82c693

+ 2 - 2
hdApp/src/admin/billing/affirmGhs.vue

@@ -1355,7 +1355,7 @@ export default {
 						.price-original {
 							margin-left: 12upx;
 							margin-top: 0;
-							font-size: 26upx;
+							font-size: 29upx;
 							color: #999999;
 							text-decoration: line-through;
 							white-space: nowrap;
@@ -1405,7 +1405,7 @@ export default {
 						.presell-tip {
 							margin-top: 4upx;
 							color: #e53935;
-							font-size: 24upx;
+							font-size: 26upx;
 							font-weight: bold;
 							line-height: 1.45;
 						}

+ 28 - 3
mallApp/src/components/item/module/app-footer-cart.vue

@@ -6,9 +6,12 @@
 					<i class="iconfont icongouwuche"></i>
 				</view>
 				<view class="price" v-if="!offPrice">
-					<text v-if="count.bigLength>0">{{count.bigLength}}扎</text>
-					<text v-if="count.smallLength>0">{{count.smallLength}}支</text>
-					<text style="margin-left:15upx;">¥{{ price }}</text>
+					<text class="price-line">
+						<text v-if="count.bigLength>0">{{count.bigLength}}扎</text>
+						<text v-if="count.smallLength>0">{{count.smallLength}}支</text>
+						<text class="price-gap">¥{{ price }}</text>
+						<text v-if="Number(discountAmount) > 0" class="discount-tip">省¥{{ parseFloat(discountAmount) }}</text>
+					</text>
 				</view>
 			</view>
 			<view class="cart-rg_bx" @click="confirmEvent"> 选好了 </view>
@@ -35,6 +38,10 @@ export default {
 		count: {
 			type: Object,
 			default: {}
+		},
+		discountAmount: {
+			type: Number,
+			default: 0
 		}
 	},
 	methods: {
@@ -98,10 +105,28 @@ export default {
 				}
 			}
 			& .price {
+				flex: 1;
+				min-width: 0;
 				font-weight: 500;
 				color: #ffffff;
 				font-size: 36upx;
 				padding-left: 24upx;
+				padding-right: 8upx;
+				.price-line {
+					display: block;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					line-height: 1.2;
+				}
+				.price-gap {
+					margin-left: 15upx;
+				}
+				.discount-tip {
+					margin-left: 10upx;
+					font-size: 26upx;
+					color: #ffd666;
+				}
 			}
 		}
 		& .cart-rg_bx {

+ 121 - 14
mallApp/src/mixins/cgProduct.js

@@ -73,23 +73,23 @@ export default {
 		//选择商品总价
 		allPrice() {
 			let price = 0;
-
 			if (this.selectList) {
 				for (const item of this.selectList) {
-					const itemInfo = this.getSelectItemById(item.id, item.classId);
-					if (
-						itemInfo &&
-						!this.$util.isEmpty(itemInfo.bigPrice) &&
-						!this.$util.isEmpty(itemInfo.smallPrice)
-					) {
-						price += item.bigCount * Number(itemInfo.bigPrice);
-						price += item.smallCount * Number(itemInfo.smallPrice);
-					}
+					price += this.getSelectItemTotalPrice(item);
 				}
 			}
-
 			return Math.round(price * 100) / 100;
 		},
+		// 满减优惠总额
+		allReachDiscountAmount() {
+			let discount = 0;
+			if (this.selectList) {
+				for (const item of this.selectList) {
+					discount += this.getReachDiscountAmount(item);
+				}
+			}
+			return Math.round(discount * 100) / 100;
+		},
 		allPriceFun() {
 			let price = 0;
 			if (this.selectList) {
@@ -99,7 +99,7 @@ export default {
 				);
 
 				for (const item of newSelectList) {
-					price += this.getLimitBuyPriceInfo(item).total;
+					price += this.getSelectItemTotalPrice(item);
 				}
 			}
 			return Math.round(price * 100) / 100;
@@ -290,6 +290,94 @@ export default {
 			const limitItem = this.getLimitBuyItemById(item.id);
 			return !!(limitItem && this.isTrueValue(limitItem.isLimit) && this.isTrueValue(limitItem.specialPrice));
 		},
+		getItemReachPrice(item) {
+			const reachPrice = Number(item.reachPrice);
+			if (!isNaN(reachPrice) && reachPrice > 0) {
+				return parseFloat(reachPrice);
+			}
+			const price = this.toSafeNumber(item.price || item.bigPrice);
+			const reachNumDiscount = Number(item.reachNumDiscount) || 0;
+			if (reachNumDiscount > 0 && price > reachNumDiscount) {
+				const computed = parseFloat((price - reachNumDiscount).toFixed(2));
+				return computed <= 0 ? 0.01 : computed;
+			}
+			return 0;
+		},
+		isReachDiscountReached(item) {
+			const reachNum = Number(item.reachNum) || 0;
+			if (reachNum <= 0) {
+				return false;
+			}
+			const itemInfo = this.getSelectItemById(item.id, item.classId);
+			return Number(itemInfo.bigCount) >= reachNum;
+		},
+		getReachDiscountAmount(item) {
+			if (!this.isReachDiscountReached(item)) {
+				return 0;
+			}
+			const itemInfo = this.getSelectItemById(item.id, item.classId);
+			const bigCount = Number(itemInfo.bigCount) || 0;
+			const originalBig = this.toSafeNumber(item.price || item.bigPrice);
+			const reachPrice = this.getItemReachPrice(item);
+			return Math.round(Math.max(0, bigCount * (originalBig - reachPrice)) * 100) / 100;
+		},
+		getCartItemUnitPrice(item) {
+			const itemInfo = this.getSelectItemById(item.id, item.classId);
+			if (Number(itemInfo.bigCount) > 0 && this.isReachDiscountReached(item)) {
+				return parseFloat(this.getItemReachPrice(item));
+			}
+			if (Number(item.discountPrice) > 0) {
+				return parseFloat(this.toSafeNumber(item.price));
+			}
+			const parts = this.getLimitBuyPriceDisplayParts(item);
+			return parseFloat(String(parts.main).replace('¥', '')) || 0;
+		},
+		getCartItemOriginalUnitPrice(item) {
+			if (this.isReachDiscountReached(item)) {
+				return parseFloat(this.toSafeNumber(item.price || item.bigPrice));
+			}
+			if (Number(item.discountPrice) > 0) {
+				return parseFloat(this.toSafeNumber(item.prePrice));
+			}
+			const parts = this.getLimitBuyPriceDisplayParts(item);
+			if (parts.showStrike) {
+				return parseFloat(String(parts.strike).replace('¥', '')) || 0;
+			}
+			return 0;
+		},
+		cartPriceShowStrike(item) {
+			if (this.isReachDiscountReached(item)) {
+				const original = this.toSafeNumber(item.price || item.bigPrice);
+				const reachPrice = this.getItemReachPrice(item);
+				return reachPrice > 0 && reachPrice < original;
+			}
+			if (Number(item.discountPrice) > 0) {
+				return true;
+			}
+			return this.getLimitBuyPriceDisplayParts(item).showStrike;
+		},
+		getSelectItemTotalPrice(item) {
+			return this.getLimitBuyPriceInfo(item).total;
+		},
+		_applyReachDiscountToPriceInfo(item, itemInfo, result) {
+			if (!this.isReachDiscountReached(item)) {
+				result.reachDiscountActive = false;
+				return;
+			}
+			const bigCount = Number(itemInfo.bigCount) || 0;
+			const smallCount = Number(itemInfo.smallCount) || 0;
+			if (!result.isLimitSpecial) {
+				const reachPrice = this.getItemReachPrice(item);
+				const smallPrice = this.toSafeNumber(item.smallPrice);
+				const unitPrice = this.toSafeNumber(item.price || item.bigPrice);
+				result.total = bigCount * reachPrice + smallCount * (smallPrice || unitPrice);
+			} else {
+				const reachNumDiscount = Number(item.reachNumDiscount) || 0;
+				result.total = Math.max(0.01, result.total - reachNumDiscount * bigCount);
+			}
+			result.total = Math.round(result.total * 100) / 100;
+			result.reachDiscountActive = true;
+		},
 		getLimitBuyPriceInfo(item) {
 			const itemInfo = this.getSelectItemById(item.id, item.classId);
 
@@ -309,6 +397,7 @@ export default {
 			result.total = itemInfo.bigCount * specialPrice + itemInfo.smallCount * originalPrice;
 			const limitItem = this.getLimitBuyItemById(item.id);
 			if (!limitItem || !this.isLimitSpecialItem(item)) {
+				this._applyReachDiscountToPriceInfo(item, itemInfo, result);
 				return result;
 			}
 			const exceedNum = this.toSafeNumber(limitItem.exceedNum) + this.toSafeNumber(limitItem.currentBuyNum);
@@ -327,14 +416,32 @@ export default {
 					(result.currentBuyNum - result.exceedNum) * specialPrice + result.exceedNum * originalPrice;
 			}
 
+			this._applyReachDiscountToPriceInfo(item, itemInfo, result);
 			return result;
 		},
 		getLimitBuyPriceDisplayParts(item) {
 			const priceInfo = this.getLimitBuyPriceInfo(item);
 			const fmt = n => parseFloat(Number(n) || 0);
+			const itemInfo = this.getSelectItemById(item.id, item.classId);
+			if (priceInfo.reachDiscountActive && !priceInfo.isLimitSpecial && Number(itemInfo.bigCount) > 0) {
+				const reachPrice = fmt(this.getItemReachPrice(item));
+				const originalBig = fmt(item.price || item.bigPrice);
+				return {
+					showStrike: reachPrice < originalBig,
+					main: `¥${reachPrice}`,
+					strike: reachPrice < originalBig ? `¥${originalBig}` : ""
+				};
+			}
 			if (!priceInfo.isLimitSpecial) {
-				const big = Number(item.bigCount) > 0;
-				const p = big ? this.toSafeNumber(item.bigPrice) : this.toSafeNumber(item.smallPrice);
+				if (Number(item.discountPrice) > 0) {
+					return {
+						showStrike: true,
+						main: `¥${fmt(item.price)}`,
+						strike: `¥${fmt(item.prePrice)}`
+					};
+				}
+				const big = Number(itemInfo.bigCount) > 0;
+				const p = big ? this.toSafeNumber(item.price || item.bigPrice) : this.toSafeNumber(item.smallPrice);
 				return {
 					showStrike: false,
 					main: `¥${fmt(p)}`,

+ 38 - 10
mallApp/src/pages/billing/affirmGhs.vue

@@ -9,10 +9,12 @@
 								<image class="item-icon" :src="item.cover" mode="aspectFill" />
 								<view class="item-info">
 									<view class="item-row-top">
-										<text class="item-name">{{ item.name }}</text>
+										<text class="item-name">{{ item.itemName || item.name }}</text>
 										<view class="item-price-block">
-											<text class="price-current">{{ affirmCommodityPriceParts[index].main }}</text>
-											<text v-if="affirmCommodityPriceParts[index].showStrike" class="price-original">{{ affirmCommodityPriceParts[index].strike }}</text>
+											<view class="item-price-line">
+												<text class="price-current">{{ affirmCommodityPriceParts[index].main }}</text>
+												<text v-if="affirmCommodityPriceParts[index].showStrike" class="price-original">{{ affirmCommodityPriceParts[index].strike }}</text>
+											</view>
 										</view>
 									</view>
 									<view class="item-row-ratio">
@@ -194,7 +196,11 @@
 		</view>
 
 		<view class="under-bar">
-		<view class="price-view">¥{{ modifyPrice }}</view>
+		<view class="price-view">
+			<text class="price-title">合计</text>
+			<text class="price-number">¥<text class="large">{{ modifyPrice }}</text></text>
+			<text v-if="allReachDiscountAmount > 0" class="price-discount-tip">省¥{{ parseFloat(allReachDiscountAmount) }}</text>
+		</view>
 		<button class="admin-button-com blue big" style="border:none;margin-right:38upx;width:280upx;" @click="confirmForm">提交</button>
 	</view>
 
@@ -1111,6 +1117,11 @@ export default {
 							align-items: baseline;
 							max-width: 48%;
 						}
+						.item-price-line {
+							display: flex;
+							flex-direction: row;
+							align-items: baseline;
+						}
 						.price-current {
 							font-size: 32upx;
 							font-weight: bold;
@@ -1120,7 +1131,7 @@ export default {
 						}
 						.price-original {
 							margin-left: 12upx;
-							font-size: 26upx;
+							font-size: 29upx;
 							color: #999999;
 							text-decoration: line-through;
 							white-space: nowrap;
@@ -1179,7 +1190,7 @@ export default {
 						.presell-tip {
 							margin-top: 4upx;
 							color: #e53935;
-							font-size: 24upx;
+							font-size: 26upx;
 							font-weight: bold;
 							line-height: 1.45;
 						}
@@ -1237,10 +1248,27 @@ export default {
 		background-color: #fff;
 		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
 		.price-view {
-			font-size: 36upx;
-			font-weight:bold;
-			color: #ff2842;
-			margin-left:20upx;
+			display: flex;
+			align-items: center;
+			font-size: 24upx;
+			margin-left: 20upx;
+			.price-title {
+				color: #333;
+			}
+			.price-number {
+				margin: 0 16upx;
+				color: #ff2842;
+				font-weight: bold;
+				.large {
+					font-size: 40upx;
+				}
+			}
+			.price-discount-tip {
+				font-size: 28upx;
+				color: #ff7a00;
+				font-weight: bold;
+				white-space: nowrap;
+			}
 		}
 	}
 }

+ 258 - 108
mallApp/src/pages/item/components/subItem.vue

@@ -1,42 +1,70 @@
 <template>
-	<view class="item-cmd_bx" @click="customNum()">
-		<view class="img_bx" style="background:#eeeeee" @click.stop="showBigImg">
-			<image :src="info.cover" v-if="isImg"></image>
-		</view>
-		<view class="cmd-info_bx">
-			<view class="tit" >
-				<text class="item-tag item-tag--presell" v-if="info.presell == 1">预售</text>
-				
-				<text class="item-tag item-tag--limit-buy" v-if="Number(info.limitBuy) > 0">限购{{ Number(info.limitBuy) }}份</text>
-
-				{{ info.itemName}}
+	<view class="product-item">
+		<view class="item-cmd_bx" @click="customNum()">
+			<view class="img_bx" style="background:#eeeeee" @click.stop="showBigImg">
+				<image :src="info.cover" v-if="isImg"></image>
 			</view>
-			<view class="kc num-open_bx flex-space">
-				<view v-if="!offPrice">
-					<view class="flex-space" style="margin-top:20upx;" v-if="Number(info.discountPrice)>0">
-						<view style="padding:2upx 10upx 5upx 10upx;text-align: center;color: red;border: 1upx solid red;line-height: 1;font-size: 20upx;">
-							{{parseFloat(((Number(info.discountPrice)/Number(info.prePrice)).toFixed(2)*10).toFixed(1))+'折'}}
+			<view class="cmd-info_bx">
+				<view class="tit">
+					<text class="item-tag item-tag--presell" v-if="info.presell == 1">预售</text>
+					<text class="item-tag item-tag--limit-buy" v-if="Number(info.limitBuy) > 0">限购{{ Number(info.limitBuy) }}份</text>
+					{{ info.itemName }}
+				</view>
+				<view class="kc num-open_bx">
+					<view v-if="!offPrice" class="price-left">
+						<view class="discount-row" v-if="Number(info.discountPrice)>0">
+							<view class="discount-tag">
+								{{parseFloat(((Number(info.discountPrice)/Number(info.prePrice)).toFixed(2)*10).toFixed(1))+'折'}}
+							</view>
+						</view>
+						<view class="ratio-row" v-else>
+							<block v-if="info.ratioType == 0">
+								{{info.ratio}}{{info.smallUnit}}/{{info.bigUnit}}
+							</block>
+							<block v-else>
+								若干{{info.smallUnit}}/{{info.bigUnit}}
+							</block>
+						</view>
+						<view class="price price-wrap">
+							<text v-if="displayOriginalPriceLabel" class="price-original">{{ displayOriginalPriceLabel }}</text>
+							<text class="price-current" :class="{'price-reach': reachDiscountReached}">¥{{ displayUnitPrice }}</text>
 						</view>
-						<text style="text-decoration:line-through;color:#A9A9A9;position:absolute;display:block;top:16upx;left:90upx;">¥{{parseFloat(info.prePrice)}}</text>
 					</view>
-					<view class="flex-space" style="color:#333333;position:absolute;top:13upx;" v-else>
-						<block v-if="info.ratioType == 0">
-						{{info.ratio}}{{info.smallUnit}}/{{info.bigUnit}}
-						</block>
-						<block v-else>
-						若干{{info.smallUnit}}/{{info.bigUnit}}
-						</block>
+					<view class="price-left" v-else></view>
+					<view class="ctrl-side">
+						<view class="open-bx">
+							<i class="iconfont iconjian" @click.stop="delEvent()" v-if="bigCount > 0 || smallCount > 0"></i>
+							<text class="num">
+								<text v-if="bigCount > 0" class="num-big">{{ bigCount }}</text>
+							</text>
+							<i class="iconfont iconzeng add-btn" @click.stop="addEvents()"></i>
+						</view>
 					</view>
-					<view class="price" >¥{{ parseFloat(info.price) }}</view>
 				</view>
-				<view class="price" v-else></view>
-				
-				<view class="open-bx" >
-					<i class="iconfont iconjian" @click.stop="delEvent()" v-if="bigCount > 0 || smallCount > 0"></i>
-					<text class="num">
-						<text v-if="bigCount > 0" style="font-weight:bold;color:#3385ff;">{{ `${bigCount}` }}</text>
-					</text>
-					<i class="iconfont iconzeng" @click.stop="addEvents()"></i>
+			</view>
+		</view>
+		<view class="extra-line extra-line--middle" v-if="info.itemRemark" @click.stop>
+			<view class="extra-line-row extra-line-row--with-icon">
+				<view class="remark-notice-icon">!</view>
+				<view class="extra-line-content">
+					<text class="remark-text">{{ info.itemRemark }}</text>
+				</view>
+			</view>
+		</view>
+		<view class="extra-line extra-line--middle" v-if="showMiddleExtra" @click.stop>
+			<view class="extra-line-row extra-line-row--with-icon" v-if="Number(info.reachNum)>0 && displayReachPrice > 0">
+				<text class="iconfont iconjianqu extra-line-icon"></text>
+				<view class="extra-line-content">
+					<text class="reach-text">满{{ info.reachNum }}扎 享 ¥{{ displayReachPrice }}</text>
+				</view>
+			</view>
+			<view class="extra-line-row extra-line-row--with-icon" v-if="info.presell && info.presell == 1">
+				<text class="iconfont iconfahuo extra-line-icon"></text>
+				<view class="extra-line-content">
+					<text class="reach-text presell-label">配送日</text>
+					<block v-if="!$util.isEmpty(info.presellDateShow)">
+						<text class="reach-text" v-for="(dateItem, dateIndex) in info.presellDateShow" :key="dateIndex">{{ dateItem }}<text v-if="dateIndex != info.presellDateShow.length - 1">,</text></text>
+					</block>
 				</view>
 			</view>
 		</view>
@@ -91,6 +119,46 @@ export default {
 			default: false
 		},
 	},
+	computed: {
+		showMiddleExtra() {
+			return this.info.presell == 1 || (Number(this.info.reachNum) > 0 && this.displayReachPrice > 0);
+		},
+		displayReachPrice() {
+			const reachPrice = Number(this.info.reachPrice);
+			if (!isNaN(reachPrice) && reachPrice > 0) {
+				return parseFloat(reachPrice);
+			}
+			const price = Number(this.info.price) || 0;
+			const reachNumDiscount = Number(this.info.reachNumDiscount) || 0;
+			if (reachNumDiscount > 0 && price > reachNumDiscount) {
+				const computed = parseFloat((price - reachNumDiscount).toFixed(2));
+				return computed <= 0 ? 0.01 : computed;
+			}
+			return 0;
+		},
+		reachDiscountReached() {
+			const reachNum = Number(this.info.reachNum) || 0;
+			return reachNum > 0 && Number(this.bigCount) >= reachNum;
+		},
+		hasLimitDiscount() {
+			return Number(this.info.discountPrice) > 0;
+		},
+		displayOriginalPriceLabel() {
+			if (this.reachDiscountReached) {
+				return `¥${parseFloat(Number(this.info.price) || 0)}`;
+			}
+			if (this.hasLimitDiscount) {
+				return `¥${parseFloat(Number(this.info.prePrice) || 0)}`;
+			}
+			return '';
+		},
+		displayUnitPrice() {
+			if (this.reachDiscountReached) {
+				return this.displayReachPrice;
+			}
+			return parseFloat(Number(this.info.price) || 0);
+		}
+	},
 	data() {
 		return {
 			COMMODITY_TYPE,
@@ -102,10 +170,9 @@ export default {
 			changeAutoPrice:'',
 			showPrice:0.00,
 			ifFocus:false,
-			showMaxStock:230,//囤货时显示的最大库存
+			showMaxStock:230,
 		};
 	},
-	created() {},
 	mounted() {
 		setTimeout(()=>{
 			this.isImg = true;
@@ -119,39 +186,18 @@ export default {
 		showBigImg(){
 			this.$emit("showBigCover", this.info);
 		},
-		//input点击删除按键
 		deleteInputVal(){
 			this.isAloneAllActive=false;
 			this.changeAutoPrice = '';
 		},
-		//离开input
 		moveAllInput(e){
 			this.isAloneAllActive=false;
 			this.isAloneAllFocus=false;
-			// if(e==''){return}
 			this.changeAutoPrice = e?e:0;
 			if(this.isAlterMoney){
 				this.isAlterMoney = false;
-				// let self = this
-				changePriceByIdApi({
-					productId: this.info.id,
-					price: this.changeAutoPrice
-				}).then(res => {
-					if(res.code == 1){
-						this.showPrice = res.data.price
-						this.isShowSucceed = true
-						setTimeout(()=>{
-							this.isShowSucceed = false
-						},1000)
-					}else{
-						this.$msg(res.msg)
-					}
-				})
 			}
 		},
-		showBigImg(){
-			this.$emit("showBigCover", this.info);
-		},
 		addEvents() {
 			const ratio = Number(this.info.ratio);
 			if(this.offVerifyRepertory){
@@ -169,10 +215,9 @@ export default {
 		delEvent() {
 			this.$emit("del", this.info);
 		},
-		changePriceEvent(event) {
+		changePriceEvent() {
 			this.isFocus = false;
 			this.isAlterMoney = true;
-
 		},
 		customNum() {
 			if(this.info.stock<=0){
@@ -198,9 +243,82 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.item-cmd_bx {
+.product-item {
 	position: relative;
 	margin-bottom: 20upx;
+}
+.remark-notice-icon {
+	width: 30upx;
+	height: 30upx;
+	border-radius: 50%;
+	background: #ff8c3a;
+	color: #fff;
+	font-size: 22upx;
+	font-weight: bold;
+	line-height: 30upx;
+	text-align: center;
+	flex-shrink: 0;
+	margin-right: 8upx;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+.remark-text {
+	font-size: 30upx;
+	font-weight: bold;
+	color: #ff2842;
+	line-height: 30upx;
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}
+.extra-line-row--with-icon {
+	display: flex;
+	align-items: center;
+}
+.extra-line-icon {
+	font-size: 26upx;
+	color: #3385ff;
+	line-height: 26upx;
+	height: 26upx;
+	margin-right: 8upx;
+	flex-shrink: 0;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+.extra-line-content {
+	flex: 1;
+	min-width: 0;
+	display: flex;
+	align-items: center;
+	flex-wrap: wrap;
+}
+.reach-text {
+	font-weight: bold;
+}
+.presell-label {
+	margin-right: 10upx;
+}
+.extra-line {
+	margin-top: 8upx;
+	font-size: 24upx;
+	color: #3385ff;
+	line-height: 1.4;
+	word-wrap: break-word;
+	white-space: normal;
+}
+.extra-line--middle {
+	font-size: 26upx;
+	display: flex;
+	flex-direction: column;
+}
+.extra-line-row + .extra-line-row {
+	margin-top: 4upx;
+}
+.item-cmd_bx {
+	position: relative;
+	margin-bottom: 0;
 	.img_bx {
 		height: 140upx;
 		width: 140upx;
@@ -219,7 +337,6 @@ export default {
 			font-size: 30upx;
 			font-weight: 700;
 			color: #333333;
-			padding-top: 0 0 2upx 0;
 			overflow: hidden;
 			white-space: nowrap;
 			text-overflow: ellipsis;
@@ -250,78 +367,111 @@ export default {
 			position: relative;
 			color: #999999;
 			font-size: 24upx;
-			.price{
+			.price-left {
+				min-height: 96upx;
+			}
+			.discount-row {
+				position: absolute;
+				top: 14upx;
+				left: 0;
+				z-index: 1;
+			}
+			.discount-tag {
+				display: inline-block;
+				padding: 2upx 10upx 5upx 10upx;
+				text-align: center;
+				color: red;
+				border: 1upx solid red;
+				line-height: 1;
+				font-size: 20upx;
+				box-sizing: border-box;
+			}
+			.ratio-row {
+				position: absolute;
+				top: 13upx;
+				left: 0;
+				z-index: 1;
+				color: #333333;
+			}
+			.price {
 				position: absolute;
 				left: 0;
 				bottom: 0;
 			}
 		}
 		& .num-open_bx {
-			display: flex;
-			align-items: center;
-			& .price {
+			position: relative;
+			min-height: 96upx;
+			.ctrl-side {
+				position: absolute;
+				right: 16upx;
+				top: -2upx;
+				z-index: 2;
+				flex-shrink: 0;
+				text-align: right;
+				box-sizing: border-box;
+			}
+			.price-wrap {
+				font-weight: bold;
+				font-size: 30upx;
+				top: 60upx;
+				right: 230upx;
+				white-space: nowrap;
+			}
+			.price-original {
+				text-decoration: line-through;
+				color: #A9A9A9;
 				font-size: 28upx;
+				margin-right: 8upx;
+				font-weight: bold;
+			}
+			.price-current {
+				font-size: 28upx;
+				color: #ff2842;
+				font-weight: 550;
+			}
+			.price-reach {
 				color: #ff2842;
-				flex: 1;
-				top:60upx;
-				font-weight:550;
 			}
 			& .open-bx {
-				position: absolute;
-				right:10upx;
-				top:10upx;
 				display: flex;
 				align-items: center;
+				justify-content: flex-end;
+				box-sizing: border-box;
+				flex-shrink: 0;
 				& .iconfont {
-					//margin-left: 15upx;
 					color: #3385ff;
 					font-size: 55upx;
 				}
-				.position{
-					display: block;
-					width: 70upx;
-					text-align: center;
-				}
-				.iconcachu {
-					margin: 0 6upx 0 20upx;
-					color: #ccc;
-					&.edit {
-						color: #3385ff;
-					}
+				& .iconfont.add-btn {
+					font-size: 62upx;
+					line-height: 1;
+					padding: 6upx;
+					margin: -6upx 0;
+					box-sizing: content-box;
 				}
 				& > .num {
-					display: inline-block;
-					width: 100upx;
-					height:40upx;
-					line-height:40upx;
-					text-align:center;
+					display: inline-flex;
+					align-items: center;
+					justify-content: center;
+					min-width: 100upx;
+					height: 50upx;
+					line-height: 50upx;
+					text-align: center;
 					margin: 0 8upx;
 					color: #868686;
-					border-radius: 22upx;
+					border-radius: 25upx;
 					background-color: #f5f5f5;
-					font-size: 24upx;
+					font-size: 30upx;
+					box-sizing: border-box;
+					padding: 0 8upx;
 				}
-				.change-input {
-					width: 164upx;
-					height: 60upx;
-					line-height: 60upx;
-					text-align: center;
-					background: #ffffff;
-					border: 1upx solid #dddddd;
-					border-radius: 4upx;
-					font-size: 25upx;
-				}
-				.btn-box{
-					width: 100upx;
-					height: 60upx;
-					line-height: 60upx;
-					color: #ffffff;
-					background: #3385ff;
-					text-align: center;
-					border-radius: 10upx;
+				.num-big {
+					font-weight: bold;
+					color: #3385ff;
 				}
 			}
 		}
 	}
 }
-</style>
+</style>

+ 39 - 35
mallApp/src/pages/item/item.vue

@@ -41,11 +41,12 @@
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(filterProductInfo)">
 					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
-						<view class="item_list_title">{{ classItem.className }}</view>
+						<view class="item_list_title" :class="{'item_list_title--special': classItem.classId == '-1' || classItem.classId == '-2' || classItem.classId == '-3'}">{{ classItem.className }}</view>
 						<view
 							v-for="(productItem, productIndex) in classItem.child"
 							:key="productIndex"
-							:class="[(productItem.presell == 1 || Number(productItem.reachNum) > 0) ? 'middle-box' : 'box']"
+							style="position: relative;"
+							:class="['product-row', (productItem.presell == 1 || Number(productItem.reachNum) > 0) ? 'middle-box' : 'box', productItem.itemRemark ? 'has-item-remark' : '']"
 							:id="`class_${classItem.classId}_${productItem.id}`"
 						>
 								<Commondity v-if="classItem.isActive"
@@ -60,19 +61,6 @@
 									@showBigCover="showBigCover"
 									@goToSpecialVariety="goToSpecialVariety"
 								></Commondity>
-								<view v-if="productItem.presell == 1 || Number(productItem.reachNum) > 0" style="position:absolute;top:150upx;font-size:26upx;color:#3385ff;white-space: normal;word-wrap: break-word;">
-									<text style="font-weight:bold;" v-if="Number(productItem.reachNum) > 0">
-										满{{ productItem.reachNum }}扎,每扎优惠 ¥{{ parseFloat(productItem.reachNumDiscount) }}<block v-if="productItem.presell == 0">(提交订单后优惠)</block>
-									</text>
-									<block v-if="productItem.presell && productItem.presell == 1"><block v-if="Number(productItem.reachNum) > 0">,</block>配送日:
-										<block v-if="!$util.isEmpty(productItem.presellDateShow)">
-											<text v-for="(dateItem, dateIndex) in productItem.presellDateShow" :key="dateIndex">
-												{{ dateItem }}
-												<text v-if="dateIndex != productItem.presellDateShow.length - 1">,</text>
-											</text>
-										</block>
-									</block>
-								</view>
 						</view>
 					</view>
 				</block>
@@ -94,7 +82,7 @@
 			</template>
 		</modal-module>
 
-		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent" @showCartItem="showCartItem"></FooterCart>
+		<FooterCart :price="allPrice" :count="allCount" :discountAmount="allReachDiscountAmount" @confirm="confirmSelectEvent" @showCartItem="showCartItem"></FooterCart>
     	<sel-popup :show="popupShow" :info="infoData" @close="hidePopup" />
 		<app-activily-coupon :show.sync="isNewCustom" :info="newCustomGift" :ghsId="ghsId" />
 		
@@ -114,18 +102,13 @@
 							<image class="item-icon" :src="item.cover" alt="" />
 							<view class="item-info">
 								<view class="info-line">
-									<text class="item-name">{{ item.name }}</text>
-									<view class="item-price">
-										<text class="unit"></text>
-										<view class="price">
-											<view v-if="Number(item.skDiscountPrice) > 0">
-												<text style="text-decoration:line-through;color:#A9A9A9;font-size:24upx;margin-left:10upx;font-weight:normal;margin-right:12upx;">¥{{ item.skPrice ? parseFloat(item.skPrice) : 0 }}</text>
-												<text>¥{{ parseFloat(item.skDiscountPrice)}}</text>
-											</view>
-											<view v-else>
-												¥{{ item.skPrice ? parseFloat(item.skPrice) : 0 }}
-											</view>
-										</view>
+									<text class="item-name">{{ item.itemName || item.name }}</text>
+									<view class="item-price-col">
+										<text class="item-price">
+											<text v-if="cartPriceShowStrike(item)" class="price-original">¥{{ getCartItemOriginalUnitPrice(item) }}</text>
+											<text class="unit">¥</text>
+											<text class="price" :class="{'price-reach': isReachDiscountReached(item)}">{{ getCartItemUnitPrice(item) }}</text>
+										</text>
 									</view>
 								</view>
 								<view class="limit-buy-tip" v-if="getLimitBuyWarn(item)">
@@ -883,22 +866,28 @@ export default {
 			margin-bottom:70upx;
 		}
 		.box{
-			height: 185upx
+			min-height: 185upx;
 		}
 		.middle-box{
-			height: 215upx;
+			min-height: 225upx;
 			position:relative;
 		}
-		.big-box{
-			height: 285upx
+		.has-item-remark {
+			min-height: 260upx;
+		}
+		.middle-box.has-item-remark {
+			min-height: 300upx;
 		}
-
 	}
 	.item_list_title {
 		margin-bottom: 20upx;
-		font-size: 24upx;
+		font-size: 30upx;
 		font-weight: 600;
-		color: #666666;
+		color: #333333;
+	}
+	.item_list_title--special {
+		color: red;
+		font-weight: bold;
 	}
 	.select-cmd_bx {
 		& .kc {
@@ -970,10 +959,25 @@ export default {
 					.item-price {
 						color: #333;
 						font-size: 22upx;
+						white-space: nowrap;
 						.price {
 							font-size: 32upx;
 							font-weight: bold;
 						}
+						.price-reach {
+							color: #ff2842;
+						}
+						.price-original {
+							margin-right: 6upx;
+							font-size: 28upx;
+							color: #A9A9A9;
+							text-decoration: line-through;
+							font-weight: normal;
+						}
+					}
+					.item-price-col {
+						flex-shrink: 0;
+						text-align: right;
 					}
 
 				}