detail-consult-api.js 1.06 KB
/**
 * Created by TaoHuang on 2016/6/13.
 */

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

    /**
     * 咨询内容列表
     */
    indexAsync(uid, pid, page, size) {
        let param = {};

        param.method = 'app.consult.li';
        param.product_id = pid;

        if (uid) {
            param.uid = uid;
        }

        param.page = page;
        param.limit = size;

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

    /**
     * 添加咨询操作
     */
    createAsync(uid, pid, content) {
        return this.post({data: {
            method: 'h5.consult.add',
            product_id: pid,
            content: content,
            uid: uid
        }});
    }


    likeAsync(uid, id) {
        return this.get({data: {
            method: 'app.consult.like',
            uid: uid,
            id: id
        }});
    }

    usefulAsync(uid, id) {
        return this.get({data: {
            method: 'app.consult.useful',
            uid: uid,
            id: id
        }});
    }
};