This commit is contained in:
expdsn 2024-11-28 19:21:06 +08:00
parent 3a40fa7a25
commit 7b0e992c98
2 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@ export function sendParent(
ifSearch: boolean ifSearch: boolean
} }
] ]
| ['information', string]
) { ) {
parent.window.postMessage( parent.window.postMessage(
{ {

View File

@ -1,3 +1,5 @@
import { sendParent } from "@/utils/parent";
import { generateRandomString } from "@/utils/tool";
import useTimeStore from "@/utils/useTimeStore"; import useTimeStore from "@/utils/useTimeStore";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { defineStore } from "pinia"; import { defineStore } from "pinia";
@ -97,10 +99,13 @@ export default defineStore("work", () => {
stopTomatoTime() stopTomatoTime()
} }
// sendParent(['information', '恭喜你完成了一个番茄钟' + generateRandomString(4)])
if (remainingTime.value === 0) { if (remainingTime.value === 0) {
state.timeList.push( state.timeList.push(
dayjs().valueOf() dayjs().valueOf()
) )
sendParent(['information', '恭喜你完成了一个番茄钟'])
} }
}) })
const openShowModel = ref<undefined | null | TomatoTarget>() const openShowModel = ref<undefined | null | TomatoTarget>()