node.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="center">
  3. <view class="tab flex">
  4. <view class="left flex" @click="backIndex"><u-icon name="arrow-left" :size="40"></u-icon></view>
  5. <u-tabs-swiper
  6. class="tabBox"
  7. ref="uTabs"
  8. :height="70"
  9. :show-bar="false"
  10. active-color="#44969D"
  11. inactive-color='#6D7C88'
  12. :list="tabList"
  13. :current="current"
  14. @change="tabsChange"
  15. :is-scroll="false"
  16. ></u-tabs-swiper>
  17. </view>
  18. <swiper class="tabSwiper" :current="current" @animationfinish="transition">
  19. <swiper-item class="swiper-item">
  20. <scroll-view scroll-y @scrolltolower="onreachBottom">
  21. <view class="boxItem">
  22. <view class="item" v-for="ls in tabList[0].list">
  23. <view class="flex title">
  24. <view class="tip"></view>
  25. <view class="name">{{ ls.name }}</view>
  26. </view>
  27. <view class="itemConetnt">
  28. </view>
  29. </view>
  30. </view>
  31. <u-loadmore :status="tabList[0].loding"></u-loadmore>
  32. </scroll-view>
  33. </swiper-item>
  34. <swiper-item class="swiper-item">
  35. <scroll-view scroll-y @scrolltolower="onreachBottom"><u-loadmore :status="tabList[1].loding"></u-loadmore></scroll-view>
  36. </swiper-item>
  37. </swiper>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. current: 0, //当前选中的标签
  45. tabList: [
  46. {
  47. name: '节点认购',
  48. list: [
  49. {
  50. name: '节点认购第一期',
  51. num: 1000, //认购份额
  52. type: 'LALA', //认购货币类型
  53. ratio: 10, //认购名额
  54. limited: 20, //限购名额
  55. allMoney: 20, //认购总额
  56. moneyType: 'USDT' //兑换比例金额
  57. }
  58. ],
  59. pages: 1,
  60. limit: 10,
  61. loding: 'loadmore' //loading加载中 nomore没有数据
  62. },
  63. {
  64. name: '我的认购',
  65. pages: 1,
  66. limit: 10,
  67. list: [],
  68. loding: 'loadmore' //loading加载中 nomore没有数据
  69. }
  70. ]
  71. };
  72. },
  73. //页面加载即刻发生
  74. onload() {},
  75. methods: {
  76. backIndex() {
  77. uni.switchTab({
  78. url: '/pages/index/index'
  79. });
  80. },
  81. // 内容框切换事件
  82. transition(e) {
  83. console.log(e);
  84. },
  85. // tab切换事件
  86. tabsChange(e) {
  87. this.current = e;
  88. },
  89. // 下拉到底部加载事件
  90. onreachBottom(e) {
  91. console.log(e);
  92. }
  93. }
  94. };
  95. </script>
  96. <style lang="scss">
  97. .tabBox {
  98. flex-grow: 1;
  99. }
  100. .center {
  101. height: 0;
  102. min-height: 100%;
  103. }
  104. .tab {
  105. background-color: #ffffff;
  106. align-items: stretch;
  107. .left {
  108. padding-left: 10rpx;
  109. padding-right: 20rpx;
  110. }
  111. }
  112. .tabSwiper {
  113. height: calc(100% - 70rpx);
  114. .swiper-item {
  115. padding: 30rpx;
  116. .boxItem {
  117. .item {
  118. background-color: #ffffff;
  119. line-height: 1;
  120. padding: 30rpx;
  121. .title {
  122. justify-content: flex-start;
  123. padding-bottom: 30rpx;
  124. align-items: stretch;
  125. border-bottom: 1px solid $border-color-light;
  126. }
  127. .tip {
  128. width: 7rpx;
  129. border-radius: 99rpx;
  130. background-color: $base-color;
  131. }
  132. .name{
  133. margin-left: 20rpx;
  134. font-size: 30rpx;
  135. font-weight: bold;
  136. color: $font-color-dark;
  137. }
  138. }
  139. }
  140. }
  141. }
  142. </style>