import { useState, useEffect } from "react" import { Image, View, Text, Swiper, SwiperItem } from "@tarojs/components" import Taro from "@tarojs/taro" import CustomNav from "@/components/CustomNav" import withLayout from '@/layouts' import ButtontWX from "@/components/ButtontWX" import decorate from "@/assets/icons/comm/decorate.png" import addresss from '@/assets/mineImgaes/addresss.png'//地址 import { getMachineryInfo } from "@/services/homes" import TextContent from "./TextContent" import './style.less' export default withLayout((props) => { console.log("🚀 ~ file: index.jsx ~ line 14 ~ props", props) const $instance = Taro.getCurrentInstance() const { id, location } = $instance.router.params const [carsInfo, setCarsInfo] = useState({}) const [imagesList, setImagesList] = useState([]) const [contentList, setContentList] = useState([]) useEffect(() => { if (id) { getMachineryInfo(id, { location: location, attached: true }).then((e) => { setImagesList(e.imagesList) setContentList(e.contentList) setCarsInfo(e) console.log('setCarsInfosetCarsInfosetCarsInfo', e); }) } }, [$instance.router.params, id, location]) console.log("🚀 ~ file: index.jsx ~ line 23 ~ carsInfo", carsInfo) const startReserve = () => { Taro.navigateTo({ url: `/pages/OrderConfirmation/index?id=${carsInfo?.machineryId}&location=${location}` }) } const goMapInfo = (res) => { Taro.navigateTo({ url: `/pages/CheckMap/index?id=${carsInfo?.machineryId}&location=${location}` }) } return ( {/* */} {imagesList.map((item, inx) => ( ))} {carsInfo?.name} {carsInfo?.price}/公顷 goMapInfo('222888')}> 距离当前位置8.8公里>> {carsInfo?.orgName} 农机详情 { contentList.map((item, index) => { return ( ) }) } ) })