gain_task.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="total-page page-box">
  3. <Nav :title="'领取任务'" :genre="1" :fixedHeight="110"></Nav>
  4. <view class="task-tabs task-tabs-width m-t30">
  5. <TaskImgTab></TaskImgTab>
  6. </view>
  7. <!-- <EnButton is_both></EnButton> -->
  8. <EnScroll ref="scroll" :navHeight="110" class="main" @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
  9. <TaskItem :type="2" is_bottom></TaskItem>
  10. </EnScroll>
  11. </view>
  12. </template>
  13. <script>
  14. import TaskItem from "@/common/task/task-item.vue"
  15. import TaskImgTab from "@/page_task/module/task_ima_tab.vue"
  16. export default {
  17. components: {
  18. TaskImgTab,
  19. TaskItem
  20. },
  21. data() {
  22. return {
  23. }
  24. },
  25. methods: {
  26. // 下拉刷新
  27. onRefresh() {
  28. uni.showLoading({
  29. title: '数据加载中'
  30. })
  31. setTimeout(() => {
  32. uni.showToast({
  33. title: '加载完成',
  34. icon: 'none'
  35. })
  36. this.$refs.scroll.onEndPulling()
  37. }, 1000)
  38. console.log("下拉刷新");
  39. },
  40. // 滚动到底部
  41. onScrollBottom() {
  42. uni.showLoading({
  43. title: '数据加载中'
  44. })
  45. setTimeout(() => {
  46. uni.showToast({
  47. title: '加载完成',
  48. icon: 'none'
  49. })
  50. }, 1000)
  51. console.log("到底部了");
  52. },
  53. }
  54. }
  55. </script>
  56. <style>
  57. .task-tabs-width {
  58. width: calc(100% - 40rpx);
  59. }
  60. </style>