import React, { Component } from "react"; import { AtModal, AtModalAction, AtModalContent, AtIcon } from "taro-ui"; import { Button, Image, View, Text } from "@tarojs/components"; import Taro from "@tarojs/taro"; import './index.less'; import { getAccountLog } from '../../../utils/servers/servers'; import "taro-ui/dist/style/components/icon.scss"; class AuditDetails extends Component { constructor(props) { super(props); this.state = { list: [], } this.selLog = this.selLog.bind(this); } componentDidMount() { this.selLog(); } selLog() { Taro.showLoading({ title: '加载中...' }) getAccountLog({ eaid: this.props.id }).then(v => { Taro.hideLoading(); if (v.error.length === 0) { this.setState({ list: v.data || [] }) this.isHere(v.data || []) } else { Taro.showToast({ title: v.error[0].message, icon: 'none' }) } }).catch(err => { Taro.hideLoading(); Taro.showToast({ title: '系统错误.请稍后重试', icon: 'none' }) }) } isHere(list = []) { for (var i = 0; i < list.length; i++) { if (!list[i].id) { this.setState({ processStatus: list[i].processStatus }) return } } } render() { const { list, processStatus } = this.state return ( { this.state.list?.map((v, n) => ( {!!v.remarks ? "✓" : n + 1} {v.auditorName}     {processStatus == v.processStatus && !v.id && 审核中...} {v.remarks && 操作:{["【发起】", "【通过】", "【完成】", "【驳回】", "【重新发起】"][v.status]} } {v.remarks && 操作时间:{v.createTimeStr} } {v.remarks && 备注:{v.remarks} } )) } ) } } export default AuditDetails;