feat: 增加防抖
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
<View className={styles["sticky-bottom-bar"]}>
|
||||
@@ -390,7 +393,7 @@ export default function StickyButton(props) {
|
||||
<View
|
||||
style={is_organizer ? {} : { margin: "auto" }}
|
||||
className={styles["sticky-bottom-bar-join-game"]}
|
||||
onClick={action}
|
||||
onClick={debounceAction}
|
||||
>
|
||||
<ActionText />
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user