index.vue 3.8 KB

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