diff --git a/src/components/AiShopDetail/AiShopDetail.tsx b/src/components/AiShopDetail/AiShopDetail.tsx index 36550f8..55bca6c 100644 --- a/src/components/AiShopDetail/AiShopDetail.tsx +++ b/src/components/AiShopDetail/AiShopDetail.tsx @@ -45,14 +45,15 @@ export default function AiShopDetail(props: any) { setLoading(false) } } + const [disabled, setDisabled] = useState(false) // 购买按钮是否禁用 // 创建订单 const createOrderFun = async (goodsId: string) => { try { + setDisabled(true) // setPayLoading(true) const res: any = await createOrder(goodsId) // console.log(res); confirmPaymentFun(res.data) - } catch (error: any) { if (error.response) { @@ -69,6 +70,7 @@ export default function AiShopDetail(props: any) { // 确认支付 const confirmPaymentFun = async (orderId: string) => { try { + setDisabled(true) // setLoading(true) const res: any = await confirmPayment(orderId) console.log(res); @@ -80,6 +82,8 @@ export default function AiShopDetail(props: any) { setBuyTipsModal(false) props.closeModal() props.upData() + setDisabled(false) + }, 1000) // props.closeModal() // props.upData() @@ -319,6 +323,7 @@ export default function AiShopDetail(props: any) { }); } }} + >购买 @@ -331,9 +336,13 @@ export default function AiShopDetail(props: any) { onCancel={() => { setBuyTipsModal(false) }} + // 禁用确定按钮 + okButtonProps={{ disabled: disabled }} onOk={() => { // alert(goodsId) // alert(props.orderId) + // 按钮禁用 + if (props.orderId) { confirmPaymentFun(props.orderId) diff --git a/src/components/BelongPeople/BelongPeople.tsx b/src/components/BelongPeople/BelongPeople.tsx index 0d37278..1cbc25e 100644 --- a/src/components/BelongPeople/BelongPeople.tsx +++ b/src/components/BelongPeople/BelongPeople.tsx @@ -65,8 +65,10 @@ type propsInfo = { setValue?: any isShow?: boolean closeModal?: any + showNow?: boolean }; export default function BelongPeople(props: propsInfo) { + const showNow = props.showNow == false?false:true // const [propsShow,setPropsShow] = useState(props.belongPeopleInfo.authorId?true) // const nav = useNavigate(); // const pathParams = useParams(); @@ -414,7 +416,10 @@ export default function BelongPeople(props: propsInfo) { setAreaArray(options); // console.log('省市2', options); }); - + // console.log('嘻嘻嘻',props.showNow); + // console.log(showNow); + + }, []) return ( @@ -527,15 +532,18 @@ export default function BelongPeople(props: propsInfo) { /> */} -