import { View, Text, Switch } from "@tarojs/components"; import './move_setting_reminder.scss' import Cell from "../base/cell"; import { useEffect, useState } from "react"; import { createSchedule, getMoveSchedules } from "@/services/health"; import { getThemeColor } from "@/features/health/hooks/health_hooks"; export default function MoveSettingReminder() { const [selIndex, setSelIndex] = useState(-1) const [hours, setHours] = useState('') const [total, setTotal] = useState('') const [detail, setDetail] = useState(null) useEffect(() => { getMoveSchedules().then(res => { setDetail(res) setHours((res as any).goal.hour) setTotal((res as any).goal.day) }) }, []) if (!detail) return return 打卡时刻表 { detail.schedules.map((item, index) => { return {item.reminder_time} check in for {item.time}-{item.end_time} { console.log(item) createSchedule({ schedules: [{ id: item.id, reminder: e.detail.value }], }).then(res => { if (global.refreshWindow){ global.refreshWindow() } if (global.refreshSchedules){ global.refreshSchedules() } if (global.updateMove){ global.updateMove() } }) }}/> }) } }