...
|
...
|
@@ -80,11 +80,15 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr |
|
|
if (isApp) {
|
|
|
result.collect = {};
|
|
|
result.collect.isCollected = articleData.isFavor === true;
|
|
|
let originUrl = helpers.urlFormat('/author/index', null, 'guang'); // 跳转回的链接
|
|
|
let colparam = articleData.colparam || {
|
|
|
urlpath: '',
|
|
|
param: ''
|
|
|
}
|
|
|
let originUrl = helpers.urlFormat(colparam.urlpath || '/author/index', null, 'guang'); // 跳转回的链接
|
|
|
let collectUrl = 'javascript:;'; // 根据用户是否登录做处理的链接
|
|
|
|
|
|
if (!uid) {
|
|
|
let playUrlEncode = originUrl.replace(/\//g, '\\/');
|
|
|
let playUrlEncode = `${originUrl}${colparam.param}`.replace(/\//g, '\\\/');
|
|
|
|
|
|
collectUrl = `${originUrl}?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"${playUrlEncode}","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}`;
|
|
|
}
|
...
|
...
|
@@ -110,7 +114,7 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr |
|
|
// 编辑人员 app跳转url处理 20160601
|
|
|
let isLogin = uid ? true : false;
|
|
|
|
|
|
articleData.author.url = `${helpers.https(articleData.author.url)}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${articleData.author.author_id}"},"share":"","id":${articleData.author.author_id},"type":0,"islogin":"${isLogin}","url":"https:${helpers.urlFormat('/author/index', {uid: uid}, 'guang')}"}}&uid=${uid}`;
|
|
|
articleData.author.url = `${helpers.https(articleData.author.url)}&openby:yohobuy={"action":"go.h5","params":{"param":{},"share":"","id":${articleData.author.author_id},"type":0,"islogin":"${isLogin}","url":"${articleData.author.url}"}}`;
|
|
|
result.author = articleData.author;
|
|
|
if (result.author.avatar) {
|
|
|
result.author.avatar = result.author.avatar.replace('http://', '//');
|
...
|
...
|
@@ -270,7 +274,7 @@ const formatProduct = (productData, showTags, showNew, showSale, width, height, |
|
|
// TODO student price
|
|
|
result.studentPrice = parseInt(productData.sales_price * 100 * 0.9) / 100;
|
|
|
result.is_soon_sold_out = (productData.is_soon_sold_out === 'Y');
|
|
|
let url = helpers.urlFormat(`/product/pro_${productData.product_id}_${productData.goods_list[0].goods_id}/${productData.cn_alphabet}.html`);
|
|
|
let url = encodeURI(helpers.urlFormat(`/product/pro_${productData.product_id}_${productData.goods_list[0].goods_id}/${productData.cn_alphabet}.html`));
|
|
|
|
|
|
result.url = url.replace('http://', '//');
|
|
|
|
...
|
...
|
@@ -282,8 +286,8 @@ const formatProduct = (productData, showTags, showNew, showSale, width, height, |
|
|
if (showTags) {
|
|
|
result.tags = {
|
|
|
is_new: showNew && productData.is_new === 'Y', // 新品
|
|
|
is_discount: showSale && productData.is_discount === 'Y', // 在售
|
|
|
is_limited: productData.is_limited && productData.is_limited === 'Y', // 限量
|
|
|
is_discount: showSale && productData.is_discount === 'Y', // 在售
|
|
|
is_limited: productData.is_limited && productData.is_limited === 'Y', // 限量
|
|
|
is_yohood: productData.is_yohood && productData.is_yohood === 'Y', // YOHOOD
|
|
|
midYear: productData.midear && productData.midear === 'Y', // 年中
|
|
|
yearEnd: productData.yearnd && productData.yearnd === 'Y', // 年末
|
...
|
...
|
@@ -294,7 +298,7 @@ const formatProduct = (productData, showTags, showNew, showSale, width, height, |
|
|
if (result.is_soon_sold_out && result.tags.is_discount) {
|
|
|
result.tags.is_new = false;
|
|
|
} else if (result.tags.is_discount &&
|
|
|
(result.tags.is_new || result.tags.is_limited || result.tags.is_yohood || result.tags.is_advance)// 打折与其它组合则隐藏打折
|
|
|
(result.tags.is_new || result.tags.is_limited || result.tags.is_yohood || result.tags.is_advance) // 打折与其它组合则隐藏打折
|
|
|
) {
|
|
|
result.tags.is_discount = false;
|
|
|
} else if (result.tags.is_yohood && result.tags.is_new) { // YOHOOD和新品组合显示YOHOOD
|
...
|
...
|
@@ -312,4 +316,4 @@ module.exports = { |
|
|
getFilterUrl,
|
|
|
formatProduct,
|
|
|
getProductIcon
|
|
|
}; |
|
|
}; |
|
|
\ No newline at end of file |
...
|
...
|
|