Authored by zhangxiaoru

editorial

... ... @@ -48,5 +48,5 @@ const index = (req, res, next) => {
};
module.exports = {
index // 组件demo页
index // 品牌一览
};
... ...
... ... @@ -11,6 +11,7 @@ const camelCase = global.yoho.camelCase;
const _ = require('lodash');
const Promise = require('bluebird');
const co = Promise.coroutine;
const config = global.yoho.config;
// const moment = require('moment');
const logger = global.yoho.logger;
... ... @@ -383,6 +384,13 @@ const _getRelateBrand = (id) => {
article_id: id
}).then((result) => {
if (result && result.code === 200) {
_.forEach(result.data, function(data) {
let domain = data.url;
domain = domain.substring(domain.indexOf('/')+2, domain.indexOf('.'))
console.log(domain)
data.url = `${config.siteUrl}/product/shop/${domain}`;
});
return camelCase(result.data);
} else {
logger.error('Related brand return code is not 200');
... ...
... ... @@ -32,13 +32,13 @@ $('#prise-btn').click(function() {
}
if ($this.hasClass('liked')) {
url = '/editorial/info/cancelPraise';
// 点赞
url = '/editorial/info/praise';
} else {
// 取消点赞
url = '/editorial/info/cancelPraise';
url = '/editorial/info/praise';
}
prising = true;
$.ajax({
... ... @@ -92,34 +92,6 @@ $('#collect-btn').click(function() {
} else {
new _alert(data.message).show();
}
// switch (data.code) {
// // case 401:
// // // 防止从已有col的页面再次进行跳转后出错的情况
// // if (/\?col=(1|0)/.test(location.href)) {
// // hrefUrl = location.href.replace(/\?col=(1|0)/, '?col=' + col);
// // } else {
// // hrefUrl = location.href + '?col=' + col;
// // }
// // location.href = '//www.yohobuy.com/signin.html?refer=' + encodeURI(hrefUrl);
// // break;
// case 400:
// new _alert(data.message).show();
// break;
// case 200:
// if (/\?col=(1|0)/.test(location.href)) {
// // 如果页面url中含有col,为了防止页面刷新时收藏或者取消收藏会根据col来的问题,进行页面跳转拿掉参数
// location.href = location.href.replace(/\?col=(1|0)/, '');
// } else {
// $this.toggleClass('collected');
// }
// break;
// default:
// break;
// }
collecting = false;
});
}).bind('mouseenter mouseleave', function() {
... ...