fast-history.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <headContent borderBottom>
  4. <template #left>
  5. <reverse-back />
  6. </template>
  7. <template #content>
  8. <view class="haed-title">
  9. 历史仓位
  10. </view>
  11. </template>
  12. </headContent>
  13. <template v-for="item in list">
  14. <view class="content-box" :rise-fall="stocksColor">
  15. <view class="content-top">
  16. <view class="top-left">
  17. <view class="top-left-title">
  18. <text>{{ item.symbol }}</text>
  19. <text v-if="item.settled == 0">永续</text>
  20. <text v-else-if="item.settled == 9">快捷</text>
  21. </view>
  22. <view class="top-left-b">
  23. <text>{{ item.multiple }}倍杠杆</text>
  24. <text class="top-left-b-tag">{{ item.type_name }}</text>
  25. </view>
  26. </view>
  27. <view :class="['top-right' , $setColor(item.profits)]">
  28. <text class="color">{{ item.profits }}</text>
  29. <text class="color top-right-float">平仓盈亏{{ item.fact_profits }}%</text>
  30. </view>
  31. <!-- <view class="top-right top-right-btns">
  32. <text class="top-right-btn" @click.stop="setCloseLeverAll()">撤单</text>
  33. </view> -->
  34. </view>
  35. <view class="content-info">
  36. <view class="info-item">
  37. <text class="info-item-lable">保证金(USDT)</text>
  38. <text class="info-item-val">{{ item.caution_money }}</text>
  39. </view>
  40. <view class="info-item">
  41. <text class="info-item-lable">开仓价格(USDT)</text>
  42. <text class="info-item-val">{{ item.price }}</text>
  43. </view>
  44. <view class="info-item">
  45. <text class="info-item-lable">平仓价格(USDT)</text>
  46. <text class="info-item-val">{{ item.origin_price }}</text>
  47. </view>
  48. <view class="info-item">
  49. <text class="info-item-lable">平仓数量(张)</text>
  50. <text class="info-item-val">{{ item.number }}</text>
  51. </view>
  52. <view class="info-item">
  53. <text class="info-item-lable">手续费(USDT)</text>
  54. <text class="info-item-val">{{ item.trade_fee || '--' }}</text>
  55. </view>
  56. <view class="info-item">
  57. <text class="info-item-lable">平仓类型(USDT)</text>
  58. <text class="info-item-val">{{ item.status === 3 ? '强制平仓' : '' }}</text>
  59. </view>
  60. </view>
  61. <view class="record-hint">
  62. <text class="record-lable">平仓时间 {{ $getData_(item.create_time ) }}</text>
  63. <view class="record-icon">
  64. <text class="icon-size iconfont">&#xe8b0;</text>
  65. <text class="icon-size">分享</text>
  66. </view>
  67. </view>
  68. </view>
  69. <gap />
  70. </template>
  71. <view class="loadmore-box" v-show="loadStatus !== 'nomore' || list.length > 0">
  72. <u-loadmore :status="loadStatus" nomoreText="没有更多数据" :fontSize='28' :icon="false"/>
  73. </view>
  74. <empty class="empty-content" v-show="loadStatus === 'nomore' && list.length <= 0" />
  75. </view>
  76. </template>
  77. <script>
  78. import {
  79. mapGetters
  80. } from 'vuex'
  81. import {
  82. Api_getRegister
  83. } from "@/api/index.js"
  84. export default {
  85. name: 'fast-history',
  86. data() {
  87. return {
  88. list: [],
  89. loadStatus: 'nomore', // loading / nomore / loadmore
  90. limit: 10,
  91. page: 1,
  92. };
  93. },
  94. computed: {
  95. ...mapGetters([
  96. "stocksColor",
  97. 'PageContentHeight'
  98. ])
  99. },
  100. onLoad() {
  101. this.getRegister()
  102. },
  103. onReachBottom() {
  104. if (this.loadStatus === 'loadmore') {
  105. this.page++;
  106. this.getRegister()
  107. }
  108. },
  109. methods: {
  110. getRegister() {
  111. if (this.loadStatus === 'loading') {
  112. return false
  113. };
  114. this.loadStatus = 'loading'
  115. Api_getRegister({
  116. status: -1,
  117. page: this.page,
  118. limit: this.limit,
  119. settled: 9
  120. }).then(res => {
  121. const data = res.message;
  122. this.list = this.list.concat(data.data)
  123. this.page = data.current_page
  124. if (this.list.length >= data.total) {
  125. this.loadStatus = 'nomore'
  126. } else {
  127. this.loadStatus = 'loadmore'
  128. }
  129. }).catch(err => {
  130. if (this.page >= 2) {
  131. this.page -= 1;
  132. this.loadStatus = 'loadmore'
  133. } else {
  134. this.loadStatus = 'nomore'
  135. }
  136. })
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. @import "~../sustainability/index.scss";
  143. </style>