Authored by chenl

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

... ... @@ -11,10 +11,12 @@ const {
Text,
ListView,
TouchableOpacity,
Platform,
} = ReactNative;
import {Map} from 'immutable';
import BrandProductListCell from '../../../../../common/components/ListCell/ProductListCell';
import DeviceInfo from 'react-native-device-info';
export default class HotProducts extends React.Component {
... ... @@ -50,10 +52,19 @@ export default class HotProducts extends React.Component {
}
renderHeader() {
let fontFamilyStyle = {};
if (Platform.OS === 'ios') {
let systemVersion = DeviceInfo.getSystemVersion();
systemVersion = parseFloat(systemVersion);
if (systemVersion >= 9.0) {
fontFamilyStyle = {fontFamily: 'PingFang SC'};
}
}
return(
<View style={styles.container}>
<View style={styles.title}>
<Text style={styles.text}>{this.props.resource.title}</Text>
<Text style={[styles.text, fontFamilyStyle]}>{this.props.resource.title}</Text>
<View style={styles.thumbnail}>
<TouchableOpacity activeOpacity={0.5} onPress={() => {
... ... @@ -61,7 +72,7 @@ export default class HotProducts extends React.Component {
}}>
<Image
source={require('../../../../image/more.png')}
style={{width: 40, height: 40}}
style={{width: 40, height: 36}}
resizeMode={'contain'}
/>
</TouchableOpacity>
... ... @@ -115,13 +126,14 @@ const styles = StyleSheet.create({
height: 40,
width: width,
backgroundColor: 'white',
borderBottomColor: '#CCC',
borderBottomWidth: 0.5,
borderBottomColor: '#e5e5e5',
borderBottomWidth: 1,
borderTopColor: '#e5e5e5',
borderTopWidth: 1,
},
text: {
textAlign: 'left',
fontSize: 16,
fontFamily: 'PingFang SC',
fontWeight: 'bold',
color: '#444',
},
... ... @@ -131,8 +143,9 @@ const styles = StyleSheet.create({
thumbnail: {
position: 'absolute',
width: 40,
height: 40,
bottom: 2,
height: 38,
top: 1,
bottom: 1,
marginLeft: width - 40,
backgroundColor: 'transparent',
},
... ...
... ... @@ -11,9 +11,11 @@ const {
Text,
ListView,
TouchableOpacity,
Platform,
} = ReactNative;
import {Map} from 'immutable';
import DeviceInfo from 'react-native-device-info';
export default class Recommend extends React.Component {
... ... @@ -50,10 +52,19 @@ export default class Recommend extends React.Component {
}
renderHeader() {
let fontFamilyStyle = {};
if (Platform.OS === 'ios') {
let systemVersion = DeviceInfo.getSystemVersion();
systemVersion = parseFloat(systemVersion);
if (systemVersion >= 9.0) {
fontFamilyStyle = {fontFamily: 'PingFang SC'};
}
}
let data = this.props.resource;
return(
<View style={styles.title}>
<Text style={styles.text}>{data.get('title')}</Text>
<Text style={[styles.text, fontFamilyStyle]}>{data.get('title')}</Text>
</View>
);
}
... ... @@ -67,9 +78,9 @@ export default class Recommend extends React.Component {
}
let backgroundWidth = width;
let backgroundHeight = 41 + Math.ceil(list.length / 4) * itemWidth;
let backgroundHeight = 40 + Math.ceil(list.length / 4) * itemWidth + 30;
return (
<View style={{width: backgroundWidth, height:backgroundHeight, backgroundColor:'#f0f0f0'}}>
<View style={{width: backgroundWidth, height:backgroundHeight, backgroundColor:'#f4f7f2'}}>
<ListView
contentContainerStyle={styles.contentContainer}
dataSource={this.dataSource.cloneWithRows(list)}
... ... @@ -98,20 +109,24 @@ const styles = StyleSheet.create({
},
rowContainer: {
borderRightWidth: 1,
borderBottomWidth: 1,
borderColor: '#e5e5e5',
},
thumbnail: {
borderWidth: 0.5,
borderColor: '#CCC',
width: itemWidth,
height: itemWidth,
width: itemWidth-1,
height: itemWidth-1,
},
title: {
alignItems: 'center',
justifyContent: 'center',
height: 40,
width:width,
backgroundColor: 'white',
backgroundColor: 'white',
borderBottomWidth: 1,
borderBottomColor: '#e5e5e5',
borderTopColor: '#e5e5e5',
borderTopWidth: 1,
},
itemTitle: {
marginLeft:5,
... ... @@ -125,12 +140,11 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
textAlign: 'center',
color: 'gray',
fontSize: 10,
fontSize: 9,
},
text: {
textAlign: 'center',
fontSize: 16,
fontFamily: 'PingFang SC',
fontWeight: 'bold',
color: '#444',
},
... ...
... ... @@ -24,10 +24,10 @@ export default class AllBrandListCell extends React.Component {
let is_show_new = this.props.rowData.is_show_new;
let shop_id = this.props.rowData.shop_id;
let shop_template_type = this.props.rowData.shop_template_type;
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shop_id}","shop_template_type":"${shop_template_type}","name":"${name}"}}`;
return(
return(
<TouchableOpacity activeOpacity={0.5} onPress={() => {
this.props.onPressSlideItem && this.props.onPressSlideItem(url);
this.props.onPressSlideItem && this.props.onPressSlideItem(this.props.rowData);
}}>
<View style={styles.rowTitle}>
<Text style={styles.rowText}>{name}</Text>
... ...
... ... @@ -29,7 +29,7 @@ export default class BannerReourceList extends React.Component {
let newSrc = getSlicedUrl(rowData.src, 140, 100, 2);
return (
<TouchableOpacity activeOpacity={0.5} onPress={() => {
this.props.onPressSlideItem && this.props.onPressSlideItem(rowData.url);
this.props.onPressSlideItem && this.props.onPressSlideItem(rowData);
}}>
<View style={styles.row}>
<View style={styles.thumbnailV}>
... ...
... ... @@ -25,11 +25,10 @@ export default class NewHotBannerListCell extends React.Component {
let name = rowData.brand_name;
let shop_id = rowData.shop_id;
let shop_template_type = rowData.shop_template_type;
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shop_id}","shop_template_type":"${shop_template_type}","name":"${name}"}}`;
return (
<TouchableOpacity activeOpacity={0.5} onPress={() => {
this.props.onPressSlideItem && this.props.onPressSlideItem(url);
this.props.onPressSlideItem && this.props.onPressSlideItem(rowData);
}}>
<View style={styles.rowContainer}>
<Image
... ...
... ... @@ -84,8 +84,8 @@ class BrandContainer extends Component {
this.subscription && this.subscription.remove();
}
_onPressSlideItem(url){
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
_onPressSlideItem(data){
ReactNative.NativeModules.YH_CommonHelper.pushBrandVC(data);
}
_onPressFilter(value) {
... ...
This diff could not be displayed because it is too large.