Authored by TaoHuang

fix order bug

... ... @@ -19,6 +19,8 @@
<div class="coupon-time">{{item.coupon_validity}}</div>
</div>
<Check class="check" :value="item.selected === 'Y'"></Check>
<div class="time-up" v-if="item.is_expired_soon === 'Y'"></div>
</div>
</div>
</slot>
... ... @@ -115,6 +117,7 @@ export default {
align-items: center;
background: url(~statics/image/order/bg@3x.png) no-repeat;
background-size: cover;
position: relative;
}
.check {
... ... @@ -179,4 +182,15 @@ export default {
font-size: 22px;
color: #999;
}
.time-up {
background: url(~statics/image/coupon/time-up@3x.png) no-repeat;
background-size: cover;
position: absolute;
top: 0;
right: 0;
width: 80px;
height: 80px;
}
</style>
... ...
... ... @@ -143,7 +143,7 @@ export default {
compute() {
return this.computeOrder({
skup: this.productDetail.skup,
addressId: this.address.address_id,
addressId: this.address?.address_id,
couponCode: get(this.orderDetail, 'recommendedCouponInfo.coupon_code', ''),
promotionId: get(this.orderDetail, 'promotionTips.promotionIds', '')
}).then(result => {
... ...
... ... @@ -82,7 +82,7 @@ export default {
},
compute() {
return this.fetchOrderPrice({
address_id: this.address.address_id,
address_id: this.address?.address_id,
num: this.num,
price: this.price,
storage_id: this.storageId,
... ...
... ... @@ -20,6 +20,10 @@ export const UserType = {
buy: 'buy'
};
const COUPON_TYPE = {
HUO_DONG: 100
};
export default function() {
return {
namespaced: true,
... ... @@ -97,6 +101,15 @@ export default function() {
state.orderDetail.recommendedCouponInfo.coupon_code =
filter(get(state.orderDetail, 'couponList', []), { selected: 'Y' }).map(i => i.coupon_code).join(',');
// 清除促消活动
if (item.coupon_type === COUPON_TYPE.HUO_DONG) {
get(state.orderDetail, 'promotionList', []).forEach(i => {
i.selected = 'N';
});
state.orderDetail.promotionTips.promotionIds = '';
}
}
},
[Types.CHANGE_SELECT_PROMOTION](state, { promotionId }) {
... ... @@ -117,6 +130,14 @@ export default function() {
});
item.selected = 'Y';
state.orderDetail.promotionTips.promotionIds = promotionId;
// 清除活动优惠券
get(state.orderDetail, 'couponList', []).filter(i => i.coupon_type === COUPON_TYPE.HUO_DONG).forEach(i => {
i.selected = 'N';
});
state.orderDetail.recommendedCouponInfo.coupon_code =
filter(get(state.orderDetail, 'couponList', []), { selected: 'Y' }).map(i => i.coupon_code).join(',');
}
}
... ...