Authored by 鹿亮亮

Merge remote-tracking branch 'origin/5.5.0' 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}
... ...
... ... @@ -36,12 +36,13 @@ export default class Detail extends Component {
if (!data) {
return null;
}
console.log(data.toJS());
return (
<View style={[styles.container, {height: this.state.totalHeight}]}>
<Text style={styles.title}>{data.get('product_name')} </Text>
<View style={styles.pricePannel}>
<Text style={styles.price}> {data.get('format_sales_price')}</Text>
<Text style={styles.originPrice}>{data.get('format_market_price')}</Text>
<Text style={styles.price}> {data.get('format_sales_price')=='0'?data.get('format_market_price'):data.get('format_sales_price')}</Text>
{data.get('format_sales_price')!='0'?<Text style={styles.originPrice}>{data.get('format_market_price')}</Text>:null}
</View>
<Text style={styles.phrase}> {data.get('phrase')}</Text>
<View style={styles.tagPannel} onLayout={this.onLayout.bind(this)} >
... ...
... ... @@ -51,7 +51,7 @@ export default function native(platform) {
store.dispatch(setHost(this.props.host));
store.dispatch(setServiceHost(this.props.serviceHost));
store.dispatch(setChannel(channel))
store.dispatch(loadChannelCachedData());
return (
<Provider store={store}>
<HomeContainer />
... ...
... ... @@ -64,7 +64,7 @@ export default class ActivityProductFloor extends Component {
let imgUrl = SlicedImage.getSlicedUrl(rowData.get('default_images'),cellWidth,120,2);
return (
<TouchableOpacity
activeOpacity={1}
activeOpacity={1} yh_exposureData={rowData.get('yh_exposureData')}
onPress={()=>{
this.props.onPressVipProduct && this.props.onPressVipProduct(rowData, imgUrl, index+rowID)
}}
... ... @@ -101,7 +101,8 @@ export default class ActivityProductFloor extends Component {
let floorH = cellH + 40 + bannerHeight;
return (
<View style={{backgroundColor: 'white',width:width,height:floorH}}>
<HeadTitleCell title={title} moreUrl={moreUrl} onPressTitleMore={this.props.onPressTitleMore}/>
<HeadTitleCell title={title} moreUrl={moreUrl}
onPressTitleMore={this.props.onPressTitleMore} yh_exposureData={data.get('title').get('yh_exposureData')}/>
<ImageSlider
resource={bannerData}
sliderWidth={width}
... ...
... ... @@ -38,7 +38,8 @@ export default class HotCategoryIndividualization extends Component {
let containerHeight = listHeight + 40;
return (
<View style={[styles.container, {height: containerHeight}]}>
<HeadTitleCell title={title.get('title')} moreUrl={title.get('more_url')} onPressTitleMore={this.props.onPressTitleMore}/>
<HeadTitleCell title={title.get('title')} moreUrl={title.get('more_url')}
onPressTitleMore={this.props.onPressTitleMore} yh_exposureData={title.get('yh_exposureData')}/>
<View style={[styles.list, {height: listHeight}]}>
{data.map((item, i) => {
let url = YH_Image.getSlicedUrl(item.get('src'), imageWidth, imageHeight, 2);
... ... @@ -47,6 +48,7 @@ export default class HotCategoryIndividualization extends Component {
key={i}
style={styles.cellContainer}
activeOpacity={1}
yh_exposureData={item.get('yh_exposureData')}
onPress={() => {
this.props.onPressVipBannerItem && this.props.onPressVipBannerItem(item.get('url'), url, i + 1);
}}>
... ...
... ... @@ -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}
... ...
... ... @@ -9,6 +9,7 @@ import Immutable, {Map} from 'immutable';
const {
View,
Text,
TouchableOpacity,
StyleSheet,
Dimensions,
... ... @@ -56,7 +57,9 @@ export default class RecommendContentFive extends React.Component {
this.props.onPressRecommendListItem && this.props.onPressRecommendListItem(item.get('url'), imageUrl, i);
}}
>
<YH_Image url={imageUrl} style={styles.image} />
<YH_Image url={imageUrl} style={styles.image} >
{item.get('title').length?<View style={styles.whiteView}><Text style={styles.viewText} numberOfLines={1}>{item.get('title')}</Text></View>:null}
</YH_Image>
</TouchableOpacity>
);
})}
... ... @@ -94,6 +97,18 @@ let styles = StyleSheet.create({
width: imageWidth,
height: imageHeight,
},
whiteView: {
width: imageWidth,
marginTop: imageHeight - Math.floor(40*width/750),
height: Math.floor(40*width/750),
backgroundColor:'rgba(255,255,255,0.6)',
alignItems: 'center',
justifyContent: 'center',
},
viewText: {
fontSize: 12,
color: '#444444'
},
vLine1: {
position: 'absolute',
backgroundColor: '#e5e5e5',
... ...
... ... @@ -44,6 +44,7 @@ export default class SingleNameImage extends React.Component {
<HeadTitleCell title={title} />
<TouchableOpacity
activeOpacity={1}
yh_exposureData={data.get(0).get('yh_exposureData')}
onPress={() => {
this.props.onPressSlideItem && this.props.onPressSlideItem(data.get(0).get('url'), imageUrl, 0);
}}
... ...
... ... @@ -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);
}}
... ...
... ... @@ -45,7 +45,7 @@ export default class VipUserFloor extends Component {
let productSkn = rowData.get('product_skn');
let imgUrl = SlicedImage.getSlicedUrl(rowData.get('default_images'),cellWidth,120,2);
return (
<TouchableOpacity style={styles.row}
<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}
... ... @@ -69,7 +69,8 @@ export default class VipUserFloor extends Component {
let productData = data.get('list');
return (
<View style={styles.container}>
<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}
... ...
... ... @@ -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);
}}
/>
);
}
... ...
... ... @@ -107,7 +107,7 @@ class HomeContainer extends Component {
}
componentDidMount() {
// this.props.actions.loadChannelCachedData();
this.props.actions.loadChannelCachedData();
this.home && this.home.trigggePullToRefresh();
this.props.actions.setShowSimilarGuider(true);
}
... ...
... ... @@ -835,10 +835,28 @@ function homeFloorAutoReportData(list,channel) {
break;
}
case 'single_image': {
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 'single_name_image': {
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 'recommend_content_one': {
let recommend_content_onelarge = item.data.big_image?item.data.big_image:[];
... ... @@ -996,11 +1014,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;
... ... @@ -1052,6 +1093,13 @@ function homeFloorAutoReportData(list,channel) {
break;
}
case 'shopRecommend': {
//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;
}
... ... @@ -1119,19 +1167,52 @@ function homeFloorAutoReportData(list,channel) {
}
break;
}
case 'vipUse': {
break;
}
case 'activityProductFloor': {
case 'vipUse':
case 'activityProductFloor':
case 'new_user_floor': {
//more添加曝光数据
let title = floorData.title ? floorData.title : {};
let titleParam = autoReportData(channlStr,floorName,floorID,floorIndex,"0",title.more_url);
title.yh_exposureData = titleParam;
//banner添加曝光数据
let banner = floorData.banner_image ? floorData.banner_image : [];
let bannerLength = banner.length ? banner.length : 0;
for (var j = 0; j < bannerLength; j++) {
let bannerItem = banner[j];
let inFloorIndex = parseInt(j) + 1 + '';
let actionUrl = bannerItem.url;
let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,actionUrl);
bannerItem.yh_exposureData = param;
}
break;
//list添加曝光数据
let itemList = floorData.list ? floorData.list : [];
for (var j = 0; j < itemList.length; j++) {
let imageItem = itemList[j];
let inFloorIndex = parseInt(j) + 1 + bannerLength + '';
let skn = imageItem.product_skn;
let param = autoReportData(channlStr,floorName,floorID,floorIndex,inFloorIndex,"",skn);
imageItem.yh_exposureData = param;
}
break;
}
case 'hot_category_individualization': {
//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;
}
case 'new_user_floor': {
//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;
}
}
... ...
... ... @@ -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: {
... ...
... ... @@ -70,6 +70,13 @@ class MineContainer extends Component {
this.subscription4 = NativeAppEventEmitter.addListener(
'MineCenterResumeEvent',
(reminder) => {
this.props.actions.onMineCenterRefresh();
}
);
this.subscription5 = NativeAppEventEmitter.addListener(
'UserDidRegisterEvent',
(reminder) => {
this.props.actions.onMineCenterRefresh();
}
... ... @@ -88,6 +95,7 @@ class MineContainer extends Component {
this.subscription2 && this.subscription2.remove();
this.subscription3 && this.subscription3.remove();
this.subscription4 && this.subscription4.remove();
this.subscription5 && this.subscription5.remove();
}
_onPressItem(viewId, data) {
... ...
... ... @@ -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);
}
... ...
... ... @@ -114,7 +114,7 @@ let styles = StyleSheet.create({
},
image: {
width: rowWidth,
height: 214*width/750,
height: Math.floor(214*width/750),
marginTop: 0,
backgroundColor: '#f0f0f0',
marginBottom: 0,
... ... @@ -125,7 +125,7 @@ let styles = StyleSheet.create({
},
name: {
width: rowWidth,
height: 166*width/750,
height: Math.floor(166*width/750),
paddingLeft: 10,
paddingTop: 0,
paddingRight: 10,
... ... @@ -168,10 +168,10 @@ let styles = StyleSheet.create({
},
title: {
fontFamily: 'STHeitiSC-Light',
paddingTop: 5 + 15*width/750,
paddingTop: Math.floor(5 + 15*width/750),
fontSize: 12,
width: rowWidth,
lineHeight: 36*width/750,
lineHeight: Math.floor(36*width/750),
color: '#444444',
},
});
... ...
... ... @@ -3,7 +3,9 @@
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node_modules/react-native/packager/packager.sh"
"start": "sh replace-custom-components-file.sh && node_modules/react-native/packager/packager.sh",
"ios": "sh replace-custom-components-file.sh && node_modules/react-native/packager/packager.sh",
"android": "sh replace-custom-components-file.sh && node_modules/react-native/packager/packager.sh"
},
"dependencies": {
"apsl-react-native-button": "^2.4.2",
... ...
#!/usr/bin/env bash
echo "Replace custom components!!!"
echo "Replace View.js..."
cp -f ./js/common/components/customComponents/View.js.bak ./node_modules/react-native/Libraries/Components/View/View.js
echo "Replace ScrollView.js..."
cp -f ./js/common/components/customComponents/ScrollView.js.bak ./node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js
echo "Replace ListView.js..."
cp -f ./js/common/components/customComponents/ListView.js.bak ./node_modules/react-native/Libraries/CustomComponents/ListView/ListView.js
echo "Replace TouchableOpacity.js..."
cp -f ./js/common/components/customComponents/TouchableOpacity.js.bak ./node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js
echo "Replace TouchableHighlight.js..."
cp -f ./js/common/components/customComponents/TouchableHighlight.js.bak ./node_modules/react-native/Libraries/Components/Touchable/TouchableHighlight.js
echo "\n"
\ No newline at end of file
... ...