Authored by chenl

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

... ... @@ -104,12 +104,23 @@ class BrandContainer extends Component {
}
let brandId = data.shop_id ? data.shop_id : '';
// 0-girl 1-boy 2-child 3-lifestyle
let gender = 0;
if (this.props.brand.selectedChannelId == 1) {
gender = 1;
} else if (this.props.brand.selectedChannelId == 2) {
gender = 0;
} else if (this.props.brand.selectedChannelId == 3) {
gender = 2;
} else if (this.props.brand.selectedChannelId == 4) {
gender = 3;
}
if (!brandId) {
brandId = data.id ? data.id : '';
}
params = {
BR_ID: brandId,
GDER: this.props.brand.selectedChannelId + '',
GDER: gender + '',
};
// console.log(eventName)
// console.log(params)
... ... @@ -120,10 +131,22 @@ class BrandContainer extends Component {
_onPressSlideItem(url, index=0) {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
// 0-girl 1-boy 2-child 3-lifestyle
let gender = 0;
if (this.props.brand.selectedChannelId == 1) {
gender = 1;
} else if (this.props.brand.selectedChannelId == 2) {
gender = 0;
} else if (this.props.brand.selectedChannelId == 3) {
gender = 2;
} else if (this.props.brand.selectedChannelId == 4) {
gender = 3;
}
let params = {
BAN_NUM: parseInt(index) + 1 + '',
TOURL: url,
GDER: this.props.brand.selectedChannelId + '',
GDER: gender + '',
};
NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_BAN', params);
... ... @@ -134,12 +157,22 @@ class BrandContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let brandId = brandId = data.id ? data.id : '';
// 0-girl 1-boy 2-child 3-lifestyle
let gender = 0;
if (this.props.brand.selectedChannelId == 1) {
gender = 1;
} else if (this.props.brand.selectedChannelId == 2) {
gender = 0;
} else if (this.props.brand.selectedChannelId == 3) {
gender = 2;
} else if (this.props.brand.selectedChannelId == 4) {
gender = 3;
}
let params = {
BAN_NUM: parseInt(index) + 1 + '',
BR_ID: brandId,
GDER: this.props.brand.selectedChannelId + '',
GDER: gender + '',
};
NativeModules.YH_CommonHelper.logEvent('YB_CATEGORY_BRAND_LIST_BR', params);
}
... ...
... ... @@ -130,6 +130,10 @@ export default class MessageList extends Component {
onLongPressListItem={(itemData) =>{
this.onLongPressListItem(itemData, rowID);
}}
onPressListItem={(itemData) =>{
this.setState({showToolTips: false});
}
}
/>
);
}
... ... @@ -189,7 +193,7 @@ export default class MessageList extends Component {
render() {
let {isFetching, endReached, list, listId, shouldShowEmpty} = this.props.data;
let isLoadingMore = list.size != 0 && isFetching;
if (shouldShowEmpty) {
return (
<View style={styles.container}>
... ...
... ... @@ -33,6 +33,9 @@ export default class MessageListBigIconCell extends Component {
onLongPress={() =>{
this.props.onLongPressListItem && this.props.onLongPressListItem(itemData);
}}
onPress={() =>{
this.props.onPressListItem && this.props.onPressListItem(itemData);
}}
>
<View style={styles.titleContainer}>
<Text
... ...
... ... @@ -31,6 +31,9 @@ export default class MessageListOrderCell extends Component {
onLongPress={() =>{
this.props.onLongPressListItem && this.props.onLongPressListItem(itemData);
}}
onPress={() =>{
this.props.onPressListItem && this.props.onPressListItem(itemData);
}}
>
<View style={styles.contentContainer}>
<Text
... ...
... ... @@ -26,7 +26,7 @@ export default class MessageListSmallIconCell extends Component {
let imageUri = body ? body.get('img_url','www.yohobuy.com') : 'www.yohobuy.com';
let content = body ? body.get('content','') : '';
imageUri = SlicedImage.getSlicedUrl(imageUri, 50, 50, 2);
return(
<View style={styles.container}>
<TouchableOpacity
... ... @@ -34,6 +34,9 @@ export default class MessageListSmallIconCell extends Component {
onLongPress={() =>{
this.props.onLongPressListItem && this.props.onLongPressListItem(itemData);
}}
onPress={() =>{
this.props.onPressListItem && this.props.onPressListItem(itemData);
}}
>
<View style={styles.contentContainer}>
<Text
... ...
... ... @@ -26,6 +26,9 @@ export default class MessageListTextCell extends Component {
onLongPress={() =>{
this.props.onLongPressListItem && this.props.onLongPressListItem(itemData);
}}
onPress={() =>{
this.props.onPressListItem && this.props.onPressListItem(itemData);
}}
>
<View style={styles.container}>
<Text
... ...
... ... @@ -30,10 +30,16 @@ export default class ProductListCell extends Component {
let browse = data.get('browse');
let src = data.get('src');
let article_id = data.get('id');
let show10K = false;
if (browse>10000) {
browse = browse/10000.0;
browse = Math.round(browse*10)/10;
if (browse >= 100) {
browse = Math.round(browse);
} else {
browse = Math.round(browse*10)/10;
}
show10K = true;
}
src = src.replace('{width}', rowWidth*2).replace('{height}',Math.ceil(214*width/750)*2).replace('{mode}',2);
... ... @@ -55,7 +61,7 @@ export default class ProductListCell extends Component {
<Image style={styles.clockImage} source={require('../../image/time_ic.png')}/>
<Text style={styles.text}>{publish_time}</Text>
<Image style={styles.eyeImage} source={require('../../image/eye_ic.png')}/>
<Text style={styles.text}>{browse}</Text>
<Text style={styles.text}>{browse}{show10K?'万':''}</Text>
</View>
</View>
... ...
... ... @@ -38,7 +38,7 @@ export default class ProductListCell extends Component {
style={[styles.container, style]}
activeOpacity={1}
onPress={() => {
this.props.onPressProduct && this.props.onPressProduct(data, rowID);
this.props.onPressShop && this.props.onPressShop(data, rowID);
}}
>
<View style={{flex:1}}>
... ... @@ -52,9 +52,7 @@ export default class ProductListCell extends Component {
人收藏
</Text>
<View style={styles.tag}>
<TouchableOpacity style={styles.button} onPress={()=>{this.props.onPressShop && this.props.onPressShop(data,rowID);}}>
<Text style={styles.tagName}>进入店铺</Text>
</TouchableOpacity>
<Text style={styles.tagName}>进入店铺</Text>
</View>
</View>
... ...