Authored by zhangxiaoru

weixin

... ... @@ -84,14 +84,6 @@ const packageData = (id, isApp) => {
cache: true
}));
if (isApp) {
promises.push(api.get('', {
method: 'app.resources.getSingleTemplate',
module: 'wechat',
key: 'guang_detail_wechat'
}));
}
// 获取资讯相关的其它资讯
if (typeof article.tag !== 'undefined') {
param = {
... ... @@ -108,10 +100,19 @@ const packageData = (id, isApp) => {
cache: true
}));
}
if (isApp) {
promises.push(api.get('', {
method: 'app.resources.getSingleTemplate',
module: 'wechat',
key: 'guang_detail_wechat'
}));
}
return Promise.all(promises).then(datas => {
let getArticleContent = datas[1].data;
if (datas[3].data) {
if (isApp && datas[4].data) {
let preCount = 0;
let i;
... ... @@ -122,14 +123,14 @@ const packageData = (id, isApp) => {
}
}
getArticleContent.splice(preCount, 0, {weixinPublic: datas[3].data});
getArticleContent.splice(preCount, 0, {weixinPublic: datas[4].data});
}
result.getAuthor = datas[0].data;
result.getArticleContent = getArticleContent;
result.getBrand = datas[2].data;
if (datas.length === 5) {
result.getOtherArticle = datas[4].data;
if (datas.length === 5 && isApp || datas.length === 4 && !isApp) {
result.getOtherArticle = datas[3].data;
}
return result;
});
... ...
... ... @@ -16,15 +16,15 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/',
// api: 'http://api-test1.yohops.com:9999/',
// service: 'http://service-test1.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test1.yohops.com:9999/',
api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test1.yohops.com:9999/',
// favApi: 'http://192.168.102.31:8092/brower',
// api: 'http://192.168.102.205:8080/gateway/',
... ...
... ... @@ -59,16 +59,13 @@ function renderData(data) {
// 点赞状态
if (it.isPraise === 'Y') {
$it.find('.like-btn').addClass('liked');
$it.find('.like-btn').addClass('like');
} else {
$it.find('.like-btn').removeClass('liked');
$it.find('.like-btn').removeClass('like');
}
// 点赞数目
$it.find('.like-count').text(it.praise_num);
// 评论数目
$it.find('.like-count').text(it.comment_num);
}
}
}
... ...