help.js 2.37 KB
/**
 * 帮助中心
 * @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
};