index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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>
  45. page{
  46. background-color: #fff;
  47. }
  48. </style>
  49. <style lang="scss" scoped>
  50. .navigation-box {
  51. width: 100%;
  52. height: 100%;
  53. padding-bottom: 11rpx;
  54. display: flex;
  55. align-items: flex-end;
  56. .navigation-item {
  57. // width: 25%;
  58. flex: 1;
  59. flex-shrink: 0;
  60. text-align: center;
  61. height: 60rpx;
  62. border: 2rpx solid #27ae83;
  63. line-height: 60rpx;
  64. font-size: 28rpx;
  65. font-family: PingFang SC, PingFang SC-Regular;
  66. font-weight: 400;
  67. color: #05c175;
  68. &:nth-child(n + 2) {
  69. border-left: none;
  70. }
  71. &:last-child {
  72. border-radius: 0 6rpx 6rpx 0;
  73. }
  74. &:first-child {
  75. border-radius: 6rpx 0 0 6rpx;
  76. }
  77. }
  78. .active-navigation-item {
  79. background-color: #05C175;
  80. color: #FFFFFF;
  81. }
  82. }
  83. </style>