Authored by 郭成尧

camlcase

... ... @@ -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 cood 不是 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 {
... ... @@ -60,9 +59,9 @@ const currencyDetail = (uid, page, limit) => {
let total = parseInt(result.data.page_total, 10) + 1;
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
});
... ... @@ -88,6 +87,5 @@ const currencyDetail = (uid, page, limit) => {
module.exports = {
myCurrency,
currencyDetail,
bannerData,
yohoCoin
bannerData
};
... ...
... ... @@ -2,7 +2,7 @@
<div class="coin">
{{# yohoCoin}}
<p class="coin-num">
{{yohocoinNum}}
{{yohocoin_num}}
</p>
<p class="info">
<span class="dollar"></span>
... ... @@ -21,7 +21,7 @@
{{# banner}}
{{# data}}
<a href="{{url}}">
<img src="{{image src 640 200 2}}" alt="img">
<img src="{{image src 640 200}}" alt="img">
</a>
{{/ data}}
{{/ banner}}
... ...
<div class="yoho-coin-page yoho-page">
{{# yohoCoin}}
<p class="coin-num">
<em>{{coinNum}}</em>
<em>{{coin_num}}</em>
有货币
</p>
... ...