Authored by htoooth

add qrcode

... ... @@ -258,7 +258,7 @@
<span class="lc-arrow"></span>
<div class="lc-content">
<div class="qr-code"></div>
<p class="title">打开APP扫描二维码获取限购码</p>
<p class="title">打开有货APP扫描二维码获取限购码</p>
<p class="sub-title">商品开售后即可购买</p>
</div>
</div>
... ...
... ... @@ -31,6 +31,14 @@ var colTxt = {
var $saleReturn = $('#saleReturn');
function productUrl(s) {
return window.location.href + '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"' + s + '"}}';
}
function isEmpty(el) {
return !$.trim(el.html());
}
bindEvent.add(function() {
var $imgShow = $('#img-show'),
$thumbs = $('#thumbs > .thumb-wrap');
... ... @@ -50,6 +58,8 @@ bindEvent.add(function() {
var $lcContainer = $('.lc-container'),
$itemBuy = $('.item-buy');
var $qrcode = $('.qr-code');
var $descColor = $('#desc-color');
var thumbsLoaded = {};
... ... @@ -137,6 +147,7 @@ bindEvent.add(function() {
}());
require('../plugins/share');
require('yoho-jquery-qrcode');
// 品牌收藏
$('#brand-favour').click(function() {
... ... @@ -312,6 +323,15 @@ bindEvent.add(function() {
// 限购码
$('.get-lc:not(.dis)').hover(function() {
$lcContainer.removeClass('hide');
if (isEmpty($qrcode)) {
$qrcode.qrcode({
render: 'table',
size: 140,
text: productUrl(skn)
});
}
}, function() {
$lcContainer.addClass('hide');
});
... ...
... ... @@ -445,9 +445,8 @@
padding: 40px 25px 0;
.qr-code {
width: 137px;
height: 137px;
background: resolve("product/top-good-qr.png");
width: 140px;
height: 140px;
margin: 0 auto;
}
... ...