returns-api.js 1.68 KB
 /**
 * 商品基本信息
 * @author: yyq<yanqing.yang@yoho.cn>
 * @date: 2016/7/19
 */
'use strict';

const api = global.yoho.API;

const getOrderInfoAsync = (orderCode, uid, sessionKey) => {
    return api.get('', {
        method: 'app.SpaceOrders.info',
        order_code: orderCode,
        uid: uid,
        session_key: sessionKey
    }, {code: 200});
};

const getRefundGoodsAsync = (orderCode, uid) => {
    return api.get('', {
        method: 'app.refund.goodsList',
        order_code: orderCode,
        uid: uid
    }, {code: 200});
};

const getRefundDetailAsync = (applyId, uid) => {
    return api.get('', {
        method: 'app.refund.detail',
        id: applyId,
        uid: uid
    }, {code: 200});
};

const refundSubmitAsync = (orderCode, uid, goods, payment) => {
    return api.get('', {
        method: 'app.refund.submit',
        order_code: orderCode,
        uid: uid,
        goods: JSON.stringify(goods),
        payment: JSON.stringify(payment)
    }, {code: 200});
};

const getChangeGoodsListAsync = (orderCode, uid) => {
    return api.get('', {
        method: 'app.change.goodsList',
        order_code: orderCode,
        uid: uid
    });
};

const getProductInfoAsync = (productId, productSkn) => {
    return api.get('', {
        method: 'app.product.data',
        product_id: productId,
        product_skn: productSkn
    });
};

const getExchangeDetail = (id, uid) => {
    return api.get('', {
        method: 'app.change.detail',
        id: id,
        uid: uid
    });
};

module.exports = {
    getOrderInfoAsync,
    getRefundGoodsAsync,
    getChangeGoodsListAsync,
    getProductInfoAsync,
    getRefundDetailAsync,
    refundSubmitAsync,
    getExchangeDetail
};