Browse Source

commit - 运费V1.0.4

zhengjinyi 1 year ago
parent
commit
798405888d

+ 6 - 5
components/cm-module/cart-components/index.vue

@@ -321,11 +321,11 @@
 			:popupShow="popupShow2"
 			:skuProduct="handlePros"
 			@skuBtnConfirm="handleBtnConfirm"
-		></cm-unit-popup>
+		/>
 		<!-- 促销活动弹窗 -->
-		<activi-popup :product="handlerPros" :popupShow="popupShow"></activi-popup>
+		<activi-popup :product="handlerPros" :popupShow="popupShow" />
 		<!-- 透明模态层 -->
-		<modal-layer v-if="modallayer"></modal-layer>
+		<modal-layer v-if="modallayer" />
 		<!-- 优惠券 -->
 		<tui-bottom-popup :radius="true" :show="popupShow0" @close="hidePopup(0)">
 			<view class="tui-popup-box clearfix">
@@ -460,7 +460,7 @@
 					<view class="tui-popup-coupon">
 						<view class="tui-popup-h1">
 							<view class="tui-popup-text left">商品总额</view>
-							<view class="tui-popup-text right bold">¥{{ totalAmount | NumFormat }}</view>
+							<view class="tui-popup-text right bold">¥{{ totalOriginalPrice | NumFormat }}</view>
 						</view>
 						<view class="tui-popup-h1" v-if="reducedPrice > 0">
 							<view class="tui-popup-text left">促销满减</view>
@@ -481,7 +481,7 @@
 						<view class="tui-popup-h1">
 							<view class="tui-popup-text left bold">总价</view>
 							<view class="tui-popup-text right bold"
-								>¥{{ (totalAmount - totalDiscountAmount) | NumFormat }}</view
+								>¥{{ (totalOriginalPrice - totalDiscountAmount) | NumFormat }}</view
 							>
 						</view>
 					</view>
