Browse Source

修改历史记录的盈亏变颜色

master
liaoxinyu 2 years ago
parent
commit
bdb4022366
  1. 21
      pages/exchange/contract-history.vue

21
pages/exchange/contract-history.vue

@ -47,7 +47,7 @@
</div> </div>
<div class="row d-flex m-y-mini justify-between"> <div class="row d-flex m-y-mini justify-between">
<div class="label fn-sm">{{$t('contract.c7')}}</div> <div class="label fn-sm">{{$t('contract.c7')}}</div>
<div class="color-light">{{item.profit*1||'--'}}</div> <div :class="profitColor(item)">{{item.profit*1||'--'}}</div>
</div> </div>
<div class="row d-flex m-y-mini justify-between"> <div class="row d-flex m-y-mini justify-between">
<div class="label fn-sm">{{$t('contract.b3')}}</div> <div class="label fn-sm">{{$t('contract.b3')}}</div>
@ -360,7 +360,15 @@ export default {
myCanvas.width=0 myCanvas.width=0
myCanvas.height=0 myCanvas.height=0
}, },
profitColor(item){
if(item && item.profit && item.profit.startsWith('-')){
return 'red'
}else if(item.profit == null){
return 'black'
}else{
return 'green'
}
}
}, },
mounted() { mounted() {
// this.generalizeInfo() // this.generalizeInfo()
@ -404,4 +412,13 @@ export default {
/deep/ .share.vant-popup-index{ /deep/ .share.vant-popup-index{
z-index: 100; z-index: 100;
} }
.red{
color: red;
}
.green{
color: green;
}
.black{
color: black;
}
</style> </style>

Loading…
Cancel
Save