Leon 2 سال پیش
والد
کامیت
5a1aa21b80

+ 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 = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				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 = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
ios/main.jsbundle


+ 93 - 34
src/components/input/Slider.scss

@@ -46,6 +46,7 @@
     // height: 100%;
 }
 
+/* #ifdef weapp */
 .slider-top {
     position: absolute;
     width: 100%;
@@ -57,11 +58,101 @@
     position: absolute;
     width: 100%;
     background-color: transparent;
-    // background-color: #00ffff;
     bottom: 0;
     transition: height 0.2s;
 }
 
+.slider-tip-desc {
+    margin-top: 12px;
+    font-size: 20px;
+    line-height: 24px;
+    background: linear-gradient(90deg, $fastColor 0%, #fff 100%);
+    -webkit-background-clip: text;
+    background-clip: text;
+    color: transparent;
+}
+
+.slider-tip-desc-post {
+    margin-top: 12px;
+    font-size: 20px;
+    line-height: 24px;
+    background: linear-gradient(90deg, #fff 0%, $foodColor 100%);
+    -webkit-background-clip: text;
+    background-clip: text;
+    color: transparent;
+}
+
+.tooltip_title {
+    font-size: 32px;
+    line-height: 40px;
+    letter-spacing: 0.05em;
+    color: #fff;
+    font-weight: bold;
+}
+
+.tooltip_desc {
+    margin-top: 20px;
+    font-size: 28px;
+    line-height: 40px;
+    letter-spacing: 0.05em;
+    color: #fff;
+    opacity: 0.6;
+}
+
+/* #endif */
+
+/* #ifdef rn */
+.slider-top {
+    position: absolute;
+    width: 100%;
+    background-color: #000;
+}
+
+.slider-bar {
+    position: absolute;
+    width: 100%;
+    background-color: transparent;
+    bottom: 0;
+}
+
+.slider-tip-desc {
+    margin-top: 12px;
+    font-size: 20px;
+    line-height: 24px;
+    // background: linear-gradient(90deg, $fastColor 0%, #fff 100%);
+    -webkit-background-clip: text;
+    background-clip: text;
+    color: transparent;
+}
+
+.slider-tip-desc-post {
+    margin-top: 12px;
+    font-size: 20px;
+    line-height: 24px;
+    // background: linear-gradient(90deg, #fff 0%, $foodColor 100%);
+    -webkit-background-clip: text;
+    background-clip: text;
+    color: transparent;
+}
+
+.tooltip_title {
+    font-size: 32px;
+    line-height: 40px;
+    // letter-spacing: 0.05em;
+    color: #fff;
+    font-weight: bold;
+}
+
+.tooltip_desc {
+    margin-top: 20px;
+    font-size: 28px;
+    line-height: 40px;
+    // letter-spacing: 0.05em;
+    color: #fff;
+    opacity: 0.6;
+}
+/* #endif */
+
 .slider-handle {
     position: absolute;
     bottom: 0;
@@ -132,22 +223,7 @@
     flex-direction: column;
 }
 
-.tooltip_title {
-    font-size: 32px;
-    line-height: 40px;
-    letter-spacing: 0.05em;
-    color: #fff;
-    font-weight: bold;
-}
 
-.tooltip_desc {
-    margin-top: 20px;
-    font-size: 28px;
-    line-height: 40px;
-    letter-spacing: 0.05em;
-    color: #fff;
-    opacity: 0.6;
-}
 
 .tooltip_arrow {
     width: 0;
@@ -179,15 +255,7 @@
     color: $fastColor;
 }
 
-.slider-tip-desc {
-    margin-top: 12px;
-    font-size: 20px;
-    line-height: 24px;
-    background: linear-gradient(90deg, $fastColor 0%, #fff 100%);
-    -webkit-background-clip: text;
-    background-clip: text;
-    color: transparent;
-}
+
 
 .slider-tip-title-post {
     font-size: 32px;
@@ -196,12 +264,3 @@
     color: $foodColor;
 }
 
-.slider-tip-desc-post {
-    margin-top: 12px;
-    font-size: 20px;
-    line-height: 24px;
-    background: linear-gradient(90deg, #fff 0%, $foodColor 100%);
-    -webkit-background-clip: text;
-    background-clip: text;
-    color: transparent;
-}

+ 5 - 1
src/components/input/SlidngScale.tsx

@@ -242,7 +242,11 @@ export default function Component(props: {
 
     return <View className="slidng">
         <View className="number_bg" style={{ opacity: enableText ? 1 : 0.4 }}>
-            <Text className="number" style={{fontFamily:"PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;"}}>{current}</Text>
+            {
+                process.env.TARO_ENV == 'weapp'?<Text className="number" style={{fontFamily:"PingFang SC,Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;"}}>{current}</Text>:
+                <Text className="number">{current}</Text>
+            }
+            
             <Text className="unit">{props.unit}</Text>
         </View>
 

+ 12 - 3
src/components/input/Switch.tsx

@@ -3,6 +3,7 @@ import './Switch.scss'
 import { IconSwitchOff } from "../basic/Icons";
 import { rpxToPx } from "@/utils/tools";
 export default function Component(props: { isOn: boolean, onClick: Function }) {
+    // alert('aa')
     if (process.env.TARO_ENV == 'weapp') {
         return <View className="switch1" style={{ backgroundColor: global.isDebug ? 'blue' : 'transparent' }} onClick={(e) => {
             if (process.env.TARO_ENV == 'weapp') {
@@ -19,10 +20,18 @@ export default function Component(props: { isOn: boolean, onClick: Function }) {
                 src={require(props.isOn ? '@/assets/images/switch.png' : '@/assets/images/switch.png')} /> */}
         </View>
     }
-    return <View onClick={(e) => {
+    return <View className="switch1" style={{ backgroundColor: global.isDebug ? 'blue' : 'transparent' }} onClick={(e) => {
+         props.onClick()
+    }}>
 
-        props.onClick()
-    }}></View>
+        {
+            props.isOn ? <Image src={require('@/assets/images/bell.png')} style={{ height: rpxToPx(56), width: rpxToPx(56) }} /> :
+                <Image src={require('@/assets/images/switch_off.png')} style={{ height: rpxToPx(56), width: rpxToPx(92) }} />
+        }
+
+        {/* <Image className="switch2" style={{ backgroundColor:'blue' }}
+            src={require(props.isOn ? '@/assets/images/switch.png' : '@/assets/images/switch.png')} /> */}
+    </View>
 
 
 }

+ 0 - 1
src/features/food/FoodJournal.tsx

@@ -212,7 +212,6 @@ export default function Component() {
             tempFirst = null
         }
         return <View style={{ position: 'relative', marginTop: rpxToPx(52) }}>
-            {/* <Timer /> */}
             {
                 (loaded || !user.isLogin) && <FoodConsole addItem={addItem} firstItem={tempFirst} />
             }

+ 34 - 24
src/features/trackSomething/components/Metric.tsx

@@ -211,7 +211,7 @@ export default function Component(props: any) {
                     })
                 }
                 {
-                    user.isLogin && list.length>0 && <View className="add_more" onClick={chooseMore}>
+                    user.isLogin && list.length > 0 && <View className="add_more" onClick={chooseMore}>
                         <Image style={{ width: rpxToPx(48), height: rpxToPx(48) }} src={require('@assets/images/add2.png')} />
                         <Text className="add_more_text">添加更多</Text>
                     </View>
@@ -421,6 +421,38 @@ export default function Component(props: any) {
         }
     }
 
+    function modalContent() {
+        if (showPageContainer) {
+            if (process.env.TARO_ENV == 'weapp') {
+                return <Modal dismiss={() => {
+                    onPageContainerCancel()
+                    setShowPageContainer(false)
+                }} confirm={() => { }}>
+                    {
+                        metricModalContent()
+                    }
+                </Modal>
+            }
+            else if (process.env.TARO_ENV == 'rn') {
+                return <PageContainer style={{ backgroundColor: '#1c1c1c' }}
+                    overlayStyle={{ backgroundColor: 'rgba(0,0,0,0.9)' }}
+                    customStyle={{ backgroundColor: '#1c1c1c' }}
+                    closeOnSlideDown={false}
+                    show={showPageContainer} round={true} overlay={true} position='bottom'
+                    onClickOverlay={onPageContainerCancel}
+                    onAfterLeave={() => { setShowPageContainer(false); setModalType(MetricModalType.none) }}
+                    onBeforeEnter={() => { dispatch(setTabbarStatus(false)); Taro.hideTabBar() }}
+                    onBeforeLeave={() => { dispatch(setTabbarStatus(true)); Taro.showTabBar() }}
+                >
+                    {
+                        metricModalContent()
+                    }
+                </PageContainer>
+            }
+        }
+        return <View />
+    }
+
     return <View style={{ position: 'relative' }}>
         <Layout children={showErrorPage ? <NoData refresh={() => { getCards() }} /> : detail()}
             title={t('page.metric.title')}
@@ -430,31 +462,9 @@ export default function Component(props: any) {
             triggered={triggered}
             titleShowStyle={NaviBarTitleShowType.scrollToShow}
         />
-
         {
-            showPageContainer && <Modal dismiss={() => {
-                onPageContainerCancel()
-                setShowPageContainer(false)
-            }} confirm={() => { }}>
-                {
-                    metricModalContent()
-                }
-            </Modal>
+            modalContent()
         }
-        {/* <PageContainer style={{ backgroundColor: '#1c1c1c' }}
-            overlayStyle='background-color:rgba(0,0,0,0.9)'
-            custom-style='background-color:#1c1c1c'
-            closeOnSlideDown={false}
-            show={showPageContainer} round={true} overlay={true} position='bottom'
-            onClickOverlay={onPageContainerCancel}
-            onAfterLeave={() => { setShowPageContainer(false); setModalType(MetricModalType.none) }}
-            onBeforeEnter={() => { dispatch(setTabbarStatus(false));Taro.hideTabBar() }}
-            onBeforeLeave={() => { dispatch(setTabbarStatus(true));Taro.showTabBar() }}
-        >
-            {
-                metricModalContent()
-            }
-        </PageContainer> */}
     </View>
 
 }

+ 0 - 2
src/features/trackSomething/components/MetricModalChoose.tsx

@@ -37,8 +37,6 @@ export default function Component(props: {
         for (var i = 0; i < newList.length; i++) {
             array.push(newList[i])
         }
-        console.log(oldList, newList, array)
-        debugger
         props.confirm(oldList, newList, array, list)
     }
 

+ 53 - 46
src/features/trackSomething/components/MoveOrderList.tsx

@@ -4,6 +4,7 @@ import { useEffect, useRef, useState } from 'react';
 import { ColorType } from '@/context/themes/color';
 import Taro from '@tarojs/taro';
 import { IconDrag } from '@/components/basic/Icons';
+import { rpxToPx } from '@/utils/tools';
 
 export default function Component(props: { array: any, itemHeight: number, color?: string, update: Function }) {
     const [list, setList] = useState(props.array)
@@ -27,12 +28,18 @@ export default function Component(props: { array: any, itemHeight: number, color
     const ref = useRef(null)
 
     useEffect(() => {
-        const query = Taro.createSelectorQuery();
-        query.select('#myScrollView').boundingClientRect();
-        query.exec((res) => {
-            setContentY(res[0].top)
-            setContentHeight(res[0].height)
-        })
+        if (process.env.TARO_ENV == 'weapp') {
+            const query = Taro.createSelectorQuery();
+            query.select('#myScrollView').boundingClientRect();
+            query.exec((res) => {
+                setContentY(res[0].top)
+                setContentHeight(res[0].height)
+            })
+        }
+        else {
+
+        }
+
     }, [])
 
     function longPress(e, index) {
@@ -174,49 +181,49 @@ export default function Component(props: { array: any, itemHeight: number, color
             return -1;  // 上滑
         }
     }
-
-    console.log(list)
     return <View id="myScrollView" ref={ref} style={{ height: '100%', overflow: canScroll ? 'scroll' : 'hidden' }} catchMove>
-        <MovableArea style={{ height: list.length * props.itemHeight, width: '100vw' }}>
-            {list.map((item, index) => {
-                return <View style={{ opacity: changedIndex == index && hiddenContent ? 0 : 1, height: props.itemHeight, width: '100vw' }}
-                    onLongPress={(e) => longPress(e, index)}
-
-                    onTouchMove={(e) => touchMove(e)}
-                    onTouchEnd={(e) => touchEnd(e)}
-                >
-                    <View className='modal_order_item' style={{ height: 40,flexDirection:'column' }}>
-                        <View style={{
-                            height: 40,
-                            display: 'flex', flexDirection: 'row',
-                            width:'100%',
-                            alignItems: 'center', justifyContent: 'space-between'
-                        }}>
-                            <Text style={{ color: props.color }}>{item.name}</Text>
-                            <IconDrag width={17} height={12} />
-                            
+        <MovableArea style={{ height: list.length * props.itemHeight, width: rpxToPx(750) }}>
+            <View>
+                {
+                    list.map((item, index) => {
+                        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)}
+                        >
+                            <View className='modal_order_item' style={{ height: 40, flexDirection: 'column' }}>
+                                <View style={{
+                                    height: 40,
+                                    display: 'flex', flexDirection: 'row',
+                                    width: '100%',
+                                    alignItems: 'center', justifyContent: 'space-between'
+                                }}>
+                                    <Text style={{ color: props.color }}>{item.name}</Text>
+                                    <IconDrag width={17} height={12} />
+
+                                </View>
+                                <View className='seperate' />
+                            </View>
                         </View>
-                        <View className='seperate' />
-
-                        {/* <Image src={require('@assets/images/menu.png')} style={{width:20,height:20}}/> */}
+                    })
+                }
+
+                <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: rpxToPx(750) }}
+                    direction='vertical'
+                    disabled
+                    animation={false}
+                    y={movaleViewY}
+                >
+                    <View className='drag_item' style={{ backgroundColor: props.color }}>
+                        {
+                            dragIndex >= 0 && <View className='modal_sel_item' style={{ height: 40, border: 'none' }}>
+                                <Text style={{ color: 'black', fontWeight: 'bold' }}>{list[changedIndex].name}</Text>
+                                <IconDrag width={17} height={12} />
+                            </View>
+                        }
                     </View>
-                </View>
-            })}
-            <MovableView style={{ height: changedIndex >= 0 ? props.itemHeight : 0, width: '100vw' }}
-                direction='vertical'
-                disabled
-                animation={false}
-                y={movaleViewY}
-            >
-                <View className='drag_item' style={{ backgroundColor: props.color }}>
-                    {
-                        dragIndex >= 0 && <View className='modal_sel_item' style={{ height: 40, border: 'none' }}>
-                            <Text style={{ color: 'black', fontWeight: 'bold' }}>{list[changedIndex].name}</Text>
-                            <IconDrag width={17} height={12} />
-                        </View>
-                    }
-                </View>
-            </MovableView>
+                </MovableView>
+            </View>
         </MovableArea>
     </View>
 }

+ 54 - 4
src/features/trackTimeDuration/components/Schedule.tsx

@@ -1,7 +1,7 @@
 import { View, Text } from "@tarojs/components";
 import trackTimeService, { machine } from "@/store/trackTimeMachine"
 import { useEffect, useState } from "react";
-import Taro from "@tarojs/taro";
+import Taro, { useReady } from "@tarojs/taro";
 import Box from "@/components/layout/Box";
 import './Schedule.scss'
 import { useTranslation } from "react-i18next";
@@ -20,6 +20,10 @@ import { ColorType } from "@/context/themes/color";
 import { getThemeColor, jumpPage } from "../hooks/Common";
 import TableCell from "@/components/layout/TableCell";
 import TimelineStage from "./TimelineStage";
+import { useFocusEffect } from "@react-navigation/native";
+import React from "react";
+import { AppState } from "react-native";
+import JPush from 'jpush-react-native';
 
 
 export default function Component(props: { type?: string, data?: any, delSuccess?: Function }) {
@@ -28,8 +32,45 @@ export default function Component(props: { type?: string, data?: any, delSuccess
     const common = useSelector((state: any) => state.common);
     const time = useSelector((state: any) => state.time);
     const [showModal, setShowModal] = useState(false)
+    const [pushEnable, setPushEnable] = useState(true)
     const dispatch = useDispatch();
 
+    useEffect(() => {
+        console.log('push', global.pushEnable)
+    }, [global.pushEnable])
+
+    const handleAppStateChange = (nextAppState) => {
+        checkPushStatus()
+    };
+
+    useEffect(() => {
+        AppState.addEventListener('change', handleAppStateChange);
+
+        return () => {
+            AppState.removeEventListener('change', handleAppStateChange);
+        };
+    }, []);
+
+    // useReady(() => {
+    //     alert('sss')
+    //     if (process.env.TARO_ENV == 'rn') {
+    //         const JPush = require('jpush-react-native')
+    //         JPush.isNotificationEnabled(obj => {
+    //             alert(obj)
+    //         })
+    //     }
+    // })
+
+    useFocusEffect(React.useCallback(() => {
+        checkPushStatus()
+    }, []))
+
+    function checkPushStatus() {
+        JPush.isNotificationEnabled(obj => {
+            setPushEnable(obj)
+        })
+    }
+
     function all() {
         if (props.type == 'latest') {
             jumpPage('/pages/common/RecordsHistory?type=time&title=Time')
@@ -48,8 +89,8 @@ export default function Component(props: { type?: string, data?: any, delSuccess
             return item.code == 'follow_wx_pub'
         })
 
-        const title = permission.wxPubFollow ?t('feature.track_time_duration.follow_wx_pub.h5_followed_title'):
-        t('feature.track_time_duration.follow_wx_pub.h5_unfollowed_title')
+        const title = permission.wxPubFollow ? t('feature.track_time_duration.follow_wx_pub.h5_followed_title') :
+            t('feature.track_time_duration.follow_wx_pub.h5_unfollowed_title')
 
         Taro.showModal({
             title: permission.wxPubFollow ? t('feature.track_time_duration.follow_wx_pub.modal_followed_title') :
@@ -232,6 +273,11 @@ export default function Component(props: { type?: string, data?: any, delSuccess
 
     }
 
+    function getSetting() {
+        // const RNBridge = require('tarojs/plugin-rn-bridge');
+        // RNBridge.NativeModules.RNBridgeModule.jumpToNotificationSettings();
+    }
+
     // if (!permission.wxPubFollow) {
     //     return <View className="schedule_box">
     //         <Text className="box_title">{t('feature.track_time_duration.schedule.section_title')}</Text>
@@ -274,7 +320,11 @@ export default function Component(props: { type?: string, data?: any, delSuccess
         return <View className="schedule_box">
             <View className="box_header" style={{ marginRight: 20, backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
                 <Text className="box_title">{t('feature.track_time_duration.schedule.section_title')}</Text>
-                <Switch isOn={permission.wxPubFollow} onClick={() => followWxPub()} />
+                {
+                    process.env.TARO_ENV == 'weapp' ? <Switch isOn={permission.wxPubFollow} onClick={() => followWxPub()} /> :
+                        <Switch isOn={!pushEnable} onClick={() => getSetting()} />
+                }
+
 
             </View>
 

+ 51 - 2
src/features/trackTimeDuration/components/TimelineStage.tsx

@@ -1,6 +1,6 @@
 import { View, Text } from '@tarojs/components'
 import './TimelineStage.scss'
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
 import Segment from '@/components/navigation/Segment';
 import TimelineFastSleep from './TimelineFastSleep';
 import Stage from './Stage';
@@ -10,6 +10,11 @@ import { useSelector } from 'react-redux';
 import Taro from '@tarojs/taro';
 import { jumpPage } from '../hooks/Common';
 import { rpxToPx } from '@/utils/tools';
+import { AppState } from 'react-native';
+import { useFocusEffect } from '@react-navigation/native';
+import React from 'react';
+import JPush from 'jpush-react-native';
+import { Linking } from 'react-native';
 
 
 export default function Component(props: { data: any, title?: string, subTitle?: string, isSchedule?: boolean,first_real_check_time?:number }) {
@@ -17,6 +22,46 @@ export default function Component(props: { data: any, title?: string, subTitle?:
     const [segmentIndex, setSegmentIndex] = useState(0)
     const permission = useSelector((state: any) => state.permission);
     const common = useSelector((state: any) => state.common);
+    const [pushEnable, setPushEnable] = useState(true)
+
+    const handleAppStateChange = (nextAppState) => {
+        checkPushStatus()
+    };
+
+    useEffect(() => {
+        AppState.addEventListener('change', handleAppStateChange);
+
+        return () => {
+            AppState.removeEventListener('change', handleAppStateChange);
+        };
+    }, []);
+
+    // useReady(() => {
+    //     alert('sss')
+    //     if (process.env.TARO_ENV == 'rn') {
+    //         const JPush = require('jpush-react-native')
+    //         JPush.isNotificationEnabled(obj => {
+    //             alert(obj)
+    //         })
+    //     }
+    // })
+
+    useFocusEffect(React.useCallback(() => {
+        checkPushStatus()
+    }, []))
+
+    function checkPushStatus() {
+
+        JPush.isNotificationEnabled(obj => {
+            setPushEnable(obj)
+        })
+    }
+
+    function goSetting(){
+        Linking.openSettings()
+    }
+
+
     const { t } = useTranslation()
 
     function followWxPub() {
@@ -51,9 +96,13 @@ export default function Component(props: { data: any, title?: string, subTitle?:
         <View className="box_header" style={{ backgroundColor: global.isDebug ? 'pink' : 'transparent' }}>
             <Text className="box_title" style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>{props.title ? props.title : 'Title'}</Text>
             {
-                props.isSchedule &&
+                props.isSchedule && process.env.TARO_ENV=='weapp' &&
                 <Switch isOn={permission.wxPubFollow} onClick={() => followWxPub()} />
             }
+            {
+                props.isSchedule && process.env.TARO_ENV=='rn' &&
+                <Switch isOn={pushEnable} onClick={() => goSetting()} />
+            }
         </View>
         <Text className='box_subtitle'>{props.subTitle ? props.subTitle : 'subTitle'}</Text>
         <View className="segment_detail" style={{

+ 42 - 15
src/features/workout/Workout.tsx

@@ -1,4 +1,4 @@
-import { View, Text, ScrollView, Image } from "@tarojs/components";
+import { View, Text, ScrollView, Image, PageContainer } from "@tarojs/components";
 import './Workout.scss'
 import { useDidShow, useReady } from "@tarojs/taro";
 import { useDispatch, useSelector } from "react-redux";
@@ -252,8 +252,8 @@ export default function Component(props: any) {
                             }
                         })
 
-                        if (ingObj){
-                            lastObject =  ingObj
+                        if (ingObj) {
+                            lastObject = ingObj
                         }
 
                         if (!ingObj && !lastObject) {
@@ -441,7 +441,7 @@ export default function Component(props: any) {
                 return;
             }
 
-            
+
             jumpPage('/pages/common/RecordsHistory?type=activity&refreshList=getCards&title=' + item.name + '&themeColor=' + item.theme_color)
         }
         else {
@@ -832,6 +832,41 @@ export default function Component(props: any) {
         }
     }
 
+    function modalContent() {
+        if (showPageContainer) {
+            if (process.env.TARO_ENV == 'weapp') {
+                return <Modal dismiss={() => {
+                    onPageContainerCancel()
+                    setShowPageContainer(false)
+                }} confirm={() => { }}>
+                    {
+                        metricModalContent()
+                    }
+                </Modal>
+            }
+            else if (process.env.TARO_ENV == 'rn') {
+                return <PageContainer style={{ backgroundColor: '#1c1c1c' }}
+                    overlayStyle={{ backgroundColor: 'rgba(0,0,0,0.9)' }}
+                    customStyle={{ backgroundColor: '#1c1c1c' }}
+                    closeOnSlideDown={false}
+                    show={showPageContainer} round={true} overlay={true} position='bottom'
+                    onClickOverlay={onPageContainerCancel}
+                    onAfterLeave={() => {
+                        onPageContainerCancel()
+                        setShowPageContainer(false)
+                    }}
+                    onBeforeEnter={() => { }}
+                    onBeforeLeave={() => { }}
+                >
+                    {
+                        metricModalContent()
+                    }
+                </PageContainer>
+            }
+        }
+        return <View />
+    }
+
     return <View style={{ position: 'relative' }}>
         <Layout type={TemplateType.customHeader} header={headerView()} children={showErrorPage ? <NoData refresh={() => { getCards() }} /> : detail()}
             title={t('page.activity.title')}
@@ -840,6 +875,9 @@ export default function Component(props: any) {
             triggered={triggered}
             titleShowStyle={NaviBarTitleShowType.scrollToShow}
         />
+        {
+            modalContent()
+        }
         {
             showModal && <Modal dismiss={() => {
                 setIsStart(false)
@@ -862,16 +900,5 @@ export default function Component(props: any) {
                 }
             </Modal>
         }
-
-        {
-            showPageContainer && <Modal dismiss={() => {
-                onPageContainerCancel()
-                setShowPageContainer(false)
-            }} confirm={() => { }}>
-                {
-                    metricModalContent()
-                }
-            </Modal>
-        }
     </View>
 }

+ 43 - 38
src/pages/clock/Clock.weapp.tsx

@@ -203,6 +203,8 @@ export default function IndexPage() {
 
 
   useReady(async () => {
+
+
     const userData = await getStorage('userData');
     if (userData) {
       dispatch(getInfoSuccess(JSON.parse(userData as string)) as any);
@@ -450,6 +452,46 @@ export default function IndexPage() {
 
   })
 
+  function modalContent() {
+    if (showModal || showModal2) {
+      if (process.env.TARO_ENV == 'weapp') {
+        return <Modal
+          testInfo={debugInfo}
+          dismiss={() => {
+            setDebugInfo(null)
+            setShowModal(false); setShowModal2(false)
+          }}
+          confirm={() => { }}>
+          {
+            isModal1 ? modalDetail : modalDetail2
+          }
+        </Modal>
+      }
+      else if (process.env.TARO_ENV == 'rn') {
+        return <PageContainer style={{ backgroundColor: '#1c1c1c' }}
+          // overlayStyle='background-color:rgba(0,0,0,0.9)'
+          // custom-style='background-color:#1c1c1c'
+          overlayStyle={{ backgroundColor: 'rgba(0,0,0,0.9)' }}
+          customStyle={{ backgroundColor: '#1c1c1c' }}
+          closeOnSlideDown={false}
+          onBeforeEnter={() => {
+            Taro.hideTabBar();
+          }}
+          onBeforeLeave={() => {
+            Taro.showTabBar();
+          }}
+          onAfterLeave={() => { setShowModal(false); setShowModal2(false) }}
+          show={showModal || showModal2} round={true} overlay={true} position='bottom'
+        >
+          {
+            isModal1 ? modalDetail : modalDetail2
+          }
+        </PageContainer>
+      }
+    }
+    return <View />
+  }
+
 
   function detail() {
     return (
@@ -497,47 +539,10 @@ export default function IndexPage() {
           <View style={{ height: 100 }} />
         </View>
 
-        {/* <PageContainer style={{ backgroundColor: '#1c1c1c' }}
-          overlayStyle='background-color:rgba(0,0,0,0.9)'
-          custom-style='background-color:#1c1c1c'
-          closeOnSlideDown={false}
-          onBeforeEnter={() => {
-            dispatch(setTabbarStatus(false));
-            Taro.hideTabBar();
-          }}
-          onBeforeLeave={() => {
-            dispatch(setTabbarStatus(true));
-            Taro.showTabBar();
-          }}
-          onAfterLeave={() => { setShowModal(false); setShowModal2(false) }}
-          show={showModal || showModal2} round={true} overlay={true} position='bottom'
-        >
-          {
-            isModal1 ? modalDetail : modalDetail2
-          }
-        </PageContainer> */}
         {
-          (showModal || showModal2) && <Modal
-            testInfo={debugInfo}
-            dismiss={() => {
-              setDebugInfo(null)
-              setShowModal(false); setShowModal2(false)
-            }}
-            confirm={() => { }}>
-            {
-              isModal1 ? modalDetail : modalDetail2
-            }
-          </Modal>
+          modalContent()
         }
 
-
-        {/* {
-          showModal && modalDetail
-        }
-        {
-          showModal2 && modalDetail2
-        } */}
-
       </Layout>
     )
   }

+ 4 - 3
src/pages/rn/RNMain.tsx

@@ -10,6 +10,7 @@ import Profile from '../account/Profile'
 import ChooseAuth from '@/pages/account/ChooseAuth'
 import Auth from '@/pages/account/Auth'
 import Setting from '@/pages/account/Setting'
+import Food from '@/pages/food/Food'
 import DemoA from '../clock/demoA';
 import { View } from '@tarojs/components';
 
@@ -57,7 +58,7 @@ export default function RNMain() {
   const MetricPage = ()=> <Metric />
   const WorkoutPage = ()=> <Workout />
   const ProfilePage = ()=> <Profile />
-  const DemoPage = ()=><DemoA/>
+  // const FoodPage = ()=><Food/>
 
   function tabNavigator() {
     return (
@@ -72,9 +73,9 @@ export default function RNMain() {
         tabBarInactiveTintColor: 'gray', // 非活动标签的颜色
       })}>
         <Tab.Screen name="Clock" component={ClockPage} />
-        {/* <Tab.Screen name="Demo" component={DemoPage} /> */}
+        {/* <Tab.Screen name="Food" component={FoodPage} /> */}
         <Tab.Screen name="Metric" component={MetricPage} />
-        <Tab.Screen name="Activity" component={WorkoutPage}/>
+        <Tab.Screen name="Workout" component={WorkoutPage}/>
         <Tab.Screen name="Profile" component={ProfilePage} />
       </Tab.Navigator>
     )

+ 2 - 1
src/utils/push.tsx

@@ -9,7 +9,6 @@ export default function jgPush() {
     //连接状态
     JPush.addConnectEventListener(result => {
         console.log(result)
-        debugger
     })
 
     console.log('young')
@@ -55,4 +54,6 @@ export default function jgPush() {
             clientId()
         },3000)
     })
+
+    
 }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است