leon 1 年之前
父节点
当前提交
2928698f0f

+ 4 - 4
src/_health/components/fast_sleep_popup.tsx

@@ -57,7 +57,7 @@ export default function FastSleepPopup(props: { close: any, data: any,top?:numbe
             return <View className="time_count h30 bold" style={{ backgroundColor: MainColorType.error }}>00:00:00</View>
         }
         if (status == 'WFS') {
-            return <View className="g02 h24 bold">{TimeFormatter.calculateTimeDifference(fast.target.start_timestamp, sleep.target.start_timestamp,false,true)}</View>
+            return <View className="g02 h24 bold" style={{ color: MainColorType.fast }}>{TimeFormatter.calculateTimeDifference(fast.target.start_timestamp, sleep.target.start_timestamp,false,true)}</View>
         }
         else if (status == 'OG1') {
             return <View className="time_count h30 bold" style={{ backgroundColor: MainColorType.fast }}>{TimeFormatter.countdown(fast.real.start_timestamp)}</View>
@@ -70,8 +70,8 @@ export default function FastSleepPopup(props: { close: any, data: any,top?:numbe
 
     function step2() {
         const { fast, sleep, status } = props.data
-        if (status == 'WFS') {
-            return <View className="g02 h24 bold">{TimeFormatter.calculateTimeDifference(sleep.target.start_timestamp, sleep.target.end_timestamp,false,true)}</View>
+        if (status == 'WFS' ) {
+            return <View className="g02 h24 bold" style={{ color: MainColorType.sleep }}>{TimeFormatter.calculateTimeDifference(sleep.target.start_timestamp, sleep.target.end_timestamp,false,true)}</View>
         }
         if (status == 'OG1') {
             return <View className="time_count h30 bold" style={{ backgroundColor: MainColorType.g03 }}>00:00:00</View>
@@ -89,7 +89,7 @@ export default function FastSleepPopup(props: { close: any, data: any,top?:numbe
     function step3() {
         const { fast, sleep, status } = props.data
         if (status == 'WFS') {
-            return <View className="g02 h24 bold">{TimeFormatter.calculateTimeDifference(sleep.target.end_timestamp, fast.target.end_timestamp,false,true)}</View>
+            return <View className="g02 h24 bold" style={{ color: MainColorType.fast }}>{TimeFormatter.calculateTimeDifference(sleep.target.end_timestamp, fast.target.end_timestamp,false,true)}</View>
         }
         if (status == 'OG1' || status == 'OG2_NO1' || status == 'OG2') {
             return <View className="time_count h30 bold" style={{ backgroundColor: MainColorType.g03 }}>00:00:00</View>

+ 1 - 1
src/_health/pages/add_moment.tsx

@@ -490,7 +490,7 @@ export default function AddMoment() {
                     text={getDate() + time}>
                     <IconCheck color="#fff" width={rpxToPx(24)} height={24} />
                 </StatusIndicator>
-                <View className="h22" style={{ color: MainColorType.link, marginTop: rpxToPx(8) }}>编辑打卡</View>
+                <View className="h22" style={{ color: MainColorType.link, marginTop: rpxToPx(8) }}>{t('health.edit_time')}</View>
 
             </View>
 

+ 1 - 1
src/_health/pages/log_time.tsx

@@ -975,7 +975,7 @@ export default function LogTime() {
                                 type={expandIndex == -1 ? NewButtonType.alpha : NewButtonType.gray}
                                 color={isFast ? MainColorType.fast : MainColorType.sleep}
                                 height={rpxToPx(84)}
-                                width={rpxToPx(218)}
+                                width={rpxToPx(238)}
                                 title={durationTime()}
                                 fontNormal
                                 onClick={() => { setExpandIndex(-1) }}

+ 1 - 1
src/_health/pages/post_result.tsx

@@ -219,7 +219,7 @@ export default function PostResult() {
                     if (data.current_window) {
                         
                         Taro.navigateBack({
-                            delta: 10
+                            delta: Taro.getCurrentPages().length-1
                         })
                     }
                     else {

+ 1 - 1
src/_health/pages/timeline_detail.tsx

@@ -684,7 +684,7 @@ export default function TimelineDetail() {
                     })
                 }
                 {
-                    isfastsleep == '1' && history && detail.windows && <TargetProgress
+                    isfastsleep == '1' && history && detail.windows && detail.windows.length>=2 && <TargetProgress
                         onClick={showFastSleepPopDetail}
                         showRing={true}
                         doubleRing={true}

+ 4 - 0
src/app.scss

@@ -697,4 +697,8 @@ page {
 
 .italic{
     font-style: italic;
+}
+
+.blur_bg{
+    filter: blur(20px) brightness(50%);
 }

+ 4 - 1
src/context/locales/en.js

@@ -1017,6 +1017,9 @@ export default {
         
         discover:'Discover',
         this_week:'This Week',
-        me:'Me'
+        me:'Me',
+
+        edit_time:'Edit Time',
+        
     }
 }

+ 2 - 1
src/context/locales/zh.js

@@ -1019,6 +1019,7 @@ export default {
 
         discover:'发现',
         this_week:'本周',
-        me:'我'
+        me:'我',
+        edit_time:'编辑时间',
     }
 }

+ 1 - 1
src/pages/account/Journal.config.ts

@@ -9,5 +9,5 @@ export default definePageConfig({
   },
   "disableScroll": true,
   "navigationBarTitleText": "",
-  "navigationBarBackgroundColor": "#f5f5f5"
+  "navigationBarBackgroundColor": "#ffffff"
 })

+ 36 - 22
src/pages/account/Journal.tsx

@@ -161,35 +161,49 @@ export default function Journal() {
         myScrollTop = e.detail.scrollTop
         setPageTop(top)
 
-        if (top > 60) {
-
-            Taro.setNavigationBarTitle({
-                title: pageTitle()
-            })
-        }
-        else {
-            Taro.setNavigationBarTitle({
-                title: ''
-            })
-        }
 
 
+        var showT = false
         if (itemLayouts.length > 0) {
             var i = -1
             var dt = ''
             journals.forEach((item, index) => {
                 if (top >= itemLayouts[index] - 50) {
                     i = index
-                    dt = global.language=='en'?dayjs(item.timestamp).format('MMMM YYYY'):dayjs(item.timestamp).format('YYYY年M月')
+                    dt = global.language == 'en' ? dayjs(item.timestamp).format('MMMM YYYY') : dayjs(item.timestamp).format('YYYY年M月')
                 }
             })
 
             setShowDate(i != -1)
             setDate(dt)
+            showT = i != -1
+
         }
         else {
             setShowDate(false)
             setDate('')
+            showT = false
+
+        }
+
+        if (showT) {
+            Taro.setNavigationBarTitle({
+                title: pageTitle()
+            })
+            Taro.setNavigationBarColor({
+                backgroundColor: '#f5f5f5',
+                frontColor: '#000000'
+            })
+
+        }
+        else {
+            Taro.setNavigationBarTitle({
+                title: ''
+            })
+            Taro.setNavigationBarColor({
+                backgroundColor: '#ffffff',
+                frontColor: '#000000'
+            })
         }
 
         // if (itemLayouts.length > 0 && itemLayouts[0] > top) {
@@ -476,10 +490,10 @@ export default function Journal() {
         return t('health.title_journal')
     }
 
-    function pageYear(){
+    function pageYear() {
         if (!loaded) return ''
-        if (journals.length==0) return global.language == 'en'?dayjs().format('YYYY'):dayjs().format('YYYY年')
-        if (journals[0].timestamp) return global.language == 'en'?dayjs(journals[0].timestamp).format('YYYY'):dayjs(journals[0].timestamp).format('YYYY年')
+        if (journals.length == 0) return global.language == 'en' ? dayjs().format('YYYY') : dayjs().format('YYYY年')
+        if (journals[0].timestamp) return global.language == 'en' ? dayjs(journals[0].timestamp).format('YYYY') : dayjs(journals[0].timestamp).format('YYYY年')
         return ''
     }
 
@@ -578,7 +592,7 @@ export default function Journal() {
     //     <View>长列表后面的内容</View>
     // </recycle-view>
 
-    function itemData(index,item) {
+    function itemData(index, item) {
         if (itemLayouts.length >= index + 1 && index > 5) {
             if (Math.abs(itemLayouts[index] - pageTop) > 2500) {
                 return <View style={{ height: itemHeights[index] }} id={`history-${index}`}>
@@ -589,9 +603,9 @@ export default function Journal() {
         return <View className="history_item2" id={`history-${index}`} onClick={() => {
             jumpPage('/pages/account/JournalDetail?date=' + item.date + '&window=' + window) //JSON.stringify(item))
         }}>
-            <TimelineDate 
+            <TimelineDate
                 timestamp={item.timestamp}
-                pre_timestamp={index>0?journals[index - 1].timestamp:null}
+                pre_timestamp={index > 0 ? journals[index - 1].timestamp : null}
                 isJournal
             />
             {/* <View className="cell_date" >
@@ -619,7 +633,7 @@ export default function Journal() {
         }}
     ><View style={{ display: 'flex', flexDirection: 'column', minHeight: rpxToPx(464), backgroundColor: '#f5f5f5' }}>
 
-            <NewHeader type={NewHeaderType.left} title={pageYear()} whiteBg/>
+            <NewHeader type={NewHeaderType.left} title={pageYear()} whiteBg />
             {
                 markDoneTip()
             }
@@ -633,10 +647,10 @@ export default function Journal() {
                                 historyYear(index)
                             }
                             {
-                                itemData(index,item)
+                                itemData(index, item)
                             }
-                            </View>
-                            
+                        </View>
+
                     })
                 }
                 {

+ 8 - 0
src/pages/account/Profile.tsx

@@ -38,12 +38,20 @@ export default function Page() {
     const [memberAlert, setMemberAlert] = useState(global.memberAlert)
     const [baseDeviceTime, setBaseDeviceTime] = useState(false)
     const accessObj = useSelector((state: any) => state.access);
+    const [didShow,setDidShow] = useState(false)
 
     let navigation;
     if (useNavigation) {
         navigation = useNavigation()
     }
 
+    useDidShow(()=>{
+        setDidShow(true)
+        setTimeout(()=>{
+            setDidShow(false)
+        },1000)
+    })
+
     useEffect(() => {
         if (process.env.TARO_ENV == 'weapp') {
             var status = Taro.getStorageSync('isDebug')