myList.jsx 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 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. const { title } = this.props
  16. return (
  17. <View className="indexPage">
  18. <View className="list">
  19. {
  20. this.props.list.length === 0 && this.props.listState === "LOADING" &&
  21. this.props.typelist?.map((v) => (
  22. <Skeleton key={v} title row={3} avatarShape="square" loading />
  23. ))
  24. }
  25. {this.props.list.length > 0 && this.props.list?.map((v, k) => (
  26. <View
  27. key={k}
  28. className="item"
  29. onClick={() => {
  30. Taro.navigateTo({
  31. url: "/pages/egressDetails/index?id=" + v.id + "&index=" + k + "&status=" + title,
  32. });
  33. }}
  34. >
  35. {v.status === 3 &&
  36. <View className="revoke">
  37. <Image src={RevokeWhite} className="revokeImg" />
  38. </View>}
  39. <View className="infor">
  40. <View className="title">
  41. <View className="aname">
  42. {v.type === 3 ? v.mainName : v.aname}提交的公出申请
  43. {v.updateStatus == 1 && <View className="aIcon">改</View>}
  44. </View>
  45. <View className="createTimes">{v.createTimes}</View>
  46. </View>
  47. <View className="userName">
  48. 公出企业:{v.nickname}
  49. {
  50. (title == "我的协单" || title === "查看协单") && v.status === 2 && v.type === 3 &&
  51. <View
  52. className="reject"
  53. onClick={e => {
  54. e.stopPropagation();
  55. this.props.opens(v.id)
  56. }}
  57. >
  58. 驳回协单
  59. </View>
  60. }
  61. </View>
  62. <View className="userName">
  63. 公出地点:{v.userName}
  64. </View>
  65. <View className="releaseStarts">
  66. 开始时间:{v.releaseStarts}
  67. {this.props.type === 0 && v.status !== 3 ? (
  68. <View
  69. className="punchClock"
  70. onClick={(e) => {
  71. e.stopPropagation();
  72. Taro.eventCenter.trigger("GoPunchIn", v);
  73. Taro.switchTab({
  74. url: "/pages/punchClock/index",
  75. });
  76. }}
  77. >
  78. {(v.clockIn === 1 || v.clockIn === 2) ? "更新打卡" : "去打卡"}
  79. </View>
  80. ) : null}
  81. </View>
  82. <View className="releaseEnds">
  83. 结束时间:{v.releaseEnds}
  84. </View>
  85. {
  86. v.assistAidName != null && v.assistAidName != "" &&
  87. <View className="coOder">
  88. 技术协单:{v.assistAidName.replace(/,/g, " ")}
  89. </View>
  90. }
  91. {
  92. v.assistantName != null && v.assistantName != "" &&
  93. <View className="coOder">
  94. 协单助手:{v.assistantName.replace(/,/g, " ")}
  95. </View>
  96. }
  97. <View className="bottomContent">
  98. <View className="clockIn"
  99. style={{ color: ['red', "#6eb173", '#dbc037'][v.clockIn] }}
  100. >{['未打卡', '已打卡', '异常打卡'][v.clockIn]}</View>
  101. <View
  102. className="status"
  103. style={{ color: getClockState(v.status).color, }}
  104. >
  105. {(v.status === 0 || v.status === 4) && v.rejectName}{getClockState(v.status).title}
  106. </View>
  107. </View>
  108. </View>
  109. </View>
  110. ))}
  111. <ListBottomStart
  112. state={this.props.listState}
  113. reload={() => {
  114. this.props.onRefresh;
  115. }}
  116. />
  117. </View>
  118. </View>
  119. );
  120. }
  121. }
  122. export default MyList;