|
|
'use strict';
|
|
|
|
|
|
import ReactNative from 'react-native';
|
|
|
import {DeviceEventEmitter} from 'react-native';
|
|
|
import InstallmentService from '../../services/InstallmentService';
|
|
|
|
|
|
const {
|
...
|
...
|
@@ -141,8 +142,8 @@ export function unbindCardSuccess(){ |
|
|
|
|
|
export function backToMyCardList() {
|
|
|
return (dispatch, getState) => {
|
|
|
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.instalmentMyCard","params":{}}`;
|
|
|
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
|
|
|
ReactNative.NativeModules.YH_CommonHelper.goBack();
|
|
|
DeviceEventEmitter.emit('BankCardChangeEvent');
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -154,11 +155,10 @@ export function toggleBankCard(cardIdNo) { |
|
|
let toggleCard = (uid) => {
|
|
|
return new InstallmentService(app.host).toggleCard(uid, cardIdNo)
|
|
|
.then(json => {
|
|
|
DeviceEventEmitter.emit('BankCardChangeEvent');
|
|
|
dispatch(toggleCardSuccess());
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(toggleCardSuccess());
|
|
|
|
|
|
dispatch(setTipMessage(error.message || '暂未获取到数据'));
|
|
|
});
|
|
|
};
|
...
|
...
|
|