Authored by 郭成尧

camlcase

@@ -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 };
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div class="coin"> 2 <div class="coin">
3 {{# yohoCoin}} 3 {{# yohoCoin}}
4 <p class="coin-num"> 4 <p class="coin-num">
5 - {{yohocoinNum}} 5 + {{yohocoin_num}}
6 </p> 6 </p>
7 <p class="info"> 7 <p class="info">
8 <span class="dollar"></span> 8 <span class="dollar"></span>
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 {{# banner}} 21 {{# banner}}
22 {{# data}} 22 {{# data}}
23 <a href="{{url}}"> 23 <a href="{{url}}">
24 - <img src="{{image src 640 200 2}}" alt="img"> 24 + <img src="{{image src 640 200}}" alt="img">
25 </a> 25 </a>
26 {{/ data}} 26 {{/ data}}
27 {{/ banner}} 27 {{/ banner}}
1 <div class="yoho-coin-page yoho-page"> 1 <div class="yoho-coin-page yoho-page">
2 {{# yohoCoin}} 2 {{# yohoCoin}}
3 <p class="coin-num"> 3 <p class="coin-num">
4 - <em>{{coinNum}}</em> 4 + <em>{{coin_num}}</em>
5 有货币 5 有货币
6 </p> 6 </p>
7 7