小程序农机手端

index.jsx 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import Taro from "@tarojs/taro"
  2. import { View, Text } from '@tarojs/components'
  3. import MyCell from "../MyCell"
  4. import MyButton from "../MyButton"
  5. import './style.less'
  6. export default (props) => {
  7. const { detail, order, job, onClick } = props
  8. const handleDetail = () => {
  9. Taro.navigateTo({ url: '/pages/orderDetail/index' });
  10. }
  11. const handleClick = () => {
  12. Taro.navigateTo({ url: '/pages/orderDetail/index' });
  13. }
  14. return (
  15. <View className='card'>
  16. <View className='jianbian'>
  17. <View className='text'>待作业</View>
  18. </View>
  19. <View className='cardHead'>
  20. {
  21. job && <MyCell header='需求时间' job action='详情>>' handleAction={handleClick}>2022-06-02</MyCell>
  22. }
  23. {
  24. !job && <>
  25. <MyCell header='需求时间'>2022-06-02</MyCell>
  26. <Text className='price'><Text style={{ fontSize: '44rpx' }}>600</Text>元</Text>
  27. </>
  28. }
  29. </View>
  30. <View className='line' />
  31. <MyCell header='农机名称'>收割机001</MyCell>
  32. <MyCell header='下单人'>张三</MyCell>
  33. {
  34. detail && <MyCell header='手机号'>13613949434</MyCell>
  35. }
  36. <MyCell header='订单时间'>2022-03-08</MyCell>
  37. {
  38. detail && <MyCell header='服务地址'>河南省南阳市邓州市孟楼镇</MyCell>
  39. }
  40. <MyCell header='作业时间'>上午06:00--晚上21:00</MyCell>
  41. {
  42. job && <MyButton value='开始作业' onClick={onClick} />
  43. }
  44. {
  45. order && <View className='line' />
  46. }
  47. {
  48. order && <View className='footer' onClick={handleDetail}>详情{">"}{">"}</View>
  49. }
  50. </View>
  51. )
  52. }