|
|
/**
|
|
|
* 购物车模型 model
|
|
|
* @author: jinhu.dong<jinhu.dong@yoho.cn>
|
|
|
* @date: 2016/07/04
|
|
|
*/
|
|
|
'use strict';
|
|
|
|
|
|
var Promise = require('bluebird');
|
|
|
|
|
|
// const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
|
|
|
// const sign = require(`${global.library}/sign`);
|
|
|
// const logger = require(`${global.library}/logger`);
|
|
|
// const headerModel = require('../../../doraemon/models/header');
|
|
|
|
|
|
// var api = new ServiceAPI();
|
|
|
|
|
|
// 获取预售商品
|
|
|
const getPreSaleProducts = () => {
|
|
|
return Promise.resolve({
|
|
|
preSalePros: [{
|
|
|
productName: 'Alle nove 小方领长袖衬衫【哥本哈根】'
|
|
|
}]
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 获取普通商品
|
|
|
const getNormalProducts = () => {
|
|
|
return Promise.resolve({
|
|
|
commonPros: [{ gender: '1',
|
|
|
tags: ['Object'],
|
|
|
status: 1,
|
|
|
smallSortId: 115,
|
|
|
vip1Price: 379.04999999999995,
|
|
|
isGlobal: 'N',
|
|
|
vip3Price: 351.12,
|
|
|
isOutlets: 2,
|
|
|
isDiscount: 'Y',
|
|
|
brandDomain: 'allenove',
|
|
|
isSpecial: 'N',
|
|
|
goodsList: ['Object'],
|
|
|
isAdvance: 'N',
|
|
|
productId: 286137,
|
|
|
vipDiscountType: 1,
|
|
|
salesNum: 0,
|
|
|
cnAlphabet: 'ALLENOVE95S12SaiWeiLiYa',
|
|
|
productSkn: 51160999,
|
|
|
shelveTime: 1455616165,
|
|
|
vip2Price: 359.1,
|
|
|
editTime: 1455616165,
|
|
|
isNew: 'N',
|
|
|
isLimited: 'N',
|
|
|
brandName: 'Alle nove',
|
|
|
maxSortId: 1,
|
|
|
productName: 'Alle nove 暗扣领长袖衬衫【塞维利亚】',
|
|
|
brandId: 1007,
|
|
|
defaultImages: 'http://img10.static.yhbimg.com/goodsimg/2015/10/21/03/01d7c265b0fa3fe1a582a73ad9175eab69.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
|
|
|
stockNumber: 23,
|
|
|
storageNum: 23,
|
|
|
isSoonSoldOut: false,
|
|
|
middleSortId: 12,
|
|
|
salesPrice: 399,
|
|
|
isPromotion: 101,
|
|
|
marketPrice: 1299,
|
|
|
vipPrice: 0,
|
|
|
id: 51160999,
|
|
|
thumb: 'http://img10.static.yhbimg.com/goodsimg/2015/10/21/03/01d7c265b0fa3fe1a582a73ad9175eab69.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
|
|
|
url: 'http://www.yohobuy.com/product/pro_286137_367987/ALLENOVE95S12SaiWeiLiYa.html',
|
|
|
brandUrl: '//allenove.yohobuy.com' }]
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 获取失效商品
|
|
|
const getInvalidProducts = () => {
|
|
|
return Promise.resolve({
|
|
|
invalidPros: [{ gender: '1',
|
|
|
tags: ['Object'],
|
|
|
status: 1,
|
|
|
smallSortId: 115,
|
|
|
vip1Price: 379.04999999999995,
|
|
|
isGlobal: 'N',
|
|
|
vip3Price: 351.12,
|
|
|
isOutlets: 2,
|
|
|
isDiscount: 'Y',
|
|
|
brandDomain: 'allenove',
|
|
|
isSpecial: 'N',
|
|
|
goodsList: ['Object'],
|
|
|
isAdvance: 'N',
|
|
|
productId: 286139,
|
|
|
vipDiscountType: 1,
|
|
|
salesNum: 0,
|
|
|
cnAlphabet: 'ALLENOVE95S13PuLuoWangSi',
|
|
|
productSkn: 51161000,
|
|
|
shelveTime: 1455616165,
|
|
|
vip2Price: 359.1,
|
|
|
editTime: 1455616165,
|
|
|
isNew: 'N',
|
|
|
isLimited: 'N',
|
|
|
brandName: 'Alle nove',
|
|
|
maxSortId: 1,
|
|
|
productName: 'Alle nove 复古圆领长袖衬衫【普罗旺斯】',
|
|
|
brandId: 1007,
|
|
|
defaultImages: 'http://img12.static.yhbimg.com/goodsimg/2015/10/21/03/02705334cacca0a06edec049918290f7b3.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
|
|
|
stockNumber: 12,
|
|
|
storageNum: 12,
|
|
|
isSoonSoldOut: false,
|
|
|
middleSortId: 12,
|
|
|
salesPrice: 399,
|
|
|
isPromotion: 101,
|
|
|
marketPrice: 1299,
|
|
|
vipPrice: 0,
|
|
|
id: 51161000,
|
|
|
thumb: 'http://img12.static.yhbimg.com/goodsimg/2015/10/21/03/02705334cacca0a06edec049918290f7b3.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
|
|
|
url: 'http://www.yohobuy.com/product/pro_286139_367989/ALLENOVE95S13PuLuoWangSi.html',
|
|
|
brandUrl: '//allenove.yohobuy.com' }]
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 移入收藏夹
|
|
|
exports.transferToFavorite = () => {
|
|
|
// TODO
|
|
|
};
|
|
|
|
|
|
// 获取购物车信息
|
|
|
exports.getCartInfo = () => {
|
|
|
return Promise.all([
|
|
|
getPreSaleProducts(),
|
|
|
getNormalProducts(),
|
|
|
getInvalidProducts()
|
|
|
]);
|
|
|
}; |
...
|
...
|
|