优惠券相关更新
This commit is contained in:
@@ -31,9 +31,15 @@
|
||||
<!-- 先支付后下单 -->
|
||||
<orderInfoBefore ref="orderInfoBefore" :listinfo="listinfo" v-else></orderInfoBefore>
|
||||
<!-- 充值免单 -->
|
||||
<rechargeFree v-if="listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')" ref="rechargeFree" :freeDisabled="freeDisabled" :payAmount="listinfo.payAmount" :freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
||||
<rechargeFree
|
||||
:rechargeFreeChecked="rechargeFreeChecked"
|
||||
v-if="listinfo.freeDingConfig.enable == 1&&(!listinfo.orderInfo.couponInfoList&&listinfo.orderInfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
|
||||
ref="rechargeFree"
|
||||
:freeDisabled="freeDisabled"
|
||||
:payAmount="listinfo.payAmount"
|
||||
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="amountVIP" @changeFree="changeFree"></rechargeFree>
|
||||
|
||||
<paymentMethod ref="paymentMethod" v-if="amountVIP&&listinfo.status == 'unpaid' || listinfo.status == 'paying'" :freeCheck="freeCheck" :amountVIP="amountVIP" @groupChange="groupChange"></paymentMethod>
|
||||
<paymentMethod ref="paymentMethod" :rechargeFreeChecked="rechargeFreeChecked" v-if="amountVIP&&listinfo.status == 'unpaid' || listinfo.status == 'paying'" :freeCheck="freeCheck" :payAmount="listinfo.payAmount" :amountVIP="amountVIP" @groupChange="groupChange"></paymentMethod>
|
||||
|
||||
<view class="fixedview">
|
||||
<view class="flex-between" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||
@@ -126,7 +132,6 @@
|
||||
methods: {
|
||||
|
||||
setPayAmount(data) {
|
||||
console.log(data)
|
||||
// this.changeFree(this.freeDisabled)
|
||||
this.listinfo.payAmount = data.payAmount
|
||||
this.couopnInfo = data;
|
||||
@@ -143,46 +148,49 @@
|
||||
* @param {Object} val
|
||||
*/
|
||||
changeFree ( val ) {
|
||||
this.freeCheck = val;
|
||||
this.rechargeFreeChecked = val
|
||||
if ( this.couopnInfo && val) {
|
||||
if ( this.couopnInfo.isPointsChecked ) {
|
||||
this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.couopnInfo.calcUsablePointsData.pointsNum/this.couopnInfo.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||
}
|
||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
||||
if ( couponList.length > 0) {
|
||||
this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) + couponList[0].discountAmount : this.listinfo.payAmount)
|
||||
}
|
||||
let productList = this.couopnInfo.userCouponInfos.filter(v => v.type == 2);
|
||||
if ( productList .length > 0 ) {
|
||||
productList.map(item=> {
|
||||
|
||||
this.listinfo.payAmount = Number(this.listinfo.payAmount) + item.discountAmount
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
// this.freeCheck = val;
|
||||
this.rechargeFreeChecked = !val
|
||||
|
||||
if ( val ) {
|
||||
|
||||
if ( this.rechargeFreeChecked ) {
|
||||
if ( this.couopnInfo) {
|
||||
if ( this.couopnInfo.isPointsChecked ) {
|
||||
this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.couopnInfo.calcUsablePointsData.pointsNum/this.couopnInfo.calcUsablePointsData.equivalentPoints)).toFixed(2);
|
||||
}
|
||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
||||
if ( couponList.length > 0) {
|
||||
this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) + couponList[0].discountAmount : this.listinfo.payAmount)
|
||||
}
|
||||
let productList = this.couopnInfo.userCouponInfos.filter(v => v.type == 2);
|
||||
if ( productList .length > 0 ) {
|
||||
productList.map(item=> {
|
||||
|
||||
this.listinfo.payAmount = Number(this.listinfo.payAmount) + item.discountAmount
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
this.listinfo.payAmount = (this.listinfo.payAmount*this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
||||
} else {
|
||||
this.couopnInfo.isPointsChecked = false;
|
||||
this.listinfo.payAmount = (this.listinfo.payAmount/this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
|
||||
if ( this.couopnInfo) {
|
||||
|
||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
||||
if ( couponList.length > 0) {
|
||||
this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) - couponList[0].discountAmount : this.listinfo.payAmount)
|
||||
}
|
||||
let productList = this.couopnInfo.userCouponInfos.filter(v => v.type == 2);
|
||||
if ( productList .length > 0 ) {
|
||||
productList.map(item=> {
|
||||
this.listinfo.payAmount = Number(this.listinfo.payAmount) - item.discountAmount
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( this.couopnInfo && !val) {
|
||||
|
||||
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
|
||||
if ( couponList.length > 0) {
|
||||
this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) - couponList[0].discountAmount : this.listinfo.payAmount)
|
||||
}
|
||||
let productList = this.couopnInfo.userCouponInfos.filter(v => v.type == 2);
|
||||
if ( productList .length > 0 ) {
|
||||
productList.map(item=> {
|
||||
this.listinfo.payAmount = Number(this.listinfo.payAmount) - item.discountAmount
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
console.log(this.freeCheck)
|
||||
},
|
||||
saveImage (url) {
|
||||
@@ -359,8 +367,8 @@
|
||||
*/
|
||||
async wechatPay() {
|
||||
let res;
|
||||
console.log(this.freeCheck)
|
||||
if ( !this.freeCheck ) {
|
||||
console.log(this.rechargeFreeChecked)
|
||||
if ( !this.rechargeFreeChecked ) {
|
||||
res = await this.api.orderPay({
|
||||
orderId: this.orderId,
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
Reference in New Issue
Block a user