diff --git a/src/utils/parent.ts b/src/utils/parent.ts index d34fdf7..869106a 100644 --- a/src/utils/parent.ts +++ b/src/utils/parent.ts @@ -12,6 +12,7 @@ export function sendParent( ifSearch: boolean } ] + | ['information', string] ) { parent.window.postMessage( { diff --git a/src/widgets/work/useTomatoStore.ts b/src/widgets/work/useTomatoStore.ts index 8243cf6..570703e 100644 --- a/src/widgets/work/useTomatoStore.ts +++ b/src/widgets/work/useTomatoStore.ts @@ -1,3 +1,5 @@ +import { sendParent } from "@/utils/parent"; +import { generateRandomString } from "@/utils/tool"; import useTimeStore from "@/utils/useTimeStore"; import dayjs from "dayjs"; import { defineStore } from "pinia"; @@ -97,10 +99,13 @@ export default defineStore("work", () => { stopTomatoTime() } + // sendParent(['information', '恭喜你完成了一个番茄钟' + generateRandomString(4)]) + if (remainingTime.value === 0) { state.timeList.push( dayjs().valueOf() ) + sendParent(['information', '恭喜你完成了一个番茄钟']) } }) const openShowModel = ref()