Merge remote-tracking branch 'origin/master' into feature/add-sessionKey
Showing
3 changed files
with
13 additions
and
3 deletions
@@ -282,6 +282,7 @@ | @@ -282,6 +282,7 @@ | ||
282 | import shoppingBag from 'component/product/shopping-bag.vue'; | 282 | import shoppingBag from 'component/product/shopping-bag.vue'; |
283 | import operationBar from './operation-bar.vue'; | 283 | import operationBar from './operation-bar.vue'; |
284 | import 'common/back-top'; | 284 | import 'common/back-top'; |
285 | + import cookie from 'yoho-cookie'; | ||
285 | 286 | ||
286 | 287 | ||
287 | const app = $('#app'); | 288 | const app = $('#app'); |
@@ -412,9 +413,13 @@ | @@ -412,9 +413,13 @@ | ||
412 | } | 413 | } |
413 | }); | 414 | }); |
414 | 415 | ||
416 | + const href = location.href; | ||
417 | + const mark = /\?/.test(href) ? '&' : '?'; | ||
418 | + const channel = cookie.get('_Channel') || 'men'; | ||
419 | + | ||
415 | share({ | 420 | share({ |
416 | title: this.entity.product_name, | 421 | title: this.entity.product_name, |
417 | - link: location.href, | 422 | + link: `${href}${mark}channel=${channel}`, |
418 | desc: '我在BLK发现了一个不错的商品,快来看看吧!', | 423 | desc: '我在BLK发现了一个不错的商品,快来看看吧!', |
419 | imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) { | 424 | imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) { |
420 | const dict = { | 425 | const dict = { |
@@ -58,6 +58,7 @@ | @@ -58,6 +58,7 @@ | ||
58 | <script> | 58 | <script> |
59 | import yoho from 'yoho'; | 59 | import yoho from 'yoho'; |
60 | import tip from 'common/tip'; | 60 | import tip from 'common/tip'; |
61 | + import cookie from 'yoho-cookie'; | ||
61 | 62 | ||
62 | export default { | 63 | export default { |
63 | name: 'operation-bar', | 64 | name: 'operation-bar', |
@@ -82,11 +83,15 @@ | @@ -82,11 +83,15 @@ | ||
82 | }, | 83 | }, |
83 | methods: { | 84 | methods: { |
84 | share() { | 85 | share() { |
86 | + const href = location.href; | ||
87 | + const mark = /\?/.test(href) ? '&' : '?'; | ||
88 | + const channel = cookie.get('_Channel') || 'men'; | ||
89 | + | ||
85 | yoho.goShare({ | 90 | yoho.goShare({ |
86 | title: this.shareTitle || '', | 91 | title: this.shareTitle || '', |
87 | des: '我在BLK发现了一个不错的商品,快来看看吧!', | 92 | des: '我在BLK发现了一个不错的商品,快来看看吧!', |
88 | img: location.protocol + this.shareImg, | 93 | img: location.protocol + this.shareImg, |
89 | - url: location.href | 94 | + url: `${href}${mark}channel=${channel}` |
90 | }); | 95 | }); |
91 | }, | 96 | }, |
92 | toggleFavorite: function() { | 97 | toggleFavorite: function() { |
-
Please register or login to post a comment