task.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="total-page page-box page-env-20 scroll_content">
  3. <Nav :title="'任务'" :genre="1" :back="false" :fixedHeight="105"></Nav>
  4. <view class="task-tabs" :style="{top:`${$tools.topHeight()}px`}">
  5. <Search :placeholder="'贷款人姓名或电话'"></Search>
  6. <view style="height: 100rpx;">
  7. <z-tabs ref="tabs" :list="tabsList" :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'28rpx'}"
  8. :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
  9. :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
  10. </view>
  11. </view>
  12. <!-- 带Swiper -->
  13. <!-- <swiper style="height: 100vh;" :current="current" @transition="swiperTransition"
  14. @animationfinish="swiperAnimationfinish">
  15. <swiper-item v-for="(item, index) in tabsList" :key="index">
  16. <EnScroll ref="scroll" :navHeight="125" @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
  17. <TaskItem :type="1" is_bottom></TaskItem>
  18. </EnScroll>
  19. </swiper-item>
  20. </swiper> -->
  21. <!-- 不带Swiper -->
  22. <EnScroll ref="scroll" :navHeight="105" is_tabHeight @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
  23. <TaskItem :type="1" is_bottom></TaskItem>
  24. </EnScroll>
  25. <Tab :tab-index="1"></Tab>
  26. </view>
  27. </template>
  28. <script>
  29. // 任务列表
  30. import TaskItem from "@/common/task/task-item.vue";
  31. export default {
  32. components: {
  33. TaskItem,
  34. },
  35. data() {
  36. return {
  37. tabHeight: uni.getStorageSync('tab_height'),
  38. current: 0,
  39. swiperCurrent: 0,
  40. tabsList: [{
  41. name: '全部',
  42. dot_color: 'red',
  43. disabled: false
  44. }, {
  45. name: '新进',
  46. dot_color: 'yellow',
  47. disabled: false
  48. }, {
  49. name: '待办',
  50. dot_color: '',
  51. disabled: false
  52. }, {
  53. name: '完成',
  54. dot_color: '',
  55. disabled: false
  56. }, {
  57. name: '拒绝',
  58. dot_color: '',
  59. disabled: false
  60. }],
  61. }
  62. },
  63. methods: {
  64. tabsChange(index) {
  65. this.current = index;
  66. },
  67. // 下拉刷新
  68. onRefresh() {
  69. uni.showLoading({
  70. title: '数据加载中'
  71. })
  72. setTimeout(() => {
  73. uni.showToast({
  74. title: '加载完成',
  75. icon: 'none'
  76. })
  77. this.$refs.scroll.onEndPulling()
  78. }, 1000)
  79. console.log("下拉刷新");
  80. },
  81. // 滚动到底部
  82. onScrollBottom() {
  83. uni.showLoading({
  84. title: '数据加载中'
  85. })
  86. setTimeout(() => {
  87. uni.showToast({
  88. title: '加载完成',
  89. icon: 'none'
  90. })
  91. }, 1000)
  92. console.log("到底部了");
  93. },
  94. //swiper滑动中
  95. swiperTransition(e) {
  96. this.$refs.tabs.setDx(e.detail.dx);
  97. },
  98. //swiper滑动结束
  99. swiperAnimationfinish(e) {
  100. this.current = e.detail.current;
  101. this.$refs.tabs.unlockDx();
  102. }
  103. },
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. </style>