Leon 1 год назад
Родитель
Сommit
50e88e2371

+ 0 - 0
src/_health/base/cell.tsx


+ 6 - 1
src/_health/pages/move.tsx

@@ -60,6 +60,11 @@ export default function Move() {
         }
     }, [])
 
+    global.updateMove = ()=>{
+        getMovesCurrent()
+        getMovesHistory()
+    }
+
     function getMovesCurrent() {
         getActiveMovesCurrent().then(res => {
             setLoaded(true)
@@ -304,7 +309,7 @@ export default function Move() {
     }
 
     function process() {
-        return `${data.stat.real_hours} / ${data.stat.target_hours}`
+        return `${data.stat.active_hours} / ${data.stat.waking_hours}`
     }
 
     function currentHourPeriod() {

+ 8 - 0
src/_health/pages/move_setting.config.ts

@@ -0,0 +1,8 @@
+export default definePageConfig({
+    usingComponents:{
+      // 'ec-canvas': '../../lib/ec-canvas/ec-canvas',
+      // 'demo':'../../components/demo'
+    },
+    "navigationBarTitleText":"设定目标",
+    "navigationBarBackgroundColor":"#f5f5f5"
+  })

+ 47 - 0
src/_health/pages/move_setting.scss

@@ -0,0 +1,47 @@
+.setting_container{
+    display: flex;
+    flex-direction: column;
+}
+
+.setting_cell{
+    height: 128px;
+    background-color: #fff;
+    padding: 0 52px;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    position: relative;
+}
+
+.setting_title{
+    font-size: 30px;
+    color:#000;
+    
+}
+
+.group_space{
+    height: 36px;
+}
+
+.placeholder{
+    color:#999999;
+    font-size: 30px;
+    flex: 1;
+    text-align: right;
+}
+
+.cell_hover{
+    background-color: #E5E5E5;
+}
+
+.edit_footer_btn{
+    position: fixed;
+    bottom: 100px;
+    height: 96px;
+    width: 520px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border-radius: 28px;
+    left: 116px;
+}

+ 81 - 3
src/_health/pages/move_setting.tsx

@@ -1,5 +1,83 @@
-import { View } from "@tarojs/components";
+import { View, Text, Input } from "@tarojs/components";
+import './move_setting.scss'
+import { rpxToPx } from "@/utils/tools";
+import { IconCellArrow } from "@/components/basic/Icons";
+import { useEffect, useState } from "react";
+import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import { getMoveSchedules, setMoveSchedules } from "@/services/health";
+import Taro from "@tarojs/taro";
 
-export default function MoveSetting(){
-    return <View></View>
+export default function MoveSetting() {
+    const [selIndex, setSelIndex] = useState(-1)
+    const [hours, setHours] = useState('')
+    const [total, setTotal] = useState('')
+    const [detail,setDetail] = useState<any>(null)
+
+    useEffect(()=>{
+        getMoveSchedules().then(res=>{
+            setDetail(res)
+            setHours((res as any).goal.hour)
+            setTotal((res as any).goal.day)
+        })
+    },[])
+
+    function tapDone(){
+        setMoveSchedules({
+            goal:{
+                day:total,
+                hour:hours
+            }
+        }).then(res=>{
+            global.updateMove()
+            Taro.navigateBack()
+        })
+    }
+    return <View className="setting_container">
+        <View className="setting_cell" hoverClass='cell_hover' hoverStayTime={50} onClick={() => { }}>
+            <Text className="setting_title">打卡提醒</Text>
+            <Text className="placeholder">设置</Text>
+            <IconCellArrow width={18} color="#B2B2B2" />
+        </View>
+        <View className="group_space" />
+        <View className="setting_cell" hoverClass='cell_hover' hoverStayTime={50} onClick={() => {
+            setSelIndex(0)
+        }}>
+            <Text className="setting_title">每小时最低步数</Text>
+            {
+                selIndex == 0 ? <Input className='placeholder' style={{ flex: 1 }}
+                    value={hours}
+                    autoFocus={true}
+                    focus={true}
+                    onBlur={() => {
+                        setSelIndex(-1)
+                    }}
+                    onInput={(e) => {
+                        setHours(e.detail.value)
+                    }} /> : <Text className="placeholder">{hours}</Text>
+            }
+            <IconCellArrow width={18} color="#B2B2B2" />
+            <View className="border_footer_line" style={{ left: rpxToPx(52) }} />
+        </View>
+        <View className="setting_cell" hoverClass='cell_hover' hoverStayTime={50} onClick={() => {
+            setSelIndex(1)
+        }}>
+            <Text className="setting_title">每日总步数目标</Text>
+            {
+                selIndex == 1 ? <Input className='placeholder' style={{ flex: 1 }}
+                    value={total}
+                    autoFocus={true}
+                    focus={true}
+                    onBlur={() => {
+                        setSelIndex(-1)
+                    }}
+                    onInput={(e) => {
+                        setTotal(e.detail.value)
+                    }} /> : <Text className="placeholder">{total}</Text>
+            }
+
+            <IconCellArrow width={18} color="#B2B2B2" />
+        </View>
+
+        <View className="edit_footer_btn" style={{ color: getThemeColor('ACTIVE'), backgroundColor: getThemeColor('ACTIVE') + '33' }} onClick={tapDone}>完成</View>
+    </View>
 }

+ 95 - 0
src/_health/pages/timeline_detail.scss

@@ -0,0 +1,95 @@
+.detail_header{
+    background-color: #fff;
+    width: 750px;
+    padding:40px;
+    padding-bottom: 28px;
+    display: flex;
+    flex-direction: row;
+}
+
+.detail_header_header{
+    margin-right:24px;
+    width: 74px;
+    height: 74px;
+    border-radius: 8px;
+}
+
+.detail_header_content{
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+
+}
+
+.detail_nickname{
+    color: #5C7099;
+    font-weight: bold;
+    font-size: 34px;
+    line-height: 42px;
+}
+
+.add_note{
+    background-color: #fff;
+    position: fixed;
+    left: 0;
+    right:0;
+    bottom:0;
+    height: 108px;
+    padding-bottom: 40px;
+    font-size: 26px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    color: #5C7099;
+
+}
+
+.publish_bg{
+    position: absolute;
+    left: 0;
+    right: 0;
+    top:0;
+    bottom:0;
+    background-color: rgba(0,0,0,0.9);
+    box-sizing: border-box;
+    padding-top:100px;
+    padding-left:72px;
+    padding-right:72px;
+    display: flex;
+    flex-direction: column;
+}
+
+.time{
+    color: #5C7099;
+    margin-bottom: 30px;
+}
+
+.toolbar{
+    height: 108px;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    padding-left:72px;
+    padding-right:40px;
+    margin-left:-72px;
+    margin-right:-72px;
+    box-sizing: border-box;
+    background-color: #fff;
+}
+
+.album{
+    width: 72px;
+    height: 72px;
+    margin-right: 32px;
+
+}
+
+.btn{
+    display: flex;
+    color: #fff;
+    width: 128px;
+    height: 72px;
+    border-radius: 18px;
+    align-items: center;
+    justify-content: center;
+}

+ 0 - 0
src/_health/pages/timeline_detail.ts.config


+ 253 - 0
src/_health/pages/timeline_detail.tsx

@@ -0,0 +1,253 @@
+import { View, Image, Text, Input, Textarea } from "@tarojs/components";
+import { useSelector } from "react-redux";
+import './timeline_detail.scss'
+import { useEffect, useState } from "react";
+import Taro, { useRouter } from "@tarojs/taro";
+import dayjs from "dayjs";
+import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import { baseUrl } from "@/services/http/api";
+import { checkAuthorized } from "@/utils/check_authorized";
+import { createMoment, getEvents } from "@/services/health";
+
+let timestamp = 0;
+let useRoute;
+let useNavigation;
+let scenario = '';
+if (process.env.TARO_ENV == 'rn') {
+    useRoute = require("@react-navigation/native").useRoute
+    useNavigation = require("@react-navigation/native").useNavigation
+}
+export default function TimelineDetail() {
+    const health = useSelector((state: any) => state.health);
+    const user = useSelector((state: any) => state.user);
+    const [list, setList] = useState<any>([])
+    const [desc, setDesc] = useState('')
+    const [imgUrl, setImgUrl] = useState('')
+    const [btnDisable, setBtnDisable] = useState(true)
+    const [showPop, setShowPop] = useState(false)
+    const [publish, setPublish] = useState<any>(null)
+    const [bottom, setBottom] = useState(0)
+    let router
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
+    if (process.env.TARO_ENV == 'rn') {
+        router = useRoute()
+    }
+    else {
+        router = useRouter()
+    }
+
+    const { schedule_id, event_id } = router.params
+
+    useEffect(() => {
+        Taro.onKeyboardHeightChange(res => {
+            setBottom(res.height)
+        })
+
+        getDatas()
+    }, [])
+
+    useEffect(() => {
+        if (desc.length > 0 || imgUrl.length > 0) {
+            setBtnDisable(false)
+        }
+        else {
+            setBtnDisable(true)
+        }
+    }, [desc, imgUrl])
+
+    function getDatas() {
+        getEvents(event_id).then(res => {
+            setList((res as any).moments)
+            setPublish((res as any).publish)
+        })
+    }
+
+    function addImage(isCamera: boolean) {
+        Taro.chooseMedia({
+            count: 1,
+            sizeType: ['compressed'],
+            mediaType: ['image'],
+            sourceType: [isCamera ? 'camera' : 'album'],
+            success: function (res) {
+                chooseSuccess(res, true)
+                // checkAuthorized()
+            },
+            fail: function (res) {
+            }
+        })
+    }
+
+    async function chooseSuccess(res, isAlbum) {
+        var params = {
+            event: 'add_a_picture',
+            value: isAlbum ? 'choose_from_album_confirm' : 'use_camera_confirm',
+        }
+
+        // saveFoodCache('create', params)
+
+        var savedFilePath = process.env.TARO_ENV == 'rn' ? res.tempFiles[0].path : res.tempFiles[0].tempFilePath
+
+        // var savedFilePath = res.savedFilePath
+        await Taro.setStorage({ key: 'pic', data: savedFilePath })
+        setImgUrl(savedFilePath as any)
+
+        uploadFile(savedFilePath, isAlbum ? 'album' : 'camera')
+
+
+    }
+
+    function uploadFile(path, source) {
+        Taro.showLoading({
+            title: '加载中'
+        })
+        var dot = path.lastIndexOf('.')
+        var fileExt = dot > 0 ? path.substring(dot) : ''
+        Taro.request({
+            method: 'GET',
+            url: `${baseUrl}/api/thirdparty/aliyun/oss-form-upload`,
+            header: {
+                'Authorization': 'bearer ' + global.token
+            },
+            data: {
+                type: 'FOOD_JOURNAL',
+                file_ext: fileExt
+            },
+            success: (rsp) => {
+                if (rsp.statusCode != 200) {
+                    Taro.showToast({
+                        title: '操作失败,请检查网络',
+                        icon: 'none'
+                    })
+                    return
+                }
+                Taro.uploadFile({
+                    url: rsp.data.upload_url,
+                    filePath: path,
+                    name: 'file',
+                    formData: rsp.data.fields,
+                    success: rlt => {
+                        setImgUrl(rsp.data.view_url)
+                        Taro.hideLoading()
+                        // createData(rsp.data.view_url, source)
+
+                        // uploadAvatar(rsp.data.view_url)
+                        // _this.changeAvatar(rsp.data.view_url);
+                    },
+                    fail: rlt => {
+                        Taro.hideLoading()
+                        Taro.showModal({
+                            content: rlt.errMsg
+                        })
+                    }
+                })
+            }
+        })
+    }
+
+    function tapPost() {
+        if (desc.length == 0 && imgUrl.length == 0) {
+            Taro.showToast({
+                icon: 'none',
+                title: '请输入描述或添加图片'
+            })
+            return
+        }
+        var params: any = {
+            schedule_id: schedule_id,
+            description: desc,
+            start: {
+                date: dayjs(timestamp).format('YYYYMMDD'),
+                timestamp: timestamp
+            },
+
+            // real_end_time: meal.target_end_time,
+        }
+
+
+        if (imgUrl.length > 0) {
+            params.media = [{
+                url: imgUrl,
+                type: imgUrl.indexOf('mp4') != -1 ? 'video' : 'image',
+                source: 'album'
+            }]
+        }
+
+        params.event_id = event_id
+        createMoment(params).then(res => {
+            getDatas()
+
+            global.refreshWindow()
+            global.refreshHistory()
+            setShowPop(false)
+        })
+
+    }
+
+    return <View style={{ display: 'flex', flex: 1 }}>
+        <View className="detail_header">
+            <Image className="detail_header_header"
+                src={user.avatar}
+                mode="aspectFill"
+            />
+            <View className="detail_header_content">
+                <Text className="detail_nickname">{user.nickname}</Text>
+                {
+                    list.map((item, index) => {
+                        return <View key={index} style={{flexDirection:'column',display:'flex'}}>
+                            <Text>{dayjs(item.time.timestamp).format('HH:mm')}</Text>
+                            {
+                                item.title && <Text>{item.title}</Text>
+                            }
+                            {
+                                item.description && <Text>{item.description}</Text>
+                            }
+                            {
+                                item.media && <Image src={item.media[0].url} style={{width:60,height:60}}/>
+                            }
+                        </View>
+                    })
+                }
+                {
+                    publish && <Text>发布于{dayjs(publish.timestamp).format('MM-DD HH:mm')}</Text>
+                }
+            </View>
+        </View>
+        <View className="add_note" onClick={() => {
+            timestamp = new Date().getTime()
+            setShowPop(true)
+        }}>写个笔记</View>
+        {
+            showPop && <View className="publish_bg">
+                <View style={{
+                    position: 'absolute', left: 50,
+                    top: 30,
+                    color: '#fff'
+                }} onClick={() => setShowPop(false)}>关闭</View>
+                <Text className="time">{dayjs(timestamp).format('HH:mm')}</Text>
+                <Textarea placeholder="What's on your mind?" style={{ flex: 1, color: '#fff', caretColor: getThemeColor(health.mode) }} focus value={desc} onInput={(e) => {
+                    setDesc(e.detail.value)
+                }} />
+                <View className="toolbar">
+                    {
+                        imgUrl.length > 0 && <Image src={imgUrl} mode="aspectFill" className="album" onClick={() => addImage(false)} />
+                    }
+                    {
+                        imgUrl.length == 0 && <Image src={require('@assets/_health/album.png')} className="album" onClick={() => addImage(false)} />
+                    }
+                    {
+                        imgUrl.length == 0 && <Image src={require('@assets/_health/camera.png')} className="album" onClick={() => addImage(true)} />
+                    }
+
+
+                    <View style={{ flex: 1 }} />
+                    <View className="btn" style={{ backgroundColor: btnDisable ? '#b2b2b2' : getThemeColor(health.mode) }} onClick={tapPost}>发布</View>
+                </View>
+                <View style={{ height: bottom, flexShrink: 0 }} />
+            </View>
+        }
+    </View>
+}

+ 1 - 0
src/app.config.ts

@@ -59,6 +59,7 @@ const appConfig = defineAppConfig({
         'pages/schedules_edit',
         'pages/setting_reminder',
         'pages/moment_detail',
+        'pages/timeline_detail',
         'pages/archive',
         'pages/move',
         'pages/move_schedule',

BIN
src/assets/_health/album.png


BIN
src/assets/_health/camera.png


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
src/components/basic/Icons.tsx


+ 54 - 15
src/features/health/MainConsole.tsx

@@ -38,6 +38,7 @@ export default function MainConsole(props: { type: WindowType }) {
     const [operateType, setOperateType] = useState('')
     const [btnDisable, setBtnDisable] = useState(false)
     const [selItem, setSelItem] = useState<any>(null)
+    
     const limitPickerRef = useRef(null)
     const dispatch = useDispatch()
 
@@ -98,6 +99,28 @@ export default function MainConsole(props: { type: WindowType }) {
                     setShowTimePicker(true)
                 }
                 return;
+            case 'MARK_DONE':
+                {
+                    setBtnDisable(true)
+                    clockTimes({
+                        check_items: [{
+                            schedule_id: item.schedule_id,
+                            date: dayjs().format('YYYYMMDD'),
+                            timestamp: new Date().getTime()
+                        }]
+                    }).then(res => {
+                        // dispatch(setShowActionTip({
+                        //     isShow: true,
+                        //     isCompleted: (selItem.event == 'FAST_END' || selItem.event == 'SLEEP_WAKE_UP')
+                        // }))
+                        // setBtnDisable(false)
+                        // setShowTimePicker(false)
+                        global.refreshWindow()
+                        global.refreshHistory()
+                    }).catch(e => {
+                    })
+                }
+                return;
 
         }
         jumpPage('/_health/pages/add_moment?moment=' + JSON.stringify(item))
@@ -108,6 +131,8 @@ export default function MainConsole(props: { type: WindowType }) {
             case 'START':
             case 'END':
                 return '打卡'
+            case 'MARK_DONE':
+                return 'Action'
         }
         return '记录'
     }
@@ -136,10 +161,24 @@ export default function MainConsole(props: { type: WindowType }) {
         return <View />
     }
 
+    function tapTimeline(item,inex){
+        if (health.mode == 'DAY'||health.mode =='NIGHT'){
+            return;
+        }
+        if (!user.isLogin) {
+            jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+            return
+        }
+        if (!item.event_id){
+            return
+        }
+        jumpPage(`/_health/pages/timeline_detail?event_id=${item.event_id}&schedule_id=${item.schedule_id}`)
+    }
+
     function timelineItem(item: any, index: number, count: number) {
-        return <View key={index} className="timeline_item" >
+        return <View key={index} className="timeline_item" onClick={()=>tapTimeline(item,index)}>
             <View className="timeline_left">
-                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center',height:rpxToPx(28) }}>
+                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', height: rpxToPx(28) }}>
                     {
                         !item.reminder && <Image src={require('@assets/images/notification_off.png')} className='notification_icon' />
                     }
@@ -147,11 +186,11 @@ export default function MainConsole(props: { type: WindowType }) {
                 </View>
 
 
-                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center',marginTop:rpxToPx(5) }}>
+                <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', marginTop: rpxToPx(5) }}>
                     <Text className="timeline_time" onClick={() => edit(item)}>{item.title}</Text>
                 </View>
                 {
-                    (item.moment && item.moment.description) ? <Text className="timeline_desc">{item.moment.description}</Text>:<View  className="timeline_thirdspace"/>
+                    (item.moment && item.moment.description) ? <Text className="timeline_desc">{item.moment.description}</Text> : <View className="timeline_thirdspace" />
                 }
 
             </View>
@@ -360,7 +399,7 @@ export default function MainConsole(props: { type: WindowType }) {
                         }
                     }
                     list.push('编辑日程列表')
-                    
+
                 }
                 break;
             case 'EAT':
@@ -409,7 +448,7 @@ export default function MainConsole(props: { type: WindowType }) {
                     switch (health.mode) {
                         case 'DAY':
                         case 'NIGHT':
-                            jumpPage('/_health/pages/schedules_list?mode='+health.mode)
+                            jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
                             break;
                         case 'FAST':
                         case 'SLEEP':
@@ -420,7 +459,7 @@ export default function MainConsole(props: { type: WindowType }) {
                                     setDurationPicker(true)
                                 }
                                 else {
-                                    jumpPage('/_health/pages/schedules_list?mode='+health.mode)
+                                    jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
                                 }
                             }
                             break;
@@ -437,14 +476,14 @@ export default function MainConsole(props: { type: WindowType }) {
                 {
                     switch (health.mode) {
                         case 'EAT':
-                            jumpPage('/_health/pages/schedules_list?mode='+health.mode)
+                            jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
                             break;
                         case 'FAST':
                         case 'SLEEP':
                             const obj = getScenario(health.windows, health.mode)
                             if (obj.window_id) {
                                 //del record
-                                jumpPage('/_health/pages/schedules_list?mode='+health.mode)
+                                jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
                                 console.log('zzzzzzzzz')
                             }
                             else {
@@ -452,7 +491,7 @@ export default function MainConsole(props: { type: WindowType }) {
                             }
                             break;
                         case 'ACTIVE':
-                            jumpPage('/_health/pages/schedules_list?mode='+health.mode)
+                            jumpPage('/_health/pages/schedules_list?mode=' + health.mode)
                             break;
                     }
                 }
@@ -615,8 +654,8 @@ export default function MainConsole(props: { type: WindowType }) {
         })
     }
 
-    function timePointClass(){
-        if (getWindowStatus(health.windows, health.mode) == WindowStatusType.process){
+    function timePointClass() {
+        if (getWindowStatus(health.windows, health.mode) == WindowStatusType.process) {
             return 'time_point time_point_animation'
         }
         return 'time_point'
@@ -626,8 +665,8 @@ export default function MainConsole(props: { type: WindowType }) {
         <View className="main_summary">
             {/* <View className="main_summary_status" style={{ color: getThemeColor(health.mode) }}>{windowStatus()}</View> */}
             <View className="main_summary_time" style={{ color: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : '#000' }}>{getCountownTime(health.windows, health.mode)}
-                <View className={timePointClass()} 
-                style={{backgroundColor:getWindowStatus(health.windows,health.mode)==WindowStatusType.upcoming?'#B2B2B2':getThemeColor(health.mode)}}/>
+                <View className={timePointClass()}
+                    style={{ backgroundColor: getWindowStatus(health.windows, health.mode) == WindowStatusType.upcoming ? '#B2B2B2' : getThemeColor(health.mode) }} />
             </View>
             <Text className="main_summary_duration">Total {getDuration(health.windows, health.mode)}</Text>
             <View className="border_footer_line" />
@@ -666,7 +705,7 @@ export default function MainConsole(props: { type: WindowType }) {
 
             </View>
         }
-        <View className="circle"/>
+        <View className="circle" />
 
         {
             showTimePicker && modalContent()

+ 34 - 1
src/services/health.tsx

@@ -1,4 +1,4 @@
-import { API_ACTIVE_MOVES, API_ACTIVE_MOVES_CURRENT, API_HEALTH_ARCHIVED, API_HEALTH_CLOCK, API_HEALTH_EVENTS, API_HEALTH_LABELS, API_HEALTH_MOMENT, API_HEALTH_RECORD, API_HEALTH_SCHEDULES, API_HEALTH_STREAKS, API_HEALTH_TARGET, API_HEALTH_WINDOWS, API_ME_ALBUMS, API_ME_JOURNALS } from "./http/api";
+import { API_ACTIVE_MOVES, API_ACTIVE_MOVES_CURRENT, API_ACTIVE_MOVES_SCHEDULES, API_HEALTH_ARCHIVED, API_HEALTH_CLOCK, API_HEALTH_EVENTS, API_HEALTH_LABELS, API_HEALTH_MOMENT, API_HEALTH_RECORD, API_HEALTH_SCHEDULES, API_HEALTH_STREAKS, API_HEALTH_TARGET, API_HEALTH_WINDOWS, API_ME_ALBUMS, API_ME_JOURNALS } from "./http/api";
 import { request } from "./http/request";
 
 export const getLabels = (params) => {
@@ -254,3 +254,36 @@ export const getAlbums = (params) =>{
         })
     })
 }
+
+export const getMoveSchedules = ()=>{
+    return new Promise((resolve) => {
+        request({
+            url: API_ACTIVE_MOVES_SCHEDULES, method: 'GET', data: {  }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
+}
+
+export const setMoveSchedules = (params)=>{
+    return new Promise((resolve) => {
+        request({
+            url: API_ACTIVE_MOVES_SCHEDULES, method: 'POST', data: { ...params }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
+}
+
+export const getEvents = (id)=>{
+    return new Promise((resolve) => {
+        request({
+            url: API_HEALTH_EVENTS+'/'+id, method: 'GET', data: {  }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
+}

+ 2 - 0
src/services/http/api.js

@@ -105,8 +105,10 @@ export const API_HEALTH_WINDOWS = `${baseUrl}/api/health/windows`
 export const API_HEALTH_CLOCK = `${baseUrl}/api/health/clocks`
 export const API_HEALTH_EVENTS = `${baseUrl}/api/health/events`
 export const API_HEALTH_ARCHIVED = `${baseUrl}/api/health/archived`
+export const API_HEATH_EVENTS = `${baseUrl}/api/health/events`
 
 export const API_ACTIVE_MOVES_CURRENT = `${baseUrl}/api/health/active/moves/current`
+export const API_ACTIVE_MOVES_SCHEDULES = `${baseUrl}/api/health/schedules/active/move`
 export const API_ACTIVE_MOVES= `${baseUrl}/api/health/active/moves`
 export const API_ME_JOURNALS = `${baseUrl}/api/health/wo/journals`
 export const API_ME_ALBUMS = `${baseUrl}/api/health/wo/albums`

Некоторые файлы не были показаны из-за большого количества измененных файлов