Authored by Rock Zhang

未登录用户点击限购商品详情页的获取限购商品时会跳转到登录页

Code Review By Rock Zhang
... ... @@ -83,22 +83,28 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
}
limitSaleHammer && limitSaleHammer.on('tap', function(e) {
var loginUrl = $('#loginUrl').val();
e.srcEvent.stopPropagation();
dialog.showDialog({
dialogText: '打开有货APP限定发售频道\n获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
window.location.href = appUrl;
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
e.stopPropagation();
if ($(e.target).hasClass('dialog-wrapper')) {
dialog.hideDialog();
}
});
if(loginUrl) {
window.location = loginUrl;
} else {
dialog.showDialog({
dialogText: '打开有货APP限定发售频道\n获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
window.location.href = appUrl;
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
e.stopPropagation();
if ($(e.target).hasClass('dialog-wrapper')) {
dialog.hideDialog();
}
});
}
});
require('./desc');
... ...
... ... @@ -177,5 +177,9 @@
<input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}">
{{/if}}
{{#loginUrl}}
<input type="hidden" name="loginUrl" id="loginUrl" value="{{.}}">
{{/loginUrl}}
</div>
{{> layout/footer}}
... ...
... ... @@ -47,6 +47,11 @@ class DetailModel
$result['goodsName'] = $baseInfo['productName'];
// 用户未登录时
if (empty($uid)) {
$result['loginUrl'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/show_' . $baseInfo['erpProductId']. '.html')));
}
// 商品促销短语
if (!empty($baseInfo['salesPhrase'])) {
$result['goodsSubtitle'] = $baseInfo['salesPhrase'];
... ...