时空网前端
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.

87 lines
2.5 KiB

  1. <template>
  2. <view>
  3. <view class="bg-white lf-p-t-40 lf-p-b-40 flex justify-around align-center text-center solid-bottom">
  4. <view class="tab-item"
  5. :class="current==index?'text-orange':'text-black1'"
  6. v-for="(item, index) in tab_list" :key="index"
  7. @click="current = index">{{ item.name }}
  8. </view>
  9. </view>
  10. <scroll-view :style="{height: 'calc('+ windowHeight +'px - 120rpx)'}"
  11. :scroll-y="true" :refresher-enabled="true"
  12. :refresher-triggered="isRefresher"
  13. @scrolltolower="onScrolltolower"
  14. @refresherrefresh="onRefresherrefresh"
  15. v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex"
  16. v-if="tabIndex == current">
  17. <view class="flex lf-p-30 solid-bottom" v-for="(item, index) in tabItem.list" :key="index">
  18. <view>
  19. <image src="../../static/center/shop-logo.png" style="height: 120rpx;width: 120rpx;" mode="aspectFill"></image>
  20. </view>
  21. <view class="flex flex-direction justify-around lf-p-l-20">
  22. <view class="lf-font-32 text-black1">时空网的内部网友 <text class="bg-red lf-font-24 lf-m-l-10" style="border-radius: 30rpx;padding: 5rpx 16rpx;">达人</text></view>
  23. <view class="lf-font-24 lf-color-gray">2021-7-6 21:32:53</view>
  24. </view>
  25. <!-- 回到顶部 -->
  26. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
  27. </view>
  28. </scroll-view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. current: 0, // tab下标
  36. pageSize: 10,
  37. isRefresher: false, // scroll-view下拉刷新状态,当前默认没有触发
  38. windowHeight: 0,
  39. tab_list: [{
  40. name: '内部粉丝',
  41. list: [1],
  42. page: 1,
  43. isPage: false,
  44. loadingClass: false,
  45. loadingText: '已加载全部数据'
  46. },{
  47. name: '外部粉丝',
  48. list: [1,2,3,4,5,6,7,8,9],
  49. page: 1,
  50. isPage: false,
  51. loadingClass: true,
  52. loadingText: '正在加载中'
  53. }]
  54. }
  55. },
  56. onLoad(){
  57. this.windowHeight = uni.getSystemInfoSync().windowHeight;
  58. },
  59. methods: {
  60. // 页面触底,加载下一页
  61. onScrolltolower(){
  62. console.log('加载下一页')
  63. },
  64. // scroll-view 下拉刷新
  65. onRefresherrefresh(){
  66. this.isRefresher = true;
  67. console.log('下拉刷新')
  68. setTimeout(() => {
  69. this.isRefresher = false;
  70. },1000)
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .tab-item{
  77. width: 50%;
  78. box-sizing: border-box;
  79. font-size: 32rpx;
  80. &:first-child{
  81. border-right: 2rpx solid rgba(0, 0, 0, 0.1);
  82. }
  83. }
  84. </style>