@@ -1051,6 +1051,7 @@ export default {
 				reducedPrice += item.reducedprice
 				originalPrice += item.originalprice
 				this.totalAmount = totalAmount
+				
 			})
 			// 总促销计算
 			this.promotionsList.forEach(promotions => {

+ 1 - 1
pages/seller/cart/cart.vue

@@ -1210,7 +1210,7 @@ page {
 				height: 28rpx;
 				border-radius: 6rpx;
 				background-color: #ffffff;
-				line-height: 28rpx;
+				line-height: 26rpx;
 				color: $color-system;
 				text-align: center;
 				display: inline-block;

+ 25 - 33
pages/seller/order/components/cm-freight-popup.vue

@@ -6,19 +6,13 @@
 				<view class="freight-left">运费:</view>
 				<view class="freight-right" @click.stop="handlePupShow">
 					<template v-if="handlePostageFlag === 0">
-						<view class="freight-text" v-if="handleSupplier.isColdChina"
-							>¥{{ handleSupplier.coldChain | NumFormat }}</view
-						>
-						<view class="freight-text" v-else>包邮</view>
+						<view class="freight-text">包邮</view>
 					</template>
 					<view class="freight-text" v-if="handlePostageFlag === 1"
 						>¥{{ handleTotalPostage | NumFormat }}</view
 					>
 					<template v-if="handlePostageFlag === 2">
-						<view class="freight-text" v-if="handleSupplier.isColdChina"
-							>¥{{ handleSupplier.coldChain | NumFormat }}</view
-						>
-						<view class="freight-text" v-else>到付</view>
+						<view class="freight-text">到付</view>
 					</template>
 					<view class="select"><text class="iconfont icon-xiayibu"></text></view>
 				</view>
@@ -40,7 +34,7 @@
 							</label>
 						</label>
 					</radio-group>
-					<template v-if="handlePostageFlag === 0">
+					<!-- <template v-if="handlePostageFlag === 0">
 						<view class="freight-form">
 							<view class="freight-form-item" v-if="handleSupplier.coldChain > 0">
 								<view class="label">冷链运输费</view>
@@ -65,7 +59,7 @@
 								<view class="texts red" v-else>包邮</view>
 							</view>
 						</view>
-					</template>
+					</template> -->
 					<template v-if="handlePostageFlag === 1">
 						<view class="freight-form">
 							<view class="freight-form-item">
@@ -78,7 +72,7 @@
 									maxlength="20"
 								/>
 							</view>
-							<view class="freight-form-item" v-if="handleSupplier.coldChain > 0">
+							<!-- 	<view class="freight-form-item" v-if="handleSupplier.coldChain > 0">
 								<view class="label">冷链运输费</view>
 								<view class="texts">
 									<text>¥{{ handleSupplier.coldChain | NumFormat }}</text>
@@ -97,10 +91,10 @@
 							<view class="freight-form-item">
 								<view class="label">总运费 </view>
 								<view class="texts red">¥{{ handleTotalPostage | NumFormat }} </view>
-							</view>
+							</view> -->
 						</view>
 					</template>
-					<template v-if="handlePostageFlag === 2">
+					<!-- <template v-if="handlePostageFlag === 2">
 						<view class="freight-form">
 							<view class="freight-form-item" v-if="handleSupplier.coldChain > 0">
 								<view class="label">冷链运输费</view>
@@ -125,7 +119,7 @@
 								<view class="texts red" v-else>到付</view>
 							</view>
 						</view>
-					</template>
+					</template> -->
 					<view class="freight-btn" @click="handleComfirm"> 确定 </view>
 				</view>
 			</tui-bottom-popup>
@@ -148,7 +142,7 @@ export default {
 		return {
 			popupShow: false,
 			isColdChina: false,
-			handleColdChain:0,// 记录冷链费
+			handleColdChain: 0, // 记录冷链费
 			handlePostage: 0, // 记录原始运费
 			handlePostageVal: 0, // 记录修改的运费
 			handlePostageFlag: 0, //  记录运费类型
@@ -185,16 +179,12 @@ export default {
 	computed: {
 		// 计算总运费
 		handleTotalPostage() {
-			if (this.handleSupplier.isColdChina) {
-				return (this.handleSupplier.postage * 100 + this.handleSupplier.coldChain * 100) / 100
-			} else {
-				return this.handleSupplier.postage
-			}
+			return this.handleSupplier.postage			
 		}
 	},
 	watch: {
 		supplier: {
-			handler: function(el) {
+			handler(el) {
 				//监听对象的变换使用 function,箭头函数容易出现this指向不正确
 				this.supplier = el
 			},
@@ -208,14 +198,15 @@ export default {
 			this.isColdChina = data.isColdChina
 			this.handleColdChain = data.coldChain
 			this.handleTotalPrice = data.totalPrice
-			this.handlePostage = this.handlePostageVal = data.postage
+			this.handlePostage = data.postage
+			this.handlePostageVal = data.postage + data.coldChain
 			this.handlePostageFlag = data.handlePostageFlag
-			console.log('handlePostageFlag', this.handlePostageFlag)
 			switch (this.handlePostageFlag) {
 				case 0:
 					this.radioItems[0].checked = true
 					break
 				case 1:
+					this.handleSupplier.postage = this.handleSupplier.postage + this.handleSupplier.coldChain
 					this.radioItems[1].checked = true
 					break
 				case 2:
@@ -249,29 +240,30 @@ export default {
 		radioChange($event) {
 			this.handlePostageFlag = this.handleSupplier.handlePostageFlag = $event.detail.value * 1
 			if (this.handlePostageFlag === 1) {
-				this.handleSupplier.postage = this.handlePostage
+				// 不包邮
+				this.handleSupplier.postage = this.handlePostageVal
 			} else {
 				this.handleSupplier.postage = this.handlePostage
 			}
 		},
 		// 确定运费
 		handleComfirm() {
-			if (this.handlePostageFlag === 0) {
-				let handleTotalPrice = this.isColdChina ? this.handleTotalPrice : Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain))
-				this.handleSupplier.totalPrice = Number(this.repiceNumSub(handleTotalPrice, this.handleSupplier.postage))
-				this.$emit('changePostage', this.handleSupplier, this.index)
-			} else if (this.handlePostageFlag === 1) {
+			// 不包邮
+			if (this.handlePostageFlag === 1) {
 				if (this.handlePostageVal == 0 || !this.handlePostageVal) {
 					this.$util.msg('请填写运费', 2000)
 					return
 				}
-				this.handleSupplier.totalPrice = Number(
-					(this.handleTotalPrice * 100 - this.handlePostage * 100 + this.handlePostageVal * 100) / 100
-				)
+				let handleTotalPrice = Number(this.repiceNumSub(this.handleTotalPrice, (this.handleColdChain + this.handlePostage)))
+				if(this.handlePostageVal!== (this.handleColdChain + this.handlePostage)){
+					this.handleSupplier.isColdChina = false
+				}
 				this.handleSupplier.postage = this.handlePostageVal
+				this.handleSupplier.totalPrice = Number((handleTotalPrice * 100 + this.handlePostageVal * 100) / 100)
 				this.$emit('changePostage', this.handleSupplier, this.index)
+			// 包邮&到付	
 			} else {
-				let handleTotalPrice = this.isColdChina ? this.handleTotalPrice : Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain))
+				let handleTotalPrice = this.isColdChina ? Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain)) : this.handleTotalPrice
 				this.handleSupplier.totalPrice = Number(this.repiceNumSub(handleTotalPrice, this.handleSupplier.postage))
 				this.$emit('changePostage', this.handleSupplier, this.index)
 			}

+ 2 - 2
pages/seller/order/components/cm-goods-temp.vue

@@ -76,11 +76,11 @@
 					@changeColdChina="hanldChangeColdChina"
 				/>
 				<view class="goods-pros-b">
-					<view class="sum-none" v-if="supplier.originalPrice - supplier.totalPrice > 0">
+					<view class="sum-none" v-if="supplier.reducedPrice > 0">
 						<text class="money-sign">¥</text>
 						<text class="money">{{ supplier.originalPrice | NumFormat }}</text>
 						<text class="money-reduced"
-							>减<text>¥{{ (supplier.originalPrice - supplier.totalPrice) | NumFormat }}</text></text
+							>减<text>¥{{ supplier.reducedPrice | NumFormat }}</text></text
 						>
 					</view>
 					<view class="sum" v-if="secondflag"

+ 1 - 2
pages/user/order/components/cm-freight-popup.vue

@@ -5,7 +5,7 @@
 			<template v-if="supplier.postageFlag === 0">
 				<view class="freight-main">
 					<view class="freight-left">运费:</view>
-					<view class="freight-right"> <view class="freight-text">包邮</view> </view>
+					<view class="freight-right"><view class="freight-text">包邮</view></view>
 				</view>
 			</template>
 			<template v-if="supplier.postageFlag === 1 && supplier.designatedFlag === 1">
@@ -224,7 +224,6 @@ export default {
 					this.repiceNumSub(this.handleSupplier.totalPrice, this.handleSupplier.postage)
 				)
 				this.handleSupplier.postage = 0
-				console.log('2222222222', this.handleSupplier.totalPrice)
 				this.$emit('changePostage', this.handleSupplier, this.index)
 			}
 		},

+ 19 - 1
pages/user/order/order-pay-list.vue

@@ -4,7 +4,10 @@
 			<view class="pay-list" v-for="(list, index) in list" :key="index">
 				<view class="pay-list-title">{{ list.shopName }}</view>
 				<view class="pay-list-goods" v-for="(pros, prosIndex) in list.orderProductList" :key="prosIndex">
-					<view class="pay-list-image"> <image :src="pros.image" class="image" mode=""></image> </view>
+					<view class="pay-list-image"> 
+						<image :src="pros.image" class="image" mode=""></image> 
+						<text class="tips" v-if="pros.giftType == 2 || pros.giftType == 1">赠品</text>
+					</view>
 					<view class="pay-list-info">
 						<view class="info-title">{{ pros.name }}</view>
 						<view class="info-view" v-if="pros.productUnit != ''">
@@ -156,6 +159,21 @@ page {
 				border-radius: 8rpx;
 				float: left;
 				margin-right: 13rpx;
+				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%;