Showing
3 changed files
with
8 additions
and
1 deletions
@@ -350,6 +350,7 @@ const _detailDataPkg = (origin) => { | @@ -350,6 +350,7 @@ const _detailDataPkg = (origin) => { | ||
350 | result.addToCart = 1; | 350 | result.addToCart = 1; |
351 | } | 351 | } |
352 | 352 | ||
353 | + result.isCollect = propOrigin('is_collect'); | ||
353 | result.colors = skuData.skuGoods; | 354 | result.colors = skuData.skuGoods; |
354 | 355 | ||
355 | return result; | 356 | return result; |
@@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
101 | <button class="btn-sell-out btn-grey none"> | 101 | <button class="btn-sell-out btn-grey none"> |
102 | <i class="sellOut iconfont"></i>已售罄 | 102 | <i class="sellOut iconfont"></i>已售罄 |
103 | </button> | 103 | </button> |
104 | - {{#if isFav}} | 104 | + {{#if isCollect}} |
105 | <button class="btn-fav-count favAdd" data-role="fav-count"><i class="fav-count iconfont coled"></i><em>已收藏</em></button> | 105 | <button class="btn-fav-count favAdd" data-role="fav-count"><i class="fav-count iconfont coled"></i><em>已收藏</em></button> |
106 | {{else}} | 106 | {{else}} |
107 | <button class="btn-fav-count favCancel" data-role="fav-count"><i class="fav-count iconfont"></i><em>收藏商品</em></button> | 107 | <button class="btn-fav-count favCancel" data-role="fav-count"><i class="fav-count iconfont"></i><em>收藏商品</em></button> |
@@ -506,6 +506,12 @@ function productCollect(pid, isCancel) { | @@ -506,6 +506,12 @@ function productCollect(pid, isCancel) { | ||
506 | productId: pid, | 506 | productId: pid, |
507 | type: isCancel ? 'cancel' : 'add' | 507 | type: isCancel ? 'cancel' : 'add' |
508 | } | 508 | } |
509 | + }).then(function(d) { | ||
510 | + if (d.code === 403) { | ||
511 | + location.href = d.data.url; | ||
512 | + } | ||
513 | + | ||
514 | + return d; | ||
509 | }); | 515 | }); |
510 | } | 516 | } |
511 | 517 |
-
Please register or login to post a comment