时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
4.6 KiB

  1. <template>
  2. <view>
  3. <!-- 钱包余额信息 -->
  4. <view class="wallet-top">
  5. <view class="bg-white wallet-wraptop flex-direction flex justify-around align-center text-center">
  6. <view class="text-black1 text-price1" style="font-size: 72rpx;">2000.48</view>
  7. <view class="text-gray lf-font-24 lf-m-b-20">佣金</view>
  8. <view>
  9. <button class="btn" @click="$url('/pages/center/widthdraw')">提取佣金</button>
  10. </view>
  11. </view>
  12. </view>
  13. <!-- tabs -->
  14. <view class="bg-white lf-p-t-40 lf-p-b-40 flex justify-around align-center text-center solid-bottom">
  15. <view class="tab-item" :class="current==index?'text-orange':'text-black1'"
  16. v-for="(item, index) in tab_list" :key="index"
  17. @click="current = index">{{ item.name }}
  18. </view>
  19. </view>
  20. <!-- scroll page -->
  21. <block v-if="current == 0">
  22. <scroll-view :style="{height: 'calc('+ windowHeight +'px - 530rpx)'}"
  23. class="scroll-view"
  24. :scroll-y="true" :refresher-enabled="true"
  25. :refresher-triggered="isRefresher"
  26. @scrolltolower="onScrolltolower"
  27. @refresherrefresh="onRefresherrefresh">
  28. <view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom" v-for="item in 12" :key="item">
  29. <view class="flex align-center text-center justify-between">
  30. <view class="lf-font-36 lf-color-price">-¥10.00</view>
  31. <view class="lf-font-32 text-black1">结余 ¥34.43</view>
  32. </view>
  33. <view class="flex align-center text-center justify-between lf-m-t-10">
  34. <view class="lf-font-24 lf-color-999">内部粉丝购买商品获得</view>
  35. <view class="lf-font-24 lf-color-999">2021-7-6 22:32:43</view>
  36. </view>
  37. </view>
  38. <!-- 空数据的情况 -->
  39. <view class="loading-more">
  40. <text v-if="tab_list[0].list.length" :class="{'loading-more-text': tab_list[0].loadingClass}">{{ tab_list[0].loadingText }}</text>
  41. <my-nocontent v-else></my-nocontent>
  42. </view>
  43. </scroll-view>
  44. </block>
  45. <block v-else>
  46. <scroll-view :style="{height: 'calc('+ windowHeight +'px - 524rpx)'}"
  47. :scroll-y="true" :refresher-enabled="true"
  48. :refresher-triggered="isRefresher"
  49. @scrolltolower="onScrolltolower"
  50. @refresherrefresh="onRefresherrefresh">
  51. <view class="flex flex-direction justify-between lf-p-t-20 lf-p-b-20 lf-p-l-32 lf-p-r-32 solid-bottom">
  52. <view class="flex align-center text-center justify-between">
  53. <view class="lf-font-36 lf-color-price">-¥11.00</view>
  54. <view class="lf-font-28 text-orange">申请中</view>
  55. </view>
  56. <view class="flex align-center text-center justify-between lf-m-t-10">
  57. <view class="lf-font-24 lf-color-999">流水号 638763485895875</view>
  58. <view class="lf-font-24 lf-color-999">2021-7-6 22:32:43</view>
  59. </view>
  60. </view>
  61. <!-- 空数据的情况 -->
  62. <view class="loading-more">
  63. <text v-if="tab_list[1].list.length" :class="{'loading-more-text': tab_list[1].loadingClass}">{{ tab_list[1].loadingText }}</text>
  64. <my-nocontent v-else></my-nocontent>
  65. </view>
  66. </scroll-view>
  67. </block>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. current: 0,
  75. pageSize: 10,
  76. isRefresher: false, // scroll-view下拉刷新状态,当前默认没有触发
  77. tab_list: [{
  78. name: '佣金记录',
  79. list: [1,2,3,4,5,6,7,8,9],
  80. page: 1,
  81. isPage: false,
  82. loadingClass: false,
  83. loadingText: '已加载全部数据'
  84. },{
  85. name: '提取记录',
  86. list: [1],
  87. page: 1,
  88. isPage: false,
  89. loadingClass: true,
  90. loadingText: '正在加载中'
  91. }],
  92. windowHeight: 0
  93. }
  94. },
  95. onLoad(){
  96. this.windowHeight = uni.getSystemInfoSync().windowHeight;
  97. },
  98. methods: {
  99. // 页面触底,加载下一页
  100. onScrolltolower(){
  101. console.log('加载下一页')
  102. },
  103. // scroll-view 下拉刷新
  104. onRefresherrefresh(){
  105. this.isRefresher = true;
  106. console.log('下拉刷新')
  107. setTimeout(() => {
  108. this.isRefresher = false;
  109. },1000)
  110. }
  111. }
  112. }
  113. </script>
  114. <style scoped lang="scss">
  115. .tab-item{
  116. font-size: 32rpx;
  117. width: 50%;
  118. box-sizing: border-box;
  119. &:first-child{
  120. border-right: 2rpx solid rgba(0, 0, 0, 0.1);
  121. }
  122. }
  123. .com {
  124. height: 900rpx;
  125. }
  126. .wallet-top {
  127. height: 404rpx;
  128. width: 100%;
  129. padding: 28rpx 32rpx;
  130. background-color: #FE9903;
  131. }
  132. .wallet-wraptop {
  133. width: 100%;
  134. height: 100%;
  135. border-radius: 10rpx;
  136. padding: 46rpx 0 44rpx 0;
  137. }
  138. .btn{
  139. margin: 0;
  140. padding: 0;
  141. width: 320rpx;
  142. height: 84rpx;
  143. background-color: #FE9903;
  144. color: #FFFFFF;
  145. line-height: 84rpx;
  146. font-size: 32rpx;
  147. border-radius: 42rpx;
  148. }
  149. .scroll-view{
  150. padding-bottom: constant(safe-area-inset-bottom);
  151. padding-bottom: env(safe-area-inset-bottom);
  152. }
  153. </style>