cart-service.js
424 Bytes
/**
* Created by TaoHuang on 2016/9/28.
*/
'use strict';
const Api = require('./cart-api');
const _ = require('lodash');
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
this.api = new Api(ctx);
}
goodsCount(uid, shoppingKey) {
return this.api.goodsCount(uid, shoppingKey).then(result => _.get(result, 'data.cart_goods_count', 0));
}
};