result.jsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React,{Component} from "react";
  2. import {View,Icon} from '@tarojs/components'
  3. import {AtButton} from "taro-ui";
  4. import './index.less';
  5. import Taro from "@tarojs/taro";
  6. class Result extends Component{
  7. constructor(props) {
  8. super(props);
  9. this.determine= this.determine.bind(this);
  10. }
  11. determine(){
  12. Taro.eventCenter.trigger('result')
  13. }
  14. render() {
  15. return(
  16. <View className='result'>
  17. <View className='resultIcon'>
  18. {
  19. this.props.resultState === 0 ?
  20. <Icon size='80' type='success' /> :
  21. this.props.resultState === 43101 ?
  22. <Icon size='80' type='info' /> :
  23. <Icon size='80' type='warn' />
  24. }
  25. </View>
  26. <View className='resultTitle'>
  27. {
  28. this.props.resultState === 0 ?
  29. '申请成功,已通知上级审核' :
  30. this.props.resultState === 43101 || this.props.resultState === 2 || this.props.resultState === 40003 ?
  31. '申请成功,上级未打开消息通知,请联系您的上级' :
  32. this.props.resultState === 41030 || this.props.resultState === 47003 || this.props.resultState === 40037 ?
  33. '申请成功,消息发送失败,请联系管理员':
  34. '申请成功,消息发送失败'
  35. }
  36. {
  37. this.props.resultState !== 0 && this.props.resultState !== 43101 && this.props.resultState !== 2 && this.props.resultState !== 40003 ?
  38. <View className='resultError'>错误编码:{this.props.resultState}</View>:null
  39. }
  40. </View>
  41. <View className='resultOperation'>
  42. <AtButton type='primary' circle onClick={this.determine}>
  43. 确定
  44. </AtButton>
  45. </View>
  46. </View>
  47. )
  48. }
  49. }
  50. export default Result;