import React, { Component } from "react"; import Taro from "@tarojs/taro"; import { View, Button, } from '@tarojs/components' import { AtRadio, AtInput, AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui"; import { accountList } from '../../utils/tools/config'; import { creatOrder } from '../../utils/servers/servers'; import './index.less'; import "taro-ui/dist/style/components/icon.scss"; import "taro-ui/dist/style/components/button.scss"; import "taro-ui/dist/style/components/radio.scss"; class Select extends Component { constructor(props) { super(props); this.state = { type: -1, other: "", }; } componentDidMount() { const { type, other } = this.props this.setState({ type, other }) } handleChange(e) { this.setState({ type: e }) } onInputChange(e) { this.setState({ other: e }) } creatOrder() { const { prid, onClose } = this.props const { type, other, } = this.state creatOrder({ prid, type, typeOther: other, }).then(v => { if (v.error.length === 0) { onClose() Taro.redirectTo({ url: '/pages/drafts/index?id=' + v.data }) } else { Taro.showToast({ title: v.error[0].message, icon: 'none' }) } }).catch(() => { Taro.showToast({ title: '系统错误,请稍后再试', icon: 'none' }) }) } render() { const { visible = "", onClose, noPost = false, onOk } = this.props const { type, other } = this.state return ( 请选择报销类型 {type == 0 && } ) } } export default Select;