index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <script>
  2. import homeIndex from "@/pages/home/home-index.vue";
  3. import myIndex from "@/pages/my/my-index.vue";
  4. import convertIndex from "@/pages/convert/convert-index.vue";
  5. // import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
  6. export default {
  7. components: { homeIndex, myIndex, convertIndex },
  8. data() {
  9. return {
  10. tab_index: 1
  11. };
  12. },
  13. mounted() {
  14. this.getMyData()
  15. // this.handlerDateDurationCurrent()
  16. },
  17. methods: {
  18. getMyData() {
  19. // let token = uni.getStorageSync('token')
  20. // if (token) {
  21. // getMemberInfo().then((res) => {
  22. // if (res.code === 1) {
  23. // this.memberData = res.data
  24. // tokenpocketBnb.getAccounts().then((babAddress)=>{
  25. // if(babAddress && this.memberData.address.toLocaleLowerCase()!==babAddress.toLocaleLowerCase()){
  26. // // uni.clearStorageSync()
  27. // // uni.reLaunch({
  28. // // 'url': 'pages/login/index'
  29. // // })
  30. // }
  31. // })
  32. // }
  33. // })
  34. // }
  35. },
  36. tabClick(num) {
  37. if(num) {
  38. this.tab_index = num
  39. }
  40. }
  41. },
  42. }
  43. </script>
  44. <template>
  45. <view class="flex-common-css">
  46. <view class="top-b bgc-f plr-20 box-sizing-border align-items-center flex-justify-space">
  47. <image
  48. class="img-box"
  49. src="@/static/img/logo/logo.png"
  50. ></image>
  51. <view class="fs-30">
  52. sdfsdfsfsd222
  53. </view>
  54. </view>
  55. <view class="content-b p-20 box-sizing-border">
  56. <view class="scroll-view-css">
  57. <homeIndex v-if="tab_index === 1"></homeIndex>
  58. <convertIndex v-else-if="tab_index === 2"></convertIndex>
  59. <myIndex v-else></myIndex>
  60. </view>
  61. <view class="tab-b align-items-center flex-justify-space b-rad-10 bgc-f">
  62. <view @click="tabClick(1)" class="flex-1 flex-direction-column align-items-center flex-justify-center">
  63. <image
  64. class="tab-img mb-4"
  65. v-if="tab_index === 1"
  66. :src="require('@/static/img/tab/index.svg')"
  67. ></image>
  68. <image
  69. class="tab-img mb-4"
  70. v-else
  71. :src="require('@/static/img/tab/index-two.svg')"
  72. ></image>
  73. <view class="fs-28" :class="tab_index === 1?'fc-f78820':''">首页</view>
  74. </view>
  75. <view @click="tabClick(2)" class="flex-1 flex-direction-column align-items-center flex-justify-center">
  76. <image
  77. class="tab-img mb-4"
  78. :src="require('@/static/img/tab/jh.svg')"
  79. ></image>
  80. <view class="fs-28" :class="tab_index === 2?'fc-f78820':''">兑换</view>
  81. </view>
  82. <view @click="tabClick(3)" class="flex-1 flex-direction-column align-items-center flex-justify-center">
  83. <image
  84. v-if="tab_index === 3"
  85. class="tab-img mb-4"
  86. :src="require('@/static/img/tab/my-two.svg')"
  87. ></image>
  88. <image
  89. v-else
  90. class="tab-img mb-4"
  91. :src="require('@/static/img/tab/my.svg')"
  92. ></image>
  93. <view class="fs-28" :class="tab_index === 3?'fc-f78820':''">我的</view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <style scoped lang="scss">
  100. .content-b{
  101. width: 100%;
  102. height: calc(100vh - 98rpx);
  103. display: flex;
  104. flex-direction: column;
  105. }
  106. .top-b{
  107. width: 100%;
  108. height: 98rpx;
  109. line-height: 98rpx;
  110. }
  111. .img-box{
  112. width: 78rpx;
  113. height: 60rpx;
  114. }
  115. .tab-img{
  116. width: 50rpx;
  117. height: 50rpx;
  118. }
  119. .tab-b{
  120. width: 100%;
  121. height: 138rpx;
  122. padding: 20rpx 0;
  123. box-sizing: border-box;
  124. }
  125. </style>