zkTaskList.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="zkTaskList" ref="zktaskList">
  3. <custom-tabs type="zkTaskListViewRef" :value="pageInfo.current" fixed="true" :activeTextStyle="{color:'rgba(190, 163, 117, 1)'}" :activeLineStyle="{'background-color':'rgba(190, 163, 117, 1)',height:'6rpx'}" @change="changeIndex">
  4. <!-- 所有 -->
  5. <custom-tab-pane label="所有" name="zkTaskListViewRef_1">
  6. <ZkTaskListView ref="zkTaskListViewRef_1" state=""></ZkTaskListView>
  7. </custom-tab-pane>
  8. <!-- 待质控 -->
  9. <custom-tab-pane label="待质控" name="zkTaskListViewRef_2">
  10. <ZkTaskListView ref="zkTaskListViewRef_2" state="7003"></ZkTaskListView>
  11. </custom-tab-pane>
  12. <!-- 质控中 -->
  13. <custom-tab-pane label="质控中" name="zkTaskListViewRef_3">
  14. <ZkTaskListView ref="zkTaskListViewRef_3" state="7007"></ZkTaskListView>
  15. </custom-tab-pane>
  16. <!-- 完成 -->
  17. <custom-tab-pane label="完成" name="zkTaskListViewRef_4">
  18. <ZkTaskListView ref="zkTaskListViewRef_4" state="7004"></ZkTaskListView>
  19. </custom-tab-pane>
  20. </custom-tabs>
  21. </view>
  22. </template>
  23. <script setup>
  24. import http from '@/utils/request';
  25. import {ref,reactive,getCurrentInstance, computed, nextTick,watch} from "vue";
  26. import {onLoad,onShow,onUnload,onPageScroll,onReachBottom,onPullDownRefresh} from "@dcloudio/uni-app";
  27. import ZkTaskListView from "./zkTaskListView.vue"
  28. const zkTaskListViewRef_1 = ref(null)
  29. const pageInfo = reactive({
  30. current:-1,
  31. tabs: ["所有", "待质控", "质控中", "完成"],
  32. detailStatus: ''
  33. });
  34. const {proxy} = getCurrentInstance()
  35. const showIcon = reactive({
  36. nowIcon: '',
  37. showIcon: '/static/blackDisplay.png',
  38. hideIcon: '/static/blackHide.png'
  39. })
  40. const statusIcon = reactive({
  41. daiIcon: '/static/dai_icon.png',
  42. wanIcon: '/static/wan_icon.png',
  43. zhiIcon: '/static/zhi_icon.png'
  44. })
  45. // 切换显示与隐藏
  46. const changeState = (type) => {
  47. if (type == 'header') {
  48. console.log("头部切换")
  49. if (eyeIcon.nowIcon == eyeIcon.hideIcon) {
  50. eyeIcon.nowIcon = eyeIcon.showIcon
  51. } else {
  52. eyeIcon.nowIcon = eyeIcon.hideIcon
  53. }
  54. } else if (type == 'list') {
  55. console.log("列表切换")
  56. if (showIcon.nowIcon == showIcon.hideIcon) {
  57. showIcon.nowIcon = showIcon.showIcon
  58. } else {
  59. showIcon.nowIcon = showIcon.hideIcon
  60. }
  61. }
  62. }
  63. const IndexName = ref("zkTaskListViewRef_1")
  64. const changeIndex=(e)=>{
  65. console.log('change-----------')
  66. IndexName.value = e.name
  67. pageInfo.current = e.value
  68. if(taskListRef())
  69. taskListRef().fetch()
  70. }
  71. const taskListRef = ()=>{
  72. const taskList = proxy.$refs[IndexName.value]
  73. return taskList
  74. }
  75. // 跳转到任务详情
  76. const toDetail = () => {
  77. }
  78. // 页面滚动触发事件
  79. onPageScroll((detail) => {
  80. //页面滚动事件
  81. uni.pageScrollTo({
  82. scrollTop: detail.scrollTop,
  83. duration: 0
  84. })
  85. })
  86. // 上拉加载
  87. onReachBottom(() => {
  88. console.log("父上拉加载");
  89. taskListRef().reachBottom()
  90. })
  91. //下拉刷新
  92. onPullDownRefresh(() => {
  93. console.log("父下拉刷新");
  94. taskListRef().pullDownRefresh()
  95. })
  96. onShow(()=>{
  97. console.log("父onShow");
  98. nextTick(()=>{
  99. pageInfo.current = 0
  100. })
  101. })
  102. </script>
  103. <style lang="scss" scoped>
  104. @import 'indexList.scss';
  105. </style>