task.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="total-page page-box page-env-160 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 class="main" @onRefresh="onRefresh"
  23. @onScrollBottom="onScrollBottom">
  24. <TaskItem :type="1" is_bottom></TaskItem>
  25. </EnScroll>
  26. <Tab :tab-index="1"></Tab>
  27. </view>
  28. </template>
  29. <script>
  30. // 任务列表
  31. import TaskItem from "@/common/task/task-item.vue";
  32. export default {
  33. components: {
  34. TaskItem
  35. },
  36. data() {
  37. return {
  38. tabHeight: uni.getStorageSync('tab_height'),
  39. current: 0,
  40. swiperCurrent: 0,
  41. tabsList: [{
  42. name: '全部',
  43. dot_color: 'red',
  44. disabled: false
  45. }, {
  46. name: '新进',
  47. dot_color: 'yellow',
  48. disabled: false
  49. }, {
  50. name: '待办',
  51. dot_color: '',
  52. disabled: false
  53. }, {
  54. name: '完成',
  55. dot_color: '',
  56. disabled: false
  57. }, {
  58. name: '拒绝',
  59. dot_color: '',
  60. disabled: false
  61. }],
  62. }
  63. },
  64. methods: {
  65. tabsChange(index) {
  66. this.current = index;
  67. },
  68. // 下拉刷新
  69. onRefresh() {
  70. uni.showLoading({
  71. title: '数据加载中'
  72. })
  73. setTimeout(() => {
  74. uni.showToast({
  75. title: '加载完成',
  76. icon: 'none'
  77. })
  78. this.$refs.scroll.onEndPulling()
  79. }, 1000)
  80. console.log("下拉刷新");
  81. },
  82. // 滚动到底部
  83. onScrollBottom() {
  84. uni.showLoading({
  85. title: '数据加载中'
  86. })
  87. setTimeout(() => {
  88. uni.showToast({
  89. title: '加载完成',
  90. icon: 'none'
  91. })
  92. }, 1000)
  93. console.log("到底部了");
  94. },
  95. //swiper滑动中
  96. swiperTransition(e) {
  97. this.$refs.tabs.setDx(e.detail.dx);
  98. },
  99. //swiper滑动结束
  100. swiperAnimationfinish(e) {
  101. this.current = e.detail.current;
  102. this.$refs.tabs.unlockDx();
  103. }
  104. },
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. </style>