Authored by lijing

秒杀详情分离

/**
* 商品详情controller
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/5/6
*/
'use strict';
const mRoot = '../models';
const headerModel = require('../../../doraemon/models/header'); // 头部model
const detailModel = require(`${mRoot}/seckill-detail`); // 商品详情 model
const introModel = require(`${mRoot}/intro`); // 商品尺码信息 model
const preferenceModel = require(`${mRoot}/preference`); // 商品偏好 model
const detailRelated = require(`${mRoot}/consult-comment`); // 商品评论咨询 model
const _ = require('lodash');
const helpers = global.yoho.helpers;
exports.getUser = (req, res, next) => {
let uid = req.user.uid,
result = {
isStudent: false
};
detailModel.getUserProfile(uid).then((data) => {
result.isStudent = data.data && data.data.vip_info && data.data.vip_info.is_student ? true : false;
req.__User__ = result;
next();
}).catch(next);
};
/**
* 商品基本信息
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.index = (req, res, next) => {
if (!req.params[0] || !req.params[1]) {
return next();
}
let uid = req.user.uid || 0;
let headerData = headerModel.setNav({
navTitle: '商品详情'
});
detailModel.getProductData({
id: req.params[0],
goodsId: req.params[1],
uid: uid,
ua: req.get('user-agent') || ''
}).then((result) => {
if (_.isEmpty(result)) {
return next();
}
result.studentPrice = req.__User__.isStudent && result && result.goodsPrice && result.goodsPrice.studentPrice ? result.goodsPrice.studentPrice : false;
res.render('detail/detail', {
pageHeader: headerData,
result: result,
page: 'detail',
title: result.goodsName,
pageFooter: true
});
}).catch(next);
};
/**
* 商品基本信息 SKN 进入
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.indexSkn = (req, res, next) => {
if (!req.params[0]) {
return next();
}
let uid = req.user.uid || 0;
let headerData = headerModel.setNav({
navTitle: '商品详情'
});
detailModel.getProductData({
productSkn: req.params[0],
uid: uid,
ua: req.get('user-agent') || ''
}).then((result) => {
if (_.isEmpty(result)) {
return next();
}
result.studentPrice = req.__User__.isStudent && result && result.goodsPrice && result.goodsPrice.studentPrice ? result.goodsPrice.studentPrice : false;
res.render('detail/detail', {
pageHeader: headerData,
result: result,
page: 'detail',
title: result.goodsName,
pageFooter: true
});
}).catch(next);
};
/**
* 商品尺码信息详情
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.intro = (req, res, next) => {
if (!req.params.productskn) {
return next();
}
introModel.getintroIntro({
productskn: req.params.productskn
}, req).then(html => {
res.send(html);
});
// introModel.getintroData({
// productskn: req.params.productskn
// }, req).then((result) => {
// res.render('detail/intro', {
// result: result,
// layout: false
// });
// }).catch(next);
};
/**
* 为你优选
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.preference = (req, res, next) => {
preferenceModel({
productskn: req.query.productSkn,
yhchannel: req.yoho.channel,
brandId: req.query.brandId
}).then((result) => {
res.render('detail/preference', Object.assign({
layout: false
}, result));
}).catch(next);
};
/**
* 购买评价页
*/
exports.comments = (req, res, next) => {
if (!req.query.product_id) {
return next();
}
let headerData = headerModel.setNav({
navTitle: '购买评价'
});
detailRelated.comments(req.query).then((result) => {
res.render('detail/comments', Object.assign({
title: '购买评价',
pageHeader: headerData,
pageFooter: true
}, result));
}).catch(next);
};
/**
* 购买咨询
*/
exports.consults = (req, res, next) => {
if (!req.query.product_id) {
return next();
}
let headerData = headerModel.setNav({
navTitle: '购买咨询'
});
detailRelated.consults(req.query).then((result) => {
res.render('detail/consults', Object.assign({
title: '购买咨询',
pageHeader: headerData,
pageFooter: true
}, result));
}).catch(next);
};
/**
* 咨询点赞
*/
exports.consultUpvoteOrUseful = (req, res, next) => {
let uid = req.user.uid || 0;
if (!uid) {
return res.json({
code: 401,
message: '用户id为空',
data: helpers.urlFormat('/signin.html', {
refer: helpers.urlFormat('/product/detail/consults', {
product_id: req.body.productId,
total: req.body.total
})
})
});
}
req.body.isUpvote = /upvote/.test(req.path);
req.body.uid = uid;
detailRelated.upvoteConsult(req.body).then((result) => {
res.json(result);
}).catch(next);
};
/**
* 咨询表单页
*/
exports.consultform = (req, res, next) => {
if (!req.query.product_id) {
return next();
}
let headerData = headerModel.setNav({
navTitle: '我要咨询'
});
res.render('detail/consult-form', {
title: '我要咨询',
pageHeader: headerData,
productId: req.query.product_id,
formUrl: '/product/detail/consultsubmit',
pageFooter: true
});
};
/**
* 咨询提交接口
*/
exports.consultsubmit = (req, res, next) => {
let data = {
code: 400,
message: '请输入咨询内容',
data: ''
};
// 判断参数是否存在
if (!req.body.product_id || !req.body.content) {
return res.json(data);
}
detailRelated.addConsult(req.user.uid, req.body.product_id, req.body.content).then((result) => {
if (result) {
Object.assign(data, result);
}
return res.json(data);
}).catch(next);
};
exports.getSeckillData = (req, res) => {
detailModel.getSeckillData({
productskn: req.params.productskn
}, req).then(result => {
return res.json(result);
});
};
... ...
/**
* 商品详情models
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/5/6
*/
'use strict';
const _ = require('lodash');
const comment = require('./consult-comment');
const api = global.yoho.API;
const helpers = global.yoho.helpers;
const SINGLE_TICKETS_SKN = 51335912; // 展览票
/**
* 获取用户数据信息
* @param {[string]} uid
* @return {[array]}
*/
const _getUserProfile = (uid) => {
if (!uid) {
return Promise.resolve({
code: 200,
data: {}
});
}
return api.get('', {
method: 'app.passport.profile',
uid: uid
}, {
cache: true
});
};
/**
* 处理品牌关联店铺信息
* @param {array}
* @return {array}
*/
const _processShopsInfo = (data) => {
let enterStore = [];
_.forEach(data, function(value) {
let shopInfo = {
img: value.brand_ico,
storeName: value.brand_name
};
if (value.shop_id) {
shopInfo.url = helpers.urlFormat('/product/index/brand', {
shop_id: value.shop_id
});
} else {
shopInfo.url = helpers.urlFormat('', null, value.brand_domain);
}
enterStore.push(shopInfo);
});
return enterStore;
};
/**
* 处理限购商品的有关按钮状态(或取现购买以及底部商品购买按钮)
* @param {array} 需要处理的数据
* @param {int} 限购商品的关联状态
* @param {Boolean} 限购商品是否已开售
* @return {array}
*/
const _procShowStatus = (data, showStatus, isBeginSale) => {
switch (showStatus) {
case 1: // 开售前/后,立即分享获得限购码(用户未领取限购码)
// 显示获取限购码按钮
data.canGetLimitCode = true;
if (isBeginSale) { // 开售后
data.cartInfo.noLimitCode = true;
} else {
data.cartInfo.limitNotForSale = true;
}
break;
case 2: // 开售后,限购码已抢光(用户未领取限购码)
data.codeEmpty = true;
data.cartInfo.noLimitCode = true;
break;
case 3: // 开售后,商品已经售罄
data.noLimitGoodsBtn = true;
data.cartInfo.soldOut = true;
break;
case 4: // 开售后,立即购买(用户已领取限购码)
data.gotCode = true;
data.cartInfo.canNotBuy = true;
break;
case 5: // 开售前,限购码已被抢光(用户未领取限购码)
data.codeEmpty = true;
data.cartInfo.limitNotForSale = true;
break;
case 6: // 开售前,即将开售(用户已领取限购码)
data.gotCode = true;
data.cartInfo.limitNotForSale = true;
break;
case 7: // 开售后,用户已经用获得的限购码购买过商品
data.gotCode = true;
data.cartInfo.noLimitCode = true;
break;
default:
break;
}
return data;
};
/**
* 根据设备类型获得限购商品跳转app的url
* @param {string} productCode 限购商品码
* @param {string} skn 限购商品skn
* @return {string} 限购商品跳转url
*/
const _getLimitCodeUrl = (productCode, skn, ua) => {
let url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode +
'&product_skn=' + skn;
let isIphone = String(ua).indexOf('iPhone') >= 0;
let isIpad = ua.indexOf('iPad') >= 0;
if (isIphone || isIpad) {
let params = {};
params.lp = productCode;
url = 'yohobuy://' + helpers.urlFormat('/limitpurchase', params);
}
return url;
};
const _detailDataPkg = (origin, uid, vipLevel, ua) => {
let dest = {}, // 结果输出
thumbImageList = [],
colorGroup = {},
sizeGroup = [],
totalStorageNum = 0;
// 商品名称
if (!origin.productName) {
dest.feedbacks = {};
return dest;
}
dest.goodsName = origin.productName;
// 是否是虚拟商品
dest.virtualGoods = (origin.attribute * 1 === 3);
// 用户未登录时
if (!uid) {
dest.loginUrl = helpers.urlFormat('/signin.html', {
refer: helpers.urlFormat('/product/show_' + origin.productSkn + '.html')
});
}
// 商品促销短语
origin.salesPhrase && (dest.goodsSubtitle = origin.salesPhrase);
// 促销信息 TODO: 换新接口
if (origin.promotionBoList) {
let discountList = [];
_.forEach(origin.promotionBoList, function(value) {
discountList.push({
text: `【${value.promotionType}${value.promotionTitle}`
});
});
discountList.length && (dest.goodsDiscount = {
list: discountList
});
}
// 商品标签
if (origin.tags) {
let productTags = {};
_.forEach(origin.tags, function(value) {
productTags[value] = true;
});
dest.tags = productTags;
}
// 商品价格
let goodsPrice = {
currentPrice: origin.formatSalesPrice === '0' ? origin.formatMarketPrice : origin.formatSalesPrice
};
if (origin.formatSalesPrice !== '0' && origin.formatMarketPrice !== origin.formatSalesPrice) {
goodsPrice.previousPrice = origin.formatMarketPrice;
}
dest.goodsPrice = goodsPrice;
// 商品返回 YOHO 币
origin.yohoCoinNum && (dest.commodityReturn = origin.yohoCoinNum);
// VIP 商品价格
if (origin.vip) {
let vipList = [];
let levelList = {
银卡: 1,
金卡: 2,
白金: 3
};
_.forEach(origin.vip, function(value) {
vipList.push({
level: levelList[value.caption],
text: value.price,
currentLevel: (levelList[value.caption] === parseInt(vipLevel, 10))
});
});
vipList.length && (dest.vipLevel = {
list: vipList
});
}
// 上市期
origin.expectArrivalTime && (dest.periodOfMarket = `${origin.expectArrivalTime}月`);
// 商品咨询
dest.feedbacks = {
consults: [],
consultsNum: 0
};
let consultParams = {
product_id: origin.productId
};
if (_.has(dest, 'feedbacks.consultsNum')) {
consultParams.total = dest.feedbacks.consultsNum;
dest.feedbacks.consultsUrl = helpers.urlFormat('/product/detail/consults', consultParams);
} else {
dest.feedbacks.consultsUrl = helpers.urlFormat('/product/detail/consultform', consultParams);
}
// 商品评价
dest.feedbacks.commentsUrl = helpers.urlFormat('/product/detail/comments', {
product_id: origin.productId,
});
// 品牌信息
if (origin.brand) {
let extra = `?productSkn=${origin.productSkn}&brandId=${origin.brandInfo.brandId}`;
dest.preferenceUrl = `/product/detail/preference${extra}`;
}
dest.productSkn = origin.productSkn;
// 商品信息
if (origin.goodsList) {
let goodsGroup = [],
sizeName = '',
colorList = [],
sizeList = {},
allSizeList = {},
colorStorageGroup = {},
colorStorageNum = 0;
_.forEach(origin.goodsList, function(value) {
if (value.status === 0) {
return;
}
colorStorageNum = 0;
// 商品分组
if (value.imagesList) {
_.forEach(value.imagesList, function(good) {
goodsGroup.push({
goodsId: value.goodsId,
img: good.imageUrl
});
});
}
// 商品的尺码列表
colorStorageGroup[value.productSkc] = {};
if (value.sizeList) {
sizeList[value.productSkc] = [];
_.forEach(value.sizeList, function(size) {
sizeList[value.productSkc].push({
id: size.sizeId,
skuId: size.productSku,
goodsId: value.goodsId,
colorId: value.colorId,
name: size.sizeName,
sizeNum: size.storageNumber
});
sizeName = size.sizeName;
// 所有尺码列表,赋值用于前端展示默认尺码的时候
// 判断出没有库存则显示灰色
let build = {
id: size.sizeId,
storage: size.storageNumber
};
allSizeList[sizeName] = (allSizeList[sizeName] === null ||
typeof allSizeList[sizeName] === 'undefined') ? build : allSizeList[sizeName];
colorStorageNum += parseInt(size.storageNumber, 10);
colorStorageGroup[value.productSkc][sizeName] = parseInt(size.storageNumber, 10);
});
// 颜色分组
colorList.push({
id: value.colorId,
skcId: value.productSkc,
name: value.colorName,
colorNum: colorStorageNum
});
}
// 缩略图
thumbImageList.push({
img: value.colorImage
});
// 商品库存总数
totalStorageNum += _.toNumber(colorStorageNum);
});
// 遍历所有尺码,构建颜色显示数据
let i = 1;
sizeGroup[0] = {
size: []
};
_.forEach(allSizeList, (value, key) => {
// 默认尺码
sizeGroup[0].size.push({
name: key,
sizeNum: _.toNumber(value.storage) > 0 ? true : false,
id: value.id
});
colorGroup[i] = {
color: []
};
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
_.forEach(colorList, (colorArr) => {
let tempColorArr = _.cloneDeep(colorArr);
if (colorStorageGroup[tempColorArr.skcId] &&
colorStorageGroup[tempColorArr.skcId][key]) {
tempColorArr.colorNum = colorStorageGroup[tempColorArr.skcId][key];
} else {
tempColorArr.colorNum = 0;
}
colorGroup[i].color.push(Object.assign({}, tempColorArr));
});
colorGroup[i].id = value.id;
++i;
});
colorGroup[0] = {
color: []
};
// 遍历所有颜色, 构建尺码显示数据
i = 1;
_.forEach(colorList, function(value) {
// 各个尺码的颜色, 每行显示一个颜色的对应尺码
sizeGroup[i] = {
size: sizeList[value.skcId],
colorId: value.skcId
};
// 默认颜色
colorGroup[0].color.push(value);
++i;
});
// 商品图:多个
if (goodsGroup.length > 1) {
let bannerList = [];
_.forEach(goodsGroup, function(value) {
bannerList.push({
img: value.img
});
});
dest.bannerTop = {
list: bannerList
};
} else if (goodsGroup[0]) {
dest.bannerTop = {
img: goodsGroup[0].img
};
}
}
// 悬浮的购物车信息
dest.cartInfo = {
cartUrl: helpers.urlFormat('/cart/index/index'),
numInCart: 0,
goodsInstore: origin.storageSum
};
let soldOut = (origin.storageSum === 0) || (totalStorageNum === 0); // status
let notForSale = origin.attribute === 2;
// 显示加入购物车链接
if (!soldOut && !notForSale) {
_.orderBy(colorGroup);
Object.assign(dest.cartInfo, {
productId: origin.productId,
thumbs: thumbImageList,
name: dest.goodsName ? dest.goodsName : '',
price: dest.goodsPrice.previousPrice ? dest.goodsPrice.previousPrice : '',
salePrice: dest.goodsPrice.currentPrice ? dest.goodsPrice.currentPrice : '',
totalNum: totalStorageNum,
colors: _.toArray(colorGroup),
sizes: sizeGroup
});
// 限购商品
if (origin.isLimitBuy) {
// 是否开售
let isBeginSale = (origin.saleStatus === 1);
// 限购商品有关的展示状态
let showStatus = 1;
origin.showStatus && (showStatus = parseInt(origin.showStatus, 10));
// 处理限购商品有关的按钮状态
dest = _procShowStatus(dest, showStatus, isBeginSale);
dest.cartInfo.limitProductCode = origin.limitProductCode;
dest.cartInfo.limitCodeUrl = _getLimitCodeUrl(origin.limitProductCode, origin.productSkn, ua);
dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure');
} else {
dest.cartInfo.addToCartUrl = helpers.urlFormat('/product/buy_' + origin.productId + '_' +
origin.goodsList.goodsId + '.html');
}
} else if (notForSale) {
dest.cartInfo.notForSale = true;
} else if (soldOut) {
dest.cartInfo.soldOut = true;
}
// 是否收藏
dest.isCollect = false;
if (origin.isCollect === 'Y') {
dest.isCollect = true;
dest.cartInfo.isCollect = true;
}
// 底部简介URL链接
dest.introUrl = '/product/detail/intro/' + origin.productSkn;
dest.id = origin.productId;
// 虚拟商品(门票)
if (origin.attribute * 1 === 3) {
dest.tickets = true;
dest.ticketsConfirm = helpers.urlFormat('/cart/index/ticketsConfirm');
// 展览票
if (origin.productSkn * 1 === SINGLE_TICKETS_SKN) {
dest.single = true;
} else {
// 套票
dest.package = true;
}
// 购票限制
dest.cartInfo.limit = 4;
// 清空活动
dest.goodsDiscount = [];
// 来自登录页,自动弹出选择框
// if (isset($_GET['product_type']) && $_GET['product_type'] == 'ticket') {
// $result['showPannel'] = true;
// }
}
return dest;
};
let _getShopsInfo = (brandId) => {
if (!brandId) {
return Promise.resolve([]);
}
return api.get('', {
method: 'app.shop.queryShopsByBrandId',
brand_id: _.toString(brandId)
}, {
cache: true
}).then(shops => {
if (shops && shops.code === 200) {
return _processShopsInfo(shops.data);
}
return [];
});
};
let _getPromotionInfo = (skn) => {
return api.get('', {
method: 'app.product.promotion',
product_skn: _.toString(skn)
}, {
code: 200,
cache: true
}).then((result) => {
return result && result.data;
});
};
/**
* 获取默认咨询列表
*/
const _getCommonConsult = () => {
let params = {
method: 'app.consult.common'
};
return api.get('', params, {
code: 200
}).then(result => {
let data = {};
if (result.data) {
data = result.data;
}
return data;
});
};
/**
* 获取秒杀列表
*/
const getSeckillData = (param) => {
let params = {
method: 'app.seckill.data',
product_skn: param.productskn
};
return api.get('', params, {
code: 200
})
// mock
.catch()
.then(result => {
let data = {};
if (result.data) {
data = result.data;
} else {
data.status = 0;
}
return data;
});
};
let getProductData = (data) => {
let finalResult = {};
let params = {
method: 'app.product.data'
};
if (data.id) { // 通过 productId 获取商品详情
Object.assign(params, {
product_id: _.toString(data.id)
});
} else if (data.productSkn) { // 通过 productSkn 获取商品详情
Object.assign(params, {
product_skn: _.toString(data.productSkn)
});
}
if (data.uid) {
params.uid = data.uid;
}
return _getUserProfile(params.uid).then((user) => {
data.vipLevel = (user.data && user.data.vip_info && user.data.vip_info.cur_level) || '0';
data.isStudent = (user.data && user.data.vip_info && user.data.vip_info.is_student) ? true : false;
params.is_student = data.isStudent ? 1 : 0;
params.current_vip_level = data.vipLevel;
return api.get('', params, {
code: 200
}).then(global.yoho.camelCase).then(result => {
if (result.code === 500 || !result.data) {
return {};
}
result = result.data;
return Promise.all([
_getShopsInfo(_.get(result, 'brandInfo.brandId', 0)),
_getPromotionInfo(result.productSkn),
comment.getCommentInfo({
productId: result.productId
}),
_getCommonConsult(),
comment.getConsults(result.productId, 1, 2)
]).then((info) => {
result.promotionBoList = info[1];
finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua);
finalResult.enterStore = info[0];
finalResult.isStudent = data.isStudent;
Object.assign(finalResult.feedbacks, info[2]);
Object.assign(finalResult, {isSecKill: result.isSecKill});
/* 预售商品不能购买 */
if (_.get(result, 'isDepositAdvance', '') === 'Y') {
finalResult.cartInfo.isDepositAdvance = true;
}
/* 如果有咨询,显示咨询,否则显示常见问题 */
if (info[4].total) {
finalResult.feedbacks.consultsNum = parseInt(info[4].total, 10);
Object.assign(finalResult.feedbacks, {
commonConsults: false,
consultsNum: parseInt(info[4].total, 10),
consults: _.take(info[4].list, 2)
});
} else if (!_.isEmpty(info[3]) && !_.get(info[2], 'feedbacks.consultsNum', 0)) {
Object.assign(finalResult.feedbacks, {
commonConsults: true,
consultsNum: true,
consults: _.take(info[3], 2)
});
}
finalResult.limit = info[2];
return finalResult;
});
});
});
};
/**
* [根据商品SKN获取商品的简要信息]
* @param {[array]} skns [skns]
* @return {[type]}
*/
let _productInfoBySkns = (skns) => {
// 调用搜索接口
let param = {
method: 'app.search.li',
query: skns.join(' '),
limit: skns.length,
order: 's_t_desc'
};
return api.get('', param, {
cache: true
});
};
module.exports = {
getProductData,
getUserProfile: _getUserProfile,
getSeckillData,
productInfoBySkns: _productInfoBySkns
};
... ...
... ... @@ -42,13 +42,15 @@ const recom = require(`${cRoot}/recom`);
// 秒杀 controller
const seckill = require(`${cRoot}/seckill`);
// 秒杀商品详情controller
const seckillDetail = require(`${cRoot}/seckill-detail`);
// routers
// /pro_136349_455445/HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.getUser, detail.index); // 商品详情页
router.get(/^\/pro_([\d]+)_([\d]+)\/(.*)/, detail.getUser, detail.index); // 商品详情页
// /show_51047967.html
router.get(/\/show_([\d]+)/, detail.getUser, detail.indexSkn); // 商品详情页 SKN 进入
router.get(/^\/show_([\d]+)/, detail.getUser, detail.indexSkn); // 商品详情页 SKN 进入
router.get('/detail/intro/:productskn', detail.intro); // 商品内嵌页
router.get('/detail/preference', detail.preference); // 为你优选
router.get('/detail/consults', detail.consults); // 商品咨询页
... ... @@ -59,7 +61,7 @@ router.post('/detail/consultsubmit', auth, detail.consultsubmit); // 商å“å’¨è¯
router.get('/recom/maylike', recom.mayLike);// 你可能喜欢
router.get('/recom/maylikekids', recom.mayLikeKids); // 潮童你可能喜欢
router.get('/detail/seckillData/:productskn', detail.getSeckillData); // 秒杀数据接口
router.get('/seckillDetail/seckillData/:productskn', seckillDetail.getSeckillData); // 秒杀数据接口
router.post('/detail/consultupvote', detail.consultUpvoteOrUseful); // 商品咨询提交接口
... ... @@ -84,6 +86,7 @@ router.get('/recommend-for-you/cart', recommendForYou.cart);
router.get('/seckill', seckill.checkAppVer('5.1.0'), seckill.index); // 秒杀列表页
router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.getUser, seckillDetail.indexSkn); // 秒杀商品详情页 SKN 进入
router.post('/seckill/remind', seckill.remind); // only app; 秒杀提醒
router.get('/seckill/get-product-list', seckill.getProductList); // 秒杀列表根据活动id获取商品列表
... ...
... ... @@ -33,14 +33,14 @@
<a href='/product/show_{{productSkn}}.html' class="btn btn-buy">即将开抢</a>
{{/if}}
{{else}}
<a href='/product/show_{{productSkn}}.html?seckill=1{{#if @root.isApp}}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"{{productSkn}}", "is_seckill":"Y"}}{{/if}}' class="btn btn-buy">去抢购</a>
<a href='/product/seckill/show_{{productSkn}}.html{{#if @root.isApp}}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"{{productSkn}}", "is_seckill":"Y"}}{{/if}}' class="btn btn-buy">去抢购</a>
{{/if}}
</div>
</div>
</div>
{{#if isSeckill}}
<a class="item-link" href='/product/show_{{{productSkn}}}?seckill=1{{#if @root.isApp}}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"{{productSkn}}", "is_seckill": "Y"}}{{/if}}'></a>
<a class="item-link" href='/product/seckill/show_{{{productSkn}}}{{#if @root.isApp}}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"{{productSkn}}", "is_seckill": "Y"}}{{/if}}'></a>
{{else}}
<a class="item-link" href='/product/show_{{{productSkn}}}{{#if @root.isApp}}?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"{{productSkn}}"}}{{/if}}'></a>
{{/if}}
... ...
... ... @@ -68,7 +68,7 @@ $(
function() {
$('.cart-bar').hide();
$('.current-price').hide();
var ajaxUrl = '/product/detail/seckillData/' + $('#productSkn').val();
var ajaxUrl = '/product/seckillDetail/seckillData/' + $('#productSkn').val();
var timestamp = Date.parse(new Date());
$.ajax({
... ...