index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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-box {
  115. padding: 0 $pages-padding;
  116. width: 100%;
  117. height: 100%;
  118. padding-bottom: 11rpx;
  119. display: flex;
  120. align-items: flex-end;
  121. .navigation-item {
  122. width: 25%;
  123. text-align: center;
  124. height: 60rpx;
  125. border: 2rpx solid #27ae83;
  126. line-height: 60rpx;
  127. font-size: 28rpx;
  128. font-family: PingFang SC, PingFang SC-Regular;
  129. font-weight: 400;
  130. color: #05c175;
  131. &:nth-child(n + 2) {
  132. border-left: none;
  133. }
  134. &:last-child {
  135. border-radius: 0 6rpx 6rpx 0;
  136. }
  137. &:first-child {
  138. border-radius: 6rpx 0 0 6rpx;
  139. }
  140. }
  141. .active-navigation-item {
  142. background-color: #05C175;
  143. color: #FFFFFF;
  144. }
  145. }
  146. </style>