help-api.js 1.47 KB
/**
 * 帮助中心首页
 * @author: wsl<shuiling.wang@yoho.cn>
 * @date: 2016/12/13
 */

'use strict';

const api = global.yoho.API;

// 获取热词搜索
const getHotSearch = () => {
    return api.get('', {
        method: 'app.helper.hotSearch',
        showPlatform: 'yohobuy_pc'
    }, {
        code: 200,
        cache: true
    });
};

// 获取首页帮助分类以及常见问题
const gethomeCategoryFaq = () => {
    return api.get('', {
        method: 'app.helper.homeCategoryFaq',
        showPlatform: 'yohobuy_pc'
    }, {
        code: 200,
        cache: true
    });
};

// 获取自助服务
const getSelfService = () => {
    return api.get('', {
        method: 'app.helper.selfService',
        showPlatform: 'yohobuy_pc'
    }, {
        code: 200
    });
};

const helpSearch = (params) => {
    return api.get('', {
        method: 'app.helper.search',
        showPlatform: 'yohobuy_pc',
        keyword: params.keywords,
        page: params.page,
        viewNum: '15',
        debug: 'XYZ'
    }, {
        code: 200
    });
};

const allQA = (page) => {
    return api.get('', {
        method: 'app.helper.allQA',
        showPlatform: 'yohobuy_pc',
        viewNum: 15,
        page: page
    }, {
        code: 200
    });
};

const onlineService = () => {
    return api.get('', {
        method: 'app.helper.getServiceOnline'
    });
};

module.exports = {
    getHotSearch,
    gethomeCategoryFaq,
    getSelfService,
    helpSearch,
    allQA,
    onlineService
};