user-data.js 980 Bytes
'use strict';

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

    getVIPInfoByUid(uid) {
        let options = {
            method: 'app.passport.growthvip',
            uid: uid
        };

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

    /**
     * [vip累计记录]
     * @param  {[uid:uid,limit:每页数量, page:第几页]} params [参数]
     * @return {[type]}        [description]
     */
    getVipRecord(params) {
        let options = {
            method: 'app.passport.growthhistory'
        };

        if (params.type === 2) {
            options = Object.assign({method: 'app.passport.growthvip'});
            delete params.type;
        }

        return this.get({data: Object.assign(options, params)});
    }

    getVipRecordDemo(params) {
        let options = {
            method: 'app.inbox.getlistnew'
        };

        return this.get({data: Object.assign(options, params)});
    }
};