Leon 2 years ago
parent
commit
3520f23154

+ 2 - 0
ios/AppDelegate.mm

@@ -32,6 +32,8 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
+//  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenNotificationSettingsURLString]];
+//  NSString *url = UIApplicationOpenNotificationSettingsURLString;
   // APNS
     JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
     if (@available(iOS 12.0, *)) {

+ 11 - 0
ios/hola/Info.plist

@@ -20,6 +20,17 @@
 	<string>1.0</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
+	<key>CFBundleURLTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>prefs</string>
+			</array>
+		</dict>
+	</array>
 	<key>CFBundleVersion</key>
 	<string>1</string>
 	<key>ITSAppUsesNonExemptEncryption</key>

File diff suppressed because it is too large
+ 1 - 1
ios/main.jsbundle


+ 89 - 0
src/components/layout/Modal.rn.tsx

@@ -0,0 +1,89 @@
+import { View, Text, ScrollView } from '@tarojs/components'
+import './Modal.scss'
+import React, { useState } from 'react';
+import { ModalType } from '@/utils/types';
+import Box from './Box';
+import Taro from '@tarojs/taro';
+import {Modal  as ModalRN} from 'react-native'
+
+export default function Modal(props: {
+    children: React.ReactNode,
+    testInfo?: React.ReactNode,
+    title?: string,
+    dismiss: Function,
+    confirm?: Function,
+    themeColor?: string,
+    modalType?: ModalType,
+    cancelCatchMove?: boolean
+}) {
+
+    const [isDismiss, setIsDismiss] = useState(false)
+
+    //阻止中间内容点击事件穿透
+    function click(e) {
+        if (process.env.TARO_ENV == 'weapp') {
+            e.stopPropagation()
+        }
+        Taro.vibrateShort({
+            type: 'medium'
+        })
+    }
+
+    function onClick() {
+        // Taro.vibrateShort({
+        //     type:'medium'
+        // })
+    }
+
+    switch (props.modalType) {
+        case ModalType.center:
+            return <ModalRN transparent={true} >
+                <View onClick={()=>{props.dismiss()}} style={{backgroundColor:'rgba(0,0,0,0.95)',width:'100%',height:'100%',alignItems:'center',justifyContent:'center'}}>
+                    <Box><View onClick={click}>
+                        {
+                            props.children
+                        }
+                    </View>
+                    </Box>
+                </View>
+            </ModalRN>
+    }
+
+    function longPress(e) {
+        if (process.env.TARO_ENV == 'weapp') {
+            e.stopPropagation()
+        }
+    }
+
+    function dismiss() {
+        if (props.modalType == ModalType.center) {
+            props.dismiss()
+            return
+        }
+        setIsDismiss(true)
+        setTimeout(() => {
+            props.dismiss()
+        }, 250)
+    }
+
+    global.dismissModal = dismiss;
+
+
+    return <ModalRN style={{backgroundColor:'red'}} >
+        <View style={{ flex: 1, width: 375, flexShrink: 0 }} onClick={(e) => {
+            dismiss()
+        }}>
+            {
+                props.testInfo ? props.testInfo : null
+            }
+        </View>
+        <View className={isDismiss ? 'modal_bottom_content modal_bottom_dismiss' : 'modal_bottom_content'} style={{ flexShrink: 0 }} onClick={onClick}>
+            {/* <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text> */}
+            {
+                props.children
+            }
+
+        </View>
+
+    </ModalRN>
+}

+ 0 - 0
src/components/layout/Modal.tsx → src/components/layout/Modal.weapp.tsx


+ 0 - 14
src/features/trackTimeDuration/components/RecordFastSleep.tsx

@@ -284,18 +284,4 @@ export default function RecordFastSleep(props: { data: any, type: string, delSuc
             }
         </View>
     </View>
-
-    // return <Box header={header()}>
-    //     <RecordItem canDel={record.status == 'COMPLETED'} delete={del}
-    //         onClick={showDetail}
-    //     >{recordDetail()}
-    //     </RecordItem>
-    //     {
-    //         showDetailModal && <Modal children={schedules()}
-    //             modalType={ModalType.center}
-    //             dismiss={() => setShowDetailModal(false)}
-    //             confirm={() => { }} />
-    //     }
-
-    // </Box>
 }

+ 20 - 8
src/features/trackTimeDuration/components/SetSchedule.rn.tsx

@@ -226,9 +226,8 @@ export default function Component() {
         setHours(durationTime(e, endTime)[0])
         setMinutes(durationTime(e, endTime)[1])
         saveTempCache(e, endTime);
-        console.log(e)
-
-        global.updateDial(e, endTime)
+        if (global.updateDial)
+            global.updateDial(e, endTime)
     }
 
     function onEndTimeChange(e: string) {
@@ -322,7 +321,7 @@ export default function Component() {
                 t('feature.track_time_duration.dial.picker_fast_schedule_duration') :
                 t('feature.track_time_duration.dial.picker_sleep_schedule_duration')}
             themeColor={scenario.step == 'fast' ? global.fastColor ? global.fastColor : ColorType.fast : global.sleepColor ? global.sleepColor : ColorType.sleep}
-            showBtns={true} onCancel={() => { setIsOpen(false) }} />
+            showBtns={true} onCancel={() => { setIsOpen(false);  }} />
     }
 
     function pickerTitle() {
@@ -350,7 +349,6 @@ export default function Component() {
     }
 
     function detail() {
-
         return <View style={{ height: Taro.getSystemInfoSync().screenHeight - 200, flexDirection: 'column', display: 'flex' }}>
             {/* <Text className="subtitle">{t('page.set_schedule.fast_subtitle')}</Text> */}
             <TitleView title={scenario.step == 'fast' ? t('page.set_schedule.fast_title') : t('page.set_schedule.sleep_title')}
@@ -378,7 +376,7 @@ export default function Component() {
                     <Text className="cell_title">开始时间</Text>
                     <Text className="cell_value" style={{ color: scenario.step == 'fast' ? ColorType.fast : ColorType.sleep }}>{startTime}</Text>
                     <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
-                    <View className="cell_line" style={{height:1/PixelRatio.get()}}/>
+                    <View className="cell_line" style={{ height: 1 / PixelRatio.get() }} />
                 </View>
                 <View className="cell_bottom" onClick={() => {
                     setIsModalTimePicker(true)
@@ -403,6 +401,20 @@ export default function Component() {
                     onClick={() => start()} />
             </Footer>
 
+            {
+                (isOpen || isTimeOpen) && <PageContainer style={{ backgroundColor: '#1c1c1c' }}
+                    overlayStyle={{ backgroundColor: 'rgba(0,0,0,0.9)' }}
+                    customStyle={{ backgroundColor: '#1c1c1c' }}
+                    closeOnSlideDown={false}
+                    onAfterLeave={() => { setIsOpen(false); setIsTimeOpen(false) }}
+                    show={isOpen || isTimeOpen} round={true} overlay={true} position='bottom'
+                >
+                    {
+                        isTimeOpen ? timeContent() : layoutContent()
+                    }
+                </PageContainer>
+            }
+
             {/* <PageContainer style={{ backgroundColor: '#1c1c1c' }}
         overlayStyle='background-color:rgba(0,0,0,0.9)'
         custom-style='background-color:#1c1c1c'
@@ -414,7 +426,7 @@ export default function Component() {
           isModalTimePicker?timeContent():layoutContent()
         }
       </PageContainer> */}
-            {
+            {/* {
                 isOpen && <Modal children={layoutContent()} dismiss={() => setIsOpen(false)} confirm={() => {
                     setIsOpen(false)
                     durationChange(pickerRef.current.getConfirmData())
@@ -424,7 +436,7 @@ export default function Component() {
                 isTimeOpen && <Modal children={timeContent()} dismiss={() => setIsTimeOpen(false)} confirm={() => {
                     setIsTimeOpen(false)
                 }} />
-            }
+            } */}
 
         </View>
     }

+ 1 - 1
src/features/trackTimeDuration/components/TimelineStage.rn.tsx

@@ -58,7 +58,7 @@ export default function Component(props: { data: any, title?: string, subTitle?:
     }
 
     function goSetting(){
-        Linking.openURL('app-settings://notification/myapp')
+        Linking.openURL('app-settings:notifications')
     }
 
 

Some files were not shown because too many files changed in this diff