Authored by yyq

ebook buyFlag-review by wenxue

... ... @@ -19,7 +19,7 @@
<i class="iconfont">&#xe614;</i>
</div>
<button class="buy-magazine-now" data-sku="{{sku}}">立即购买</button>
<button class="buy-magazine-now" data-sku="{{sku}}" data-buy="{{buyFlag}}">立即购买</button>
</div>
</div>
</div>
... ...
... ... @@ -5,6 +5,8 @@ let get = require('lodash/get');
let Swiper = require('yoho-swiper');
let dialog = require('js/plugin/dialog');
const downloadPage = '//union.yoho.cn/union/app-downloads.html?union_type=100000000000349';
new Swiper('.swiper-container', {
observer: true,
observeParents: true,
... ... @@ -123,15 +125,15 @@ $('.to-download').on('click', function() {
rightBtnText: '确定'
}
}, function() {
window.location.href = '//union.yoho.cn/union/app-downloads.html?union_type=100000000000349';
window.location.href = downloadPage;
});
});
$('.buy-magazine-now').on('click', function() {
let sku = $(this).data('sku');
let buy = $(this).data('buy');
if (sku) {
window.location.href = `/cart/magazine/ensure?sku=${sku}`;
window.location.href = buy ? `/cart/magazine/ensure?sku=${sku}` : downloadPage;
}
});
... ...