myList.jsx 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. <View className="releaseStarts">
  58. <View
  59. className="punchClock"
  60. // onClick={(e) => {
  61. // e.stopPropagation();
  62. // }}
  63. >
  64. 去审核
  65. </View>
  66. </View>
  67. }
  68. {v.processStatus == 2 && <View style={{ textAlign: "right" }}>已审核</View>}
  69. {v.processStatus == 3 && <View style={{ textAlign: "right", color: "red" }}>已驳回</View>}
  70. </View>
  71. </View>
  72. ))}
  73. <ListBottomStart
  74. state={this.props.listState}
  75. reload={() => {
  76. this.props.onRefresh;
  77. }}
  78. />
  79. </View>
  80. </View>
  81. );
  82. }
  83. }
  84. export default MyList;