Leon 1 سال پیش
والد
کامیت
9de2429f03

+ 14 - 8
src/features/trackSomething/components/DayNightCard.tsx

@@ -40,7 +40,13 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
                 setExpand(props.isNight ? (res as any).show_night_ring : (res as any).show_day_ring)
             })
 
-            latestLocation().then(data => {})
+            var today = new Date()
+            var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000 * 3)
+            var strToday = `${today.getFullYear()}-${TimeFormatter.padZero(today.getMonth() + 1)}-${TimeFormatter.padZero(today.getDate())}`
+            var strTomorrow = `${tomorrow.getFullYear()}-${TimeFormatter.padZero(tomorrow.getMonth() + 1)}-${TimeFormatter.padZero(tomorrow.getDate())}`
+            latestLocation({
+                date_start: strToday, date_end: strTomorrow
+            }).then(data => { })
 
         }
         getContent()
@@ -144,7 +150,7 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             success: function (res) {
                 console.log(res)
                 var today = new Date()
-                var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000*3)
+                var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000 * 3)
                 var strToday = `${today.getFullYear()}-${TimeFormatter.padZero(today.getMonth() + 1)}-${TimeFormatter.padZero(today.getDate())}`
                 var strTomorrow = `${tomorrow.getFullYear()}-${TimeFormatter.padZero(tomorrow.getMonth() + 1)}-${TimeFormatter.padZero(tomorrow.getDate())}`
 
@@ -208,8 +214,8 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             sunriseDate.setMinutes(min2)
             sunriseDate.setSeconds(second2)
 
-            if (new Date().getTime()<sunriseDate.getTime()){
-                return TimeFormatter.countdown(now.getTime()-24*3600*1000)
+            if (new Date().getTime() < sunriseDate.getTime()) {
+                return TimeFormatter.countdown(now.getTime() - 24 * 3600 * 1000)
             }
 
             return TimeFormatter.countdown(now.getTime())
@@ -302,7 +308,7 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             sunriseDate.setHours(hour2)
             sunriseDate.setMinutes(min2)
             sunriseDate.setSeconds(second2)
-            if (sunriseDate.getTime()>new Date().getTime()){
+            if (sunriseDate.getTime() > new Date().getTime()) {
                 return true
             }
 
@@ -353,7 +359,7 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
             sunriseDate.setHours(hour2)
             sunriseDate.setMinutes(min2)
             sunriseDate.setSeconds(second2)
-            if (sunriseDate.getTime()>new Date().getTime()){
+            if (sunriseDate.getTime() > new Date().getTime()) {
                 return 'Time past Sunset'
             }
 
@@ -551,14 +557,14 @@ export default function DayNightCard(props: { isNight: boolean, switchChanged: F
                         <View style={{ display: 'flex', flexDirection: 'column' }}>
                             <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{props.isNight ? `Today ${sunsetTime} - Tomorrow ${sunriseTmrTime}` : `${sunriseTime} - ${sunsetTime}`}</Text>
                             <Text className='day_night_desc'>{props.isNight ? 'Sunset to Sunrise' : 'Sunrise to Sunset'}</Text>
-                            <View style={{ display: 'flex', flexDirection: 'row',marginTop:rpxToPx(32) }}>
+                            <View style={{ display: 'flex', flexDirection: 'row', marginTop: rpxToPx(32) }}>
                                 <View style={{ display: 'flex', flexDirection: 'column', width: rpxToPx(300) }}>
                                     <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day }}>{timeCount()}</Text>
                                     <Text className='day_night_desc'>{timeDesc()}</Text>
                                 </View>
                                 {
                                     showExtraData() && <View style={{ display: 'flex', flexDirection: 'column', width: rpxToPx(300) }}>
-                                        <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day,opacity:0.6 }}>{timeCount2()}</Text>
+                                        <Text className='day_night_value' style={{ color: props.isNight ? ColorType.night : ColorType.day, opacity: 0.6 }}>{timeCount2()}</Text>
                                         <Text className='day_night_desc'>{timeDesc2()}</Text>
                                     </View>
                                 }

+ 25 - 0
src/features/trackTimeDuration/components/Discovery.scss

@@ -8,4 +8,29 @@
     justify-content: center;
     margin-bottom: 36px;
 
+}
+
+.duration_bg3 {
+    margin-left: 50px;
+    display: flex;
+    flex-direction: column;
+    // align-items: center;
+    justify-content: center;
+    flex: 1;
+}
+
+.duration_title2 {
+    font-size: 32px;
+    line-height: 32px;
+    color: #fff;
+    opacity: 0.6;
+    font-weight: 400;
+}
+
+.duration_value2 {
+    margin-top: 2px;
+    font-size: 36px;
+    line-height: 36px;
+    font-weight: 500;
+    margin-bottom: 8px;
 }

