Leon 2 年 前
コミット
c44fa74184

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

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

ファイルの差分が大きいため隠しています
+ 0 - 0
ios/main.jsbundle


+ 5 - 1
src/app.tsx

@@ -6,14 +6,17 @@ import store from './store/store'
 import { View } from '@tarojs/components'
 import GlobalModal from './components/layout/GlobalModal'
 import Taro from '@tarojs/taro'
+// import { StatusBar } from 'react-native'
 // import jgPush from './utils/push.rn'
 
 
 // import 'taro-ui/dist/style/index.scss'
 
 let LogBox;
+let StatusBar;
 if (process.env.TARO_ENV == 'rn') {
   LogBox = require("react-native").LogBox
+  StatusBar = require("react-native").StatusBar
 }
 
 
@@ -49,7 +52,7 @@ const App: React.FC<PropsWithChildren> = ({ children }) => {
     //关闭其中某些yellow警告
     LogBox.ignoreLogs(['Warning: ...']); // Ignore log notification by message
     LogBox.ignoreAllLogs();//Ignore all log notifications
-    
+
     const test = require('./utils/push').default
     test()
     // jgPush()
@@ -100,6 +103,7 @@ const App: React.FC<PropsWithChildren> = ({ children }) => {
   }
 
   return <Provider store={store}>
+    {process.env.TARO_ENV == 'rn' && <StatusBar barStyle='light-content' />}
     {children}
   </Provider>
 }

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

