index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="navigation-page">
  3. <headContent :showleftRight="false">
  4. <template #content>
  5. <view class="navigation-box">
  6. <view
  7. :class="['navigation-item hide_1' , navigationIndex === index ? 'active-navigation-item' : '']"
  8. v-for="(item , index) in navigationArr" :key="`navigation_${index}`"
  9. @click.stop="navigationIndex = index">
  10. {{ item }}
  11. </view>
  12. </view>
  13. </template>
  14. </headContent>
  15. <view class="content">
  16. <card :cardIndex="navigationIndex" :userInfo="UserInfo"></card>
  17. <!-- 合约账户 -->
  18. <template v-if="navigationIndex === 0">
  19. <contractModules />
  20. </template>
  21. <!-- 币币账户 -->
  22. <template v-if="navigationIndex === 1">
  23. <BibiModules />
  24. </template>
  25. <!-- 合约账户 -->
  26. <template v-if="navigationIndex === 2">
  27. <legalTenderModules />
  28. </template>
  29. <template v-else-if="navigationIndex === 3">
  30. <GiftMoneyModules />
  31. </template>
  32. </view>
  33. <!-- <uni-load-more /> -->
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. mapGetters
  39. } from 'vuex'
  40. import card from "./modules/card.vue"
  41. import contractModules from "./modules/contract/index.vue"
  42. import GiftMoneyModules from "./modules/GiftMoney/index.vue"
  43. import legalTenderModules from "./modules/legalTender/index.vue"
  44. import BibiModules from "./modules/Bibi/index.vue"
  45. import { Way_getUserInfo } from "@/utils/common-request.js"
  46. export default {
  47. name: 'property',
  48. components: {
  49. card,
  50. contractModules,
  51. GiftMoneyModules,
  52. legalTenderModules,
  53. BibiModules
  54. },
  55. data() {
  56. return {
  57. navigationIndex: 1,
  58. navigationArr: [
  59. '合约账户',
  60. '币币账户',
  61. '法币账户',
  62. '赠金账户'
  63. ],
  64. UserInfo: null
  65. };
  66. },
  67. computed: {
  68. ...mapGetters([
  69. 'token'
  70. ]),
  71. },
  72. onShow() {
  73. if(this.token){
  74. this.getUserInfo()
  75. }else{
  76. uni.navigateTo({
  77. url: '/pages/login/index'
  78. })
  79. }
  80. },
  81. onReachBottom() {
  82. console.log('页面触底')
  83. },
  84. methods:{
  85. getUserInfo(){
  86. Way_getUserInfo().then(res => {
  87. this.UserInfo = res
  88. console.log('this.UserInfo = ' , this.UserInfo.legal_wallet)
  89. }).catch(err => {
  90. this.UserInfo = null
  91. })
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .navigation-page {
  98. background-color: #fff;
  99. min-height: 100vh;
  100. .content {}
  101. }
  102. .navigation-box {
  103. width: 100%;
  104. height: 100%;
  105. padding-bottom: 11rpx;
  106. display: flex;
  107. align-items: flex-end;
  108. .navigation-item {
  109. width: 25%;
  110. text-align: center;
  111. height: 60rpx;
  112. border: 2rpx solid #27ae83;
  113. line-height: 60rpx;
  114. font-size: 28rpx;
  115. font-family: PingFang SC, PingFang SC-Regular;
  116. font-weight: 400;
  117. color: #05c175;
  118. &:nth-child(n + 2) {
  119. border-left: none;
  120. }
  121. &:last-child {
  122. border-radius: 0 6rpx 6rpx 0;
  123. }
  124. &:first-child {
  125. border-radius: 6rpx 0 0 6rpx;
  126. }
  127. }
  128. .active-navigation-item {
  129. background-color: #05C175;
  130. color: #FFFFFF;
  131. }
  132. }
  133. </style>