leon 1 سال پیش
والد
کامیت
7de4c6c6c6

+ 3 - 1
src/_health/components/fast_sleep_console.tsx

@@ -132,7 +132,9 @@ export default function FastSleepConsole(props: { step: number, data: any, del:
             showCancel: true,
             confirm: () => {
                 delRecord({ ids: array }).then(res => {
-                    global.refreshWindow()
+                    if (global.refreshWindow) {
+                        global.refreshWindow()
+                    }
                     if (global.refreshHistory)
                         global.refreshHistory()
                     props.del()

+ 14 - 11
src/_health/pages/add_moment.tsx

@@ -80,11 +80,11 @@ export default function AddMoment() {
 
     const moment = router.params.moment ? JSON.parse(router.params.moment) : null
 
-    const window = router.params.window??health.mode
+    const window = router.params.window ?? health.mode
 
     useEffect(() => {
         global.set_time = new Date().getTime()
-        
+
         getLabelsEvent({ window: window, use: is_temp ? 'ONE_RECORD' : '' }).then(res => {
             setLabels((res as any).labels)
             if (is_temp && title == '') {
@@ -101,7 +101,7 @@ export default function AddMoment() {
             var timeObj = moment.time
             setTime(dayjs(timeObj.timestamp).format('HH:mm'))
             setSelDate(dayjs(timeObj.timestamp).format('YYYY-MM-DD'))
-            
+
             if (moment.media.length > 0) {
                 setPics(moment.media)
                 // setImgUrl(moment.media[0].url)
@@ -223,7 +223,7 @@ export default function AddMoment() {
             }
         }
 
-        if (router.params.join_id){
+        if (router.params.join_id) {
             params.join_key = router.params.join_id
         }
 
@@ -294,8 +294,11 @@ export default function AddMoment() {
 
             })
 
-            global.refreshWindow()
-            global.refreshHistory()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
+            if (global.refreshHistory)
+                global.refreshHistory()
 
             if (global.postMomentSuccess) {
                 global.postMomentSuccess()
@@ -534,13 +537,13 @@ export default function AddMoment() {
         })
     }
 
-    function chooseLocation(){
+    function chooseLocation() {
         Taro.choosePoi({
             success(result) {
-                console.log('choose poi',result)
+                console.log('choose poi', result)
             },
             fail(res) {
-                console.log('choose poi failed',res)
+                console.log('choose poi failed', res)
             },
         })
         // jumpPage('/_common/pages/map')
@@ -681,9 +684,9 @@ export default function AddMoment() {
 
             </View> */}
         </View>
-        <View style={{height:rpxToPx(24)}}/>
+        <View style={{ height: rpxToPx(24) }} />
         {
-            router.params.join_id && <FollowInfo user={long.follow}/>
+            router.params.join_id && <FollowInfo user={long.follow} />
         }
 
         {/* <FollowInfo /> */}

+ 3 - 1
src/_health/pages/guide_active.tsx

@@ -270,7 +270,9 @@ export default function GuideActive() {
                                 }
                                 setList(array)
                                 check(array)
-                                global.refreshWindow()
+                                if (global.refreshWindow) {
+                                    global.refreshWindow()
+                                }
                             })
                         }}
                         onChange={(time) => {

+ 3 - 1
src/_health/pages/guide_full.tsx

@@ -50,7 +50,9 @@ export default function GuideFull() {
                 current_window: (res as any).current_window
             }
             jumpPage('./post_result?type=schedule&data=' + JSON.stringify(data))
-            global.refreshWindow()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
             setPosting(false)
         }).catch(e=>{
             setPosting(false)

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

@@ -845,7 +845,9 @@ export default function LogTime() {
 
                 delRecord({ ids: [getScenario(health.windows, window).window_id] }).then(res => {
                     Taro.eventCenter.trigger('refreshMoments', '')
-                    global.refreshWindow()
+                    if (global.refreshWindow) {
+                        global.refreshWindow()
+                    }
                     Taro.redirectTo({
                         url: `./log_time?hide_more=1&join_id=${join_id}&index=${window == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${window}&op_page=${window == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`
                     })

+ 17 - 8
src/_health/pages/long_fast.tsx

@@ -84,7 +84,9 @@ export default function LongFast() {
                 confirm: () => {
                     // 
                     updateFast({ fast_type: 'LF' }).then(res => {
-                        global.refreshWindow()
+                        if (global.refreshWindow) {
+                            global.refreshWindow()
+                        }
                     })
                 }
             })
@@ -98,7 +100,7 @@ export default function LongFast() {
     function tapLog() {
         var item = long_fast.timeline[0]
         const { event_id, schedule_id } = item
-        const {window_id} = long_fast
+        const { window_id } = long_fast
         jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&schedule_id=${schedule_id}&window_id=${window_id}&fast_type=LF&autoPost=1&op_page=LONG_FAST`)
         // jumpPage(`/_health/pages/add_moment?moment=${JSON.stringify(item)}&title=${item.title}&schedule_id=${item.schedule_id}&event_id=${item.event_id}`)
     }
@@ -142,7 +144,9 @@ export default function LongFast() {
 
     function del() {
         delRecord({ ids: [health.long_fast.window_id] }).then(res => {
-            global.refreshWindow()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
         })
     }
 
@@ -188,8 +192,11 @@ export default function LongFast() {
                 })
                 return
             }
-            global.refreshWindow()
-            global.refreshHistory()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
+            if (global.refreshHistory)
+                global.refreshHistory()
             jumpPage('/_health/pages/post_result?data=' + JSON.stringify(res))
         }).catch(e => {
         })
@@ -255,7 +262,7 @@ export default function LongFast() {
                 onClick={() => {
                     var item = long_fast.timeline[0]
                     const { event_id, schedule_id } = item
-                    const {window_id} = long_fast
+                    const { window_id } = long_fast
                     jumpPage(`/_health/pages/timeline_detail?event_id=${event_id}&schedule_id=${schedule_id}&window_id=${window_id}&fast_type=LF&op_page=LONG_FAST`)
                 }}
             >
@@ -305,7 +312,7 @@ export default function LongFast() {
                 (historyRef.current as any).more()
             }
         }}
-    ><View className="page_container" style={{minHeight:'101vh'}}>
+    ><View className="page_container" style={{ minHeight: '101vh' }}>
             <NewHeader type={NewHeaderType.left_subtitle}
                 title={t('health.long_fast')}
                 subtitle={t('health.long_fast_subtitle')}
@@ -414,7 +421,9 @@ export default function LongFast() {
 
                         updateFast({ fast_type: 'LF', long_fast_goal: duration * 60 }).then(res => {
                             setEditDuration(false)
-                            global.refreshWindow()
+                            if (global.refreshWindow) {
+                                global.refreshWindow()
+                            }
                         })
                     }}
                     themeColor={getThemeColor('FAST')}>

+ 8 - 5
src/_health/pages/long_fast_setting.tsx

@@ -52,8 +52,8 @@ export default function LongFastSetting() {
         }
         // params.requestId = enterTime
 
-        clockTimes('',{
-            requestId:enterTimestamp,
+        clockTimes('', {
+            requestId: enterTimestamp,
             check_items: [{
                 schedule_id: health.long_fast.timeline[0].schedule_id,
                 date: dayjs(now).format('YYYYMMDD'),
@@ -65,8 +65,11 @@ export default function LongFastSetting() {
                 }
             }]
         }).then(res => {
-            global.refreshWindow()
-            global.refreshHistory()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
+            if (global.refreshHistory)
+                global.refreshHistory()
 
             Taro.redirectTo({
                 url: '/_health/pages/post_result?data=' + JSON.stringify(res)
@@ -131,7 +134,7 @@ export default function LongFastSetting() {
                 color={MainColorType.fast}
                 date={date}
                 time={time}
-                change={(e)=>{
+                change={(e) => {
                     setDate(e[0])
                     if (e[0] == dayjs().format('YYYY-MM-DD')) {
                         setIsToday(true)

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

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

+ 12 - 0
src/_health/pages/recents.scss

@@ -0,0 +1,12 @@
+.streak_toolbar_btn{
+    height: 72px;
+    border-radius: 18px;
+    display: flex;
+    flex-direction: row;
+    // justify-content: center;
+    align-items: center;
+    padding-left: 48px;
+    padding-right: 48px;
+    margin-right: 12px;
+    flex-shrink: 0;
+}

+ 78 - 0
src/_health/pages/recents.tsx

@@ -0,0 +1,78 @@
+import { ScrollView, View, Text } from "@tarojs/components";
+import './recents.scss'
+import Layout from "@/components/layout/layout";
+import { useTranslation } from "react-i18next";
+import NewHeader, { NewHeaderType } from "../components/new_header";
+import { rpxToPx } from "@/utils/tools";
+import NewButton, { NewButtonType } from "../base/new_button";
+import { getThemeColor } from "@/features/health/hooks/health_hooks";
+import { MainColorType } from "@/context/themes/color";
+import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import { useRef, useState } from "react";
+import MainHistory from "@/features/health/MainHistory";
+
+export default function Recents() {
+    const [mode, setMode] = useState('EAT')
+    const { t } = useTranslation()
+    const historyRef = useRef()
+    function detail() {
+        return <View style={{ display: 'flex', flexDirection: 'column', height: '100vh' }}>
+            <NewHeader type={NewHeaderType.left} title={t('health.recents')} />
+            <ScrollView style={{ width: rpxToPx(750), flexDirection: 'row', display: 'flex', height: rpxToPx(72) }} scrollX enableFlex showScrollbar={false}>
+                <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
+                <NewButton type={NewButtonType.img} onClick={() => setMode('EAT')}>
+                    <View className="streak_toolbar_btn"
+                        style={{ backgroundColor: mode == 'EAT' ? getThemeColor('EAT') + '1A' : 'transparent' }}
+                    >
+                        <Text className={mode == 'EAT' ? 'bold h30' : 'h30'}
+                            style={{ color: mode == 'EAT' ? getThemeColor('EAT') : MainColorType.g01, marginRight: 5 }}>{t('health.eat')}</Text>
+                    </View>
+                </NewButton>
+
+                <NewButton type={NewButtonType.img} onClick={() => setMode('ACTIVE')}>
+                    <View className="streak_toolbar_btn"
+                        style={{ backgroundColor: mode == 'ACTIVE' ? getThemeColor('ACTIVE') + '1A' : 'transparent' }}
+                    >
+                        <Text className={mode == 'ACTIVE' ? 'bold h30' : 'h30'}
+                            style={{ color: mode == 'ACTIVE' ? getThemeColor('ACTIVE') : MainColorType.g01, marginRight: 5 }}>{t('health.active')}</Text>
+                    </View>
+                </NewButton>
+                <NewButton type={NewButtonType.img} onClick={() => setMode('FAST')}>
+                    <View className="streak_toolbar_btn"
+                        style={{ backgroundColor: mode == 'FAST' ? getThemeColor('FAST') + '1A' : 'transparent' }}
+                    >
+                        <Text className={mode == 'FAST' ? 'bold h30' : 'h30'}
+                            style={{ color: mode == 'FAST' ? getThemeColor('FAST') : MainColorType.g01, marginRight: 5 }}>{t('health.fast')}</Text>
+                    </View>
+                </NewButton>
+                <NewButton type={NewButtonType.img} onClick={() => setMode('SLEEP')}>
+                    <View className="streak_toolbar_btn"
+                        style={{ backgroundColor: mode == 'SLEEP' ? getThemeColor('SLEEP') + '1A' : 'transparent' }}
+                    >
+                        <Text className={mode == 'SLEEP' ? 'bold h30' : 'h30'}
+                            style={{ color: mode == 'SLEEP' ? getThemeColor('SLEEP') : MainColorType.g01, marginRight: 5 }}>{t('health.sleep')}</Text>
+                    </View>
+                </NewButton>
+                <View style={{ width: rpxToPx(40), flexShrink: 0 }} />
+            </ScrollView>
+            <View style={{height:rpxToPx(36),flexShrink:0}}/>
+            <MainHistory ref={historyRef} type={mode} updateDate={(e) => {
+                // setShowDate(e.show)
+                // setDate(e.date)
+            }} />
+        </View>
+    }
+
+    return <Layout children={detail()}
+        // title={router.params.title}
+
+        // secondPage={true}
+        // titleColor={'#fff'}
+        title={t('health.recents')}
+        type={TemplateType.customHeader}
+        // refresh={() => { refresh() }}
+        // triggered={triggered}
+        // more={() => { more() }}
+        titleShowStyle={NaviBarTitleShowType.scrollToShow}
+    />
+}

+ 6 - 2
src/_health/pages/schedules.tsx

@@ -220,7 +220,9 @@ export default function Schedules() {
             setShowAutoSave(true)
             setErrors([])
             setList((res as any).schedules)
-            global.refreshWindow()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
             // if (global.refreshSchedules) {
             //     global.refreshSchedules()
             // }
@@ -518,7 +520,9 @@ export default function Schedules() {
                                             array.splice(i, 1)
                                             setList(array)
 
-                                            global.refreshWindow()
+                                            if (global.refreshWindow) {
+                                                global.refreshWindow()
+                                            }
                                         })
                                     }}
                                 />

+ 3 - 1
src/_health/pages/schedules_edit.tsx

@@ -178,7 +178,9 @@ export default function SchedulesEdit() {
             delete_ids: delIds
         }).then(res => {
             if ((res as any).result) {
-                global.refreshWindow()
+                if (global.refreshWindow) {
+                    global.refreshWindow()
+                }
                 if (global.refreshSchedules) {
                     global.refreshSchedules()
                 }

+ 3 - 1
src/_health/pages/schedules_order.tsx

@@ -83,7 +83,9 @@ export default function SchedulesOrder() {
             array.push(item.id)
         })
         orderSchedules({ids:array}).then(res=>{
-            global.refreshWindow()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
             if (global.tempRefresh){
                 global.tempRefresh()
             }

+ 11 - 4
src/_health/pages/timeline_detail.tsx

@@ -562,8 +562,11 @@ export default function TimelineDetail() {
             getDatas()
             setImgUrl('')
             setDesc('')
-            global.refreshWindow()
-            global.refreshHistory()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
+            if (global.refreshHistory)
+                global.refreshHistory()
             setShowPop(false)
         })
 
@@ -617,7 +620,9 @@ export default function TimelineDetail() {
                 delEvents(event_id).then(res => {
                     Taro.eventCenter.trigger('refreshMoments', '')
                     Taro.navigateBack()
-                    global.refreshWindow()
+                    if (global.refreshWindow) {
+                        global.refreshWindow()
+                    }
                     if (global.refreshHistory)
                         global.refreshHistory()
                     if (global.refreshOtherHistory)
@@ -653,7 +658,9 @@ export default function TimelineDetail() {
             showCancel: true,
             confirm: () => {
                 delRecord({ ids: ids }).then(res => {
-                    global.refreshWindow()
+                    if (global.refreshWindow) {
+                        global.refreshWindow()
+                    }
                     if (global.refreshHistory)
                         global.refreshHistory()
                     if (global.refreshOtherHistory)

+ 23 - 38
src/_record/pages/log_record.tsx

@@ -124,23 +124,26 @@ export default function LogRecord() {
 
     function getTags() {
         userTags({ scenario: scenario }).then(res => {
-            var current = dayjs().format('HH:mm');
-            var isFind = false;
-            (res as any).tags.map(item => {
-                if (item.time_from && item.time_to) {
-                    if (isInTimeRange(current, item.time_from, item.time_to)) {
-                        isFind = true;
-                        setTitle(item.title)
-                        setChooseTitle(item.title)
-                        setPostCount(item.log_count + 1)
+            if (chooseTitle == '') {
+                var current = dayjs().format('HH:mm');
+                var isFind = false;
+                (res as any).tags.map(item => {
+                    if (item.time_from && item.time_to) {
+                        if (isInTimeRange(current, item.time_from, item.time_to)) {
+                            isFind = true;
+                            setTitle(item.title)
+                            setChooseTitle(item.title)
+                            setPostCount(item.log_count + 1)
+                        }
                     }
+                })
+                if (!isFind) {
+                    setTitle((res as any).tags[0].title)
+                    setChooseTitle((res as any).tags[0].title)
+                    setPostCount((res as any).tags[0].log_count + 1)
                 }
-            })
-            if (!isFind) {
-                setTitle((res as any).tags[0].title)
-                setChooseTitle((res as any).tags[0].title)
-                setPostCount((res as any).tags[0].log_count + 1)
             }
+
             setTags((res as any).tags)
         })
     }
@@ -476,9 +479,9 @@ export default function LogRecord() {
                 Taro.navigateBack();
             }
 
-            global.refreshWindow()
-            global.refreshHistory()
-            global.refreshMoment()
+            // global.refreshWindow()
+            // global.refreshHistory()
+            // global.refreshMoment()
         }).catch(e => {
             setPosting(false)
         })
@@ -573,7 +576,7 @@ export default function LogRecord() {
                 {/* <Snapshot id="temp"> */}
                 <View className="cardShowAni" style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: rpxToPx(152) }}>
                     <Image src={BASE_IMG_URL + 'tag.svg'} style={{ width: rpxToPx(96), height: rpxToPx(96), marginBottom: rpxToPx(24) }} />
-                    <View className="h50 bold" style={{ textAlign: 'center', width: rpxToPx(600) }}>选择打卡的{scenario == 'MEAL' ? '餐次' : '活动'}</View>
+                    <View className="h50 bold" style={{ textAlign: 'center', width: rpxToPx(600), }}>{scenario == 'MEAL' ? '选择打卡的餐次' : '选择打卡的活动'}</View>
                     <View className="operate_bg">
                         {
                             tags.map((item, index) => {
@@ -600,26 +603,6 @@ export default function LogRecord() {
                         <View className="operate_item h34"
                             style={{ backgroundColor: MainColorType.white_25 }}
                             onClick={() => {
-
-                                // Taro.createSelectorQuery().select('#temp').node().exec(res=>{
-                                //     console.log('9527')
-                                //     const node = res[0].node
-                                //     node.takeSnapshot({
-                                //         type:'file',
-                                //         format:'png',
-                                //         success:(res)=>{
-                                //             console.log(res)
-                                //             Taro.saveImageToPhotosAlbum({
-                                //                 filePath:res.tempFilePath
-                                //             })
-                                //         },
-                                //         fail(res){
-                                //             console.log(res)
-                                //             debugger
-                                //         }
-                                //     })
-                                // })
-                                // return
                                 setTitle('')
                                 setChooseTitle('')
                                 setPostCount(1)
@@ -640,6 +623,7 @@ export default function LogRecord() {
                         maxlength={10}
                         onInput={(e: any) => {
                             setTitle(e.target.value)
+                            setChooseTitle(e.target.value)
                         }} />
                     <View className="form_btns">
                         <View className="form_cancel">
@@ -655,6 +639,7 @@ export default function LogRecord() {
                             <NewButton btnStyle={{ flex: 1 }} type={NewButtonType.img}
                                 onClick={() => {
                                     if (title.length == 0) return
+                                    console.log(title)
                                     setChooseTitle(title)
                                     setPostCount(1)
                                     setStep(2)

+ 9 - 8
src/app.config.ts

@@ -56,6 +56,7 @@ const appConfig = defineAppConfig({
         'pages/guide_sleep',
         'pages/guide_active',
         'pages/guide_full',
+        'pages/recents'
       ]
     },
     {
@@ -98,10 +99,10 @@ const appConfig = defineAppConfig({
       ]
     }
   ],
-  preloadRule:{
-    "pages/clock/Clock":{
-      "network":"all",
-      "packages":["_record"]
+  preloadRule: {
+    "pages/clock/Clock": {
+      "network": "all",
+      "packages": ["_record"]
     }
   },
   usingComponents: {
@@ -160,10 +161,10 @@ const appConfig = defineAppConfig({
     "navigationBarTextStyle": "black",
     "backgroundColor": "#f5f5f5"
   },
-  lazyCodeLoading:"requiredComponents",
-  rendererOptions:{
-    skyline:{
-      defaultDisplayBlock:true,
+  lazyCodeLoading: "requiredComponents",
+  rendererOptions: {
+    skyline: {
+      defaultDisplayBlock: true,
       defaultContentBox: true
     }
   }

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

@@ -81,6 +81,7 @@ export default function Layout(props: {
             global.dimissSel()
         }
         if (props.titleShowStyle == NaviBarTitleShowType.scrollToShow) {
+            debugger
             if (e.nativeEvent) {
                 const { contentOffset } = e.nativeEvent
                 if (contentOffset.y > 70) {

+ 7 - 4
src/features/health/MainHistory.tsx

@@ -482,6 +482,9 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                         setSleepTotal((res as any).total)
                     }
                 }
+                else {
+                    setList(array)
+                }
 
                 setTotal((res as any).total)
                 if (props.refreshSuccess) {
@@ -723,7 +726,7 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
 
     return <View style={{ width: rpxToPx(750) }}>
 
-        {
+        {/* {
             (list.length >= 0 || health.mode == 'EAT' || health.mode == 'ACTIVE') && <View className="new_header_bg2">
                 <Text className="h50 bold">{t('health.recents')}</Text>
 
@@ -741,10 +744,10 @@ export default forwardRef((props: { type?: string, fast_type?: string, updateDat
                 }
 
             </View>
-        }
-        {
+        } */}
+        {/* {
             markDoneTip()
-        }
+        } */}
 
 
         {

+ 30 - 18
src/pages/account/Profile.tsx

@@ -39,22 +39,22 @@ export default function Page() {
     const [memberAlert, setMemberAlert] = useState(global.memberAlert)
     const [baseDeviceTime, setBaseDeviceTime] = useState(false)
     const accessObj = useSelector((state: any) => state.access);
-    const [naviTitle,setNaviTitle] = useState('')
+    const [naviTitle, setNaviTitle] = useState('')
 
     let navigation;
     if (useNavigation) {
         navigation = useNavigation()
     }
 
-    useEffect(()=>{
-        if (user.isLogin){
+    useEffect(() => {
+        if (user.isLogin) {
             checkBalance()
         }
-    },[user.isLogin])
+    }, [user.isLogin])
 
-    useDidShow(()=>{
+    useDidShow(() => {
         Taro.setNavigationBarTitle({
-            title:naviTitle
+            title: naviTitle
         })
     })
 
@@ -106,7 +106,7 @@ export default function Page() {
 
     }
 
-    function checkBalance(){
+    function checkBalance() {
         userAccess().then(res => {
             // global.offsetTimestamp = 0;
             // const { server_timestamp } = res as any
@@ -184,7 +184,7 @@ export default function Page() {
         }
         if (user.isLogin) {
             debugger
-            jumpPage(`/_account/pages/ProfileSetting?newuser=${user.is_new_user?'1':'0'}`, 'ProfileSetting', navigation)
+            jumpPage(`/_account/pages/ProfileSetting?newuser=${user.is_new_user ? '1' : '0'}`, 'ProfileSetting', navigation)
             // jumpPage('/_account/pages/ProfileSetting?newuser='+user.is_new_user?'1':'0', 'ProfileSetting', navigation)
         }
         else {
@@ -222,17 +222,21 @@ export default function Page() {
                 icon: 'none'
             })
             Taro.setStorage({ key: '148alert', data: true })
-            global.refreshWindow()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
         })
     }
 
-    function resetNewUser(){
-        resetInfo({ is_new_user:true }).then(res => {
+    function resetNewUser() {
+        resetInfo({ is_new_user: true }).then(res => {
             Taro.showToast({
                 title: '成功',
                 icon: 'none'
             })
-            global.refreshWindow()
+            if (global.refreshWindow) {
+                global.refreshWindow()
+            }
         })
     }
 
@@ -355,7 +359,7 @@ export default function Page() {
                 display: 'flex', flexDirection: 'column',
                 width: rpxToPx(750),
                 alignItems: 'center',
-                position:'relative'
+                position: 'relative'
             }}
                 onClick={() => {
                     if (!user.isLogin) {
@@ -372,9 +376,9 @@ export default function Page() {
                         <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
                             <IconVip width={rpxToPx(36)} color={MainColorType.blue} />
                             <View style={{ width: rpxToPx(8) }} />
-                            <View className="h34 bold" style={{ color: MainColorType.blue }}>{isMember()?t('page.more.pro_member'):t('health.no_vip_title')}</View>
+                            <View className="h34 bold" style={{ color: MainColorType.blue }}>{isMember() ? t('page.more.pro_member') : t('health.no_vip_title')}</View>
                         </View>
-                        <View className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(12),textAlign:'center' }}>{isMember() ? memberdesc() : t('health.no_vip_desc')}</View>
+                        <View className="h24" style={{ color: MainColorType.g02, marginTop: rpxToPx(12), textAlign: 'center' }}>{isMember() ? memberdesc() : t('health.no_vip_desc')}</View>
                         <View style={{ height: rpxToPx(18), flexShrink: 0 }} />
                     </View>
                     <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
@@ -390,6 +394,14 @@ export default function Page() {
             />
 
             <View className="profile_cell_space" /> */}
+            <IconTitleCell
+                onClick={() => {
+                    jumpPage('/_health/pages/recents')
+                }}
+                title={t('health.recents')}
+                showLine
+                icon={<Image src={require('@assets/_health/setting_album.png')} className="profile_cell_icon" />}
+            />
             <IconTitleCell
                 onClick={() => {
                     jumpPage('/_health/pages/schedules?mode=')
@@ -413,10 +425,10 @@ export default function Page() {
                 title={t('health.photos')}
                 icon={<Image src={require('@assets/_health/setting_album.png')} className="profile_cell_icon" />}
             />
-            
+
 
             <View className="profile_cell_space" />
-            
+
             <IconTitleCell
                 onClick={goCalendar}
                 title={t('health.streaks')}
@@ -481,7 +493,7 @@ export default function Page() {
             triggered={triggered}
             refresh={refresh}
             showPullToRefresh={true}
-            updateTitle={(title)=>{
+            updateTitle={(title) => {
                 setNaviTitle(title)
             }}
         >

+ 2 - 2
src/pages/clock/components/choose_actions.tsx

@@ -177,7 +177,7 @@ export default function ChooseActions(props: { close: any, quick: any, chooseTex
             </View>
         </NewButton>
 
-        <View className='cardShowAni' style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', height: rpxToPx(64), marginTop: rpxToPx(26) }}>
+        {/* <View className='cardShowAni' style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', height: rpxToPx(64), marginTop: rpxToPx(26) }}>
             <View className='or_line'/>
             <View className='white h30 bold' style={{marginLeft:rpxToPx(24),marginRight:rpxToPx(24)}}>OR</View>
             <View className='or_line'/>
@@ -186,7 +186,7 @@ export default function ChooseActions(props: { close: any, quick: any, chooseTex
 
         <NewButton type={NewButtonType.img} onClick={checkin}>
             <View className='action_btn h30 bold cardShowAni'>Quick Check in</View>
-        </NewButton>
+        </NewButton> */}
 
 
         <View className='btnAni' style={{ marginBottom: rpxToPx(84), marginTop: rpxToPx(60) }} onClick={props.close}>

+ 1 - 1
src/pages/moment/moment_item.tsx

@@ -89,7 +89,7 @@ export default function MomentItem(props: { data: any }) {
 
     return <View className="moment_item">
         <Image className="moment_avatar" src={user.avatar} mode="aspectFill" onClick={goProfile} />
-        <View className="moment_detail" onClick={goDetail}>
+        <View className="moment_detail">
             <View className="h34 bold" style={{ color: MainColorType.link, marginBottom: rpxToPx(6) }} onClick={goProfile}>{user.nickname}</View>
             {
                 moment.title && <View className="h26 g02">{moment.title}</View>

+ 3 - 1
src/pages/store/product_list.tsx

@@ -146,7 +146,9 @@ export default function ProductList() {
                 success(dt) {
                     orderCheck(order_no).then(res => {
                         dispatch(setAccessData((res as any).access))
-                        global.refreshWindow()
+                        if (global.refreshWindow) {
+                            global.refreshWindow()
+                        }
                         Taro.navigateBack({
                             delta: 1
                         })