Authored by 郭成尧

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

@@ -69,10 +69,12 @@ $.ajax({ @@ -69,10 +69,12 @@ $.ajax({
69 }); 69 });
70 70
71 module.exports = (shareData) => { 71 module.exports = (shareData) => {
72 - window.wx.ready(function() {  
73 - window.wx.onMenuShareAppMessage(shareData);  
74 - window.wx.onMenuShareTimeline(shareData);  
75 - window.wx.onMenuShareQQ(shareData);  
76 - window.wx.onMenuShareWeibo(shareData);  
77 - }); 72 + if (window.wx) {
  73 + window.wx.ready(function() {
  74 + window.wx.onMenuShareAppMessage(shareData);
  75 + window.wx.onMenuShareTimeline(shareData);
  76 + window.wx.onMenuShareQQ(shareData);
  77 + window.wx.onMenuShareWeibo(shareData);
  78 + });
  79 + }
78 }; 80 };
@@ -396,6 +396,7 @@ @@ -396,6 +396,7 @@
396 const app = $('#app'); 396 const app = $('#app');
397 const tip = require('common/tip'); 397 const tip = require('common/tip');
398 const yoho = require('yoho'); 398 const yoho = require('yoho');
  399 + const share = require('common/share');
399 400
400 require('yoho-vue-swipe/dist/vue-swipe.css'); 401 require('yoho-vue-swipe/dist/vue-swipe.css');
401 402
@@ -525,6 +526,21 @@ @@ -525,6 +526,21 @@
525 } 526 }
526 }); 527 });
527 528
  529 + share({
  530 + title: this.entity.productName,
  531 + link: location.href,
  532 + desc: '我在BLK发现了一个不错的商品,快来看看吧!',
  533 + imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) {
  534 + const dict = {
  535 + '{width}': 300,
  536 + '{height}': 300,
  537 + '{mode}': 2
  538 + };
  539 +
  540 + return dict[$0];
  541 + })
  542 + });
  543 +
528 return result; 544 return result;
529 }).then((result)=> { 545 }).then((result)=> {
530 loadIntroDeferred = () => { 546 loadIntroDeferred = () => {