Order displaying & coupon calculating issue fixed

This commit is contained in:
Leung 2022-02-01 00:22:44 +08:00
parent 44766ef791
commit d1995c9238
3 changed files with 13 additions and 8 deletions

View File

@ -287,12 +287,13 @@ export default {
checkResult = false;
}
if(checkResult) {
this.discountedProductCode = this.goldmedal[0].productCode
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0) {
this.discountAmount = this.curCoupon.couponAmount;
return this.sumPrice - this.curCoupon.couponAmount;
} else if(this.curCoupon.discount && this.curCoupon.discount>0) {
this.discountAmount = this.sumPrice*(1-this.curCoupon.discount);
return this.sumPrice * this.curCoupon.discount;
this.discountAmount = this.sumPrice*this.curCoupon.discount;
return this.sumPrice * ( 1 - this.curCoupon.discount );
}
} else {
return this.sumPrice;
@ -330,7 +331,7 @@ export default {
break;
case 3: //Limited product % discount
case 4: //% discount
total = total + (itemInCart.productPrice * itemInCart.buyCount) * (1-this.curCoupon.discount);
total = total + (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount );
this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount;
this.discountedProductCode = itemInCart.productCode;
couponUsed=true;
@ -536,6 +537,8 @@ export default {
addressDetailInfo: orderAddress[0].detailAddress,
},
};
console.log(this.curCoupon,item.productCode,this.discountedProductCode);
debugger;
if(this.curCoupon.couponId && item.productCode == this.discountedProductCode) {
oneProduct.couponId = this.curCoupon.couponId;
oneProduct.couponTypeId = this.curCoupon.couponTypeId;

View File

@ -317,8 +317,8 @@ export default {
this.obligation=[];
this.receiving=[];
this.pending=[];
for (let i = (this.goldmedal.length-1); i >= 0; i--) {
this.useralllist.unshift(this.goldmedal[i].orderDetailList[0]);
for (let i = 0; i < this.goldmedal.length; i++) {
this.useralllist.push(this.goldmedal[i].orderDetailList[0]);
this.alllist.push(this.goldmedal[i].orderDetailList[0])
this.allmessage.push(this.goldmedal[i].orderDetailList[0])
if(this.goldmedal[i].status==0){
@ -330,7 +330,7 @@ export default {
this.pending.push(this.goldmedal[i].orderDetailList[0]);
}
}
for (let i = (this.goldmedal.length-1); i >0; i--) {
for (let i = 0; i < this.goldmedal.length; i++) {
this.useralllist[i].orderNumber = this.goldmedal[i].orderNumber;
this.useralllist[i].status = this.goldmedal[i].status;
this.useralllist[i].addressUserName = this.goldmedal[i].addressUserName;

View File

@ -12,7 +12,8 @@ Vue.prototype.formatConversion = function (te){
var h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
//var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
var timedate = y + '-' + m + '-' + d;
return timedate;
}else{
var time = new Date(te);
@ -22,7 +23,8 @@ Vue.prototype.formatConversion = function (te){
var h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
var mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
var s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
//var timedate = y + '-' + m + '-' + d + ' ' + h + ':' + mm + ':' + s;
var timedate = y + '-' + m + '-' + d;
return timedate;
}
}