index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="Audit">
  3. <custom-navbar title="开园审核" id="custom-navbar"/>
  4. <view class="tabs">
  5. <van-tabs
  6. swipeable
  7. animated
  8. :active="active"
  9. @change="onChange"
  10. :border="false"
  11. :lazy-render="false"
  12. class="tabs-element"
  13. >
  14. <van-tab title="待审核" :name="0"><NeedAudit v-if="active === 0" :height="height" /></van-tab>
  15. <van-tab title="已审核" :name="1"><AlreadyAudit v-if="active === 1"/></van-tab>
  16. </van-tabs>
  17. <view class="tabs-line">
  18. <view class="tabs-line-item" :style="{left: mulTabsLineSite }">
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import CustomNavbar from '@/components/CustomNavbar'
  26. import NeedAudit from './needAudit'
  27. import AlreadyAudit from './alreadyAudit'
  28. import { getNodeInfo } from '@/utils/wxTool.js'
  29. export default {
  30. name: 'Audit',
  31. components: {
  32. CustomNavbar,
  33. NeedAudit,
  34. AlreadyAudit
  35. },
  36. computed: {
  37. activeTitle () {
  38. return `color: ${String(this.active)} == ${0} ? '#666666' : '#1677FF'`
  39. },
  40. mulTabsLineSite () {
  41. const width = this.$store.state.systemInfo.windowWidth
  42. const result = width / 2 / 2 - 10
  43. return this.active !== 0 ? result * 3 + 20 + 'px' : result + 'px'
  44. }
  45. },
  46. onLoad () {
  47. this.getNodeInfo()
  48. },
  49. data () {
  50. return {
  51. active: 0,
  52. height: ''
  53. }
  54. },
  55. methods: {
  56. onChange (item) {
  57. this.active = item.target.name
  58. },
  59. async getNodeInfo () {
  60. const res = await getNodeInfo('#custom-navbar', 'single')
  61. this.height = res.height
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped lang="less">
  67. .Audit {
  68. height: 100vh;
  69. .tabs {
  70. width: 100%;
  71. height: 102rpx;
  72. position: relative;
  73. .tabs-line {
  74. position: absolute;
  75. bottom: 16rpx;
  76. width: 100%;
  77. height: 6px;
  78. z-index: 1;
  79. &-item {
  80. width: 40rpx;
  81. height: 6rpx;
  82. background: #1677FF;
  83. box-shadow: 0px 2px 12px 0px rgba(22, 119, 255, 0.43);
  84. border-radius: 200px;
  85. position: absolute;
  86. transition: left .5s;
  87. }
  88. }
  89. }
  90. }
  91. /deep/ .van-tabs__line {
  92. display: none !important;
  93. }
  94. /deep/ .van-tabs__wrap {
  95. height: 102rpx !important;
  96. }
  97. /deep/ .van-ellipsis {
  98. font-size: 32rpx;
  99. font-family: PingFangSC-Medium, PingFang SC;
  100. font-weight: 500;
  101. }
  102. /deep/ .tabs-element .van-tab--active .van-ellipsis {
  103. color: #1677FF;
  104. }
  105. </style>