leon hai 1 ano
pai
achega
b8b9f95406

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

+ 1 - 1
ios/hola/Info.plist

@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>104</string>
+	<string>105</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationCategoryType</key>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
ios/main.jsbundle


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

@@ -16,6 +16,9 @@ export default {
         clock: {
             title: 'Today',
         },
+        reminders:{
+            title:'Reminders',
+        },
         activity: {
             title: 'Activity',
         },

+ 3 - 0
src/context/locales/zh.js

@@ -16,6 +16,9 @@ export default {
         clock: {
             title: '今天',
         },
+        reminders:{
+            title:'提醒',
+        },
         activity: {
             title: '运动',
         },

+ 2 - 2
src/features/trackTimeDuration/components/WeekCalendar.tsx

@@ -240,12 +240,12 @@ const WeekCalendar = memo((props: { isFastSleep: boolean }) => {
     function getWeekDuration() {
         if (global.language == 'en') {
             if (!props.isFastSleep) {
-                return `${t('feature.common.day_of_week_full.mon')}, ${getDate(calendarData.start)} - ${t('feature.common.day_of_week_full.sun')}, ${getDate(calendarData.end - 1)}`
+                return `${t('feature.common.day_of_week_full.sun')}, ${getDate(calendarData.start)} - ${t('feature.common.day_of_week_full.sat')}, ${getDate(calendarData.end - 1)}`
             }
             return `${t('feature.common.day_of_week_full.sun')} ${t('feature.common.time_desc.afternoon')}, ${getDate(calendarData.start)} - ${t('feature.common.day_of_week_full.sun')} ${t('feature.common.time_desc.morning')}, ${getDate(calendarData.end)}`
         }
         if (!props.isFastSleep) {
-            return `${getDate(calendarData.start)} ${t('feature.common.day_of_week_full.mon')} - ${getDate(calendarData.end - 1)} ${t('feature.common.day_of_week_full.sun')}`
+            return `${getDate(calendarData.start)} ${t('feature.common.day_of_week_full.sun')} - ${getDate(calendarData.end - 1)} ${t('feature.common.day_of_week_full.sat')}`
         }
         return `${getDate(calendarData.start)} ${t('feature.common.day_of_week_full.sun')}${t('feature.common.time_desc.afternoon')} - ${getDate(calendarData.end)} ${t('feature.common.day_of_week_full.sun')}${t('feature.common.time_desc.morning')}`
     }

+ 11 - 6
src/pages/account/Profile.tsx

@@ -151,17 +151,17 @@ export default function Page() {
         </TitleView>
     }
 
-    function member_expire(){
-        if (accessObj.access.member.type == 'NON_CONSUMABLE'){
+    function member_expire() {
+        if (accessObj.access.member.type == 'NON_CONSUMABLE') {
             return 'Unlimited premium access to Pro features forever.'
         }
-        if (accessObj.access.member.type == 'AUTO_RENEW'){
+        if (accessObj.access.member.type == 'AUTO_RENEW') {
             return 'Premium access to Pro features during membership.'
         }
-        if (global.language=='en'){
+        if (global.language == 'en') {
             return dayjs(accessObj.access.member.expire).format('MMM D HH:mm')
         }
-        
+
         return dayjs(accessObj.access.member.expire).format('MM月DD日 HH:mm')
     }
 
@@ -195,7 +195,7 @@ export default function Page() {
                     </View> :
                         <View className="balance" onClick={tapBalance}>
                             <Text className="title">{t('page.more.pro_member')}</Text>
-                            <Text className="desc">{t('page.more.member_desc',{time:member_expire()})}</Text>
+                            <Text className="desc">{t('page.more.member_desc', { time: member_expire() })}</Text>
                         </View>
                 }
 
@@ -234,6 +234,11 @@ export default function Page() {
                         <Switch checked={memberAlert} onChange={alertChanged} />
                     </View>
                     <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
+                    <View className="cell_center">
+                        <Text className="cell_title">expire based on device time</Text>
+                        <Switch checked={memberAlert} onChange={alertChanged} />
+                    </View>
+                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
                     <View className="cell_bottom">
                         <Text className="cell_title">{t('page.more.debug_mode')}</Text>
                         <Switch checked={switchOn} onChange={switchChanged} />

+ 3 - 2
src/pages/notification/setting.scss

@@ -10,7 +10,7 @@
 }
 
 .setting_section {
-    height: 120px;
+    height: 88px;
     display: flex;
     flex-direction: row;
     align-items: center;
@@ -20,7 +20,8 @@
     color: #fff;
     margin-left: 46px;
     font-weight: bold;
-    font-size: 48px;
+    font-size: 32px;
+    opacity: 0.6;
 }
 
 .setting_header {

+ 117 - 46
src/pages/notification/setting.tsx

@@ -13,6 +13,11 @@ import { useSelector } from "react-redux";
 import ProductList from "../store/product_list";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
 import { userAccess } from "@/services/user";
+import '@/features/trackTimeDuration/components/CheckAccess.scss';
+import Modal from "@/components/layout/Modal.weapp";
+import Layout from "@/components/layout/layout";
+import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import TitleView from "@/features/trackTimeDuration/components/TitleView";
 
 let useNavigation;
 let AppState, Switch;
@@ -34,6 +39,8 @@ export default function Page() {
     const [systemFast, setSystemFast] = useState(true)
     const [systemExtra, setSystemExtra] = useState(true)
     const [systemSun, setSystemSun] = useState(true)
+
+    const [showMemberAlert, setShowMemberAlert] = useState(false)
     const user = useSelector((state: any) => state.user);
     const accessObj = useSelector((state: any) => state.access);
 
@@ -55,7 +62,7 @@ export default function Page() {
         getMemberStatus()
         if (process.env.TARO_ENV == 'rn') {
             navigation.setOptions({
-                headerTitle: 'Notification Settings',
+                headerTitle: '',
             });
             AppState.addEventListener('change', handleAppStateChange);
             // AppState.addEventListener('change', handleAppStateChange);
@@ -220,37 +227,67 @@ export default function Page() {
         </View>
     }
 
-    function iap() {
+
+    function confirm() {
         jumpPage('', 'ProductList', navigation)
+        setShowMemberAlert(false)
+    }
+
+
+
+    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_confirm' onClick={confirm}>
+                    <Text style={{ fontWeight: 'bold', color: ColorType.black }}>Become a Pro Member</Text>
+                </View>
+                <View className="fast_alert_cancel" onClick={()=>{setShowMemberAlert(false)}}>Not now</View>
+
+            </View>
+        </View>
     }
 
-    function pro(isLogin:boolean) {
+    function pro(isLogin: boolean) {
         return <ScrollView style={{ flex: 1 }}>
             {/* <ProductList /> */}
             {/* <Text style={{fontSize:30,color:'#fff'}} onClick={iap}>iap test</Text> */}
             <View className="setting_container">
                 <View className="setting_section">
-                    <Text className="setting_section_title">Fasting with/or Sleep</Text>
+                    <Text className="setting_section_title">Fasting & Sleep</Text>
                 </View>
                 <Text className="setting_header">Reminders</Text>
                 <View className="setting_cell">
                     <Text className="setting_cell_title" style={{ flex: 1 }}>At my scheduled time</Text>
                     {
-                        isLogin?<Text className="setting_cell_value1">{systemFast ? 'Always' : 'Off'}</Text>:
-                        <Text className="setting_cell_value1">Off</Text>
+                        isLogin ? <Text className="setting_cell_value1">{systemFast ? 'Always' : 'Off'}</Text> :
+                            <Text className="setting_cell_value1">Off</Text>
                     }
-                    
+
                 </View>
-                <Text className="setting_footer">A timely reminder so you never miss your scheduled time for fasting or sleep.</Text>
-                <Text className="setting_header">Extra Reminders</Text>
+                <Text className="setting_footer">A timely reminder so you never miss your schedule time for fasting and/or sleep.</Text>
+                <Text className="setting_header">Extra Reminders (Pro)</Text>
                 <View className="setting_cell">
-                    <Text className="setting_cell_title" style={{ flex: 1 }}>If I missed previous action</Text>
-                    <Switch className="myswitch" value={isLogin?isExtra:false} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
-                        if (!isLogin){
+                    <Text className="setting_cell_title" style={{ flex: 1 }}>Missed previous action</Text>
+                    <Switch className="myswitch" value={isLogin ? isExtra : false} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
+                        if (!isLogin) {
                             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
                             return
                         }
                         const value = e.nativeEvent.value
+                        if (e.nativeEvent.value) {
+                            if (accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER') {
+                                // setTimeout(() => {
+                                //     setIsSunrise(false)
+                                // }, 1000)
+
+                                // jumpPage('', 'ProductList', navigation)
+                                setShowMemberAlert(true)
+                                return
+                            }
+
+                        }
                         postNotifySettings({
                             notification: {
                                 fast_sleep: {
@@ -265,28 +302,29 @@ export default function Page() {
                         })
                     }} />
                 </View>
-                <Text className="setting_footer">In cases when you missed a previous action, you receive another reminder to log it together with the current action. This gives you extra protection against any streak loss.</Text>
+                <Text className="setting_footer">In case you missed your previous action, receive another reminder to log it together with the current one. This gives you extra protection against any streak loss.</Text>
                 <View className="setting_section">
-                    <Text className="setting_section_title">Follow the Sun (PRO)</Text>
+                    <Text className="setting_section_title">The Sun (PRO)</Text>
                 </View>
-                <Text className="setting_header">Reminders for Your Daily Local Sun Schedule</Text>
+                <Text className="setting_header">Reminders for Your Daily Local Salor Times</Text>
                 <View className="setting_cell_group">
                     <View className="setting_cell_group_item">
                         <Text className="setting_cell_title" style={{ flex: 1 }}>Sunrise</Text>
-                        <Switch className="myswitch" value={isLogin?isSunrise:false} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
+                        <Switch className="myswitch" value={isLogin ? isSunrise : false} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
                             // setIsMulti(e.nativeEvent.value)
-                            if (!isLogin){
+                            if (!isLogin) {
                                 jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
                                 return
                             }
                             const value = e.nativeEvent.value
                             if (e.nativeEvent.value) {
                                 if (accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER') {
-                                    setTimeout(() => {
-                                        setIsSunrise(false)
-                                    }, 1000)
+                                    // setTimeout(() => {
+                                    //     setIsSunrise(false)
+                                    // }, 1000)
 
-                                    jumpPage('', 'ProductList', navigation)
+                                    // jumpPage('', 'ProductList', navigation)
+                                    setShowMemberAlert(true)
                                     return
                                 }
 
@@ -308,20 +346,21 @@ export default function Page() {
                     </View>
                     <View className="setting_cell_group_item">
                         <Text className="setting_cell_title" style={{ flex: 1 }}>Sunset</Text>
-                        <Switch className="myswitch" value={isLogin?isSunset:false} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
+                        <Switch className="myswitch" value={isLogin ? isSunset : false} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
                             // setIsMulti(e.nativeEvent.value)
-                            if (!isLogin){
+                            if (!isLogin) {
                                 jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
                                 return
                             }
                             const value = e.nativeEvent.value
                             if (e.nativeEvent.value) {
-                                if (accessObj && accessObj.access && accessObj.member.status == 'NON_MEMBER') {
-                                    setTimeout(() => {
-                                        setIsSunset(false)
-                                    }, 1000)
+                                if (accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER') {
+                                    // setTimeout(() => {
+                                    //     setIsSunset(false)
+                                    // }, 1000)
 
-                                    jumpPage('', 'ProductList', navigation)
+                                    // jumpPage('', 'ProductList', navigation)
+                                    setShowMemberAlert(true)
                                     return
                                 }
 
@@ -342,20 +381,21 @@ export default function Page() {
                     </View>
                     <View className="setting_cell_group_item">
                         <Text className="setting_cell_title" style={{ flex: 1 }}>Solar Noon</Text>
-                        <Switch className="myswitch" value={isLogin?isSolarNoon:false} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
+                        <Switch className="myswitch" value={isLogin ? isSolarNoon : false} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
                             // setIsMulti(e.nativeEvent.value)
-                            if (!isLogin){
+                            if (!isLogin) {
                                 jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
                                 return
                             }
                             const value = e.nativeEvent.value
                             if (e.nativeEvent.value) {
-                                if (accessObj && accessObj.access && accessObj.member.status == 'NON_MEMBER') {
-                                    setTimeout(() => {
-                                        setIsSolarNoon(false)
-                                    }, 1000)
+                                if (accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER') {
+                                    // setTimeout(() => {
+                                    //     setIsSolarNoon(false)
+                                    // }, 1000)
 
-                                    jumpPage('', 'ProductList', navigation)
+                                    // jumpPage('', 'ProductList', navigation)
+                                    setShowMemberAlert(true)
                                     return
                                 }
 
@@ -397,19 +437,50 @@ export default function Page() {
 
     if (!user.isLogin)
         return <View className="container" style={{ flex: 1 }}>
-            {
-                pro(false)
-            }
+            <Layout title={t('page.reminders.title')}
+                titleShowStyle={NaviBarTitleShowType.scrollToShow}
+                type={TemplateType.customHeader}
+                header={headerView()}
+            // triggered={triggered}
+            // refresh={refresh}
+            >
+                {
+                    pro(false)
+                }
+            </Layout>
         </View>
 
+    function headerView() {
+        return <TitleView title={t('page.reminders.title')} showAddBtn={false}>
+        </TitleView>
+    }
+
     return <View className="container" style={{ flex: 1 }}>
-        {
-            loaded && pro(true)
-        }
-        {
-            process.env.TARO_ENV == 'rn' && kIsAndroid && checkSystemChannel() && <View className="setting_tip" onClick={goSetting}>
-                <Text className="setting_tip_text">Jump to App's Notifications settings{'>>'}</Text>
-            </View>
-        }
+        <Layout title={t('page.reminders.title')}
+            titleShowStyle={NaviBarTitleShowType.scrollToShow}
+            type={TemplateType.customHeader}
+            header={headerView()}
+        // triggered={triggered}
+        // refresh={refresh}
+        >
+            {
+                loaded && pro(true)
+            }
+            {
+                process.env.TARO_ENV == 'rn' && kIsAndroid && checkSystemChannel() && <View className="setting_tip" onClick={goSetting}>
+                    <Text className="setting_tip_text">Jump to App's Notifications settings{'>>'}</Text>
+                </View>
+            }
+            {
+                showMemberAlert && process.env.TARO_ENV == 'weapp' && alertPop()
+            }
+            {
+                showMemberAlert && process.env.TARO_ENV == 'rn' && <Modal dismiss={() => { setShowMemberAlert(false) }}>
+                    <View style={{ backgroundColor: 'rgba(0,0,0,0.95)', width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center' }}>
+                        {alertPop()}
+                    </View>
+                </Modal>
+            }
+        </Layout>
     </View>
 }

+ 1 - 1
src/pages/rn/RNMain.tsx

@@ -101,7 +101,7 @@ export default function RNMain() {
             );
           },
         }} />
-        <Tab.Screen name="Notification" component={NotificationSetting} options={{
+        <Tab.Screen name="Reminders" component={NotificationSetting} options={{
           tabBarIcon: ({ size, focused, color }) => {
             return (
               <Image

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio