mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 18:26:38 +08:00
Order confirm page refined
This commit is contained in:
parent
d6d51f9f5d
commit
cd45fca6c0
@ -52,7 +52,7 @@
|
||||
<div class="rc-userbottom">
|
||||
<p>¥{{ item.productPrice }}</p>
|
||||
<p>X{{ item.buyCount }}</p>
|
||||
<p class="price">¥{{ item.productPrice }}</p>
|
||||
<p class="price">¥{{ item.productPrice * item.buyCount }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -295,6 +295,7 @@ export default {
|
||||
break;
|
||||
case 3: //Limited product % discount
|
||||
case 4: //% discount
|
||||
debugger;
|
||||
total = total + (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount;
|
||||
this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount);
|
||||
this.discountedItemIndex = tmpCounter;
|
||||
@ -328,16 +329,68 @@ export default {
|
||||
methods: {
|
||||
...mapMutations(["checkIsLogin"]),
|
||||
wholeOrderDiscount(){
|
||||
//TODO
|
||||
this.discountedItemIndex = 0;
|
||||
if(this.curCoupon.minPrice && this.curCoupon.minPrice > this.sumPrice) {
|
||||
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0)
|
||||
if(this.curCoupon.couponAmount && this.curCoupon.couponAmount>0) {
|
||||
this.discountAmount = this.curCoupon.discount;
|
||||
return this.sumPrice - this.curCoupon.couponAmount;
|
||||
else
|
||||
return 0;
|
||||
} else if(this.curCoupon.discount && this.curCoupon.discount>0) {
|
||||
this.discountAmount = this.sumPrice*this.curCoupon.discount;
|
||||
return this.sumPrice * (1-this.curCoupon.discount);
|
||||
}
|
||||
}
|
||||
},
|
||||
qualifiedProductDiscount(){
|
||||
//TODO
|
||||
this.discountedItemIndex = 0;
|
||||
let tmpCounter = 0 ;
|
||||
|
||||
//Sort items by items amount
|
||||
|
||||
//Sort items by items amount end
|
||||
|
||||
for(let itemInCart of this.goldmedal) {
|
||||
if((!this.curCoupon.productCodes || this.curCoupon.productCodes.indexOf(itemInCart.productCode)>-1) && !couponUsed) {
|
||||
if(this.curCoupon.minQuantity && this.curCoupon.minQuantity>itemInCart.buyCount) {
|
||||
//Check minQuantity
|
||||
total+=(itemInCart.buyCount * itemInCart.productPrice);
|
||||
} else if(this.curCoupon.minPrice && this.curCoupon.minPrice > (itemInCart.buyCount * itemInCart.productPrice)) {
|
||||
//Check minPrice
|
||||
total+=(itemInCart.buyCount * itemInCart.productPrice);
|
||||
} else {
|
||||
//Into coupon discount calculation
|
||||
switch(this.curCoupon.couponTypeId) {
|
||||
case 1: //Amount deduct
|
||||
total = total + (itemInCart.productPrice * itemInCart.buyCount - this.curCoupon.couponAmount);
|
||||
this.discountAmount = this.curCoupon.couponAmount;
|
||||
this.discountedItemIndex = tmpCounter;
|
||||
couponUsed=true;
|
||||
break;
|
||||
case 2: //Amount deduct with minPrice restriction
|
||||
case 6:
|
||||
total = total + (itemInCart.productPrice * itemInCart.buyCount) - this.curCoupon.couponAmount;
|
||||
this.discountAmount = this.curCoupon.couponAmount;
|
||||
this.discountedItemIndex = tmpCounter;
|
||||
couponUsed=true;
|
||||
break;
|
||||
case 3: //Limited product % discount
|
||||
case 4: //% discount
|
||||
total = total + (itemInCart.productPrice * itemInCart.buyCount) * this.curCoupon.discount;
|
||||
this.discountAmount = (itemInCart.productPrice * itemInCart.buyCount) * ( 1 - this.curCoupon.discount);
|
||||
this.discountedItemIndex = tmpCounter;
|
||||
couponUsed=true;
|
||||
break;
|
||||
default:
|
||||
total += itemInCart.productPrice * itemInCart.buyCount;
|
||||
break;
|
||||
}
|
||||
//Into coupon discount calculation end
|
||||
}
|
||||
} else {
|
||||
total += itemInCart.productPrice * itemInCart.buyCount;
|
||||
}
|
||||
tmpCounter++;
|
||||
}
|
||||
},
|
||||
async getAddressList() {
|
||||
let memberId = JSON.parse(localStorage.getItem("userInfo")).data.id;
|
||||
|
Loading…
Reference in New Issue
Block a user