Authored by chenl

修改了快速送达接口,增加了无数据时依旧显示头部的判断。review by 庄佳佳。

... ... @@ -51,11 +51,20 @@ export default class HotCategoryList extends Component{
return null;
}
let imageUrl = SlicedImage.getSlicedUrl(rowData.get("default_images"), 98, 128, 2);
let imageUrl = rowData.get("default_images");
let hasImage;
if(imageUrl){
imageUrl = SlicedImage.getSlicedUrl(rowData.get("default_images"), 98, 128, 2);
hasImage = true;
}
else
hasImage = false;
return (
<TouchableOpacity onPress={() => this.props.onPressHotCategoryItem && this.props.onPressHotCategoryItem(rowData.toJS(),rowID)}>
<View style={styles.rowContainer}>
<Image style={styles.rowThumbnail} key={imageUrl} source={{uri: imageUrl}}/>
{hasImage ? <Image style={styles.rowThumbnail} key={imageUrl} source={{uri:imageUrl}}/>
: <View style={styles.rowDefaultImageContainer}><Image style={styles.rowDefaultImage} source={require('../../images/yoho_icon.png')}/></View>}
<View style={styles.rowTextContainer}><Text style={styles.rowText} numberOfLines={2}>{rowData.get("category_name")}</Text></View>
</View>
</TouchableOpacity>
... ... @@ -158,6 +167,18 @@ let styles = StyleSheet.create({
height: 65 * DEVICE_WIDTH_RATIO,
},
rowDefaultImageContainer:{
width: 48 * DEVICE_WIDTH_RATIO,
height: 65 * DEVICE_WIDTH_RATIO,
justifyContent: 'center',
alignItems: 'center',
},
rowDefaultImage:{
width: 48 * DEVICE_WIDTH_RATIO,
height: 28 * DEVICE_WIDTH_RATIO,
},
rowTextContainer:{
width: 53 * DEVICE_WIDTH_RATIO,
height: 28 * DEVICE_WIDTH_RATIO,
... ...
... ... @@ -32,6 +32,10 @@ export default class Birth extends Component {
renderHeader(){
let {data} = this.props;
let showProductTitle = (!data || data.toArray().length == 0) ? false : true;
return(
<View style={styles.birthdayTipContainer}>
<Text style={styles.tipText}>生日特惠:除了在生日当月月初收到来自我们的真诚祝福,还将收到每年一次的”特殊优惠券”作为生日礼物。</Text>
... ... @@ -40,7 +44,8 @@ export default class Birth extends Component {
this.props.onPressComplete && this.props.onPressComplete();}}>
<Text style={styles.completeButton}>完善生日信息</Text>
</TouchableOpacity>
<HeadTitleCell title={"新品推荐"} />
{ showProductTitle ? <HeadTitleCell title={"新品推荐"} /> : null}
</View>
);
}
... ... @@ -69,10 +74,6 @@ export default class Birth extends Component {
let {isFetching, data} = this.props;
if(!data || data.toArray().length == 0){
return null;
}
return (
<View style={styles.container}>
<ListView
... ... @@ -106,7 +107,7 @@ let productHeight = Platform.OS === 'ios'? (rowHeight + rowMarginTop + rowMargin
let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f0f0',
backgroundColor: 'white',
},
contentContainer: {
... ...
... ... @@ -26,13 +26,13 @@ export default class FastExpress extends Component {
this.dataSource = new ListView.DataSource({rowHasChanged: (r1, r2) => !immutable.is(r1, r2)});
this.renderHeader = this.renderHeader.bind(this);
this.renderRow = this.renderRow.bind(this);
}
renderHeader(){
let {data, fastExpressList} = this.props;
let showProductTitle = (!data || data.toArray().length == 0) ? false : true;
let desc1 = "白金会员可享受快速送达服务。订单将采用最快速度进行配送(比如航空快件),保证您可以尽快获得心仪的商品。";
let desc2 = "※ 如果您的收件区域位于可提供快速送达服务的快递范围外或订单内的商品包含航空禁运品,我们仍将统一采用可送达快递进行配送,敬请谅解。";
... ... @@ -64,8 +64,7 @@ export default class FastExpress extends Component {
<Text style={styles.headerDescription1}>{desc1}</Text>
<Text style={styles.headerDescription2}>{desc2}</Text>
<HeadTitleCell title={"新品推荐"} />
{ showProductTitle ? <HeadTitleCell title={"新品推荐"} /> : null}
</View>
);
... ... @@ -95,10 +94,6 @@ export default class FastExpress extends Component {
let {isFetching, data} = this.props;
if(!data || data.toArray().length == 0){
return null;
}
return (
<View style={styles.container}>
<ListView
... ...
... ... @@ -35,7 +35,7 @@ export function getFastExpressInfo() {
return (dispatch, getState) => {
let {app, fastExpress} = getState();
return new FastExpressService(app.host).getFastExpressInfo()
return new FastExpressService(app.serviceHost).getFastExpressInfo()
.then(json => {
dispatch(getFastExpressInfoSuccess(json));
})
... ...
... ... @@ -14,7 +14,7 @@ export default class fastExpressService {
async getFastExpressInfo(){
return await this.api.get({
url: '',
url: '/gateway/',
body: {
method: 'app.vipgrade.fastexpress',
}
... ...