mutations.js
2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import * as Types from './types';
export default {
[Types.FETCH_ORDER_PRODUCT_REQUEST](state) {
state.productInfo = {};
state.fetchingPro = true;
},
[Types.FETCH_ORDER_PRODUCT_FAILED](state) {
state.fetchingPro = false;
},
/**
* 获取商品信息成功
* @param state
* @param order
* @param refresh
*/
[Types.FETCH_ORDER_PRODUCT_SUCCESS](state, {order, refresh}) {
state.fetchingPro = false;
if (order.productInfo && state.productInfo.productId !== order.productInfo.productId || refresh) {
state.productInfo = order.productInfo || state.productInfo;
}
if (refresh) {
state.skcs = order.data;
} else if (order.data) {
state.skcs = state.skcs.concat(order.data);
}
},
[Types.FETCH_NOENTRY_ORDER_PRODUCT_REQUEST](state) {
state.noEntryOrderInfo = {};
state.fetchingOrder = true;
},
[Types.FETCH_NOENTRY_ORDER_PRODUCT_FAILED](state) {
state.fetchingOrder = false;
},
/**
* 获取未入驻商家调价时的商品详情
* @param state
* @param order
*/
[Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS](state, {order}) {
state.fetchingOrder = false;
if (order && order.data) {
state.noEntryOrderInfo = order.data || {};
}
},
[Types.MERGE_CHANGEPRICE_DATA](state, {skc, mergeData}) {
Object.assign(skc, mergeData);
},
[Types.POST_NOSALE_REQUEST](state) {
state.fetchingNoSale = true;
},
[Types.POST_NOSALE_FAILED](state) {
state.fetchingNoSale = false;
},
[Types.POST_NOSALE_SUCCESS](state) {
state.fetchingNoSale = false;
},
[Types.POST_CHANGE_PRICE_REQUEST](state) {
state.fetchingChangePrice = true;
},
[Types.POST_CHANGEPRICE_FAILED](state) {
state.fetchingChangePrice = false;
},
[Types.POST_CHANGEPRICE_SUCCESS](state) {
state.fetchingChangePrice = false;
},
[Types.POST_CALCPRICE_REQUEST](state) {
state.fetchingCalcPrice = true;
},
[Types.POST_CALCPRICE_FAILED](state) {
state.fetchingCalcPrice = false;
},
[Types.POST_CALCPRICE_SUCCESS](state) {
state.fetchingCalcPrice = true;
},
[Types.POST_NOENTRY_CALCPRICE_REQUEST](state) {
state.fetchingCalcPrice = true;
},
[Types.POST_NOENTRY_CALCPRICE_FAILED](state) {
state.fetchingCalcPrice = false;
},
[Types.POST_NOENTRY_CALCPRICE_SUCCESS](state) {
state.fetchingCalcPrice = false;
},
[Types.POST_NOENTRY_CHANGE_PRICE_REQUEST](state) {
state.fetchingChangePrice = true;
},
[Types.POST_NOENTRY_CHANGE_PRICE_FAILED](state) {
state.fetchingChangePrice = false;
},
[Types.POST_NOENTRY_CHANGE_PRICE_SUCCESS](state) {
state.fetchingChangePrice = false;
}
};