+ 41 - 34
src/features/trackTimeDuration/components/Discovery.tsx

@@ -75,8 +75,8 @@ export default function Discovery() {
                 obj = item
             }
         })
-        if (!obj){
-            console.log('报错',schedule)
+        if (!obj) {
+            console.log('报错', schedule)
             return null;
         }
         return [obj.schedule.fast.end_time, obj.schedule.fast.start_time]
@@ -315,44 +315,50 @@ export default function Discovery() {
     }
     return <View style={{ display: 'flex', flexDirection: 'column' }}>
         <Box>
-            <View style={{
-                marginLeft: rpxToPx(-40),
-                marginRight: rpxToPx(-40),
-                marginTop: rpxToPx(-40),
-                padding: rpxToPx(48),
-            }}>
+            <View>
                 <View style={{
-                    display: 'flex', flexDirection: 'row', 
-                    marginTop: showRing ? -6 : 0,
-                    marginBottom: showRing ? -6 : 0,
-                    padding: showRing ? 14 : 0,
-                    alignItems: 'center'
+                    marginLeft: rpxToPx(-40),
+                    marginRight: rpxToPx(-40),
+                    marginTop: rpxToPx(-40),
+                    padding: rpxToPx(48),
+                    // backgroundColor: 'red'
                 }}>
-                    {
-                        schedule && rings()
-                    }
-                    {schedule && <View className="duration_bg" style={{ marginLeft: showRing ? rpxToPx(68) : rpxToPx(52) }}>
-                        {
-                            showRing && <Text className="duration_title">{t('feature.common.day')}</Text>
-                        }
-                        {
-                            showRing &&
-                            <Text className="duration_value" style={{ color: ColorType.day }}>{dayDuration()}</Text>
-                        }
-                        {
-                            <Text className="duration_title">{t('feature.common.eat')}</Text>
-                        }
+
+                    <View style={{
+                        display: 'flex',
+                        flexDirection: 'row',
+                        marginTop: showRing ? -6 : 0,
+                        marginBottom: showRing ? -6 : 0,
+                        padding: showRing ? 14 : 0,
+                        alignItems: 'center'
+                    }}>
                         {
-                            <Text className="duration_value" style={{ color: ColorType.food }}>{eatDuration()}</Text>
+                            schedule && rings()
                         }
-                        {
-                            <Text className="duration_title">{t('feature.common.move')}</Text>
-                        }
-                        {
-                            <Text className="duration_value" style={{ color: ColorType.activity }}>{activityDuration()}</Text>
+                        {schedule && <View className="duration_bg3"
+                            style={{ marginLeft: showRing ? rpxToPx(68) : rpxToPx(52), height: bigRingRadius * 2, overflow: 'visible' }}>
+                            {
+                                showRing && <Text className="duration_title2">{t('feature.common.day')}</Text>
+                            }
+                            {
+                                showRing &&
+                                <Text className="duration_value2" style={{ color: ColorType.day }}>{dayDuration()}</Text>
+                            }
+                            {
+                                <Text className="duration_title2">进食</Text>
+                            }
+                            {
+                                <Text className="duration_value2" style={{ color: ColorType.food }}>{eatDuration()}</Text>
+                            }
+                            {
+                                <Text className="duration_title2">活动</Text>
+                            }
+                            {
+                                <Text className="duration_value2" style={{ color: ColorType.activity,marginBottom: 0 }}>{activityDuration()}</Text>
+                            }
+                        </View>
                         }
                     </View>
-                    }
                 </View>
                 <View className="food_btn1" style={{ backgroundColor: ColorType.food }} onClick={goFood}>
                     <Text style={{ fontWeight: 'bold' }}>食物日记</Text>
@@ -360,6 +366,7 @@ export default function Discovery() {
                 <View className="food_btn1" style={{ backgroundColor: ColorType.activity, marginBottom: 0 }} onClick={goAcitivity}>
                     <Text style={{ fontWeight: 'bold' }}>运动训练</Text>
                 </View>
+
             </View>
         </Box>
 

+ 3 - 3
src/features/trackTimeDuration/components/IndexItem.scss

@@ -35,7 +35,7 @@
     // padding-bottom: 20px;
 }
 
-.duration_bg {
+.duration_bg2 {
     margin-left: 50px;
     display: flex;
     flex-direction: column;
@@ -44,7 +44,7 @@
     flex: 1;
 }
 
-.duration_title {
+.duration_title2 {
     font-size: 32px;
     line-height: 32px;
     color: #fff;
@@ -52,7 +52,7 @@
     font-weight: 400;
 }
 
-.duration_value {
+.duration_value2 {
     margin-top: 2px;
     font-size: 36px;
     line-height: 36px;

+ 8 - 8
src/features/trackTimeDuration/components/IndexItem.tsx

@@ -123,7 +123,7 @@ export default function Component(props: { type: string, data: any, time: any, s
                 realRing1.color = ColorType.fast + '66'
             }
 
-            if (!isStageMode) {
+            if (user.isLogin) {
                 list = []
             }
             return <Rings common={common} bgRing={bgRing} currentDot={isStageMode ? null : currentDot1} stageList={list} realRing={realRing1} canvasId={props.type + props.time + 'big'} />
@@ -438,26 +438,26 @@ export default function Component(props: { type: string, data: any, time: any, s
                 {
                     rings()
                 }
-                <View className="duration_bg" style={{ marginLeft: !props.showStage && global.showNightRing === true ? rpxToPx(68) : rpxToPx(52),height: bigRingRadius*2,overflow:'visible'}}>
+                <View className="duration_bg2" style={{ marginLeft: !props.showStage && global.showNightRing === true ? rpxToPx(68) : rpxToPx(52),height: bigRingRadius*2,overflow:'visible'}}>
                     {
                         !props.showStage && global.showNightRing === true &&
-                        <Text className="duration_title">{t('feature.common.overnight')}</Text>
+                        <Text className="duration_title2">{t('feature.common.overnight')}</Text>
                     }
                     {
                         !props.showStage && global.showNightRing === true &&
-                        <Text className="duration_value" style={{ color: ColorType.night }}>{nightDuration()}</Text>
+                        <Text className="duration_value2" style={{ color: ColorType.night }}>{nightDuration()}</Text>
                     }
                     {
-                        (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title">{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
+                        (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title2">{t('feature.track_time_duration.record_fast_sleep.item.fast')}</Text>
                     }
                     {
-                        (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.fastColor ? global.fastColor : ColorType.fast }}>{fastDuration()}</Text>
+                        (props.data.scenario.name == 'FAST' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value2" style={{ color: global.fastColor ? global.fastColor : ColorType.fast }}>{fastDuration()}</Text>
                     }
                     {
-                        (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title" >{t('feature.track_time_duration.record_fast_sleep.item.sleep')}</Text>
+                        (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_title2" >{t('feature.track_time_duration.record_fast_sleep.item.sleep')}</Text>
                     }
                     {
-                        (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value" style={{ color: global.sleepColor ? global.sleepColor : ColorType.sleep, marginBottom: 0 }}>{sleepDuration()}</Text>
+                        (props.data.scenario.name == 'SLEEP' || props.data.scenario.name == 'FAST_SLEEP') && <Text className="duration_value2" style={{ color: global.sleepColor ? global.sleepColor : ColorType.sleep, marginBottom: 0 }}>{sleepDuration()}</Text>
                     }
                 </View>
                 <Image className="arrow2" src={require('@/assets/images/arrow3.png')} />

+ 3 - 2
src/features/trackTimeDuration/components/RecordFastSleep.scss

@@ -15,6 +15,7 @@
     margin-top: 20px;
     position: relative;
     overflow: hidden;
+    box-sizing: border-box;
     // margin-bottom: 16px;
 }
 
@@ -48,13 +49,13 @@
 }
 
 
-.fast_sleep_item {
+.fast_sleep_item1 {
     // display: 'flex',position:'relative', flex-: 'row', alignItems: 'center'
     display: flex;
     position: relative;
     flex-direction: row;
     align-items: center;
-    width: 578px;
+    width: 562px;
     // padding-top: 20px;
     // padding-bottom: 20px;
 }

+ 2 - 3
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -503,8 +503,8 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
             sleepDuration = getDuration(record.sleep)
             showSleep = true
         }
-        return <View style={{ display: 'flex', flexDirection: 'column' }}>
-            <View className="fast_sleep_item">
+        return <View style={{ display: 'flex', flexDirection: 'column',margin:rpxToPx(8),boxSizing:'border-box' }}>
+            <View className="fast_sleep_item1">
                 {
                     rings()
                 }
@@ -522,7 +522,6 @@ const RecordFastSleep = memo((props: { data: any, type: string, index: number })
                         showSleep && <Text className="duration_value" style={{ color: global.sleepColor ? global.sleepColor : ColorType.sleep }}>{sleepDuration}</Text>
                     }
                 </View>
-                {/* <Image className="arrow1" src={require('@/assets/images/arrow.png')} /> */}
                 <View className="record_arrow_bg" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
                     <View style={{ flex: 1 }} />
                     <Text className='recordTime'>{getArrowText()}</Text>

+ 1 - 1
src/features/trackTimeDuration/components/WeekCalendar.tsx

@@ -159,7 +159,7 @@ const WeekCalendar = memo(() => {
 
                             // // 
                             if (index == current || index == current - 1 || index == current + 1)
-                                return <WeekCalendarItem data={item} key={index} />
+                                return <WeekCalendarItem data={item} key={index} isCurrentWeek={index==calendars.length-1}/>
                             return <View style={{ width: parseInt(rpxToPx(658) + ''), flexShrink: 0 }} />
                         })
                     }

+ 58 - 20
src/features/trackTimeDuration/components/WeekCalendarItem.tsx

@@ -3,8 +3,12 @@ import './WeekCalendarItem.scss'
 import { rpxToPx } from "@/utils/tools";
 import { useEffect, useState } from "react";
 import { ColorType } from "@/context/themes/color";
-export default function WeekCalendarItem(props: { data: any }) {
+
+let timer
+export default function WeekCalendarItem(props: { data: any, isCurrentWeek: boolean }) {
     const [charts, setCharts] = useState([])
+    const [showCurrentTime, setShowCurrentTime] = useState(false)
+    const [position, setPosition] = useState({ left: 0, top: 0 })
     useEffect(() => {
         var array: any = []
         for (var i = 0; i < 7; i++) {
@@ -41,6 +45,30 @@ export default function WeekCalendarItem(props: { data: any }) {
         setCharts(array)
     }, [])
 
+    useEffect(() => {
+        if (timer)
+            clearInterval(timer)
+        if (props.isCurrentWeek) {
+            timer = setInterval(()=>{
+                getPosition()
+            },60000)
+            getPosition()
+        }
+        setShowCurrentTime(props.isCurrentWeek)
+    }, [props.isCurrentWeek])
+
+    function getPosition() {
+        var now = new Date().getTime()
+        var start = props.data.start
+        var index = Math.floor((now - start) / (3600 * 24 * 1000))
+        var left = (now - start) % (3600 * 24 * 1000)
+        var top = left / (3600 * 24 * 1000) * 400
+        setPosition({
+            left: rpxToPx(94 * index),
+            top: rpxToPx(top)
+        })
+    }
+
     function getIntersection(start1, end1, start2, end2) {
         // 确保 start1 小于等于 end1,start2 小于等于 end2
         if (start1 > end1) {
@@ -67,23 +95,33 @@ export default function WeekCalendarItem(props: { data: any }) {
         <View style={{ height: parseInt(rpxToPx(60) + '') }}>
             <View className="chart_top_week">
                 <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(0) + '') }}>周日</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*1) + '') }}>周一</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*2) + '') }}>周二</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*3) + '') }}>周三</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*4) + '') }}>周四</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*5) + '') }}>周五</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*6) + '') }}>周六</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 1) + '') }}>周一</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 2) + '') }}>周二</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 3) + '') }}>周三</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 4) + '') }}>周四</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 5) + '') }}>周五</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 6) + '') }}>周六</Text>
             </View>
         </View>
 
         <View className="chart_detail">
