|
@@ -56,7 +56,11 @@
|
|
|
<div class="module-com discount-wrap" v-if="!$util.isEmpty(discountArr)">
|
|
<div class="module-com discount-wrap" v-if="!$util.isEmpty(discountArr)">
|
|
|
<div class="module-tit">可选优惠</div>
|
|
<div class="module-tit">可选优惠</div>
|
|
|
<div class="module-det">
|
|
<div class="module-det">
|
|
|
- <app-coupon-sel ref="couponSel" :price="totalPrice" :discountArr="['member', 'coupon']" />
|
|
|
|
|
|
|
+ <app-coupon-sel
|
|
|
|
|
+ ref="couponSel"
|
|
|
|
|
+ @calcDiscount="calcDiscount"
|
|
|
|
|
+ :discountArr="['member', 'coupon']"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<app-trademark />
|
|
<app-trademark />
|
|
@@ -147,20 +151,24 @@ export default {
|
|
|
//显示的距离
|
|
//显示的距离
|
|
|
showDistance: 0,
|
|
showDistance: 0,
|
|
|
totalPrice: 0,
|
|
totalPrice: 0,
|
|
|
- mayPayAmount: 0
|
|
|
|
|
|
|
+ memberDiscount: 1,
|
|
|
|
|
+ couponDiscountAmount: 0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {},
|
|
mounted() {},
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters({ orderShop: "getOrderShop" }),
|
|
...mapGetters({ orderShop: "getOrderShop" }),
|
|
|
- ...mapGetters({ shopUser: "getShopUser" })
|
|
|
|
|
|
|
+ ...mapGetters({ shopUser: "getShopUser" }),
|
|
|
|
|
+ mayPayAmount:function(){
|
|
|
|
|
+ let price = (this.goodsInfo.price * this.goodsInfo.buyNum + this.freightPrice)/this.memberDiscount + this.couponDiscountAmount;
|
|
|
|
|
+ return price.toFixed(2);
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
//运费变化则总金额和应付金额变化
|
|
//运费变化则总金额和应付金额变化
|
|
|
freightPrice(newVal) {
|
|
freightPrice(newVal) {
|
|
|
let price = this.goodsInfo.price * this.goodsInfo.buyNum + newVal;
|
|
let price = this.goodsInfo.price * this.goodsInfo.buyNum + newVal;
|
|
|
this.totalPrice = price.toFixed(2);
|
|
this.totalPrice = price.toFixed(2);
|
|
|
- this.mayPayAmount = price.toFixed(2);
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
@@ -188,13 +196,17 @@ export default {
|
|
|
this.goodsInfo = goodsInfo;
|
|
this.goodsInfo = goodsInfo;
|
|
|
|
|
|
|
|
this.totalPrice = goodsInfo.price * this.option.goodsNum;
|
|
this.totalPrice = goodsInfo.price * this.option.goodsNum;
|
|
|
- this.mayPayAmount = this.totalPrice;
|
|
|
|
|
|
|
+ //this.mayPayAmount = this.totalPrice;
|
|
|
|
|
|
|
|
// 初始化上个页面带入的值
|
|
// 初始化上个页面带入的值
|
|
|
Object.keys(this.form).forEach((i, index) => {
|
|
Object.keys(this.form).forEach((i, index) => {
|
|
|
this.form[i] = this.option[i];
|
|
this.form[i] = this.option[i];
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ calcDiscount(discountData) {
|
|
|
|
|
+ console.log("执行了方法");
|
|
|
|
|
+ this.memberDiscount = 0.8
|
|
|
|
|
+ },
|
|
|
// 生成订单
|
|
// 生成订单
|
|
|
createOrderFn() {
|
|
createOrderFn() {
|
|
|
let addForm = {};
|
|
let addForm = {};
|