zhengjinyi 2 年之前
父节点
当前提交
9f2494ee89

+ 1 - 9
components/cm-module/cm-cart-temp/index.vue

@@ -778,15 +778,7 @@ export default {
 			this.$api.navigateTo(`/pages/goods/product?id=${id}`)
 			this.$api.navigateTo(`/pages/goods/product?id=${id}`)
 		},
 		},
 		failureToProduct(failure) {
 		failureToProduct(failure) {
-			if (failure.status == 1) {
-				this.$util.msg('商品已丢失,不能查看', 2000)
-				return
-			} else if (failure.status == 2) {
-				this.$util.msg('商品已停售,不能查看', 2000)
-				return
-			} else {
-				this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
-			}
+			this.$api.navigateTo(`/pages/goods/product?id=${failure.productId}`)
 		},
 		},
 		handleShouUnitPopup(pros) {
 		handleShouUnitPopup(pros) {
 			// 规格弹窗
 			// 规格弹窗

+ 6 - 5
components/cm-module/cm-cart-temp/mixins/cartMixins.js

@@ -4,7 +4,7 @@ import Vue from 'vue'
 const cartMixins = {
 const cartMixins = {
     data() {
     data() {
         return {
         return {
-			delSkuIds:''
+            delSkuIds:''
         }
         }
     },
     },
     methods: {
     methods: {
@@ -41,6 +41,7 @@ const cartMixins = {
             }
             }
             // 友盟埋点购物车去结算点击事件
             // 友盟埋点购物车去结算点击事件
             let cartSkuIds = { skuIds: skuIds.substring(0, skuIds.lastIndexOf(',')) }
             let cartSkuIds = { skuIds: skuIds.substring(0, skuIds.lastIndexOf(',')) }
+            console.log('cartSkuIds',cartSkuIds)
             this.$api.navigateTo(
             this.$api.navigateTo(
                 `/pages/user/order/create-order?type=2&data=${JSON.stringify({ data: cartSkuIds })}`
                 `/pages/user/order/create-order?type=2&data=${JSON.stringify({ data: cartSkuIds })}`
             )
             )
@@ -77,15 +78,15 @@ const cartMixins = {
                 this.$util.msg('请选择要删除的商品~', 2000)
                 this.$util.msg('请选择要删除的商品~', 2000)
                 return
                 return
             }
             }
-			this.modal = true
-			this.contentModalText = '确定删除选中的商品吗?'
+            this.modal = true
+            this.contentModalText = '确定删除选中的商品吗?'
         },
         },
         handleDeletefailures() { // 一键清楚所有失效商品
         handleDeletefailures() { // 一键清楚所有失效商品
             this.failureList.forEach(failure => {
             this.failureList.forEach(failure => {
                 this.delSkuIds += failure.skuId + ','
                 this.delSkuIds += failure.skuId + ','
             })
             })
-			this.modal = true
-			this.contentModalText = '确定清空全部失效商品吗?'
+            this.modal = true
+            this.contentModalText = '确定清空全部失效商品吗?'
         }
         }
     }
     }
 }
 }

+ 2 - 2
pages/login/login.vue

