Authored by 于良

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

... ... @@ -119,7 +119,6 @@ export default class BrandSwiper extends React.Component {
{list.map((item, i) => {
let newSrc = getSlicedUrl(item.src, width, height, 2);
console.log("chenlin", newSrc);
return (
<TouchableOpacity
key={i}
... ...
... ... @@ -53,7 +53,8 @@ export default class KidsBrandFloor extends Component {
if (rowID == 7) {
return (
<TouchableOpacity
onPress={()=>{this.props.onPressBrandItem&&this.props.onPressBrandItem(moreUrl, '', rowID)}}>
onPress={()=>{this.props.onPressBrandItem&&this.props.onPressBrandItem(moreUrl, '', rowID)}}
yh_exposureData={this.props.data.get('title').get('yh_exposureData')}>
<View style={styles.row}>
<View style={styles.imageContainer}>
<Image
... ... @@ -69,6 +70,7 @@ export default class KidsBrandFloor extends Component {
return (
<TouchableOpacity style={styles.cellContainer}
activeOpacity={1}
yh_exposureData={rowData.get('yh_exposureData')}
onPress={()=>{this.props.onPressBrandItem&&this.props.onPressBrandItem(actionUrl, imgUrl, rowID)}}>
<YH_Image style={styles.image}
url={imgUrl}/>
... ... @@ -91,7 +93,8 @@ export default class KidsBrandFloor extends Component {
let floorH = 40 + itemHeight * 2 + 0.5;
return (
<View style={{backgroundColor:'white',width:width,height:floorH}}>
<HeadTitleCell title={title} moreUrl={moreurl}/>
<HeadTitleCell title={title} moreUrl={moreurl}
onPressTitleMore={this.props.onPressTitleMore} yh_exposureData={data.get('title').get('yh_exposureData')}/>
<ListView
contentContainerStyle={styles.list}
dataSource={this.dataSource.cloneWithRows(dataList.toArray())}
... ...
... ... @@ -44,7 +44,8 @@ export default class NewUserFloor extends Component {
let productSkn = rowData.get('product_skn');
let imgUrl = SlicedImage.getSlicedUrl(rowData.get('default_images'),cellWidth / 2,cellHeight,2);
return (
<TouchableOpacity style={styles.row} onPress={()=>{this.props.onPressVipProduct&&this.props.onPressVipProduct(rowData, imgUrl, index + rowID)}}>
<TouchableOpacity style={styles.row} yh_exposureData={rowData.get('yh_exposureData')}
onPress={()=>{this.props.onPressVipProduct&&this.props.onPressVipProduct(rowData, imgUrl, index + rowID)}}>
<YH_Image style={styles.image}
url={imgUrl}/>
<View style={styles.detailContainer}>
... ... @@ -70,7 +71,8 @@ export default class NewUserFloor extends Component {
let floorH = 130 + 40 + bannerHeight;
return (
<View style={{backgroundColor:'white',width:width,height:floorH}}>
<HeadTitleCell title={title} moreUrl={moreUrl}/>
<HeadTitleCell title={title} moreUrl={moreUrl}
onPressTitleMore={this.props.onPressTitleMore} yh_exposureData={data.get('title').get('yh_exposureData')}/>
<ImageSlider
resource={bannerData}
sliderWidth={width}
... ...
... ... @@ -42,6 +42,7 @@ export default class SmallPic extends React.Component {
<View style={styles.container}>
<TouchableOpacity
activeOpacity={1}
yh_exposureData={data.get(0).get('yh_exposureData')}
onPress={() => {
this.props.onPressPicItem && this.props.onPressPicItem(data.get(0).get('url'), url1, 0);
}}
... ... @@ -55,6 +56,7 @@ export default class SmallPic extends React.Component {
</TouchableOpacity>
<TouchableOpacity
activeOpacity={1}
yh_exposureData={data.get(1).get('yh_exposureData')}
onPress={() => {
this.props.onPressPicItem && this.props.onPressPicItem(data.get(1).get('url'), url2, 1);
}}
... ...
... ... @@ -147,16 +147,13 @@ export default class Home extends Component {
let data = this._currentChannelData();
let similarIndex = data.get('similarIndex')
let imgUrl = YH_Image.getSlicedUrl(rowData.get('default_images', ''), 290, 386, 2); // 商品缩略图
let yh_exposureData = rowData.get('yh_exposureData', Map()).toJS();
let showSimilarGuider = this.props.data.showSimilarGuider
&& this.state.scrollEnd
&& rowID == this.state.selectedVisibleIndex
let showSimilarGuider = this.props.data.showSimilarGuider
&& this.state.scrollEnd
&& rowID == this.state.selectedVisibleIndex
&& rowID != similarIndex;
return (
<View style={[styles.product,]}
yh_exposureData={yh_exposureData}
>
<View style={[styles.product,]}>
<ProductListCell
style={[styles.listContainer, customStyle]}
key={'sectionID+rowID' + sectionID+rowID}
... ... @@ -378,6 +375,9 @@ export default class Home extends Component {
onPressBrandItem={(jumpUrl, imageUrl, index) =>{
this.props.onPressFloorItem&&this.props.onPressFloorItem(jumpUrl, imageUrl, index, rowData, rowID);
}}
onPressTitleMore={(jumpUrl, imageUrl, index) =>{
this.props.onPressTitleMore&&this.props.onPressTitleMore(jumpUrl, imageUrl, index, rowData, rowID);
}}
/>
);
}
... ...
... ... @@ -996,11 +996,34 @@ function homeFloorAutoReportData(list,channel) {
break;
}
case 'kids_brands':{
//more添加曝光数据
let title = floorData.title ? floorData.title : {};
let moreUrl = title.more_url ? title.more_url : "";
let titleParam = autoReportData(channlStr,floorName,floorID,floorIndex,"0",moreUrl);
title.yh_exposureData = titleParam ? titleParam : "";
break;
//list添加曝光数据
let itemList = floorData.list ? floorData.list : [];
for (let j = 0; j < itemList.length; j++) {
let imageItem = itemList[j];
let inFloorIndex = parseInt(j) + 1 + '';
let actionUrl = imageItem.url;
let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,actionUrl);
imageItem.yh_exposureData = param;
}
break;
}
case 'small_pic': {
break;
//list添加曝光数据
let itemList = floorData ? floorData : [];
for (let j = 0; j < itemList.length; j++) {
let imageItem = itemList[j];
let inFloorIndex = parseInt(j) + 1 + '';
let actionUrl = imageItem.url;
let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,actionUrl);
imageItem.yh_exposureData = param;
}
break;
}
case 'divideImage': {
break;
... ...
... ... @@ -29,23 +29,16 @@ export default class MineListHeader extends React.Component {
* */
_renderMineOrderNumberPoint(num) {
let offset = 0;
if (isNaN(num)) {
//兼容非数字
} else if (num <= 0) {
if (num <= 0) {
//0不显示
return null;
} else if (num < 10) {
offset = 17;
} else if (num < 100) {
offset = 17;
} else {
offset = 12;
} else if (num >= 100) {
num = '99+';
}
return (
<View style={{
position:'absolute',
right:offset,
left: orderContentWidth / 2 + 7,
top:0,
backgroundColor:'#d0021b',
paddingLeft: 2.5,
... ... @@ -68,29 +61,16 @@ export default class MineListHeader extends React.Component {
* 我的资产中的数字展示
* */
_renderMinePropertyNumberPoint(num) {
let offset = 0;
if (isNaN(num)) {
//兼容非数字
offset = 15;
} else if (num <= 0) {
if (num <= 0) {
//0不显示
return null;
} else if (num < 10) {
offset = 30;
} else if (num < 100) {
offset = 30;
} else if (num < 1000) {
offset = 25;
} else if (num < 10000) {
offset = 20;
} else {
offset = 15;
} else if (num >= 10000) {
num = '9999+';
}
return (
<View style={{
position:'absolute',
right:offset,
left: assetContentWidth / 2+ 7,
top:0,
backgroundColor:'#444444',
paddingLeft: 2.5,
... ... @@ -698,6 +678,8 @@ let subRowHeight = Math.ceil(35 * DEVICE_WIDTH_RATIO);//账号安全 通知层
let rowheight = 45;//wo的订单类似的高度,我的逛也用这个高度
let orderContainerHeight = 55;
let topHeight = 175 + rowheight + orderContainerHeight + 10 + rowheight + orderContainerHeight + 1 + 10 + rowheight * 3 + 91;
let orderContentWidth = (width - 10) / 5;
let assetContentWidth = (width - 10) / 4;
let styles = StyleSheet.create({
container: {
... ... @@ -736,7 +718,7 @@ let styles = StyleSheet.create({
order_content: {
flex: 1,
flexDirection: 'column',
width: (width - 10) / 5,
width: orderContentWidth,
alignItems: 'center',
paddingTop: 4,
paddingBottom: 4,
... ... @@ -746,7 +728,7 @@ let styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
width: (width - 10) / 4,
width: assetContentWidth,
paddingTop: 4,
paddingBottom: 4,
// backgroundColor:'red'
... ... @@ -755,7 +737,7 @@ let styles = StyleSheet.create({
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
width: (width - 10) / 4,
width: assetContentWidth,
height: 45,
},
icon_image: {
... ...
... ... @@ -99,9 +99,7 @@ export default function appReducer(state = initialState, action) {
}
case LOGIN_IN_SUCCESS: {
let {
uid,
} = action.payload;
let uid = action.payload;
let newProfile = state.profile.set("uid", uid);
return state.set('profile', newProfile);
}
... ...