砍价增加版本弹窗提示 review by孙凯
Showing
1 changed file
with
21 additions
and
1 deletions
@@ -11,6 +11,8 @@ import HaggleList from '../components/HaggleList' | @@ -11,6 +11,8 @@ import HaggleList from '../components/HaggleList' | ||
11 | import LoadingIndicator from '../../common/components/LoadingIndicator'; | 11 | import LoadingIndicator from '../../common/components/LoadingIndicator'; |
12 | import { TipsAlertItem, TipsAlert } from '../../common/components/YH_TipsAlert'; | 12 | import { TipsAlertItem, TipsAlert } from '../../common/components/YH_TipsAlert'; |
13 | import { YHAlert, YHAlertItem } from '../components/cell/YH_Alert.js'; | 13 | import { YHAlert, YHAlertItem } from '../components/cell/YH_Alert.js'; |
14 | +import DeviceInfo from 'react-native-device-info'; | ||
15 | +import Prompt from '../../common/components/Prompt'; | ||
14 | 16 | ||
15 | const actions = [ | 17 | const actions = [ |
16 | allianceActions, | 18 | allianceActions, |
@@ -38,7 +40,7 @@ function mapDispatchToProps(dispatch) { | @@ -38,7 +40,7 @@ function mapDispatchToProps(dispatch) { | ||
38 | class HaggleListContainer extends Component { | 40 | class HaggleListContainer extends Component { |
39 | constructor(props) { | 41 | constructor(props) { |
40 | super(props); | 42 | super(props); |
41 | - this.state = {showAlert:false, productItem:null}; | 43 | + this.state = {showAlert:false, productItem:null, showVersionAlert:false}; |
42 | this._onEndReached = this._onEndReached.bind(this); | 44 | this._onEndReached = this._onEndReached.bind(this); |
43 | this._onPressProduct = this._onPressProduct.bind(this); | 45 | this._onPressProduct = this._onPressProduct.bind(this); |
44 | this._jumpHaggleDetail = this._jumpHaggleDetail.bind(this); | 46 | this._jumpHaggleDetail = this._jumpHaggleDetail.bind(this); |
@@ -47,6 +49,7 @@ class HaggleListContainer extends Component { | @@ -47,6 +49,7 @@ class HaggleListContainer extends Component { | ||
47 | this._timerStop = this._timerStop.bind(this); | 49 | this._timerStop = this._timerStop.bind(this); |
48 | this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this); | 50 | this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this); |
49 | this._onRefresh = this._onRefresh.bind(this); | 51 | this._onRefresh = this._onRefresh.bind(this); |
52 | + this._onPromptHidden = this._onPromptHidden.bind(this); | ||
50 | } | 53 | } |
51 | 54 | ||
52 | componentDidMount() { | 55 | componentDidMount() { |
@@ -124,7 +127,17 @@ class HaggleListContainer extends Component { | @@ -124,7 +127,17 @@ class HaggleListContainer extends Component { | ||
124 | 127 | ||
125 | } | 128 | } |
126 | 129 | ||
130 | + _onPromptHidden() { | ||
131 | + this.setState({showVersionAlert:false}); | ||
132 | + } | ||
133 | + | ||
127 | _onPressProduct(product) { | 134 | _onPressProduct(product) { |
135 | + let app_version = DeviceInfo.getVersion(); | ||
136 | + if (Platform.OS === 'ios' && app_version === '6.8.3') { | ||
137 | + this.setState({showVersionAlert:true}); | ||
138 | + return; | ||
139 | + } | ||
140 | + | ||
128 | let {categoryType} = this.props.haggle; | 141 | let {categoryType} = this.props.haggle; |
129 | 142 | ||
130 | let that = this; | 143 | let that = this; |
@@ -182,6 +195,13 @@ class HaggleListContainer extends Component { | @@ -182,6 +195,13 @@ class HaggleListContainer extends Component { | ||
182 | onRefresh={this._onRefresh} | 195 | onRefresh={this._onRefresh} |
183 | /> | 196 | /> |
184 | <LoadingIndicator isVisible={isFetching && !isPullToRefresh}/> | 197 | <LoadingIndicator isVisible={isFetching && !isPullToRefresh}/> |
198 | + | ||
199 | + {this.state.showVersionAlert ? <Prompt | ||
200 | + text={'您的版本不支持该功能,请更新版本!'} | ||
201 | + duration={1600} | ||
202 | + onPromptHidden={this._onPromptHidden} | ||
203 | + /> : null} | ||
204 | + | ||
185 | </View> | 205 | </View> |
186 | ); | 206 | ); |
187 | } | 207 | } |
-
Please register or login to post a comment