qrcode-api.js 745 Bytes
/**
 * 个人中心二维码 model
 * @author: weiqingting<qingting.wei@yoho.cn>
 * @date: 2016/05/16
 */
'use strict';

const logger = global.yoho.logger;

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

    getQRcodeData(id, uid) {
        let options = {
            method: 'app.SpaceOrders.getQrByOrderCode',
            order_code: id,
            uid: uid
        };

        return this.get({data: options}).then(result => {
            if (result && result.code === 200) {
                return result.data;
            } else {
                logger.error(`查看二维码ID: ${id}  接口返回数据错误`);
                return false;
            }
        });
    }
};