Authored by 王水玲

Merge branch 'master' into hotfix/wx-share

... ... @@ -141,6 +141,7 @@ const _pageArticleContent = (articleContent, isApp, gender, isWeixin, isqq, isWe
let callArtGoodGroup = (ii, len2) => {
if (ii < len2) {
let goods = art.goodsGroup.data[ii];
if (goods) {
let good = {
thumb: goods.cover ? helpers.image(goods.cover.cover, 235, 314) : '',
... ... @@ -265,15 +266,15 @@ const _relatedInfo = (getOtherArticle, isApp) => {
const _shareInfo = (id, getArticle) => {
let shareInfo = {};
shareInfo.shareLink = helpers.urlFormat('/info/index', {
shareInfo.shareLink = 'http:' + helpers.urlFormat('/info/index', {
id: id
}, 'guang');
shareInfo.shareTitle = getArticle.article_title;
shareInfo.shareDesc = getArticle.article_summary;
if (getArticle.cover_image_type === 1) {
shareInfo.shareImg = helpers.image(getArticle.cover_image, 640, 640);
shareInfo.shareImg = 'http:' + helpers.image(getArticle.cover_image, 640, 640);
} else {
shareInfo.shareImg = helpers.image(getArticle.cover_image, 640, 320);
shareInfo.shareImg = 'http:' + helpers.image(getArticle.cover_image, 640, 320);
}
return shareInfo;
};
... ... @@ -393,6 +394,7 @@ const index = (req, res, next) => {
// 分享参数
if (detail.getArticle.cover_image) {
let shareInfo = _shareInfo(id, detail.getArticle);
Object.assign(guang, shareInfo);
data.title = detail.getArticle.article_title + ' | Yoho!Buy有货 | 潮流购物逛不停';
data.title_more = true;
... ...
... ... @@ -232,14 +232,34 @@ const packageData = (id, isApp, isWeixin, channel, isShare) => {
});
}
if (isShare) {
if (isShare && datas[5]) {
if (datas[5].wechatShareImgUrl) {
datas[5].wechatShareImgUrl = datas[5].wechatShareImgUrl.substring(datas[5].wechatShareImgUrl.indexOf('//'));
if (datas[5].wechatShareImgUrl.indexOf('?') === -1) {
datas[5].wechatShareImgUrl = datas[5].wechatShareImgUrl + '?imageView2/2/interlace/1/q/75';
}
} else if (datas[5].qqShareImgUrl) {
datas[5].qqShareImgUrl = datas[5].qqShareImgUrl.substring(datas[5].qqShareImgUrl.indexOf('//'));
if (datas[5].qqShareImgUrl.indexOf('?') === -1) {
datas[5].qqShareImgUrl = datas[5].wechatShareImgUrl + '?imageView2/2/interlace/1/q/75';
}
} else if (datas[5].showShareImgUrl) {
datas[5].showShareImgUrl = datas[5].showShareImgUrl.substring(datas[5].showShareImgUrl.indexOf('//'));
if (datas[5].showShareImgUrl.indexOf('?') === -1) {
datas[5].showShareImgUrl = datas[5].showShareImgUrl + '?imageView2/2/interlace/1/q/75';
}
}
let preCount = 0;
let i;
for (i = 0; i < getArticleContent.length; i++) {
if (getArticleContent[i].singleImage || getArticleContent[i].text || getArticleContent[i].smallPic) {
preCount++;
preCount = i + 1;
}
}
... ... @@ -247,15 +267,6 @@ const packageData = (id, isApp, isWeixin, channel, isShare) => {
shareCode: datas[5]
});
// if (isWeixin && datas[5]) {
// getArticleContent.splice(preCount, 0, {
// shareCode: datas[5]
// });
// } else if (!isWeixin && datas[4]) {
// getArticleContent.splice(preCount, 0, {
// shareCode: datas[4]
// });
// }
}
if (datas[0]) {
... ...
{{# enterStore}}
<div id="enter-store" class="enter-store page-block tap-hightlight">
<a class="store-logo" href="{{url}}" style="">
<img class="lazy" src="{{image img 47 47}}" alt="{{storeName}}">
</a>
{{#if img}}
<a class="store-logo" href="{{url}}" style="">
<img class="lazy" src="{{image img 47 47}}" alt="{{storeName}}">
</a>
{{/if}}
<a class="store-name" href="{{url}}">{{storeName}}</a>
<a class="store-link" href="{{url}}">进入店铺<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -3,7 +3,7 @@ var $ = require('yoho-jquery');
require('../common');
// 生成二维码
(function() {
setTimeout(function() {
var text = $('.myqrcode_qr').attr('qr-data'),
width = $('.myqrcode_qr').css('width');
... ... @@ -14,4 +14,4 @@ require('../common');
size: parseInt(width), // 大小
ecLevel: 'H', // 纠错级别
});
}());
}, 0);
... ...
... ... @@ -23,7 +23,7 @@ module.exports = function() {
_appId = json.appId.toString();
_timestamp = json.timestamp;
_nonceStr = json.nonceStr.toString();
_signature = json.ticket.toString();
_signature = json.signature.toString();
wx.config({
debug: false,
... ...