Authored by hongyong.zhao

修改有货有赞首页及其他bug -- reviewed by 孙凯

... ... @@ -36,7 +36,7 @@ export default class Home extends Component {
_renderRow(rowData, sectionID, rowID) {
let paddingLeft = rowID % 2 === 1 ? rowMarginHorizontal / 2 : rowMarginHorizontal;
let customStyle = rowID === 0 || rowID === 1 ? {paddingLeft} : {paddingLeft};
let sliderHeight = 111 * DEVICE_WIDTH_RATIO;
let sliderHeight = 90 * DEVICE_WIDTH_RATIO;
let imageUrl = YH_Image.getSlicedUrl(this.props.src, width, sliderHeight, 2);
switch (sectionID) {
case 'resourceList': {
... ... @@ -138,11 +138,13 @@ export default class Home extends Component {
);
}
case 'newSingleImage': {
let imageHeight = rowData.get('data').toJS().imageHeight;
return (
<SingleImage
data={rowData.get('data')}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
<SingleImage
style={imageHeight> 100 ? {marginLeft: 15, marginRight: 15, width: width-30}: {}}
data={rowData.get('data')}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
);
}
case 'image_list': {
... ... @@ -251,7 +253,7 @@ let styles = StyleSheet.create({
fontSize: 16,
color: '#000000',
textAlign:'center',
marginTop:28,
marginTop:12,
},
bannerSubTitle: {
fontFamily: 'SourceHanSansCN-Bold',
... ...
... ... @@ -36,7 +36,7 @@ export default class ImageSingle extends React.Component {
if (!list || list.length === 0) {
return null;
}
let sliderWidth = width;
let sliderWidth = this.props.style && this.props.style.width ? this.props.style.width : width;
let ratio = data.imageWidth / width;
let sliderHeight = data.imageHeight / ratio;
let imageUrl = YH_Image.getSlicedUrl(list[0].src, sliderWidth, sliderHeight, 2);
... ... @@ -44,7 +44,7 @@ export default class ImageSingle extends React.Component {
<TouchableOpacity
activeOpacity={1}
yh_exposureData={list[0].yh_exposureData}
style={{width: sliderWidth, height: sliderHeight}}
style={[{width: sliderWidth, height: sliderHeight},this.props.style]}
onPress={() => {
this.props.resourceJumpWithUrl && this.props.resourceJumpWithUrl(list[0].url);
}}
... ...
... ... @@ -25,6 +25,7 @@ export default class SingleImage extends React.Component {
render() {
return (
<ImageSingle
style={this.props.style}
resource={this.props.data}
resourceJumpWithUrl={this.props.resourceJumpWithUrl}
/>
... ...
... ... @@ -70,7 +70,7 @@ export default class Recommend extends Component {
<ProductCell
key={'row' + rowID}
data={rowData}
onPressProduct={this.props.onPressProduct}
onPressProduct={() => this.props.onPressProduct(rowData)}
/>
);
}
... ...
... ... @@ -136,10 +136,11 @@ class HomeContainer extends Component {
}
_onEndReached() {
let {
productPool,
} = this.props.app;
this.props.actions.getProductList(productPool);
productPool !=0 && this.props.actions.getProductList(productPool);
}
render() {
... ...
... ... @@ -70,7 +70,7 @@ class RecommendContainer extends Component {
}
onPressProduct(data) {
let productSkn = data.get('product_skn', 0);
let productSkn = data ? data.get('product_skn', 0): null;
if (!productSkn) {
return;
}
... ...

26.8 KB | W: | H:

37.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

54.7 KB | W: | H:

59.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin