leon 1 سال پیش
والد
کامیت
6482eadc4b

+ 1 - 9
ios/AppDelegate.mm

@@ -125,7 +125,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
 {
 //  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
-#if DEBUG
+#if DEBUGAA
   return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
 #else
   return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
@@ -213,14 +213,6 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
   
 }
 
-- (void)application:(UIApplication *)application didReceiveLocalNotification:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {
-    if ([response.actionIdentifier isEqualToString:@"action1"]) {
-        // 处理"动作1"
-    } else if ([response.actionIdentifier isEqualToString:@"action2"]) {
-        // 处理"动作2"
-    }
-    completionHandler();
-}
 
 //再实现UNUserNotificationCenterDelegate代理的方法
 //- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler

+ 1 - 1
ios/NativeBridge.m

@@ -231,7 +231,7 @@ RCT_EXPORT_METHOD(addLocalPush:(id)array){
         // 计算当前时间与给定时间戳之间的时间差(秒)
         NSTimeInterval timeInterval = timestamp - [currentDate timeIntervalSince1970];
         
-        UNTimeIntervalNotificationTrigger * trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 repeats:NO];
+        UNTimeIntervalNotificationTrigger * trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:timeInterval repeats:NO];
         NSString * identifier = message_id;
         UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:identifier content:content trigger:trigger];
         [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {

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

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

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


+ 39 - 0
src/components/input/Inputs.tsx

@@ -45,6 +45,45 @@ export default function Component({
         setInputValue('')
         onChange('')
     }
+
+    if (process.env.TARO_ENV=='rn'){
+        const TextInput = require('react-native').TextInput
+        return (
+            <View className="input_bg">
+                <TextInput className={isFocus ? "input input_focus" : "input"}
+                    // style={{backgroundColor:'red'}}
+                    placeholder={placeholder ? placeholder : ''}
+                    value={inputValue}
+                    password={isSecure ? true : false}
+                    type={openType == 'nickname' ? 'nickname' : isSecure ? 'safe-password' : 'text'}
+                    // type={openType?openType:'text'}
+                    onInput={handleInputChange}
+                    placeholderStyle='color:#ffffff66'
+                    // onConfirm={() => onConfirm()}
+                    focus={autoFocus}
+                    confirmType="done"
+                    selectionColor={global.fastColor ? global.fastColor : ColorType.fast}
+                    disabled={disabled ? disabled : false}
+                    onFocus={() => {
+                        setIsFocus(true)
+                        if (onFocus)
+                            onFocus()
+                    }}
+                    onBlur={() => {
+                        setIsFocus(false)
+                        if (onBlur)
+                            onBlur()
+                    }}
+                />
+                {
+                    inputValue.length > 0 && <View className="clear_bg" onClick={clear}>
+                        <IconClear />
+                    </View>
+                }
+            </View>
+        )
+    }
+
     return (
         <View className="input_bg">
             <Input className={isFocus ? "input input_focus" : "input"}

+ 1 - 1
src/components/view/Timeline.tsx

@@ -17,7 +17,7 @@ export default function Component(props: { items: any[], title?: string, type?:
             }
             {
                 props.items.map((item, index) => (
-                    <View className='timelineItem'>
+                    <View className='timelineItem' key={index}>
                         <View className='timelineContentView' style={{ background: global.isDebug ? 'red' : 'transparent' }}>
                             {
                                 item.status == 'padding' && <IconRadio width={16} color={item.color} />

+ 13 - 3
src/features/auth/components/CreatePassword.tsx

@@ -13,6 +13,7 @@ import Taro from "@tarojs/taro";
 import { clientId, register } from "@/services/user";
 import { ColorType } from "@/context/themes/color";
 import { registerSuccess } from "@/store/user";
+import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 
 let useNavigation;
 if (process.env.TARO_ENV == 'rn') {
@@ -45,7 +46,16 @@ export default function Component(prop: { name?: string, email?: string }) {
   useEffect(() => {
     if (user.isLogin) {
       navigation.pop(3)
+      jumpPage(`/pages/clock/ChooseScenario`, 'ChooseScenario', navigation, {
+        trigger_event: 'SETUP_UPON_ACCOUNT_CREATION',
+      })
+
+      setTimeout(()=>{
+        jumpPage('/pages/account/ProfileSetting', 'ProfileSetting', navigation)
+      },1000)
+      
     }
+
   }, [user.isLogin])
 
   function loginComponent() {
@@ -61,10 +71,10 @@ export default function Component(prop: { name?: string, email?: string }) {
       return;
     }
 
-    if (password!=repeat){
+    if (password != repeat) {
       Taro.showToast({
-        title:'两次密码输入不一致',
-        icon:'none'
+        title: '两次密码输入不一致',
+        icon: 'none'
       })
       return
     }

+ 2 - 2
src/features/auth/components/login.tsx

@@ -156,7 +156,7 @@ export default function Login(props: { register: () => void }) {
     }
 
     return <View style={{ width: '100%', height: '100%' }}>
-        <Texts text={'Hola'} type={TextType.primary}></Texts>
+        <Texts text={'fast16cc'} type={TextType.primary}></Texts>
         {
             loginComponent()
         }
@@ -186,7 +186,7 @@ export default function Login(props: { register: () => void }) {
     </View>
 
     return <View style={{ backgroundColor: '#000', flex: 1, flexDirection: 'column', display: 'flex', width: '100%', height: '100%' }}>
-        <Texts text={'Hola'} type={TextType.primary}></Texts>
+        <Texts text={'fast16cc'} type={TextType.primary}></Texts>
         {/* <Texts text={t('feature.auth.create_account.sub_title')} type={TextType.secondary}></Texts> */}
         <Box children={loginComponent()}></Box>
 

+ 1 - 1
src/features/daynight/DayNightCard.scss

@@ -356,7 +356,7 @@
 }
 
 .day_night_card_footer_btn{
-    width: 598px;
+    width: 578px;
     height: 84px;
     border-radius: 42px;
     margin-top: 40px;

+ 35 - 21
src/features/daynight/DayNightCard.tsx

@@ -129,6 +129,9 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
     }, [])
 
     useEffect(() => {
+        if (!locationDetail && global.locationDetail){
+            locationDetail = global.locationDetail
+        }
         if (locationDetail) {
             var detail: any = locationDetail
             var now = new Date()
@@ -202,7 +205,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
 
     function updateDate(data) {
         var today = new Date()
-        if (user.isLogin && authInfo && isMember && data && data.daylights && data.daylights.length > 0) {
+        if (user.isLogin && isMember && data && data.daylights && data.daylights.length > 0) {
             // var sunriseObj,sunsetObj;
             var list = data.daylights
             for (var i = 0; i < (list.length - 1); i++) {
@@ -272,15 +275,16 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
             dispatch(updateMember({ isMember: isMember, gpsInfo: null }))
 
             dispatch(setDayRingData({
-                date: sunriseDate,
+                date: sunriseDate.getTime(),
                 sunrise: '06:00',
                 sunset: '18:00'
             }))
             dispatch(setNightRingData({
-                date: sunsetDate,
+                date: sunsetDate.getTime(),
                 sunrise: '06:00',
                 sunset: '18:00'
             }))
+            debugger
             updateUnloginData()
 
         }
@@ -359,12 +363,13 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
             return
         }
+        global.showDayNightSwiperPop(props.isNight, nightDate, dayDate)
         // if (!dayStore.showDayRing) {
         //     return
         // }
         // setShowDetailPopup(true)
-        if (props.detailPop)
-            props.detailPop(props.isNight, nightDate, dayDate)
+        // if (props.detailPop)
+        //     props.detailPop(props.isNight, nightDate, dayDate)
     }
 
     function auth(e?: any) {
@@ -644,7 +649,8 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
 
     function longClick() {
         if (user.isLogin && user.test_user && authInfo)
-            setShowDetailModal(true)
+            global.showDayNightSwiperModal()
+        // setShowDetailModal(true)
     }
 
     function showLocationAlert(e) {
@@ -956,7 +962,10 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
                                 />
                             }
                         </View>
-                        <View className='day_night_card_footer1' style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
+                        <Image className="card_arrowaaa"
+                                style={{ backgroundColor: global.isDebug ? 'blue' : 'transparent' }}
+                                src={require('@/assets/images/arrow3.png')} />
+                        {/* <View className='day_night_card_footer1' style={{ backgroundColor: global.isDebug ? 'red' : 'transparent' }}>
                             {
                                 !showArrow() && <View className='footer_sun_icon_bg' style={{ backgroundColor: global.isDebug ? 'pink' : 'transparent' }}>
                                     {
@@ -965,8 +974,10 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
                                 </View>
                             }
                             <Text className='footer_desc_text' style={{ backgroundColor: global.isDebug ? 'black' : 'transparent' }}>{showArrow() ? completedDate() : footerDesc()}</Text>
-                            <Image className="card_arrowaaa" style={{ backgroundColor: global.isDebug ? 'blue' : 'transparent' }} src={require('@/assets/images/arrow3.png')} />
-                        </View>
+                            <Image className="card_arrowaaa"
+                                style={{ backgroundColor: global.isDebug ? 'blue' : 'transparent' }}
+                                src={require('@/assets/images/arrow3.png')} />
+                        </View> */}
                     </View>
                 </View>
             </View>
@@ -982,21 +993,24 @@ export default function DayNightCard(props: { isNight: boolean, count: number, d
     function detail() {
         return <View>
             {cardContent()}
-            <View className='day_night_card_footer_btn' 
-            onClick={()=>{
-                if (props.isNight){
-                    global.tapShowNight()
-                }
-                else {
-                    global.tapShowDay()
-                }
-            }}
-            style={{ backgroundColor: props.isNight ? ColorType.night : ColorType.day }}>
-                <Text style={{ color: props.isNight ? ColorType.white : ColorType.black }}>白天/夜晚</Text>
+            <View className='day_night_card_footer_btn'
+                onClick={(e) => {
+                    if (process.env.TARO_ENV == 'weapp') {
+                        e.stopPropagation()
+                    }
+                    if (props.isNight) {
+                        global.tapShowNight()
+                    }
+                    else {
+                        global.tapShowDay()
+                    }
+                }}
+                style={{ backgroundColor: props.isNight ? ColorType.night : ColorType.day }}>
+                <Text style={{ color: props.isNight ? ColorType.white : ColorType.black, fontWeight: 'bold' }}>白天/夜晚</Text>
             </View>
         </View>
     }
 
-    return process.env.TARO_ENV == 'weapp' ? <Box>{detail()}</Box> :
+    return process.env.TARO_ENV == 'weapp' ? <Box style={{marginBottom:0}}>{detail()}</Box> :
         <View className='rn_card_bg'>{detail()}</View>
 }

+ 2 - 0
src/features/daynight/DayNightDetailPopup.tsx

@@ -100,6 +100,7 @@ export default function DayNightDetailPopup(props: {
     }
 
     function dayDuration() {
+        debugger
         if (isCompleted()) {
             return TimeFormatter.calculateTimeDifference(props.authInfo.day_completed.sunrise_ts, props.authInfo.day_completed.sunset_ts, true);
         }
@@ -251,6 +252,7 @@ export default function DayNightDetailPopup(props: {
     }
 
     function dayDurationDesc() {
+        debugger
         if (!props.authInfo || !(props.authInfo as any).lat) {
             if (new Date().getHours() >= 18) {
                 return [t('feature.day_night.tomorrow'), t('feature.day_night.tomorrow')]

+ 1 - 0
src/features/daynight/DayNightRing.tsx

@@ -51,6 +51,7 @@ export default function DayNightRing(props: {
             // if (!realRingBig.startArc){
             //     realRingBig = null
             // }
+            debugger
             return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} canvasId={props.canvasId} />
 
         }

+ 8 - 286
src/features/daynight/DayNightSwiper.tsx

@@ -5,15 +5,10 @@ import { TimeFormatter } from "@/utils/time_format";
 import { clearLocation, latestLocation } from "@/services/user";
 import { useDispatch, useSelector } from "react-redux";
 import '@/pages/clock/Clock.scss';
-import Modal from '@/components/layout/Modal.weapp'
-import DayNightDetailPopup from './DayNightDetailPopup'
-import { rpxToPx, getTimezone } from "@/utils/tools";
-import { useTranslation } from "react-i18next";
-import Taro from "@tarojs/taro";
-import { systemLocation } from "@/services/common";
-import showAlert from "@/components/basic/Alert";
 import AllRings from "./AllRings";
 import AllDayRings from "./AllDayRings";
+import DayNightSwiperPopup from "./DayNightSwiperPopup";
+import { rpxToPx } from "@/utils/tools";
 
 let locationObj
 
@@ -30,13 +25,6 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
     const [firstNight, setFirstNight] = useState(true)
     const [current, setCurrent] = useState(0)
     const [authInfo, setAuthInfo] = useState<any>(null)
-    const [showDetailModal, setShowDetailModal] = useState(false)
-    const [showDetailPopup, setShowDetailPopup] = useState(false)
-    const [dayDate, setDayDate] = useState<any>('')
-    const [nightDate, setNightDate] = useState<any>('')
-    const [isNight, setIsNight] = useState(false)
-    const { t } = useTranslation()
-    const dispatch = useDispatch();
 
 
     useEffect(() => {
@@ -122,258 +110,6 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
 
     }
 
-    function clearData() {
-        Taro.showModal({
-            title: '提示',
-            content: '确认清除位置数据?',
-            success: function (res) {
-                if (res.confirm) {
-                    clearLocation().then(res => {
-                        getLatestLocation()
-                    })
-                } else if (res.cancel) {
-                    console.log('用户点击取消')
-                }
-            }
-        })
-    }
-
-    function auth(e?: any) {
-        if (e && process.env.TARO_ENV == 'weapp') {
-            e.stopPropagation()
-        }
-        var today = new Date()
-        var yesterday = new Date(today.getTime() - 24 * 3600 * 1000)
-        var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000 * 5)
-        var strYesterday = `${yesterday.getFullYear()}-${TimeFormatter.padZero(yesterday.getMonth() + 1)}-${TimeFormatter.padZero(yesterday.getDate())}`
-        var strTomorrow = `${tomorrow.getFullYear()}-${TimeFormatter.padZero(tomorrow.getMonth() + 1)}-${TimeFormatter.padZero(tomorrow.getDate())}`
-
-        if (process.env.TARO_ENV == 'rn') {
-            Taro.getLocation({
-                success(res) {
-                    systemLocation({
-                        lat: res.latitude,
-                        lng: res.longitude,
-                        date_start: strYesterday,
-                        date_end: strTomorrow,
-                        coordinate_system_standard: 'WGS-84'
-                    }).then(data => {
-                        updateDate(data);
-                        global.locationDetail = data
-                        setAuthInfo(data as any)
-                        Taro.setStorage({
-                            key: 'gps',
-                            data: JSON.stringify(data as any)
-                        })
-                        // dispatch(updateMember({ isMember: isMember, gpsInfo: (data as any) }))
-                        if (Taro.getSystemInfoSync().platform == 'android' && process.env.TARO_ENV == 'rn') {
-                            var ToastAndroid = require('react-native').ToastAndroid;
-                            ToastAndroid.show(t('feature.day_night.location_updated'), ToastAndroid.LONG);
-                        }
-                        else {
-                            Taro.showToast({
-                                title: t('feature.day_night.location_updated'),
-                                icon: 'none'
-                            })
-                        }
-
-                    })
-                },
-                fail(res) {
-                    if (res.errMsg == 'Permissions denied!') {
-                        showAlert({
-                            title: t('feature.auth_sys.location_title'),
-                            content: t('feature.auth_sys.location_desc'),
-                            showCancel: true,
-                            cancelText: t('feature.auth_sys.location_cancel'),
-                            confirmText: t('feature.auth_sys.location_confirm'),
-                            confirm: () => {
-                                Linking.openURL('app-settings:')
-                            }
-                        })
-                    }
-                    else {
-                        if (Taro.getSystemInfoSync().platform == 'android' && process.env.TARO_ENV == 'rn') {
-                            var ToastAndroid = require('react-native').ToastAndroid;
-                            ToastAndroid.show(t('feature.day_night.location_failed'), ToastAndroid.LONG);
-                        }
-                        else {
-                            Taro.showToast({
-                                title: t('feature.day_night.location_failed'),
-                                icon: 'none'
-                            })
-                        }
-                    }
-                    console.log(res)
-                },
-                complete(res) {
-
-                }
-            })
-            return
-        }
-        Taro.chooseLocation({
-            latitude: authInfo && authInfo.lat ? authInfo.lat : undefined,
-            longitude: authInfo && authInfo.lat ? authInfo.lng : undefined,
-            success: function (res) {
-
-                systemLocation({
-                    lat: res.latitude,
-                    lng: res.longitude,
-                    name: res.name,
-                    address: res.address,
-                    date_start: strYesterday,
-                    date_end: strTomorrow,
-                    coordinate_system_standard: 'GCJ-02'
-                }).then(data => {
-                    updateDate(data);
-                    global.locationDetail = data
-                    setAuthInfo(data as any)
-                    Taro.setStorage({
-                        key: 'gps',
-                        data: JSON.stringify(data as any)
-                    })
-                    // dispatch(updateMember({ isMember: isMember, gpsInfo: (data as any) }))
-
-                    if (global.swiperDayNightRefresh) {
-                        global.swiperDayNightRefresh()
-                    }
-                })
-
-            },
-            fail(res) {
-                Taro.showToast({
-                    title: '位置修改失败!\n请重新选择就近位置',
-                    icon: 'none'
-                })
-            },
-            complete(res) {
-
-            }
-        })
-
-    }
-
-    function getLocation() {
-        if (!authInfo) {
-            return ''
-        }
-        return `${getCity()} | ${Math.abs(parseInt(authInfo.lat))}°${parseInt(authInfo.lat) < 0 ? 'S' : 'N'} ${Math.abs(parseInt(authInfo.lng))}°${parseInt(authInfo.lng) < 0 ? 'W' : 'E'}`
-    }
-
-    function getCity() {
-        var city = ''
-        if (!authInfo) {
-            return ''
-        }
-        if ((authInfo as any).address) {
-            if ((authInfo as any).address.city.length > 0) {
-                city = (authInfo as any).address.city
-            }
-            else if ((authInfo as any).address.province.length > 0) {
-                city = (authInfo as any).address.province
-            }
-            else if ((authInfo as any).address.country.length > 0) {
-                city = (authInfo as any).address.country
-            }
-            else {
-                city = t('feature.track_time_duration.third_ring.unknown')
-            }
-        }
-        else {
-            city = t('feature.track_time_duration.third_ring.unknown')
-        }
-        return city
-    }
-
-
-    function modalContent() {
-        return <Modal
-            testInfo={null}
-            dismiss={() => {
-                setShowDetailPopup(false)
-            }}
-            confirm={() => { }}>
-            <DayNightDetailPopup
-                isNight={isNight}
-                authInfo={authInfo}
-                nightDate={nightDate}
-                dayDate={dayDate}
-                updateLocation={auth}
-                onClose={() => { setShowDetailPopup(false) }}
-            />
-        </Modal>
-    }
-
-    function modalContent2() {
-        return <Modal
-            testInfo={null}
-            dismiss={() => {
-                setShowDetailModal(false)
-            }}
-            confirm={() => { }}>
-            {
-                detailModalContent()
-            }
-        </Modal>
-    }
-
-    function detailModalContent() {
-        var timezone = getTimezone()
-        if (!authInfo || !(authInfo as any).lat) {
-            return <View style={{ height: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', width: rpxToPx(750) }}>
-                <Text>暂无位置信息</Text>
-            </View>
-        }
-        return <View style={{ display: 'flex', flexDirection: 'column' }}>
-            {
-                <View className="cell_bg">
-                    {
-                        <View className="cell_full">
-                            <Text className="cell_title">{t('feature.track_time_duration.third_ring.location')}</Text>
-                            <Text className="cell_value">{authInfo ? getLocation() : t('feature.track_time_duration.third_ring.enter')}</Text>
-                        </View>
-                    }
-                    <View className="cell_line" style={{ height: 1 }} />
-
-
-                    {
-                        <View className="cell_full" >
-                            <Text className="cell_title">{t('feature.track_time_duration.third_ring.latitude')}</Text>
-
-                            <Text className="cell_value">{(authInfo as any).lat}</Text>
-
-
-                        </View>
-                    }
-                    <View className="cell_line" style={{ height: 1 }} />
-
-                    <View className="cell_full">
-                        <Text className="cell_title" >{t('feature.track_time_duration.third_ring.longitude')}</Text>
-
-                        <Text className="cell_value">{(authInfo as any).lng}</Text>
-
-                    </View>
-                    <View className="cell_line" style={{ height: 1 }} />
-                    <View className="cell_full">
-                        <Text className="cell_title">{t('feature.track_time_duration.third_ring.timezone')}</Text>
-
-                        <Text className="cell_value">{timezone}</Text>
-
-                    </View>
-
-
-
-                </View>
-
-            }
-
-            <Text onClick={() => {
-                clearData()
-                setShowDetailModal(false)
-            }} style={{ width: '100%', textAlign: 'center', marginBottom: 50, color: '#fff', marginTop: 20 }}>清除位置</Text>
-        </View>
-    }
 
 
 
@@ -386,35 +122,21 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
     return <View><Swiper
         className="rn_swiper"
         indicatorDots
-        indicatorColor='#333'
-        indicatorActiveColor='#999'
+        indicatorColor='#ffffff66'
+        indicatorActiveColor='#ffffff99'
         current={current}
+        style={{height:process.env.TARO_ENV=='weapp'?rpxToPx(204)+96+4:rpxToPx(204)+96+12}}
 
     >
         <SwiperItem>
-            <DayNightCard isNight={firstNight} count={props.count} detailPop={(isNight, strNight, strDay) => {
-                setNightDate(strNight)
-                setDayDate(strDay)
-                setIsNight(isNight)
-                setShowDetailPopup(true)
-            }} />
+            <DayNightCard isNight={firstNight} count={props.count} />
         </SwiperItem>
         <SwiperItem>
-            <DayNightCard isNight={!firstNight} count={props.count} detailPop={(isNight, strNight, strDay) => {
-                setNightDate(strNight)
-                setDayDate(strDay)
-                setIsNight(isNight)
-                setShowDetailPopup(true)
-            }} />
+            <DayNightCard isNight={!firstNight} count={props.count} />
         </SwiperItem>
     </Swiper>
-        {
-            showDetailPopup && modalContent()
-        }
-        {
-            showDetailModal && modalContent2()
-        }
         <AllRings data={props.homeData} time={timestamp} />
         <AllDayRings schedule={props.schedule} />
+        <DayNightSwiperPopup authInfo={authInfo} />
     </View>
 }

+ 313 - 0
src/features/daynight/DayNightSwiperPopup.tsx

@@ -0,0 +1,313 @@
+import { PageContainer, Switch, Text, View, Image } from '@tarojs/components'
+import Modal from '@/components/layout/Modal.weapp'
+import { useEffect, useState } from 'react'
+import DayNightDetailPopup from './DayNightDetailPopup'
+import { useTranslation } from 'react-i18next'
+import Taro from '@tarojs/taro'
+import { systemLocation } from '@/services/common'
+import showAlert from '@/components/basic/Alert'
+import { getTimezone } from '@/utils/tools'
+import { clearLocation } from '@/services/user'
+import { TimeFormatter } from '@/utils/time_format'
+
+
+let Linking;
+if (process.env.TARO_ENV == 'rn') {
+    // useNavigation = require("@react-navigation/native").useNavigation
+    Linking = require('react-native').Linking;
+}
+export default function DayNightSwiperPopup(props: { authInfo: any }) {
+    const [showDetailModal, setShowDetailModal] = useState(false)
+    const [showDetailPopup, setShowDetailPopup] = useState(false)
+    const [authInfo, setAuthInfo] = useState<any>(props.authInfo)
+    const [dayDate, setDayDate] = useState<any>('')
+    const [nightDate, setNightDate] = useState<any>('')
+    const [isNight, setIsNight] = useState(false)
+
+    useEffect(() => {
+        setAuthInfo(props.authInfo)
+    }, [props.authInfo])
+
+    const { t } = useTranslation()
+
+    function modalContent() {
+        return <Modal
+            testInfo={null}
+            dismiss={() => {
+                setShowDetailPopup(false)
+            }}
+            confirm={() => { }}>
+            <DayNightDetailPopup
+                isNight={isNight}
+                authInfo={authInfo}
+                nightDate={nightDate}
+                dayDate={dayDate}
+                updateLocation={auth}
+                onClose={() => { setShowDetailPopup(false) }}
+            />
+        </Modal>
+    }
+
+    function modalContent2() {
+        return <Modal
+            testInfo={null}
+            dismiss={() => {
+                setShowDetailModal(false)
+            }}
+            confirm={() => { }}>
+            {
+                detailModalContent()
+            }
+        </Modal>
+    }
+
+    function getLocation() {
+        if (!authInfo) {
+            return ''
+        }
+        return `${getCity()} | ${Math.abs(parseInt(authInfo.lat))}°${parseInt(authInfo.lat) < 0 ? 'S' : 'N'} ${Math.abs(parseInt(authInfo.lng))}°${parseInt(authInfo.lng) < 0 ? 'W' : 'E'}`
+    }
+
+    function getCity() {
+        var city = ''
+        if (!authInfo) {
+            return ''
+        }
+        if ((authInfo as any).address) {
+            if ((authInfo as any).address.city.length > 0) {
+                city = (authInfo as any).address.city
+            }
+            else if ((authInfo as any).address.province.length > 0) {
+                city = (authInfo as any).address.province
+            }
+            else if ((authInfo as any).address.country.length > 0) {
+                city = (authInfo as any).address.country
+            }
+            else {
+                city = t('feature.track_time_duration.third_ring.unknown')
+            }
+        }
+        else {
+            city = t('feature.track_time_duration.third_ring.unknown')
+        }
+        return city
+    }
+
+
+    function detailModalContent() {
+        var timezone = getTimezone()
+        if (!authInfo || !(authInfo as any).lat) {
+            return <View style={{ height: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', width: rpxToPx(750) }}>
+                <Text>暂无位置信息</Text>
+            </View>
+        }
+        return <View style={{ display: 'flex', flexDirection: 'column' }}>
+            {
+                <View className="cell_bg">
+                    {
+                        <View className="cell_full">
+                            <Text className="cell_title">{t('feature.track_time_duration.third_ring.location')}</Text>
+                            <Text className="cell_value">{authInfo ? getLocation() : t('feature.track_time_duration.third_ring.enter')}</Text>
+                        </View>
+                    }
+                    <View className="cell_line" style={{ height: 1 }} />
+
+
+                    {
+                        <View className="cell_full" >
+                            <Text className="cell_title">{t('feature.track_time_duration.third_ring.latitude')}</Text>
+
+                            <Text className="cell_value">{(authInfo as any).lat}</Text>
+
+
+                        </View>
+                    }
+                    <View className="cell_line" style={{ height: 1 }} />
+
+                    <View className="cell_full">
+                        <Text className="cell_title" >{t('feature.track_time_duration.third_ring.longitude')}</Text>
+
+                        <Text className="cell_value">{(authInfo as any).lng}</Text>
+
+                    </View>
+                    <View className="cell_line" style={{ height: 1 }} />
+                    <View className="cell_full">
+                        <Text className="cell_title">{t('feature.track_time_duration.third_ring.timezone')}</Text>
+
+                        <Text className="cell_value">{timezone}</Text>
+
+                    </View>
+
+
+
+                </View>
+
+            }
+
+            <Text onClick={() => {
+                clearData()
+                setShowDetailModal(false)
+            }} style={{ width: '100%', textAlign: 'center', marginBottom: 50, color: '#fff', marginTop: 20 }}>清除位置</Text>
+        </View>
+    }
+
+    function clearData() {
+        Taro.showModal({
+            title: '提示',
+            content: '确认清除位置数据?',
+            success: function (res) {
+                if (res.confirm) {
+                    clearLocation().then(res => {
+                        // getLatestLocation()
+                        global.swiperDayNightRefresh()
+                        global.refreshNight()
+                        global.refreshDay()
+                    })
+                } else if (res.cancel) {
+                    console.log('用户点击取消')
+                }
+            }
+        })
+    }
+
+    function auth(e?: any) {
+        if (e && process.env.TARO_ENV == 'weapp') {
+            e.stopPropagation()
+        }
+        var today = new Date()
+        var yesterday = new Date(today.getTime() - 24 * 3600 * 1000)
+        var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000 * 5)
+        var strYesterday = `${yesterday.getFullYear()}-${TimeFormatter.padZero(yesterday.getMonth() + 1)}-${TimeFormatter.padZero(yesterday.getDate())}`
+        var strTomorrow = `${tomorrow.getFullYear()}-${TimeFormatter.padZero(tomorrow.getMonth() + 1)}-${TimeFormatter.padZero(tomorrow.getDate())}`
+
+        if (process.env.TARO_ENV == 'rn') {
+            Taro.getLocation({
+                success(res) {
+                    systemLocation({
+                        lat: res.latitude,
+                        lng: res.longitude,
+                        date_start: strYesterday,
+                        date_end: strTomorrow,
+                        coordinate_system_standard: 'WGS-84'
+                    }).then(data => {
+                        global.swiperDayNightRefresh()
+                        global.refreshNight()
+                        global.refreshDay()
+                        // updateDate(data);
+                        global.locationDetail = data
+                        setAuthInfo(data as any)
+                        Taro.setStorage({
+                            key: 'gps',
+                            data: JSON.stringify(data as any)
+                        })
+                        // dispatch(updateMember({ isMember: isMember, gpsInfo: (data as any) }))
+                        if (Taro.getSystemInfoSync().platform == 'android' && process.env.TARO_ENV == 'rn') {
+                            var ToastAndroid = require('react-native').ToastAndroid;
+                            ToastAndroid.show(t('feature.day_night.location_updated'), ToastAndroid.LONG);
+                        }
+                        else {
+                            Taro.showToast({
+                                title: t('feature.day_night.location_updated'),
+                                icon: 'none'
+                            })
+                        }
+
+                    })
+                },
+                fail(res) {
+                    if (res.errMsg == 'Permissions denied!') {
+                        showAlert({
+                            title: t('feature.auth_sys.location_title'),
+                            content: t('feature.auth_sys.location_desc'),
+                            showCancel: true,
+                            cancelText: t('feature.auth_sys.location_cancel'),
+                            confirmText: t('feature.auth_sys.location_confirm'),
+                            confirm: () => {
+                                Linking.openURL('app-settings:')
+                            }
+                        })
+                    }
+                    else {
+                        if (Taro.getSystemInfoSync().platform == 'android' && process.env.TARO_ENV == 'rn') {
+                            var ToastAndroid = require('react-native').ToastAndroid;
+                            ToastAndroid.show(t('feature.day_night.location_failed'), ToastAndroid.LONG);
+                        }
+                        else {
+                            Taro.showToast({
+                                title: t('feature.day_night.location_failed'),
+                                icon: 'none'
+                            })
+                        }
+                    }
+                    console.log(res)
+                },
+                complete(res) {
+
+                }
+            })
+            return
+        }
+        Taro.chooseLocation({
+            latitude: authInfo && authInfo.lat ? authInfo.lat : undefined,
+            longitude: authInfo && authInfo.lat ? authInfo.lng : undefined,
+            success: function (res) {
+
+                systemLocation({
+                    lat: res.latitude,
+                    lng: res.longitude,
+                    name: res.name,
+                    address: res.address,
+                    date_start: strYesterday,
+                    date_end: strTomorrow,
+                    coordinate_system_standard: 'GCJ-02'
+                }).then(data => {
+                    // updateDate(data);
+                    global.locationDetail = data
+                    setAuthInfo(data as any)
+                    Taro.setStorage({
+                        key: 'gps',
+                        data: JSON.stringify(data as any)
+                    })
+                    // dispatch(updateMember({ isMember: isMember, gpsInfo: (data as any) }))
+
+                    if (global.swiperDayNightRefresh) {
+                        global.swiperDayNightRefresh()
+                    }
+                    global.refreshNight()
+                    global.refreshDay()
+                })
+
+            },
+            fail(res) {
+                Taro.showToast({
+                    title: '位置修改失败!\n请重新选择就近位置',
+                    icon: 'none'
+                })
+            },
+            complete(res) {
+
+            }
+        })
+
+    }
+
+    global.showDayNightSwiperPop = (isNight, strNight, strDay) => {
+        setNightDate(strNight)
+        setDayDate(strDay)
+        setIsNight(isNight)
+        setShowDetailPopup(true)
+    }
+
+    global.showDayNightSwiperModal = () => {
+        setShowDetailModal(true)
+    }
+
+    return <View>
+        {
+            showDetailPopup && modalContent()
+        }
+        {
+            showDetailModal && modalContent2()
+        }
+    </View>
+}

+ 2 - 0
src/features/trackTimeDuration/components/CheckAccess.scss

@@ -68,6 +68,7 @@
     -webkit-text-fill-color: transparent;
     background-clip: text;
     text-fill-color: transparent;
+    font-weight: bold;
 }
 
 .fast_alert_container {
@@ -89,6 +90,7 @@
 .confirm_sub_text {
     color: #fff;
     font-size: 20px;
+    font-weight: bold;
 }
 
 .fast_alert_container {

+ 12 - 26
src/features/trackTimeDuration/components/CheckAccess.tsx

@@ -8,7 +8,7 @@ import { useDispatch, useSelector } from "react-redux";
 import { getPlans, setPlan } from "@/services/trackTimeDuration";
 import { chooseMode, initTarget, updateStep } from "@/store/set_target";
 import { jumpPage } from "../hooks/Common";
-import { useDidShow } from "@tarojs/taro";
+import { useDidHide, useDidShow } from "@tarojs/taro";
 import Taro from "@tarojs/taro";
 import { useTranslation } from "react-i18next";
 
@@ -34,6 +34,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
     const [confirmText, setConfirmText] = useState('')
     const [subConfirmText, setSubConfirmText] = useState('')
     const user = useSelector((state: any) => state.user);
+    const [rnKeep,setRnKeep] = useState(false)
 
     const { t } = useTranslation()
 
@@ -52,6 +53,8 @@ export default function CheckAccess(props: { record: any, count: number }) {
     // const [confirmAction, setConfirmAction] = useState<any>(null)
     // const [access, setAccess] = useState<any>(null)
 
+    
+
     useEffect(() => {
         var obj = props.record
         if (obj.access) {
@@ -92,6 +95,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
     // };
 
     function viewWillAppear() {
+        setRnKeep(true)
         if (checkChooseMixed && chooseMixedSuccess) {
             upgradeSuccess()
             confirmAction = null
@@ -100,6 +104,10 @@ export default function CheckAccess(props: { record: any, count: number }) {
         setChooseMixedSuccess(false)
     }
 
+    function viewWillDisappear(){
+        setRnKeep(false)
+    }
+
     useDidShow(() => {
         console.log('user did show');
         viewWillAppear()
@@ -114,11 +122,13 @@ export default function CheckAccess(props: { record: any, count: number }) {
 
             // 当页面即将消失时执行
             navigation.addListener('blur', () => {
+                viewWillDisappear()
             });
 
         }
 
         global.chooseMixed = () => {
+            debugger
             setChooseMixedSuccess(true)
             setShowFastAlert(false)
             setKeepContent(false)
@@ -214,37 +224,13 @@ export default function CheckAccess(props: { record: any, count: number }) {
                 setConfirmText(t('feature.check_access.stay_qualified.btn'))
             }
             else if (preStatus == 'PROVISIONAL_QUALIFIED' && currentStatus == 'NOT_QUALIFIED') {
-                // lose(acccessData.current.qualification);
                 loseGain(acccessData);
-                // setShowFastAlert(true)
-                // setAlertTitle('Premium Access Lost')
-                // setAlertContent(`You've lost premium access to the 'Fasting with Sleep' feature
-                // since you lost your fasting streak. To regain access, become a PRO or achieve a new 3-day fasting streak.`)
-                // setShowCancel(true)
-                // setCancelText('Achieve New Fasting Streak')
-                // setConfirmText('Become a PRO member')
             }
         }
     }, [])
 
     function upgradeSuccess() {
         setShowFastAlert(false)
-    //     var expire = access.current.qualification.fast_expire
-    //     setShowFastAlert(true)
-    //     setKeepContent(false)
-    //     setAlertTitle(t('feature.check_access.upgrade_pro.title'))
-    //     setAlertContent(t('feature.check_access.upgrade_pro.desc', { time: TimeFormatter.countdown(expire) }))
-    //     setShowCancel(false)
-    //     setConfirmText(t('feature.check_access.upgrade_pro.btn'))
-    //     setSubConfirmText('')
-    //     timer = setInterval(() => {
-
-    //         if (new Date().getTime() > expire) {
-    //             cancel()
-    //             return
-    //         }
-    //         setAlertContent(t('feature.check_access.upgrade_pro.desc', { time: TimeFormatter.countdown(expire) }))
-    //     }, 1000)
     }
 
     async function loseGain(access) {
@@ -485,7 +471,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
             showFastAlert && process.env.TARO_ENV == 'weapp' && alertPop()
         }
         {
-            showFastAlert && process.env.TARO_ENV == 'rn' && <Modal transparent={true}>
+            showFastAlert && rnKeep && process.env.TARO_ENV == 'rn' && <Modal transparent={true}>
                 <View style={{ backgroundColor: 'rgba(0,0,0,0.95)', width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center' }}>
                     {alertPop()}
                 </View>

+ 1 - 0
src/features/trackTimeDuration/components/Discovery.tsx

@@ -20,6 +20,7 @@ import { AtActivityIndicator } from "taro-ui";
 import NoData from "@/components/view/NoData";
 import AllRings from "../../daynight/AllRings";
 import AllDayRings from "../../daynight/AllDayRings";
+import '@utils/ring_card.scss'
 // import AtActivityIndicator from "taro-ui/types/activity-indicator";
 
 

+ 5 - 2
src/features/trackTimeDuration/components/Streaks.tsx

@@ -66,7 +66,7 @@ export default function Streaks(props: { count: number }) {
     function getDatas() {
         setIsLoading(true)
         var a = dayjs().format('YYYYMMDD')
-        getStreaks({ date: a,mode:'by_end_date' }).then(res => {
+        getStreaks({ date: a, mode: 'by_end_date' }).then(res => {
             console.log('streak', res)
             if (res) {
                 setFastStreaks((res as any).fast)
@@ -80,7 +80,10 @@ export default function Streaks(props: { count: number }) {
 
     if (!fastStreaks || !sleepStreaks) return <View />
     return <View>
-        <Text className='streaks_title'>{t('feature.track_time_duration.streaks.title')}</Text>
+        <View className="index_section">
+            <Text className="index_section_title">{t('feature.track_time_duration.streaks.title')}</Text>
+        </View>
+
         <View className='streaks_content'>
             <StreakItem isFast={true} data={fastStreaks} />
             <StreakItem isFast={false} data={sleepStreaks} />

+ 11 - 3
src/pages/account/EditPage.tsx

@@ -8,10 +8,12 @@ import { Input, View, Text } from "@tarojs/components";
 import Taro, { useRouter } from "@tarojs/taro";
 import { useEffect, useState } from "react";
 import { useTranslation } from "react-i18next";
+import { TextInput } from "react-native";
 import { useDispatch, useSelector } from "react-redux";
 
 let useNavigation;
 let useRoute;
+
 if (process.env.TARO_ENV == 'rn') {
     useRoute = require("@react-navigation/native").useRoute
     useNavigation = require("@react-navigation/native").useNavigation
@@ -92,9 +94,15 @@ export default function Page() {
     return <View style={{ flex: 1 }}>
         <View style={{ height: 20 }}></View>
         {/* <Input type="nickname" placeholder="请输入昵称" style={{ color: '#fff' }} value={value} onInput={handleChange} /> */}
-        <Inputs autoFocus placeholder={t('feature.common.toast.input_nickname')} value={value} onChange={handleChange} onConfirm={save}
-            openType="nickname"
-        />
+        {
+            process.env.TARO_ENV == 'weapp' ? <Inputs autoFocus placeholder={t('feature.common.toast.input_nickname')} value={value} onChange={handleChange} onConfirm={save}
+                openType="nickname"
+            /> :
+                <Inputs autoFocus placeholder={t('feature.common.toast.input_nickname')} value={value} onChange={handleChange} onConfirm={save}
+                />
+        }
+        
+
         <View className="cell_footer">{t('page.user_profile.nickname_footer')}</View>
         <View style={{ flex: 1 }} />
         <Footer>

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

@@ -77,7 +77,7 @@ export default function Page() {
         showAlert({
             title: t('feature.common.modal.deluser_title'),
             content: t('feature.common.modal.deluser_content'),
-            showCancel: false,
+            showCancel: true,
             confirm: () => {
                 dispatch(clear() as any);
             }

+ 27 - 9
src/pages/clock/Clock.scss

@@ -1,11 +1,12 @@
 @import '@/utils/common.scss';
-.index_container{
+
+.index_container {
     display: flex;
     flex-direction: column;
     color: #fff;
 }
 
-.discovery1{
+.discovery1 {
     margin-left: 46px;
     font-weight: bold;
     font-size: 48px;
@@ -14,15 +15,14 @@
     color: #fff;
 }
 
-.count{
+.count {
     opacity: 0;
     height: 0;
 }
 
-.rn_swiper{
+.rn_swiper {
     width: 750px;
-    height: 404px;
-    margin-bottom: 5px;
+    // height: 404px;
     // background-color: oldlace;
     // background-color: red;
     // margin-bottom: 20px;
@@ -30,7 +30,7 @@
 
 
 
-.swiper1{
+.swiper1 {
     height: 850px;
 }
 
@@ -42,11 +42,29 @@
     color: transparent;
     font-weight: bold;
 }
+
 /* #endif */
 
-.index_more{
-    margin-right: 46px;
+.index_more {
     line-height: 48px;
     // margin-top: 64px;
     // margin-bottom: 22px;
+}
+
+.index_section {
+    height: 120px;
+    display: flex;
+    flex-direction: row;
+    padding-left: 46px;
+    padding-right: 46px;
+    align-items: center;
+    justify-content: space-between;
+    // background-color: pink;
+}
+
+.index_section_title {
+    color: #fff;
+    opacity: 0.6;
+    font-size: 48px;
+    font-weight: bold;
 }

+ 1 - 1
src/pages/clock/Clock.tsx

@@ -2,7 +2,7 @@ import { showDay } from "@/store/day";
 import { showNight } from "@/store/night";
 import { getInfoSuccess } from "@/store/user";
 import { View } from "@tarojs/components";
-import Taro, { useShareAppMessage } from "@tarojs/taro";
+import Taro, { useDidHide, useShareAppMessage } from "@tarojs/taro";
 import { useEffect, useState } from "react";
 import { useDispatch } from "react-redux";
 import Clock from "./ClockMain";

+ 25 - 21
src/pages/clock/ClockMain.tsx

@@ -645,9 +645,9 @@ export default function Page() {
             }
         }
         else {
-            PushNotification.checkPermissions((res)=>{
+            PushNotification.checkPermissions((res) => {
                 //允许授权
-                if (res.authorizationStatus == 2){
+                if (res.authorizationStatus == 2) {
                     // showAlert({
                     //     title: t('feature.track_time_duration.reminders.schedule_title'),
                     //     content: scenario.name == 'FAST' ?
@@ -704,9 +704,9 @@ export default function Page() {
             }
         }
         else {
-            PushNotification.checkPermissions((res)=>{
+            PushNotification.checkPermissions((res) => {
                 //允许授权
-                if (res.authorizationStatus == 2){
+                if (res.authorizationStatus == 2) {
                     // showAlert({
                     //     title: t('feature.track_time_duration.reminders.schedule_title'),
                     //     content: t('feature.track_time_duration.reminders.enable_schedule_mix_content', { time1: time1, time2: time2 }),
@@ -824,24 +824,15 @@ export default function Page() {
                     </View>
                 </Box>
 
-
-
-
-
-
-
-                {/* {user.isLogin && <AllRings data={homeData} time={timestamp} />} */}
                 {
-                    user.isLogin && records.length > 0 && <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginTop: rpxToPx(40), }}>
-                        {
-                            <Text className="discovery1" style={{ marginBottom: 0 }}>{t('feature.track_time_duration.record_fast_sleep.header.latest_record')}</Text>
-                        }
+                    user.isLogin && records.length > 0 && <View className="index_section" style={{ marginTop: -rpxToPx(25), marginBottom: -rpxToPx(20) }}>
+                        <Text className="index_section_title">{t('feature.track_time_duration.record_fast_sleep.header.latest_record')}</Text>
                         {
                             process.env.TARO_ENV == 'weapp' && <Text className="fast_sleep_more index_more" onClick={more}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</Text>
                         }
                         {
                             process.env.TARO_ENV == 'rn' && <View onClick={more}>
-                                <GradientText style={{ fontSize: rpxToPx(32), fontWeight: 'bold', marginRight: rpxToPx(46) }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</GradientText>
+                                <GradientText style={{ fontSize: rpxToPx(32), fontWeight: 'bold' }}>{t('feature.track_time_duration.record_fast_sleep.header.btn_show_all')}</GradientText>
                             </View>
                         }
                     </View>
@@ -859,11 +850,14 @@ export default function Page() {
                 }
 
                 {
-                    user.isLogin && !showErrorPage && <View style={{ marginTop: rpxToPx(60), display: 'flex', flexDirection: 'column' }}>
-                        <Text className="discovery1" >{t('feature.track_time_duration.weekly.title')}</Text>
+                    user.isLogin && !showErrorPage && <View style={{ display: 'flex', flexDirection: 'column' }}>
+                        <View className="index_section">
+                            <Text className="index_section_title">{t('feature.track_time_duration.weekly.title')}</Text>
+                        </View>
                         <WeekCalendar />
                     </View>
                 }
+
                 {
                     user.isLogin && <Streaks count={count} />
                 }
@@ -878,10 +872,20 @@ export default function Page() {
                     </View>
                 }
 
-                <View style={{ height: rpxToPx(40) }} />
+                <View className="index_section">
+                    <Text className="index_section_title">昼夜节律</Text>
+                </View>
                 <DayNightSwiper count={count} schedule={schedules} homeData={homeData} />
-                <View style={{ height: rpxToPx(20) }} />
-                <Discovery />
+                {
+                    process.env.TARO_ENV == 'weapp' && <View className="index_section">
+                        <Text className="index_section_title">日记</Text>
+                    </View>
+                }
+
+                {
+                    process.env.TARO_ENV == 'weapp' && <Discovery />
+                }
+
                 {
                     process.env.TARO_ENV == 'weapp' && <View style={{ height: 100 }} />
                 }

+ 8 - 8
src/pages/clock/SetGoal.tsx

@@ -19,7 +19,7 @@ import { getLocalPush } from "@/features/trackTimeDuration/actions/TrackTimeActi
 let OneSignal
 let NativeAppEventEmitter
 let Jto
-let uploadPermissions, checkNotification,PushNotification
+let uploadPermissions, checkNotification, PushNotification
 if (process.env.TARO_ENV == 'rn') {
     OneSignal = require('react-native-onesignal').OneSignal
     NativeAppEventEmitter = require('react-native').NativeAppEventEmitter
@@ -304,7 +304,7 @@ export default function SetGoal() {
             if (global.indexPageRefresh) {
                 global.indexPageRefresh()
             }
-
+            global.chooseMixed()
 
             if (process.env.TARO_ENV === 'rn') {
                 popRNAlert()
@@ -320,7 +320,7 @@ export default function SetGoal() {
     }
 
     function popAlert() {
-        global.chooseMixed()
+
 
         if (process.env.TARO_ENV === 'weapp') {
             Taro.navigateBack({ delta: 6 }).then(res => {
@@ -358,9 +358,9 @@ export default function SetGoal() {
 
     function popScheduleAlert(scenario, startTime) {
         if (process.env.TARO_ENV === 'rn') {
-            PushNotification.checkPermissions((res)=>{
+            PushNotification.checkPermissions((res) => {
                 //允许授权
-                if (res.authorizationStatus == 2){
+                if (res.authorizationStatus == 2) {
                     getLocalPush();
                     navigation.popToTop()
                     // showAlert({
@@ -408,9 +408,9 @@ export default function SetGoal() {
         if (process.env.TARO_ENV === 'rn') {
             // const JPush = require('jpush-react-native').default;
             const checkNotification = require('@/utils/native_permission_check').checkNotification;
-            PushNotification.checkPermissions((res)=>{
+            PushNotification.checkPermissions((res) => {
                 //允许授权
-                if (res.authorizationStatus == 2){
+                if (res.authorizationStatus == 2) {
                     getLocalPush();
                     navigation.popToTop()
                     // showAlert({
@@ -585,7 +585,7 @@ export default function SetGoal() {
             {
                 parseInt(router.params.isSelf + '') != 1 && <Text className="cell_footer">{t('feature.set_goal.footer')}</Text>
             }
-            
+
         </View>
 
         <View style={{ flex: 1 }} />

+ 78 - 37
src/pages/clock/Suggest.tsx

@@ -113,10 +113,10 @@ export default function Suggest() {
             setFastLastIndex(lastIndex)
             setSuggestItem(array)
             setSuggestIndex(currentIndex)
-            setScrollTop(currentIndex * (rpxToPx(92+28)+72)-30)
+            setScrollTop(currentIndex * (rpxToPx(92 + 28) + 72) - 30)
             if (process.env.TARO_ENV == 'rn') {
                 setTimeout(() => {
-                    (scrollViewRef.current as any).scrollTo({ x: 0, y: currentIndex * (rpxToPx(92+28)+72) - 30, animated: true })
+                    (scrollViewRef.current as any).scrollTo({ x: 0, y: currentIndex * (rpxToPx(92 + 28) + 72) - 30, animated: true })
                 }, 500)
             }
             else {
@@ -124,7 +124,7 @@ export default function Suggest() {
                     Taro.createSelectorQuery().select('#myScrollView').boundingClientRect((rect) => {
                         var screenHeight = Taro.getSystemInfoSync().screenHeight
                         var safeBottom = Taro.getSystemInfoSync().safeArea?.bottom
-                        setScrollHeight(Taro.getSystemInfoSync().windowHeight-(rect as any).top-rpxToPx(88)-50-(screenHeight-safeBottom)-rpxToPx(46));
+                        setScrollHeight(Taro.getSystemInfoSync().windowHeight - (rect as any).top - rpxToPx(88) - 50 - (screenHeight - safeBottom) - rpxToPx(46));
                     }).exec()
                 }, 100)
             }
@@ -352,24 +352,41 @@ export default function Suggest() {
         }
     }
 
+    function picker1() {
+        return <PickerViews ref={null}
+            onChange={timePickerChanged}
+            items={durationDatas()}
+            value={durationValues()} height={170}
+            title=''
+            themeColor={target.isMixed ? global.fastColor ? global.fastColor : ColorType.fast : global.sleepColor ? global.sleepColor : ColorType.sleep}
+            showBtns={false}
+            hideTitle={true}
+            onCancel={() => { }} />
+    }
+
     function timePicker() {
         return <View>
-            <View style={{
-                marginBottom: rpxToPx(40), marginLeft: rpxToPx(46),
-                marginRight: rpxToPx(46), borderRadius: 10,
-                overflow: 'hidden', backgroundColor: '#1c1c1c', paddingTop: 10, paddingBottom: 10
-            }}>
-                <PickerViews ref={null}
-                    onChange={timePickerChanged}
-                    items={durationDatas()}
-                    value={durationValues()} height={170}
-                    title=''
-                    themeColor={target.isMixed ? global.fastColor ? global.fastColor : ColorType.fast : global.sleepColor ? global.sleepColor : ColorType.sleep}
-                    showBtns={false}
-                    hideTitle={true}
-                    onCancel={() => { }} />
+            {
+                process.env.TARO_ENV == 'weapp' ? <View style={{
+                    marginBottom: rpxToPx(40), marginLeft: rpxToPx(46),
+                    marginRight: rpxToPx(46), borderRadius: 10,
+                    overflow: 'hidden', backgroundColor: '#1c1c1c', paddingTop: 10, paddingBottom: 10
+                }}>
+
+                    {picker1()}
+                </View> :
+                    <View style={{
+                        marginBottom: rpxToPx(40), marginLeft: rpxToPx(46),
+                        marginRight: rpxToPx(46), borderRadius: 10,
+                        overflow: 'hidden', backgroundColor: '#1c1c1c',
+                        height: 180,
+                        justifyContent: 'center'
+                    }}>
+
+                        {picker1()}
+                    </View>
+            }
 
-            </View>
             {
                 pageStep == 0 && <Text className="suggest_footer_note">{t('feature.suggest.end_fast_picker_footer')}</Text>
             }
@@ -387,25 +404,46 @@ export default function Suggest() {
         dispatch(updateSleep({ sleep: sleep }))
     }
 
+    function picker2() {
+        return <PickerViews ref={null}
+            onChange={fallSleepChanged}
+            items={sleepLatency()}
+            value={sleepLatencyValue()} height={170}
+            title=''
+            themeColor={target.isMixed ? global.fastColor ? global.fastColor : ColorType.fast : global.sleepColor ? global.sleepColor : ColorType.sleep}
+            showBtns={false}
+            hideTitle={true}
+            onCancel={() => { }} />
+    }
+
     function fallSleepPicker() {
         return <View>
             <View className="target_desc">{t('feature.suggest.fall_sleep_picker_header')}</View>
-            <View style={{
-                marginLeft: rpxToPx(46), marginRight: rpxToPx(46),
-                borderRadius: 10,
-                overflow: 'hidden', backgroundColor: '#1c1c1c', paddingTop: 10, paddingBottom: 10
-            }}>
-                <PickerViews ref={null}
-                    onChange={fallSleepChanged}
-                    items={sleepLatency()}
-                    value={sleepLatencyValue()} height={170}
-                    title=''
-                    themeColor={target.isMixed ? global.fastColor ? global.fastColor : ColorType.fast : global.sleepColor ? global.sleepColor : ColorType.sleep}
-                    showBtns={false}
-                    hideTitle={true}
-                    onCancel={() => { }} />
+            {
+                process.env.TARO_ENV == 'weapp' ? <View style={{
+                    marginLeft: rpxToPx(46), marginRight: rpxToPx(46),
+                    borderRadius: 10,
+                    overflow: 'hidden', backgroundColor: '#1c1c1c', paddingTop: 10, paddingBottom: 10
+                }}>
+
+                    {
+                        picker2()
+                    }
+                </View> :
+                    <View style={{
+                        marginLeft: rpxToPx(46), marginRight: rpxToPx(46),
+                        borderRadius: 10,
+                        overflow: 'hidden', backgroundColor: '#1c1c1c', 
+                        justifyContent:'center',
+                        height:180
+                    }}>
+
+                        {
+                            picker2()
+                        }
+                    </View>
+            }
 
-            </View>
             <Text className="suggest_footer_note">{t('feature.suggest.fall_sleep_picker_footer')}</Text>
         </View>
     }
@@ -575,7 +613,7 @@ export default function Suggest() {
             </ScrollViewRN>
         }
 
-        return <View style={{ flex: 1, overflow: 'scroll' }}>
+        return <View style={{ height:400 }}>
             {
                 suggestItems.map((item: any, index: number) => {
                     return <View key={index} className={suggestIndex == index ? 'item1 item_sel1' : 'item1'} style={{ borderColor: suggestIndex == index ? ColorType.sleep : '#00000000' }} onClick={() => setSuggestIndex(index)}>
@@ -616,7 +654,7 @@ export default function Suggest() {
     }
 
     function content() {
-        return <View style={{  display: 'flex', flexDirection: 'column' }}>
+        return <View style={{ display: 'flex', flexDirection: 'column' }}>
             {
                 (pageStep == 0 || pageStep == 2) && timePicker()
             }
@@ -630,7 +668,7 @@ export default function Suggest() {
                 pageStep == 2 && fallSleepPicker()
             }
             {
-                pageStep == 2 && <View style={{ height: 200 }} />
+                pageStep == 2 && process.env.TARO_ENV=='weapp' && <View style={{ height: 200 }} />
             }
         </View>
     }
@@ -652,6 +690,9 @@ export default function Suggest() {
         {
             content()
         }
+        {
+            process.env.TARO_ENV == 'rn' && <View style={{ flex: 1 }} />
+        }
 
         <Footer>
             <View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
@@ -664,7 +705,7 @@ export default function Suggest() {
             </View>
         </Footer>
         {
-            process.env.TARO_ENV == 'rn' && <View style={{ marginBottom: 40 }} />
+            process.env.TARO_ENV == 'rn' && <View style={{ marginBottom: 20 }} />
         }
 
     </View>

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