Authored by 郭成尧

'处理收藏店铺分享'

@@ -25,7 +25,7 @@ module.exports = { @@ -25,7 +25,7 @@ module.exports = {
25 getShopInfo: (req, res, next) => { 25 getShopInfo: (req, res, next) => {
26 shopModel.getShopData({ 26 shopModel.getShopData({
27 domain: req.query.domain, 27 domain: req.query.domain,
28 - shopId: req.query.id, 28 + shopId: req.query.shopId,
29 uid: req.user.uid 29 uid: req.user.uid
30 }).then(result => { 30 }).then(result => {
31 res.json(result); 31 res.json(result);
@@ -79,7 +79,8 @@ module.exports = { @@ -79,7 +79,8 @@ module.exports = {
79 res.render('shop/share', { 79 res.render('shop/share', {
80 module: 'product', 80 module: 'product',
81 page: 'shop-share', 81 page: 'shop-share',
82 - domain: req.params.domain 82 + domain: req.params.domain,
  83 + shopId: req.query.id
83 }); 84 });
84 } 85 }
85 }; 86 };
1 -<div id="share" data-domain="{{domain}}"> 1 +<div id="share" data-domain="{{domain}}" data-shopid="{{shopId}}">
2 <share-box></share-box> 2 <share-box></share-box>
3 </div> 3 </div>
@@ -77,7 +77,10 @@ @@ -77,7 +77,10 @@
77 getShopInfo() { 77 getShopInfo() {
78 $.get({ 78 $.get({
79 url: '/product/shop/info.json', 79 url: '/product/shop/info.json',
80 - data: { domain: $share.data('domain') } 80 + data: {
  81 + domain: $share.data('domain'),
  82 + shopId: $share.data('shopid')
  83 + }
81 }).done(result => { 84 }).done(result => {
82 this.shopInfo = result; 85 this.shopInfo = result;
83 }).fail(() => { 86 }).fail(() => {
@@ -76,16 +76,20 @@ @@ -76,16 +76,20 @@
76 url: '/product/shop/info.json', 76 url: '/product/shop/info.json',
77 data: { 77 data: {
78 domain: $shop.data('domain'), 78 domain: $shop.data('domain'),
79 - id: $shop.data('shopid') // 店铺 ID 79 + shopId: $shop.data('shopid') // 店铺 ID
80 } 80 }
81 }).done(result => { 81 }).done(result => {
82 if (result) { 82 if (result) {
83 this.shopInfo = result; 83 this.shopInfo = result;
84 this.shopInfo.showBrandInfo = true; 84 this.shopInfo.showBrandInfo = true;
  85 + let shareUrl = locationQuery.id ?
  86 + location.origin + '/product/shop/favorite/share?id=' + locationQuery.id :
  87 + location.origin + '/product/shop/' + $shop.data('domain') + '/share';
  88 +
85 this.shareData = { 89 this.shareData = {
86 title: result.shopName, 90 title: result.shopName,
87 des: shareSubTitle, 91 des: shareSubTitle,
88 - url: location.origin + '/product/shop/' + $shop.data('domain') + '/share', 92 + url: shareUrl,
89 img: result.shopBg, 93 img: result.shopBg,
90 isBlkShop: result.isBlkShop, 94 isBlkShop: result.isBlkShop,
91 domain: locationQuery.domain, 95 domain: locationQuery.domain,