Authored by 郝肖肖

'installment-ctx'

... ... @@ -37,7 +37,7 @@ const _repaymentList = (req, res, next, opt, params) => {
uid: req.user.uid
}, params);
installmentModel.getQueryAmtList(params).then((result) => {
req.ctx(installmentModel).getQueryAmtList(params).then((result) => {
res.render('installment/repayment-list', _.assign({
module: 'home',
page: 'repayment-list',
... ... @@ -58,8 +58,8 @@ const index = (req, res, next) => {
logger.info(`installment index info: client_type=${req.query.client_type},req.user.uid=${req.user.uid},req.query.uid=${req.query.uid},cookies=${JSON.stringify(req.cookies)}`); // eslint-disable-line
Promise.all([
installmentModel.getStauts(uid),
installmentModel.getSearchIntallment({
req.ctx(installmentModel).getStauts(uid),
req.ctx(installmentModel).getSearchIntallment({
uid: uid
})
]).then((result) => {
... ... @@ -77,7 +77,10 @@ const index = (req, res, next) => {
};
if (openStatus === '0') {
return Promise.all([installmentModel.getResources('openN'), installmentModel.getNotices()]).then(data => {
return Promise.all([
req.ctx(installmentModel).getResources('openN'),
req.ctx(installmentModel).getNotices()
]).then(data => {
_.forEach(data[0], (item) => {
if (item.singleOne) {
item.data[0].url = 'javascript:void(0)'; //eslint-disable-line
... ... @@ -93,10 +96,10 @@ const index = (req, res, next) => {
});
} else if (openStatus === '2') {
return Promise.all([
installmentModel.getQueryCreditInfo(uid),
installmentModel.getQueryAmtInfo(uid),
installmentModel.getResources('openY'),
installmentModel.getNotices()
req.ctx(installmentModel).getQueryCreditInfo(uid),
req.ctx(installmentModel).getQueryAmtInfo(uid),
req.ctx(installmentModel).getResources('openY'),
req.ctx(installmentModel).getNotices()
]).then((data) => {
let params = _.assign({
isOverdue: false,
... ... @@ -161,7 +164,7 @@ const getInstallmentGoods = (req, res, next) => {
uid: req.user.uid
};
installmentModel.getSearchIntallment(params).then((result) => {
req.ctx(installmentModel).getSearchIntallment(params).then((result) => {
if (result) {
res.render('installment/goods-template', {
layout: false,
... ... @@ -192,11 +195,11 @@ const review = (req, res, next) => {
if (openStatus === '2') {
Promise.all([
installmentModel.getSearchIntallment({
req.ctx(installmentModel).getSearchIntallment({
page: 1
}),
installmentModel.getQueryCreditInfo(uid),
installmentModel.getResources('advertisement')
req.ctx(installmentModel).getQueryCreditInfo(uid),
req.ctx(installmentModel).getResources('advertisement')
]).then((result) => {
let advertisement = false;
... ... @@ -314,7 +317,7 @@ const getRepayRecord = (req, res, next) => {
pageNo: req.query.page || 1
});
installmentModel.getQueryRePayList(params).then((result) => {
req.ctx(installmentModel).getQueryRePayList(params).then((result) => {
if (result) {
res.render('installment/record-template', {
layout: false,
... ... @@ -378,7 +381,7 @@ const postAccount = (req, res, next) => {
uid: req.user.uid
}, req.query);
installmentModel.postAccount(params).then((result) => {
req.ctx(installmentModel).postAccount(params).then((result) => {
res.json(result);
}).catch((err) => {
_serverCrash(res, {
... ... @@ -417,7 +420,7 @@ function getRealIP(req) {
const activateService = (req, res, next) => {
installmentModel.activateService({
req.ctx(installmentModel).activateService({
uid: req.user.uid,
userName: req.body.userName,
identityCardNo: req.body.identityCardNo,
... ... @@ -440,7 +443,7 @@ const activateService = (req, res, next) => {
};
const getBankInfo = (req, res, next) => {
installmentModel.getBankInfo({
req.ctx(installmentModel).getBankInfo({
cardNo: req.query.cardNo,
uid: req.user.uid
}).then((result)=> {
... ... @@ -453,7 +456,7 @@ const getBankInfo = (req, res, next) => {
};
const verifyCode = (req, res, next) => {
installmentModel.sendVerifyCode(req.user.uid || 1, req.query.mobile).then((result)=> {
req.ctx(installmentModel).sendVerifyCode(req.user.uid || 1, req.query.mobile).then((result)=> {
res.json(result);
}).catch((err) => {
_serverCrash(res, {
... ... @@ -481,7 +484,7 @@ const orderList = (req, res, next) => {
limit: req.query.limit || 10
};
installmentModel.getInstallmentOrders(params).then((result)=> {
req.ctx(installmentModel).getInstallmentOrders(params).then((result)=> {
res.render('installment/order-list', {
title: '我的分期订单',
orders: ((()=> {
... ... @@ -515,7 +518,7 @@ const orderDetail = (req, res, next) => {
orderCode: req.params.id
};
installmentModel.getInstallmentOrderDetail(params).then((result)=> {
req.ctx(installmentModel).getInstallmentOrderDetail(params).then((result)=> {
res.render('installment/order-detail', {
module: 'home',
page: 'installment.order-detail',
... ... @@ -610,7 +613,7 @@ const repayDetail = (req, res, next) => {
pageNo: 1
};
installmentModel.getQueryRePayList(params).then((result) => {
req.ctx(installmentModel).getQueryRePayList(params).then((result) => {
res.render('installment/repay-detail', _.assign({
title: '还款详情',
isInstallmentPage: true,
... ... @@ -628,7 +631,7 @@ const repayDetail = (req, res, next) => {
const help = (req, res, next) => {
let id = 263;
installmentModel.getHelpDetail(id).then((result) => {
req.ctx(installmentModel).getHelpDetail(id).then((result) => {
res.render('installment/help', {
title: '分期支付帮助中心',
helpdetail_list: result.helpdetail_list
... ... @@ -646,7 +649,7 @@ const agreement = (req, res) => {
// 计算金额
const totalAmount = (req, res, next) => {
installmentModel.totalAmount(req.query.prices).then((result) => {
req.ctx(installmentModel).totalAmount(req.query.prices).then((result) => {
res.json(result);
}).catch((err) => {
_serverCrash(res, {
... ... @@ -657,7 +660,7 @@ const totalAmount = (req, res, next) => {
// 检查验证码
const checkVerifyCode = (req, res, next) => {
installmentModel.checkVerifyCode(req.user.uid, req.query.mobile, req.query.code).then((result) => {
req.ctx(installmentModel).checkVerifyCode(req.user.uid, req.query.mobile, req.query.code).then((result) => {
res.json(result);
}).catch((err) => {
_serverCrash(res, {
... ... @@ -675,7 +678,7 @@ const serverCrash = (req, res) => {
const bankCard = (req, res, next) => {
let uid = req.user.uid;
installmentModel.getBankCards(uid).then((result) => {
req.ctx(installmentModel).getBankCards(uid).then((result) => {
let noBank = true;
_.forEach(result, (val) => {
... ... @@ -706,7 +709,7 @@ const cardDetail = (req, res, next) => {
let uid = req.user.uid;
let cardIdNo = req.query.cardIdNo;
installmentModel.getCardDetail(uid, cardIdNo).then((result) => {
req.ctx(installmentModel).getCardDetail(uid, cardIdNo).then((result) => {
res.render('installment/card-detail', {
module: 'home',
page: 'card-detail',
... ... @@ -730,7 +733,7 @@ const delBankCard = (req, res, next) => {
cardIdNo: req.query.cardIdNo
};
installmentModel.delBankCard(params).then((result) => {
req.ctx(installmentModel).delBankCard(params).then((result) => {
res.json(result);
}).catch((err) => {
_serverCrash(res, {
... ... @@ -747,7 +750,7 @@ const setMasterCard = (req, res, next) => {
cardIdNo: req.query.cardIdNo
};
installmentModel.setMasterCard(params).then((result) => {
req.ctx(installmentModel).setMasterCard(params).then((result) => {
res.json(result);
}).catch((err) => {
_serverCrash(res, {
... ...
... ... @@ -9,7 +9,6 @@ const productProcess = require(`${utils}/product-process`);
const resourcesProcess = require(`${utils}/resources-process`);
const _ = require('lodash');
const helpers = global.yoho.helpers;
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const logger = global.yoho.logger;
const stringProcess = require(`${global.utils}/string-process`);
... ... @@ -19,7 +18,8 @@ const codeContent = {
openY: 'c233ad4ca91fef45ed7d0b26d9953e61',
advertisement: 'f3fe0793a7d59479542a14b15359c47d'
};
const response = require('./response.json');
const _DEBUG = false;// true;
// 处理还款列表数据
const _processAmtList = (listData, queryDays) => {
... ... @@ -29,7 +29,6 @@ const _processAmtList = (listData, queryDays) => {
currFeeCount: 0
};
if (listData !== 'NULL') {
let list = listData.amtList;
... ... @@ -175,410 +174,445 @@ const _processCardDetail = (list) => {
return list;
};
/**
* 获取资源位数据
* @return {[array]}
*/
const getResources = (code) => {
return serviceAPI.get('/operations/api/v5/resource/get', {
content_code: codeContent[code],
platform: 'iphone'
}, {
cache: true
}).then((result) => {
if (result && result.code === 200) {
return resourcesProcess(result.data);
} else {
logger.error('get resources data return code is not 200');
return [];
}
});
};
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
const response = require('./response.json');
const _DEBUG = false;// true;
/**
* 获取资源位数据
* @return {[array]}
*/
getResources(code) {
return this.get({
api: serviceAPI,
url: '/operations/api/v5/resource/get',
data: {
content_code: codeContent[code],
platform: 'iphone'
},
param: {
cache: true
}
}).then((result) => {
if (result && result.code === 200) {
return resourcesProcess(result.data);
} else {
logger.error('get resources data return code is not 200');
return [];
}
});
}
// 获取分期开通状态
const getStauts = (uid) => {
return api.get('', {
method: 'user.instalment.getStatus',
uid: uid
}, {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
return result.data.status;
} else {
logger.error(`get installment open status return code is not 200,uid:${uid},result=${JSON.stringify(result)}`); // eslint-disable-line
return Promise.reject(result);
}
});
};
// 获取分期开通状态
getStauts(uid) {
return this.get({
data: {
method: 'user.instalment.getStatus',
uid: uid
},
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
return result.data.status;
} else {
logger.error(`get installment open status return code is not 200,uid:${uid},result=${JSON.stringify(result)}`); // eslint-disable-line
return Promise.reject(result);
}
});
}
// 获取用户可用额度信息
const getQueryCreditInfo = (uid) => {
return api.get('', {
method: 'user.instalment.queryCreditLimit',
uid: uid
}, {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
logger.error('get user installment usable price info return code is not 200');
return Promise.reject(result);
}
});
};
// 获取用户可用额度信息
getQueryCreditInfo(uid) {
return this.get({
data: {
method: 'user.instalment.queryCreditLimit',
uid: uid
},
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
logger.error('get user installment usable price info return code is not 200');
return Promise.reject(result);
}
});
}
// 获取用户待还款金额
const getQueryAmtInfo = (uid) => {
return api.get('', {
method: 'app.order.queryAmtInfo',
uid: uid
}, {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
result.data.dayAmt = result.data.s_7daysAmt;
return result.data;
} else {
logger.error('get user installment repay info return code is not 200');
return Promise.reject(result);
}
});
};
// 获取用户待还款金额
getQueryAmtInfo(uid) {
return this.get({
data: {
method: 'app.order.queryAmtInfo',
uid: uid
},
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
result.data.dayAmt = result.data.s_7daysAmt;
return result.data;
} else {
logger.error('get user installment repay info return code is not 200');
return Promise.reject(result);
}
});
}
// 获取用户待还列表信息 queryDays -1:逾期待还;0:全部待还;7:七日待还;30:本月待还
getQueryAmtList(params) {
return this.get({
data: _.assign({
method: 'app.order.queryAmtList',
pageSize: '20'
}, params),
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
return _processAmtList(result.data, params.queryDays);
} else {
logger.error('get queryAmtList data return code is not 200');
return Promise.reject(result);
}
});
}
// 获取用户待还列表信息 queryDays -1:逾期待还;0:全部待还;7:七日待还;30:本月待还
const getQueryAmtList = (params) => {
return api.get('', _.assign({
method: 'app.order.queryAmtList',
pageSize: '20'
}, params), {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
return _processAmtList(result.data, params.queryDays);
} else {
logger.error('get queryAmtList data return code is not 200');
return Promise.reject(result);
}
});
};
// 分期专享推荐商品
getSearchIntallment(params) {
return this.get({
data: {
method: 'app.search.recInstal',
uid: params.uid
},
param: {
cache: true,
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
let goods = productProcess.processProductList(result.data.product_list);
// 分期专享推荐商品
const getSearchIntallment = (params) => {
return api.post('', {
method: 'app.search.recInstal',
uid: params.uid
}, {
cache: true,
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
let goods = productProcess.processProductList(result.data.product_list);
_.forEach(goods, (data) => {
data.url = helpers.appUrlFormat(data.url, 'go.productDetail', {
product_skn: data.product_skn
_.forEach(goods, (data) => {
data.url = helpers.appUrlFormat(data.url, 'go.productDetail', {
product_skn: data.product_skn
});
});
});
return goods;
} else {
logger.error('get instalment promote goods return code is not 200');
return Promise.reject(result);
}
});
};
/**
* 获取短信验证码
*
* @param uid 用户ID
* @param mobile 手机号码
*/
const sendVerifyCode = (uid, mobile) => {
return api.get('', {
method: 'user.instalment.getSnsCheckCode',
uid: uid,
mobile: mobile,
codeType: 1 // 授信
}, {
timeout: API_TIMEOUT
});
};
/**
* 开通服务
*
* @param 参数
* uid 用户id
* userName 姓名
* identityCardNo 身份证号码
* cardNo 银行卡号码
* mobile 手机号码
* snsCheckCode 验证码
* @returns {*}
*/
const activateService = (params) => {
return api.get('', Object.assign({
method: 'user.instalment.activate'
}, params), {
timeout: 30000
});
};
return goods;
} else {
logger.error('get instalment promote goods return code is not 200');
return Promise.reject(result);
}
});
}
/**
* 获取银行信息
*
* @param cardNo
* @param uid
* @returns {*}
*/
const getBankInfo = (params) => {
return api.get('', {
method: 'user.instalment.getBankInfoByCardNo',
cardNo: params.cardNo,
uid: params.uid
}, {
timeout: API_TIMEOUT
});
};
/**
* 获取短信验证码
*
* @param uid 用户ID
* @param mobile 手机号码
*/
sendVerifyCode(uid, mobile) {
return this.get({
data: {
method: 'user.instalment.getSnsCheckCode',
uid: uid,
mobile: mobile,
codeType: 1 // 授信
},
param: {
timeout: API_TIMEOUT
}
});
}
/**
* 分期订单列表
*
* @params 参数
* uid
* type 订单类型 1:全部订单,2:还款中,3:已还清
* page 页数
* limit
* @returns {*}
*/
const getInstallmentOrders = (params) => {
const method = 'app.SpaceOrders.getInstallment';
if (!_DEBUG) {
return api.get('', {
method: method,
uid: params.uid,
type: params.type || 1,
page: params.page || 1,
limit: params.limit || 10
}, {
timeout: API_TIMEOUT
}).then((result) => {
return Promise.resolve(result);
/**
* 开通服务
*
* @param 参数
* uid 用户id
* userName 姓名
* identityCardNo 身份证号码
* cardNo 银行卡号码
* mobile 手机号码
* snsCheckCode 验证码
* @returns {*}
*/
activateService(params) {
return this.get({
data: Object.assign({
method: 'user.instalment.activate'
}, params),
param: {
timeout: 30000
}
});
} else {
return Promise.resolve(response[method]);
}
};
// 还款记录查询
const getQueryRePayList = (params) => {
return api.get('', _.assign({
method: 'app.order.queryRePayList',
pageSize: '20'
}, params), {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
return _processRepayList(result.data);
} else {
logger.error('get queryRePayList data return code is not 200');
return {};
}
});
};
/**
* 获取银行信息
*
* @param cardNo
* @param uid
* @returns {*}
*/
getBankInfo(params) {
return this.get({
data: {
method: 'user.instalment.getBankInfoByCardNo',
cardNo: params.cardNo,
uid: params.uid
},
param: {
timeout: API_TIMEOUT
}
});
}
// 账号管理
const getBankCards = (uid) => {
return api.get('', {
method: 'user.instalment.getBankCards',
uid: uid
}, {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
return _processBankCards(result.data);
/**
* 分期订单列表
*
* @params 参数
* uid
* type 订单类型 1:全部订单,2:还款中,3:已还清
* page 页数
* limit
* @returns {*}
*/
getInstallmentOrders(params) {
const method = 'app.SpaceOrders.getInstallment';
if (!_DEBUG) {
return this.get({
data: {
method: method,
uid: params.uid,
type: params.type || 1,
page: params.page || 1,
limit: params.limit || 10
},
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
return Promise.resolve(result);
});
} else {
logger.error('get getBankCards data return code is not 200');
return '';
return Promise.resolve(response[method]);
}
});
};
/**
* 获取订单号
*
* @param 参数
* orderCode 订单号
*
* @returns {*}
*/
const getInstallmentOrderDetail = (params) => {
const method = 'app.SpaceOrders.installDetail';
}
if (!params.uid || !params.orderCode || !stringProcess.isNumeric(params.orderCode)) {
return Promise.resolve({});
// 还款记录查询
getQueryRePayList(params) {
return this.get({
data: _.assign({
method: 'app.order.queryRePayList',
pageSize: '20'
}, params),
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
return _processRepayList(result.data);
} else {
logger.error('get queryRePayList data return code is not 200');
return {};
}
});
}
return api.get('', {
method: method,
uid: params.uid,
order_code: params.orderCode
}, {
timeout: API_TIMEOUT
}).then((result)=> {
return Promise.resolve(result);
});
};
// 账号管理
getBankCards(uid) {
return this.get({
data: {
method: 'user.instalment.getBankCards',
uid: uid
},
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
return _processBankCards(result.data);
} else {
logger.error('get getBankCards data return code is not 200');
return '';
}
});
}
/**
* 计算总金额
*
* @param params 金额
*
* @returns {*|Promise.<TResult>}
*/
const totalAmount = (params) => {
const method = 'app.order.calPrice';
return api.get('', {
method: method,
prices: params
}, {
timeout: API_TIMEOUT
}).then((result)=> {
return Promise.resolve(result);
});
};
/**
* 获取订单号
*
* @param 参数
* orderCode 订单号
*
* @returns {*}
*/
getInstallmentOrderDetail(params) {
const method = 'app.SpaceOrders.installDetail';
if (!params.uid || !params.orderCode || !stringProcess.isNumeric(params.orderCode)) {
return Promise.resolve({});
}
return this.get({
data: {
method: method,
uid: params.uid,
order_code: params.orderCode
},
param: {
timeout: API_TIMEOUT
}
}).then((result)=> {
return Promise.resolve(result);
});
}
const checkVerifyCode = (uid, mobile, code) => {
const method = 'user.instalment.validateSnsCheckCode';
/**
* 计算总金额
*
* @param params 金额
*
* @returns {*|Promise.<TResult>}
*/
totalAmount(params) {
const method = 'app.order.calPrice';
return this.get({
data: {
method: method,
prices: params
},
param: {
timeout: API_TIMEOUT
}
}).then((result)=> {
return Promise.resolve(result);
});
}
return api.get('', {
uid: uid,
method: method,
mobile: mobile,
snsCheckCode: code,
codeType: 1 // 授信
}, {
timeout: API_TIMEOUT
}).then((result)=> {
return Promise.resolve(result);
});
};
checkVerifyCode(uid, mobile, code) {
const method = 'user.instalment.validateSnsCheckCode';
return this.get({
data: {
uid: uid,
method: method,
mobile: mobile,
snsCheckCode: code,
codeType: 1 // 授信
},
param: {
timeout: API_TIMEOUT
}
}).then((result)=> {
return Promise.resolve(result);
});
}
// 添加银行卡请求
const postAccount = (params) => {
return api.get('', _.assign({
method: 'user.instalment.bindingCards'
}, params), {
timeout: 6000
});
};
// 添加银行卡请求
postAccount(params) {
return this.get({
data: _.assign({
method: 'user.instalment.bindingCards'
}, params),
param: {
timeout: 6000
}
});
}
// 获取银行卡详情
const getCardDetail = (uid, cardIdNo) => {
return api.get('', {
method: 'user.instalment.getBankCardDetail',
uid: uid,
cardIdNo: cardIdNo
}, {
timeout: API_TIMEOUT
}).then((result) => {
if (result && result.code === 200) {
return _processCardDetail(result.data);
} else {
logger.error('get getBankCards data return code is not 200');
return Promise.reject(result);
}
});
};
// 获取银行卡详情
getCardDetail(uid, cardIdNo) {
return this.get({
data: {
method: 'user.instalment.getBankCardDetail',
uid: uid,
cardIdNo: cardIdNo
},
param: {
timeout: API_TIMEOUT
}
}).then((result) => {
if (result && result.code === 200) {
return _processCardDetail(result.data);
} else {
logger.error('get getCardDetail data return code is not 200');
return Promise.reject(result);
}
});
}
// 解除银行卡绑定
const delBankCard = (params) => {
return api.get('', _.assign({
method: 'user.instalment.unbindCard'
}, params)).then((res) => {
return res;
});
};
// 解除银行卡绑定
delBankCard(params) {
return this.get({
data: _.assign({
method: 'user.instalment.unbindCard'
}, params)
});
}
// 切换银行卡主卡
const setMasterCard = (params) => {
return api.get('', _.assign({
method: 'user.instalment.toggleCard'
}, params)).then((res) => {
return res;
});
};
// 切换银行卡主卡
setMasterCard(params) {
return this.get({
data: _.assign({
method: 'user.instalment.toggleCard'
}, params)
});
}
// 公告
const getNotices = () => {
return api.get('', {
method: 'app.resources.getNotices',
position: 8
}, {
cache: true
}).then((res) => {
if (res && res.code === 200) {
if (res.data && res.data.list.length < 1) {
return false;
// 公告
getNotices() {
return this.get({
data: {
method: 'app.resources.getNotices',
position: 8
},
param: {
cache: true
}
}).then((res) => {
if (res && res.code === 200) {
if (res.data && res.data.list.length < 1) {
return false;
} else {
return res.data;
}
} else {
return res.data;
return false;
}
} else {
return false;
}
});
};
// 帮助中心
const getHelpDetail = (id) => {
return api.get('', {
method: 'app.helper.detail',
id: id
}, {
cache: true
}).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
return false;
}
});
};
});
}
module.exports = {
getStauts,
getQueryCreditInfo,
getQueryAmtInfo,
getSearchIntallment,
sendVerifyCode,
activateService,
getResources,
getQueryAmtList,
getQueryRePayList,
getBankCards,
getBankInfo,
getInstallmentOrders,
getInstallmentOrderDetail,
totalAmount,
checkVerifyCode,
postAccount,
getCardDetail,
delBankCard,
setMasterCard,
getNotices,
getHelpDetail
// 帮助中心
getHelpDetail(id) {
return this.get({
data: {
method: 'app.helper.detail',
id: id
},
param: {
cache: true
}
}).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
return false;
}
});
}
};
... ...