Authored by 郁健超

砍价增加版本弹窗提示 review by孙凯

... ... @@ -11,6 +11,8 @@ import HaggleList from '../components/HaggleList'
import LoadingIndicator from '../../common/components/LoadingIndicator';
import { TipsAlertItem, TipsAlert } from '../../common/components/YH_TipsAlert';
import { YHAlert, YHAlertItem } from '../components/cell/YH_Alert.js';
import DeviceInfo from 'react-native-device-info';
import Prompt from '../../common/components/Prompt';
const actions = [
allianceActions,
... ... @@ -38,7 +40,7 @@ function mapDispatchToProps(dispatch) {
class HaggleListContainer extends Component {
constructor(props) {
super(props);
this.state = {showAlert:false, productItem:null};
this.state = {showAlert:false, productItem:null, showVersionAlert:false};
this._onEndReached = this._onEndReached.bind(this);
this._onPressProduct = this._onPressProduct.bind(this);
this._jumpHaggleDetail = this._jumpHaggleDetail.bind(this);
... ... @@ -47,6 +49,7 @@ class HaggleListContainer extends Component {
this._timerStop = this._timerStop.bind(this);
this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this);
this._onRefresh = this._onRefresh.bind(this);
this._onPromptHidden = this._onPromptHidden.bind(this);
}
componentDidMount() {
... ... @@ -124,7 +127,17 @@ class HaggleListContainer extends Component {
}
_onPromptHidden() {
this.setState({showVersionAlert:false});
}
_onPressProduct(product) {
let app_version = DeviceInfo.getVersion();
if (Platform.OS === 'ios' && app_version === '6.8.3') {
this.setState({showVersionAlert:true});
return;
}
let {categoryType} = this.props.haggle;
let that = this;
... ... @@ -182,6 +195,13 @@ class HaggleListContainer extends Component {
onRefresh={this._onRefresh}
/>
<LoadingIndicator isVisible={isFetching && !isPullToRefresh}/>
{this.state.showVersionAlert ? <Prompt
text={'您的版本不支持该功能,请更新版本!'}
duration={1600}
onPromptHidden={this._onPromptHidden}
/> : null}
</View>
);
}
... ...