Merge branch 'V6.9.6_Alliance' into V6.9.7
Showing
3 changed files
with
15 additions
and
8 deletions
@@ -219,7 +219,7 @@ export default class NameAuthen extends Component { | @@ -219,7 +219,7 @@ export default class NameAuthen extends Component { | ||
219 | 219 | ||
220 | {isShowToast ? <Prompt | 220 | {isShowToast ? <Prompt |
221 | text={toastMessage} | 221 | text={toastMessage} |
222 | - duration={1500} | 222 | + duration={800} |
223 | onPromptHidden={this.props.hideToastMessage} | 223 | onPromptHidden={this.props.hideToastMessage} |
224 | /> : null} | 224 | /> : null} |
225 | 225 |
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | import React, {Component} from "react"; | 3 | import React, {Component} from "react"; |
4 | -import {StyleSheet, View, NativeModules, DeviceEventEmitter} from "react-native"; | 4 | +import ReactNative, {StyleSheet, View, NativeModules, DeviceEventEmitter} from "react-native"; |
5 | import {bindActionCreators} from "redux"; | 5 | import {bindActionCreators} from "redux"; |
6 | import {connect} from "react-redux"; | 6 | import {connect} from "react-redux"; |
7 | import {Map} from "immutable"; | 7 | import {Map} from "immutable"; |
8 | +import TimerMixin from 'react-timer-mixin'; | ||
8 | 9 | ||
9 | import * as allianceActions from '../reducers/alliance/allianceActions'; | 10 | import * as allianceActions from '../reducers/alliance/allianceActions'; |
10 | 11 | ||
@@ -48,7 +49,7 @@ class NameAuthenContainer extends Component { | @@ -48,7 +49,7 @@ class NameAuthenContainer extends Component { | ||
48 | } | 49 | } |
49 | 50 | ||
50 | componentWillUnmount() { | 51 | componentWillUnmount() { |
51 | - | 52 | + this.timer && TimerMixin.clearTimeout(this.timer); |
52 | } | 53 | } |
53 | 54 | ||
54 | showLoading(show){ | 55 | showLoading(show){ |
@@ -83,7 +84,15 @@ class NameAuthenContainer extends Component { | @@ -83,7 +84,15 @@ class NameAuthenContainer extends Component { | ||
83 | return; | 84 | return; |
84 | } | 85 | } |
85 | 86 | ||
86 | - this.props.actions.bindIdentityCard(cardFrontUrl, cardBackUrl); | 87 | + this.props.actions.bindIdentityCard(cardFrontUrl, cardBackUrl, (json) => { |
88 | + | ||
89 | + this.timer = TimerMixin.setTimeout(() => { | ||
90 | + ReactNative.NativeModules.YH_CommonHelper.goBack(); | ||
91 | + //绑定成功后更新绑定状态 | ||
92 | + DeviceEventEmitter.emit('IdentityCardBindSuccessEvent'); | ||
93 | + }, 1000); | ||
94 | + | ||
95 | + }); | ||
87 | }) | 96 | }) |
88 | .catch(error => { | 97 | .catch(error => { |
89 | this.showLoading(false); | 98 | this.showLoading(false); |
@@ -1434,7 +1434,7 @@ function exposeProductListData(json) { | @@ -1434,7 +1434,7 @@ function exposeProductListData(json) { | ||
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | 1436 | ||
1437 | -export function bindIdentityCard(cardFrontUrl, cardBackUrl) { | 1437 | +export function bindIdentityCard(cardFrontUrl, cardBackUrl, callback) { |
1438 | return (dispatch, getState) => { | 1438 | return (dispatch, getState) => { |
1439 | let {app, alliance} = getState(); | 1439 | let {app, alliance} = getState(); |
1440 | 1440 | ||
@@ -1445,9 +1445,7 @@ export function bindIdentityCard(cardFrontUrl, cardBackUrl) { | @@ -1445,9 +1445,7 @@ export function bindIdentityCard(cardFrontUrl, cardBackUrl) { | ||
1445 | dispatch(bindIdentityCardSuccess(json)); | 1445 | dispatch(bindIdentityCardSuccess(json)); |
1446 | dispatch(showToastMessage('绑定成功')); | 1446 | dispatch(showToastMessage('绑定成功')); |
1447 | 1447 | ||
1448 | - ReactNative.NativeModules.YH_CommonHelper.goBack(); | ||
1449 | - //绑定成功后更新绑定状态 | ||
1450 | - DeviceEventEmitter.emit('IdentityCardBindSuccessEvent'); | 1448 | + callback && typeof callback === 'function' && callback(json) |
1451 | }) | 1449 | }) |
1452 | .catch(error => { | 1450 | .catch(error => { |
1453 | dispatch(bindIdentityCardFailure(error)); | 1451 | dispatch(bindIdentityCardFailure(error)); |
-
Please register or login to post a comment