trade-list.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="p-md">
  3. <view class="color-light fn-16">{{$t('exchange.d3')}}</view>
  4. <table class="w-max ">
  5. <thead class="fn-xs">
  6. <tr>
  7. <td class="p-y-xs p-l-md">{{$t('exchange.d4')}}</td>
  8. <td class="p-y-xs ">{{$t('exchange.d5')}}</td>
  9. <td class="p-y-xs fn-right">{{$t('exchange.d2')}}</td>
  10. <td class="p-y-xs fn-right p-r-md">{{$t('exchange.c5')}}</td>
  11. </tr>
  12. </thead>
  13. <tbody class="color-light trade-list">
  14. <!-- ||item.tradeId -->
  15. <tr v-for="(item,idx) in tradeList" :key="idx">
  16. <td class="p-y-xs p-l-md rounded-bl-xs rounded-tl-xs">{{parseTime(item.ts,false,'{h}:{i}:{s}')}}</td>
  17. <td :class="`color-${item.direction}`">
  18. <template v-if="item.direction=='buy'">{{$t('exchange.b5')}}</template>
  19. <template v-else-if="'sell'">{{$t('exchange.b6')}}</template>
  20. </td>
  21. <td class="fn-right">{{item.price}}</td>
  22. <td class="p-y-xs p-r-md fn-right rounded-br-xs rounded-tr-xs">{{omitTo(item.amount,8)*1}}</td>
  23. </tr>
  24. </tbody>
  25. </table>
  26. </view>
  27. </template>
  28. <script>
  29. import date from "@/utils/class/date";
  30. import math from "@/utils/class/math";
  31. export default {
  32. name: "trade-list",
  33. props:{
  34. tradeList:{
  35. type:Array,
  36. default:()=>[],
  37. required:true
  38. }
  39. },
  40. data() {
  41. return {};
  42. },
  43. methods: {
  44. parseTime: date.parseTime,
  45. omitTo: math.omitTo,
  46. },
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. .trade-list{
  51. tr:nth-of-type(2n-1){
  52. box-shadow: $shadow;
  53. border-radius: $border-radius-xs;
  54. td{
  55. background: $panel-3;
  56. }
  57. }
  58. }
  59. </style>