import { View, ScrollView, Swiper, SwiperItem } from "@tarojs/components"; import './Clock.scss' import { useEffect, useState } from "react"; import MainDayNightCard from "@/features/health/MainDayNightCard"; import MainFastEatCard from "@/features/health/MainFastEatCard"; import MainSleepActiveCard from "@/features/health/MainSleepActiveCard"; import TabBar from "@/components/navigation/TabBar"; import { rpxToPx } from "@/utils/tools"; import MainSwiper from "@/features/health/MainSwiper"; import MainConsole from "@/features/health/MainConsole"; import MainHistory from "@/features/health/MainHistory"; import { WindowType } from "@/utils/types"; export default function ClockNew() { const [count, setCount] = useState(0) const [scrollLeft, setScrollLeft] = useState(rpxToPx(750) * 0) const [type,setType] = useState(WindowType.day) useEffect(() => { setInterval(() => { setCount(index => index + 1) }, 1000) }, []) function tapScroll(index) { setScrollLeft(rpxToPx(750) * index) } function scroll(e) { console.log(e.detail.scrollLeft) } function pageChanged(index){ } function typeChanged(str){ } function detail() { return } //https://blog.csdn.net/weixin_43525284/article/details/130182218 return { process.env.TARO_ENV == 'weapp' ? detail() : { detail() } } {/* tapScroll(0)}> tab 0 tapScroll(1)}>tab 1 tapScroll(2)}>tab 2 */} }