index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="contract">
  3. <headContent :showleftRight="false">
  4. <template #content>
  5. <view class="navigation-box">
  6. <view :class="['navigation-item hide_1' , contractIndex === index ? 'active-navigation-item' : '']"
  7. v-for="(item , index) in contractArr" :key="`navigation_${index}`"
  8. @click.stop="contractIndex = index">
  9. {{ item }}
  10. </view>
  11. </view>
  12. </template>
  13. </headContent>
  14. <!-- 永续合约 -->
  15. <template v-if="contractIndex === 0">
  16. <sustainability :currency-info="currency"/>
  17. </template>
  18. <!-- 永续合约 -->
  19. <template v-if="contractIndex === 1">
  20. <shortcut />
  21. </template>
  22. <!-- 赠金交易 -->
  23. <template v-if="contractIndex === 2">
  24. <grants />
  25. </template>
  26. <notarize />
  27. </view>
  28. </template>
  29. <script>
  30. import notarize from "./modules/notarize.vue"
  31. import sustainability from "./sustainability/index.vue"
  32. import grants from "./grants/index.vue"
  33. import shortcut from "./shortcut/index.vue"
  34. import { Api_getLeverDeal } from "@/api/index.js"
  35. // import { startWebSocket , startAjaxSocket} from "@/utils/websock.js"
  36. export default {
  37. name:'contract',
  38. components:{notarize , sustainability , grants , shortcut},
  39. data() {
  40. return {
  41. contractIndex: 0,
  42. contractArr:[
  43. '永续合约',
  44. '快捷合约',
  45. '赠金交易'
  46. ],
  47. currency:{},
  48. };
  49. },
  50. onLoad() {
  51. // startWebSocket();
  52. // startAjaxSocket()
  53. const val = this.$getStorageSync('Picture');
  54. if(val){
  55. this.currency = val;
  56. }
  57. console.log('val = ' , val)
  58. },
  59. methods:{
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .navigation-box {
  65. width: 100%;
  66. height: 100%;
  67. padding:0 $pages-padding 11rpx;
  68. display: flex;
  69. align-items: flex-end;
  70. .navigation-item {
  71. // width: 25%;
  72. flex: 1;
  73. flex-shrink: 0;
  74. text-align: center;
  75. height: 60rpx;
  76. border: 2rpx solid #27ae83;
  77. line-height: 60rpx;
  78. font-size: 28rpx;
  79. font-family: PingFang SC, PingFang SC-Regular;
  80. font-weight: 400;
  81. color: #05c175;
  82. &:nth-child(n + 2) {
  83. border-left: none;
  84. }
  85. &:last-child {
  86. border-radius: 0 6rpx 6rpx 0;
  87. }
  88. &:first-child {
  89. border-radius: 6rpx 0 0 6rpx;
  90. }
  91. }
  92. .active-navigation-item {
  93. background-color: #05C175;
  94. color: #FFFFFF;
  95. }
  96. }
  97. </style>