Authored by 陈轩

Merge remote-tracking branch 'origin/feature/seckill' into feature/seckill

... ... @@ -121,7 +121,6 @@ const index = (req, res, next) => {
times: 12
}, result, hbsHelper));
});
});
};
... ...
... ... @@ -986,7 +986,11 @@ const getSeckillData = (productSkn) => {
return api.get('', params, {
code: 200
}).then(result => {
})
//mock
.catch()
.then(result => {
let data = {};
if (result.data) {
... ... @@ -995,9 +999,9 @@ const getSeckillData = (productSkn) => {
data = {
activityId: 4,
startTime: 1465194254,
endTime: 1475294254,
formatSecKillPrice: '¥133.00',
startTime: 1475892120,
endTime: 1476892120,
formatSecKillPrice: '¥1234.00',
id: 4,
orderBy: 0,
productSkn: 512581470,
... ... @@ -1029,7 +1033,21 @@ const getSeckillData = (productSkn) => {
id: 2,
productSkn: 512581470,
productSku: 1384444,
storageNum: 0
storageNum: 4
},
{
activityId: 4,
id: 2,
productSkn: 512581470,
productSku: 138555,
storageNum: 3
},
{
activityId: 4,
id: 2,
productSkn: 512581470,
productSku: 138666,
storageNum: 3
}
],
secKillStatus: 0,
... ... @@ -1135,7 +1153,7 @@ let getProductData = (data) => {
// 秒杀详情页
if (isSecKills && leftCount && info[5]) {
if (isSecKills && info[5]) {
let end = info[5].status === 3 ? true : false;
... ... @@ -1177,7 +1195,6 @@ let getProductData = (data) => {
consults: _.take(info[3], 2)
});
}
return finalResult;
});
... ...
exports.activities = {
"alg": "SALT_MD5",
"code": 200,
"data": {
"currentTime": 1473839306925,
"secKillProductVoList": [{
"activityId": 1,
"endTime": 1473739200,
"secKillStatus": 0,
"startTime": 1475096193,
"status": 0,
"storageSum": 0
'alg': 'SALT_MD5',
'code': 200,
'data': {
'currentTime': 1473839306925,
'secKillProductVoList': [{
'activityId': 1,
'endTime': 1473739200,
'secKillStatus': 0,
'startTime': 1475096193,
'status': 0,
'storageSum': 0
}, {
"activityId": 2,
"endTime": 1473746400,
"secKillStatus": 0,
"startTime": 1475096193,
"status": 0,
"storageSum": 0
'activityId': 2,
'endTime': 1473746400,
'secKillStatus': 0,
'startTime': 1475096193,
'status': 0,
'storageSum': 0
}, {
"activityId": 3,
"endTime": Math.round((Date.now() + 1000 * 60 * 60 * 8) / 1000),
"secKillStatus": 0,
"startTime": Math.round((Date.now() + 1000 * 60 * 60) / 1000),
"status": 0,
"storageSum": 0
'activityId': 3,
'endTime': Math.round((Date.now() + 1000 * 60 * 60 * 8) / 1000),
'secKillStatus': 0,
'startTime': Math.round((Date.now() + 1000 * 60 * 60) / 1000),
'status': 0,
'storageSum': 0
}]
},
"md5": "b291f2aa3015749f676f50de0d513437",
"message": "query secKillActivity info"
'md5': 'b291f2aa3015749f676f50de0d513437',
'message': 'query secKillActivity info'
};
// 未开抢 mock 数据
exports.waitData = {
"alg": "SALT_MD5",
"code": 200,
"data": [{
"activityId": 3,
"defaultImages": "http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70",
"endTime": Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
"marketPrice": 100,
"productName": "blkheimei男休闲/运动鞋南京艾尚仅门店可售",
"productSkn": 512581470,
"secKillPrice": 40,
"secKillSku": [{
"productSkn": 512581470,
"productSku": 1384138,
"storageNum": 5
'alg': 'SALT_MD5',
'code': 200,
'data': [{
'activityId': 3,
'defaultImages': 'http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70',
'endTime': Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
'marketPrice': 100,
'productName': 'blkheimei男休闲/运动鞋南京艾尚仅门店可售',
'productSkn': 512581470,
'secKillPrice': 40,
'secKillSku': [{
'productSkn': 512581470,
'productSku': 1384138,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}],
"secKillStatus": 1,
"startTime": Math.round((Date.now() + 1000 * 60 * 60) / 1000),
"status": 0,
"storageSum": 10,
'secKillStatus': 1,
'startTime': Math.round((Date.now() + 1000 * 60 * 60) / 1000),
'status': 0,
'storageSum': 10,
remindFlag: false
}, {
"activityId": 3,
"defaultImages": "http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70",
"endTime": Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
"marketPrice": 100,
"productName": "blkheimei男休闲/运动鞋南京艾尚仅门店可售",
"productSkn": 512581470,
"secKillPrice": 40,
"secKillSku": [{
"productSkn": 512581470,
"productSku": 1384138,
"storageNum": 5
'activityId': 3,
'defaultImages': 'http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70',
'endTime': Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
'marketPrice': 100,
'productName': 'blkheimei男休闲/运动鞋南京艾尚仅门店可售',
'productSkn': 512581470,
'secKillPrice': 40,
'secKillSku': [{
'productSkn': 512581470,
'productSku': 1384138,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}],
"secKillStatus": 1,
"startTime": Math.round((Date.now() + 1000 * 60 * 60) / 1000),
"status": 0,
"storageSum": 10,
'secKillStatus': 1,
'startTime': Math.round((Date.now() + 1000 * 60 * 60) / 1000),
'status': 0,
'storageSum': 10,
remindFlag: true
}],
"md5": "f09659c22f275fbd23d8999c58aba994",
"message": "query secKillProductList info"
'md5': 'f09659c22f275fbd23d8999c58aba994',
'message': 'query secKillProductList info'
};
exports.inActivityData = {
"alg": "SALT_MD5",
"code": 200,
"data": [{
"activityId": 3,
"defaultImages": "http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70",
"endTime": Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
"marketPrice": 100,
"productName": "blkheimei男休闲/运动鞋南京艾尚仅门店可售",
"productSkn": 512581470,
"secKillPrice": 40,
"secKillSku": [{
"productSkn": 512581470,
"productSku": 1384138,
"storageNum": 5
'alg': 'SALT_MD5',
'code': 200,
'data': [{
'activityId': 3,
'defaultImages': 'http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70',
'endTime': Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
'marketPrice': 100,
'productName': 'blkheimei男休闲/运动鞋南京艾尚仅门店可售',
'productSkn': 512581470,
'secKillPrice': 40,
'secKillSku': [{
'productSkn': 512581470,
'productSku': 1384138,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}],
"secKillStatus": 1,
"startTime": Math.round(Date.now() / 1000),
"status": 0,
"storageSum": 10,
'secKillStatus': 1,
'startTime': Math.round(Date.now() / 1000),
'status': 0,
'storageSum': 10,
remind: false
}, {
"activityId": 3,
"defaultImages": "http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70",
"endTime": Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
"marketPrice": 100,
"productName": "blkheimei男休闲/运动鞋南京艾尚仅门店可售",
"productSkn": 512581470,
"secKillPrice": 40,
"secKillSku": [{
"productSkn": 512581470,
"productSku": 1384138,
"storageNum": 5
'activityId': 3,
'defaultImages': 'http://img11.static.yhbimg.com/goodsimg/2016/09/12/14/018aea16153cec3ad0c677a106b5d95c53.png?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/70',
'endTime': Math.round((Date.now() + 1000 * 60 * 60 * 7) / 1000),
'marketPrice': 100,
'productName': 'blkheimei男休闲/运动鞋南京艾尚仅门店可售',
'productSkn': 512581470,
'secKillPrice': 40,
'secKillSku': [{
'productSkn': 512581470,
'productSku': 1384138,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}, {
"productSkn": 512581470,
"productSku": 1384140,
"storageNum": 5
'productSkn': 512581470,
'productSku': 1384140,
'storageNum': 5
}],
"secKillStatus": 1,
"startTime": Math.round(Date.now() / 1000),
"status": 0,
"storageSum": 10,
'secKillStatus': 1,
'startTime': Math.round(Date.now() / 1000),
'status': 0,
'storageSum': 10,
remind: true
}],
"md5": "f09659c22f275fbd23d8999c58aba994",
"message": "query secKillProductList info"
'md5': 'f09659c22f275fbd23d8999c58aba994',
'message': 'query secKillProductList info'
};
... ...
... ... @@ -685,15 +685,8 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
function() {
var thisSkn = $('#productSkn').val();
var thisSku = '';
$('.size-row').each(
function() {
if ($(this).hasClass('hide')) {
return false;
} else {
thisSku = $(this).find('.chosed').attr('data-skuid');
}
}
);
thisSku = $('.size-row:last').find('.chosed').attr('data-skuid');
window.location.href = '/cart/seckill?skn=' + thisSkn + '&sku=' + thisSku;
}
... ...
... ... @@ -35,7 +35,7 @@ try {
info = JSON.parse(info);
// 2015/12/31 hf: fixes bug to 购物车页面调用该JS, 会导致有有货币,值却没有传给服务端. 因此需要再设置一下
//info['yohoCoin'] = $('.coin').data('yoho-coin') || 0;
// info['yohoCoin'] = $('.coin').data('yoho-coin') || 0;
} catch (e) {
init();
}
... ...
... ... @@ -84,7 +84,7 @@ $(
seckillObj.startTick(timeObj, offsetTime);
},
error: function() {
// alert('err');
tip.show('网络异常~');
}
});
... ...