guonan
2025-04-18 fe14fbb369b1c960e4602e084646bd4554a63411
src/components/menu/TimeLine.vue
@@ -1,7 +1,7 @@
<template>
  <div class="timeline-container">
    <div class="controls">
    <!-- <div @click="endSimulate">结束模拟</div> -->
      <!-- <div @click="endSimulate">结束模拟</div> -->
      <div class="control-btn" @click="skipBackward">
        <img
          src="@/assets/img/timeline/left.png"
@@ -53,7 +53,6 @@
          :style="{ left: progressPercentage + '%' }"
        ></div>
        <div class="time-markers">
          <div
            v-for="(time, index) in timeMarkers"
            :key="index"
@@ -76,7 +75,7 @@
  watch,
  defineProps,
  onBeforeUnmount,
  inject
  inject,
} from "vue";
import dayjs from "dayjs";
import { createWaterPrimitive, destoryWaterPrimitive } from "@/utils/water";
@@ -148,6 +147,7 @@
  if (!isPlaying.value && currentTime.value >= duration.value) {
    currentTime.value = 0;
    emit("timeUpdate", progressPercentage.value);
    // earthCtrl.environment.disableEffect("rain");
  }
  isPlaying.value = !isPlaying.value;
@@ -165,6 +165,7 @@
};
const startPlayback = () => {
  // earthCtrl.environment.showEffect("rain");
  clearInterval(playInterval);
  playInterval = setInterval(() => {
    currentTime.value += 600 * playbackRate.value;
@@ -186,6 +187,7 @@
};
const stopPlayback = () => {
  // earthCtrl.environment.disableEffect("rain");
  clearInterval(playInterval);
};
@@ -299,7 +301,6 @@
  }, delay);
});
const { startSimulate, endSimulate } = inject("simulateActions");
</script>
<style scoped>