|
@@ -3,17 +3,16 @@ |
|
@@ -3,17 +3,16 @@ |
3
|
const serviceAPI = global.yoho.ServiceAPI;
|
3
|
const serviceAPI = global.yoho.ServiceAPI;
|
4
|
const api = global.yoho.API;
|
4
|
const api = global.yoho.API;
|
5
|
const _ = require('lodash');
|
5
|
const _ = require('lodash');
|
6
|
-const camelCase = global.yoho.camelCase;
|
|
|
7
|
const logger = global.yoho.logger;
|
6
|
const logger = global.yoho.logger;
|
8
|
|
7
|
|
9
|
-const yohoCoin = (uid) => {
|
8
|
+const _yohoCoin = (uid) => {
|
10
|
return api.get('', {
|
9
|
return api.get('', {
|
11
|
method: 'app.yoho.yohocoin',
|
10
|
method: 'app.yoho.yohocoin',
|
12
|
uid: uid
|
11
|
uid: uid
|
13
|
}).then((result) => {
|
12
|
}).then((result) => {
|
14
|
|
13
|
|
15
|
if (result && result.code === 200) {
|
14
|
if (result && result.code === 200) {
|
16
|
- return camelCase(result.data);
|
15
|
+ return result.data;
|
17
|
} else {
|
16
|
} else {
|
18
|
logger.error('youhocoin cood 不是 200');
|
17
|
logger.error('youhocoin cood 不是 200');
|
19
|
}
|
18
|
}
|
|
@@ -38,7 +37,7 @@ const bannerData = (contentCode) => { |
|
@@ -38,7 +37,7 @@ const bannerData = (contentCode) => { |
38
|
};
|
37
|
};
|
39
|
|
38
|
|
40
|
const myCurrency = (uid, contentCode) => {
|
39
|
const myCurrency = (uid, contentCode) => {
|
41
|
- return Promise.all([yohoCoin(uid), bannerData(contentCode)])
|
40
|
+ return Promise.all([_yohoCoin(uid), bannerData(contentCode)])
|
42
|
.then((result) => {
|
41
|
.then((result) => {
|
43
|
|
42
|
|
44
|
return {
|
43
|
return {
|
|
@@ -60,9 +59,9 @@ const currencyDetail = (uid, page, limit) => { |
|
@@ -60,9 +59,9 @@ const currencyDetail = (uid, page, limit) => { |
60
|
let total = parseInt(result.data.page_total, 10) + 1;
|
59
|
let total = parseInt(result.data.page_total, 10) + 1;
|
61
|
|
60
|
|
62
|
if (page && page <= total) {
|
61
|
if (page && page <= total) {
|
63
|
- return yohoCoin(uid).then(list => {
|
62
|
+ return _yohoCoin(uid).then(list => {
|
64
|
|
63
|
|
65
|
- if (list.yohocoinNum && list.yohocoinNum !== 0) {
|
64
|
+ if (list.yohocoin_num && list.yohocoin_num !== 0) {
|
66
|
result.data = _.assign(result.data, {
|
65
|
result.data = _.assign(result.data, {
|
67
|
money: true
|
66
|
money: true
|
68
|
});
|
67
|
});
|
|
@@ -88,6 +87,5 @@ const currencyDetail = (uid, page, limit) => { |
|
@@ -88,6 +87,5 @@ const currencyDetail = (uid, page, limit) => { |
88
|
module.exports = {
|
87
|
module.exports = {
|
89
|
myCurrency,
|
88
|
myCurrency,
|
90
|
currencyDetail,
|
89
|
currencyDetail,
|
91
|
- bannerData,
|
|
|
92
|
- yohoCoin
|
90
|
+ bannerData
|
93
|
}; |
91
|
}; |