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,38 +72,37 @@ const helpListDataProc = (helpData) => { @@ -72,38 +72,37 @@ const helpListDataProc = (helpData) => {
72 72
73 73
74 /** 74 /**
75 - * 帮助中心 75 + * 帮助中心列表页
76 * 76 *
77 - * @param req  
78 - * @param res  
79 - * @param next 77 + * @param data
  78 + *
80 */ 79 */
  80 +exports.getHelpInfo = (data) => {
  81 + var defaultParam = {
  82 + method: 'app.help.li'
  83 + },
  84 + infoData = Object.assign(defaultParam, data);
81 85
82 -let home = {  
83 - getHelpInfo(data) {  
84 - var defaultParam = {  
85 - method: 'app.help.li'  
86 - },  
87 - infoData = Object.assign(defaultParam, data);  
88 -  
89 - return api.get('', infoData).then(result => { 86 + return api.get('', infoData).then(result => {
90 87
91 - return helpListDataProc(result.data);  
92 - });  
93 - }, 88 + return helpListDataProc(result.data);
  89 + });
  90 +}
94 91
95 - getHelpDetail(data) {  
96 - var defaultParam = { 92 +/**
  93 + * 帮助中心详情页
  94 + *
  95 + * @param data
  96 + */
  97 +exports.getHelpDetail = (data) => {
  98 + var defaultParam = {
97 method: 'app.help.detail', 99 method: 'app.help.detail',
98 return_type: 'html' 100 return_type: 'html'
99 }, 101 },
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;