Authored by 于良

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

... ... @@ -47,11 +47,13 @@ export default class OutletPageListView extends Component {
resource,
} = this.props;
if (resource.get('sort_name')=='即将开始' || resource.get('sort_name') == '即将结束') {
this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'));
if (resource.get('sort_name')=='即将开始') {
this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type'));
}else if (resource.get('sort_name') == '即将结束') {
this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type'));
}else {
this.props.getOutletHomeResource && this.props.getOutletHomeResource(resource.get('content_code'),ptr);
this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'));
this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type'));
}
}
... ...
... ... @@ -68,8 +68,8 @@ class OutletContainer extends Component {
this.props.actions.getOutletHomeResource(content_code,ptr);
}
_getOutletActivityList(content_code){
this.props.actions.getOutletActivityList(content_code);
_getOutletActivityList(content_code,yh_channel,type){
this.props.actions.getOutletActivityList(content_code,yh_channel,type);
}
_setActivityFliter(content_code,activityMore) {
... ...
... ... @@ -78,10 +78,14 @@ function parseListFromCategory(json) {
json.map((item, i) => {
let url = item.sort_url;
let content_code = GetQueryString(url,'content_code');
let type = GetQueryString(url,'type');
let yh_channel = GetQueryString(url,'yh_channel');
if (!content_code) {
content_code = item.content_code;
}
item.content_code = content_code;
item.type = type?type:0;
item.yh_channel=yh_channel?yh_channel:0;
})
return json;
}
... ... @@ -228,12 +232,12 @@ export function getOutletActivityListFailure(content_code,error) {
}
}
export function getOutletActivityList(content_code) {
export function getOutletActivityList(content_code,yh_channel,type) {
return (dispatch, getState) => {
let {app, outlet} = getState();
let {categoryList} = outlet;
dispatch(getOutletActivityListRequest(content_code));
return new OutletService(app.host).getOutletActivityList(app.yh_channel)
return new OutletService(app.host).getOutletActivityList(yh_channel,type)
.then(json => {
dispatch(getOutletActivityListSuccess({'json':json,'content_code':content_code}));
})
... ...
... ... @@ -68,7 +68,7 @@ export default class OutletService {
});
}
async getOutletActivityList(yh_channel='',platform='2',size=0, type=0){
async getOutletActivityList(yh_channel='',type=0,platform='2',size=0){
return await this.api.get({
url: '',
body: {
... ...
... ... @@ -3,6 +3,6 @@
export function GetQueryString(url,name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = url.match(reg);
var r = url.substr(url.indexOf("\?")+1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
... ...
... ... @@ -85,9 +85,9 @@ export default class Header extends React.Component {
handleNavigationChange(navState) {
let heightT = parseInt(navState.title, 10) || 0; // turn NaN to 0
this.setState({
heightT>0?this.setState({
realContentHeight: heightT,
});
}):null;
}
shouldStartLoadWithRequest(event) {
... ...
... ... @@ -63,7 +63,7 @@ export default class Title extends React.Component {
}}>
<Image
source={require('../../../brandStore/image/btn_more_p.png')}
style={{width: 22, height: 4,backgroundColor:'white',marginLeft:3}}
style={{width: 22, height: 4,marginLeft:3}}
resizeMode={'contain'}
/>
</TouchableOpacity>:null}
... ...
... ... @@ -71,7 +71,7 @@ export default class RedPersonPicThree extends Component{
<TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType1,linkReource1)}} >
<YH_Image url={backgroundImage1} style={styles.imagetype4}/>
{linkType1=='1'?<View style={styles.maskContainer4}>
<Text style={styles.titleText4}>{name1}</Text>
<Text style={styles.titleText4} numberOfLines={1}>{name1}</Text>
<View style={styles.saleView}>
<Text style={{marginTop: 2,marginLeft: 10,fontSize: 13,backgroundColor: 'transparent',color: saleAble1?'red':'white',}}>{price1}</Text>
{saleAble1?<Text style={styles.deleteSale}>{sale1}</Text>:null}
... ... @@ -81,7 +81,7 @@ export default class RedPersonPicThree extends Component{
<TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType2,linkReource2)}} >
<YH_Image url={backgroundImage2} style={styles.imagetype4}/>
{linkType2=='1'?<View style={styles.maskContainer4}>
<Text style={styles.titleText4}>{name2}</Text>
<Text style={styles.titleText4} numberOfLines={1}>{name2}</Text>
<View style={styles.saleView}>
<Text style={{marginTop: 2,marginLeft: 10,fontSize: 13,backgroundColor: 'transparent',color: saleAble2?'red':'white',}}>{price2}</Text>
{saleAble2?<Text style={styles.deleteSale}>{sale2}</Text>:null}
... ... @@ -91,7 +91,7 @@ export default class RedPersonPicThree extends Component{
<TouchableOpacity style={styles.imagetype4} onPress={() => {this.props.onPressProduct && this.props.onPressProduct(linkType3,linkReource3)}} >
<YH_Image url={backgroundImage3} style={styles.imagetype4}/>
{linkType3=='1'?<View style={styles.maskContainer4}>
<Text style={styles.titleText4}>{name3}</Text>
<Text style={styles.titleText4} numberOfLines={1}>{name3}</Text>
<View style={styles.saleView}>
<Text style={{marginTop: 2,marginLeft: 10,fontSize: 13,backgroundColor: 'transparent',color: saleAble3?'red':'white',}}>{price3}</Text>
{saleAble3?<Text style={styles.deleteSale}>{sale3}</Text>:null}
... ... @@ -299,7 +299,7 @@ let styles = StyleSheet.create({
textAlign :'left',
},
titleText4: {
width:width/3 ,
width:width/3 -10,
height:maskHeight / 2,
color: 'white',
marginLeft: 10,
... ...