diff --git a/src/game_pages/detail/components/StickyBottom/index.tsx b/src/game_pages/detail/components/StickyBottom/index.tsx index ea560bd..796562c 100644 --- a/src/game_pages/detail/components/StickyBottom/index.tsx +++ b/src/game_pages/detail/components/StickyBottom/index.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react"; import Taro from "@tarojs/taro"; import classnames from "classnames"; import dayjs from "dayjs"; +import { debounce } from "@tarojs/runtime"; import { Text, View, Image } from "@tarojs/components"; import OrderService from "@/services/orderService"; import { EvaluateCallback, EvaluateScene } from "@/store/evaluateStore"; @@ -348,6 +349,8 @@ export default function StickyButton(props) { }; } + const debounceAction = debounce(action, 300); + return ( <> @@ -390,7 +393,7 @@ export default function StickyButton(props) { diff --git a/src/order_pages/orderDetail/index.tsx b/src/order_pages/orderDetail/index.tsx index 5b89268..5e6b06d 100644 --- a/src/order_pages/orderDetail/index.tsx +++ b/src/order_pages/orderDetail/index.tsx @@ -11,6 +11,7 @@ import orderService, { OrderStatus, refundTextMap, } from "@/services/orderService"; +import { debounce } from "@tarojs/runtime"; import { payOrder, delay, @@ -615,7 +616,7 @@ const OrderCheck = () => { } //TODO: get order msg from id - const handlePay = async () => { + const handlePay = debounce(async () => { // 检查登录状态和手机号 if (!requireLoginWithPhone()) { return; // 未登录或未绑定手机号,已跳转到登录页 @@ -654,7 +655,8 @@ const OrderCheck = () => { init(); setPaying(false); } - }; + }, 300); + if (!id && !gameId) { return (