Blame view

apps/product/models/detail-consult-api.js 665 Bytes
htoooth authored
1 2 3 4 5 6
/**
 * Created by TaoHuang on 2016/6/13.
 */

'use strict';
htoooth authored
7
const api = global.yoho.API;
htoooth authored
8 9 10 11

/**
 * 咨询内容列表
 */
htoooth authored
12
const indexAsync = function(uid, pid, page, size) {
htoooth authored
13
    let param = {};
htoooth authored
14
htoooth authored
15 16 17 18 19 20 21 22 23 24
    param.method = 'app.consult.li';
    param.product_id = pid;

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

    param.page = page;
    param.limit = size;
htoooth authored
25
    return api.get('', param);
htoooth authored
26 27 28 29 30
};

/**
 * 添加咨询操作
 */
htoooth authored
31 32
const createAsync = function(uid, pid, content) {
    return api.post('', {
htoooth authored
33 34 35 36
        method: 'h5.consult.add',
        product_id: pid,
        content: content,
        uid: uid
htoooth authored
37 38 39 40 41 42
    });
};

module.exports = {
    indexAsync,
    createAsync
htoooth authored
43
};