leon преди 1 година
родител
ревизия
b21c0a5853

+ 5 - 0
src/_health/components/move_item.tsx

@@ -0,0 +1,5 @@
+import { View } from "@tarojs/components";
+
+export default function MoveItem({data:any}){
+    return <View></View>
+}

+ 200 - 0
src/_health/pages/move.scss

@@ -6,4 +6,204 @@
     width: 160px;
     height: 72px;
     border-radius: 21px;
+}
+
+.move-title{
+    margin-top: 60px;
+    margin-bottom: 60px;
+    margin-left: 52px;
+    color: #000;
+    font-size: 48px;
+    font-weight: bold;
+}
+
+.move-header{
+    background-color: #fff;
+    padding-left: 52px;
+    display: flex;
+    flex-direction: column;
+}
+
+.header-current{
+    display: flex;
+    align-items: center;
+    flex-direction: row;
+    justify-content: space-between;
+    padding-top: 44px;
+    padding-bottom: 44px;
+    position: relative;
+    padding-right: 40px;
+}
+
+.current_intro{
+    display: flex;
+    flex-direction: column;
+}
+
+.current_footer{
+    height: 108px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    padding-right: 40px;
+    align-items: center;
+    color: #B2B2B2;
+    font-size: 24px;
+}
+
+.summary{
+    margin-top: 36px;
+    background-color: #fff;
+
+}
+
+.summary_header{
+    height: 108px;
+    position: relative;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    box-sizing: border-box;
+    padding-left: 50px;
+    padding-right: 50px;
+}
+
+.summary_footer{
+    height: 222px;
+    display: flex;
+    align-items: center;
+    flex-direction: row;
+}
+
+.summary_footer_item{
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    flex: 1;
+}
+
+.light_desc{
+    font-size: 24px;
+    color: #B2B2B2;
+    margin-bottom: 16px;
+}
+
+.history{
+    background-color: white;
+    display: flex;
+    flex-direction: column;
+    margin-top: 36px;
+}
+
+.history_header{
+    display: flex;
+    height: 108px;
+    margin-left: 52px;
+    position: relative;
+    flex-direction: row;
+    align-items: center;
+}
+
+.history_header_title{
+    color: #000;
+    font-size: 36px;
+    font-weight: bold;
+}
+
+.history_item{
+    padding-left: 44px;
+    padding-right: 40px;
+    height: 152px;
+    display: flex;
+    flex-direction: row;
+    box-sizing: border-box;
+    align-items: center;
+}
+
+.history_item_date{
+    color: #000;
+    font-size: 50px;
+    width: 60px;
+    display: flex;
+    text-align: center;
+    justify-content: center;
+    font-weight: bold;
+    margin-right: 30px;
+}
+
+.history_item_detail_bg{
+    height: 68px;
+    flex: 1;
+    background-color: #F5F5F5;
+    padding-left: 20px;
+    align-items: center;
+    flex-direction: row;
+    display: flex;
+}
+
+.history_item_detail_icon{
+    height: 32px;
+    width: 32px;
+    margin-right: 16px;
+}
+.no_more{
+    color: #B2B2B2;
+    background-color: #f5f5f5;
+    width: 750px;
+    height: 128px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.current_history_item{
+    height: 140px;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    position: relative;
+    display: flex;
+    margin-left: 52px;
+    padding-right: 40px;
+    box-sizing: border-box;
+    align-items: center;
+}
+
+.current_item_period{
+    font-size: 24px;
+    color: #B2B2B2;
+}
+
+.missed{
+    color: #B2B2B2;
+    font-size: 26px;
+}
+
+.recent_btn_bg{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin-top: 24px;
+    padding-bottom: 28px;
+    position: relative;
+}
+
+.recent_btn{
+    height: 56px;
+    border-radius: 28px;
+    width: 180px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background-color: #B2B2B21A;
+    color: #B2B2B2;
+    font-size: 24px;
+}
+
+.arrow_hide{
+    width: 34px;
+    height: 34px;
+    padding: 10px;
 }

+ 295 - 43
src/_health/pages/move.tsx

@@ -1,4 +1,4 @@
-import { View, Text } from "@tarojs/components";
+import { View, Text, Image } from "@tarojs/components";
 import './move.scss'
 import { useDispatch, useSelector } from "react-redux";
 import { getScenario, getThemeColor } from "@/features/health/hooks/health_hooks";
@@ -8,16 +8,28 @@ import { checkStart, setResult } from "@/store/action_results";
 import RequestType, { thirdPartRequest } from "@/services/thirdPartRequest";
 import { setAuth } from "@/features/trackSomething/hooks/werun";
 import { useTranslation } from "react-i18next";
-import { uploadActiveMoves } from "@/services/health";
+import { getActiveMoves, getActiveMovesCurrent, uploadActiveMoves } from "@/services/health";
 import dayjs from "dayjs";
+import { TimeFormatter } from "@/utils/time_format";
 
+let timer
 export default function Move() {
     const health = useSelector((state: any) => state.health);
     const [allowRun, setAllowRun] = useState(false)
+    const [loaded, setLoaded] = useState(false)
+    const [count, setCount] = useState(0)
+    const [data, setData] = useState<any>(null)
+    const [list, setList] = useState<any>([])
+    const [total, setTotal] = useState(0)
+    const [index, setIndex] = useState(1)
+    const [hideCurrentRecent, setHideCurrentRecent] = useState(false)
+    const [moreActive, setMoreActive] = useState(false)
     const { t } = useTranslation()
     const dispatch = useDispatch()
 
     useEffect(() => {
+        getMovesCurrent()
+        getMovesHistory()
         Taro.getSetting({
             success: res => {
                 //第一步,检测是否有授权 - 没有授权
@@ -31,10 +43,39 @@ export default function Move() {
                 }
             }
         })
+        timer = setInterval(() => {
+            setCount((index) => index + 1)
+        }, 1000)
+
+        return () => {
+            clearInterval(timer)
+        }
     }, [])
 
+    function getMovesCurrent() {
+        getActiveMovesCurrent().then(res => {
+            setLoaded(true)
+            setData(res)
+        })
+    }
+
+    function getMovesHistory() {
+        getActiveMoves().then(res => {
+            if (index == 1) {
+                setList((res as any).data)
+                setTotal((res as any).total)
+            }
+            else {
+                setList([...list, ...(res as any).data])
+            }
+        })
+    }
+
 
     function tapLog() {
+        // if (getStatus() != 'open') {
+        //     return
+        // }
         if (allowRun) {
             checkout()
         }
@@ -70,64 +111,275 @@ export default function Move() {
 
         // setTitle('打卡');
         setAllowRun(true)
-        var date = new Date();
-        var time = date.getTime()
-        var strDate = (date.getFullYear() + '') + (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)) + (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
 
+        let schedule_id = null
+        const hour = currentHourPeriod()
+        data.hours.map(item => {
+            if (item.hour == hour) {
+                schedule_id = item.schedule_id
+            }
+        })
 
         thirdPartRequest(RequestType.RequestTypeWXRunData).then(res => {
-            var params = {
-                is_manual: autoCheck ? 0 : 1,
-                timestamp: time,
-                encryptedData: (res as any).encryptedData,
-                iv: (res as any).iv,
-                date: strDate,
-                cloudID: (res as any).cloudID,
-            }
+            // var params = {
+            //     is_manual: autoCheck ? 0 : 1,
+            //     timestamp: time,
+            //     encryptedData: (res as any).encryptedData,
+            //     iv: (res as any).iv,
+            //     date: strDate,
+            //     cloudID: (res as any).cloudID,
+            // }
 
             uploadActiveMoves({
-                wechat_run:{
-                    encryptedData:(res as any).encryptedData,
-                    iv:(res as any).iv,
+                wechat_run: {
+                    encryptedData: (res as any).encryptedData,
+                    iv: (res as any).iv,
                 },
-                date:dayjs().format('YYYYMMDD'),
-                timestamp:new Date().getTime(),
-                schedule_id:getScenario(health.windows,health.mode).window_id
-            }).then(res=>{
+                date: dayjs().format('YYYYMMDD'),
+                hour: hour,
+                timestamp: new Date().getTime(),
+                schedule_id: schedule_id
+            }).then(res => {
                 Taro.showToast({
-                    title:'上报成功',
-                    icon:'none'
+                    title: '上报成功',
+                    icon: 'none'
                 })
             })
-            // uploadSteps(params).then(res => {
-            //     if ((res as any).error_code == 'WX_STEP_PARSE_FAIL') {
-            //         retry(params, autoCheck, time)
-            //         dispatch(checkRetry())
-            //     }
-            //     else {
-
-            //         setShowErrorBadge(false)
-            //         uploadSuccess(res, autoCheck, time)
-            //         setTimeout(() => {
-            //             setCount(count + 1)
-            //         }, 31000)
-            //     }
-
-            // }).catch(e => {
-            //     retry(params, autoCheck, time)
-            // });
         }).catch(_ => {
             dispatch(setResult({ isSuccess: false }) as any)
         })
+    }
 
+    function getStatus() {
+        const minute = new Date().getMinutes()
+        if (minute >= 50 || minute < 10) {
+            return 'open'
+        }
+        return 'upcoming'
+    }
 
+    function currentFootDesc() {
+        const minute = new Date().getMinutes()
+        const pre = new Date().getTime()
+        const next = new Date().getTime() + 3600 * 1000
+        if (minute >= 50) {
+            return `Now open ${dayjs(pre).format('HH:50')}-${dayjs(next).format('HH:10')}`
+        }
+        else if (minute < 10) {
+            let time = new Date()
+            time.setMinutes(10)
+            time.setSeconds(0)
+            time.setMilliseconds(0)
+
+            // 获取总秒数
+            const totalSeconds = Math.floor((time.getTime() - new Date().getTime()) / 1000);
+
+            // 计算小时、分钟和秒
+            // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
+            const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
+            const seconds = String(totalSeconds % 60).padStart(2, '0');
+
+            // return `${hours}:${minutes}:${seconds}`;
+            return `Closing in ${minutes}:${seconds}`
+        }
+
+        let time = new Date()
+        time.setMinutes(50)
+        time.setSeconds(0)
+        time.setMilliseconds(0)
+
+        // 获取总秒数
+        const totalSeconds = Math.floor((time.getTime() - new Date().getTime()) / 1000);
+
+        // 计算小时、分钟和秒
+        // const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0');
+        const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0');
+        const seconds = String(totalSeconds % 60).padStart(2, '0');
+
+        // return `${hours}:${minutes}:${seconds}`;
+        return `Opening soon ${minutes}:${seconds}`
     }
 
+    function getDuration() {
+        const pre = new Date().getTime()
+        const next = new Date().getTime() + 3600 * 1000
+        return dayjs(pre).format('H:00') + '-' + dayjs(next).format('H:00')
+    }
+
+    function process() {
+        let count = 0;
+        data.hours.map(item => {
+            // if (item.)
+        })
+        return `${count} / ${data.hours.length}`
+    }
+
+    function currentHourPeriod() {
+        const time = new Date()
+        let hour = time.getHours()
+        //假如00:09,则为23小时
+        if (time.getMinutes() < 10) {
+            hour--;
+        }
+        if (hour < 0) {
+            hour = 23
+        }
+        return hour
+    }
 
-    return <View>
-        <Text>Move Every Hour</Text>
-        <View className="log_btn" style={{ backgroundColor: getThemeColor(health.mode) }} onClick={tapLog}>
-            Log
+    function currentContent() {
+        const hour = currentHourPeriod()
+        let info: any = null
+        data.hours.map(item => {
+            if (item.hour == hour) {
+                info = item
+            }
+        })
+
+        return <View className="move-header">
+            <View className="header-current">
+                <View className="current_intro">
+                    <View style={{ color: new Date().getMinutes() < 10 ? getThemeColor(health.mode) : '#b2b2b2' }}>{getDuration()}</View>
+                    <Text>0/200 steps</Text>
+                </View>
+                <View className="log_btn" style={{
+                    backgroundColor: getStatus() == 'open' ? getThemeColor(health.mode) : '#6666661A',
+                    color: getStatus() == 'open' ? '#fff' : '#666666'
+                }} onClick={tapLog}>Log</View>
+                <View className="border_footer_line" />
+            </View>
+            <View className="current_footer">
+                <Text>{currentFootDesc()}</Text>
+                <Text>Show More</Text>
+            </View>
+
+        </View>
+    }
+
+    function currentHistory(item) {
+        var start = item.hour
+        var end = start + 1
+        start = (start + '').padStart(2, '0')
+        end = (end + '').padStart(2, '0')
+        return <View className="current_history_item">
+            <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <Text className="current_item_period">{start}:00-{end}:00</Text>
+                <Text>{item.real_steps}/{item.target_steps}</Text>
+            </View>
+
+            {
+                item.status == 'MISSED' && <Text className="missed">Missed</Text>
+            }
+            {
+                item.status == 'CHECKED' && item.real_steps == 0 && <Image className="history_item_detail_icon" src={require('@assets/_health/sit.png')} />
+            }
+            {
+                item.status == 'CHECKED' && item.real_steps > 0 && <Image className="history_item_detail_icon" src={require('@assets/_health/walk.png')} />
+            }
+            <View className="border_footer_line" />
+        </View>
+    }
+
+    function activeCount() {
+        var count = 0;
+        data.hours.map(item => {
+            if (item.status != 'NOT_CHECK') {
+                count++
+            }
+        })
+        return count
+    }
+
+    function activeHour() {
+
+
+        return <View className="summary">
+            <View className="summary_header">
+                <Text>Active Hours</Text>
+                <Image className="arrow_hide"
+                    onClick={() => {
+                        setHideCurrentRecent(!hideCurrentRecent)
+                    }}
+                    src={hideCurrentRecent ? require('@assets/_health/arrow_down.png') : require('@assets/_health/arrow_up.png')} />
+                <View style={{ flex: 1 }} />
+                <Text style={{ color: getThemeColor(health.mode) }}>{process()}</Text>
+                <View className="border_footer_line" />
+            </View>
+            {
+                !hideCurrentRecent && <View className="summary_content">
+                    {
+                        data.hours.map((item, index) => {
+                            if (item.status == 'NOT_CHECK') return <View key={index} />
+                            if (index >= 3 && !moreActive) return <View key={index} />
+                            return <View key={index}>
+                                {
+                                    currentHistory(item)
+                                }
+                            </View>
+                        })
+                    }
+                    {
+                        activeCount() > 3 && <View className="recent_btn_bg">
+                            {
+                                moreActive ? <View className="recent_btn" onClick={() => setMoreActive(false)}>收起</View> : <View className="recent_btn" onClick={() => setMoreActive(true)}>展开剩余{activeCount() - 3}条</View>
+                            }
+                            <View className="border_footer_line" />
+                        </View>
+                    }
+                </View>
+            }
+
+            <View className="summary_footer">
+                <View className="summary_footer_item">
+                    <Text className="light_desc">Steps</Text>
+                    <Text>{data.stat.real_steps}/{data.stat.target_steps}</Text>
+                </View>
+                <View className="summary_footer_item">
+                    <Text className="light_desc">Calories</Text>
+                    <Text>{data.stat.real_calories}/{data.stat.target_calories}</Text>
+                </View>
+                <View className="summary_footer_item">
+                    <Text className="light_desc">Distance</Text>
+                    <Text>{data.stat.real_distance}/{data.stat.target_distance}</Text>
+                </View>
+            </View>
         </View>
+    }
+
+    if (!loaded) return <View />
+
+    return <View style={{ display: 'flex', flexDirection: 'column' }}>
+        <Text className="move-title">Move Every Hour</Text>
+        {
+            currentContent()
+        }
+        {
+            activeHour()
+        }
+        {
+            list.length > 0 && <View className="history">
+                <View className="history_header">
+                    <Text className="history_header_title">Recent</Text>
+                    <View className="border_footer_line" />
+                </View>
+                {
+                    list.map((item, index) => {
+                        return <View key={index} className="history_item">
+                            <Text className="history_item_date">{(item.date + '').substring(6, 8)}</Text>
+                            <View className="history_item_detail_bg">
+                                <Image className="history_item_detail_icon" src={require('@assets/_health/walk.png')} />
+                                <Text>每小时活动 {item.real_hours}/{item.target_hours} · Steps {item.stat.real_steps}/{item.stat.target_steps}</Text>
+                            </View>
+                            <View className="border_footer_line" />
+                        </View>
+                    })
+                }
+            </View>
+        }
+        {
+            (list.length > 0) && (total == list.length) && <Text className="no_more">没有更多了</Text>
+        }
+
+
     </View>
 }

BIN
src/assets/_health/arrow_down.png


BIN
src/assets/_health/arrow_up.png


BIN
src/assets/_health/sit.png


+ 14 - 54
src/features/health/MainFastEatCard.tsx

@@ -22,7 +22,7 @@ import { WindowStatusType, WindowType } from "@/utils/types";
 import { durationArc, isCurrentTimeInRange, startArc } from "./util";
 import { setMode } from "@/store/health";
 import { IconSwitch1, IconSwitch2 } from "@/components/basic/Icons";
-import { getScenario, getWindowStatus } from "./hooks/health_hooks";
+import { getDurationArc, getScenario, getStartArc, getWindowStatus } from "./hooks/health_hooks";
 let useNavigation;
 
 let checkNotification;
@@ -127,7 +127,7 @@ export default function MainFastEatCard(props: {
         color: MainColorType.ringBg
     }
 
-    function scheduleRing() {
+    function targetRing() {
         const { fast, eat } = health.windows.fast_eat
 
         var starts: any = fast.period.start_time.split(':')
@@ -141,62 +141,23 @@ export default function MainFastEatCard(props: {
         const eatCount = 1440 - fastCount
 
         const durationArc = isFastMode ? fastCount / 1440 * 2 * Math.PI : eatCount / 1440 * 2 * Math.PI
-        return {
-            color,
-            startArc,
-            durationArc
-        }
-    }
-
-    function targetRing() {
-        if (status != 'process') {
-            return null
-        }
-        const { fast, eat } = health.windows.fast_eat
-
-        var starts: any = fast.period.start_time.split(':')
-        var ends: any = fast.period.end_time.split(':')
-        const startSeconds: any = parseInt(starts[0] + '') * 60 + parseInt(starts[1] + '')
-        const endSeconds: any = parseInt(ends[0] + '') * 60 + parseInt(ends[1] + '')
-        const color = isFastMode ? '#9AE2FE' : '#FE810C66'
-        var startArc = isFastMode ? startSeconds / 1440 * 2 * Math.PI - Math.PI / 2 : endSeconds / 1440 * 2 * Math.PI - Math.PI / 2
-
-        const fastCount = endSeconds - startSeconds > 0 ? endSeconds - startSeconds : endSeconds - startSeconds + 1440
-        const eatCount = 1440 - fastCount
-
-        var durationArc = isFastMode ? fastCount / 1440 * 2 * Math.PI : eatCount / 1440 * 2 * Math.PI
 
-        if (isFastMode) {
-            var dt = new Date(fastData.target.start_time)
-            var realSeconds = dt.getHours() * 3600 + dt.getMinutes() * 60 + dt.getSeconds()
-            startArc = realSeconds / (1440 * 60) * 2 * Math.PI - Math.PI / 2
-            durationArc = ((fastData.target.end_time - fastData.target.start_time) / 1000) / (1440 * 60) * 2 * Math.PI
+        if (isFastMode && getWindowStatus(health.windows,'FAST') == WindowStatusType.process){
+            const scenario = getScenario(health.windows,'FAST')
+            return {
+                color,
+                startArc:getStartArc(scenario.target.start_timestamp),
+                durationArc:getDurationArc(scenario.target.start_timestamp,scenario.target.end_timestamp)
+            }
         }
 
-
-
         return {
             color,
             startArc,
-            durationArc,
-            radius: isFastMode ? 90 : null,
-            lineWidth: isFastMode ? 10 : null
+            durationArc
         }
     }
 
-    function getRealArc(time) {
-        var date = new Date(time);
-        var hour = date.getHours();
-        var minute = date.getMinutes();
-        var second = date.getSeconds();
-        return (hour * 3600 + minute * 60 + second) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
-    }
-
-    function getRealDurationArc(start, end) {
-        var duration = (end - start) / 1000;
-        return duration / (24 * 3600) * 2 * Math.PI;
-    }
-
     function realRing() {
         const status = getWindowStatus(health.windows, isFastMode ? 'FAST' : 'EAT')
         const scenario = getScenario(health.windows, isFastMode ? 'FAST' : 'EAT')
@@ -204,14 +165,14 @@ export default function MainFastEatCard(props: {
         if (status == WindowStatusType.upcoming) {
             return {
                 color: '#cccccc',
-                startArc: getRealArc(new Date().getTime()),
-                durationArc: getRealDurationArc(new Date().getTime(), scenario.target.start_timestamp),
+                startArc: getStartArc(new Date().getTime()),
+                durationArc: getDurationArc(new Date().getTime(), scenario.target.start_timestamp),
             }
         }
         return {
             color: isFastMode ? MainColorType.fast : MainColorType.eat,
-            startArc: getRealArc(scenario.target.start_timestamp),
-            durationArc: getRealDurationArc(scenario.target.start_timestamp, new Date().getTime())
+            startArc: getStartArc(scenario.target.start_timestamp),
+            durationArc: getDurationArc(scenario.target.start_timestamp, new Date().getTime())
         }
     }
 
@@ -219,7 +180,6 @@ export default function MainFastEatCard(props: {
 
         return <Rings common={common}
             bgRing={bgRing}
-            scheduleRing={scheduleRing()}
             targetRing={targetRing()}
             realRing={realRing()}
             canvasId={'smal11l' + props.id}

+ 13 - 0
src/features/health/hooks/health_hooks.tsx

@@ -81,4 +81,17 @@ export function getCountownTime(windows: any, mode: any) {
             return TimeFormatter.countdown(now, scenario.target.start_timestamp)
     }
     return ''
+}
+
+export const getStartArc = (time: number) => {
+    var date = new Date(time);
+    var hour = date.getHours();
+    var minute = date.getMinutes();
+    var second = date.getSeconds();
+    return (hour * 3600 + minute * 60 + second) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
+}
+
+export const getDurationArc = (start_time: number, end_time: number) => {
+    var duration = (end_time - start_time) / 1000;
+    return duration / (24 * 3600) * 2 * Math.PI;
 }

+ 36 - 2
src/services/health.tsx

@@ -1,4 +1,4 @@
-import { API_ACTIVE_MOVES, 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 } from "./http/api";
+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 } from "./http/api";
 import { request } from "./http/request";
 
 export const getLabels = (params) => {
@@ -188,6 +188,28 @@ export const makeDone = (id)=>{
     })
 }
 
+export const getActiveMovesCurrent = () =>{
+    return new Promise((resolve) => {
+        request({
+            url: API_ACTIVE_MOVES_CURRENT, method: 'GET', data: {  }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
+}
+
+export const getActiveMoves = ()=>{
+    return new Promise((resolve) => {
+        request({
+            url: API_ACTIVE_MOVES, method: 'GET', data: {  }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
+}
+
 export const uploadActiveMoves = (params) =>{
     return new Promise((resolve) => {
         request({
@@ -197,4 +219,16 @@ export const uploadActiveMoves = (params) =>{
             // dispatch(loginSuccess(res));
         })
     })
-}
+}
+
+export const getActiveMoveDetail = (id)=>{
+    return new Promise((resolve) => {
+        request({
+            url: API_ACTIVE_MOVES+'/'+id, method: 'GET', data: {  }
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        })
+    })
+}
+

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

@@ -106,4 +106,5 @@ 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_ACTIVE_MOVES = `${baseUrl}/api/health/active/moves`
+export const API_ACTIVE_MOVES_CURRENT = `${baseUrl}/api/health/active/moves/current`
+export const API_ACTIVE_MOVES= `${baseUrl}/api/health/active/moves`