...
|
...
|
@@ -35,10 +35,11 @@ import { get } from 'lodash'; |
|
|
import { createNamespacedHelpers, mapState } from 'vuex';
|
|
|
|
|
|
const { mapState: mapOrderState, mapActions: mapOrderAction, mapMutations: mapOrderMutations } = createNamespacedHelpers('order/orderConfirm');
|
|
|
const { mapActions: mapSecondActions } = createNamespacedHelpers('second');
|
|
|
|
|
|
export default {
|
|
|
name: 'BuyOrderConfirm',
|
|
|
props: ['productId', 'storageId'],
|
|
|
props: ['productId', 'storageId', 'type', 'skup'],
|
|
|
data() {
|
|
|
return {
|
|
|
isActive: false
|
...
|
...
|
@@ -71,15 +72,26 @@ export default { |
|
|
computed: {
|
|
|
...mapOrderState(['address', 'orderDetail']),
|
|
|
...mapState({
|
|
|
productDetail: state => {
|
|
|
return {
|
|
|
goodImg: get(state.product.selectedProductInfo, 'product.goods_list[0].image_list[0].image_url', ''),
|
|
|
productName: get(state.product.selectedProductInfo, 'product.product_name', ''),
|
|
|
colorName: get(state.product.selectedProductInfo, 'product.goods_list[0].color_name', ''),
|
|
|
sizeName: get(state.product.selectedProductInfo, 'size.size_name', ''),
|
|
|
goodPrice: get(state.product.selectedProductInfo, 'size.least_price', ''),
|
|
|
skup: get(state.product.selectedProductInfo, 'size.skup', '')
|
|
|
};
|
|
|
productDetail(state) {
|
|
|
if (this.type === 'second') {
|
|
|
return {
|
|
|
goodImg: get(state.second.info, 'imageList[0]', ''),
|
|
|
productName: get(state.second.info, 'productName', ''),
|
|
|
colorName: get(state.second.info, 'colorName', ''),
|
|
|
sizeName: get(state.second.info, 'sizeName', ''),
|
|
|
goodPrice: get(state.second.info, 'price', ''),
|
|
|
skup: this.skup
|
|
|
};
|
|
|
} else {
|
|
|
return {
|
|
|
goodImg: get(state.product.selectedProductInfo, 'product.goods_list[0].image_list[0].image_url', ''),
|
|
|
productName: get(state.product.selectedProductInfo, 'product.product_name', ''),
|
|
|
colorName: get(state.product.selectedProductInfo, 'product.goods_list[0].color_name', ''),
|
|
|
sizeName: get(state.product.selectedProductInfo, 'size.size_name', ''),
|
|
|
goodPrice: get(state.product.selectedProductInfo, 'size.least_price', ''),
|
|
|
skup: get(state.product.selectedProductInfo, 'size.skup', '')
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
}),
|
|
|
couponList() {
|
...
|
...
|
@@ -109,6 +121,7 @@ export default { |
|
|
methods: {
|
|
|
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchPayList', 'fetchPayment', 'computeOrder', 'buyPayAction']),
|
|
|
...mapOrderMutations([Types.CHANGE_SELECT_COUPON_LIST, Types.CHANGE_SELECT_PROMOTION, Types.CLEAR_BUY_STATUS]),
|
|
|
...mapSecondActions(['fetchDetailById']),
|
|
|
replaceBr(str) {
|
|
|
return str ? str.replace(/\n/g, '<br />') : '';
|
|
|
},
|
...
|
...
|
@@ -273,10 +286,14 @@ export default { |
|
|
async init() {
|
|
|
this.fetchOrderAddress({ tabType: UserType.buy });
|
|
|
|
|
|
await this.$store.dispatch('product/getSelectedTradeProduct', {
|
|
|
productId: this.productId,
|
|
|
storageId: this.storageId
|
|
|
});
|
|
|
if (this.type === 'second') {
|
|
|
await this.fetchDetailById({ skup: this.skup });
|
|
|
} else {
|
|
|
await this.$store.dispatch('product/getSelectedTradeProduct', {
|
|
|
productId: this.productId,
|
|
|
storageId: this.storageId
|
|
|
});
|
|
|
}
|
|
|
|
|
|
let user = await this.$sdk.getUser();
|
|
|
|
...
|
...
|
|