未登录用户点击限购商品详情页的获取限购商品时会跳转到登录页
Code Review By Rock Zhang
Showing
3 changed files
with
15 additions
and
0 deletions
@@ -83,7 +83,12 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { | @@ -83,7 +83,12 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { | ||
83 | } | 83 | } |
84 | 84 | ||
85 | limitSaleHammer && limitSaleHammer.on('tap', function(e) { | 85 | limitSaleHammer && limitSaleHammer.on('tap', function(e) { |
86 | + var loginUrl = $('#loginUrl').val(); | ||
87 | + | ||
86 | e.srcEvent.stopPropagation(); | 88 | e.srcEvent.stopPropagation(); |
89 | + if(loginUrl) { | ||
90 | + window.location = loginUrl; | ||
91 | + } else { | ||
87 | dialog.showDialog({ | 92 | dialog.showDialog({ |
88 | dialogText: '打开有货APP限定发售频道\n获取限购码', | 93 | dialogText: '打开有货APP限定发售频道\n获取限购码', |
89 | hasFooter: { | 94 | hasFooter: { |
@@ -99,6 +104,7 @@ limitSaleHammer && limitSaleHammer.on('tap', function(e) { | @@ -99,6 +104,7 @@ limitSaleHammer && limitSaleHammer.on('tap', function(e) { | ||
99 | dialog.hideDialog(); | 104 | dialog.hideDialog(); |
100 | } | 105 | } |
101 | }); | 106 | }); |
107 | + } | ||
102 | }); | 108 | }); |
103 | 109 | ||
104 | require('./desc'); | 110 | require('./desc'); |
@@ -177,5 +177,9 @@ | @@ -177,5 +177,9 @@ | ||
177 | <input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}"> | 177 | <input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}"> |
178 | {{/if}} | 178 | {{/if}} |
179 | 179 | ||
180 | + {{#loginUrl}} | ||
181 | + <input type="hidden" name="loginUrl" id="loginUrl" value="{{.}}"> | ||
182 | + {{/loginUrl}} | ||
183 | + | ||
180 | </div> | 184 | </div> |
181 | {{> layout/footer}} | 185 | {{> layout/footer}} |
@@ -47,6 +47,11 @@ class DetailModel | @@ -47,6 +47,11 @@ class DetailModel | ||
47 | 47 | ||
48 | $result['goodsName'] = $baseInfo['productName']; | 48 | $result['goodsName'] = $baseInfo['productName']; |
49 | 49 | ||
50 | + // 用户未登录时 | ||
51 | + if (empty($uid)) { | ||
52 | + $result['loginUrl'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/show_' . $baseInfo['erpProductId']. '.html'))); | ||
53 | + } | ||
54 | + | ||
50 | // 商品促销短语 | 55 | // 商品促销短语 |
51 | if (!empty($baseInfo['salesPhrase'])) { | 56 | if (!empty($baseInfo['salesPhrase'])) { |
52 | $result['goodsSubtitle'] = $baseInfo['salesPhrase']; | 57 | $result['goodsSubtitle'] = $baseInfo['salesPhrase']; |
-
Please register or login to post a comment