Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangwenxue
5 years ago
Commit
232216a3f40e63cd2caffc6477523bb88f7af467
1 parent
38e8030d
商品详情:调整变现流程
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
6 deletions
apps/pages/product/components/size-select-sheet.vue
apps/pages/product/components/top-list.vue
apps/pages/product/product-detail.scss
apps/pages/product/product-detail.vue
apps/pages/product/components/size-select-sheet.vue
View file @
232216a
...
...
@@ -18,8 +18,8 @@
@select="onSelectSize"
@add="onAdd" />
<div class="footer">
<cube-button v-if="config.type === 'sell'" @click="magic">变现 <span><i>¥</i>{{399}}</span></cube-button>
<cube-button @click="select" :class="{active: selectedSize.size_id }">{{config.title}}</cube-button>
<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: isTradable }">{{config.title}}</cube-button>
</div>
</div>
</div>
...
...
@@ -83,6 +83,31 @@ export default {
},
canAddSize() {
return get(this.product, 'goods_list[0].canAddSize', false);
},
/**
* 可交易(购买|出售)
*/
isTradable() {
return this.selectedSize && this.selectedSize.size_id;
},
/**
* 变现价格,使用bid_moster_price
*/
cashPrice() {
if (this.selectedSize && this.selectedSize.hasOwnProperty('bid_moster_price')) {
return this.selectedSize.bid_moster_price;
}
return '-';
},
/**
* 是否可变现
*/
isMarketable() {
return this.cashPrice !== '-' && this.cashPrice > 0;
}
},
mounted() {
...
...
@@ -106,12 +131,18 @@ export default {
this.$emit('add');
},
select() {
if (!this.isTradable) {
return;
}
this.$emit('select', {
productId: this.product.product_id,
storageId: this.selectedSize.storage_id,
});
},
magic() {
convertToCash() {
if (!this.isMarketable) {
return;
}
this.hide();
// TODO: TBD
...
...
apps/pages/product/components/top-list.vue
View file @
232216a
...
...
@@ -64,7 +64,7 @@ export default {
.row {
overflow: hidden;
margin: -8px;
margin:
0
-8px;
.col {
width: 33.3333%;
...
...
apps/pages/product/product-detail.scss
View file @
232216a
...
...
@@ -17,7 +17,7 @@ $sub-color : #64ad88;
}
&
.active
{
border
:
0
;
border
-color
:
$primary-color
;
background
:
$primary-color
;
color
:
#fff
;
}
...
...
apps/pages/product/product-detail.vue
View file @
232216a
...
...
@@ -178,7 +178,9 @@ export default {
this.imageHideThreadhold = -window.innerWidth * 0.693;
},
activated() {
this.loadData(this.productId);
if (this.productId !== this.productDetail.product_id) {
this.loadData(this.productId);
}
},
methods: {
...mapActions(['fetchProductInfo', 'fetchTop3', 'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct']),
...
...
Please
register
or
login
to post a comment