Authored by shixiang

修改秒杀删除线样式

review 陈林
... ... @@ -7,6 +7,7 @@ const {
View,
Text,
StyleSheet,
Platform,
} = ReactNative;
export default class DeleteLineText extends React.Component {
... ... @@ -37,7 +38,7 @@ let styles = StyleSheet.create({
},
deleteLine: {
position: 'absolute',
top: (11 / 2),
top: Platform.OS === 'ios'?(11 / 2):8,
left: 0,
right: 0,
height: 1,
... ...
... ... @@ -76,9 +76,8 @@ export default class ProductListView extends Component {
</View>
:<View style={[styles.secKillMarketPriceContainer, {marginTop: 2}]}>
<Text style={[styles.secKillPrice,{color:'#d0021b'}]}>¥{rowData.secKillPrice}</Text>
<DeleteLineText style={{top:3, left:8}} text={'¥' + rowData.marketPrice} />
<DeleteLineText style={{top:3, left:8}} text={'¥' + rowData.marketPrice+' '} />
</View>
}
</View>
<TouchableOpacity onPress={() => {
... ...
... ... @@ -28,6 +28,7 @@ export default class Seckill extends Component {
this.renderRow = this.renderRow.bind(this);
this.renderSectionHeader = this.renderSectionHeader.bind(this);
this._renderSeparator = this._renderSeparator.bind(this);
this._onPressTimeItem=this._onPressTimeItem.bind(this);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
sectionHeaderHasChanged: (s1, s2) => !Immutable.is(s1, s2),
... ... @@ -59,6 +60,13 @@ export default class Seckill extends Component {
if (nextProps.tipMessage && nextProps.tipMessage !== '') {
this._showToast && this._showToast(nextProps.tipMessage);
}
}
_onPressTimeItem(activity) {
this.props.onPressTimeItem(activity);
if( Platform.OS === 'android'){
this.props.onRefresh && this.props.onRefresh();
}
}
_showToast = (message) => {
... ... @@ -86,7 +94,7 @@ export default class Seckill extends Component {
return (
<TimeListView
resource={this.queryActivityInfo.secKillProductVoList.toArray()}
onPressTimeItem={this.props.onPressTimeItem}
onPressTimeItem={this._onPressTimeItem}
onFocusToCurStartedActivity={this.props.onFocusToCurStartedActivity}
curActivity = {this.props.curActivity}
diff={diff}
... ... @@ -146,6 +154,7 @@ export default class Seckill extends Component {
ActivityProductList: queryProductList ? queryProductList : [{}],
};
let isPullToRefresh = ptr && isFetching;
return (
<View style={styles.container}>
{
... ... @@ -180,7 +189,7 @@ export default class Seckill extends Component {
}}
refreshControl={
<RefreshControl
refreshing={false}
refreshing={isPullToRefresh}
onRefresh={() => {
//强制刷新数据
this.props.onRefresh && this.props.onRefresh();
... ...