...
|
...
|
@@ -41,7 +41,7 @@ export function getCategoryBList() { |
|
|
return new CategoryBService(app.host).getCategoryBList()
|
|
|
.then(json => {
|
|
|
dispatch(getCategoryBListSuccess(json));
|
|
|
|
|
|
|
|
|
dispatch(getCategoryBFirstSubCategoryDetail(categoryB.currentChannelId));
|
|
|
})
|
|
|
.catch(error => {
|
...
|
...
|
@@ -61,7 +61,7 @@ export function pressCategoryBMore(category_id){ |
|
|
let categoryData = categoryB.categoryList ? categoryB.categoryList.get(categoryB.currentChannelValue) : [];
|
|
|
|
|
|
//获取指定category_id分类信息
|
|
|
let category = null;
|
|
|
let category = null;
|
|
|
categoryData.map((item, i) => {
|
|
|
if(item && (category_id == item.get('category_id'))){
|
|
|
category = item;
|
...
|
...
|
@@ -78,7 +78,7 @@ export function pressCategoryBMore(category_id){ |
|
|
//设置当前的类别信息
|
|
|
// dispatch(setCurrentCateB(category_id, category ? category.get('category_name') : ""));
|
|
|
dispatch(jumpToCategory(all, 0, categoryB.currentChannelId));
|
|
|
|
|
|
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -130,6 +130,7 @@ export function getCategoryBSubCategoryDetail(categoryId, categoryValue){ |
|
|
currentCateId,
|
|
|
currentCateValue,
|
|
|
cacheSubCateData,
|
|
|
contentError,
|
|
|
} = categoryB;
|
|
|
|
|
|
//检查缓存是否存在数据
|
...
|
...
|
@@ -140,16 +141,24 @@ export function getCategoryBSubCategoryDetail(categoryId, categoryValue){ |
|
|
let lastTimestamp = categoryData.get('lrts', 0);
|
|
|
let currentTimestamp = new Date().getTime();
|
|
|
let diff = currentTimestamp - lastTimestamp;
|
|
|
if (diff < 250) {
|
|
|
if (diff < 400) {
|
|
|
__DEV__ && console.log('timestamp diff < 50, return');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (contentError) {
|
|
|
let lastTimestamp = contentError.lrts;
|
|
|
let currentTimestamp = new Date().getTime();
|
|
|
let diff = currentTimestamp - lastTimestamp;
|
|
|
if (diff < 400) {
|
|
|
__DEV__ && console.log('timestamp diff < 50, return');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (currentCateId == categoryId && categoryB.contentFetching) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
dispatch(getCategoryBSubDetail(currentChannelId, categoryId, categoryValue));
|
|
|
};
|
|
|
}
|
...
|
...
|
@@ -201,9 +210,10 @@ export function getCategoryBSubDetail(channel_id, category_id, category_value) { |
|
|
//曝光从网络获取的数据
|
|
|
dispatch(dataExposure(channel_id, category_id, category_value, json));
|
|
|
}
|
|
|
|
|
|
|
|
|
})
|
|
|
.catch(error => {
|
|
|
error.lrts = new Date().getTime();
|
|
|
dispatch(getCategoryBSubDetailFailure(error));
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -432,4 +442,4 @@ function dataExposure(channel_id, category_id, category_value, json) { |
|
|
|
|
|
}
|
|
|
};
|
|
|
} |
|
|
\ No newline at end of file |
|
|
} |
...
|
...
|
|