@@ -228,7 +228,7 @@ const Component = forwardRef((props: {
             <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text>
             <View style={{ backgroundColor: 'transparent', position: 'relative' }}>
                 <PickerView
-                    itemStyle={{ color: '#fff',margin:0,padding:0 }}
+                    // itemStyle={{ color: '#fff',margin:0,padding:0 }}
                     value={values}
                     className="picker"
                     maskClass="picker-mask"
@@ -237,7 +237,7 @@ const Component = forwardRef((props: {
                     onPickEnd={onPickerEnd}
                     immediateChange={true}
                     indicatorStyle='height: 50px;color:red;'>
-                    <PickerViewColumn color='red' style='flex:0 0 45%'>
+                    <PickerViewColumn style='flex:0 0 45%'>
                         {days.map(item => {
                             return (
                                 <View style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff' }}>{item}</View>

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

@@ -53,7 +53,7 @@ const Component = forwardRef((props: {
         <Text className='modal_title' style={{ color: color }}>{props.title ? props.title : '测试标题 '}</Text>
         <PickerView value={v}
             // color='#fff'
-            itemStyle={{color:'#fff'}}
+            // itemStyle={{color:'#fff'}}
             style={{color:'#fff'}}
             onChange={onPickerChange}
             indicatorStyle='height: 50px;'

+ 1 - 1
src/components/navigation/TabBar.tsx

@@ -49,7 +49,7 @@ export default function Component(props: { index: number }) {
             <View style={{ position: 'relative' }}>
                 <Text>饮食</Text>
                 {
-                    common.showFoodTabBadge && <View className='food-tab-badge' style={{ backgroundColor: ColorType.food }} />
+                    common.showFoodTabBadge && process.env.TARO_ENV=='weapp' && <View className='food-tab-badge' style={{ backgroundColor: ColorType.food }} />
                 }
             </View>
 

+ 13 - 0
src/features/trackTimeDuration/components/ChooseScenario.tsx

@@ -32,6 +32,7 @@ export default function Component() {
     const [selIndex, setSelIndex] = useState(-1)
     const [scenarios, setScenarios] = useState<any[]>([])
     const selScenario = useSelector((state: any) => state.scenario);
+    const time = useSelector((state: any) => state.time);
     const [count, setCount] = useState(0)
 
     let navigation;
@@ -58,6 +59,18 @@ export default function Component() {
                 setSelIndex(0)
             }
         }
+
+        if (time){
+            if (time.scenario=='FAST_SLEEP'){
+                setSelIndex(2)
+            }
+            else if (time.scenario=='SLEEP'){
+                setSelIndex(1)
+            }
+            else{
+                setSelIndex(0)
+            }
+        }
         Taro.getStorage({ key: 'scenarios' }).then(res => {
             if (res) {
                 setScenarios(JSON.parse(res.data as any))

+ 20 - 2
src/pages/account/EditPage.tsx

@@ -10,6 +10,11 @@ import { useEffect, useState } from "react";
 import { useTranslation } from "react-i18next";
 import { useDispatch, useSelector } from "react-redux";
 
+let useNavigation;
+if (process.env.TARO_ENV == 'rn') {
+    useNavigation = require("@react-navigation/native").useNavigation
+}
+
 export default function Page() {
 
     const user = useSelector((state: any) => state.user);
@@ -19,6 +24,12 @@ export default function Page() {
     const dispatch = useDispatch();
     const router = useRouter();
 
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
+
     useEffect(() => {
         setTimeout(() => {
             setValue(router.params.name as any)
@@ -48,7 +59,12 @@ export default function Page() {
             })
 
             setTimeout(() => {
-                Taro.navigateBack()
+                if (process.env.TARO_ENV=='weapp'){
+                    Taro.navigateBack()
+                }
+                else {
+                    navigation.goBack()
+                }
             }, 300)
 
         }).catch(e => {
@@ -57,15 +73,17 @@ export default function Page() {
         // dispatch(update({nickname:value}).then() as any)
     }
 
-    return <View>
+    return <View style={{flex:1}}>
         <View style={{ height: 20 }}></View>
         {/* <Input type="nickname" placeholder="请输入昵称" style={{ color: '#fff' }} value={value} onInput={handleChange} /> */}
         <Inputs placeholder={t('feature.common.toast.input_nickname')} value={value} onChange={handleChange} onConfirm={save}
             openType="nickname"
         />
+        <View style={{flex:1}}/>
         <Footer>
             <ChooseScenarioBtn disable={btnDisable} title={t('page.user_profile.save')} onClick={save} background={ColorType.fast} />
         </Footer>
+        <View style={{height:40}}/>
         {/* <Text onClick={save} style={{ color: '#fff' }}>保存</Text> */}
     </View>
 }

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

@@ -88,7 +88,7 @@ export default function Page() {
             e.stopPropagation()
         }
         if (user.isLogin) {
-            jumpPage('/pages/account/ProfileSetting')
+            jumpPage('/pages/account/ProfileSetting','ProfileSetting',navigation)
         }
         else {
             jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
@@ -110,7 +110,7 @@ export default function Page() {
 
     function goSetting(e) {
         console.log('apple')
-        jumpPage('/pages/account/Setting','Setting',navigation)
+        jumpPage('/pages/account/Setting', 'Setting', navigation)
         if (process.env.TARO_ENV == 'weapp') {
             e.stopPropagation()
         }
@@ -165,10 +165,13 @@ export default function Page() {
                 </View>
             </Box>
             {
-                user.isLogin && <View onClick={goSetting}>
+                user.isLogin && process.env.TARO_ENV == 'rn' && <View onClick={goSetting}>
                     <TableCell title={t('page.more.setting')} showArrow={true} showMarginBottom={true} onClick={goSetting}></TableCell>
                 </View>
             }
+            {
+                user.isLogin && process.env.TARO_ENV == 'weapp' && <TableCell title={t('page.more.setting')} showArrow={true} showMarginBottom={true} onClick={goSetting}></TableCell>
+            }
             {/* {user.isLogin && <Box >
                 <View onClick={goSetting}>
                     <Text className="title">设置</Text>

+ 23 - 8
src/pages/account/ProfileSetting.tsx

@@ -15,6 +15,12 @@ import Footer from "@/components/layout/Footer";
 import { ChooseScenarioBtn } from "@/features/common/SpecBtns";
 import { ColorType } from "@/context/themes/color";
 
+let useNavigation;
+if (process.env.TARO_ENV == 'rn') {
+    useNavigation = require("@react-navigation/native").useNavigation
+}
+
+
 export default function Page() {
     const dispatch = useDispatch();
     const router = useRouter();
@@ -23,6 +29,11 @@ export default function Page() {
     const [header, setHeader] = useState(user.avatar)
     const { t } = useTranslation()
 
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
     useEffect(() => {
         Taro.setNavigationBarTitle({
             title: t('page.user_profile.title')
@@ -31,10 +42,10 @@ export default function Page() {
 
     function editNickname() {
         if (router.params.newuser == '1') {
-            jumpPage('/pages/account/EditPage?name='+(name==user.nickname?'':user.nickname))
+            jumpPage('/pages/account/EditPage?name=' + (name == user.nickname ? '' : user.nickname), 'EditPage', navigation)
         }
         else {
-            jumpPage('/pages/account/EditPage?name='+user.nickname)
+            jumpPage('/pages/account/EditPage?name=' + user.nickname, 'EditPage', navigation)
         }
 
     }
@@ -55,7 +66,6 @@ export default function Page() {
                 file_ext: fileExt
             },
             success: (rsp) => {
-                debugger
                 Taro.uploadFile({
                     url: rsp.data.upload_url,
                     filePath: avatarUrl,
@@ -83,12 +93,10 @@ export default function Page() {
                 title: t('feature.common.toast.update_success'),
                 icon: 'none'
             })
-
-
         })
     }
 
-    return <View className="container">
+    return <View className="container" style={{flex:1}}>
         <View className="avatar_row">
             <View className="avatar_bg">
 
@@ -106,16 +114,23 @@ export default function Page() {
 
 
         <View onClick={editNickname}>
-            <TableCell title={t('page.user_profile.nickname')} showArrow={true} showMarginBottom={true}>
+            <TableCell onClick={editNickname} title={t('page.user_profile.nickname')} showArrow={true} showMarginBottom={true}>
                 <Text style={{ opacity: 0.8 }}>{router.params.newuser == '1' ? (user.nickname == name ? '取个名字' : user.nickname) : user.nickname}</Text>
             </TableCell>
         </View>
+        <View style={{flex:1}}/>
 
         <Footer>
             <ChooseScenarioBtn disable={router.params.newuser == '1' && (user.avatar == header || user.nickname == name)} title='确定' onClick={() => {
-                Taro.navigateBack()
+                if (process.env.TARO_ENV == 'weapp') {
+                    Taro.navigateBack()
+                }
+                else {
+                    navigation.goBack()
+                }
             }} background={ColorType.fast} />
         </Footer>
+        <View style={{height:40}}/>
 
 
     </View>

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

@@ -61,7 +61,7 @@ export default function Page() {
 
     return <View style={{ color: '#fff', display: 'flex', flexDirection: 'column', flex: 1 }}>
         <View style={{ height: 20 }} />
-        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>1.3.1</Text></TableCell>
+        <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>1.3.2</Text></TableCell>
         {/* <Text style={{color:'#9E9E9E',textAlign:'center',fontSize:14}}>v1.2.2</Text> */}
         {
             process.env.TARO_ENV == 'rn' && <View style={{ flex: 1 }} />

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

@@ -13,8 +13,10 @@ import Setting from '@/pages/account/Setting'
 import SetSchedule from '@/pages/clock/SetSchedule'
 import ChooseScenario from '@/pages/clock/ChooseScenario'
 import RecordsHistory from '@/pages/common/RecordsHistory'
+import ProfileSetting from '@/pages/account/ProfileSetting'
+import EditPage from '@/pages/account/EditPage'
 import Food from '@/pages/food/Food'
-import DemoA from '../clock/demoA';
+// import DemoA from '../clock/demoA';
 import { View } from '@tarojs/components';
 
 // 创建底部 Tab 导航器
@@ -61,7 +63,7 @@ export default function RNMain() {
   const MetricPage = () => <Metric />
   const WorkoutPage = () => <Workout />
   const ProfilePage = () => <Profile />
-  const DemoAPage = () => <DemoA />
+  // const DemoAPage = () => <DemoA />
   // const FoodPage = ()=><Food/>
 
   function tabNavigator() {
@@ -77,7 +79,7 @@ export default function RNMain() {
         tabBarInactiveTintColor: 'gray', // 非活动标签的颜色
       })}>
         <Tab.Screen name="Clock" component={ClockPage} />
-        <Tab.Screen name='DemoA' component={DemoAPage} />
+        {/* <Tab.Screen name='DemoA' component={DemoAPage} /> */}
         {/* <Tab.Screen name="Food" component={FoodPage} /> */}
         <Tab.Screen name="Metric" component={MetricPage} />
         <Tab.Screen name="Workout" component={WorkoutPage} />
@@ -115,6 +117,8 @@ export default function RNMain() {
         <Stack.Screen name='ChooseScenario' component={ChooseScenario} />
         <Stack.Screen name='RecordsHistory' component={RecordsHistory} />
         <Stack.Screen name='SetSchedule' component={SetSchedule} />
+        <Stack.Screen name='ProfileSetting' component={ProfileSetting} />
+        <Stack.Screen name='EditPage' component={EditPage} />
       </Stack.Navigator>
     </NavigationContainer>
   )

+ 1 - 1
src/services/http/api.js

@@ -1,4 +1,4 @@
-let online = false;
+let online = process.env.TARO_ENV=='rn'?false:true;
 export let baseUrl = online ? 'https://api.fast.liveplus.fun' : 'https://api.fast.dev.liveplus.fun';
 export let imgUrl = online
     ? 'https://api.fast.liveplus.fun/static/image/'

+ 1 - 0
src/services/http/request.ts

@@ -131,6 +131,7 @@ export async function request<T>(param: RequestParam): Promise<T> {
             },
             fail: err => {
                 if ((err as any).statusCode >= 200 && (err as any).statusCode < 300){
+                    clearTimeout(timer);
                     resolve()
                     return;
                 }

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません