Authored by 李奇

定金预售商品显示已售罄;分享链接修正

@@ -58,7 +58,7 @@ export default { @@ -58,7 +58,7 @@ export default {
58 return {}; 58 return {};
59 }, 59 },
60 buttonText() { 60 buttonText() {
61 - if (this.value.storage_sum <= 0) { 61 + if (this.value.storage_sum <= 0 || this.value.is_deposit_advance === 'Y') {
62 return '已售罄'; 62 return '已售罄';
63 } 63 }
64 return '加入购物车'; 64 return '加入购物车';
@@ -156,7 +156,7 @@ export default { @@ -156,7 +156,7 @@ export default {
156 return yoho.goLogin(); 156 return yoho.goLogin();
157 } 157 }
158 158
159 - if (this.value.storage_sum <= 0) { 159 + if (this.value.storage_sum <= 0 || this.value.is_deposit_advance === 'Y') {
160 return; 160 return;
161 } 161 }
162 if (!this.colorId) { 162 if (!this.colorId) {
@@ -283,6 +283,7 @@ @@ -283,6 +283,7 @@
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 import cookie from 'yoho-cookie';
  286 + import qs from 'yoho-qs';
286 287
287 288
288 const app = $('#app'); 289 const app = $('#app');
@@ -413,13 +414,14 @@ @@ -413,13 +414,14 @@
413 } 414 }
414 }); 415 });
415 416
416 - const href = location.href;  
417 - const mark = /\?/.test(href) ? '&' : '?'; 417 + const origin = location.origin;
  418 + const pathname = location.pathname;
418 const channel = cookie.get('_Channel') || 'men'; 419 const channel = cookie.get('_Channel') || 'men';
  420 + const queryStr = $.param(Object.assign(qs, {channel}));
419 421
420 share({ 422 share({
421 title: this.entity.product_name, 423 title: this.entity.product_name,
422 - link: `${href}${mark}channel=${channel}`, 424 + link: `${origin}${pathname}?${queryStr}`,
423 desc: '我在BLK发现了一个不错的商品,快来看看吧!', 425 desc: '我在BLK发现了一个不错的商品,快来看看吧!',
424 imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) { 426 imgUrl: this.firstImage.replace(/(\{width}|\{height}|\{mode})/g, function($0) {
425 const dict = { 427 const dict = {
@@ -56,9 +56,11 @@ @@ -56,9 +56,11 @@
56 } 56 }
57 </style> 57 </style>
58 <script> 58 <script>
  59 + import $ from 'yoho-jquery';
59 import yoho from 'yoho'; 60 import yoho from 'yoho';
60 import tip from 'common/tip'; 61 import tip from 'common/tip';
61 import cookie from 'yoho-cookie'; 62 import cookie from 'yoho-cookie';
  63 + import qs from 'yoho-qs';
62 64
63 export default { 65 export default {
64 name: 'operation-bar', 66 name: 'operation-bar',
@@ -83,15 +85,16 @@ @@ -83,15 +85,16 @@
83 }, 85 },
84 methods: { 86 methods: {
85 share() { 87 share() {
86 - const href = location.href;  
87 - const mark = /\?/.test(href) ? '&' : '?'; 88 + const origin = location.origin;
  89 + const pathname = location.pathname;
88 const channel = cookie.get('_Channel') || 'men'; 90 const channel = cookie.get('_Channel') || 'men';
  91 + const queryStr = $.param(Object.assign(qs, {channel}));
89 92
90 yoho.goShare({ 93 yoho.goShare({
91 title: this.shareTitle || '', 94 title: this.shareTitle || '',
92 des: '我在BLK发现了一个不错的商品,快来看看吧!', 95 des: '我在BLK发现了一个不错的商品,快来看看吧!',
93 img: location.protocol + this.shareImg, 96 img: location.protocol + this.shareImg,
94 - url: `${href}${mark}channel=${channel}` 97 + url: `${origin}${pathname}?${queryStr}`
95 }); 98 });
96 }, 99 },
97 toggleFavorite: function() { 100 toggleFavorite: function() {