diff --git a/src/adoptionManage/crabList/index.tsx b/src/adoptionManage/crabList/index.tsx index 82130d2..686cfbc 100644 --- a/src/adoptionManage/crabList/index.tsx +++ b/src/adoptionManage/crabList/index.tsx @@ -20,28 +20,13 @@ export default function CrabList() { }) console.log("getPlotDataList", data); if (Array.isArray(data)) setPlotDataList(data.map(item => ({ - ...item, percent: (item.alreadyAmount * 100 / item.quantity).toFixed(2) + ...item, + percent: (item.alreadyAmount * 100 / item.quantity).toFixed(2), + img: item.img?.replace("http://117.73.12.97:9000", "https://www.zhuangbeizz.cn/minio") }))) } useEffect(() => { getPlotDataList() }, []) - const [img, setImg] = useState('') - const [dataList, setDataList] = useState>([ - { - id: '1', - img: '', - name: '1号蟹塘', - price: '29.9元', - adoption: 21 - }, - { - id: '2', - img: '', - name: '1号蟹塘', - price: '29.9元', - adoption: 21 - }, - ]) const CrabItemsWrapper = () => { return ( diff --git a/src/api/order.ts b/src/api/order.ts index ccc3677..d62c5f0 100644 --- a/src/api/order.ts +++ b/src/api/order.ts @@ -23,4 +23,12 @@ export const tickPage = (params) => { method: 'GET', params }) +} + +export const getOrderInfoById = (params) => { + return request({ + url: 'wechat/v1/ticket/page', + method: 'GET', + params + }) } \ No newline at end of file diff --git a/src/app.ts b/src/app.ts index 33d411d..85cbd6f 100644 --- a/src/app.ts +++ b/src/app.ts @@ -4,13 +4,9 @@ import './app.scss' class App extends Component { componentDidMount () { - console.log("componentDidMount"); - } componentDidShow () { - console.log("componentDidShow"); - } componentDidHide () {} diff --git a/src/pageMe/myOrder/index.tsx b/src/pageMe/myOrder/index.tsx index dcbb959..f516b74 100644 --- a/src/pageMe/myOrder/index.tsx +++ b/src/pageMe/myOrder/index.tsx @@ -55,9 +55,9 @@ export default function MyOrder() { dataList.map(item => ( - {item.planName} + {item.planName} - diff --git a/src/userInfo/confirmOrder/index.tsx b/src/userInfo/confirmOrder/index.tsx index a805db1..a899266 100644 --- a/src/userInfo/confirmOrder/index.tsx +++ b/src/userInfo/confirmOrder/index.tsx @@ -6,7 +6,7 @@ import { APP_FULL_HEIGHT, formatMoney, IMG_BASE_URL } from "../../config"; import { useEffect, useState } from "react"; import arrow from './assets/arrow.png' import Taro, { getCurrentInstance, useDidShow } from "@tarojs/taro" -import { adoptionOrderUpdate, orderPage } from "../../api/order"; +import { adoptionOrderUpdate, orderPage, getOrderInfoById } from "../../api/order"; import * as dayjs from 'dayjs' import useStore from "../../storage"; import { addressPage } from "../../api/me"; @@ -52,17 +52,14 @@ export default function ConfirmOrder() { ) } const [orderInfo, setOrderInfo] = useState({}) - - const [regionSelected, setRegionSelected] = useState() const { router } = getCurrentInstance() console.log("ID" , router && router.params && router.params.id); const OrderId = router && router.params && router.params.id const getOrderInfo = async () => { if (!OrderId) return const userOpenId = Taro.getStorageSync("USER_OPEN_ID") - const { data } = await orderPage({ - pageNo: 1, - pageSize: 5, + const { data } = await getOrderInfoById({ + id: OrderId, serialNumber: 'JHLS202407012565376', openId: userOpenId })