|
@@ -28,6 +28,7 @@ import PickerCard from "@/_record/components/picker_card";
|
|
|
import LogPublish from "./components/log_publish";
|
|
import LogPublish from "./components/log_publish";
|
|
|
import RecordTimeResult from "./components/record_time_result";
|
|
import RecordTimeResult from "./components/record_time_result";
|
|
|
import { setFastWithSleep, setWindows } from "@/store/health";
|
|
import { setFastWithSleep, setWindows } from "@/store/health";
|
|
|
|
|
+import { MainColorType } from "@/context/themes/color";
|
|
|
|
|
|
|
|
var timer
|
|
var timer
|
|
|
let useNavigation, LinearGradient;
|
|
let useNavigation, LinearGradient;
|
|
@@ -84,8 +85,6 @@ export default function ClockIndex() {
|
|
|
|
|
|
|
|
dayjs.locale(global.language == 'en' ? 'en' : 'zh-cn');
|
|
dayjs.locale(global.language == 'en' ? 'en' : 'zh-cn');
|
|
|
|
|
|
|
|
- console.log('oooooooo')
|
|
|
|
|
-
|
|
|
|
|
let navigation;
|
|
let navigation;
|
|
|
if (useNavigation) {
|
|
if (useNavigation) {
|
|
|
navigation = useNavigation()
|
|
navigation = useNavigation()
|
|
@@ -101,13 +100,13 @@ export default function ClockIndex() {
|
|
|
durationPickerRef.current = showDurationPicker
|
|
durationPickerRef.current = showDurationPicker
|
|
|
}, [showDatePicker, showDurationPicker, showEndDatePicker])
|
|
}, [showDatePicker, showDurationPicker, showEndDatePicker])
|
|
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
downloadFile()
|
|
downloadFile()
|
|
|
- },[])
|
|
|
|
|
|
|
+ }, [])
|
|
|
|
|
|
|
|
function downloadFile() {
|
|
function downloadFile() {
|
|
|
Taro.downloadFile({
|
|
Taro.downloadFile({
|
|
|
- url: BASE_IMG_URL+'cp_check_f.png',
|
|
|
|
|
|
|
+ url: BASE_IMG_URL + 'cp_check_f.png',
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
if (res.statusCode === 200) {
|
|
if (res.statusCode === 200) {
|
|
|
global.checkFastImg = res.tempFilePath
|
|
global.checkFastImg = res.tempFilePath
|
|
@@ -120,7 +119,7 @@ export default function ClockIndex() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
Taro.downloadFile({
|
|
Taro.downloadFile({
|
|
|
- url: BASE_IMG_URL+'cp_check_s.png',
|
|
|
|
|
|
|
+ url: BASE_IMG_URL + 'cp_check_s.png',
|
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
if (res.statusCode === 200) {
|
|
if (res.statusCode === 200) {
|
|
|
global.checkSleepImg = res.tempFilePath
|
|
global.checkSleepImg = res.tempFilePath
|
|
@@ -222,7 +221,7 @@ export default function ClockIndex() {
|
|
|
getInfo()
|
|
getInfo()
|
|
|
|
|
|
|
|
Taro.eventCenter.on('refreshClockIndex', getHomeData)
|
|
Taro.eventCenter.on('refreshClockIndex', getHomeData)
|
|
|
- if (timer){
|
|
|
|
|
|
|
+ if (timer) {
|
|
|
clearInterval(timer)
|
|
clearInterval(timer)
|
|
|
}
|
|
}
|
|
|
timer = setInterval(() => {
|
|
timer = setInterval(() => {
|
|
@@ -319,6 +318,14 @@ export default function ClockIndex() {
|
|
|
return ''
|
|
return ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function pickerColor(){
|
|
|
|
|
+ var obj = scenarios[current]
|
|
|
|
|
+ if (obj.theme_color) {
|
|
|
|
|
+ return obj.theme_color
|
|
|
|
|
+ }
|
|
|
|
|
+ return MainColorType.orange
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function showPicker(type, title, value, confirm) {
|
|
function showPicker(type, title, value, confirm) {
|
|
|
setPickerTitle(title)
|
|
setPickerTitle(title)
|
|
|
setPickerValue(value)
|
|
setPickerValue(value)
|
|
@@ -531,6 +538,7 @@ export default function ClockIndex() {
|
|
|
<Block>
|
|
<Block>
|
|
|
{
|
|
{
|
|
|
showDurationPicker && <PickerCard onClose={() => { setShowDurationPicker(false) }}
|
|
showDurationPicker && <PickerCard onClose={() => { setShowDurationPicker(false) }}
|
|
|
|
|
+ color={pickerColor()}
|
|
|
value={pickerValue}
|
|
value={pickerValue}
|
|
|
type="duration"
|
|
type="duration"
|
|
|
title={pickerTitle}
|
|
title={pickerTitle}
|
|
@@ -544,6 +552,7 @@ export default function ClockIndex() {
|
|
|
<Block>
|
|
<Block>
|
|
|
{
|
|
{
|
|
|
showDatePicker && <PickerCard onClose={() => { setShowDatePicker(false) }}
|
|
showDatePicker && <PickerCard onClose={() => { setShowDatePicker(false) }}
|
|
|
|
|
+ color={pickerColor()}
|
|
|
value={pickerValue}
|
|
value={pickerValue}
|
|
|
type="datetime"
|
|
type="datetime"
|
|
|
title={pickerTitle}
|
|
title={pickerTitle}
|
|
@@ -557,6 +566,7 @@ export default function ClockIndex() {
|
|
|
<Block>
|
|
<Block>
|
|
|
{
|
|
{
|
|
|
showEndDatePicker && <PickerCard onClose={() => { setShowEndDatePicker(false) }}
|
|
showEndDatePicker && <PickerCard onClose={() => { setShowEndDatePicker(false) }}
|
|
|
|
|
+ color={pickerColor()}
|
|
|
value={pickerValue}
|
|
value={pickerValue}
|
|
|
type="datetime"
|
|
type="datetime"
|
|
|
title={pickerTitle}
|
|
title={pickerTitle}
|