Browse Source

修改价格有分隔符

master
liaoxinyu 11 months ago
parent
commit
80a585dc6e
  1. 4
      src/views/home/index.vue
  2. 16
      src/views/wallet/exchange-assets.vue

4
src/views/home/index.vue

@ -278,9 +278,9 @@
</div> </div>
</div> </div>
<div style="font-weight: bold;color: white;margin-top: 5px;">{{ item.close }}</div> <div style="font-weight: bold;color: white;margin-top: 5px;">{{ item.close }}</div>
<div> <!-- <div>
<div style="color: #6b6f6c;font-size: 12px;"> {{omitTo(item.close*price_cny,2)}} USD</div> <div style="color: #6b6f6c;font-size: 12px;"> {{omitTo(item.close*price_cny,2)}} USD</div>
</div> </div> -->
</router-link> </router-link>
</div> </div>
</div> </div>

16
src/views/wallet/exchange-assets.vue

@ -56,10 +56,11 @@
<div class="my-1"> <div class="my-1">
<span class="num h2"> <span class="num h2">
<template v-if="showValue">{{userAssets.total_assets_usd|omitTo(2)}}</template> <!-- <template v-if="showValue">{{userAssets.total_assets_usd|omitTo(2)}}</template> -->
<template v-if="showValue">${{price1(userAssets.total_assets_usd,2)}}</template>
<template v-else>********</template> <template v-else>********</template>
</span> </span>
USDT <!-- USDT -->
</div> </div>
<div class="container"> <div class="container">
<div class="row mt-4"> <div class="row mt-4">
@ -68,6 +69,7 @@
<div> <div>
<span class="num h3"> <span class="num h3">
<template v-if="showValue">{{userAssets.funds_account_usd|omitTo(2)}}</template> <template v-if="showValue">{{userAssets.funds_account_usd|omitTo(2)}}</template>
<!-- <template v-if="showValue">{{price1(userAssets.funds_account_usd,2)}}</template> -->
<template v-else>********</template> <template v-else>********</template>
</span> </span>
USDT USDT
@ -559,6 +561,16 @@ export default {
} }
}, },
methods: { methods: {
price1(item,index){
if (item) {
let price = item.toFixed(index).toString();
let parts = price.split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
return parts.join(".");
}else{
return '0.00';
}
},
// //
paypalSbumit(){ paypalSbumit(){
if(!this.paypal.amount){ if(!this.paypal.amount){

Loading…
Cancel
Save