index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="history-box" :rise-fall="stocksColor">
  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. <view class="swiper-lable">
  14. <template v-for="(item , index) in historyLable">
  15. <view @click.stop="historyIdex = index"
  16. :class="['swiper-lable-item' , historyIdex === index ? 'active-swiper-lable' : '']">
  17. {{ item.name }}
  18. </view>
  19. </template>
  20. </view>
  21. <view class="">
  22. <!-- <u-swiper :list="list1" @change="change" ></u-swiper> -->
  23. <swiper class="swiper-content" :current="historyIdex"
  24. :style="{'height': swiperHeight ? `${swiperHeight}px` : '' }" :duration="200">
  25. <swiper-item class="swiper-item-box">
  26. <at-present :listHeight="swiperHeight" :status="historyLable[historyIdex].status"
  27. :legal_id="legal_id" :currency_id="currency_id" />
  28. </swiper-item>
  29. <swiper-item class="swiper-item-box">
  30. <history-entrust :listHeight="swiperHeight" :status="historyLable[historyIdex].status"
  31. :legal_id="legal_id" :currency_id="currency_id" />
  32. </swiper-item>
  33. <swiper-item>
  34. <history-freight-space :listHeight="swiperHeight" :status="historyLable[historyIdex].status" @shareContent="val => $refs.shareRef.openShare(val)"/>
  35. </swiper-item>
  36. <swiper-item>
  37. <turnover :listHeight="swiperHeight" :status="historyLable[historyIdex].status" />
  38. </swiper-item>
  39. </swiper>
  40. </view>
  41. <sharePage ref="shareRef" :shareType="2"></sharePage>
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. mapGetters
  47. } from 'vuex'
  48. import entrust from "../sustainability/entrust.vue"
  49. import atPresent from "./at-present.vue"
  50. import historyEntrust from "./history-entrust.vue"
  51. import historyFreightSpace from "./history-freight-space.vue"
  52. import turnover from "./turnover.vue"
  53. import {
  54. Api_getRegister
  55. } from "@/api/index.js"
  56. export default {
  57. name: 'contract-history',
  58. components: {
  59. entrust,
  60. historyEntrust,
  61. historyFreightSpace,
  62. turnover,
  63. atPresent
  64. },
  65. data() {
  66. return {
  67. legal_id: '',
  68. currency_id: '',
  69. swiperHeight: 0,
  70. historyIdex: 0,
  71. historyLable: [
  72. // 类型:
  73. // -1:历史仓位;
  74. // 3:成交记录;
  75. // 0:当前委托;
  76. // 1:当前持仓
  77. // (无历史委托,成交的委托会转 1 当前持仓,成交后转 成交记录)
  78. {
  79. name: '当前委托',
  80. status: 0,
  81. },
  82. {
  83. name: '历史委托',
  84. status: 999,
  85. },
  86. {
  87. name: '历史仓位',
  88. status: -1,
  89. },
  90. {
  91. name: '成交记录',
  92. status: 3,
  93. }
  94. ],
  95. historyData: [
  96. [],
  97. [],
  98. []
  99. ]
  100. };
  101. },
  102. computed: {
  103. ...mapGetters([
  104. "stocksColor",
  105. 'PageContentHeight'
  106. ])
  107. },
  108. watch: {
  109. PageContentHeight: {
  110. handler(newH) {
  111. if (newH) {
  112. this.swiperHeight = newH - uni.upx2px(96);
  113. }
  114. },
  115. immediate: true
  116. },
  117. },
  118. onLoad(opt) {
  119. this.legal_id = opt?.legal_id;
  120. this.currency_id = opt?.currency_id;
  121. // ?legal_id=3&currency_id=1
  122. },
  123. mounted() {
  124. },
  125. methods: {
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. @import "~../sustainability/index.scss";
  131. .history-box {
  132. width: 100%;
  133. height: 100vh;
  134. // <view class="swiper-lable">
  135. // <template v-for="(item , index) in historyLable">
  136. // <view class="swiper-lable-item">{{ item.name }}</view>
  137. // </template>
  138. // </view>
  139. .swiper-lable {
  140. padding: 0 $pages-padding;
  141. width: 100%;
  142. height: 96rpx;
  143. border-bottom: 1rpx solid $border-color;
  144. background-color: #fff;
  145. display: flex;
  146. align-items: stretch;
  147. .swiper-lable-item {
  148. display: flex;
  149. align-items: center;
  150. font-size: 28rpx;
  151. color: $SizeColor3;
  152. font-weight: 700;
  153. &:nth-child(n + 2) {
  154. margin-left: 30rpx;
  155. }
  156. }
  157. .active-swiper-lable {
  158. position: relative;
  159. color: $Theme-Color;
  160. &::before {
  161. content: '';
  162. position: absolute;
  163. left: 50%;
  164. bottom: 0;
  165. width: 40rpx;
  166. height: 7rpx;
  167. background-color: $Theme-Color;
  168. transform: translateX(-50%);
  169. border-radius: 8rpx;
  170. }
  171. }
  172. }
  173. .swiper-content {
  174. width: 100%;
  175. .swiper-item-box {
  176. width: 100%;
  177. height: 100%;
  178. }
  179. .swiper-list {}
  180. }
  181. }
  182. </style>