|
@@ -1,6 +1,11 @@
|
|
import { Button, Popup } from "vant";
|
|
import { Button, Popup } from "vant";
|
|
|
|
+import styles from "./index.module.less";
|
|
import { defineComponent, onMounted, onUnmounted, reactive } from "vue";
|
|
import { defineComponent, onMounted, onUnmounted, reactive } from "vue";
|
|
import { api_toggleTune, removeResult, sendResult } from "/src/helpers/communication";
|
|
import { api_toggleTune, removeResult, sendResult } from "/src/helpers/communication";
|
|
|
|
+import { Vue3Lottie } from "vue3-lottie";
|
|
|
|
+import bg from "./json/bg.json";
|
|
|
|
+import f1 from "./json/f1.json";
|
|
|
|
+import f2 from "./json/f2.json";
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: "delay-check",
|
|
name: "delay-check",
|
|
@@ -31,25 +36,39 @@ export default defineComponent({
|
|
});
|
|
});
|
|
|
|
|
|
const toggleTune = async (state: "start" | "stop" | "finishTune") => {
|
|
const toggleTune = async (state: "start" | "stop" | "finishTune") => {
|
|
- await api_toggleTune(state, data.count);
|
|
|
|
|
|
+ if(state === 'start') {
|
|
|
|
+ await api_toggleTune('start', data.count);
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ api_toggleTune('stop');
|
|
|
|
+ }, 1500)
|
|
|
|
+ } else if (state === 'finishTune') {
|
|
|
|
+ await api_toggleTune('finishTune');
|
|
|
|
+
|
|
|
|
+ }
|
|
};
|
|
};
|
|
return () => (
|
|
return () => (
|
|
<Popup
|
|
<Popup
|
|
teleport="body"
|
|
teleport="body"
|
|
- closeOnClickOverlay={false}
|
|
|
|
- class={["popup-custom"]}
|
|
|
|
|
|
+ overlay={false}
|
|
|
|
+ class={["popup-custom", styles.popup]}
|
|
transition="van-fade"
|
|
transition="van-fade"
|
|
v-model:show={data.show}
|
|
v-model:show={data.show}
|
|
>
|
|
>
|
|
- <Button
|
|
|
|
- disabled={data.checkStatus !== "init"}
|
|
|
|
- onClick={() => {
|
|
|
|
- data.checkStatus = "ing";
|
|
|
|
- toggleTune("start");
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 开始检测
|
|
|
|
- </Button>
|
|
|
|
|
|
+ <div class={styles.delayBox}>
|
|
|
|
+ <Vue3Lottie width={"100%"} height={"100%"} animationData={bg}></Vue3Lottie>
|
|
|
|
+ {/* <Vue3Lottie class={styles.item} animationData={f1} loop={false}></Vue3Lottie> */}
|
|
|
|
+ <Vue3Lottie class={styles.item} animationData={f2}></Vue3Lottie>
|
|
|
|
+ <Button
|
|
|
|
+ class={styles.btn}
|
|
|
|
+ disabled={data.checkStatus !== "init"}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ data.checkStatus = "ing";
|
|
|
|
+ toggleTune("start");
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 开始检测
|
|
|
|
+ </Button>
|
|
|
|
+ </div>
|
|
</Popup>
|
|
</Popup>
|
|
);
|
|
);
|
|
},
|
|
},
|