index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 />
  17. </template>
  18. <!-- 赠金交易 -->
  19. <template v-if="contractIndex === 2">
  20. <grants />
  21. </template>
  22. <notarize />
  23. </view>
  24. </template>
  25. <script>
  26. import notarize from "./modules/notarize.vue"
  27. import sustainability from "./sustainability/index.vue"
  28. import grants from "./grants/index.vue"
  29. export default {
  30. name:'contract',
  31. components:{notarize , sustainability , grants},
  32. data() {
  33. return {
  34. contractIndex:2,
  35. contractArr:[
  36. '永续合约',
  37. '快捷合约',
  38. '赠金交易'
  39. ]
  40. };
  41. }
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .navigation-box {
  46. width: 100%;
  47. height: 100%;
  48. padding-bottom: 11rpx;
  49. display: flex;
  50. align-items: flex-end;
  51. .navigation-item {
  52. // width: 25%;
  53. flex: 1;
  54. flex-shrink: 0;
  55. text-align: center;
  56. height: 60rpx;
  57. border: 2rpx solid #27ae83;
  58. line-height: 60rpx;
  59. font-size: 28rpx;
  60. font-family: PingFang SC, PingFang SC-Regular;
  61. font-weight: 400;
  62. color: #05c175;
  63. &:nth-child(n + 2) {
  64. border-left: none;
  65. }
  66. &:last-child {
  67. border-radius: 0 6rpx 6rpx 0;
  68. }
  69. &:first-child {
  70. border-radius: 6rpx 0 0 6rpx;
  71. }
  72. }
  73. .active-navigation-item {
  74. background-color: #05C175;
  75. color: #FFFFFF;
  76. }
  77. }
  78. </style>