leon 1 vuosi sitten
vanhempi
commit
59db14a6a4

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
android/app/src/main/assets/index.android.bundle


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
android/app/src/main/assets/index.android.map


+ 1 - 1
android/app/src/main/jni/CMakeLists.txt

@@ -2,4 +2,4 @@ cmake_minimum_required(VERSION 3.13)
 # Define the library name here.
 project(rndiffapp_appmodules)
 # This file includes all the necessary to let you build your application with the New Architecture.
-include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
+include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)/Users/hechao/Downloads/alert-circle.svg

+ 1 - 1
ios/AppDelegate.mm

@@ -131,7 +131,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
 {
 //  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
-#if DEBUGaaa
+#if DEBUGaa
   return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
 #else
   return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

BIN
ios/assets/src/assets/images/center.png


BIN
ios/assets/src/assets/images/current_location.png


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
ios/main.jsbundle


+ 1 - 0
package.json

@@ -103,6 +103,7 @@
 		"react-native-device-info": "~10.3.0",
 		"react-native-gesture-handler": "~2.9.0",
 		"react-native-haptic-feedback": "^2.2.0",
+		"react-native-leaflet-maps": "^0.2.1",
 		"react-native-linear-gradient": "^2.8.3",
 		"react-native-localize": "^3.1.0",
 		"react-native-onesignal": "^5.1.3",

+ 1 - 1
src/app.scss

@@ -305,7 +305,7 @@ page {
 
 .cell_line {
     margin-left: 0px;
-    height: 1px;
+    height: 2px;
     background-color: #323232;
     transform: scaleY(0.5);
 }

BIN
src/assets/images/center.png


BIN
src/assets/images/current_location.png


BIN
src/assets/images/location_point.png


+ 14 - 0
src/components/input/LimitPickers.scss

@@ -14,6 +14,20 @@
     z-index: 9;
 }
 
+.picker-mask-small{
+    max-width: auto;
+    // background: red;
+    background: linear-gradient(0deg, rgba(28, 28, 28, 1) 0%,
+            rgba(28, 28, 28, 0) 45%,
+            rgba(28, 28, 28, 0) 55%,
+            rgba(28, 28, 28, 1) 100%);
+    background-size: 750px 340px !important;
+    height: 340px ;
+    background-position: center center;
+    background-repeat: no-repeat;
+    z-index: 9;
+}
+
 .picker {
     background-size: 750px 500px !important;
     height: 500px;

+ 0 - 1
src/components/input/PickerViews.scss

@@ -1,7 +1,6 @@
 /* #ifdef weapp */
 .picker-mask {
     max-width: auto;
-    // background: red;
     background: linear-gradient(0deg, rgba(28, 28, 28, 1) 0%,
             rgba(28, 28, 28, 0) 45%,
             rgba(28, 28, 28, 0) 55%,

+ 2 - 2
src/components/input/PickerViews.tsx

@@ -58,12 +58,12 @@ const Component = forwardRef((props: {
         <PickerView value={v}
             // color='#fff'
             itemStyle={{ color: '#fff' }}
-            style={{ color: '#fff' }}
+            style={{ color: '#fff',height:rpxToPx(340) }}
             onChange={onPickerChange}
             indicatorStyle='height: 40px;'
             immediateChange={true}
             className="picker"
-            maskClass="picker-mask"
+            maskClass={props.hideTitle?"picker-mask-small":"picker-mask"}
         >
             {
                 props.items.map((item, index) => {

+ 6 - 0
src/context/locales/en.js

@@ -114,6 +114,7 @@ export default {
             base:'Reminders',
             base_schedule_time:'At schedule time',
             always:'Always',
+            off:'Off',
             base_footer:'A timely reminder so you never miss your schedule time for fasting and/or sleep.',
             extra:'Extra Reminders',
             missed_action:'Missed previous action',
@@ -124,6 +125,11 @@ export default {
             sunrise:'Sunrise',
             sunset:'Sunset',
             solarnoon:'Solar noon',
+            pro_feature:'Pro Feature',
+            pro_sun_desc:'Unlock exclusive features such as reminders for daily sunrise, sunset, etc.',
+            become_pro:'Become a Pro Member',
+            not_now:'Not now',
+            open:'Follow'
         }
     },
     feature: {

+ 13 - 7
src/context/locales/zh.js

@@ -40,7 +40,7 @@ export default {
             title: '我',
             un_login: '未登录',
             stone: '成为 Pro 会员',
-            stone_desc: '更多高级会员专属功能,敬请期待!',
+            stone_desc: '解锁会员专享功能。',
             pro_member:'Pro 会员',
             member_desc:'{{time}} 到期。',
             setting: '设置',
@@ -113,16 +113,22 @@ export default {
             base:'基础',
             base_schedule_time:'打卡提醒',
             always:'已开启',
-            base_footer:'到了开始断食或就寝时间,收到打卡提醒一次。',
-            extra:'外加',
+            off:'未开启',
+            base_footer:'日程开始及进程结束,收到提醒。',
+            extra:'额外',
             missed_action:'补记提醒',
-            extra_footer:'当错过开始时间仍未打卡,到了结束时间可收到补记提醒、避免连续纪录中断。',
-            sun:'昼夜与阴阳 (Pro 会员专享)',
-            sun_header:'基于太阳运动轨迹,安排每日饮食作息时间表。',
-            sun_footer:'支持全球任意位置。如您位于极地地区,由于极昼期间太阳位于地平线以上、极夜期间太阳地平线以下,您只会在“正午”太阳位于相对最高点时收到提醒。',
+            extra_footer:'日程结束时间仍未打卡,收到提醒。及时补记将避免连续纪录中断。',
+            sun:'昼夜与阴阳 (Pro)',
+            sun_header:'顺应天时,改善进食、断食及作息时间',
+            sun_footer:'支持全球任意位置。如您位于极地地区,由于极昼期间太阳总在地平线以上、极夜期间太阳总在地平线以下,仅支持太阳位于相对高点的“正午”提醒。',
             sunrise:'日出',
             sunset:'日落',
             solarnoon:'正午',
+            pro_feature:'会员功能',
+            pro_sun_desc:'解锁日出日落提醒等会员功能。',
+            become_pro:'成为 Pro 会员',
+            not_now:'暂不',
+            open:'立即开启'
         }
 
 

+ 15 - 1
src/features/daynight/DayNightDetailPopup.tsx

@@ -12,6 +12,7 @@ import dayjs, { Dayjs } from 'dayjs'
 import showAlert from '@/components/basic/Alert'
 import { AtActivityIndicator } from 'taro-ui'
 import showActionSheet from '@/components/basic/ActionSheet'
+import { jumpPage } from '../trackTimeDuration/hooks/Common'
 
 
 const utc = require('dayjs/plugin/utc')
@@ -20,10 +21,11 @@ const timezone = require('dayjs/plugin/timezone')
 dayjs.extend(utc)
 dayjs.extend(timezone)
 
-let LinearGradient, useActionSheet
+let LinearGradient, useActionSheet,useNavigation
 if (process.env.TARO_ENV == 'rn') {
     LinearGradient = require('react-native-linear-gradient').default
     useActionSheet = require('@expo/react-native-action-sheet').useActionSheet
+    useNavigation = require("@react-navigation/native").useNavigation
 }
 export default function DayNightDetailPopup(props: {
     isNight: boolean,
@@ -38,6 +40,10 @@ export default function DayNightDetailPopup(props: {
     const user = useSelector((state: any) => state.user);
     const [tabIndex, setTabIndex] = useState(0)
     const [isLoading, setIsLoading] = useState(false)
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
     const { t } = useTranslation()
 
     let showActionSheetWithOptions;
@@ -585,6 +591,14 @@ export default function DayNightDetailPopup(props: {
         if (process.env.TARO_ENV == 'weapp') {
             e.stopPropagation()
         }
+        else {
+            jumpPage('','map',navigation)
+            if (props.onClose){
+                props.onClose()
+            }
+            
+            return
+        }
         // else {
         //     props.onClose()
         // }

+ 6 - 5
src/features/daynight/DayNightSwiper.tsx

@@ -9,6 +9,7 @@ import AllRings from "./AllRings";
 import AllDayRings from "./AllDayRings";
 import DayNightSwiperPopup from "./DayNightSwiperPopup";
 import { kIsIOS, rpxToPx } from "@/utils/tools";
+import dayjs from "dayjs";
 
 let locationObj
 
@@ -106,8 +107,8 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
                     list.push({
                         channel_id: 'REMINDER_SUN',
                         category_id: 'REMINDER_SUN_RISE',
-                        title: 'Sunrise',
-                        body: `Daylight lasts ${dayDuration}`,
+                        title: `Sunrise at ${dayjs(item.sunrise_ts).format('HH:mm')}`,
+                        body: `Daylight lasts ${dayDuration}.`,
                         timestamp: item.sunrise_ts
                     })
                 }
@@ -115,8 +116,8 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
                     list.push({
                         channel_id: 'REMINDER_SUN',
                         category_id: 'REMINDER_SUN_SET',
-                        title: 'Sunset',
-                        body: `The night lasts ${nightDuration}`,
+                        title: `Sunset at ${dayjs(item.sunset_ts).format('HH:mm')}`,
+                        body: `The night lasts ${nightDuration}.`,
                         timestamp: item.sunset_ts
                     })
                 }
@@ -124,7 +125,7 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
                     list.push({
                         channel_id: 'REMINDER_SUN',
                         category_id: 'REMINDER_SUN_SOLAR_NOON',
-                        title: 'Solar Noon',
+                        title: `Solar Noon at ${dayjs(item.solar_noon_ts).format('HH:mm')}`,
                         body: 'The Sun is currently at its highest point in the sky for the day.',
                         timestamp: item.solar_noon_ts
                     })

+ 1 - 1
src/features/trackTimeDuration/components/IndexConsoleMuti.scss

@@ -19,7 +19,7 @@
 }
 
 .new_item_cell_line{
-    height: 1px;
+    height: 2px;
     background-color: #fff;
     opacity: 0.2;
     margin-left: 40px;

+ 4 - 4
src/features/trackTimeDuration/components/TotalTime.tsx

@@ -101,7 +101,7 @@ export default function TotalTime(props: { record: any }) {
                         opacity: props.record.status == 'WAIT_FOR_START' ? 0.2 : 1
                     }}>{fastGoingText()}</Text>
             </View>
-            <View className="cell_line" style={{ height: 1 }} />
+            <View className="cell_line" />
             <View className="cell_full" >
                 <Text className="cell_title" style={{ opacity: 0.2 }}>{new Date().getTime() < props.record.fast.target_end_time ? '距结束' : '已超时'}</Text>
                 <Text className="cell_value" style={{ opacity: 0.2 }}>{fastEndText()}</Text>
@@ -119,7 +119,7 @@ export default function TotalTime(props: { record: any }) {
                     opacity: props.record.status == 'WAIT_FOR_START' || props.record.status == 'ONGOING1' ? 0.2 : 1
                 }}>{sleepGoingText()}</Text>
             </View>
-            <View className="cell_line" style={{ height: 1 }} />
+            <View className="cell_line"  />
             <View className="cell_full" >
                 <Text className="cell_title" style={{ opacity: 0.2 }}>{new Date().getTime() < props.record.sleep.target_end_time ? '距结束' : '已超时'}</Text>
                 <Text className="cell_value" style={{ opacity: 0.2 }}>{sleepEndText()}</Text>
@@ -145,7 +145,7 @@ export default function TotalTime(props: { record: any }) {
                                 {!disableChange(true) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
                             </View>
                     }
-                    <View className="cell_line" style={{ height: 1 }} />
+                    <View className="cell_line" />
                     {
                         props.record.status == 'COMPLETED' ?
                             <View className="cell_full" onClick={setFastDuration}>
@@ -175,7 +175,7 @@ export default function TotalTime(props: { record: any }) {
                             {!disableChange(false) && <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />}
                         </View>
                     }
-                    <View className="cell_line" style={{ height: 1 }} />
+                    <View className="cell_line" />
                     {
                         props.record.status == 'COMPLETED' || props.record.status == 'ONGOING3' ?
                             // <View className="cell_full" onClick={setSleepDuration}>

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

@@ -190,7 +190,7 @@ export default function Page() {
             return dayjs(accessObj.access.member.expire).format('MMM D HH:mm')
         }
 
-        return dayjs(accessObj.access.member.expire).format('MM月DD日 HH:mm')
+        return dayjs(accessObj.access.member.expire).format('YYYY年MM月DD日 HH:mm')
     }
 
     function detail() {

+ 3 - 3
src/pages/clock/ClockMain.tsx

@@ -268,16 +268,16 @@ export default function Page() {
             return;
         }
 
-        const showAlert1 = await getStorage('121alert') || false;
+        const showAlert1 = await getStorage('146alert') || false;
         if (!showAlert1) {
             showAlert({
                 title: '重要更新提示',
-                content: '🔥 连续打卡天数现根据结束日期统计;\n 🪐 断食与睡眠升级为高级功能。\n连续打卡的老用户仍可继续使用。\n更多高级功能如『进食窗口』显示、『社区排行』等敬请期待!',
+                content: '⏰ 提醒:自定义断食睡眠提醒;\n💎 会员:每日日出/日落/正午时分提醒。',
                 showCancel: false,
                 confirmText: '我知道了'
             })
         }
-        Taro.setStorage({ key: '121alert', data: true })
+        Taro.setStorage({ key: '146alert', data: true })
 
     }
 

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

@@ -502,7 +502,7 @@ export default function SetGoal() {
                     <Text className="cell_value" style={{ color: ColorType.fast }}>{fastDuration}</Text>
                 </View>
                 {
-                    target.isMixed && <View className="cell_line" style={{ marginLeft: -rpxToPx(46), marginRight: -rpxToPx(46) }} />
+                    target.isMixed && <View className="cell_line" style={{ marginLeft: -rpxToPx(0), marginRight: -rpxToPx(46) }} />
                 }
                 {
                     target.isMixed && <View className="cell_full" style={{
@@ -537,7 +537,7 @@ export default function SetGoal() {
                     <View className="cell_line" style={{ height: 1 }} />
                 </View>
                 {
-                    target.isMixed && <View className="cell_line" style={{ marginLeft: -rpxToPx(46), marginRight: -rpxToPx(46) }} />
+                    target.isMixed && <View className="cell_line" style={{ marginLeft: -rpxToPx(0), marginRight: -rpxToPx(46) }} />
                 }
                 {
                     target.isMixed && <View className="cell_top" style={{
@@ -557,7 +557,7 @@ export default function SetGoal() {
                     </View>
                 }
                 {
-                    target.isMixed && <View className="cell_line" style={{ marginLeft: -rpxToPx(46), marginRight: -rpxToPx(46) }} />
+                    target.isMixed && <View className="cell_line" style={{ marginLeft: -rpxToPx(0), marginRight: -rpxToPx(46) }} />
                 }
                 {
                     target.isMixed && <View className="cell_bottom" style={{
@@ -576,7 +576,7 @@ export default function SetGoal() {
                         <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
                     </View>
                 }
-                <View className="cell_line" style={{ marginLeft: -rpxToPx(46), marginRight: -rpxToPx(46) }} />
+                <View className="cell_line" style={{ marginLeft: rpxToPx(0), marginRight: -rpxToPx(46) }} />
 
                 <View className="cell_bottom" style={{
                     marginLeft: 0,

+ 1 - 0
src/pages/clock/Suggest.tsx

@@ -380,6 +380,7 @@ export default function Suggest() {
                 process.env.TARO_ENV == 'weapp' ? <View style={{
                     marginLeft: rpxToPx(46),
                     marginRight: rpxToPx(46), borderRadius: 10,
+                    height:180,
                     overflow: 'hidden', backgroundColor: '#1c1c1c', paddingTop: 10, paddingBottom: 10
                 }}>
 

+ 13 - 0
src/pages/map/map.scss

@@ -0,0 +1,13 @@
+.topView{
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    align-items: center;
+    justify-content: center;
+    pointer-events: none;
+    background-color: red;
+    opacity: 0.5;
+
+}

+ 190 - 0
src/pages/map/map.tsx

@@ -0,0 +1,190 @@
+import { View, StyleSheet } from "react-native";
+import { Image, Text } from "@tarojs/components";
+import './map.scss'
+import { useEffect, useRef, useState } from "react";
+import Taro from "@tarojs/taro";
+import { LeafletView } from 'react-native-leaflet-maps';
+import { useNavigation } from "@react-navigation/native";
+import { TimeFormatter } from "@/utils/time_format";
+import { systemLocation } from "@/services/common";
+
+// let LeafletView = require('react-native-leaflet-maps').LeafletView
+let location:any = null
+export default function map() {
+    // const [location, setLocation] = useState<any>(null)
+    const navigation = useNavigation()
+    const [current, setCurrent] = useState<any>(null)
+    const [show, setShow] = useState(false)
+    const [count, setCount] = useState(0)
+
+    useEffect(() => {
+        navigation.setOptions({
+            headerTitle: '',
+            headerRight: () => {
+                return <View>
+                    <Text onClick={confirmChoose} style={{ color: '#fff', marginRight: 15 }}>Done</Text>
+                </View>
+            }
+        });
+        getCurrent()
+    }, [])
+
+    function confirmChoose() {
+        var today = new Date()
+        var yesterday = new Date(today.getTime() - 24 * 3600 * 1000)
+        var tomorrow = new Date(today.getTime() + 24 * 3600 * 1000)
+        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())}`
+
+        systemLocation({
+            lat: (location as any).lat,
+            lng: (location as any).lng,
+            date_start: strYesterday,
+            date_end: strTomorrow,
+            coordinate_system_standard: process.env.TARO_ENV == 'weapp' ? 'GCJ-02' : 'WGS-84'
+        }).then(data => {
+            global.locationDetail = data
+            Taro.setStorage({
+                key: 'gps',
+                data: JSON.stringify(data as any)
+            })
+
+            if (global.swiperDayNightRefresh) {
+                global.swiperDayNightRefresh()
+            }
+            if (global.updateSwiper) {
+                global.updateSwiper()
+            }
+            global.refreshNight()
+            global.refreshDay()
+
+            navigation.goBack()
+        })
+    }
+
+    function getCurrent() {
+        Taro.getLocation({
+            success(res) {
+                setShow(true)
+                setCurrent(res)
+                location = {
+                    lat: (res as any).latitude, lng: (res as any).longitude
+                }
+            }
+        })
+    }
+
+
+    function showCurrent() {
+        getCurrent()
+    }
+
+    function centerPosition() {
+        if (current) {
+            return { lat: current.latitude, lng: current.longitude }
+        }
+        return null
+    }
+
+    function mapMarkers() {
+        const icon = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1721280834380" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8231" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M511.999097 511.999097m-486.524133 0a486.524133 486.524133 0 1 0 973.048266 0 486.524133 486.524133 0 1 0-973.048266 0Z" fill="#286FB7" opacity=".2" p-id="8232"></path><path d="M511.999097 511.999097m-307.200542 0a307.200542 307.200542 0 1 0 614.401084 0 307.200542 307.200542 0 1 0-614.401084 0Z" fill="#FFFFFF" p-id="8233"></path><path d="M511.999097 511.999097m-257.688367 0a257.688367 257.688367 0 1 0 515.376734 0 257.688367 257.688367 0 1 0-515.376734 0Z" fill="#4575F6" p-id="8234"></path></svg>'
+        if (current) {
+            return [{
+                id: 9527,
+                position: {
+                    lat: current.latitude,
+                    lng: current.longitude
+                },
+                icon: `<div style="width: 24px; height: 24px; background-color: #286FB752; border-radius: 50%;display:flex;align-items:center;justify-content:center;">
+                    <div style="width: 16px; height: 16px; background-color: #fff;; border-radius: 50%;display:flex;align-items:center;justify-content:center">
+                    <div style="width: 12px; height: 12px; background-color: #4575F6; border-radius: 50%;display:flex;align-items:center;justify-content:center">
+                    </div>
+                    </div>
+                </div>`,
+                // icon:
+                //     require('@/assets/images/current_location.png'),
+                // icon: this.state.user_last_car,
+                size: [32, 32],
+            }]
+        }
+        return []
+    }
+
+    return <View style={{ flex: 1 }}>
+        <LeafletView
+            style={{ flex: 1 }}
+            zoom={10}
+            mapCenterPosition={centerPosition()}
+            mapMarkers={mapMarkers()}
+            onMessageReceived={e => {
+                // console.log(e)
+                // setCount(count => count + 1)
+                // if (e.payload && e.payload.mapCenterPosition)
+                //     location = e.payload.mapCenterPosition
+                // if (e.event && e.event == 'onMoveEnd') {
+                //     if (e.payload && e.payload.mapCenterPosition)
+                //         setLocation(e.payload.mapCenterPosition)
+                // }
+                // setTimeout(() => {
+                //     if (e.payload && e.payload.mapCenterPosition)
+                //         setLocation(e.payload.mapCenterPosition)
+                // }, 500)
+                // if (e.payload && e.payload.mapCenterPosition)
+                //     setLocation(e.payload.mapCenterPosition)
+            }}
+        />
+        <View style={styles.overlayView}
+            pointerEvents="none"
+        >
+            <Image src={require('@/assets/images/center.png')} style={styles.center} />
+        </View>
+        <Image src={require('@/assets/images/current_location.png')} onClick={showCurrent} style={styles.location_btn} />
+        <View style={styles.footer}>
+            {
+                location && <Text style={{ fontSize: 14, color: '#000' }}>Center位置:lat {(location as any).lat.toFixed(4)} lng {(location as any).lng.toFixed(4)}</Text>
+            }
+        </View>
+    </View>
+}
+
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+    },
+    scrollContent: {
+        // 您的滚动内容样式
+    },
+    overlayView: {
+        // 覆盖视图样式
+        position: 'absolute',
+        top: 0,
+        left: 0,
+        right: 0,
+        bottom: 0,
+        alignItems: 'center',
+        justifyContent: 'center'
+    },
+    center: {
+        width: 40,
+        height: 40,
+        marginBottom: 25
+    },
+    location_btn: {
+        position: 'absolute',
+        left: 40,
+        bottom: 80,
+        width: 40,
+        height: 40
+    },
+    footer: {
+        position: 'absolute',
+        left: 50,
+        right: 50,
+        bottom: 30,
+        backgroundColor: '#fff',
+        alignItems: 'center',
+        justifyContent: 'center',
+        height: 30
+    }
+
+});

+ 1 - 1
src/pages/notification/setting.scss

@@ -35,7 +35,7 @@
 }
 
 .setting_footer {
-    font-size: 28px;
+    font-size: 24px;
     margin-bottom: 40px;
     color: #fff;
     opacity: 0.2;

+ 44 - 31
src/pages/notification/setting.tsx

@@ -36,6 +36,7 @@ let Jto
 let PushNotification
 let checkNotification
 let Linking;
+let LeafletView;
 if (process.env.TARO_ENV == 'rn') {
     OneSignal = require('react-native-onesignal').OneSignal
     NativeAppEventEmitter = require('react-native').NativeAppEventEmitter
@@ -46,6 +47,8 @@ if (process.env.TARO_ENV == 'rn') {
     AppState = require("react-native").AppState
     useNavigation = require("@react-navigation/native").useNavigation
     Linking = require('react-native').Linking;
+
+    LeafletView = require('react-native-leaflet-maps').LeafletView
 }
 export default function Page() {
     const { t } = useTranslation()
@@ -84,7 +87,7 @@ export default function Page() {
     }
 
     useEffect(() => {
-        
+
         setInterval(() => {
             setIndex(index => index + 1)
         }, 1000)
@@ -371,12 +374,12 @@ export default function Page() {
     function alertPop() {
         return <View className="fast_alert_container">
             <View className="fast_alert_content" catchMove>
-                <View className="fast_alert_title">Pro Access</View>
-                <View className="fast_alert_detail">With Pro Membership, you can set custom reminders and will be reminded even when you're not actively using the app.</View>
+                <View className="fast_alert_title">{t('page.reminders.pro_feature')}</View>
+                <View className="fast_alert_detail">{t('page.reminders.pro_sun_desc')}</View>
                 <View className='fast_alert_confirm' onClick={confirm}>
-                    <Text style={{ fontWeight: 'bold', color: ColorType.black }}>Become a Pro Member</Text>
+                    <Text style={{ fontWeight: 'bold', color: ColorType.black }}>{t('page.reminders.become_pro')}</Text>
                 </View>
-                <View className="fast_alert_cancel" onClick={() => { setShowMemberAlert(false) }}>Not now</View>
+                <View className="fast_alert_cancel" onClick={() => { setShowMemberAlert(false) }}>{t('page.reminders.not_now')}</View>
 
             </View>
         </View>
@@ -390,33 +393,34 @@ export default function Page() {
                     setIsAuthorized(true)
                 }
                 else {
-                    showAlert({
-                        title: 'title',
-                        content: 'content',
-                        cancelText: t('feature.track_time_duration.reminders.later'),
-                        confirmText: t('feature.track_time_duration.reminders.open'),
-                        showCancel: true,
-                        cancel: () => {
-                        },
-                        confirm: () => {
-                            if (process.env.TARO_ENV == 'weapp') {
-                                followWxPub()
-                            }
-                            else {
-                                checkNotification()
-                            }
-
-                        }
-                    })
+                    checkNotification()
+                    // showAlert({
+                    //     title: 'Allow Notification',
+                    //     content: 'content',
+                    //     cancelText: t('feature.track_time_duration.reminders.later'),
+                    //     confirmText: t('feature.track_time_duration.reminders.open'),
+                    //     showCancel: true,
+                    //     cancel: () => {
+                    //     },
+                    //     confirm: () => {
+                    //         if (process.env.TARO_ENV == 'weapp') {
+                    //             followWxPub()
+                    //         }
+                    //         else {
+                    //             checkNotification()
+                    //         }
+
+                    //     }
+                    // })
                 }
             })
         }
         else {
             showAlert({
                 title: '关注公众号',
-                content: 'content',
-                cancelText: t('feature.track_time_duration.reminders.later'),
-                confirmText: t('feature.track_time_duration.reminders.open'),
+                content: '以开启消息提醒。',
+                cancelText: t('page.reminders.not_now'),
+                confirmText: t('page.reminders.open'),
                 showCancel: true,
                 cancel: () => {
                 },
@@ -625,8 +629,8 @@ export default function Page() {
             }
             else {
                 Taro.showToast({
-                    icon:'none',
-                    title:t('feature.day_night.location_updated')
+                    icon: 'none',
+                    title: t('feature.day_night.location_updated')
                 })
             }
         })
@@ -698,7 +702,15 @@ export default function Page() {
     }
 
     function proDetail(isLogin: boolean) {
+
         return <View className="setting_container">
+            {/* {
+            process.env.TARO_ENV == 'rn' && <LeafletView
+                onMessageReceived={e=>{
+                    console.log(e)
+                }}
+            />
+        } */}
             <View className="setting_section">
                 <Text className="setting_section_title">{t('page.reminders.fast_sleep')}</Text>
             </View>
@@ -706,8 +718,8 @@ export default function Page() {
             <View className="setting_cell">
                 <Text className="setting_cell_title" style={{ flex: 1 }}>{t('page.reminders.base_schedule_time')}</Text>
                 {
-                    isLogin ? <Text className="setting_cell_value1">{systemFast ? t('page.reminders.always') : 'Off'}</Text> :
-                        <Text className="setting_cell_value1">Off</Text>
+                    isLogin ? <Text className="setting_cell_value1">{systemFast ? t('page.reminders.always') : t('page.reminders.off')}</Text> :
+                        <Text className="setting_cell_value1">{t('page.reminders.off')}</Text>
                 }
 
             </View>
@@ -889,7 +901,7 @@ export default function Page() {
                                     }
                                 }
                             }).then(res => {
-                                
+
                                 setIsSolarNoon(value)
                                 global.swiperDayNightRefresh()
                             })
@@ -932,6 +944,7 @@ export default function Page() {
                     pro(false)
                 }
             </Layout>
+            <Tabbar index={2} />
         </View>
 
     function headerView() {

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

@@ -26,6 +26,7 @@ import H5 from '@/pages/common/H5';
 import NotificationSetting from '@/pages/notification/setting';
 import { Image, PixelRatio } from 'react-native';
 import ProductList from '../store/product_list';
+import map from '../map/map';
 // import { View,Image } from '@tarojs/components';
 
 // 创建底部 Tab 导航器
@@ -258,6 +259,9 @@ export default function RNMain() {
         <Stack.Screen name='ProductList' component={ProductList} options={{
           headerBackTitle: ' '
         }} />
+        <Stack.Screen name='map' component={map} options={{
+          headerBackTitle: ' '
+        }} />
         {/* <Stack.Screen name='NotificationSetting' component={NotificationSetting} options={{
           headerBackTitle: ' '
         }} /> */}

+ 81 - 3
yarn.lock

@@ -13409,6 +13409,16 @@ lazy-cache@^1.0.3:
   resolved "https://registry.npmmirror.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
   integrity sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==
 
+leaflet.markercluster@^1.4.1:
+  version "1.5.3"
+  resolved "https://registry.yarnpkg.com/leaflet.markercluster/-/leaflet.markercluster-1.5.3.tgz#9cdb52a4eab92671832e1ef9899669e80efc4056"
+  integrity sha512-vPTw/Bndq7eQHjLBVlWpnGeLa3t+3zGiuM7fJwCkiMFq+nmRuG3RI3f7f4N4TDX7T4NpbAXpR2+NTRSEGfCSeA==
+
+leaflet@^1.6.0:
+  version "1.9.4"
+  resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.9.4.tgz#23fae724e282fa25745aff82ca4d394748db7d8d"
+  integrity sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==
+
 less-loader@10.2.0:
   version "10.2.0"
   resolved "https://registry.npmmirror.com/less-loader/-/less-loader-10.2.0.tgz#97286d8797dc3dc05b1d16b0ecec5f968bdd4e32"
@@ -16720,6 +16730,25 @@ react-is@^17.0.1:
   resolved "https://registry.npmmirror.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
   integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
 
+react-leaflet-markercluster@^2.0.0-rc3:
+  version "2.0.0"
+  resolved "https://registry.yarnpkg.com/react-leaflet-markercluster/-/react-leaflet-markercluster-2.0.0.tgz#e0138b89a1b9c5cf752c9a8ec80231588ab46b38"
+  integrity sha512-X1OuaMf4LeAQap638+X46+AN7ZqJKZse84o964brKj4AVVifs4fKCxTTFH6+MoyIarbWvF8x6tJ4vxT2BtxLYg==
+  dependencies:
+    leaflet "^1.6.0"
+    leaflet.markercluster "^1.4.1"
+    react-leaflet "^2.6.3"
+
+react-leaflet@^2.6.1, react-leaflet@^2.6.3:
+  version "2.8.0"
+  resolved "https://registry.yarnpkg.com/react-leaflet/-/react-leaflet-2.8.0.tgz#14bfc77b6ae8263d3a62e0ba7a39539c05973c6f"
+  integrity sha512-Y7oHtNrrlRH8muDttXf+jZ2Ga/X7jneSGi1GN8uEdeCfLProTqgG2Zoa5TfloS3ZnY20v7w+DIenMG59beFsQw==
+  dependencies:
+    "@babel/runtime" "^7.12.1"
+    fast-deep-equal "^3.1.3"
+    hoist-non-react-statics "^3.3.2"
+    warning "^4.0.3"
+
 react-lifecycles-compat@^3.0.4:
   version "3.0.4"
   resolved "https://registry.npmmirror.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
@@ -16799,6 +16828,15 @@ react-native-known-styling-properties@^1.0.4:
   resolved "https://registry.npmmirror.com/react-native-known-styling-properties/-/react-native-known-styling-properties-1.2.0.tgz#5370f87af605c6c516178bac4eb1493cdf160f36"
   integrity sha512-nrsxo8t1FjMJILe9hoRC1WtfXw7gBs/Cq7Gcts8soDDhN0RjoFu9bJtphJGYC2fs9B2ANYOdEoP4B4tiinkwgw==
 
+react-native-leaflet-maps@^0.2.1:
+  version "0.2.1"
+  resolved "https://registry.yarnpkg.com/react-native-leaflet-maps/-/react-native-leaflet-maps-0.2.1.tgz#0efea39b73551b6136a6d5453facf5c6d8bfc5e1"
+  integrity sha512-cx7gqPxJWx7QQuxMJjTzTfrX0x9/x8dhtYJ62lgSGDV9zFpPxSfTvSax6MDgZWSFM4JiDR2dk0tv/q6wXDx87Q==
+  dependencies:
+    react-leaflet "^2.6.1"
+    react-leaflet-markercluster "^2.0.0-rc3"
+    react-native-webview "^11.26.0"
+
 react-native-linear-gradient@^2.8.3:
   version "2.8.3"
   resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.8.3.tgz#9a116649f86d74747304ee13db325e20b21e564f"
@@ -16924,6 +16962,14 @@ react-native-syan-image-picker@0.5.3:
   resolved "https://registry.npmmirror.com/react-native-syan-image-picker/-/react-native-syan-image-picker-0.5.3.tgz#4d1f164449abac11f60cde337ad1ac22ef554b19"
   integrity sha512-jDHKiv6jPrC3Dslhq2tDjqYC27HE0sNRzpthOY1//THgQpJ0Ht7B6EHvllWVaMw0V41kFVMixLxVQTMu/V7RSw==
 
+react-native-webview@^11.26.0:
+  version "11.26.1"
+  resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-11.26.1.tgz#658c09ed5162dc170b361e48c2dd26c9712879da"
+  integrity sha512-hC7BkxOpf+z0UKhxFSFTPAM4shQzYmZHoELa6/8a/MspcjEP7ukYKpuSUTLDywQditT8yI9idfcKvfZDKQExGw==
+  dependencies:
+    escape-string-regexp "2.0.0"
+    invariant "2.2.4"
+
 react-native-webview@~11.23.0:
   version "11.23.1"
   resolved "https://registry.npmmirror.com/react-native-webview/-/react-native-webview-11.23.1.tgz#6a4bf2620e491dd4fecf4e6dc079005117fae12c"
@@ -18511,7 +18557,7 @@ string-hash-64@1.0.3:
   resolved "https://registry.yarnpkg.com/string-hash-64/-/string-hash-64-1.0.3.tgz#0deb56df58678640db5c479ccbbb597aaa0de322"
   integrity sha512-D5OKWKvDhyVWWn2x5Y9b+37NUllks34q1dCDhk/vYcso9fmhs+Tl3KR/gE4v5UNj2UA35cnX4KdVVGkG1deKqw==
 
-"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
+"string-width-cjs@npm:string-width@^4.2.0":
   version "4.2.3"
   resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
   integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -18528,6 +18574,15 @@ string-width@^2.1.0, string-width@^2.1.1:
     is-fullwidth-code-point "^2.0.0"
     strip-ansi "^4.0.0"
 
+string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
+  version "4.2.3"
+  resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
+  integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
+  dependencies:
+    emoji-regex "^8.0.0"
+    is-fullwidth-code-point "^3.0.0"
+    strip-ansi "^6.0.1"
+
 string-width@^5.0.1, string-width@^5.1.2:
   version "5.1.2"
   resolved "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -18608,7 +18663,7 @@ stringify-entities@^1.0.1:
     is-alphanumerical "^1.0.0"
     is-hexadecimal "^1.0.0"
 
-"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
+"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
   version "6.0.1"
   resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
   integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -18636,6 +18691,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0:
   dependencies:
     ansi-regex "^4.1.0"
 
+strip-ansi@^6.0.0, strip-ansi@^6.0.1:
+  version "6.0.1"
+  resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
+  integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
+  dependencies:
+    ansi-regex "^5.0.1"
+
 strip-ansi@^7.0.1:
   version "7.1.0"
   resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -20208,6 +20270,13 @@ warn-once@^0.1.0:
   resolved "https://registry.npmmirror.com/warn-once/-/warn-once-0.1.1.tgz#952088f4fb56896e73fd4e6a3767272a3fccce43"
   integrity sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q==
 
+warning@^4.0.3:
+  version "4.0.3"
+  resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
+  integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==
+  dependencies:
+    loose-envify "^1.0.0"
+
 watchpack@^2.4.0:
   version "2.4.0"
   resolved "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"
@@ -20517,7 +20586,7 @@ wonka@^6.3.2:
   resolved "https://registry.npmmirror.com/wonka/-/wonka-6.3.4.tgz#76eb9316e3d67d7febf4945202b5bdb2db534594"
   integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg==
 
-"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
+"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
   version "7.0.0"
   resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
   integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -20535,6 +20604,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
     string-width "^4.1.0"
     strip-ansi "^6.0.0"
 
+wrap-ansi@^7.0.0:
+  version "7.0.0"
+  resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
+  integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
+  dependencies:
+    ansi-styles "^4.0.0"
+    string-width "^4.1.0"
+    strip-ansi "^6.0.0"
+
 wrap-ansi@^8.1.0:
   version "8.1.0"
   resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä