index.js
1.67 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
import actions from './actions';
import mutations from './mutations';
export function defaultSelectedSize() {
return {
productId: null,
product: {},
sizeId: null,
storageId: null,
size: {},
};
}
export function defaultProduct() {
return {
brand_name: '',
canPublishSecondHand: false,
gender: '通用',
goods_list: [
{
canAddSize: false,
color_name: '',
goods_id: null,
goods_name: '-',
image_list: [
],
size_list: [
]
}
],
least_price: null,
max_price: null,
max_sort_id: null,
min_price: null,
offer_price: null,
product_code: null,
product_id: null,
product_name: null,
sale_time: null,
sellerCanPublish: true,
series_name: null,
shelve_status: null,
resource: null,
activity: [],
recommend: [],
top3: [],
};
}
export function defaultState() {
return {
products: {},
resourceContentCode: '05e4f5782dfc3a5e10d39b8f04a7dcb9', // 资源位code,当前只有一个固定的code
/**
1: 当前商品对应品牌系统的推荐
2: 商品详情页面取前3
3: 品牌系统-商品列表页面显示前30个商品, 且不能显示当前详情页对应的商品(接口过滤)
*/
topLists: {},
fav: {},
/**
* 用户在商品详情页选择的交易信息
* productId: 商品id
* product: 商品详情
* sizeId: 尺寸id
* storageId: 库存id
* size: 尺寸信息
*/
selectedProductInfo: defaultSelectedSize(),
};
}
export default function() {
return {
namespaced: true,
state: defaultState(),
mutations,
actions,
};
}