...
|
...
|
@@ -3,17 +3,16 @@ |
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
const api = global.yoho.API;
|
|
|
const _ = require('lodash');
|
|
|
const camelCase = global.yoho.camelCase;
|
|
|
const logger = global.yoho.logger;
|
|
|
|
|
|
const yohoCoin = (uid) => {
|
|
|
const _yohoCoin = (uid) => {
|
|
|
return api.get('', {
|
|
|
method: 'app.yoho.yohocoin',
|
|
|
uid: uid
|
|
|
}).then((result) => {
|
|
|
|
|
|
if (result && result.code === 200) {
|
|
|
return camelCase(result.data);
|
|
|
return result.data;
|
|
|
} else {
|
|
|
logger.error('youhocoin code no 200');
|
|
|
}
|
...
|
...
|
@@ -38,7 +37,7 @@ const bannerData = (contentCode) => { |
|
|
};
|
|
|
|
|
|
const myCurrency = (uid, contentCode) => {
|
|
|
return Promise.all([yohoCoin(uid), bannerData(contentCode)])
|
|
|
return Promise.all([_yohoCoin(uid), bannerData(contentCode)])
|
|
|
.then((result) => {
|
|
|
|
|
|
return {
|
...
|
...
|
@@ -66,9 +65,9 @@ const currencyDetail = (uid, page, limit) => { |
|
|
});
|
|
|
|
|
|
if (page && page <= total) {
|
|
|
return yohoCoin(uid).then(list => {
|
|
|
return _yohoCoin(uid).then(list => {
|
|
|
|
|
|
if (list.yohocoinNum && list.yohocoinNum !== 0) {
|
|
|
if (list.yohocoin_num && list.yohocoin_num !== 0) {
|
|
|
result.data = _.assign(result.data, {
|
|
|
money: true
|
|
|
});
|
...
|
...
|
@@ -94,6 +93,5 @@ const currencyDetail = (uid, page, limit) => { |
|
|
module.exports = {
|
|
|
myCurrency,
|
|
|
currencyDetail,
|
|
|
bannerData,
|
|
|
yohoCoin
|
|
|
bannerData
|
|
|
}; |
...
|
...
|
|