Browse Source

优化直接购买无跑腿费问题

xiaoxin 1 year ago
parent
commit
60dd67adde

+ 1 - 2
pages/index/shop/confirmOrder.vue

@@ -701,6 +701,7 @@ export default {
 				lat: this.lat
 			}
 			this.$Request.get('/app/goods/selectGoodsList', data).then((res) => {
+				console.log(res, 'data')
 				if (res.code == 0 && res.data) {
 					this.reservationOpenFlag = res.data.goodsShop.reservationOpenFlag
 					this.autoSendOrder = res.data.goodsShop.autoSendOrder
@@ -1006,7 +1007,6 @@ export default {
 					}
 					console.log(this.dataList, this.dabaoMoney, 'kkklll')
 
-					// this.paotuiMoney = this.dataList.errandMoney
 					if (this.ifPaotui == 1) {
 						this.paotuiMoney = this.dataList.errandMoney
 					} else if (this.ifPaotui == 0) {
@@ -1061,7 +1061,6 @@ export default {
 					}
 					console.log(this.dataList, this.dabaoMoney, 'kkklll')
 
-					// this.paotuiMoney = this.dataList.errandMoney
 					if (this.ifPaotui == 1) {
 						this.paotuiMoney = this.dataList.errandMoney
 					} else if (this.ifPaotui == 0) {

+ 3 - 3
pages/index/shop/goodsDet.vue

@@ -632,7 +632,7 @@ export default {
 								if (res.code == 0) {
 									this.skuShow = false
 									uni.navigateTo({
-										url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType
+										url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType + '&shopId=' + this.shopId
 									})
 								} else {
 									this.$queue.showToast(res.msg)
@@ -666,7 +666,7 @@ export default {
 					if (res.code == 0) {
 						this.skuShow = false
 						uni.navigateTo({
-							url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType
+							url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType + '&shopId=' + this.shopId
 						})
 					} else {
 						this.$queue.showToast(res.msg)
@@ -1579,4 +1579,4 @@ export default {
 	line-height: 2.8;
 	background-color: #fcd202;
 }
-</style>
+</style>

File diff suppressed because it is too large
+ 1794 - 1764
pages/index/shop/goodsList.vue


+ 3 - 3
pages/index/shop/index.vue

@@ -1049,7 +1049,7 @@ export default {
 								if (res.code == 0) {
 									this.skuShow = false
 									uni.navigateTo({
-										url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType
+										url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType + '&shopId=' + this.shopId
 									})
 								} else {
 									this.$queue.showToast(res.msg)
@@ -1083,7 +1083,7 @@ export default {
 					if (res.code == 0) {
 						this.skuShow = false
 						uni.navigateTo({
-							url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType
+							url: '/pages/index/shop/payOrder?orderId=' + res.data + '&orderType=' + this.orderType + '&shopId=' + this.shopId
 						})
 					} else {
 						this.$queue.showToast(res.msg)
@@ -2169,4 +2169,4 @@ page {
 	width: 180rpx; /* 三张图片平分宽度 */
 	height: 135rpx;
 }
-</style>
+</style>

+ 24 - 13
pages/index/shop/payOrder.vue

@@ -330,7 +330,8 @@ export default {
 			autoSendOrder: 0, //autoSendOrder为1商家自配,0平台配送
 
 			ifPaotui: 0, //是否满减
-			reservationOpenFlag: 0 //1预约,0不预约
+			reservationOpenFlag: 0, //1预约,0不预约
+			shopId: ''
 		}
 	},
 	onLoad(option) {
@@ -391,13 +392,18 @@ export default {
 		// #endif
 		this.orderId = option.orderId
 		this.orderType = option.orderType
+		if (option.shopId) {
+			this.shopId = option.shopId
+		}
 
 		uni.showLoading({
 			title: '加载中...',
 			mask: true // 是否显示透明蒙层,防止触摸穿透
 		})
 
-		this.getOrderList()
+		this.getShopDet(this.shopId)
+
+		// this.getOrderList()
 		this.getAddressList()
 		// this.getQishou()
 		let that = this
@@ -669,12 +675,13 @@ export default {
 				lat: this.lat
 			}
 			this.$Request.get('/app/goods/selectGoodsList', data).then((res) => {
+				console.log(res, 'data')
 				if (res.code == 0 && res.data) {
 					this.reservationOpenFlag = res.data.goodsShop.reservationOpenFlag
 					this.autoSendOrder = res.data.goodsShop.autoSendOrder
 					this.shopDet = res.data.goodsShop
 					this.ifPaotui = res.data.goodsShop.enableFullReductionFlag
-					// this.getOrderList();
+					this.getOrderList()
 					// this.getQishou()
 				}
 			})
@@ -924,13 +931,14 @@ export default {
 				orderId: this.orderId
 			}
 			this.$Request.get('/app/order/selectBuyGoods', data).then((res) => {
+				console.log(res, '666')
 				uni.hideLoading()
 				if (res.code == 0) {
 					this.dataList = res.data
 					this.GoodsorderId = res.data.orderId
-					this.getShopDet(res.data.shopId)
+					// this.getShopDet(res.data.shopId)
 					// this.dataList.orderGoodsList[0].goodsPicture = this.dataList.orderGoodsList[0].goodsPicture.split(',')
-					console.log(this.dataList.orderGoodsList)
+					// console.log(this.dataList.orderGoodsList)
 					if (this.dataList) {
 						this.dataList.orderGoodsList.forEach((res) => {
 							res.goodsPicture = res.goodsPicture.split(',')
@@ -940,14 +948,17 @@ export default {
 						})
 					}
 
-					console.log(Number(this.dataList.orderGoodsList[0].goodsPrice))
-					console.log(Number(this.dataList.exemptMinMoney))
-					// 判断商品金额是否大于最低减免配送费金额
-					if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
-						console.log('跑腿费')
-						this.paotuiMoney = 0
-					} else {
+					console.log(this.ifPaotui, 'this.ifPaotui')
+					if (this.ifPaotui == 1) {
 						this.paotuiMoney = this.dataList.errandMoney
+					} else if (this.ifPaotui == 0) {
+						// 判断商品金额是否大于最低减免配送费金额
+						if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
+							console.log('跑腿费')
+							this.paotuiMoney = 0
+						} else {
+							this.paotuiMoney = this.dataList.errandMoney
+						}
 					}
 
 					this.totalPrice = res.data.payMoney * 1
@@ -1636,4 +1647,4 @@ export default {
 		top: -20rpx; */
 	z-index: 9;
 }
-</style>
+</style>