xiaoxin 1 yıl önce
ebeveyn
işleme
7e9663d23e
2 değiştirilmiş dosya ile 74 ekleme ve 7 silme
  1. 73 6
      pages/index/shop/confirmOrder.vue
  2. 1 1
      pages/order/index.vue

+ 73 - 6
pages/index/shop/confirmOrder.vue

@@ -340,10 +340,12 @@ export default {
 			expectDeliveryTime: '', //预约送达时间
 			expectDeliveryTime: '', //预约送达时间
 			timer: '', //定时器
 			timer: '', //定时器
 			autoSendOrder: 0, //autoSendOrder为1商家自配,0平台配送
 			autoSendOrder: 0, //autoSendOrder为1商家自配,0平台配送
-			reservationOpenFlag: 0 //1预约,0不预约
+			reservationOpenFlag: 0, //1预约,0不预约
+			status: null
 		}
 		}
 	},
 	},
 	onLoad(option) {
 	onLoad(option) {
+		console.log(option, '256')
 		// #ifdef APP
 		// #ifdef APP
 		this.openLists = [
 		this.openLists = [
 			{
 			{
@@ -401,6 +403,14 @@ export default {
 		// #endif
 		// #endif
 
 
 		this.shopId = option.shopId
 		this.shopId = option.shopId
+		this.orderType = option.orderType
+		if (option.orderId) {
+			this.orderId = option.orderId
+		}
+
+		if (option.status) {
+			this.status = option.status
+		}
 		// #ifndef H5
 		// #ifndef H5
 		uni.getLocation({
 		uni.getLocation({
 			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
 			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
@@ -423,11 +433,6 @@ export default {
 		this.getShopDet(this.shopId)
 		this.getShopDet(this.shopId)
 		// #endif
 		// #endif
 
 
-		this.orderType = option.orderType
-		if (option.orderId) {
-			this.orderId = option.orderId
-		}
-
 		uni.showLoading({
 		uni.showLoading({
 			title: '加载中...',
 			title: '加载中...',
 			mask: true // 是否显示透明蒙层,防止触摸穿透
 			mask: true // 是否显示透明蒙层,防止触摸穿透
@@ -966,6 +971,12 @@ export default {
 			})
 			})
 			this.paotuiMoney = 0
 			this.paotuiMoney = 0
 			this.totalPrice1 = 0
 			this.totalPrice1 = 0
+
+			if (this.status == 0) {
+				console.log(6666)
+				this.payContinue()
+				return
+			}
 			let data = {
 			let data = {
 				shopId: this.shopId,
 				shopId: this.shopId,
 				status: 1,
 				status: 1,
@@ -973,6 +984,7 @@ export default {
 				limit: 1000
 				limit: 1000
 				// orderType: this.orderType
 				// orderType: this.orderType
 			}
 			}
+			console.log(data)
 			this.$Request.get('/app/order/selectAllOrderList', data).then((res) => {
 			this.$Request.get('/app/order/selectAllOrderList', data).then((res) => {
 				console.log(res)
 				console.log(res)
 				uni.hideLoading()
 				uni.hideLoading()
@@ -1021,6 +1033,61 @@ export default {
 				uni.hideLoading()
 				uni.hideLoading()
 			})
 			})
 		},
 		},
+		payContinue() {
+			let data = {
+				orderId: this.orderId,
+				page: 1,
+				limit: 1000
+			}
+			console.log(data)
+			this.$Request.get('/app/order/selectOrder', data).then((res) => {
+				console.log(res)
+				uni.hideLoading()
+				if (res.code == 0 && res.data.pageUtils.list.length) {
+					this.GoodsorderId = res.data.pageUtils.list[0].orderId
+					this.dataList = res.data.pageUtils.list[0]
+
+					if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
+						this.dataList.orderGoodsList[0].forEach((res) => {
+							res.goodsPicture = res.goodsPicture.split(',')
+							this.dabaoMoney += res.goodsPack * res.goodsNum
+							this.goodsMoney += res.goodsPrice * res.goodsNum
+							this.goodsMoney = parseFloat(this.goodsMoney + this.dabaoMoney)
+						})
+						this.goodsList = this.dataList.orderGoodsList[0]
+					}
+					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) {
+						// 判断商品金额是否大于最低减免配送费金额
+						console.log(this.goodsMoney, '商品总金额', res, this.dataList.exemptMinMoney)
+						if (Number(this.goodsMoney) >= Number(this.dataList.exemptMinMoney)) {
+							this.paotuiMoney = 0
+						} else {
+							this.paotuiMoney = this.dataList.errandMoney
+						}
+					}
+
+					this.totalPrice = res.data.money
+					if (this.orderType == 2) {
+						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney)).toFixed(2)
+					} else {
+						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
+					}
+
+					// console.log(this.dataList)
+					this.getCouponList()
+					this.getHuoList()
+					this.detCoupon()
+					this.getDistance()
+				}
+				// 加载提示关闭
+				uni.hideLoading()
+			})
+		},
 		selectWay(item) {
 		selectWay(item) {
 			this.openWay = item.id
 			this.openWay = item.id
 		},
 		},

+ 1 - 1
pages/order/index.vue

@@ -962,7 +962,7 @@ export default {
 		}, 1000),
 		}, 1000),
 		goPay(item) {
 		goPay(item) {
 			uni.navigateTo({
 			uni.navigateTo({
-				url: '/pages/index/shop/confirmOrder?shopId=' + item.shopId + '&orderType=' + item.orderType
+				url: `/pages/index/shop/confirmOrder?shopId=${item.shopId}&orderType=${item.orderType}&orderId=${item.orderId}&status=${item.status}`
 			})
 			})
 		}
 		}
 	},
 	},