+            {
+                showCurrentTime && <View style={{
+                    position: 'absolute',
+                    left: position.left,
+                    top: position.top,
+                    width: rpxToPx(94),
+                    height: 1,
+                    backgroundColor: 'red'
+                }} />
+            }
             <View className="verticalLine" style={{ left: 0 }} />
-            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94*1) + '') }} />
-            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94*2) + '') }} />
-            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94*3) + '') }} />
-            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94*4) + '') }} />
-            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94*5) + '') }} />
-            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94*6) + '') }} />
+            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 1) + '') }} />
+            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 2) + '') }} />
+            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 3) + '') }} />
+            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 4) + '') }} />
+            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 5) + '') }} />
+            <View className="verticalLine" style={{ left: parseInt(rpxToPx(94 * 6) + '') }} />
             <View className="horizontalLine" style={{ top: rpxToPx(100), backgroundColor: '#262626' }} />
             <View className="horizontalLine" style={{ top: rpxToPx(200), backgroundColor: '#383838' }} />
             <View className="horizontalLine" style={{ top: rpxToPx(300), backgroundColor: '#262626' }} />
@@ -125,13 +163,13 @@ export default function WeekCalendarItem(props: { data: any }) {
         </View>
         <View style={{ height: parseInt(rpxToPx(60) + '') }}>
             <View className="chart_bottom_week">
-            <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(0) + '') }}>周一</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*1) + '') }}>周二</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*2) + '') }}>周三</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*3) + '') }}>周四</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*4) + '') }}>周五</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*5) + '') }}>周六</Text>
-                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94*6) + '') }}>周日</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(0) + '') }}>周一</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 1) + '') }}>周二</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 2) + '') }}>周三</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 3) + '') }}>周四</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 4) + '') }}>周五</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 5) + '') }}>周六</Text>
+                <Text className="chart_week_text" style={{ left: parseInt(rpxToPx(94 * 6) + '') }}>周日</Text>
             </View>
         </View>
     </View>

