Authored by htoooth

fix bug

... ... @@ -26,8 +26,6 @@ class DetailAction extends YohoAction {
let pid = req.params[0];
let gid = req.params[1];
let uid = req.user.uid || '';
let vipLevel = detailHelper.vipLevel(req.user.vip);
let saveCurrentGoodsInCookies = _.partial(service.saveRecentGoodInCookies,
req.cookies._browse,
req.cookies._browseskn,
... ... @@ -39,9 +37,9 @@ class DetailAction extends YohoAction {
gid: gid,
channel: this.getSessionChannel(),
gender: this.guessUserGender(),
uid: uid,
isStudent: req.user.isStudent,
vipLevel: vipLevel,
uid: null,
isStudent: null,
vipLevel: null,
saveInCookies: saveCurrentGoodsInCookies
}).then(result=> {
const seo = result.seo;
... ... @@ -172,13 +170,13 @@ class CreateConsultAction extends YohoAction {
const detailHeader = (req, res, next) => {
let pid = req.query.productId || 0;
let uid = req.user.uid || '';
let uid = req.user.uid || 0;
let vipLevel = detailHelper.vipLevel(req.user.vip);
let dataMd5 = req.query.md5 || 0;
service.getDetailHeader(pid, uid, req.user.isStudent, vipLevel, dataMd5).then((result) => {
if (result.code === 200) {
return res.render('product/detail-header', Object.assign({layout: false}, result));
return res.render('product/detail-header', Object.assign({layout: false}, result.data));
} else {
return res.status(204).end();
}
... ...
... ... @@ -1277,10 +1277,10 @@ const getDetailHeader = (pid, uid, isStudent, vipLevel, dataMd5) => {
return productAPI.getProductAsync(pid, uid, isStudent, vipLevel)
.then(result => currentUserProductInfo(result))
.then((result) => {
if (result.goodsInfo.md5 !== dataMd5) {
if (result.goodsInfo.md5 !== dataMd5 || uid) {
return {
code: 200, // 改变数据
data: result.data
data: result
};
} else {
return {
... ...
{{#if pathNav}}
<p class="path-nav">
{{#each pathNav}}
{{#if href}}
<a {{#if @last}}class="last"{{/if}} href="{{href}}" title="{{pathTitle}}">{{{name}}}</a>
{{^}}
<span {{#if @last}}class="last"{{/if}} title="{{pathTitle}}">{{{name}}}</span>
{{/if}}
{{#if name}}
{{#if href}}
<a {{#if @last}}class="last"{{/if}} href="{{href}}" title="{{pathTitle}}">{{{name}}}</a>
{{^}}
<span {{#if @last}}class="last"{{/if}} title="{{pathTitle}}">{{{name}}}</span>
{{/if}}
{{#unless @last}}
<span class="iconfont">&#xe60c;</span>
{{/unless}}
{{#unless @last}}
<span class="iconfont">&#xe60c;</span>
{{/unless}}
{{/if}}
{{/each}}
</p>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -115,7 +115,7 @@ bindEvent.add(function() {
jsonHtml = $sizeTitleJson.html(),
sizeTitle;
if (jsonHtml === '') {
if (!jsonHtml) {
return;
}
... ... @@ -134,7 +134,6 @@ bindEvent.add(function() {
require('../plugins/share');
// 品牌收藏
$('#brand-favour').click(function() {
var $this = $(this);
... ...