1410417013 пре 7 месеци
родитељ
комит
1c49a435ab
2 измењених фајлова са 73 додато и 17 уклоњено
  1. 27 9
      pages/index/shop/confirmOrder.vue
  2. 46 8
      pages/index/shop/payOrder.vue

+ 27 - 9
pages/index/shop/confirmOrder.vue

@@ -652,7 +652,7 @@ export default {
 			})
 		},
 		bindMultiPickerColumnChange: function (e) {
-			console.log(e)
+			console.log(e,'e')
 			console.log('第几列发生变化', e.detail.column)
 			console.log('选择第几个', e.detail.value)
 			let c = e.detail.column
@@ -1087,10 +1087,10 @@ export default {
 
 					this.totalPrice = res.data.money
 
-					console.log(this.totalPrice)
-					console.log(this.paotuiMoney)
-					console.log(this.dabaoMoney)
-					console.log(this.address.insideDeliveryFee)
+					console.log(this.totalPrice,'total')
+					console.log(this.paotuiMoney,'paotui')
+					console.log(this.dabaoMoney,'dabao')
+					console.log(this.address.insideDeliveryFee,'free')
 
 					if (this.orderType == 2) {
 						this.totalPrice1 = parseFloat(
@@ -1099,6 +1099,15 @@ export default {
 					} else {
 						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 					}
+					let totalMoney = parseFloat(
+						this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
+					).toFixed(2)
+					
+					if (totalMoney <= 0) {
+						this.totalPrice1 = 0.01
+					} else {
+						this.totalPrice1 = totalMoney
+					}
 
 					// console.log(this.dataList)
 					this.getCouponList()
@@ -1116,9 +1125,9 @@ export default {
 				page: 1,
 				limit: 1000
 			}
-			console.log(data)
+			console.log(data,'select11')
 			this.$Request.get('/app/order/selectOrder', data).then((res) => {
-				console.log(res)
+				console.log(res,'select')
 				uni.hideLoading()
 				if (res.code == 0 && res.data.pageUtils.list.length) {
 					this.GoodsorderId = res.data.pageUtils.list[0].orderId
@@ -1155,6 +1164,15 @@ export default {
 					} else {
 						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 					}
+					let totalMoney = parseFloat(
+						this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
+					).toFixed(2)
+					
+					if (totalMoney <= 0) {
+						this.totalPrice1 = 0.01
+					} else {
+						this.totalPrice1 = totalMoney
+					}
 
 					// console.log(this.dataList)
 					this.getCouponList()
@@ -1295,7 +1313,7 @@ export default {
 							idCard: this.idcard1
 						}
 
-						console.log(data)
+						console.log(data,'xinjiu')
 						if (res.enable) {
 							console.log('xin')
 							this.newPay(data)
@@ -1317,7 +1335,7 @@ export default {
 					orderType: this.orderType
 				}
 				this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
-					console.log(res)
+					console.log(res,'wxaa')
 					this.showpay = false
 					if (res.code == 0) {
 						this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data))

+ 46 - 8
pages/index/shop/payOrder.vue

@@ -104,6 +104,10 @@
 				<view>特殊地址跑腿费</view>
 				<view class="tosend_header_do_ri">¥{{ address.insideDeliveryFee }}</view>
 			</view>
+			<view class="tosend_header_do justify-between" v-if="Vipmoney.canReduceFlag=='1'">
+				<view>会员立减</view>
+				<view class="tosend_header_do_ri">- ¥{{ Vipmoney.reduceAmount }}</view>
+			</view>
 			<view class="tosend_header_do justify-between do_bot" @click="isShow">
 				<view>优惠券</view>
 				<view class="tosend_header_do_ri" v-if="coupon">- ¥{{ coupon.money }}</view>
@@ -341,6 +345,11 @@ export default {
 			coupon: '',
 			shopDet: '',
 			huodong: '', //选择的活动信息
+			Vipmoney:{
+				canReduceFlag:'0',
+				reduceAmount:0,
+				vipReduceDesc:''
+			},//会员立减金额
 			couponList: [],
 			huoList: [], //可用活动
 			orderType: 2, //1表示到店自取 2表示外卖配送
@@ -425,7 +434,9 @@ export default {
 		}
 	},
 	onShow() {
+		this.getvipMoney()
 		this.getMsgData()
+		
 		this.addressId = this.addressId ? this.addressId : uni.getStorageSync('addressId')
 		if (this.addressId) {
 			this.getAddressDet(this.addressId)
@@ -448,6 +459,16 @@ export default {
 		}
 	},
 	methods: {
+		//获取会员立减金额
+		getvipMoney() {
+			var shopId =this.shopId
+			this.$Request.get(`/app/vip/get-can-reduce/${shopId}`).then((res) => {
+				console.log(res, '会员立减')
+				if (res.code == 0 && res.data) {
+					this.Vipmoney=res.data
+				}
+			})
+		},
 		getIntegralRules() {
 			let data = {
 				money: this.totalPrice1
@@ -773,7 +794,7 @@ export default {
 			}
 			if (this.coupon) {
 				let totalMoney = parseFloat(
-					this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0).toFixed(2)
+					this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
 				)
 				if (totalMoney <= 0) {
 					this.totalPrice1 = 0.01
@@ -784,7 +805,16 @@ export default {
 
 			if (this.huodong) {
 				let totalMoney = parseFloat(
-					this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0).toFixed(2)
+					this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
+				)
+				if (totalMoney <= 0) {
+					this.totalPrice1 = 0.01
+				} else {
+					this.totalPrice1 = totalMoney
+				}
+			}if (this.Vipmoney.canReduceFlag=='1') {
+				let totalMoney = parseFloat(
+					this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0).toFixed(2)
 				)
 				if (totalMoney <= 0) {
 					this.totalPrice1 = 0.01
@@ -811,7 +841,7 @@ export default {
 			} else {
 				this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 			}
-			let totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)).toFixed(2)
+			let totalMoney = parseFloat(this.totalPrice1 - (this.coupon.money ? this.coupon.money : 0) - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
 
 			if (totalMoney <= 0) {
 				this.totalPrice1 = 0.01
@@ -841,7 +871,7 @@ export default {
 				this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 			}
 
-			let totalMoney = parseFloat(this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)).toFixed(2)
+			let totalMoney = parseFloat(this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)).toFixed(2)
 
 			if (totalMoney <= 0) {
 				this.totalPrice1 = 0.01
@@ -875,7 +905,7 @@ export default {
 							}
 
 							let totalMoney = parseFloat(
-								this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)
+								this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
 							).toFixed(2)
 
 							if (totalMoney <= 0) {
@@ -919,9 +949,9 @@ export default {
 							}
 
 							let totalMoney = parseFloat(
-								this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)
+								this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
 							).toFixed(2)
-
+							
 							if (totalMoney <= 0) {
 								this.totalPrice1 = 0.01
 							} else {
@@ -997,7 +1027,15 @@ export default {
 					} else {
 						this.totalPrice1 = this.totalPrice + this.dabaoMoney
 					}
-
+					let totalMoney = parseFloat(
+						this.totalPrice1 - (this.huodong.discountAmount ? this.huodong.discountAmount : 0) - (this.coupon.money ? this.coupon.money : 0)-(this.Vipmoney.reduceAmount?this.Vipmoney.reduceAmount:0)
+					).toFixed(2) 
+					
+					if (totalMoney <= 0) {
+						this.totalPrice1 = 0.01
+					} else {
+						this.totalPrice1 = totalMoney
+					}
 					console.log(this.dataList)
 
 					this.getCouponList()