...
|
...
|
@@ -28,6 +28,15 @@ NEXT_BTN_PROCESSING_FAILURE, |
|
|
|
|
|
SET_INSTALLMENT_STATUS_PAGE_ORIGINAL_INFO,
|
|
|
SET_INSTALLMENT_STATUS_PAGE_GOODS,
|
|
|
SET_STATUS_PAGE_ADVERTISEMENT,
|
|
|
|
|
|
SET_ALREADY_PAGE_TAB_FOCUS_INDEX,
|
|
|
SET_ALREADY_PAGE_GOODS,
|
|
|
SET_ALREADY_PAGE_CONTENT,
|
|
|
SET_ALREADY_PAGE_NOTICE,
|
|
|
SET_ALREADY_PAGE_AMT_INFO,
|
|
|
SET_ALREADY_PAGE_OVERDUE_STATUS,
|
|
|
SET_ALREADY_PAGE_CREDIT_INFO,
|
|
|
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
const codeContent = {
|
...
|
...
|
@@ -60,9 +69,10 @@ export function productListForInstallmentFailure(){ |
|
|
}
|
|
|
}
|
|
|
|
|
|
export function featchInstallmentStatusRequest() {
|
|
|
export function featchInstallmentStatusRequest(uid) {
|
|
|
return {
|
|
|
type: GET_INSTALLMENT_STATUS_REQUEST,
|
|
|
payload: uid
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -159,6 +169,62 @@ export function setInstallmentStatusPageGoods(goods) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
export function setStatusPageAdvertisement(advertisement) {
|
|
|
return {
|
|
|
type: SET_STATUS_PAGE_ADVERTISEMENT,
|
|
|
payload: advertisement
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function setAlreadyPageTabFocusIndex(index) {
|
|
|
return {
|
|
|
type: SET_ALREADY_PAGE_TAB_FOCUS_INDEX,
|
|
|
payload: index
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function setAlreadPageGoods(goods) {
|
|
|
return {
|
|
|
type: SET_ALREADY_PAGE_GOODS,
|
|
|
payload: goods
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function setAlreadPageContent(content) {
|
|
|
return {
|
|
|
type: SET_ALREADY_PAGE_CONTENT,
|
|
|
payload: content
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function setAlreadPageNotices(notice) {
|
|
|
return {
|
|
|
type: SET_ALREADY_PAGE_NOTICE,
|
|
|
payload: notice
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function setAlreadPageAmtInfo(info) {
|
|
|
return {
|
|
|
type: SET_ALREADY_PAGE_AMT_INFO,
|
|
|
payload: info
|
|
|
}
|
|
|
}//
|
|
|
|
|
|
export function setAlreadPageOverdueStatus(status) {
|
|
|
return {
|
|
|
type: SET_ALREADY_PAGE_OVERDUE_STATUS,
|
|
|
payload: status
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function setAlreadPageCreditInfo(creditInfo) {
|
|
|
return {
|
|
|
type: SET_ALREADY_PAGE_CREDIT_INFO,
|
|
|
payload: creditInfo,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function productListForInstallment() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
...
|
...
|
@@ -217,14 +283,26 @@ export function getInstallmentStatus() { |
|
|
|
|
|
let installmentStatus = (uid) => {
|
|
|
let {app, installment} = getState();
|
|
|
dispatch(featchInstallmentStatusRequest());
|
|
|
dispatch(featchInstallmentStatusRequest(uid));
|
|
|
return new InstallmentService(app.host).getStauts(uid)
|
|
|
.then(json => {
|
|
|
let status = 0;
|
|
|
if (json.status) {
|
|
|
status = json.status;
|
|
|
let status = 'New';
|
|
|
switch (json.status) {
|
|
|
case '0':
|
|
|
status = 'New';
|
|
|
break;
|
|
|
case '2':
|
|
|
status = 'AlreadyOpned';
|
|
|
break;
|
|
|
case '1':
|
|
|
case '3':
|
|
|
case '4':
|
|
|
case '5':
|
|
|
status = 'OpenStatus';
|
|
|
break;
|
|
|
default:
|
|
|
}
|
|
|
dispatch(productListForInstallment());
|
|
|
dispatch(featchInstallmentStatusSuccess(status));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(featchInstallmentStatusFailure(error));
|
...
|
...
|
@@ -261,10 +339,10 @@ export function onPressOpenNext() { |
|
|
let {nextBtnEnable,cellList,nextProcessing} = installment.openPageInfo;
|
|
|
let activateParams = {};
|
|
|
let newCellList = cellList;
|
|
|
if (!nextBtnEnable) {
|
|
|
return;
|
|
|
}
|
|
|
// ReactNative.NativeModules.YH_InstallmentHelper.gotoInstallmentStatusView('5', '您的授信未通过,在有货更多的消费,增加信用度,会大大提升审核通过率奥。');
|
|
|
// if (!nextBtnEnable) {
|
|
|
// return;
|
|
|
// }
|
|
|
ReactNative.NativeModules.YH_InstallmentHelper.gotoInstallmentStatusView('2', '您的授信未通过,在有货更多的消费,增加信用度,会大大提升审核通过率奥。');
|
|
|
return;
|
|
|
cellList.map((item, i) => {
|
|
|
if (item.get('inputKey') != 'BankIcon') {
|
...
|
...
|
@@ -273,11 +351,9 @@ export function onPressOpenNext() { |
|
|
});
|
|
|
let activateService = (uid) => {
|
|
|
dispatch(nextBtnProcessingRequest());
|
|
|
console.log('----0000');
|
|
|
return new InstallmentService(app.host).checkVerifyCode(uid, activateParams.mobile, activateParams.snsCheckCode)
|
|
|
.then(json => {
|
|
|
if (json.result === '1') {
|
|
|
|
|
|
return new InstallmentService(app.host).activateService(activateParams)
|
|
|
}else {
|
|
|
newCellList.map((item, i) => {
|
...
|
...
|
@@ -515,7 +591,7 @@ export function onPressCheckCode() { |
|
|
if (snsCheckCodeEnable && snsCheckCodeText == '获取验证码') {
|
|
|
return new InstallmentService(app.host).sendVerifyCode('17705176933')
|
|
|
.then(json => {
|
|
|
|
|
|
|
|
|
let status = 0;
|
|
|
let snsText = '';
|
|
|
new Timer().startCountdown(function() {
|
...
|
...
|
@@ -547,8 +623,6 @@ export function setInstallmentStausPageParams(statusCode, failReason, uid) { |
|
|
//请求用户信用额度
|
|
|
return new InstallmentService(app.host).getQueryCreditInfo('5448919')
|
|
|
.then(json => {
|
|
|
console.log('---额度');
|
|
|
console.log(json);
|
|
|
status = 'success',
|
|
|
statusInfo = {
|
|
|
message: '可用额度',
|
...
|
...
|
@@ -627,11 +701,17 @@ export function setInstallmentStausPageParams(statusCode, failReason, uid) { |
|
|
export function getInstallmentProductAndAdvertisement(page) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
|
|
return new InstallmentService(app.host).getSearchIntallment(page)
|
|
|
return new InstallmentService(app.host).fetchInstallmentProductList(page)
|
|
|
.then(json => {
|
|
|
dispatch(setInstallmentStatusPageGoods(json.product_list))
|
|
|
console.log('goods');
|
|
|
console.log(json);
|
|
|
let content_code = codeContent['advertisement'];
|
|
|
return new InstallmentService(app.serviceHost).getResources(content_code)
|
|
|
})
|
|
|
.then(json => {
|
|
|
let advertisement = false;
|
|
|
if (json && json.length > 1) {
|
|
|
advertisement = json[0].data[0];
|
|
|
}
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
...
|
...
|
@@ -650,3 +730,83 @@ export function onPressStatusPageBtn(page) { |
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function getAlreadPageGoods() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
|
|
return new InstallmentService(app.host).fetchInstallmentProductList(1)
|
|
|
.then(json => {
|
|
|
dispatch(setAlreadPageGoods(json.product_list))
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function getAlreadPageResources() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
|
|
let content_code = codeContent['openY'];
|
|
|
return new InstallmentService(app.serviceHost).getResources(content_code)
|
|
|
.then(json => {
|
|
|
dispatch(setAlreadPageContent(json))
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function getAlreadPageNotices() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
|
|
return new InstallmentService(app.host).getNotices()
|
|
|
.then(json => {
|
|
|
dispatch(setAlreadPageNotices(json))
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function getAlreadPageAmtInfo(uid) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
|
|
return new InstallmentService(app.host).getAmtInfo(uid)
|
|
|
.then(json => {
|
|
|
json.dayAmt = json.s_7daysAmt;
|
|
|
dispatch(setAlreadPageAmtInfo(json))
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function getAlreadPageCreditInfo(uid) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
|
|
return new InstallmentService(app.host).getQueryCreditInfo(uid)
|
|
|
.then(json => {
|
|
|
dispatch(setAlreadPageCreditInfo(json))
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getAlreadyPageInfo() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, installment} = getState();
|
|
|
let {uid} = installment;
|
|
|
dispatch(getAlreadPageGoods());
|
|
|
dispatch(getAlreadPageResources());
|
|
|
dispatch(getAlreadPageNotices());
|
|
|
dispatch(getAlreadPageAmtInfo(uid));
|
|
|
dispatch(getAlreadPageCreditInfo(uid));
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function onPressTabBtn() {
|
|
|
return (dispatch, getState) => {
|
|
|
ReactNative.NativeModules.YH_InstallmentHelper.helpAction();
|
|
|
};
|
|
|
} |
...
|
...
|
|