From d1995c9238822ccae0ef3d64f3c08a35c6d152c1 Mon Sep 17 00:00:00 2001 From: Leung Date: Tue, 1 Feb 2022 00:22:44 +0800 Subject: [PATCH] Order displaying & coupon calculating issue fixed --- rc-busness/pages/personal/settlement.vue | 9 ++++++--- rc-busness/pages/personal/useraddress.vue | 6 +++--- rc-busness/static/js/date.js | 6 ++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/rc-busness/pages/personal/settlement.vue b/rc-busness/pages/personal/settlement.vue index 1288f863..870ef892 100644 --- a/rc-busness/pages/personal/settlement.vue +++ b/rc-busness/pages/personal/settlement.vue @@ -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; diff --git a/rc-busness/pages/personal/useraddress.vue b/rc-busness/pages/personal/useraddress.vue index d5aeac27..60c50fb7 100644 --- a/rc-busness/pages/personal/useraddress.vue +++ b/rc-busness/pages/personal/useraddress.vue @@ -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; diff --git a/rc-busness/static/js/date.js b/rc-busness/static/js/date.js index 5b05c6ac..dcfac30f 100644 --- a/rc-busness/static/js/date.js +++ b/rc-busness/static/js/date.js @@ -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; } } \ No newline at end of file