@@ -201,8 +201,8 @@ export default {
 		},
 		},
 		async handleSubLogin() {
 		async handleSubLogin() {
 			// 点击登录
 			// 点击登录
-			const _storage = await this.$api.getStorage()
-			this.accountParams.unionId = this.codeParams.unionId = _storage.unionId ? _storage.unionId : ''
+			const stor = await this.$api.getStorage()
+			this.accountParams.unionId = this.codeParams.unionId = stor.unionId ? stor.unionId : ''
 			if (this.loginType === 0) {
 			if (this.loginType === 0) {
 				this.userCodeLogin()
 				this.userCodeLogin()
 			} else {
 			} else {

+ 6 - 33
pages/user/order/components/details/voucherRecord.vue

@@ -3,7 +3,7 @@
 		<!-- 支付凭证 -->
 		<!-- 支付凭证 -->
 		<view class="record-content">
 		<view class="record-content">
 			<view class="record-title">线下支付凭证</view>
 			<view class="record-title">线下支付凭证</view>
-			<view class="record-list" v-for="(item,index) in list">
+			<view class="record-list" v-for="(item,index) in voucherList">
 				<view class="record-list-time">{{ item.addtime }}</view>
 				<view class="record-list-time">{{ item.addtime }}</view>
 				<scroll-view scroll-x>
 				<scroll-view scroll-x>
 					<view class="tui-goods__list">
 					<view class="tui-goods__list">
@@ -33,45 +33,18 @@
 		data() {
 		data() {
 			return{
 			return{
 				isEmpty:true,
 				isEmpty:true,
-				list:[
-					{
-						time:'2023-05-15 16:13:34',
-						imgs:[
-							{
-								img:'https://img0.baidu.com/it/u=1944692716,1047751661&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
-							},
-							{
-								img:'https://img0.baidu.com/it/u=1944692716,1047751661&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
-							},
-							{
-								img:'https://img0.baidu.com/it/u=1944692716,1047751661&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
-							},
-							{
-								img:'https://img0.baidu.com/it/u=1944692716,1047751661&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
-							},
-							{
-								img:'https://img0.baidu.com/it/u=1944692716,1047751661&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
-							}
-						],
-						content:'备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注备注'
-					}
-				]
+				voucherList:[]
 			}
 			}
 		},
 		},
 		created(){
 		created(){
-			// this.initData(this.returnedPurchaseList)
+			this.initData(this.list)
 		},
 		},
 		computed: {
 		computed: {
 		
 		
 		},
 		},
 		methods:{
 		methods:{
-			initData(res) {
-				if(res!=''){
-					this.isEmpty = true
-				}else{
-					this.isEmpty = false
-					this.refundData = res;
-				}
+			initData(data) {
+				this.voucherList = data
 			},
 			},
 			previewImg (image) {//顶部商品图片预览
 			previewImg (image) {//顶部商品图片预览
 				this.isPreviewImage = true
 				this.isPreviewImage = true
@@ -96,7 +69,7 @@
 		padding-bottom: 40rpx;
 		padding-bottom: 40rpx;
 		.record-content{
 		.record-content{
 			width: 100%;
 			width: 100%;
-			padding: 24rpx 0;
+			padding: 24rpx;
 			box-sizing: border-box;
 			box-sizing: border-box;
 			height: auto;
 			height: auto;
 			.record-title{
 			.record-title{

+ 178 - 257
pages/user/order/components/freight.vue

@@ -1,300 +1,221 @@
 <template name="freight">
 <template name="freight">
-	<view class="freight-template" @click.stop="discard">
-		 <!-- 运费信息 -->
+	<view class="freight-template">
+		<!-- 运费信息 -->
 		<view class="invoice-freight">
 		<view class="invoice-freight">
-			<view class="freight-main">
+			<view class="freight-main" v-if="infoData.designatedFlag === 2">
 				<view class="freight-left">运费</view>
 				<view class="freight-left">运费</view>
-				<view class="freight-right" >
-					<view class="freight-text">{{freightText}}</view>
-					<view class="select" v-if="freightData.postageFlag == 1"  @click.stop="selectFreight">
-						<text class="select-text">{{orderPriceToFixed(freightMoney)}}</text>
-						<text class="iconfont icon-xiayibu"></text>
-					</view>
+				<view class="freight-right">
+					<view class="freight-text">{{ freightText }}</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<view class="freight-bean">
-				<view class="bean-le">冷链运输费</view>
-				<view class="bean-ri">
-					<view class="checkbox-box">
-						<button class="checkbox iconfont"
+			<template v-else>
+				<view class="freight-main">
+					<view class="freight-left">运费</view>
+					<view class="freight-right">
+						<view class="freight-text">{{ totalFreight }}</view>
+					</view>
+				</view>
+				<view class="freight-bean">
+					<view class="bean-le">冷链运输费</view>
+					<view class="bean-ri">
+						<text>¥{{ coldChain | NumFormat }}</text>
+						<view class="checkbox-box" v-if="coldChain > 0">
+							<button
+								class="checkbox iconfont"
 								hover-class="btn-hover"
 								hover-class="btn-hover"
 								@click.stop="checkedBalabce"
 								@click.stop="checkedBalabce"
-								:class="[ischecked ?'icon-yixuanze':'icon-weixuanze']"
-						>
-						</button>
+								:class="[ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
+							></button>
+						</view>
 					</view>
 					</view>
 				</view>
 				</view>
-			</view>
-			<view class="freight-bean">
-				<view class="bean-le">其他运费</view>
-				<view class="bean-ri">
-					¥15.00
+				<view class="freight-bean" v-if="infoData.designatedFlag === 3">
+					<view class="bean-le">其他运费</view>
+					<view class="bean-ri">
+						<view>{{ freightText }}</view>
+					</view>
 				</view>
 				</view>
-			</view>
+			</template>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	export default{
-		name:'freight',
-		props:{
-			freightData:{
-				type:Object
-			}
+export default {
+	name: 'freight',
+	props: {
+		coldChain: {
+			type: Number
 		},
 		},
-		data() {
-			return{
-				infoData:{},
-				freightText:'',
-				freightMoney:'',
-				isShowOption:false,
-				optionList:['到付'],
-				postageFlag:0,
-				ischecked:false,
-				isBeansShow:false,
-				userBeans:0,
-				deductionBeans:0,
-				freightBeansMoney:0,
-				vipFlag:0
+		freightData: {
+			type: Object
+		}
+	},
+	data() {
+		return {
+			infoData: {},
+			freightText: '',
+			postageFlag: 0,
+			ischecked: true,
+			totalFreight: 0
+		}
+	},
+	created() {
+		this.initData(this.freightData)
+	},
+	filters: {
+		NumFormat(value) {
+			//处理金额
+			if (value && value > 0) {
+				return Number(value).toFixed(2)
+			} else {
+				return '0.00'
+			}
+		}
+	},
+	methods: {
+		async initData(data) {
+			this.infoData = data
+			/**
+			 * 1.如果designatedFlag === 1 且 冷链费 大于 0 勾选冷链费 运费为 冷链费
+			 * 2.如果designatedFlag === 1 且 冷链费 等于 0 运费为0
+			 * 3.如果designatedFlag === 2 只有其他供应商商品 运费按采美规则
+			 * 4.如果designatedFlag === 3 且 冷链费 大于 0 其他供应商商品不包邮有运费 勾选冷链费 运费为 冷链费 + 采美规则运费
+			 * 5.如果designatedFlag === 3 且 冷链费 大于 0 其他供应商商品到付 勾选冷链费 运费为 冷链费
+			 * 5.如果designatedFlag === 3 且 冷链费 大于 0 其他供应商商品包邮 勾选冷链费 运费为 冷链费
+			 * */
+			if (data.designatedFlag === 1) {
+				this.freightText = '¥' + data.postage.toFixed(2)
+				this.totalFreight = '¥' + this.coldChain.toFixed(2)
+			} else if (data.designatedFlag === 2) {
+				this.infoFreightText(data)
+			} else if (data.designatedFlag === 3) {
+				if (this.coldChain === 0) { this.ischecked = false }
+				if (data.postageFlag === 1) {
+					this.freightText = '¥' + data.postage.toFixed(2)
+					this.totalFreight = '¥' + (this.coldChain+data.postage).toFixed(2)
+				} else {
+					this.freightText = data.postageFlag === 0 ? '包邮' : '到付'
+					this.totalFreight = this.ischecked ? '¥' + this.coldChain.toFixed(2) : this.freightText
+				}
 			}
 			}
 		},
 		},
-		created(){
-			this.initData(this.freightData)
+		infoFreightText(data) {
+			//仅其他供应商商品设置运费
+			switch (data.postageFlag) {
+				case 0:
+					this.freightText = '包邮'
+					this.freightData.freight = 0
+					this.postageFlag = data.postageFlag
+					break
+				case 1:
+					this.freightText = '¥'+ data.postage.toFixed(2)
+					this.postageFlag = data.postageFlag
+					break
+				case -1:
+					this.freightText = '到付'
+					this.postageFlag = data.postageFlag
+					this.freightData.freight = 0
+					break
+			}
 		},
 		},
-		computed: {
-
+		checkedBalabce() {
+			//勾选是否使用冷链运输费
+			this.ischecked = !this.ischecked
+			if (this.ischecked) {
+				this.setTotalFreight(this.infoData)
+			} else {
+				this.totalFreight = this.freightText
+			}
+			this.$emit('confirmFreight', this.ischecked)
 		},
 		},
-		methods:{
-			async initData(res) {
-				const userInfo = await this.$api.getStorage()
-				this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
-				this.infoData = res
-				switch(res.postageFlag){
-					case 0:
-						this.freightText = '包邮'
-						this.freightData.freight  = 0
-						this.postageFlag = res.postageFlag
-						this.isBeansShow = false
-						break
-					case 1:
-						this.freightText = ''
-						this.freightMoney = this.freightBeansMoney =  res.postage
-						this.userBeans = res.userBeans
-						this.postageFlag = res.postageFlag
-						this.optionList.unshift(this.orderPriceToFixed(this.freightMoney))
-						if( res.userBeans > 0 ){
-							this.isBeansShow = true
-						}else{
-							this.isBeansShow = false
-						}
-						if(res.userBeans >= this.freightBeansMoney*100){
-							this.deductionBeans = this.freightBeansMoney*100
-						}else{
-							this.deductionBeans = res.userBeans
-						}
-						break
-					case -1:
-						this.freightText = '到付'
-						this.freightMoney = '到付'
-						this.userBeans = res.userBeans
-						this.postageFlag = res.postageFlag
-						this.freightData.freight  = 0
-						this.freightBeansMoney = 30
-						if( res.userBeans >0 ){
-							this.isBeansShow = true
-						}else{
-							this.isBeansShow = false
-						}
-						if(res.userBeans >= this.freightBeansMoney*100){
-							this.deductionBeans = this.freightBeansMoney*100
-						}else{
-							this.deductionBeans = res.userBeans
-						}
-						break
-				}
-			},
-			selectFreight (){//切换运费
-				if(this.vipFlag==1){ return }
-				let self = this
-				uni.showActionSheet({
-				    itemList: self.optionList,
-				    success: function (res) {
-						switch(res.tapIndex){
-							case 0:
-								self.freightMoney = self.infoData.postage
-								self.postageFlag = 1
-								if( self.userBeans > 0 ){
-									self.isBeansShow = true
-									self.freightBeansMoney = self.freightMoney
-									if(self.userBeans >= self.freightBeansMoney*100){
-										self.deductionBeans = self.freightBeansMoney*100
-									}else{
-										self.deductionBeans = self.userBeans
-									}
-								}else{
-									self.isBeansShow = false
-									self.freightBeansMoney = 0
-								}
-								break
-							case 1:
-								self.postageFlag = -1
-								self.freightMoney = '到付'
-								if( self.userBeans > 0 ){
-									self.freightBeansMoney = 30
-									self.isBeansShow = true
-									if(self.userBeans >= self.freightBeansMoney*100){
-										self.deductionBeans = self.freightBeansMoney*100
-									}else{
-										self.deductionBeans = self.userBeans
-									}
-								}else{
-									self.freightBeansMoney = 0
-									self.isBeansShow = false
-								}
-								break
-						}
-						let obj = {
-								postageFlag :self.postageFlag,
-								freightBeansMoney: self.freightBeansMoney
-							}
-						self.$emit('confirmFreight',obj)
-				    },
-				    fail: function (res) {
-				        console.log(res.errMsg)
-				    }
-				})
-			},
-			checkedBalabce(){//勾选使用采美豆抵扣
-				this.ischecked = !this.ischecked
-				this.$emit('confirmFreightBeans',this.ischecked)
-			},
-			orderPriceToFixed (value){
-				let price =''
-				if(value == '到付'){
-					price = value
-				}else{
-					price ='¥'+parseInt(value).toFixed(2)
+		setTotalFreight(data){// 勾选冷链费
+			if (data.designatedFlag === 1) {
+				this.totalFreight ='¥'+ this.coldChain.toFixed(2)
+			} else {
+				if (data.postageFlag === 1) {
+					this.totalFreight = '¥' + (this.coldChain+data.postage).toFixed(2)
+				} else {
+					this.freightText = data.postageFlag === 0 ? '包邮' : '到付'
+					this.totalFreight = this.freightText
 				}
 				}
-				return price
-			},
-			discard(){
-				this.isShowOption = false
-				this.selectClass = ''
-			},
-			showTip(){
-				this.$emit('showFreightAlert')
-			},
+			}
 		}
 		}
 	}
 	}
+}
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
-	.freight-template{
+.freight-template {
+	width: 100%;
+	height: auto;
+	background: #ffffff;
+	float: left;
+	margin-top: 24rpx;
+	.invoice-freight {
 		width: 100%;
 		width: 100%;
-		height: auto;
-		background: #FFFFFF;
+		box-sizing: border-box;
+		padding: 10rpx 24rpx;
 		float: left;
 		float: left;
-		margin-top: 24rpx;
-		.invoice-freight{
+		.freight-main {
 			width: 100%;
 			width: 100%;
-			box-sizing: border-box;
-			padding: 10rpx 24rpx;
-			.freight-main{
-				width: 100%;
-				height: 78rpx;
-				line-height: 78rpx;
-				font-size: $font-size-28;
-				color: $text-color;
-				background: #FFFFFF;
+			height: 78rpx;
+			line-height: 78rpx;
+			font-size: $font-size-28;
+			color: $text-color;
+			background: #ffffff;
+			float: left;
+			.freight-left {
 				float: left;
 				float: left;
 				font-weight: bold;
 				font-weight: bold;
-				.freight-left{
+			}
+			.freight-right {
+				float: right;
+				position: relative;
+				.freight-text {
 					float: left;
 					float: left;
-					.tips{
-						font-size: $font-size-24;
-						color: $color-system;
-						font-weight: normal;
-						margin-left: 20rpx;
-					}
-					.icon-yunfeishuoming{
-						height: 100%;
-						padding:15rpx;
-						color: $color-system;
-						font-weight: normal;
-					}
-				}
-				.freight-right{
-					float: right;
-					color: #2A81FF;
-					position: relative;
-					.freight-text{
-						float: left;
-					}
-					.select{
-						float: right;
-						height: 60rpx;
-						padding: 0 20rpx;
-						margin-top: 14rpx;
-						line-height: 60rpx;
-						color: #2A81FF;
-						font-weight: normal;
-						position: relative;
-						.select-text{
-							display: inline-block;
-							float: left;
-							margin-right: 30rpx;
-						}
-						.iconfont{
-							width: 60rpx;
-							height: 60rpx;
-							line-height: 60rpx;
-							text-align: right;
-							position: absolute;
-							right: 0;
-							top: 0;
-							font-size: $font-size-28;
-							color: #2A81FF;
-						}
-					}
+					color:#F85050;
 				}
 				}
 			}
 			}
-			.freight-bean{
-				width: 100%;
-				height: 58rpx;
-				line-height: 58rpx;
+		}
+		.freight-bean {
+			width: 100%;
+			height: 58rpx;
+			line-height: 58rpx;
+			float: left;
+			.bean-le {
 				float: left;
 				float: left;
-				.bean-le{
+				color: $text-color;
+				font-size: $font-size-26;
+			}
+			.bean-ri {
+				float: right;
+				display: flex;
+				align-items: center;
+				.checkbox-box {
+					display: flex;
+					width: 60rpx;
 					float: left;
 					float: left;
-					color: #666666;
+					height: 100%;
 					font-size: $font-size-26;
 					font-size: $font-size-26;
-					font-weight: normal;
-				}
-				.bean-ri{
-					float: right;
-					display: flex;
-					align-items: center;
-					.checkbox-box{
-						display: flex;
-						width: 60rpx;
-						float: left;
-						height: 100%;
-						font-size: $font-size-26;
-						margin-top: 8rpx;
-						.checkbox{
-							width: 40rpx;
-							text-align: right;
-							box-sizing: border-box;
-							text-align: center;
-							text-decoration: none;
-							border-radius: 0;
-							-webkit-tap-highlight-color: transparent;
-							overflow: hidden;
-							color: $color-system;
-						}
+					margin-left: 20rpx;
+					.checkbox {
+						width: 40rpx;
+						text-align: right;
+						box-sizing: border-box;
+						text-align: center;
+						text-decoration: none;
+						border-radius: 0;
+						-webkit-tap-highlight-color: transparent;
+						overflow: hidden;
+						color: $color-system;
+					}
+					.iconfont {
+						font-size: 34rpx;
 					}
 					}
 				}
 				}
 			}
 			}
 		}
 		}
 	}
 	}
+}
 </style>
 </style>

+ 81 - 97
pages/user/order/create-order.vue

@@ -1,31 +1,19 @@
 <template>
 <template>
-	<view class="container order clearfix" :style="{ paddingBottom: isIphoneX ? '170rpx' : '134rpx' }">
+	<view class="container order clearfix" :style="{ paddingBottom: isIphoneX ? '200rpx' : '164rpx' }">
 		<!-- 地址选择 -->
 		<!-- 地址选择 -->
-		<choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData"></choice-address>
+		<choice-address ref="choiceAddress" v-if="isAddress" :addressData="addressData" />
 		<!-- 商品 -->
 		<!-- 商品 -->
-		<goods-list
-			ref="goods"
-			v-if="isRequest"
-			:goodsData="goodsData"
-			@handleGoodList="handChangeInputGoodsList"
-		></goods-list>
+		<goods-list ref="goods" v-if="isRequest" :goodsData="goodsData" @handleGoodList="handChangeInputGoodsList" />
 		<!-- 发票信息 -->
 		<!-- 发票信息 -->
 		<invoice-tent
 		<invoice-tent
 			ref="invoice"
 			ref="invoice"
 			v-if="isRequest"
 			v-if="isRequest"
 			:invoiceDatas="invoiceData"
 			:invoiceDatas="invoiceData"
 			@handleChoiceaInvoice="handleChoiceaInvoiceData"
 			@handleChoiceaInvoice="handleChoiceaInvoiceData"
-		>
-		</invoice-tent>
+		/>
 		<!-- 运费 -->
 		<!-- 运费 -->
-		<freight
-			ref="freight"
-			v-if="isFreight"
-			:freightData="freightData"
-			@confirmFreight="hanldFreightFn"
-		>
-		</freight>
-		<freight-alert v-if="isfreightTip" ref="csPhone"></freight-alert>
+		<freight ref="freight" v-if="isFreight" :freightData="freightData" :coldChain="handleColdChain" @confirmFreight="hanldFreightFn" />
+		<freight-alert v-if="isfreightTip" ref="csPhone" />
 		<!-- 底部 -->
 		<!-- 底部 -->
 		<view class="footer-wrapper" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
 		<view class="footer-wrapper" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
 			<view class="footer">
 			<view class="footer">
@@ -75,6 +63,7 @@ export default {
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {
+			skeletonShow: true,
 			isIphoneX: this.$store.state.isIphoneX,
 			isIphoneX: this.$store.state.isIphoneX,
 			isSubLoading: false,
 			isSubLoading: false,
 			confirmType: 1,
 			confirmType: 1,
@@ -115,6 +104,7 @@ export default {
 				orderInvoice: { type: 0 }, // 订单发票信息
 				orderInvoice: { type: 0 }, // 订单发票信息
 				payInfo: {
 				payInfo: {
 					// 订单金额数据
 					// 订单金额数据
+					isColdChina:1, //是否勾选冷链费	
 					orderShouldPayFee: 0, // 订单最终支付金额
 					orderShouldPayFee: 0, // 订单最终支付金额
 					balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
 					balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
 					clauseId: 0, // 条款Id
 					clauseId: 0, // 条款Id
@@ -135,6 +125,7 @@ export default {
 			isAddress: false, // 是否加载完成地址
 			isAddress: false, // 是否加载完成地址
 			isExchangePopup: false, // 控制兑换优惠券弹窗
 			isExchangePopup: false, // 控制兑换优惠券弹窗
 			isfreightTip: false, // 控制邮费弹窗
 			isfreightTip: false, // 控制邮费弹窗
+			designatedFlag: '', // 是否为指定商品 1.仅为指定商品 2.仅为供应商商品 3.指定商品+供应商商品
 			hanldFreePostFlag: '', // 邮费状态
 			hanldFreePostFlag: '', // 邮费状态
 			hanldFreight: '', // 邮费
 			hanldFreight: '', // 邮费
 			addressData: {}, // 初始化地址信息
 			addressData: {}, // 初始化地址信息
@@ -143,7 +134,8 @@ export default {
 			invoiceData: { type: 0 }, // 初始化发票信息
 			invoiceData: { type: 0 }, // 初始化发票信息
 			freightData: {}, // 邮费数据
 			freightData: {}, // 邮费数据
 			orderInfo: [], // 提交的商品信息
 			orderInfo: [], // 提交的商品信息
-			freightBeansMoney: 0, // 存储采美豆抵扣金额
+			handleColdChain:0,// 指定商品冷链费
+			freightColdChain: 0, // 存储冷链费
 			contentModalText: '采购金额过小,将扣除500采美豆,建议您前往采美旗下“颜选美学”小程序购买小额商品。', //操作文字提示语句
 			contentModalText: '采购金额过小,将扣除500采美豆,建议您前往采美旗下“颜选美学”小程序购买小额商品。', //操作文字提示语句
 			modalButton: [
 			modalButton: [
 				{
 				{
@@ -161,12 +153,12 @@ export default {
 				}
 				}
 			],
 			],
 			showModal: false,
 			showModal: false,
-			showModalstauts: 0,
+			showModalstauts: 0
 		}
 		}
 	},
 	},
 	onLoad(option) {
 	onLoad(option) {
 		//商品数据
 		//商品数据
-		this.initStorage(option)
+		this.initCreateOrderInfo(option)
 	},
 	},
 	filters: {
 	filters: {
 		NumFormat(value) {
 		NumFormat(value) {
@@ -175,14 +167,12 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
-		async initStorage(option) {
+		async initCreateOrderInfo(option) {
 			const data = JSON.parse(option.data)
 			const data = JSON.parse(option.data)
 			const userInfo = await this.$api.getStorage()
 			const userInfo = await this.$api.getStorage()
-			console.log('data', data)
-			this.productParam.userId = this.cartParam.userId = this.supportParm.userId = this.postageParam.userId = userInfo.userId
-				? userInfo.userId
-				: 0
-			this.confirmParam.clubId = userInfo.clubId ? userInfo.clubId : 0
+			this.productParam.userId = this.cartParam.userId = userInfo.userId
+			this.supportParm.userId = this.postageParam.userId = userInfo.userId
+			this.confirmParam.clubId = userInfo.clubId
 			switch (option.type) {
 			switch (option.type) {
 				case '1': // 商品详情立即购买
 				case '1': // 商品详情立即购买
 					this.confirmParam.cartType = 2
 					this.confirmParam.cartType = 2
@@ -207,28 +197,28 @@ export default {
 		},
 		},
 		// 商品立即购买确认订单数据初始化
 		// 商品立即购买确认订单数据初始化
 		async GetProductCreateOrderInfo() {
 		async GetProductCreateOrderInfo() {
-			try{
+			try {
 				const res = await this.OrderService.ProductCreateOrderInfo(this.productParam)
 				const res = await this.OrderService.ProductCreateOrderInfo(this.productParam)
 				this.setCreatDataInfo(res.data)
 				this.setCreatDataInfo(res.data)
-			}catch(error){
+			} catch (error) {
 				console.log('商品立即购买订单初始化异常')
 				console.log('商品立即购买订单初始化异常')
 			}
 			}
 		},
 		},
 		// 组合商品立即购买确认订单数据初始化
 		// 组合商品立即购买确认订单数据初始化
 		async GetOrderClubProductSupporting() {
 		async GetOrderClubProductSupporting() {
-			try{
+			try {
 				const res = await this.OrderService.OrderClubProductSupporting(this.supportParm)
 				const res = await this.OrderService.OrderClubProductSupporting(this.supportParm)
 				this.setCreatDataInfo(res.data)
 				this.setCreatDataInfo(res.data)
-			}catch(error){
+			} catch (error) {
 				console.log('组合商品立即购买订单初始化异常')
 				console.log('组合商品立即购买订单初始化异常')
 			}
 			}
 		},
 		},
 		// 购物车去结算确认订单数据初始化
 		// 购物车去结算确认订单数据初始化
 		async CartCreateOrderInfo() {
 		async CartCreateOrderInfo() {
-			try{
+			try {
 				const res = await this.OrderService.CartCreateOrderInfo(this.cartParam)
 				const res = await this.OrderService.CartCreateOrderInfo(this.cartParam)
 				this.setCreatDataInfo(res.data)
 				this.setCreatDataInfo(res.data)
-			}catch(error){
+			} catch (error) {
 				console.log('购物车结算订单初始化异常')
 				console.log('购物车结算订单初始化异常')
 			}
 			}
 		},
 		},
@@ -237,6 +227,7 @@ export default {
 			this.isRequest = true
 			this.isRequest = true
 			this.goodsData = data.list
 			this.goodsData = data.list
 			this.couponList = data.couponList
 			this.couponList = data.couponList
+			this.handleColdChain = this.freightColdChain = data.coldChain
 			this.userMoney = data.userMoney
 			this.userMoney = data.userMoney
 			this.totalCount = data.totalCount
 			this.totalCount = data.totalCount
 			this.allPrice = data.totalPrice
 			this.allPrice = data.totalPrice
@@ -257,40 +248,28 @@ export default {
 		},
 		},
 		// 获取邮费信息
 		// 获取邮费信息
 		async getFreightData() {
 		async getFreightData() {
-			try{
+			try {
 				this.isFreight = false
 				this.isFreight = false
 				const res = await this.OrderService.GetOrderPostage(this.postageParam)
 				const res = await this.OrderService.GetOrderPostage(this.postageParam)
 				const data = res.data
 				const data = res.data
 				this.isFreight = true
 				this.isFreight = true
 				this.freightData = data
 				this.freightData = data
+				this.designatedFlag = data.designatedFlag
 				this.hanldFreePostFlag = data.postageFlag
 				this.hanldFreePostFlag = data.postageFlag
 				this.hanldFreight = data.postage
 				this.hanldFreight = data.postage
-				if (this.hanldFreePostFlag == 1) {
-					if (this.freightData.userBeans > 0) {
-						this.freightBeansMoney = this.hanldFreight
-					} else {
-						this.freightBeansMoney = 0
-					}
-					this.orderShouldPayFee = this.allPrice + data.postage
-					this.attributePallPrice()
-				} else {
-					if (this.freightData.userBeans > 0) {
-						this.freightBeansMoney = 30
-					} else {
-						this.freightBeansMoney = 0
-					}
-					this.orderShouldPayFee = this.allPrice
-					this.attributePallPrice()
-				}
-			}catch(error){
+				this.attributePallPrice()
+			} catch (error) {
 				console.log('获取订单运费异常')
 				console.log('获取订单运费异常')
 			}
 			}
 		},
 		},
 		//获取地址信息
 		//获取地址信息
 		async getAddressData() {
 		async getAddressData() {
-			try{
-				const userInfo = await this.$api.getStorage()
-				const res = await this.UserService.QueryAddressList({ pageNum: 1,pageSize: 1,userId: this.postageParam.userId })
+			try {
+				const res = await this.UserService.QueryAddressList({
+					pageNum: 1,
+					pageSize: 1,
+					userId: this.postageParam.userId
+				})
 				const data = res.data
 				const data = res.data
 				this.isAddress = true
 				this.isAddress = true
 				this.addressData = {}
 				this.addressData = {}
@@ -302,8 +281,8 @@ export default {
 				} else {
 				} else {
 					this.addressData = this.addressData
 					this.addressData = this.addressData
 				}
 				}
-			}catch(error){
-				console.log('error',error)
+			} catch (error) {
+				console.log('error', error)
 			}
 			}
 		},
 		},
 		//对应供应商的留言信息
 		//对应供应商的留言信息
@@ -314,32 +293,35 @@ export default {
 		handleChoiceaInvoiceData(data) {
 		handleChoiceaInvoiceData(data) {
 			this.confirmParam.orderInvoice = data
 			this.confirmParam.orderInvoice = data
 		},
 		},
-		//显示邮费弹窗
-		hanldFreightFn(data) {
-			console.log('邮费信息', data)
-			switch (data.postageFlag) {
-				case 1:
-					this.hanldFreight = this.freightData.postage
-					this.hanldFreePostFlag = data.postageFlag
-					this.freightBeansMoney = data.freightBeansMoney
-					this.orderShouldPayFee = this.allPrice + this.hanldFreight
-					this.attributePallPrice()
-					break
-				case -1:
-					this.hanldFreight = 0
-					this.hanldFreePostFlag = data.postageFlag
-					this.freightBeansMoney = data.freightBeansMoney
-					this.orderShouldPayFee = this.allPrice
-					this.attributePallPrice()
-					break
+		hanldFreightFn(ischecked){//是否勾选冷链费
+			this.confirmParam.payInfo.isColdChina = ischecked ? 1 : 0
+			if(ischecked){
+				this.freightColdChain = this.handleColdChain
+			}else{// 不勾选冷链费计算总价
+				this.freightColdChain = 0
 			}
 			}
+			this.attributePallPrice()
 		},
 		},
 		// 计算价格
 		// 计算价格
 		attributePallPrice() {
 		attributePallPrice() {
-			if (this.hanldFreePostFlag == 1 || this.hanldFreePostFlag == '1') {
-				this.attributeHashfreight(this.freightData.postage)
-			} else {
-				this.attributeNofreight()
+			switch(this.designatedFlag){
+				case 1://仅为指定商品
+					this.attributeChainfreight()
+					break
+				case 2:// 仅为供应商商品
+					if (this.hanldFreePostFlag == 1) {
+						this.attributeHashfreight(this.freightData.postage)
+					} else {
+						this.attributeNofreight()
+					}
+					break
+				case 3:// 有指定商品 + 供应商商品
+					if (this.hanldFreePostFlag == 1) {
+						this.attributeHashChainfreight(this.freightData.postage)
+					} else {
+						this.attributeChainfreight()
+					}
+					break
 			}
 			}
 		},
 		},
 		// 计算没有邮费的支付价格
 		// 计算没有邮费的支付价格
@@ -347,9 +329,19 @@ export default {
 			this.orderShouldPayFee = this.allPrice
 			this.orderShouldPayFee = this.allPrice
 			console.log('最终订单支付金额', this.orderShouldPayFee)
 			console.log('最终订单支付金额', this.orderShouldPayFee)
 		},
 		},
+		// 计算仅为指定商品冷链费的价格
+		attributeChainfreight(){
+			this.orderShouldPayFee = this.allPrice + this.freightColdChain
+			console.log('最终订单支付金额', this.orderShouldPayFee)
+		},
+		// 计算指定商品冷链费后+运费的支付价格
+		attributeHashChainfreight(postage){
+			this.orderShouldPayFee = this.allPrice + this.freightColdChain + parseInt(postage)
+			console.log('最终订单支付金额', this.orderShouldPayFee)
+		},
 		// 计算需要邮费的支付价格
 		// 计算需要邮费的支付价格
 		attributeHashfreight(postage) {
 		attributeHashfreight(postage) {
-			this.orderShouldPayFee = this.allPrice + parseInt(postage) //计算不包邮的价格 总价等于商品价格+邮费
+			this.orderShouldPayFee = this.allPrice + parseInt(postage)  //计算不包邮的价格 总价等于商品价格+邮费
 			console.log('最终订单支付金额', this.orderShouldPayFee)
 			console.log('最终订单支付金额', this.orderShouldPayFee)
 		},
 		},
 		// 提交订单按钮点击事件
 		// 提交订单按钮点击事件
@@ -358,7 +350,9 @@ export default {
 		},
 		},
 		// 提交订单
 		// 提交订单
 		handleClickOrderSubmitMit() {
 		handleClickOrderSubmitMit() {
-			if (this.isSubLoading) { return }
+			if (this.isSubLoading) {
+				return
+			}
 			if (this.confirmParam.addressId == '') {
 			if (this.confirmParam.addressId == '') {
 				this.$util.msg('请先添加收货地址~', 2000)
 				this.$util.msg('请先添加收货地址~', 2000)
 				return
 				return
@@ -392,8 +386,8 @@ export default {
 		},
 		},
 		async hanldeOrderSubmit(params) {
 		async hanldeOrderSubmit(params) {
 			// 提交订单
 			// 提交订单
-			try{
-				const res =await this.OrderService.CreatedOrderSubmit(params)
+			try {
+				const res = await this.OrderService.CreatedOrderSubmit(params)
 				const data = res.data
 				const data = res.data
 				if (data.code === 1) {
 				if (data.code === 1) {
 					this.submitState = 'success'
 					this.submitState = 'success'
@@ -415,13 +409,14 @@ export default {
 						}
 						}
 					}, 2000)
 					}, 2000)
 				}
 				}
-			}catch(error){
+			} catch (error) {
 				console.log(error)
 				console.log(error)
 				this.formatConfirmParam()
 				this.formatConfirmParam()
 				this.isSubLoading = false
 				this.isSubLoading = false
 			}
 			}
 		},
 		},
-		formatConfirmParam(){// 还原提交订单参数格式
+		formatConfirmParam() {
+			// 还原提交订单参数格式
 			this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
 			this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
 			this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
 			this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
 			this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
 			this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
@@ -488,7 +483,7 @@ export default {
 			this.postageParam.townId = SelectData.townId
 			this.postageParam.townId = SelectData.townId
 			this.addressData = SelectData
 			this.addressData = SelectData
 			this.getFreightData()
 			this.getFreightData()
-		}else{
+		} else {
 			this.getAddressData()
 			this.getAddressData()
 		}
 		}
 	}
 	}
@@ -512,16 +507,6 @@ page {
 .order {
 .order {
 	padding-bottom: 134rpx;
 	padding-bottom: 134rpx;
 }
 }
-.invoice-freight {
-	width: 702rpx;
-	padding: 0 24rpx;
-	height: auto;
-	font-size: $font-size-28;
-	color: $text-color;
-	background: #ffffff;
-	float: left;
-	font-weight: bold;
-}
 .invoice-balance {
 .invoice-balance {
 	width: 702rpx;
 	width: 702rpx;
 	height: auto;
 	height: auto;
@@ -612,7 +597,6 @@ page {
 	.footer-count {
 	.footer-count {
 		float: left;
 		float: left;
 		padding-left: 24rpx;
 		padding-left: 24rpx;
-		width: 180rpx;
 		box-sizing: border-box;
 		box-sizing: border-box;
 	}
 	}
 	.footer-price {
 	.footer-price {

+ 9 - 19
pages/user/order/order-details.vue

@@ -16,32 +16,29 @@
 		></tui-skeleton>
 		></tui-skeleton>
 		<view v-else class="container-details" :style="{ paddingTop: navbarHeight + 'px' }">
 		<view v-else class="container-details" :style="{ paddingTop: navbarHeight + 'px' }">
 			<!-- 地址选择 -->
 			<!-- 地址选择 -->
-			<order-address ref="orderAddress" v-if="skeletonShow" :addressData="addressData"></order-address>
+			<order-address ref="orderAddress" v-if="skeletonShow" :addressData="addressData" />
 			<!-- 商品 -->
 			<!-- 商品 -->
-			<goods-list
-				ref="goods"
-				v-if="skeletonShow"
-				:shopOrderData="shopOrderData"
-				:information="information"
-			></goods-list>
+			<goods-list ref="goods" v-if="skeletonShow" :shopOrderData="shopOrderData" :information="information" />
 			<!-- 订单信息 -->
 			<!-- 订单信息 -->
-			<order-information ref="information" v-if="skeletonShow" :information="information"></order-information>
+			<order-information ref="information" v-if="skeletonShow" :information="information" />
 			<!-- 发票信息 -->
 			<!-- 发票信息 -->
-			<invoice-tent ref="invoice" v-if="skeletonShow" :orderInvoice="orderInvoice"></invoice-tent>
+			<invoice-tent ref="invoice" v-if="skeletonShow" :orderInvoice="orderInvoice" />
 			<!-- 支付记录 -->
 			<!-- 支付记录 -->
 			<payment-record
 			<payment-record
 				ref="payment"
 				ref="payment"
-				v-if="skeletonShow"
+				v-if="skeletonShow && discernReceiptList.length > 0"
 				:discernReceiptList="discernReceiptList"
 				:discernReceiptList="discernReceiptList"
 				:receiptAmount="receiptAmount"
 				:receiptAmount="receiptAmount"
-			></payment-record>
+			/>
 			<!-- 退款记录 -->
 			<!-- 退款记录 -->
 			<refund-record
 			<refund-record
 				ref="refund"
 				ref="refund"
 				v-if="skeletonShow"
 				v-if="skeletonShow"
 				:returnedPurchaseList="returnedPurchaseList"
 				:returnedPurchaseList="returnedPurchaseList"
 				:returnedPurchaseFee="returnedPurchaseFee"
 				:returnedPurchaseFee="returnedPurchaseFee"
-			></refund-record>
+			/>
+			<!-- 支付凭证记录 -->
+			<voucher-record ref="voucher" v-if="skeletonShow && voucherList.length > 0" :list="voucherList" />
 			<!-- 底部button -->
 			<!-- 底部button -->
 			<order-button
 			<order-button
 				ref="orderButton"
 				ref="orderButton"
@@ -50,13 +47,6 @@
 				:shareCode="shareCode"
 				:shareCode="shareCode"
 				:order="orderInfo"
 				:order="orderInfo"
 				@buttonConfirm="handButtonConfirm"
 				@buttonConfirm="handButtonConfirm"
-			>
-			</order-button>
-			<!-- 支付凭证记录 -->
-			<voucher-record
-				ref="voucher"
-				v-if="skeletonShow"
-				:list="voucherList"
 			/>
 			/>
 		</view>
 		</view>
 		<!-- 分享弹窗 -->
 		<!-- 分享弹窗 -->