myList.jsx 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import React, { Component } from "react";
  2. import Taro from "@tarojs/taro";
  3. import { View, Image, Button } from "@tarojs/components";
  4. import Skeleton from "taro-skeleton";
  5. import { getClockState } from "../../utils/tools";
  6. import ListBottomStart from "../../components/common/listBottomStart";
  7. import "./index.less";
  8. class MyList extends Component {
  9. constructor(props) {
  10. super(props);
  11. }
  12. render() {
  13. const { type } = this.props
  14. return (
  15. <View className="indexPage">
  16. <View className="list">
  17. {
  18. this.props.list.length === 0 && this.props.listState === "LOADING" &&
  19. this.props.typelist?.map((v) => (
  20. <Skeleton key={v} title row={3} avatarShape="square" loading />
  21. ))
  22. }
  23. {this.props.list.length > 0 && this.props.list?.map((v, k) => (
  24. <View
  25. key={k}
  26. className="item"
  27. onClick={(e) => {
  28. e.stopPropagation();
  29. Taro.navigateTo({
  30. url: `/pages/detail/index?id=${v.id}&type=${type}`,
  31. });
  32. }}
  33. >
  34. <View className="infor">
  35. <View className="title">
  36. <View className="aname">
  37. {v.projectName}
  38. </View>
  39. </View>
  40. <View className="userName">
  41. <View className="uNtext">
  42. 负责人:{v.adminName}
  43. </View>
  44. </View>
  45. <View className="userName">
  46. <View className="uNtext">
  47. 研发人员:{v.name}
  48. </View>
  49. </View>
  50. <View className="userName">
  51. <View className="uNtext">
  52. 打卡工时:{v.duration}
  53. </View>
  54. </View>
  55. {
  56. v.processStatus == 1 &&
  57. (
  58. type == 0 ?
  59. <View style={{ textAlign: "right", color: "blue" }}>已打卡,待审核</View> :
  60. <View className="releaseStarts">
  61. <View
  62. className="punchClock"
  63. // onClick={(e) => {
  64. // e.stopPropagation();
  65. // }}
  66. >
  67. 去审核
  68. </View>
  69. </View>
  70. )
  71. }
  72. {v.processStatus == 2 && <View style={{ textAlign: "right", color: "green" }}>{type == 0 ? "已打卡,已审核" : "已审核"}</View>}
  73. {v.processStatus == 3 && <View style={{ textAlign: "right", color: "red" }}>{type == 0 ? "已打卡,已驳回" : "已驳回"}</View>}
  74. </View>
  75. </View>
  76. ))}
  77. <ListBottomStart
  78. state={this.props.listState}
  79. reload={() => {
  80. this.props.onRefresh;
  81. }}
  82. />
  83. </View>
  84. </View>
  85. );
  86. }
  87. }
  88. export default MyList;