index.jsx 765 B

12345678910111213141516171819202122232425262728
  1. import {View, Text, Textarea} from '@tarojs/components';
  2. import {Switch} from '@nutui/nutui-react-taro';
  3. import classNames from 'classnames';
  4. export default function Exception({checked, onChange}) {
  5. return (
  6. <>
  7. <View className='flex items-center'>
  8. <Switch
  9. activeColor='#58C6EA'
  10. activeText='是'
  11. inactiveText='否'
  12. checked={checked}
  13. onChange={onChange}
  14. />
  15. <Text className='text-sm text-[#999] ml-2'>是否异常</Text>
  16. </View>
  17. <Textarea
  18. className={classNames(
  19. 'border border-solid border-gray-200 rounded-md mt-3 w-[calc(100%-32px)] p-4',
  20. {hidden: !checked},
  21. )}
  22. placeholder='请输入异常原因'
  23. />
  24. </>
  25. );
  26. }