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

'use strict';

module.exports = class extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);
    }

    // 获取热词搜索
    getHotSearch() {

        let data = {
            method: 'app.helper.hotSearch',
            showPlatform: 'yohobuy_pc'
        };

        return this.get({
            data: data,
            param: {
                code: 200,
                cache: true
            }
        });
    }

    // 获取首页帮助分类以及常见问题
    gethomeCategoryFaq() {

        let data = {
            method: 'app.helper.homeCategoryFaq',
            showPlatform: 'yohobuy_pc'
        };

        return this.get({
            data: data,
            param: {
                code: 200,
                cache: true
            }
        });
    }

    // 获取自助服务
    getSelfService() {

        let data = {
            method: 'app.helper.selfService',
            showPlatform: 'yohobuy_pc'
        };

        return this.get({
            data: data,
            param: {
                code: 200
            }
        });
    }

    helpSearch(params) {

        let data = {
            method: 'app.helper.search',
            showPlatform: 'yohobuy_pc',
            keyword: params.keywords,
            page: params.page,
            viewNum: '15',
            debug: 'XYZ'
        };

        return this.get({
            data: data,
            param: {
                code: 200
            }
        });
    }

    allQA(page) {

        let data = {
            method: 'app.helper.allQA',
            showPlatform: 'yohobuy_pc',
            viewNum: 15,
            page: page
        };

        return this.get({
            data: data,
            param: {
                code: 200
            }
        });
    }

    onlineService() {
        return this.get({
            data: {
                method: 'app.helper.getServiceOnline'
            }
        });
    }
};