usdt.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="usdt-box" :rise-fall="stocksColor">
  3. <view :class="['usdt-item' ,$setColor(item.change)]" v-for="(item , index ) in usdtList"
  4. :key="`usdt_${index}`" @click.stop="getPicture(item)">
  5. <text class="item-title">{{ item.currency_name }}{{ item.legal_name ? `/${item.legal_name}` : '' }}</text>
  6. <text class="item-nums color">{{ $numIntercepting(item.now_price , 2) }}</text>
  7. <text class="item-ratio color">{{ item.change }}%</text>
  8. <text class="item-result"><text class="iconfont">≈</text><text class="iconfont2">&#xe615;</text>{{ $numIntercepting(item.volume , 2) }}</text>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {
  14. mapGetters
  15. } from 'vuex'
  16. export default {
  17. name: "usdtModules",
  18. data() {
  19. return {
  20. };
  21. },
  22. computed: {
  23. ...mapGetters([
  24. 'stocksColor',
  25. 'usdtList'
  26. ]),
  27. },
  28. methods:{
  29. getPicture(val){
  30. // this.$setStorageSync('Picture' , val)
  31. this.$store.commit('websocket/set_currency_val' , val)
  32. uni.switchTab({
  33. url: '/pages/contract/index'
  34. });
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .usdt-box {
  41. width: 100%;
  42. min-height: 218rpx;
  43. background-color: $modules-box-bg;
  44. padding: 30rpx $pages-padding 20rpx;
  45. display: flex;
  46. .usdt-item {
  47. width: 33%;
  48. display: flex;
  49. flex-direction: column;
  50. justify-content: center;
  51. align-items: center;
  52. font-family: PingFang SC, PingFang SC-Bold;
  53. font-weight: 700;
  54. .item-title {
  55. font-size: 22rpx;
  56. line-height: 30rpx;
  57. color: #1a1a1a;
  58. letter-spacing: 0.44rpx;
  59. }
  60. .item-nums {
  61. font-size: 34rpx;
  62. line-height: 53rpx;
  63. padding-top: 11rpx;
  64. letter-spacing: 0.76rpx;
  65. }
  66. .item-ratio {
  67. font-size: 22rpx;
  68. line-height: 33rpx;
  69. padding-top: 7rpx;
  70. letter-spacing: 0.44rpx;
  71. }
  72. .item-result {
  73. font-size: 20rpx;
  74. font-family: PingFang SC, PingFang SC-Regular;
  75. font-weight: 400;
  76. line-height: 33rpx;
  77. color: #808080;
  78. display: flex;
  79. align-items: center;
  80. .iconfont,.iconfont2{
  81. font-size: 18rpx;
  82. }
  83. }
  84. }
  85. .err-item {
  86. .item-nums {
  87. color: #FF0000;
  88. }
  89. .item-ratio {
  90. color: #BE1B1B;
  91. }
  92. }
  93. }
  94. </style>