homeInitialState.js
1.66 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
'use strict';
import Immutable, {Record, List, Map} from 'immutable';
let favorite = Immutable.fromJS({
isFetching: false,
currentPage: 0,
pageCount: 0,
total: 0,
pageSize: 50,
error: null,
list: List(),
rec_id: ''
});
let bottomBanner = Immutable.fromJS({
list: List(),
isFetching: false,
error: null
});
let shop = Immutable.fromJS({
list: Map(),
isFetching: false,
error: null
});
let cached = Immutable.fromJS({
list: List(),
md5: '',
content_code: ''
});
let recommendProduct = Immutable.fromJS({
isFetching: false,
error: null,
list: List(),
rec_id: '',
isVisible: false,
});
let templet = new (Record({
isFetching: false,
isFirstLoad: true,
error: null,
cached: cached, //缓存
list: List(),
shop: shop,
recommendProduct: recommendProduct,
bottomBanner: bottomBanner,
favorite: favorite, //男, 女,潮童频道 猜你喜欢列表
content_code: '',
endReached: false,
similarIndex: -1,
floorHeight: 0, //接口返回的楼层高度
}));
let lifeStyle = new (Record({
isFetching: false,
isFirstLoad: true,
error: null,
cached: cached, //缓存
list: List(),
shop: shop, //店铺信息
recommendProduct: recommendProduct,
currentPage: 0,
pageCount: 0,
total: 0,
endReached: false,
md5:'',
isListFetching: false,
listError: null,
hotList: List(), //创意生活频道 人气单品商品列表
newList: List(), //创意生活频道 新品到着商品列表
selectIndex: 0,
content_code: '',
similarIndex: -1,
floorHeight: 0, //接口返回的楼层高度
}));
let InitialState = Record({
boy: templet,
girl: templet,
kid: templet,
lifeStyle: lifeStyle,
showSimilarGuider: false,
});
export default InitialState;