123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import { View, Swiper, Image, SwiperItem, Text, Input } from "@tarojs/components"
  2. import ButtontWX from '@/components/ButtontWX'
  3. import Taro from "@tarojs/taro"
  4. import addresss from '@/assets/mineImgaes/addresss.png'//地址
  5. import searchs from '@/assets/homesImgaes/searchs.png'//搜索图片
  6. import carsListImga from '@/assets/homesImgaes/carsListImga.png'//农机列表图片
  7. import './HomesCss/style.less'
  8. export default (props) => {
  9. // const { SwiperItem } = Swiper
  10. const carsList = [
  11. { carsName: '联合收割机', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd0311736f.jpg', jiage: '300', carsLocation: '3.9' },
  12. { carsName: '水稻播种机', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd031719b1.jpg', jiage: '300', carsLocation: '3.9' },
  13. { carsName: '秸秆统一处理 型号:GB2312', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd03201503.jpg', jiage: '免费', carsLocation: '3.9' },
  14. { carsName: '花生稻子小麦收割一体机', carsUrl: 'http://img3.jc001.cn/img/001/1/1512/15566fd0324f649.jpg', jiage: '550', carsLocation: '3.9' },
  15. { carsName: '拖拉机', carsUrl: 'https://image.cnhnb.com/image/jpg/miniapp/2020/03/26/ef945970d2cc4948b61d45ce57ac1179.jpg', jiage: '180', carsLocation: '3.9' },
  16. { carsName: '自行车', carsUrl: 'https://image.cnhnb.com/image/jpg/miniapp/2020/03/26/e8745759793d48398f82e6658186686a.jpg', jiage: '20', carsLocation: '3.9' },
  17. ]
  18. const imglist = [
  19. { url: 'https://profile.csdnimg.cn/3/1/5/0_qq_42551866' },
  20. { url: 'https://profile.csdnimg.cn/3/1/5/0_qq_42551866' },
  21. { url: 'https://profile.csdnimg.cn/3/1/5/0_qq_42551866' },
  22. { url: 'https://profile.csdnimg.cn/3/1/5/0_qq_42551866' },
  23. { url: 'https://profile.csdnimg.cn/3/1/5/0_qq_42551866' },
  24. { url: 'https://profile.csdnimg.cn/3/1/5/0_qq_42551866' },
  25. ]
  26. const handleSearch = (e) => {
  27. console.log(e.detail.value)
  28. }
  29. const goToCarsList = () => {//更多
  30. Taro.navigateTo({ url: '/pages/MoreCars/index' })
  31. }
  32. const startReserve = () => {
  33. Taro.navigateTo({ url: `/pages/OrderInfo/index?id${1}` })
  34. }
  35. const goCarsInfo = (res) => {
  36. Taro.navigateTo({ url: `/pages/CheckDetails/index?id=${res}` })
  37. }
  38. const goMapInfo = (res) => {
  39. Taro.navigateTo({ url: `/pages/CheckMap/index?mapId=${res + 111}` })
  40. }
  41. return (
  42. <scroll-view className='scrollView' scrollY style='height: 100%;' >
  43. <View className='heads-top-box'>
  44. <View className='heads-top-box-left'>
  45. <Image src={addresss} className='heads-top-box-left-addresssImg' />
  46. <Text>邓州市</Text>
  47. <View className='heads-top-box-left-addresssImg-DownIcon' />
  48. </View>
  49. <View className='heads-content-searchClass'>
  50. <Input type='text' className='heads-content-searchClass-searchInput' onBlur={handleSearch} placeholder='搜索关键字查询订单' />
  51. <Image src={searchs} className='heads-content-searchClass-searchInput-searchImg' />
  52. </View>
  53. </View>
  54. <Swiper
  55. circular
  56. autoplay
  57. className='swiper-box'
  58. >
  59. {imglist.map((item, inx) => (
  60. <SwiperItem key={inx}>
  61. <Image src={item.url} mode='widthFix' className='storeImage' />
  62. </SwiperItem>
  63. ))}
  64. </Swiper>
  65. <View className='content-header-box'>
  66. <View className='content-header-box-liftCentent'>
  67. <Image src={carsListImga} />
  68. <View>农机列表</View>
  69. </View>
  70. <View onClick={goToCarsList} className='content-header-box-rightCentent'>更多&gt;&gt;</View>
  71. </View>
  72. {
  73. carsList.map((item, index) => {
  74. return (
  75. <View key={index} className='carsListImga-bottom-box'>
  76. <Image src={item.carsUrl} onClick={() => goCarsInfo(item.id)} />
  77. <View className='carsListImga-bottom-box-flaxBox'>
  78. <View className='carsListImga-bottom-box-flaxBox-liftText'>
  79. <View className='carsListImga-bottom-box-flaxBox-liftText-Titles'>{item.carsName}</View>
  80. <View className='carsListImga-bottom-box-flaxBox-liftText-price'>{item.jiage}/<Text>公顷</Text></View>
  81. </View>
  82. <View className='carsListImga-bottom-box-flaxBox-rightBut'>
  83. <ButtontWX onClick={startReserve} butText='预约' butWidth={80} butHeight={34} butFontSize={19} butBorderRadius={0} />
  84. </View>
  85. </View>
  86. <View className='content-header-box-map' onClick={() => goMapInfo(item.mapId)}>
  87. <View className='content-header-box-map-liftCentent'>
  88. <Image src={addresss} />
  89. <View>距离当前位置{item.carsLocation}公里</View>
  90. </View>
  91. <View className='content-header-box-map-rightCentent'>进入地图&gt;&gt;</View>
  92. </View>
  93. </View>
  94. )
  95. })
  96. }
  97. </scroll-view>
  98. )
  99. }