Showing
3 changed files
with
19 additions
and
20 deletions
@@ -22,26 +22,19 @@ export default class GroupPurchase extends Component { | @@ -22,26 +22,19 @@ export default class GroupPurchase extends Component { | ||
22 | 22 | ||
23 | _renderHeader() { | 23 | _renderHeader() { |
24 | let { | 24 | let { |
25 | - resource, | 25 | + productList, |
26 | } = this.props; | 26 | } = this.props; |
27 | - let resourceJS = resource.toJS(); | ||
28 | - | ||
29 | - if(!resourceJS.data || resourceJS.data.length == 0) return null; | ||
30 | - let datss = resourceJS.data; | ||
31 | - let data = datss[0].data; | ||
32 | - let imageHeight = data.imageHeight; | ||
33 | - let imageWidth = data.imageWidth; | ||
34 | - let list = data.list; | ||
35 | - let src = list[0].src; | ||
36 | - let url = list[0].url; | 27 | + let banner = productList.banner; |
28 | + let url = productList.url; | ||
37 | 29 | ||
38 | - let newSrc = getSlicedUrl(src, imageWidth, imageHeight, 2); | 30 | + if(banner === '' || url === '') return null; |
31 | + | ||
39 | return ( | 32 | return ( |
40 | <View style={styles.header}> | 33 | <View style={styles.header}> |
41 | <TouchableOpacity activeOpacity={0.8} onPress={() => { | 34 | <TouchableOpacity activeOpacity={0.8} onPress={() => { |
42 | this.props.didTouchBanner && this.props.didTouchBanner(url); | 35 | this.props.didTouchBanner && this.props.didTouchBanner(url); |
43 | }}> | 36 | }}> |
44 | - <YH_Image style={styles.header} url={newSrc}></YH_Image> | 37 | + <YH_Image style={{width: '100%', height: '100%'}} url={banner}></YH_Image> |
45 | </TouchableOpacity> | 38 | </TouchableOpacity> |
46 | </View> | 39 | </View> |
47 | ); | 40 | ); |
@@ -10,6 +10,8 @@ let InitialState = Record({ | @@ -10,6 +10,8 @@ let InitialState = Record({ | ||
10 | isFetching: false, | 10 | isFetching: false, |
11 | error: null, | 11 | error: null, |
12 | list: List(), | 12 | list: List(), |
13 | + banner: '', | ||
14 | + url: '', | ||
13 | page: 0, | 15 | page: 0, |
14 | total: 0, | 16 | total: 0, |
15 | pagetotal: 0, | 17 | pagetotal: 0, |
@@ -41,17 +41,21 @@ export default function couponReducer(state = initialState, action) { | @@ -41,17 +41,21 @@ export default function couponReducer(state = initialState, action) { | ||
41 | .setIn(['productList', 'error'], null); | 41 | .setIn(['productList', 'error'], null); |
42 | } | 42 | } |
43 | case PRODUCT_LIST_SUCCESS: { | 43 | case PRODUCT_LIST_SUCCESS: { |
44 | - let { | ||
45 | - collageProductVoList, | ||
46 | - page, | ||
47 | - page_total, | ||
48 | - total, | ||
49 | - endReached, | ||
50 | - } = action.payload; | 44 | + let { |
45 | + collageProductVoList, | ||
46 | + page, | ||
47 | + page_total, | ||
48 | + total, | ||
49 | + endReached, | ||
50 | + banner, | ||
51 | + jumpUrl | ||
52 | + } = action.payload; | ||
51 | 53 | ||
52 | return state.setIn(['productList', 'page'], page) | 54 | return state.setIn(['productList', 'page'], page) |
53 | .setIn(['productList', 'pagetotal'], page_total) | 55 | .setIn(['productList', 'pagetotal'], page_total) |
54 | .setIn(['productList', 'total'], total) | 56 | .setIn(['productList', 'total'], total) |
57 | + .setIn(['productList', 'banner'], banner) | ||
58 | + .setIn(['productList', 'url'], jumpUrl) | ||
55 | .setIn(['productList', 'list'], Immutable.fromJS(collageProductVoList)) | 59 | .setIn(['productList', 'list'], Immutable.fromJS(collageProductVoList)) |
56 | .setIn(['productList', 'isFetching'], false) | 60 | .setIn(['productList', 'isFetching'], false) |
57 | .setIn(['productList', 'error'], null) | 61 | .setIn(['productList', 'error'], null) |
-
Please register or login to post a comment