myList.jsx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import React, { Component } from "react";
  2. import Taro from "@tarojs/taro";
  3. import { View, Image } from "@tarojs/components";
  4. import Skeleton from "taro-skeleton";
  5. import { getClockState } from "../../utils/tools";
  6. import ListBottomStart from "../../components/common/listBottomStart";
  7. import RevokeWhite from "../../image/revokeWhite.png";
  8. import "./index.less";
  9. class MyList extends Component {
  10. constructor(props) {
  11. super(props);
  12. }
  13. render() {
  14. let seeView = this.props.seeView;
  15. return (
  16. <View className="indexPage">
  17. <View className="list">
  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. : null}
  23. {this.props.list.map((v, k) => (
  24. <View
  25. key={k}
  26. className="item"
  27. onClick={() => {
  28. Taro.navigateTo({
  29. url: "/pages/egressDetails/index?id=" + v.id + "&index=" + k + "&status=" + seeView,
  30. });
  31. }}
  32. >
  33. {v.status === 3 ? (
  34. <View className="revoke">
  35. <Image src={RevokeWhite} className="revokeImg" />
  36. </View>
  37. ) : null}
  38. <View className="infor">
  39. <View className="title">
  40. <View className="aname">
  41. {v.type === 3 ? v.mainName : v.aname}提交的公出申请
  42. {v.updateStatus == 1 && <View className="aIcon">改</View>}
  43. </View>
  44. <View className="createTimes">{v.createTimes}</View>
  45. </View>
  46. <View className="userName">
  47. 公出企业:
  48. {v.nickname}
  49. </View>
  50. <View className="userName">
  51. 公出地点:
  52. {v.userName}
  53. </View>
  54. <View className="releaseStarts">
  55. 开始时间:{v.releaseStarts}
  56. {this.props.type === 0 && v.status !== 3 ? (
  57. <View
  58. className="punchClock"
  59. onClick={(e) => {
  60. e.stopPropagation();
  61. Taro.eventCenter.trigger("GoPunchIn", v);
  62. Taro.switchTab({
  63. url: "/pages/punchClock/index",
  64. });
  65. }}
  66. >
  67. {v.clockIn === 1 ? "更新打卡" : "去打卡"}
  68. </View>
  69. ) : null}
  70. </View>
  71. <View className="releaseEnds">结束时间:{v.releaseEnds}</View>
  72. {
  73. v.assistAidName != null && v.assistAidName != "" &&
  74. <View className="coOder">
  75. 技术协单:{v.assistAidName.replace(/,/g, " ")}
  76. </View>
  77. }
  78. <View className="bottomContent">
  79. {v.clockIn === 1 ? (
  80. <View className="clockIn" style={{ color: "#6eb173" }}>
  81. 已打卡
  82. </View>
  83. ) : (
  84. <View className="clockIn" style={{ color: "#dbc037" }}>
  85. 未打卡
  86. </View>
  87. )}
  88. <View
  89. className="status"
  90. style={{
  91. color: getClockState(v.status).color,
  92. }}
  93. >
  94. {getClockState(v.status).title}
  95. </View>
  96. </View>
  97. </View>
  98. </View>
  99. ))}
  100. <ListBottomStart
  101. state={this.props.listState}
  102. reload={() => {
  103. this.props.onRefresh;
  104. }}
  105. />
  106. </View>
  107. </View>
  108. );
  109. }
  110. }
  111. export default MyList;