Authored by 张文文

Merge branch 'V6.9.6_Alliance' into V6.9.7

... ... @@ -219,10 +219,10 @@ export default class NameAuthen extends Component {
{isShowToast ? <Prompt
text={toastMessage}
duration={1500}
duration={800}
onPromptHidden={this.props.hideToastMessage}
/> : null}
<YH_ActionSheet
ref="YH_ActionSheet"
items={[{title:'拍照',id:'1'},{title:'从相册中选择',id:'2'}]}
... ...
'use strict'
import React, {Component} from "react";
import {StyleSheet, View, NativeModules, DeviceEventEmitter} from "react-native";
import ReactNative, {StyleSheet, View, NativeModules, DeviceEventEmitter} from "react-native";
import {bindActionCreators} from "redux";
import {connect} from "react-redux";
import {Map} from "immutable";
import TimerMixin from 'react-timer-mixin';
import * as allianceActions from '../reducers/alliance/allianceActions';
... ... @@ -48,7 +49,7 @@ class NameAuthenContainer extends Component {
}
componentWillUnmount() {
this.timer && TimerMixin.clearTimeout(this.timer);
}
showLoading(show){
... ... @@ -83,7 +84,15 @@ class NameAuthenContainer extends Component {
return;
}
this.props.actions.bindIdentityCard(cardFrontUrl, cardBackUrl);
this.props.actions.bindIdentityCard(cardFrontUrl, cardBackUrl, (json) => {
this.timer = TimerMixin.setTimeout(() => {
ReactNative.NativeModules.YH_CommonHelper.goBack();
//绑定成功后更新绑定状态
DeviceEventEmitter.emit('IdentityCardBindSuccessEvent');
}, 1000);
});
})
.catch(error => {
this.showLoading(false);
... ...
... ... @@ -1434,7 +1434,7 @@ function exposeProductListData(json) {
}
export function bindIdentityCard(cardFrontUrl, cardBackUrl) {
export function bindIdentityCard(cardFrontUrl, cardBackUrl, callback) {
return (dispatch, getState) => {
let {app, alliance} = getState();
... ... @@ -1445,9 +1445,7 @@ export function bindIdentityCard(cardFrontUrl, cardBackUrl) {
dispatch(bindIdentityCardSuccess(json));
dispatch(showToastMessage('绑定成功'));
ReactNative.NativeModules.YH_CommonHelper.goBack();
//绑定成功后更新绑定状态
DeviceEventEmitter.emit('IdentityCardBindSuccessEvent');
callback && typeof callback === 'function' && callback(json)
})
.catch(error => {
dispatch(bindIdentityCardFailure(error));
... ...