Authored by 张文文

有赚我的页面身份证绑定修改

... ... @@ -6,6 +6,7 @@ import {Immutable} from "immutable";
import SingleImage from './floor/SingleImage';
import MineCell from './cell/MineCell';
import YH_Image from '../../common/components/YH_Image';
import Prompt from "../../common/components/Prompt";
export default class Mine extends Component {
... ... @@ -77,7 +78,11 @@ export default class Mine extends Component {
<View style={{height: 1, backgroundColor: '#f0f0f0'}}/>
<TouchableOpacity activeOpacity={1} style={styles.withdrawView} onPress={() => {
if (uploadStatus) {
this.props.showToastMessage && this.props.showToastMessage('身份证已上传,如需修改请联系有货客服');
} else {
this.props.jumpWithUrl && this.props.jumpWithUrl('我的身份证', 'nameAuthen');
}
}}>
<Text style={styles.hasWithDrawText}>我的身份证</Text>
<View style={[styles.textView, {flexDirection: 'row', paddingRight: 15}]}>
... ... @@ -141,7 +146,7 @@ export default class Mine extends Component {
}
render() {
let {mineResourceInfo} = this.props;
let {mineResourceInfo, isShowToast, toastMessage} = this.props;
let resourceList = mineResourceInfo.resourceList ? mineResourceInfo.resourceList.toArray() : [];
return (
<View style={styles.container}>
... ... @@ -155,6 +160,12 @@ export default class Mine extends Component {
renderHeader={this._renderHeader}
renderRow={this._renderRow}
/>
{isShowToast ? <Prompt
text={toastMessage}
duration={1500}
onPromptHidden={this.props.hideToastMessage}
/> : null}
</View>
);
}
... ...
... ... @@ -39,6 +39,9 @@ class MineContainer extends Component {
this._jumpWithUrl = this._jumpWithUrl.bind(this);
this._resourceJumpWithUrl = this._resourceJumpWithUrl.bind(this);
this._refreshSettlementInfo = this._refreshSettlementInfo.bind(this);
this._showToastMessage = this._showToastMessage.bind(this);
this._hideToastMessage = this._hideToastMessage.bind(this);
}
componentDidMount() {
... ... @@ -53,6 +56,14 @@ class MineContainer extends Component {
}
_showToastMessage(toast) {
this.props.actions.showToastMessage(toast);
}
_hideToastMessage() {
this.props.actions.hideToastMessage();
}
_jumpWithUrl(title = '', type = '', orderCode = '') {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"${title}","type":"${type}","order_code":"${orderCode}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
... ... @@ -90,6 +101,11 @@ class MineContainer extends Component {
jumpWithUrl={this._jumpWithUrl}
resourceJumpWithUrl={this._resourceJumpWithUrl}
refreshSettlementInfo={this._refreshSettlementInfo}
isShowToast={this.props.alliance.isShowToast}
toastMessage={this.props.alliance.toastMessage}
showToastMessage={this._showToastMessage}
hideToastMessage={this._hideToastMessage}
/>
<LoadingIndicator isVisible={isFetching}/>
</View>
... ...
... ... @@ -62,8 +62,6 @@ class NameAuthenContainer extends Component {
bindIdentityCard(frontIDCardImageUri, backIDCardImageUri) {
this.showLoading(true);
console.log(backIDCardImageUri);
console.log(frontIDCardImageUri);
let param = [{code: 0,imageUri:frontIDCardImageUri.replace('file://','')},{code: 1,imageUri:backIDCardImageUri.replace('file://','')}];
NativeModules.YH_MarketHelper && NativeModules.YH_MarketHelper.postIDCardImage(param).then(data => {
let list = data;
... ... @@ -85,9 +83,7 @@ class NameAuthenContainer extends Component {
return;
}
this.props.actions.bindIdentityCard(cardFrontUrl, cardBackUrl, function(json) {
});
this.props.actions.bindIdentityCard(cardFrontUrl, cardBackUrl);
})
.catch(error => {
this.showLoading(false);
... ...
... ... @@ -1402,7 +1402,7 @@ function exposeProductListData(json) {
}
export function bindIdentityCard(cardFrontUrl, cardBackUrl, callback) {
export function bindIdentityCard(cardFrontUrl, cardBackUrl) {
return (dispatch, getState) => {
let {app, alliance} = getState();
... ... @@ -1411,8 +1411,9 @@ export function bindIdentityCard(cardFrontUrl, cardBackUrl, callback) {
return new AllianceService(app.host).bindIdentityCard(uid, cardFrontUrl, cardBackUrl)
.then(json => {
dispatch(bindIdentityCardSuccess(json));
dispatch(showToastMessage('绑定成功'));
callback && typeof callback === 'function' && callback(json)
ReactNative.NativeModules.YH_CommonHelper.goBack();
})
.catch(error => {
dispatch(bindIdentityCardFailure(error));
... ...