homeInitialState.js 1.66 KB
'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;