Leon 2 年之前
父節點
當前提交
45315343a0

+ 2 - 2
ios/hola.xcodeproj/project.pbxproj

@@ -550,7 +550,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 15;
+				CURRENT_PROJECT_VERSION = 16;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -583,7 +583,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 15;
+				CURRENT_PROJECT_VERSION = 16;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

File diff suppressed because it is too large
+ 0 - 0
ios/main.jsbundle


+ 30 - 0
src/app.scss

@@ -59,6 +59,24 @@ page {
 
 .fast_bg_color {}
 
+.metric_tag_bg{
+    height: 32px;
+    padding-left: 6px;
+    padding-right: 6px;
+    border-radius: 16px;
+    background-color: #343434;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.metric_tag_text{
+    height: 32px;
+    line-height: 32px;
+    font-size: 20px;
+
+}
+
 
 
 .px1SperateWidth {
@@ -277,6 +295,18 @@ page {
     border-bottom-left-radius: 24px;
     border-bottom-right-radius: 24px;
 }
+.cell_center {
+    position: relative;
+    background-color: #1C1C1C;
+    display: flex;
+    flex-direction: row;
+    height: 96px;
+    margin-left: 46px;
+    margin-right: 46px;
+    padding-left: 40px;
+    padding-right: 40px;
+    align-items: center;
+}
 
 .cell_title {
     font-size: 28px;

+ 1 - 1
src/components/layout/layout.tsx

@@ -178,7 +178,7 @@ export default function Layout(props: {
             </View>
         case TemplateType.customHeader:
             if (process.env.TARO_ENV == 'rn') {
-                return <ScrollView onScroll={onScroll}>
+                return <ScrollView onScroll={onScroll} showsVerticalScrollIndicator={false}>
                     <View className='flex'>
                         {
                             props.header

+ 19 - 17
src/context/locales/en.js

@@ -44,15 +44,17 @@ export default {
             sleep_title: 'Sleep Schedule',
             fast_subtitle: 'Set time and duration goals',
             sleep_subtitle: 'Set time and duration goals',
-            fast_target:'断食目标',
-            fast_target_desc:'计划每日断食{{target_time}}, 其余{{left_time}}进食。',
-            fast_schedule:'断食日程',
-            fast_schedule_desc:'计划每日{{start_time}}开始断食, {{next_day}}{{end_time}}结束断食。',
-            sleep_target:'睡眠目标',
-            sleep_target_desc:'计划每日睡眠{{target_time}}, 其余{{left_time}}清醒。',
-            sleep_schedule:'睡眠日程',
-            sleep_schedule_desc:'计划每日{{start_time}}开始睡眠, {{next_day}}{{end_time}}结束睡眠。',
-            next_day:'Next day'
+            fast_target: 'Goal',
+            fast_target_desc: 'Fasting window is {{target_time}}, and eating window is {{left_time}}.',
+            fast_schedule: 'Schedule',
+            fast_schedule_desc: 'Start fasting at {{start_time}}, and end fasting {{the_next_day}} at {{end_time}}.',
+
+            sleep_target: 'Goal',
+            sleep_target_desc: 'Sleep window is {{target_time}}, and wake window is {{left_time}}.',
+            sleep_schedule: 'Schedule',
+            sleep_schedule_desc: 'Go to bed at {{start_time}}, and wake up {{the_next_day}} at {{end_time}}.',
+            next_day: 'Next day',
+            the_next_day: 'the next day'
         },
         choose_language: {
             title: '',
@@ -170,7 +172,7 @@ export default {
             common: {
                 share_title: 'My Fasting Sleep Diary',
                 start_fast: 'Start fasting',//正常态
-                started_fasting:'Started fasting',//完成时
+                started_fasting: 'Started fasting',//完成时
                 end_fast: 'End fasting',
                 ended_fasting: 'Ended fasting',
                 start_sleep: 'Start sleeping',
@@ -184,12 +186,12 @@ export default {
                 confirm: 'Got it'
             },
             status_indicator: {
-                fast_wait_for_start:'Fast',
-                fast_ongoing:'Fasting',
-                sleep_wait_for_start:'Sleep',
-                sleep_ongoing:'Sleeping',
-                sleep_ongoing1:'Sleep pending start',
-                sleep_ongoing3:'Sleep ended'
+                fast_wait_for_start: 'Fast',
+                fast_ongoing: 'Fasting',
+                sleep_wait_for_start: 'Sleep',
+                sleep_ongoing: 'Sleeping',
+                sleep_ongoing1: 'Sleep pending start',
+                sleep_ongoing3: 'Sleep ended'
 
             },
             follow_wx_pub: {
@@ -368,7 +370,7 @@ export default {
                 login_can_check: 'Record after Logging In',
                 check_unlock_data: 'Record to Unlock Trends',
                 choose_metric: 'Choose Metric',
-                choose_metric_desc:'Select metrics based on your needs.',
+                choose_metric_desc: 'Select metrics based on your needs.',
                 order: 'Adjust Order'
 
             },

+ 6 - 5
src/context/locales/zh.js

@@ -44,14 +44,15 @@ export default {
             fast_subtitle: '设定时间和时长目标',
             sleep_subtitle: '设定时间和时长目标',
             fast_target:'断食目标',
-            fast_target_desc:'计划每日断食16小时45分钟, 其余7小时15分钟进食。',
+            fast_target_desc:'计划每日断食{{target_time}}, 其余{{left_time}}进食。',
             fast_schedule:'断食日程',
-            fast_schedule_desc:'计划每日18:00开始断食, 次日10:00结束断食。',
+            fast_schedule_desc:'计划每日{{start_time}}开始断食, {{the_next_day}}{{end_time}}结束断食。',
             sleep_target:'睡眠目标',
-            sleep_target_desc:'计划每日断食16小时45分钟, 其余7小时15分钟进食。',
+            sleep_target_desc:'计划每日睡眠{{target_time}}, 其余{{left_time}}清醒。',
             sleep_schedule:'睡眠日程',
-            sleep_schedule_desc:'计划每日18:00开始断食, 次日10:00结束断食。',
-            next_day:'次日'
+            sleep_schedule_desc:'计划每日{{start_time}}开始睡眠, {{the_next_day}}{{end_time}}结束睡眠。',
+            next_day:'次日',
+            the_next_day:'次日'
 
         },
         choose_language: {

+ 3 - 1
src/features/trackSomething/components/ActivityHistory.tsx

@@ -108,7 +108,9 @@ export default function Component(props: { records: any[] }) {
         //     confirm={() => { }} />);
         // global.showModal(true, node);
     }
-    var lastYearStr = '2023年'
+
+    
+    var lastYearStr = '2025年'
 
     return <View style={{ display: 'flex', flexDirection: 'column' }}>
 

+ 17 - 0
src/features/trackSomething/components/Metric.tsx

@@ -144,6 +144,7 @@ export default function Component(props: any) {
             if (!item.latest_record) {
                 return
             }
+            global.selMetricItem = item
             jumpPage('/pages/common/RecordsHistory?type=metric&refreshList=getCards&code='
                 + item.code + `&title=${item.name}` + '&themeColor=' + item.theme_color, 'RecordsHistory', navigation, {
                 type: 'metric',
@@ -182,6 +183,18 @@ export default function Component(props: any) {
     const limitDay = 500
     const limit = new Date().getTime() - limitDay * 3600 * 1000 * 24;
 
+    //获取参考值
+    function getTargetValue(item) {
+        for (var i = 0; i < item.references.length; i++) {
+            for (var j = 0; j < item.references[i].categories.length; j++) {
+                if (item.references[i].categories[j].is_default) {
+                    return item.references[i].categories[j].value_range
+                }
+            }
+        }
+        return null
+    }
+
     function detail() {
         return <View>
 
@@ -204,6 +217,10 @@ export default function Component(props: any) {
                             value = t('feature.track_something.metric.un_login')
                             desc = t('feature.track_something.metric.login_can_check')
                         }
+                        if (getTargetValue(item)) {
+                            desc = getTargetValue(item)
+                        }
+                        // desc = '90~140/60~90 mmHg'
                         return <MetricItem title={item.name}
                             value={value}
                             unit={unit}

+ 62 - 1
src/features/trackSomething/components/MetricHistory.tsx

@@ -5,10 +5,14 @@ import { deleteMetricRecord } from "@/services/trackSomething";
 import { useEffect, useState } from "react";
 import { useSelector } from "react-redux";
 import { TimeFormatter } from "@/utils/time_format";
+import { ColorType } from "@/context/themes/color";
+import { rpxToPx } from "@/utils/tools";
+import Taro from "@tarojs/taro";
 
 export default function Component(props: { records: any[] }) {
     const user = useSelector((state: any) => state.user);
     const [list, setList] = useState(props.records)
+    const [selReference, setSelReference] = useState(global.selMetricItem && global.selMetricItem.references.length > 0 ? global.selMetricItem.references[0] : null)
     useEffect(() => {
         setList(props.records)
     }, [props.records])
@@ -60,11 +64,68 @@ export default function Component(props: { records: any[] }) {
         })
     }
 
-    var lastYearStr = '2023年'
+    function showMore() {
+        var list:any = []
+        global.selMetricItem.references.map((item)=>{
+            list.push((item as any).standard)
+        })
+        Taro.showActionSheet({
+            itemList: list,
+            success: function (res) {
+                // console.log(res.tapIndex)
+                setSelReference(global.selMetricItem.references[res.tapIndex])
+            },
+            fail: function (res) {
+                console.log(res.errMsg)
+            }
+        })
+    }
+
+    function metricStandard() {
+        if (global.selMetricItem && global.selMetricItem.references.length > 0) {
+            return <View style={{ display: 'flex', flexDirection: 'column', position: 'relative' }}>
+                <Text className="cell_header">{selReference.standard}</Text>
+                <Text onClick={showMore} style={{ color: global.selMetricItem.theme_color, position: 'absolute', right: rpxToPx(86), top: -rpxToPx(10) }}>More</Text>
+                {
+                    selReference.categories.map((item, index) => {
+                        var cellClassName = 'cell_full'
+                        var showLine = false
+                        if (selReference.categories.length > 1) {
+                            if (index == 0) {
+                                cellClassName = 'cell_top'
+                                showLine = true
+                            }
+                            else if (index == selReference.categories.length - 1) {
+                                cellClassName = 'cell_bottom'
+                                showLine = false
+                            }
+                            else {
+                                cellClassName = 'cell_center'
+                                showLine = true
+                            }
+                        }
+                        return <View className={cellClassName} key={index}>
+                            <Text className="cell_title" style={{ color: global.selMetricItem.theme_color }}>{item.value_range}</Text>
+                            <Text className="cell_value" style={{ color: '#fff' }}>{item.category}</Text>
+                            {
+                                showLine && <View className="cell_line" style={{ height: 1 }} />
+                            }
+                        </View>
+                    })
+                }
+
+            </View>
+        }
+    }
+
+    var lastYearStr = '2025年'
     return <View style={{ display: 'flex', flexDirection: 'column' }}>
         {
             user.test_user && <Text style={{ color: '#fff', position: 'absolute', right: 50, top: 0 }} onClick={() => global.clearHistory()}>删除全部</Text>
         }
+        {
+            metricStandard()
+        }
         {
             (list as any).map(item => {
                 var showYear = lastYearStr != TimeFormatter.getYearByDate(item.date)

+ 10 - 1
src/features/trackSomething/components/MetricItem.scss

@@ -14,6 +14,14 @@
     margin-bottom: 20px;
 }
 
+.metric_title_bg{
+    position: relative;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+
+}
+
 .metric_title {
     font-size: 36px;
     line-height: 36px;
@@ -56,8 +64,9 @@
 }
 
 .mteric_desc {
-    font-size: 28px;
+    font-size: 24px;
     line-height: 28px;
+    letter-spacing: -2px;
     height: 28px;
     color: #ffffff;
     opacity: 0.4;

+ 10 - 1
src/features/trackSomething/components/MetricItem.tsx

@@ -37,7 +37,16 @@ export default function Component(props: {
     }
 
     return <View className="metric_bg">
-        <Text className="metric_title" style={{ color: props.themeColor }} onClick={() => props.onClickDetail()}>{props.title}</Text>
+        <View className="metric_title_bg">
+            <Text className="metric_title"
+                style={{ color: props.themeColor }}
+                onClick={() => props.onClickDetail()}>{props.title}</Text>
+            <View style={{ flex: 1 }} />
+            <View className="metric_tag_bg">
+                <Text className="metric_tag_text" style={{color:props.themeColor}}>复合</Text>
+            </View>
+        </View>
+
         <View className="metric_value_bg" onClick={() => props.onClickDetail()}>
             {
                 props.valueView ? props.valueView : <Text className="metric_value">{props.value}<Text className="metric_unit">{props.unit}</Text></Text>

+ 2 - 2
src/features/trackSomething/components/MoveOrderList.weapp.tsx

@@ -187,7 +187,7 @@ export default function Component(props: { array: any, itemHeight: number, color
             <View>
                 {
                     list.map((item, index) => {
-                        return <View key={index} style={{ opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: rpxToPx(750),backgroundColor:'pink' }}
+                        return <View key={index} style={{ opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: rpxToPx(750) }}
                             onLongPress={(e) => longPress(e, index)}
                             onTouchMove={(e) => touchMove(e)}
                             onTouchEnd={(e) => touchEnd(e)}
@@ -209,7 +209,7 @@ export default function Component(props: { array: any, itemHeight: number, color
                     })
                 }
 
-                <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: rpxToPx(750),backgroundColor:'red' }}
+                <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: rpxToPx(750) }}
                     direction='vertical'
                     disabled
                     animation={false}

+ 4 - 4
src/features/trackTimeDuration/components/SetSchedule.rn.tsx

@@ -409,12 +409,12 @@ export default function Component() {
                     <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                 </View>
                 <Text className="cell_footer">{scenario.step == 'fast' ? t('page.set_schedule.fast_schedule_desc', {
-                    start_time: startTime, end_time: endTime, next_day:
-                        isNextDay ? t('page.set_schedule.next_day') : ''
+                    start_time: startTime, end_time: endTime, the_next_day:
+                        isNextDay ? t('page.set_schedule.the_next_day') : ''
                 }) :
                     t('page.set_schedule.sleep_schedule_desc', {
-                        start_time: startTime, end_time: endTime, next_day:
-                            isNextDay ? t('page.set_schedule.next_day') : ''
+                        start_time: startTime, end_time: endTime, the_next_day:
+                            isNextDay ? t('page.set_schedule.the_next_day') : ''
                     })}</Text>
                 {/* <Text className="cell_footer">计划每日18:00开始断食,次日10:00结束断食。</Text> */}
             </View>

+ 1 - 1
src/pages/account/Setting.tsx

@@ -61,7 +61,7 @@ export default function Page() {
 
     return <View style={{ color: '#fff', display: 'flex', flexDirection: 'column', flex: 1 }}>
         <View style={{ height: 20 }} />
-        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>1.3.2</Text></TableCell>
+        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>1.3.3</Text></TableCell>
         {/* <Text style={{color:'#9E9E9E',textAlign:'center',fontSize:14}}>v1.2.2</Text> */}
         {
             process.env.TARO_ENV == 'rn' && <View style={{ flex: 1 }} />

+ 20 - 1
src/pages/clock/demoA.tsx

@@ -11,7 +11,25 @@ import AppleHealthKit, {
 /* Permission options */
 const permissions = {
     permissions: {
-        read: [AppleHealthKit.Constants.Permissions.Steps],
+        read: [AppleHealthKit.Constants.Permissions.Steps,
+            AppleHealthKit.Constants.Permissions.HeartRate,
+            AppleHealthKit.Constants.Permissions.BloodGlucose,
+            AppleHealthKit.Constants.Permissions.BloodPressureDiastolic,
+            AppleHealthKit.Constants.Permissions.BloodPressureSystolic,
+            AppleHealthKit.Constants.Permissions.ActiveEnergyBurned,
+            // AppleHealthKit.Constants.Permissions.AllergyRecord,
+            AppleHealthKit.Constants.Permissions.AppleStandTime,
+            AppleHealthKit.Constants.Permissions.BloodType,
+            AppleHealthKit.Constants.Permissions.BiologicalSex,
+            AppleHealthKit.Constants.Permissions.BloodGlucose,
+            AppleHealthKit.Constants.Permissions.FatTotal,
+            AppleHealthKit.Constants.Permissions.Iron,
+            AppleHealthKit.Constants.Permissions.StepCount,
+            AppleHealthKit.Constants.Permissions.VitaminA,
+            AppleHealthKit.Constants.Permissions.VitaminC,
+            AppleHealthKit.Constants.Permissions.VitaminD,
+            // AppleHealthKit.Constants.Permissions.VitalSignRecord,
+        ],
         write: [AppleHealthKit.Constants.Permissions.Steps],
     },
 } as HealthKitPermissions
@@ -49,6 +67,7 @@ export default function DemoA() {
         const options = {
             startDate: new Date(2024, 1, 2).toISOString(),
         }
+        // AppleHealthKit.getDailyStepCountSamples
         AppleHealthKit.getStepCount(options, (error: string, results: HealthValue) => {
             if (!error){
                 setSteps(results.value+'')

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

@@ -1,4 +1,4 @@
-let online = process.env.TARO_ENV=='rn'?false:true;
+let online = process.env.TARO_ENV=='rn'?false:false;
 export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 export let imgUrl = online
     ? 'https://api.fast.liveplus.fun/static/image/'

Some files were not shown because too many files changed in this diff