Authored by 张丽霞

帮助中心

@@ -5,11 +5,8 @@ @@ -5,11 +5,8 @@
5 */ 5 */
6 'use strict'; 6 'use strict';
7 const homeModel = require('../models/index'); 7 const homeModel = require('../models/index');
8 -  
9 -  
10 const _ = require('lodash'); 8 const _ = require('lodash');
11 const helpers = global.yoho.helpers; 9 const helpers = global.yoho.helpers;
12 -const model = require('../models/index');  
13 10
14 /** 11 /**
15 * 个人中心主页 12 * 个人中心主页
@@ -25,7 +22,7 @@ const component = { @@ -25,7 +22,7 @@ const component = {
25 }); 22 });
26 } 23 }
27 24
28 - model.getUserHomeData(uid).then(data => { 25 + homeModel.getUserHomeData(uid).then(data => {
29 var result = { 26 var result = {
30 module: 'home', 27 module: 'home',
31 page: 'index', 28 page: 'index',
@@ -72,15 +72,12 @@ const helpListDataProc = (helpData) => { @@ -72,15 +72,12 @@ const helpListDataProc = (helpData) => {
72 72
73 73
74 /** 74 /**
75 - * 帮助中心 75 + * 帮助中心列表页
  76 + *
  77 + * @param data
76 * 78 *
77 - * @param req  
78 - * @param res  
79 - * @param next  
80 */ 79 */
81 -  
82 -let home = {  
83 - getHelpInfo(data) { 80 +exports.getHelpInfo = (data) => {
84 var defaultParam = { 81 var defaultParam = {
85 method: 'app.help.li' 82 method: 'app.help.li'
86 }, 83 },
@@ -90,9 +87,14 @@ let home = { @@ -90,9 +87,14 @@ let home = {
90 87
91 return helpListDataProc(result.data); 88 return helpListDataProc(result.data);
92 }); 89 });
93 - }, 90 +}
94 91
95 - getHelpDetail(data) { 92 +/**
  93 + * 帮助中心详情页
  94 + *
  95 + * @param data
  96 + */
  97 +exports.getHelpDetail = (data) => {
96 var defaultParam = { 98 var defaultParam = {
97 method: 'app.help.detail', 99 method: 'app.help.detail',
98 return_type: 'html' 100 return_type: 'html'
@@ -100,10 +102,7 @@ let home = { @@ -100,10 +102,7 @@ let home = {
100 detailData = Object.assign(defaultParam, data); 102 detailData = Object.assign(defaultParam, data);
101 103
102 return api.get('', detailData).then(result => { 104 return api.get('', detailData).then(result => {
103 - console.log(result);  
104 return result; 105 return result;
105 }); 106 });
106 - }  
107 -}; 107 +}
108 108
109 -module.exports = home;