Authored by 陈峰

套餐优化分享

... ... @@ -35,6 +35,8 @@ const detail = (params) => {
--bundleIndex;
return getBundleBySkn(params.skn).then(result => {
if (_.has(result, `data[${bundleIndex}]`)) {
let shareInfo = _.get(result, 'data[0].shareInfo', {});
return {
bundleDatas: _.map(result.data, (bundle, index) => {
return {
... ... @@ -43,6 +45,12 @@ const detail = (params) => {
href: helpers.urlFormat('/product/bundle/detail', {skn: params.skn, index: ++index}),
};
}),
shareInfo: {
imgUrl: `http:${helpers.image(shareInfo.imgUrl, 300, 300)}`,
subTitle: encodeURIComponent(shareInfo.subTitle),
title: encodeURIComponent(shareInfo.title),
url: shareInfo.url
},
bundleInfo: _.get(result, `data[${bundleIndex}].bundleInfo`, {}),
productList: productProcess.processProductList(_.get(result, `data[${bundleIndex}].productList`, []))
};
... ...
... ... @@ -47,4 +47,10 @@
</div>
<input type="hidden" id="activityId" value="{{bundleId}}">
{{/ bundleInfo}}
{{#shareInfo}}
<input type="hidden" id="shareImgUrl" value="{{imgUrl}}">
<input type="hidden" id="shareSubTitle" value="{{subTitle}}">
<input type="hidden" id="shareTitle" value="{{title}}">
<input type="hidden" id="shareUrl" value="{{url}}">
{{/shareInfo}}
</div>
\ No newline at end of file
... ...
'use strict';
const fs = require('fs');
let devHost = '127.0.0.1';
let devHost = 'm.yohobuy.com';
fs.readFile('.devhost', (err, buf)=> {
if (!err) {
... ...
... ... @@ -23,12 +23,14 @@ let actCkOpthn = {
$(function() {
window.setCookie('activity-info', '', actCkOpthn);
share({
imgUrl: 'https://feature.yoho.cn/300x300.png',
title: '会搭是成为潮流ICON的第一步,搭配购买还有优惠折扣!',
link: window.location.href,
desc: '超高性价比,开启省钱大作战!'
});
if ($('#shareUrl').length) {
share({
imgUrl: $('#shareImgUrl').val(),
title: decodeURIComponent($('#shareTitle').val()),
link: $('#shareUrl').val(),
desc: decodeURIComponent($('#shareSubTitle').val())
});
}
if ($('.bundle-tabs').find('.swiper-slide').length > 3) {
new Swiper('.bundle-tabs', {
freeMode: true,
... ...