Index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <HeaderNav headerText="交易历史"></HeaderNav>
  3. <div class="history-index">
  4. <div class="notifi-classifi">
  5. <div
  6. class="classifi-item"
  7. :class="currentTitle == 0 ? 'current-classifi' : 'pf600 fs14 fcA8A8A8'"
  8. @click="currentTitle = 0">
  9. 币币
  10. <div class="active-line" v-if="currentTitle == 0"></div>
  11. </div>
  12. <div
  13. class="classifi-item"
  14. :class="currentTitle == 1 ? 'current-classifi' : 'pf600 fs14 fcA8A8A8'"
  15. @click="currentTitle = 1">
  16. 合约
  17. <div class="active-line" v-if="currentTitle == 1"></div>
  18. </div>
  19. <div
  20. class="classifi-item"
  21. :class="currentTitle == 2 ? 'current-classifi' : 'pf600 fs14 fcA8A8A8'"
  22. @click="currentTitle = 2">
  23. 秒合约
  24. <div class="active-line" v-if="currentTitle == 2"></div>
  25. </div>
  26. <div
  27. class="classifi-item"
  28. :class="currentTitle == 3 ? 'current-classifi' : 'pf600 fs14 fcA8A8A8'"
  29. @click="currentTitle = 3">
  30. 期权
  31. <div class="active-line" v-if="currentTitle == 3"></div>
  32. </div>
  33. </div>
  34. <div class="history-menu">
  35. <div
  36. :class="
  37. current == 'currentEntrustment' ? 'pf600 fs14 #121212' : 'pf600 fs14 fcA8A8A8'
  38. "
  39. @click="messageChange('currentEntrustment')">
  40. 当前委托
  41. </div>
  42. <div
  43. :class="
  44. current == 'historicalEntrustment'
  45. ? 'pf600 fs14 #121212'
  46. : 'pf600 fs14 fcA8A8A8'
  47. "
  48. @click="messageChange('historicalEntrustment')">
  49. 历史委托
  50. </div>
  51. <div
  52. :class="
  53. current == 'positionHistory' ? 'pf600 fs14 #121212' : 'pf600 fs14 fcA8A8A8'
  54. "
  55. @click="messageChange('positionHistory')">
  56. 仓位历史
  57. </div>
  58. <div
  59. :class="
  60. current == 'historicalTransactions'
  61. ? 'pf600 fs14 #121212'
  62. : 'pf600 fs14 fcA8A8A8'
  63. "
  64. @click="messageChange('historicalTransactions')">
  65. 历史成交
  66. </div>
  67. <div
  68. :class="current == 'fundFlow' ? 'pf600 fs14 #121212' : 'pf600 fs14 fcA8A8A8'"
  69. @click="messageChange('fundFlow')">
  70. 资金流水
  71. </div>
  72. </div>
  73. <component :is="currentComponent" />
  74. </div>
  75. </template>
  76. <script setup>
  77. import HeaderNav from "../../index/components/HeaderNav.vue";
  78. import CurrentEntrustment from "./CurrentEntrustment.vue";
  79. import FundFlow from "./FundFlow.vue";
  80. import HistoricalEntrustment from "./HistoricalEntrustment.vue";
  81. import HistoricalTransactions from "./HistoricalTransactions.vue";
  82. import PositionHistory from "./PositionHistory.vue";
  83. import { ref, computed } from "vue";
  84. const currentTitle = ref(0);
  85. const current = ref("currentEntrustment");
  86. const componentsMap = {
  87. currentEntrustment: CurrentEntrustment,
  88. fundFlow: FundFlow,
  89. historicalEntrustment: HistoricalEntrustment,
  90. historicalTransactions: HistoricalTransactions,
  91. positionHistory: PositionHistory,
  92. };
  93. const currentComponent = computed(() => componentsMap[current.value]);
  94. const messageChange = (key) => {
  95. current.value = key;
  96. };
  97. </script>
  98. <style lang="less" scoped>
  99. .history-index {
  100. display: flex;
  101. flex-direction: column;
  102. justify-content: flex-start;
  103. align-items: center;
  104. width: 100%;
  105. .notifi-classifi {
  106. display: flex;
  107. flex-direction: row;
  108. justify-content: flex-start;
  109. align-items: flex-end;
  110. margin-top: 48px;
  111. width: 349px;
  112. height: 24px;
  113. .classifi-item {
  114. position: relative;
  115. margin-left: 43px;
  116. .active-line {
  117. position: absolute;
  118. bottom: -6px;
  119. left: 50%;
  120. transform: translateX(-50%);
  121. width: 20px;
  122. height: 3px;
  123. background-color: #323233;
  124. border-radius: 2px;
  125. }
  126. &:first-child {
  127. margin-left: 0;
  128. }
  129. }
  130. .current-classifi {
  131. font-family: "PingFang SC";
  132. font-style: normal;
  133. font-weight: 600;
  134. font-size: 18px;
  135. color: #121212;
  136. transition: color 0.3s, font-size 0.3s;
  137. }
  138. }
  139. .history-menu {
  140. display: flex;
  141. flex-direction: row;
  142. justify-content: space-between;
  143. align-items: flex-end;
  144. margin-top: 10px;
  145. width: 349px;
  146. height: 24px;
  147. }
  148. }
  149. </style>