...
|
...
|
@@ -84,7 +84,7 @@ export default { |
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchPayList', 'fetchPayment', 'computeOrder']),
|
|
|
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchPayList', 'fetchPayment', 'computeOrder', 'buyPayAction']),
|
|
|
...mapOrderMutations([Types.CHANGE_SELECT_COUPON_LIST, Types.CHANGE_SELECT_PROMOTION]),
|
|
|
replaceBr(str) {
|
|
|
return str ? str.replace(/\n/g, '<br />') : '';
|
...
|
...
|
@@ -150,17 +150,57 @@ export default { |
|
|
});
|
|
|
},
|
|
|
async onPayAction() {
|
|
|
const vm = this;
|
|
|
|
|
|
await this.compute();
|
|
|
|
|
|
const { data: { orderCode, message } } = await this.buyPayAction({
|
|
|
skup: this.productDetail.skup,
|
|
|
addressId: this.address.address_id,
|
|
|
couponCode: get(this.orderDetail, 'recommendedCouponInfo.coupon_code', ''),
|
|
|
promotionId: get(this.orderDetail, 'promotionTips.promotionIds', '')
|
|
|
});
|
|
|
|
|
|
if (!orderCode) {
|
|
|
this.$createToast({
|
|
|
time: 1500,
|
|
|
txt: message,
|
|
|
type: 'txt'
|
|
|
}).show();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.$createOrderPayType({
|
|
|
orderCode,
|
|
|
price: this.orderDetail.amount,
|
|
|
desc: '金额'
|
|
|
desc: '金额',
|
|
|
onCloseAction() {
|
|
|
vm.onClose(orderCode);
|
|
|
},
|
|
|
onPayAction() {
|
|
|
vm.onPay();
|
|
|
}
|
|
|
}).show();
|
|
|
},
|
|
|
onPay() {
|
|
|
console.log('ok');
|
|
|
},
|
|
|
onClose(orderCode) {
|
|
|
this.$router.push({
|
|
|
name: 'orderDetail',
|
|
|
params: {
|
|
|
owner: UserType.buy,
|
|
|
code: orderCode
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@import '~statics/scss/variable.scss';
|
|
|
|
|
|
.footer {
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
...
|
...
|
|