feat: 功能调整

This commit is contained in:
Tony 2024-07-15 08:52:38 +08:00
parent 85f73b6c35
commit d8d5469671
8 changed files with 22 additions and 33 deletions

View File

@ -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<string>('')
const [dataList, setDataList] = useState<Array<any>>([
{
id: '1',
img: '',
name: '1号蟹塘',
price: '29.9元',
adoption: 21
},
{
id: '2',
img: '',
name: '1号蟹塘',
price: '29.9元',
adoption: 21
},
])
const CrabItemsWrapper = () => {
return (
<View className="p-3">

View File

@ -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
})
}

View File

@ -4,13 +4,9 @@ import './app.scss'
class App extends Component<PropsWithChildren> {
componentDidMount () {
console.log("componentDidMount");
}
componentDidShow () {
console.log("componentDidShow");
}
componentDidHide () {}

View File

@ -55,9 +55,9 @@ export default function MyOrder() {
dataList.map(item => (
<View className="bg-white p-4 px-5 shadow-md rounded-md mb-2">
<View className="flex justify-between items-start py-1 pb-2">
<View className="pr-2">{item.planName}</View>
<View className="pr-3 grow">{item.planName}</View>
<View
className="text-[#fa6642] w-[4rem]"
className="text-[#fa6642] w-[4rem] break-normal"
style={{
color: item.status === '0' ? '#fa6642' : '#1ed76d'
}}

View File

@ -31,7 +31,7 @@ export default function AdoptionCircle() {
id: item.orderNumber,
name: item.nickName || '匿名塘主',
avatar: item.buyerImg,
count: item.productAmount + (item.orderType === '0' ? '只' : '亩'),
count: item.productAmount + "份",
level: index + 1
})))
}

View File

@ -121,7 +121,10 @@ export default function Adoption() {
if (_item) {
console.log("选中地块", _item);
setSelectedPlotInfo(_item)
setSelectedPlotInfo({
..._item,
img: _item.img?.replace("http://117.73.12.97:9000", "https://www.zhuangbeizz.cn/minio")
})
setShowConfirmPlot(true)
} else {
Taro.showToast({

View File

@ -98,7 +98,7 @@ export default function HomeLayout() {
return (
<OuterFrame>
<View className='index relative'>
<View style={{
<View className="relative z-[3]" style={{
height: APP_HEAD_HEIGHT + 'px',
backgroundColor: '#fff'
}}></View>

View File

@ -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<any>({})
const [regionSelected, setRegionSelected] = useState<any>()
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
})