|
@@ -35,10 +35,11 @@ import { get } from 'lodash'; |
|
@@ -35,10 +35,11 @@ import { get } from 'lodash'; |
35
|
import { createNamespacedHelpers, mapState } from 'vuex';
|
35
|
import { createNamespacedHelpers, mapState } from 'vuex';
|
36
|
|
36
|
|
37
|
const { mapState: mapOrderState, mapActions: mapOrderAction, mapMutations: mapOrderMutations } = createNamespacedHelpers('order/orderConfirm');
|
37
|
const { mapState: mapOrderState, mapActions: mapOrderAction, mapMutations: mapOrderMutations } = createNamespacedHelpers('order/orderConfirm');
|
|
|
38
|
+const { mapActions: mapSecondActions } = createNamespacedHelpers('second');
|
38
|
|
39
|
|
39
|
export default {
|
40
|
export default {
|
40
|
name: 'BuyOrderConfirm',
|
41
|
name: 'BuyOrderConfirm',
|
41
|
- props: ['productId', 'storageId'],
|
42
|
+ props: ['productId', 'storageId', 'type', 'skup'],
|
42
|
data() {
|
43
|
data() {
|
43
|
return {
|
44
|
return {
|
44
|
isActive: false
|
45
|
isActive: false
|
|
@@ -71,15 +72,26 @@ export default { |
|
@@ -71,15 +72,26 @@ export default { |
71
|
computed: {
|
72
|
computed: {
|
72
|
...mapOrderState(['address', 'orderDetail']),
|
73
|
...mapOrderState(['address', 'orderDetail']),
|
73
|
...mapState({
|
74
|
...mapState({
|
74
|
- productDetail: state => {
|
|
|
75
|
- return {
|
|
|
76
|
- goodImg: get(state.product.selectedProductInfo, 'product.goods_list[0].image_list[0].image_url', ''),
|
|
|
77
|
- productName: get(state.product.selectedProductInfo, 'product.product_name', ''),
|
|
|
78
|
- colorName: get(state.product.selectedProductInfo, 'product.goods_list[0].color_name', ''),
|
|
|
79
|
- sizeName: get(state.product.selectedProductInfo, 'size.size_name', ''),
|
|
|
80
|
- goodPrice: get(state.product.selectedProductInfo, 'size.least_price', ''),
|
|
|
81
|
- skup: get(state.product.selectedProductInfo, 'size.skup', '')
|
|
|
82
|
- };
|
75
|
+ productDetail(state) {
|
|
|
76
|
+ if (this.type === 'second') {
|
|
|
77
|
+ return {
|
|
|
78
|
+ goodImg: get(state.second.info, 'imageList[0]', ''),
|
|
|
79
|
+ productName: get(state.second.info, 'productName', ''),
|
|
|
80
|
+ colorName: get(state.second.info, 'colorName', ''),
|
|
|
81
|
+ sizeName: get(state.second.info, 'sizeName', ''),
|
|
|
82
|
+ goodPrice: get(state.second.info, 'price', ''),
|
|
|
83
|
+ skup: this.skup
|
|
|
84
|
+ };
|
|
|
85
|
+ } else {
|
|
|
86
|
+ return {
|
|
|
87
|
+ goodImg: get(state.product.selectedProductInfo, 'product.goods_list[0].image_list[0].image_url', ''),
|
|
|
88
|
+ productName: get(state.product.selectedProductInfo, 'product.product_name', ''),
|
|
|
89
|
+ colorName: get(state.product.selectedProductInfo, 'product.goods_list[0].color_name', ''),
|
|
|
90
|
+ sizeName: get(state.product.selectedProductInfo, 'size.size_name', ''),
|
|
|
91
|
+ goodPrice: get(state.product.selectedProductInfo, 'size.least_price', ''),
|
|
|
92
|
+ skup: get(state.product.selectedProductInfo, 'size.skup', '')
|
|
|
93
|
+ };
|
|
|
94
|
+ }
|
83
|
}
|
95
|
}
|
84
|
}),
|
96
|
}),
|
85
|
couponList() {
|
97
|
couponList() {
|
|
@@ -109,6 +121,7 @@ export default { |
|
@@ -109,6 +121,7 @@ export default { |
109
|
methods: {
|
121
|
methods: {
|
110
|
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchPayList', 'fetchPayment', 'computeOrder', 'buyPayAction']),
|
122
|
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchPayList', 'fetchPayment', 'computeOrder', 'buyPayAction']),
|
111
|
...mapOrderMutations([Types.CHANGE_SELECT_COUPON_LIST, Types.CHANGE_SELECT_PROMOTION, Types.CLEAR_BUY_STATUS]),
|
123
|
...mapOrderMutations([Types.CHANGE_SELECT_COUPON_LIST, Types.CHANGE_SELECT_PROMOTION, Types.CLEAR_BUY_STATUS]),
|
|
|
124
|
+ ...mapSecondActions(['fetchDetailById']),
|
112
|
replaceBr(str) {
|
125
|
replaceBr(str) {
|
113
|
return str ? str.replace(/\n/g, '<br />') : '';
|
126
|
return str ? str.replace(/\n/g, '<br />') : '';
|
114
|
},
|
127
|
},
|
|
@@ -273,10 +286,14 @@ export default { |
|
@@ -273,10 +286,14 @@ export default { |
273
|
async init() {
|
286
|
async init() {
|
274
|
this.fetchOrderAddress({ tabType: UserType.buy });
|
287
|
this.fetchOrderAddress({ tabType: UserType.buy });
|
275
|
|
288
|
|
276
|
- await this.$store.dispatch('product/getSelectedTradeProduct', {
|
|
|
277
|
- productId: this.productId,
|
|
|
278
|
- storageId: this.storageId
|
|
|
279
|
- });
|
289
|
+ if (this.type === 'second') {
|
|
|
290
|
+ await this.fetchDetailById({ skup: this.skup });
|
|
|
291
|
+ } else {
|
|
|
292
|
+ await this.$store.dispatch('product/getSelectedTradeProduct', {
|
|
|
293
|
+ productId: this.productId,
|
|
|
294
|
+ storageId: this.storageId
|
|
|
295
|
+ });
|
|
|
296
|
+ }
|
280
|
|
297
|
|
281
|
let user = await this.$sdk.getUser();
|
298
|
let user = await this.$sdk.getUser();
|
282
|
|
299
|
|