index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. <!-- 合约账户 -->
  17. <template v-if="navigationIndex === 0">
  18. <contractModules />
  19. </template>
  20. <!-- 币币账户 -->
  21. <template v-if="navigationIndex === 1">
  22. <BibiModules />
  23. </template>
  24. <!-- 合约账户 -->
  25. <template v-if="navigationIndex === 2">
  26. <legalTenderModules />
  27. </template>
  28. <template v-else-if="navigationIndex === 3">
  29. <GiftMoneyModules />
  30. </template>
  31. </view>
  32. <!-- <uni-load-more /> -->
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. mapGetters
  38. } from 'vuex'
  39. import card from "./modules/card.vue"
  40. import contractModules from "./modules/contract/index.vue"
  41. import GiftMoneyModules from "./modules/GiftMoney/index.vue"
  42. import legalTenderModules from "./modules/legalTender/index.vue"
  43. import BibiModules from "./modules/Bibi/index.vue"
  44. import {
  45. Way_getUserInfo
  46. } from "@/utils/common-request.js"
  47. export default {
  48. name: 'property',
  49. components: {
  50. card,
  51. contractModules,
  52. GiftMoneyModules,
  53. legalTenderModules,
  54. BibiModules
  55. },
  56. data() {
  57. return {
  58. navigationIndex: 0,
  59. navigationArr: [
  60. '合约账户',
  61. '币币账户',
  62. '法币账户',
  63. '赠金账户'
  64. ],
  65. UserInfo: null,
  66. };
  67. },
  68. computed: {
  69. ...mapGetters([
  70. 'token'
  71. ]),
  72. },
  73. onShow() {
  74. this.getTokenStatus()
  75. },
  76. onReachBottom() {
  77. console.log('页面触底')
  78. },
  79. watch: {
  80. token: {
  81. handler(newToken) {
  82. if (!newToken) {
  83. this.goLogin()
  84. };
  85. }
  86. }
  87. },
  88. methods: {
  89. goLogin(){
  90. // #ifndef APP-PLUS
  91. uni.redirectTo({
  92. url: '/pages/login/index'
  93. })
  94. // #endif
  95. },
  96. getTokenStatus() {
  97. if (this.token) {
  98. this.getAccountInfo()
  99. } else {
  100. this.goLogin()
  101. }
  102. },
  103. getAccountInfo() {
  104. this.$store.dispatch('possession/getPossession').then(res => {
  105. console.log('获取成功')
  106. }).catch(err => {
  107. console.log('获取shibai ')
  108. })
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .navigation-page {
  115. background-color: #fff;
  116. min-height: 100vh;
  117. .content {}
  118. }
  119. .navigation-box {
  120. width: 100%;
  121. height: 100%;
  122. padding-bottom: 11rpx;
  123. display: flex;
  124. align-items: flex-end;
  125. .navigation-item {
  126. width: 25%;
  127. text-align: center;
  128. height: 60rpx;
  129. border: 2rpx solid #27ae83;
  130. line-height: 60rpx;
  131. font-size: 28rpx;
  132. font-family: PingFang SC, PingFang SC-Regular;
  133. font-weight: 400;
  134. color: #05c175;
  135. &:nth-child(n + 2) {
  136. border-left: none;
  137. }
  138. &:last-child {
  139. border-radius: 0 6rpx 6rpx 0;
  140. }
  141. &:first-child {
  142. border-radius: 6rpx 0 0 6rpx;
  143. }
  144. }
  145. .active-navigation-item {
  146. background-color: #05C175;
  147. color: #FFFFFF;
  148. }
  149. }
  150. </style>