Selaa lähdekoodia

优惠券V1.0.4

zhengjinyi 1 vuosi sitten
vanhempi
commit
63f66f35e0

+ 1 - 3
components/cm-module/homeIndex/quickOperation.vue

@@ -69,9 +69,7 @@ export default {
         }
     },
     watch: {},
-    mounted() {
-        console.log('this.footList', this.footList)
-    },
+    mounted() {},
     methods: {
         // 链接跳转
         NavToDetailPage(pros) {

+ 8 - 4
pages/seller/order/components/details/cm-goods-temp.vue

@@ -115,13 +115,17 @@
 						<view class="price-view-le">运费:</view>
 						<view class="price-view-ri">{{ orderInfo.postageInfo }}</view>
 					</view>
-					<view class="pros-price-view" v-if="orderInfo.eachDiscount > 0">
+					<view class="pros-price-view" v-if="orderInfo.couponAmount > 0">
 						<view class="price-view-le">优惠:</view>
-						<view class="price-view-ri">¥{{ orderInfo.eachDiscount | NumFormat }}</view>
+						<view class="price-view-ri">¥{{ orderInfo.couponAmount | NumFormat }}</view>
 					</view>
-					<view class="pros-price-view" v-if="orderInfo.totalAmount > 0">
+					<view class="pros-price-view" v-if="orderInfo.promotionFullReduction > 0">
 						<view class="price-view-le">促销满减:</view>
-						<view class="price-view-ri">¥{{ orderInfo.totalAmount | NumFormat }}</view>
+						<view class="price-view-ri">¥{{ orderInfo.promotionFullReduction | NumFormat }}</view>
+					</view>
+					<view class="pros-price-view" v-if="orderInfo.presentNum > 0">
+						<view class="price-view-le">赠品数:</view>
+						<view class="price-view-ri">¥{{ orderInfo.presentNum }}</view>
 					</view>
 					<view class="pros-price-view">
 						<view class="price-view-le">订单总额:</view>

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

@@ -9,19 +9,12 @@
 					</view>
 				</view>
 			</view>
-			<view class="information-view same" v-if="orderData.presentNum > 0">
-				<view class="view-man">
-					赠品总数:<label class="label">{{
-						orderData.presentNum
-					}}</label>
-				</view>
-			</view>
 			<view class="information-view">
 				<view class="view-num time">
 					下单时间:<label class="label">{{ orderData.orderTime ? orderData.orderTime : '' }}</label>
 				</view>
 			</view>
-<!-- 			<view class="information-view same" v-if="orderData.svipFullReduction > 0">
+<!-- 		<view class="information-view same" v-if="orderData.svipFullReduction > 0">
 				<view class="view-man">
 					超级会员优惠:<label class="label">¥{{ orderData.svipFullReduction | NumFormat }}</label>
 				</view>
@@ -30,25 +23,7 @@
 				<view class="view-man">
 					采美豆抵用运费:<label class="label">{{ orderData.userBeans }}</label>
 				</view>
-			</view>
-			<view class="information-view same" v-if="orderData.discountFee && orderData.discountFee > 0">
-				<view class="view-num">
-					经理折扣:<label class="label">¥{{ orderData.discountFee | NumFormat }}</label>
-				</view>
-			</view>
-			<view
-				class="information-view"
-				v-if="orderData.promotionFullReduction && orderData.promotionFullReduction > 0"
-			>
-				<view class="view-man">
-					促销满减:<label class="label">¥{{ orderData.promotionFullReduction | NumFormat }}</label>
-				</view>
-			</view>
-			<view class="information-view same">
-				<view class="view-man">
-					优惠券:<label class="label">¥{{ orderData.couponAmount | NumFormat }}</label>
-				</view>
-			</view> -->
+			</view>-->
 		</view>
 	</view>
 </template>

+ 18 - 12
pages/seller/order/create-order.vue

@@ -306,8 +306,8 @@ export default {
 				if (data.list && data.list.length > 0) {
 					this.addressData = data.list[0]
 					this.confirmParam.addressId = this.addressData.addressId
-					this.cartParam.townId = this.addressData.townId
-					this.productParam.townId = this.addressData.townId
+					this.cartParam.cityId = this.addressData.cityId
+					this.productParam.cityId = this.addressData.cityId
 				}
 				if (type === 1) {
 					//立即都买提交
@@ -368,7 +368,17 @@ export default {
 			if (this.isSubLoading) {
 				return
 			}
-			this.confirmParam.orderInfo = this.goodsData.map(el => {
+			this.confirmParam.orderInfo = this.hanldeProcessing()
+			this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
+			this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
+			this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
+			this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
+			this.isSubLoading = true
+			this.hanldeOrderSubmit(this.confirmParam)
+		},
+		// 处理数据格式
+		hanldeProcessing() {
+			return this.goodsData.map(el => {
 				let productInfo = []
 				el.cartList.forEach(pros => {
 					productInfo.push({
@@ -382,18 +392,14 @@ export default {
 					splitCode: el.splitCode,
 					shopId: el.shopId,
 					note: el.note ? el.note : '',
-					postage: parseInt(el.postage).toFixed(2),
+					postage: el.isColdChina
+						? parseInt(el.postage + el.coldChain).toFixed(2)
+						: parseInt(el.postage).toFixed(2),
 					postageFlag: parseInt(el.handlePostageFlag),
 					isColdChina: el.isColdChina ? 1 : 0,
 					productInfo: productInfo
 				}
 			})
-			this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
-			this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
-			this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
-			this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
-			this.isSubLoading = true
-			this.hanldeOrderSubmit(this.confirmParam)
 		},
 		// 提交订单
 		async hanldeOrderSubmit(params) {
@@ -555,8 +561,8 @@ export default {
 		if (currPage.data.select == 'select') {
 			let address = uni.getStorageSync('selectAddress')
 			this.confirmParam.addressId = address.addressId
-			this.cartParam.townId = address.townId
-			this.productParam.townId = address.townId
+			this.cartParam.cityId = address.cityId
+			this.productParam.cityId = address.cityId
 			this.addressData = address
 			this.ischecked = false
 			this.isRequest = false

+ 2 - 2
pages/seller/order/mixins/conMixins.js

@@ -5,14 +5,14 @@ const conMixins = {
             handleComType:0,//跳转类型
             cartParam: {
                 // 购物车立即结算确认订单参数
-                townId:'',          //地址ID
+                cityId:'',          //地址ID
                 skuIds:'',
                 serviceProviderId: 0, // 协销Id
                 clubId: 0 // 机构Id
             },
             productParam: {
                 // 商品立即购买确认订单参数
-                townId:'',          //地址ID
+                cityId:'',          //地址ID
                 productCount: 0, // 商品数量
                 productId: 0, // 商品Id
                 serviceProviderId: 0, // 协销Id

+ 22 - 16
pages/user/order/components/cm-freight-popup.vue

@@ -13,7 +13,9 @@
 					<view class="freight-left">运费:</view>
 					<view class="freight-right">
 						<view class="freight-text">¥{{ handleTotalPostage | NumFormat }}</view>
-						<!-- <view class="select"><text class="iconfont icon-xiayibu"></text></view> -->
+						<view class="select" v-if="supplier.coldChain > 0" @click="handlePupShow">
+							<text class="iconfont icon-xiayibu"></text>
+						</view>
 					</view>
 				</view>
 			</template>
@@ -23,17 +25,21 @@
 						(supplier.postageFlag === 1 && supplier.designatedFlag === 3)
 				"
 			>
-				<view class="freight-main">
+				<view class="freight-main"> 
 					<view class="freight-left">运费:</view>
 					<view class="freight-right">
 						<template v-if="handlePostageFlag === 1">
 							<view class="freight-text">¥{{ handleTotalPostage | NumFormat }}</view>
 						</template>
 						<template v-if="handlePostageFlag === 2">
-							<view v-if="handleSupplier.isColdChina" class="freight-text" >¥{{ handleTotalPostage | NumFormat }}</view>
+							<view v-if="handleSupplier.isColdChina" class="freight-text"
+								>¥{{ handleTotalPostage | NumFormat }}</view
+							>
 							<view v-else class="freight-text">到付</view>
 						</template>
-						<!-- <view class="select"><text class="iconfont icon-xiayibu"></text></view> -->
+						<view class="select" v-if="supplier.coldChain > 0" @click="handlePupShow">
+							<text class="iconfont icon-xiayibu"></text>
+						</view>
 					</view>
 				</view>
 			</template>
@@ -46,7 +52,7 @@
 			<tui-bottom-popup :radius="true" :show="popupShow" @close="hidePopup">
 				<view class="freight-title">运费设置</view>
 				<view class="freight-content">
-					<radio-group @change="radioChange" v-if="handleDesignatedFlag!=1">
+					<!-- <radio-group @change="radioChange" v-if="handleDesignatedFlag != 1">
 						<label v-for="(item, index) in radioItems" :key="index">
 							<radio
 								style="transform:scale(0.7)"
@@ -54,12 +60,12 @@
 								:id="item.value"
 								:value="item.value"
 								:checked="item.checked"
-							></radio>
+							/>
 							<label :for="item.value" class="label">
 								<text>{{ item.name }}</text>
 							</label>
 						</label>
-					</radio-group>
+					</radio-group> -->
 					<template v-if="handlePostageFlag === 1">
 						<view class="freight-form">
 							<view class="freight-form-item" v-if="handleSupplier.coldChain > 0">
@@ -74,7 +80,7 @@
 									</text>
 								</view>
 							</view>
-							<view class="freight-form-item" v-if="handleDesignatedFlag!=1">
+							<view class="freight-form-item" v-if="handleDesignatedFlag != 1">
 								<view class="label">其他运费 </view>
 								<view class="texts red">¥{{ handleSupplier.postage | NumFormat }} </view>
 							</view>
@@ -132,19 +138,19 @@ export default {
 		return {
 			popupShow: false,
 			isColdChina: false,
-			handlePostage:0,
+			handlePostage: 0,
 			handlePostageFlag: 1,
-			handleDesignatedFlag:0,
+			handleDesignatedFlag: 0,
 			radioItems: [
 				{
 					name: '不包邮',
 					value: 1,
 					checked: true
-				},
-				{
-					name: '到付',
-					value: 2
 				}
+				// 	{
+				// 		name: '到付',
+				// 		value: 2
+				// 	}
 			],
 			handleSupplier: {}
 		}
@@ -206,7 +212,7 @@ export default {
 		radioChange($event) {
 			// const postage = this.isColdChina ? ( this.handleSupplier.postage + this.handleSupplier.coldChain ) : this.handleSupplier.postage
 			this.handlePostageFlag = this.handleSupplier.handlePostageFlag = $event.detail.value * 1
-			console.log('handlePostageFlag',this.handlePostageFlag)
+			console.log('handlePostageFlag', this.handlePostageFlag)
 			if (this.handlePostageFlag === 1) {
 				this.handleSupplier.postage = this.handlePostage
 				this.handleSupplier.totalPrice = Number(
@@ -218,7 +224,7 @@ export default {
 					this.repiceNumSub(this.handleSupplier.totalPrice, this.handleSupplier.postage)
 				)
 				this.handleSupplier.postage = 0
-				console.log('2222222222',this.handleSupplier.totalPrice)
+				console.log('2222222222', this.handleSupplier.totalPrice)
 				this.$emit('changePostage', this.handleSupplier, this.index)
 			}
 		},

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

@@ -75,11 +75,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"

+ 8 - 4
pages/user/order/components/details/cm-goods-temp.vue

@@ -115,13 +115,17 @@
 						<view class="price-view-le">运费:</view>
 						<view class="price-view-ri">{{ orderInfo.postageInfo }}</view>
 					</view>
-					<view class="pros-price-view" v-if="orderInfo.eachDiscount > 0">
+					<view class="pros-price-view" v-if="orderInfo.couponAmount > 0">
 						<view class="price-view-le">优惠:</view>
-						<view class="price-view-ri">¥{{ orderInfo.eachDiscount | NumFormat }}</view>
+						<view class="price-view-ri">¥{{ orderInfo.couponAmount | NumFormat }}</view>
 					</view>
-					<view class="pros-price-view" v-if="orderInfo.totalAmount > 0">
+					<view class="pros-price-view" v-if="orderInfo.promotionFullReduction > 0">
 						<view class="price-view-le">促销满减:</view>
-						<view class="price-view-ri">¥{{ orderInfo.totalAmount | NumFormat }}</view>
+						<view class="price-view-ri">¥{{ orderInfo.promotionFullReduction | NumFormat }}</view>
+					</view>
+					<view class="pros-price-view" v-if="orderInfo.presentNum > 0">
+						<view class="price-view-le">赠品数:</view>
+						<view class="price-view-ri">¥{{ orderInfo.presentNum }}</view>
 					</view>
 					<view class="pros-price-view">
 						<view class="price-view-le">订单总额:</view>

+ 2 - 27
pages/user/order/components/details/cm-order-temp.vue

@@ -9,19 +9,12 @@
 					</view>
 				</view>
 			</view>
-			<view class="information-view same" v-if="orderData.presentNum > 0">
-				<view class="view-man">
-					赠品总数:<label class="label">{{
-						orderData.presentNum
-					}}</label>
-				</view>
-			</view>
 			<view class="information-view">
 				<view class="view-num time">
 					下单时间:<label class="label">{{ orderData.orderTime ? orderData.orderTime : '' }}</label>
 				</view>
 			</view>
-<!-- 			<view class="information-view same" v-if="orderData.svipFullReduction > 0">
+ 		<!--<view class="information-view same" v-if="orderData.svipFullReduction > 0">
 				<view class="view-man">
 					超级会员优惠:<label class="label">¥{{ orderData.svipFullReduction | NumFormat }}</label>
 				</view>
@@ -30,25 +23,7 @@
 				<view class="view-man">
 					采美豆抵用运费:<label class="label">{{ orderData.userBeans }}</label>
 				</view>
-			</view>
-			<view class="information-view same" v-if="orderData.discountFee && orderData.discountFee > 0">
-				<view class="view-num">
-					经理折扣:<label class="label">¥{{ orderData.discountFee | NumFormat }}</label>
-				</view>
-			</view>
-			<view
-				class="information-view"
-				v-if="orderData.promotionFullReduction && orderData.promotionFullReduction > 0"
-			>
-				<view class="view-man">
-					促销满减:<label class="label">¥{{ orderData.promotionFullReduction | NumFormat }}</label>
-				</view>
-			</view>
-			<view class="information-view same">
-				<view class="view-man">
-					优惠券:<label class="label">¥{{ orderData.couponAmount | NumFormat }}</label>
-				</view>
-			</view> -->
+			</view>-->
 		</view>
 	</view>
 </template>

+ 21 - 15
pages/user/order/create-order.vue

@@ -260,9 +260,9 @@ export default {
 				if (data.list && data.list.length > 0) {
 					this.addressData = data.list[0]
 					this.confirmParam.addressId = this.addressData.addressId
-					this.cartParam.townId = this.addressData.townId
-					this.productParam.townId = this.addressData.townId
-					this.supportParm.townId = this.addressData.townId
+					this.cartParam.cityId = this.addressData.cityId
+					this.productParam.cityId = this.addressData.cityId
+					this.supportParm.cityId = this.addressData.cityId
 				}
 				if (type === 1) {
 					//立即都买提交
@@ -474,7 +474,18 @@ export default {
 				this.$util.msg('请先添加收货地址~', 2000)
 				return
 			}
-			this.confirmParam.orderInfo = this.goodsData.map(el => {
+			this.confirmParam.orderInfo = this.hanldeProcessing()
+			this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
+			this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
+			this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
+			this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
+			console.log(this.confirmParam)
+			this.isSubLoading = true
+			this.hanldeOrderSubmit(this.confirmParam)
+		},
+		// 处理数据格式
+		hanldeProcessing() {
+			return this.goodsData.map(el => {
 				let productInfo = []
 				el.cartList.forEach(pros => {
 					productInfo.push({
@@ -488,19 +499,14 @@ export default {
 					splitCode: el.splitCode,
 					shopId: el.shopId,
 					note: el.note ? el.note : '',
-					postage: parseInt(el.postage).toFixed(2),
+					postage: el.isColdChina
+						? parseInt(el.postage + el.coldChain).toFixed(2)
+						: parseInt(el.postage).toFixed(2),
 					postageFlag: parseInt(el.handlePostageFlag),
 					isColdChina: el.isColdChina ? 1 : 0,
 					productInfo: productInfo
 				}
 			})
-			this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
-			this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
-			this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
-			this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
-			console.log(this.confirmParam)
-			this.isSubLoading = true
-			this.hanldeOrderSubmit(this.confirmParam)
 		},
 		// 提交订单
 		async hanldeOrderSubmit(params) {
@@ -683,9 +689,9 @@ export default {
 		if (currPage.data.select == 'select') {
 			let address = uni.getStorageSync('selectAddress')
 			this.confirmParam.addressId = address.addressId
-			this.cartParam.townId = address.townId
-			this.productParam.townId = address.townId
-			this.supportParm.townId = address.townId
+			this.cartParam.cityId = address.cityId
+			this.productParam.cityId = address.cityId
+			this.supportParm.cityId = address.cityId
 			this.addressData = address
 			this.ischecked = false
 			this.isRequest = false

+ 5 - 5
pages/user/order/mixins/conMixins.js

@@ -5,14 +5,14 @@ const conMixins = {
             handleComType:0,//跳转类型
             cartParam: {
                 // 购物车立即结算确认订单参数
-                townId:'',          //地址ID
+                cityId:'',          //地址ID
                 skuIds: 0, // 商品Id(逗号隔开)
                 source: 2, // 来源:1WWW 2小程序
                 userId: 0 // 用户Id
             },
             productParam: {
                 // 商品立即购买确认订单参数
-                townId:'',          //地址ID
+                cityId:'',          //地址ID
                 productCount: 0, // 商品数量
                 productId: 0, // 商品Id
                 source: 2, // 来源:1WWW 2小程序
@@ -20,7 +20,7 @@ const conMixins = {
             },
             supportParm: {
                 // 组合商品立即购买确认订单参数
-                townId:'',          //地址ID
+                cityId:'',          //地址ID
                 productInfo: '',
                 source: 2, // 来源:1WWW 2小程序
                 userId: 0 // 用户Id
@@ -84,11 +84,11 @@ const conMixins = {
                 if (this.userMoney >= this.orderTotalPrice) {
                     this.orderShouldPayFee =0.0
                     this.deductMoney = this.orderTotalPrice// 当前使用金额等于订单金额
-                    console.log('最终订单支付金额00001', this.orderShouldPayFee)
+                    console.log('最终订单支付金额', this.orderShouldPayFee)
                 } else {
                     this.orderShouldPayFee = this.orderTotalPrice - this.userMoney // 订单最终支付金额等于订单金额-账户余额
                     this.deductMoney = this.userMoney // 当前使用金额等于总余额
-                    console.log('最终订单支付金额00002', this.orderShouldPayFee)
+                    console.log('最终订单支付金额', this.orderShouldPayFee)
                 }
                 console.log('余额抵扣最终订单支付金额', this.orderShouldPayFee)
             } else {

+ 8 - 4
pages/user/order/order-pay-list.vue

@@ -22,6 +22,14 @@
 						<text class="text"> {{ list.postageInfo }}</text>
 					</view>
 				</view>
+				<view class="pay-list-msg" v-if="list.couponAmount > 0">
+					<view class="list-label">优惠:</view>
+					<view class="list-msg">¥{{ list.couponAmount | NumFormat }}</view>
+				</view>
+				<view class="pay-list-msg" v-if="list.promotionFullReduction > 0">
+					<view class="list-label">促销满减:</view>
+					<view class="list-msg">¥{{ list.promotionFullReduction | NumFormat }}</view>
+				</view>
 				<view class="pay-list-msg">
 					<view class="list-label">已付:</view>
 					<view class="list-msg">
@@ -31,10 +39,6 @@
 						</text>
 					</view>
 				</view>
-				<view class="pay-list-msg" v-if="list.eachDiscount > 0">
-					<view class="list-label">优惠:</view>
-					<view class="list-msg">¥{{ list.shopeachDiscountPostFee | NumFormat }}</view>
-				</view>
 				<view class="pay-list-msg">
 					<view class="list-label">待付:</view>
 					<view class="list-msg"><text class="text red"> ¥{{ list.obligation | NumFormat }}</text></view>