Authored by chenl

修复了androdi 机型样式展现问题。

... ... @@ -11,6 +11,7 @@ import ReactNative, {
StyleSheet,
Dimensions,
TouchableOpacity,
Platform,
} from 'react-native';
import Immutable from 'immutable';
... ... @@ -45,7 +46,7 @@ export default class HotBrandList extends Component{
return null;
}
let imageUrl = SlicedImage.getSlicedUrl(rowData.get("brand_ico"), 70, 29, 2);
let imageUrl = SlicedImage.getSlicedUrl(rowData.get("brand_ico"), (70 - diff), 29, 2);
let brandName = rowData.get("brand_name");
return (
... ... @@ -81,6 +82,10 @@ export default class HotBrandList extends Component{
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
console.log("chenlin:" + "width:" + width + "height:" + height + "DEVICE_WIDTH_RATIO:" + DEVICE_WIDTH_RATIO);
let diff = (Platform.OS === 'android' && width < 440) ? 1 : 0;
let styles = StyleSheet.create({
... ... @@ -128,24 +133,24 @@ let styles = StyleSheet.create({
},
rowContainer:{
width: 70 * DEVICE_WIDTH_RATIO,
height: 70 * DEVICE_WIDTH_RATIO,
width: (70 - diff) * DEVICE_WIDTH_RATIO,
height: (70 - diff) * DEVICE_WIDTH_RATIO ,
},
rowImageContainer:{
width: 70 * DEVICE_WIDTH_RATIO,
width: (70 - diff) * DEVICE_WIDTH_RATIO,
height: 50 * DEVICE_WIDTH_RATIO,
justifyContent: 'center',
alignItems: 'center',
},
rowThumbnail:{
width: 70 * DEVICE_WIDTH_RATIO,
width: (70 - diff) * DEVICE_WIDTH_RATIO,
height: 29 * DEVICE_WIDTH_RATIO,
},
rowText:{
width: 70 * DEVICE_WIDTH_RATIO,
width: (70 - diff) * DEVICE_WIDTH_RATIO,
height: 20 * DEVICE_WIDTH_RATIO,
fontSize: 10,
color: '#B0B0B0',
... ...
... ... @@ -11,6 +11,7 @@ import ReactNative, {
StyleSheet,
Dimensions,
TouchableOpacity,
Platform,
} from 'react-native';
import Immutable from 'immutable';
... ... @@ -99,7 +100,7 @@ export default class HotCategoryList extends Component{
let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;
let diff = (Platform.OS === 'android' && width < 440) ? 1 : 0;
let styles = StyleSheet.create({
... ... @@ -159,7 +160,7 @@ let styles = StyleSheet.create({
},
rowContainer:{
width: 70 * DEVICE_WIDTH_RATIO,
width: (70 - diff) * DEVICE_WIDTH_RATIO,
height: 93 * DEVICE_WIDTH_RATIO,
paddingLeft: 5 * DEVICE_WIDTH_RATIO,
paddingRight: 5 * DEVICE_WIDTH_RATIO,
... ...
... ... @@ -52,6 +52,10 @@ export default class NativeRequest {
body,
};
let response = await ReactNative.NativeModules.YH_NativeRequest.get(params);
if (Platform.OS === 'android') {
response = JSON.parse(response);
}
let data = await this._parseResponse(response);
return data;
... ... @@ -93,6 +97,9 @@ export default class NativeRequest {
body,
};
let response = await ReactNative.NativeModules.YH_NativeRequest.post(params);
if (Platform.OS === 'android') {
response = JSON.parse(response);
}
let data = await this._parseResponse(response);
return data;
... ...