Showing
1 changed file
with
11 additions
and
5 deletions
@@ -392,7 +392,6 @@ | @@ -392,7 +392,6 @@ | ||
392 | data() { | 392 | data() { |
393 | return { | 393 | return { |
394 | yoho: yoho, | 394 | yoho: yoho, |
395 | - isApp: yoho.isApp, | ||
396 | intro: {}, | 395 | intro: {}, |
397 | firstImage: '', | 396 | firstImage: '', |
398 | entity: { | 397 | entity: { |
@@ -432,13 +431,14 @@ | @@ -432,13 +431,14 @@ | ||
432 | this.showFeatureSelector = false; | 431 | this.showFeatureSelector = false; |
433 | tip(result.message); | 432 | tip(result.message); |
434 | }); | 433 | }); |
435 | - } | 434 | + }, |
435 | + | ||
436 | + //state | ||
437 | + isApp: yoho.isApp, | ||
438 | + isSoldOut: true | ||
436 | }; | 439 | }; |
437 | }, | 440 | }, |
438 | computed: { | 441 | computed: { |
439 | - isSoldOut: function() { | ||
440 | - return this.entity.storage === 0; | ||
441 | - } | ||
442 | }, | 442 | }, |
443 | components: { | 443 | components: { |
444 | imageCarousel: require('./image-carousel.vue'), | 444 | imageCarousel: require('./image-carousel.vue'), |
@@ -490,6 +490,8 @@ | @@ -490,6 +490,8 @@ | ||
490 | const self = this; | 490 | const self = this; |
491 | const pid = app.data('pid'); | 491 | const pid = app.data('pid'); |
492 | 492 | ||
493 | + this.isSoldOut = true; | ||
494 | + | ||
493 | // 显示商品特征选择组件 | 495 | // 显示商品特征选择组件 |
494 | this.$on('feature.close', function() { | 496 | this.$on('feature.close', function() { |
495 | self.showFeatureSelector = false; | 497 | self.showFeatureSelector = false; |
@@ -500,6 +502,10 @@ | @@ -500,6 +502,10 @@ | ||
500 | // TODO: 异常处理 | 502 | // TODO: 异常处理 |
501 | this.entity = result; | 503 | this.entity = result; |
502 | 504 | ||
505 | + if (this.entity.storage !== 0 && this.entity.status !== 0) { | ||
506 | + this.isSoldOut = false; | ||
507 | + } | ||
508 | + | ||
503 | this.entity.goodsList.forEach((goods)=> { | 509 | this.entity.goodsList.forEach((goods)=> { |
504 | if (!this.firstImage && goods.colorImage) { | 510 | if (!this.firstImage && goods.colorImage) { |
505 | this.firstImage = goods.colorImage; | 511 | this.firstImage = goods.colorImage; |
-
Please register or login to post a comment