Authored by 孙凯

outlet 添加请求参数 review by hongmo

... ... @@ -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;
}
... ...