...
|
...
|
@@ -7,7 +7,8 @@ const { |
|
|
|
|
|
SET_ERROR,
|
|
|
SHOW_BANK_INFO,
|
|
|
|
|
|
SHOW_RESULT_INFO,
|
|
|
RESET_CARD_ADD_INFO,
|
|
|
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
|
...
|
...
|
@@ -17,7 +18,7 @@ export function getBankInfo(cardNo) { |
|
|
return (dispatch, getState) => {
|
|
|
|
|
|
let bankInfo = (uid) => {
|
|
|
let {app, myCardAdd} = getState();
|
|
|
let {app} = getState();
|
|
|
let info = {
|
|
|
bankCode: '',
|
|
|
bankName: '',
|
...
|
...
|
@@ -80,20 +81,30 @@ export function bindingCard(cardNo, mobile, bankName, bankCode) { |
|
|
|
|
|
let bindCards = (uid) => {
|
|
|
let {app} = getState();
|
|
|
let result = {
|
|
|
showResult: false,
|
|
|
result: '',
|
|
|
message: '',
|
|
|
description: '',
|
|
|
buttonText: '',
|
|
|
};
|
|
|
|
|
|
return new InstallmentService(app.host).bindingCards(uid, cardNo, mobile, bankName, bankCode)
|
|
|
.then(json => {
|
|
|
|
|
|
console.log("chenlin9999", JSON.stringify(json));
|
|
|
|
|
|
// dispatch(showBankInfo(info));
|
|
|
result.showResult = true;
|
|
|
result.result = 'success';
|
|
|
result.message = '恭喜您,新增还款银行卡成功!';
|
|
|
result.description = '';
|
|
|
result.buttonText = '确认';
|
|
|
dispatch(showResultInfo(result));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
console.log("chenlin6666", JSON.stringify(error));
|
|
|
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.instalmentMyCardAdd","params":{}}`;
|
|
|
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
|
|
|
|
|
|
|
|
|
result.showResult = true;
|
|
|
result.result = 'fail';
|
|
|
result.message = '对不起,绑定银行卡失败!';
|
|
|
result.description = '失败的原因可能是:银行卡户名、银行卡、预留的手机号不一致';
|
|
|
result.buttonText = '重新绑定银行卡';
|
|
|
dispatch(showResultInfo(result));
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -114,7 +125,47 @@ export function bindingCard(cardNo, mobile, bankName, bankCode) { |
|
|
}
|
|
|
|
|
|
|
|
|
export function showResultInfo(result) {
|
|
|
return {
|
|
|
type: SHOW_RESULT_INFO,
|
|
|
payload: result,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
export function backToMyCardList() {
|
|
|
return (dispatch, getState) => {
|
|
|
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.instalmentMyCard","params":{}}`;
|
|
|
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
export function backToMyCardAdd() {
|
|
|
return (dispatch, getState) => {
|
|
|
|
|
|
let reset = {
|
|
|
bankCode: '',
|
|
|
bankName: '',
|
|
|
cardNO: '',
|
|
|
bankSupport: false,
|
|
|
showBankInfo: false,
|
|
|
showResult: false,
|
|
|
result: '',
|
|
|
message: '',
|
|
|
description: '',
|
|
|
buttonText: '',
|
|
|
};
|
|
|
|
|
|
dispatch(resetStateInfo(reset));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function resetStateInfo(state) {
|
|
|
return {
|
|
|
type: RESET_CARD_ADD_INFO,
|
|
|
payload: state,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|