+ 6 - 4
src/pages/clock/Index.tsx

@@ -94,7 +94,8 @@ export default function Page() {
             if (isPause) {
                 return
             }
-            setCount((prevCounter) => prevCounter + 1)
+            if (user.isLogin)
+                setCount((prevCounter) => prevCounter + 1)
         }, 1000)
     }, [])
 
@@ -119,11 +120,12 @@ export default function Page() {
     })
 
     useDidShow(() => {
-        if (user.isLogin)
-            refresh()
+        // if (user.isLogin)
+        //     refresh()
     })
 
     global.refreshIndex = () => {
+
         setCount((prevCounter) => prevCounter + 1)
     }
 
@@ -408,7 +410,7 @@ export default function Page() {
                 } */}
                 <DayNightCard isNight={true} switchChanged={(e) => { }} />
                 {
-                    user.isLogin && records.length > 0 && <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between',marginTop: rpxToPx(40),  }}>
+                    user.isLogin && records.length > 0 && <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginTop: rpxToPx(40), }}>
                         {
                             <Text className="discovery1" style={{ marginBottom: 0 }}>{t('feature.track_time_duration.record_fast_sleep.header.latest_record')}</Text>
                         }

+ 2 - 2
src/services/user.tsx

@@ -134,10 +134,10 @@ export const clear = () => (dispatch: any) => {
     })
 }
 
-export const latestLocation = () => {
+export const latestLocation = (params) => {
     return new Promise((resolve, reject) => {
         request({
-            url: API_USER_LOCATION, method: 'GET', data: {}
+            url: API_USER_LOCATION, method: 'GET', data: {...params}
         }).then(res => {
             return resolve(res)
             // dispatch(getInfoSuccess(res));