Authored by 于良

Merge branch '5.4' of http://git.yoho.cn/mobile/YH_RNComponent into 5.4

... ... @@ -175,7 +175,8 @@ let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
width: width,
height: height,
},
contentContainer:{
backgroundColor: 'white',
... ...
... ... @@ -194,6 +194,8 @@ export default class MessageList extends Component {
let {isFetching, endReached, list, listId, shouldShowEmpty} = this.props.data;
let isLoadingMore = list.size != 0 && isFetching;
let isShowLoading = list.size == 0 && isFetching;
if (shouldShowEmpty) {
return (
<View style={styles.container}>
... ... @@ -234,7 +236,7 @@ export default class MessageList extends Component {
}}
/>
<LoadingIndicator
isVisible={isFetching}
isVisible={isShowLoading}
/>
</View>
);
... ...
... ... @@ -36,7 +36,9 @@ export default class BrandArticleList extends Component {
_renderHeader(){
return(
<View style={styles.headerContainer}>
<Text style={styles.headerText}>相关资讯</Text>
<View style={styles.headerContainerWithoutBorder}>
<Text style={styles.headerText}>相关资讯</Text>
</View>
</View>
);
}
... ... @@ -51,7 +53,7 @@ export default class BrandArticleList extends Component {
onPressArticle={this.props.onPressArticle}
onPressArticleLike={this.props.onPressArticleLike}
/>
);
}
... ... @@ -114,13 +116,17 @@ let styles = StyleSheet.create({
height: 36 * DEVICE_WIDTH_RATIO,
marginLeft: 30 * DEVICE_WIDTH_RATIO,
marginRight: 30 * DEVICE_WIDTH_RATIO,
borderColor: '#e0e0e0',
backgroundColor: "#e0e0e0",
},
headerContainerWithoutBorder: {
marginTop: 0.5 *DEVICE_WIDTH_RATIO,
height: 35.5 * DEVICE_WIDTH_RATIO,
marginLeft: 0.5 * DEVICE_WIDTH_RATIO,
marginRight: 0.5 * DEVICE_WIDTH_RATIO,
flex:1,
justifyContent: 'center',
alignItems: 'center',
borderColor: '#e0e0e0',
borderTopWidth: 0.5,
borderLeftWidth: 0.5,
borderRightWidth: 0.5,
borderBottomWidth: 0,
backgroundColor: "#ffffff",
},
headerText:{
... ...
... ... @@ -44,7 +44,6 @@ function mapDispatchToProps(dispatch) {
class DetailContainer extends Component {
componentDidMount() {
this.props.actions.uidBrandFav();
this.props.actions.brandInfo();
}
... ...
... ... @@ -115,7 +115,8 @@ export function brandInfo(reload = false) {
dispatch(brandInfoSuccess(json));
dispatch(setBrandId(json.brand_id));
dispatch(newArrive());
dispatch(articleByBrand());
dispatch(uidBrandFav(json.brand_id))
dispatch(articleByBrand(json.brand_id));
let isDifferent = json.is_different;
let url = '?openby:yohobuy={"action":"go.brand","params":{"brand_id":"' + json.brand_id + '","is_different":"' + isDifferent + '"}}';
dispatch(setMoreProductUrl(url));
... ... @@ -187,14 +188,9 @@ export function uidBrandFavFailure(){
};
}
export function uidBrandFav(){
export function uidBrandFav(brandId){
return (dispatch, getState) => {
let {app,detail} = getState();
let {brandId} = detail;
if (!brandId) {
return;
}
let fetchUidBrandFav = (brandId,uid) => {
dispatch(uidBrandFavRequest());
return new DetailService(app.servicehost).getUidBrandFav(brandId,uid)
... ... @@ -272,14 +268,9 @@ export function articleByBrandFailure(){
type: ARTICLE_BY_BRAND_FAILURE,
};
}
export function articleByBrand(){
export function articleByBrand(brandId){
return (dispatch, getState) => {
let {detail,app} = getState();
let {brandId} = detail;
if (!brandId) {
return;
}
let fetchUidBrandFav = (brandId,uid) => {
dispatch(articleByBrandRequest());
return new DetailService(app.servicehost).getArticleByBrand(brandId,uid)
... ...
... ... @@ -104,7 +104,7 @@ export default class DetailService {
url: '',
body: {
method: 'app.favorite.cancel',
id,
fav_id: id,
uid,
type,
}
... ...