outlet 添加请求参数 review by hongmo
Showing
5 changed files
with
15 additions
and
9 deletions
@@ -47,11 +47,13 @@ export default class OutletPageListView extends Component { | @@ -47,11 +47,13 @@ export default class OutletPageListView extends Component { | ||
47 | resource, | 47 | resource, |
48 | } = this.props; | 48 | } = this.props; |
49 | 49 | ||
50 | - if (resource.get('sort_name')=='即将开始' || resource.get('sort_name') == '即将结束') { | ||
51 | - this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code')); | 50 | + if (resource.get('sort_name')=='即将开始') { |
51 | + this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type')); | ||
52 | + }else if (resource.get('sort_name') == '即将结束') { | ||
53 | + this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type')); | ||
52 | }else { | 54 | }else { |
53 | this.props.getOutletHomeResource && this.props.getOutletHomeResource(resource.get('content_code'),ptr); | 55 | this.props.getOutletHomeResource && this.props.getOutletHomeResource(resource.get('content_code'),ptr); |
54 | - this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code')); | 56 | + this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type')); |
55 | } | 57 | } |
56 | } | 58 | } |
57 | 59 |
@@ -68,8 +68,8 @@ class OutletContainer extends Component { | @@ -68,8 +68,8 @@ class OutletContainer extends Component { | ||
68 | this.props.actions.getOutletHomeResource(content_code,ptr); | 68 | this.props.actions.getOutletHomeResource(content_code,ptr); |
69 | } | 69 | } |
70 | 70 | ||
71 | - _getOutletActivityList(content_code){ | ||
72 | - this.props.actions.getOutletActivityList(content_code); | 71 | + _getOutletActivityList(content_code,yh_channel,type){ |
72 | + this.props.actions.getOutletActivityList(content_code,yh_channel,type); | ||
73 | } | 73 | } |
74 | 74 | ||
75 | _setActivityFliter(content_code,activityMore) { | 75 | _setActivityFliter(content_code,activityMore) { |
@@ -78,10 +78,14 @@ function parseListFromCategory(json) { | @@ -78,10 +78,14 @@ function parseListFromCategory(json) { | ||
78 | json.map((item, i) => { | 78 | json.map((item, i) => { |
79 | let url = item.sort_url; | 79 | let url = item.sort_url; |
80 | let content_code = GetQueryString(url,'content_code'); | 80 | let content_code = GetQueryString(url,'content_code'); |
81 | + let type = GetQueryString(url,'type'); | ||
82 | + let yh_channel = GetQueryString(url,'yh_channel'); | ||
81 | if (!content_code) { | 83 | if (!content_code) { |
82 | content_code = item.content_code; | 84 | content_code = item.content_code; |
83 | } | 85 | } |
84 | item.content_code = content_code; | 86 | item.content_code = content_code; |
87 | + item.type = type?type:0; | ||
88 | + item.yh_channel=yh_channel?yh_channel:0; | ||
85 | }) | 89 | }) |
86 | return json; | 90 | return json; |
87 | } | 91 | } |
@@ -228,12 +232,12 @@ export function getOutletActivityListFailure(content_code,error) { | @@ -228,12 +232,12 @@ export function getOutletActivityListFailure(content_code,error) { | ||
228 | } | 232 | } |
229 | } | 233 | } |
230 | 234 | ||
231 | -export function getOutletActivityList(content_code) { | 235 | +export function getOutletActivityList(content_code,yh_channel,type) { |
232 | return (dispatch, getState) => { | 236 | return (dispatch, getState) => { |
233 | let {app, outlet} = getState(); | 237 | let {app, outlet} = getState(); |
234 | let {categoryList} = outlet; | 238 | let {categoryList} = outlet; |
235 | dispatch(getOutletActivityListRequest(content_code)); | 239 | dispatch(getOutletActivityListRequest(content_code)); |
236 | - return new OutletService(app.host).getOutletActivityList(app.yh_channel) | 240 | + return new OutletService(app.host).getOutletActivityList(yh_channel,type) |
237 | .then(json => { | 241 | .then(json => { |
238 | dispatch(getOutletActivityListSuccess({'json':json,'content_code':content_code})); | 242 | dispatch(getOutletActivityListSuccess({'json':json,'content_code':content_code})); |
239 | }) | 243 | }) |
@@ -68,7 +68,7 @@ export default class OutletService { | @@ -68,7 +68,7 @@ export default class OutletService { | ||
68 | }); | 68 | }); |
69 | } | 69 | } |
70 | 70 | ||
71 | - async getOutletActivityList(yh_channel='',platform='2',size=0, type=0){ | 71 | + async getOutletActivityList(yh_channel='',type=0,platform='2',size=0){ |
72 | return await this.api.get({ | 72 | return await this.api.get({ |
73 | url: '', | 73 | url: '', |
74 | body: { | 74 | body: { |
@@ -3,6 +3,6 @@ | @@ -3,6 +3,6 @@ | ||
3 | export function GetQueryString(url,name) | 3 | export function GetQueryString(url,name) |
4 | { | 4 | { |
5 | var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); | 5 | var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); |
6 | - var r = url.match(reg); | 6 | + var r = url.substr(url.indexOf("\?")+1).match(reg); |
7 | if(r!=null)return unescape(r[2]); return null; | 7 | if(r!=null)return unescape(r[2]); return null; |
8 | } | 8 | } |
-
Please register or login to post a comment