help.js
2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* 帮助中心
* @author: jiangmin
* @date: 2016/07/27
*/
'use strict';
const api = global.yoho.API;
/**
* 分类数据
* @returns {{}}
*/
const menuData = ()=> {
return {
menuData: [
{
id: "1",
text: "购物指南"
},
{
id: "2",
text: "支付方式"
},
{
id: "3",
text: "配送方式",
subsets: [
{
id: "31",
parendId: "3",
text: "配送时间与范围"
},
{
id: "32",
parendId: "3",
text: "商品验收与签收"
}
]
},
{
id: "4",
text: "售后服务",
subsets: [
{
id: "41",
parendId: "4",
text: "投诉与建议"
},
{
id: "42",
parendId: "4",
text: "退换货流程"
},
{
id: "43",
parendId: "4",
text: "退换货政策"
}
]
}
]
};
};
/**
* 文章数据
* @returns {{content: *[]}}
*/
const contentData = ()=> {
return {
content: [
{
id: "11",
content: "<h1>你好</h1><p>测试11</p>"
},
{
id: "12",
content: "<h1>你好</h1><p>测试12</p>"
},
{
id: "13",
content: "<h1>你好</h1><p>测试13</p>"
}
]
}
};
/**
* 查看问题详情
* @param cateId
* @param page
* @param limit
* @param problem
*/
const getHelpDetail = (cateId, page, limit, problem)=> {
return api.get('', {
method: 'web.help.getHelpDetailList',
category_id: cateId,
page: page,
limit: limit,
problem: problem
}).then(result => result.data);
};
module.exports = {
menuData,
contentData,
getHelpDetail
};