Authored by 周少峰

buynow checkout login , and show pannel auto

... ... @@ -14,6 +14,9 @@ var productId = $('#productId').val();
var skn = $('#productSkn').val(),
productCode = $('#limitProductCode').val();
//门票 限购数量
var ticketsLimit = $('#limitNum').val() || 0;
$('#likeBtn').on('touchstart', function() {
var opt,
favorite;
... ... @@ -67,6 +70,14 @@ $('#likeBtn').on('touchstart', function() {
});
$('#addtoCart').on('touchstart', function() {
//门票验证登录
if (ticketsLimit) {
if (!ticketCheckLogin()) {
return false;
}
}
$('.cart-bar').hide();
productCode && chosePanel.setLimitGoodModeWithSknId(productCode, skn);
... ... @@ -83,7 +94,27 @@ $('#addtoCart').on('touchstart', function() {
return false;
});
ticketCheckOpen();
$('#buyLimit').on('touchstart', function() {
tip.show('打开APP可抢购该商品哦~');
return false;
});
//门票立即购买验证登录
function ticketCheckLogin() {
if (!window.getUid()) {
var urlArray = window.location.href.split('?');
window.location.href = '//m.yohobuy.com/signin.html?refer=' + urlArray[0] + '?product_type=ticket';
return false;
}
}
// 门票登录后自动弹出
function ticketCheckOpen() {
var showPannel = $('#showPannel').val();
if (showPannel) {
chosePanel.show();
}
}
... ...
... ... @@ -190,5 +190,9 @@
</form>
{{/if}}
{{#if showPannel}}
<input type="hidden" id="showPannel" value="1">
{{/if}}
</div>
{{> layout/footer}}
... ...
... ... @@ -1147,7 +1147,6 @@ class CartModel
$result['price'] = Helpers::transPrice($price, true);
// 有货币
$result['yohoCoin'] = Helpers::transPrice($data['data']['yoho_coin']);
// print_r($data);
$result['useYohoCoin'] = isset($data['data']['shopping_cart_data']['use_yoho_coin']) ? $data['data']['shopping_cart_data']['use_yoho_coin'] : false;
return $result;
}
... ... @@ -1162,7 +1161,6 @@ class CartModel
$compute['data']['shopping_cart_data']['use_yoho_coin'] = Helpers::transPrice($compute['data']['shopping_cart_data']['use_yoho_coin']);
$result = $compute['data']['shopping_cart_data'];
}
// print_r($compute);
return $result;
}
... ...
... ... @@ -385,6 +385,11 @@ class DetailModel
//清空活动
unset($result['goodsDiscount']);
// 来自登录页,自动弹出选择框
if (isset($_GET['product_type']) && $_GET['product_type'] == 'ticket') {
$result['showPannel'] = true;
}
}
// 清空变量,释放内存
... ...