...
|
...
|
@@ -18,9 +18,9 @@ |
|
|
@select="onSelectSize"
|
|
|
@add="onAdd" />
|
|
|
<transition name="slide-up">
|
|
|
<div class="footer" v-if="isTradable">
|
|
|
<div class="footer" v-if="isAvailable">
|
|
|
<cube-button v-if="config.type === 'sell'" @click="convertToCash" :class="{active: isMarketable}">变现<span> <i>¥</i>{{cashPrice}}</span></cube-button>
|
|
|
<cube-button @click="select" class="active">{{config.title}}</cube-button>
|
|
|
<cube-button @click="select" :class="{active: isTradable}">{{config.title}}</cube-button>
|
|
|
</div>
|
|
|
</transition>
|
|
|
</div>
|
...
|
...
|
@@ -87,11 +87,15 @@ export default { |
|
|
return get(this.product, 'goods_list[0].canAddSize', false);
|
|
|
},
|
|
|
|
|
|
isAvailable() {
|
|
|
return this.selectedSize && this.selectedSize.size_id > 0;
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 可交易(购买|出售)
|
|
|
*/
|
|
|
isTradable() {
|
|
|
return this.selectedSize && this.selectedSize.size_id;
|
|
|
return this.isAvailable && this.selectedSize.storage_num > 0 && this.selectedSize.least_price !== '-';
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -106,10 +110,11 @@ export default { |
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 是否可变现
|
|
|
* 可变现
|
|
|
* 通过bid_moster_price或bid_skup判断
|
|
|
*/
|
|
|
isMarketable() {
|
|
|
return this.cashPrice !== '-' && this.cashPrice > 0;
|
|
|
return this.cashPrice > 0;
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
...
|
...
|
@@ -140,6 +145,7 @@ export default { |
|
|
productId: this.product.product_id,
|
|
|
storageId: this.selectedSize.storage_id,
|
|
|
skup: this.selectedSize.skup,
|
|
|
bid_skup: this.selectedSize.bid_skup,
|
|
|
});
|
|
|
},
|
|
|
convertToCash() {
|
...
|
...
|
|