|
@@ -217,16 +217,23 @@ const SlotsClient: FC<SlotsClientProps> = (props) => {
|
|
|
}, 200);
|
|
|
slotsRef.current?.play();
|
|
|
|
|
|
+ const Interval = setInterval(() => {
|
|
|
+ const num = Math.floor(Math.random() * 99) + 1
|
|
|
+ setRatio(() => (numberPadding(num, 2)))
|
|
|
+ }, 500)
|
|
|
+
|
|
|
// 数据获取
|
|
|
getGiveReceiveApi(params as SlotParams)
|
|
|
.then((res) => {
|
|
|
setTimeout(() => {
|
|
|
+ Interval && clearInterval(Interval)
|
|
|
const rollover = flatPoint(res.data.rollover / 100);
|
|
|
slotsRef.current?.stop(numberPadding(res.data.amount));
|
|
|
setRatio(numberPadding(rollover > 100 ? 99 : rollover, 2));
|
|
|
- }, 2500);
|
|
|
+ }, 3000);
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
+ Interval && clearInterval(Interval)
|
|
|
slotsRef.current.init();
|
|
|
rotating.current = false;
|
|
|
Toast.show(t(`code.${error.data.code}`));
|