Subscription.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <!-- 认购 -->
  3. <div class="subscription">
  4. <div class="subscription-content" v-if="subscriptionData > 0">
  5. <div class="subscription-head pf400 fs12 fc666666">
  6. <div class="head-name">名称</div>
  7. <div class="head-price">单价</div>
  8. <div class="head-operate">操作</div>
  9. </div>
  10. <div class="subscription-body">
  11. <div class="subscription-item" v-for="(item, index) in icoData" :key="index">
  12. <div class="item-name pf400 fs14 fc2C3131">{{ item.asset_name }}</div>
  13. <div class="item-price pf400 fs14 fc2C3131">
  14. {{ Number(item.issue_price).toFixed(2) }}
  15. </div>
  16. <div class="item-operate">
  17. <div class="text pf500 fs12 fcFFFFFF">认购</div>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="subscription-null" v-else>
  23. <img
  24. src="../../../assets/icon/index/subscription-null.svg"
  25. class="img-null"
  26. alt="" />
  27. </div>
  28. </div>
  29. </template>
  30. <script setup>
  31. import { ref, onMounted } from "vue";
  32. import { GetIcoIco } from "@/api/index";
  33. const icoData = ref();
  34. const subscriptionData = ref();
  35. const GetIcoIcoData = async () => {
  36. // 1,认购 2,配售
  37. const params = {
  38. asset_type: "1",
  39. };
  40. const data = await GetIcoIco(params);
  41. if (data) {
  42. icoData.value = data.list;
  43. subscriptionData.value = data.total;
  44. }
  45. };
  46. onMounted(() => {
  47. GetIcoIcoData();
  48. });
  49. </script>
  50. <style lang="less" scoped>
  51. .subscription {
  52. width: 349px;
  53. .subscription-content {
  54. margin-top: 15px;
  55. width: 100%;
  56. .subscription-head {
  57. display: flex;
  58. flex-direction: row;
  59. justify-content: flex-start;
  60. width: 100%;
  61. height: 24px;
  62. .head-name {
  63. width: 116px;
  64. height: 24px;
  65. line-height: 24px;
  66. text-align: left;
  67. letter-spacing: 0.17px;
  68. }
  69. .head-price {
  70. width: 117px;
  71. height: 24px;
  72. line-height: 24px;
  73. text-align: center;
  74. letter-spacing: 0.17px;
  75. }
  76. .head-operate {
  77. width: 116px;
  78. height: 24px;
  79. line-height: 24px;
  80. text-align: right;
  81. letter-spacing: 0.17px;
  82. }
  83. }
  84. .subscription-body {
  85. width: 100%;
  86. .subscription-item {
  87. display: flex;
  88. flex-direction: row;
  89. justify-content: flex-start;
  90. margin-top: 8px;
  91. padding-bottom: 8px;
  92. width: 100%;
  93. border-bottom: 1px solid #f5f5f5;
  94. .item-name {
  95. width: 116px;
  96. height: 24px;
  97. line-height: 24px;
  98. text-align: left;
  99. letter-spacing: 0.17px;
  100. }
  101. .item-price {
  102. width: 117px;
  103. height: 24px;
  104. line-height: 24px;
  105. text-align: center;
  106. letter-spacing: 0.17px;
  107. }
  108. .item-operate {
  109. display: flex;
  110. flex-direction: row;
  111. justify-content: flex-end;
  112. width: 116px;
  113. height: 24px;
  114. .text {
  115. width: 61px;
  116. height: 24px;
  117. line-height: 24px;
  118. text-align: center;
  119. border-radius: 5px;
  120. background: #45b26b;
  121. }
  122. }
  123. }
  124. }
  125. }
  126. .subscription-null {
  127. .img-null {
  128. margin-top: 117px;
  129. width: 343px;
  130. height: 267px;
  131. }
  132. }
  133. }
  134. </style>