|
@@ -1,6 +1,7 @@
|
|
|
"use client";
|
|
|
import { PromotionRep } from "@/api/home";
|
|
|
import { useUserInfoStore } from "@/stores/useUserInfoStore";
|
|
|
+import useWheelStore from "@/stores/useWheelStore";
|
|
|
import { server } from "@/utils/client";
|
|
|
import { Local } from "@/utils/storage";
|
|
|
import dayjs from "dayjs";
|
|
@@ -28,6 +29,7 @@ const getPromotions = async () => {
|
|
|
const AutoShowDialog = () => {
|
|
|
const [data, setData] = React.useState<PromotionRep[]>([]);
|
|
|
const { userInfo } = useUserInfoStore();
|
|
|
+ const wheelState = useWheelStore((state) => state);
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
getData();
|
|
@@ -89,7 +91,7 @@ const AutoShowDialog = () => {
|
|
|
popData[userInfo.id] = {};
|
|
|
}
|
|
|
popData[userInfo.id][popid] = true;
|
|
|
- console.log(1122, keyMap[type], type);
|
|
|
+
|
|
|
Local.setKey(keyMap[type], JSON.stringify(popData));
|
|
|
};
|
|
|
|
|
@@ -104,6 +106,7 @@ const AutoShowDialog = () => {
|
|
|
if (startShow > data.length - 1) {
|
|
|
startShow = 0;
|
|
|
}
|
|
|
+
|
|
|
for (let i = startShow; i < data.length; i++) {
|
|
|
const curData = data[i];
|
|
|
// 一天只展示一次
|
|
@@ -127,6 +130,14 @@ const AutoShowDialog = () => {
|
|
|
await dialogManage.showDialog("TextDialog", curData);
|
|
|
break;
|
|
|
case 3:
|
|
|
+ // 轮盘特殊处理 dialogManage.showDialog('WheelSection')
|
|
|
+ console.log(wheelState.status);
|
|
|
+ if (
|
|
|
+ curData?.action_params?.includes("WheelSection") &&
|
|
|
+ wheelState.status === 2
|
|
|
+ ) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
if (curData.action_type === 5) {
|
|
|
curData?.action_params ? await eval(curData?.action_params || "") : "";
|
|
|
}
|