...
|
...
|
@@ -14,6 +14,7 @@ import ReactNative, { |
|
|
|
|
|
import Immutable, {Map} from 'immutable';
|
|
|
import Announcement from './Announcement';
|
|
|
import MineResourceList from './MineResourceList';
|
|
|
import YH_Image from '../../../common/components/YH_Image';
|
|
|
|
|
|
export default class MineListHeader extends React.Component {
|
...
|
...
|
@@ -23,6 +24,8 @@ export default class MineListHeader extends React.Component { |
|
|
this._renderMinePropertyNumberPoint = this._renderMinePropertyNumberPoint.bind(this);
|
|
|
this._renderVip = this._renderVip.bind(this);
|
|
|
this._renderBannerResource = this._renderBannerResource.bind(this);
|
|
|
this._calculateBannerResourceHeight = this._calculateBannerResourceHeight.bind(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -111,20 +114,54 @@ export default class MineListHeader extends React.Component { |
|
|
);
|
|
|
}
|
|
|
|
|
|
//渲染资源位
|
|
|
_renderBannerResource(){
|
|
|
let mineResource = this.props.mineResource;
|
|
|
|
|
|
if(!mineResource)
|
|
|
return;
|
|
|
|
|
|
//
|
|
|
return(
|
|
|
<MineResourceList
|
|
|
style={{width:width,height:500}}
|
|
|
mineResource={this.props.mineResource}
|
|
|
onPressFloorItem={this.props.onPressFloorItem}>
|
|
|
</MineResourceList>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
<View style={{width:width,height:25, backgroundColor:'red'}}>
|
|
|
//计算资源位高度
|
|
|
_calculateBannerResourceHeight(){
|
|
|
let {mineResource} = this.props;
|
|
|
let resourceList = mineResource ? mineResource.toJS() : [];
|
|
|
let floorHeight = 0;
|
|
|
let i = 0;
|
|
|
let count = resourceList.length;
|
|
|
for(i; i < count; i++) {
|
|
|
let item = resourceList[i];
|
|
|
if (!item) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
</View>
|
|
|
);
|
|
|
let templateName = item.template_name;
|
|
|
let data = item.data;
|
|
|
if (!templateName || !data) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
switch(templateName) {
|
|
|
case 'single_image': {
|
|
|
floorHeight = floorHeight + Math.ceil(width * 234 / 750);
|
|
|
break;
|
|
|
}
|
|
|
case 'small_pic': {
|
|
|
floorHeight = floorHeight + Math.ceil(80 * (width - 45) / 2 / 137.5);
|
|
|
break;
|
|
|
}
|
|
|
case 'divideImage': {
|
|
|
floorHeight = floorHeight + 10;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return floorHeight;
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -166,6 +203,13 @@ export default class MineListHeader extends React.Component { |
|
|
if (this.props.activityListInfo && this.props.activityListInfo.list && this.props.activityListInfo.list.size > 0) {
|
|
|
oHigh = oHigh + rowheight * this.props.activityListInfo.list.size;
|
|
|
}
|
|
|
|
|
|
//资源位高度
|
|
|
if (this.props.mineResource) {
|
|
|
let floorHeight = this._calculateBannerResourceHeight();
|
|
|
oHigh = oHigh + floorHeight;
|
|
|
}
|
|
|
|
|
|
oHigh = topHeight + oHigh;
|
|
|
let bgImage = Platform.OS === 'ios' ? require('../../image/mine_top_boy.png') : require('../../image/mine_banner_boy.jpg');
|
|
|
let bgHeight = Platform.OS === 'ios' ? 284 : 175;
|
...
|
...
|
@@ -675,7 +719,9 @@ export default class MineListHeader extends React.Component { |
|
|
<Image style={styles.arrow} source={require('../../image/arrow_gray.png')}/>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
{this._renderBannerResource()}
|
|
|
|
|
|
<View style={{
|
|
|
width: width,
|
|
|
height: 10,
|
...
|
...
|
|