leon 1 éve
szülő
commit
4613e3708b

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

@@ -580,7 +580,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 136;
+				CURRENT_PROJECT_VERSION = 138;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -613,7 +613,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 136;
+				CURRENT_PROJECT_VERSION = 138;
 				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>135</string>
+	<string>138</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationCategoryType</key>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
ios/main.jsbundle


+ 12 - 2
src/_moment/pages/relation.tsx

@@ -11,6 +11,11 @@ import Taro from "@tarojs/taro";
 import NoRecord from "@/_health/components/no_record";
 import { useTranslation } from "react-i18next";
 
+let useNavigation
+if (process.env.TARO_ENV == 'rn') {
+    useNavigation = require("@react-navigation/native").useNavigation
+}
+
 export default function Relation() {
     const [count, setCount] = useState(0)
     const [friends, setFriends] = useState<any>([])
@@ -29,6 +34,11 @@ export default function Relation() {
     const navigationBarHeight = systemInfo.statusBarHeight + 44;
     const {t} = useTranslation()
 
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
     useEffect(() => {
         // getRelation()
         // getFollowers()
@@ -264,7 +274,7 @@ export default function Relation() {
 
     return <View >
         <View style={{
-            position: 'fixed',
+            position: process.env.TARO_ENV=='weapp'?'fixed':'absolute',
             top: 0,
             left: 0,
             zIndex: 10,
@@ -283,7 +293,7 @@ export default function Relation() {
                     top: 22 - rpxToPx(32)
                 }}
                     onClick={() => {
-                        Taro.navigateBack()
+                        process.env.TARO_ENV=='weapp'?Taro.navigateBack():navigation.goBack()
                     }}
                 />
                 <View style={{ display: 'flex', flexDirection: 'row', height: 44, alignItems: 'center', justifyContent: 'center' }}>

+ 31 - 0
src/_record/components/ring_progress.rn.tsx

@@ -0,0 +1,31 @@
+import { TimeFormatter } from "@/utils/time_format";
+import Svg, { Circle, Path, SvgUri, Image } from 'react-native-svg';
+import { useSelector } from "react-redux";
+import { NativeAppEventEmitter } from 'react-native';
+import { MainColorType } from "@/context/themes/color";
+import { rpxToPx } from "@/utils/tools";
+// import { Canvas } from "@tarojs/components";
+import Taro, { useReady } from "@tarojs/taro";
+import { View } from "@tarojs/components";
+import { useEffect, useRef, useState } from "react";
+
+
+export default function RNRingProgress(props: {
+    canvasId?: string;
+    bgRing: any;
+    target?: any;
+    real?: any;
+    scale?: number;
+    radius: number;
+    width?: number;
+    height?: number;
+    extra?: any;
+    count?: number;
+    shareBg?: any;
+    shareCover?: any;
+    isCompleted?: boolean;
+}) {
+    const canvasWidth = props.width ?? rpxToPx(900)
+    const canvasHeight = props.height ?? rpxToPx(720)
+    return <Svg width={canvasWidth} height={canvasHeight}></Svg>
+}

+ 7 - 8
src/_record/components/ring_progress.tsx → src/_record/components/ring_progress.weapp.tsx

@@ -4,10 +4,11 @@ import { rpxToPx } from "@/utils/tools";
 import Taro, { useReady } from "@tarojs/taro";
 import { View } from "@tarojs/components";
 import { useEffect, useRef, useState } from "react";
+// import RNRingProgress from "./rn_ring_progress";
 
 let Canvas
 
-if (process.env.TARO_ENV == 'weapp'){
+if (process.env.TARO_ENV == 'weapp') {
     Canvas = require("@tarojs/components").Canvas
 }
 export default function RingProgress(props: {
@@ -30,7 +31,7 @@ export default function RingProgress(props: {
     const dpr = info.pixelRatio; // 获取设备的像素比
     const [ctx, setCtx] = useState<any>(null)
     const [canvas, setCanvas] = useState<any>(null)
-    const [checkImg,setCheckImg] = useState<any>(null)
+    const [checkImg, setCheckImg] = useState<any>(null)
     const canvasRef = useRef(null);
 
 
@@ -38,8 +39,6 @@ export default function RingProgress(props: {
     const canvasHeight = props.height ?? rpxToPx(720)
     const scale = props.scale ?? 1
 
-    if (process.env.TARO_ENV=='rn') return <View />
-
     useEffect(() => {
         if (ctx) {
             drawContent(ctx, canvas)
@@ -123,7 +122,7 @@ export default function RingProgress(props: {
         if (props.real) {
             if (props.isCompleted) {
                 ctx.beginPath();
-                ctx.arc(canvasWidth / 2.0, canvasHeight / 2.0, props.radius, 0, Math.PI*2);
+                ctx.arc(canvasWidth / 2.0, canvasHeight / 2.0, props.radius, 0, Math.PI * 2);
                 ctx.lineWidth = rpxToPx(4);
                 ctx.strokeStyle = 'rgba(0,0,0,0.05)';
                 ctx.lineCap = 'round'; // 设置为圆角
@@ -177,7 +176,7 @@ export default function RingProgress(props: {
             //     dotLineWidth = 4
 
             // }
-            ctx.arc(xPrime, yPrime, props.target.width / 2.0+rpxToPx(3), 0, 2 * Math.PI);
+            ctx.arc(xPrime, yPrime, props.target.width / 2.0 + rpxToPx(3), 0, 2 * Math.PI);
             ctx.lineWidth = dotLineWidth;
             ctx.fillStyle = 'transparent'
             ctx.fill()
@@ -237,7 +236,7 @@ export default function RingProgress(props: {
         if (props.isCompleted) {
             if (_canvas) {
 
-                if (!checkImg){
+                if (!checkImg) {
                     const img1 = _canvas.createImage(); // 创建图像对象
                     img1.src = global.checkImg
                     img1.onload = () => {
@@ -260,7 +259,7 @@ export default function RingProgress(props: {
                         save(_canvas)
                     }
                 }
-                
+
             }
         }
         else {

+ 0 - 2
src/features/trackTimeDuration/components/Rings.rn.tsx

@@ -57,8 +57,6 @@ export default function Component(props: {
     const dpr = Taro.getSystemInfoSync().pixelRatio; // 获取设备的像素比
     const radius = r; // 圆形进度条的半径
     const lineWidth = strokeWidth; // 圆形进度条的线宽
-    const timeObj = useSelector((state: any) => state.time);
-    const user = useSelector((state: any) => state.user);
 
     const center = radius + lineWidth / 2 + 3; // 圆心坐标
 

+ 23 - 5
src/pages/moment/moment_item.tsx

@@ -96,6 +96,7 @@ export default function MomentItem(props: { data: any, del?: any }) {
                 e.stopPropagation()
             }
             Taro.previewImage({
+                current:imgObj.url,
                 urls: [imgObj.url]
             })
         }} mode="aspectFill" style={{ width: rpxToPx(width), height: rpxToPx(height) }} src={imgObj.url + scale} />
@@ -141,7 +142,11 @@ export default function MomentItem(props: { data: any, del?: any }) {
     }
 
     function edit() {
-        jumpPage(`/_record/pages/log_record?edit=1&id=${link.event_id}&scenario=${link.scenario}`)
+        jumpPage(`/_record/pages/log_record?edit=1&id=${link.event_id}&scenario=${link.scenario}`, 'LogRecord', navigation, {
+            edit: 1,
+            id: link.event_id,
+            scenario: link.scenario
+        })
     }
 
     function del() {
@@ -241,21 +246,34 @@ export default function MomentItem(props: { data: any, del?: any }) {
                 {
                     join && join.status == 'JOIN' && <NewButton type={NewButtonType.custom} onClick={() => {
                         if (!my.isLogin) {
-                            jumpPage('/_account/pages/ChooseAuth')
+                            jumpPage('/_account/pages/ChooseAuth', 'ChooseAuth', navigation)
                             return
                         }
                         dispatch(setFollow(user))
                         dispatch(setJoinData(join))
                         if (join.window == 'ACTIVE' || join.window == 'EAT') {
-                            jumpPage(`/_record/pages/log_record?scenario=${join.window == 'EAT' ? 'MEAL' : 'ACTIVITY'}&join_id=${join.key}`)
+                            jumpPage(`/_record/pages/log_record?scenario=${join.window == 'EAT' ? 'MEAL' : 'ACTIVITY'}&join_id=${join.key}`,
+                                'LogRecord',
+                                navigation,
+                                {
+                                    scenario: join.window == 'EAT' ? 'MEAL' : 'ACTIVITY',
+                                    join_id: join.key
+                                }
+                            )
                         }
                         else if (join.window == 'FAST' || join.window == 'SLEEP') {
-                            jumpPage(`/_record/pages/time_record?scenario=${join.window}&join_id=${join.key}`)
+                            jumpPage(`/_record/pages/time_record?scenario=${join.window}&join_id=${join.key}`,
+                                'TimeRecord', navigation,
+                                {
+                                    scenario: join.window,
+                                    join_id: join.key
+                                }
+                            )
                         }
 
                         // jumpPage(`/_moment/pages/long_detail?join_id=${join.key}&window=${join.window}&status=${join.status}`)
                     }}>
-                        <View className="h24" style={{ color: MainColorType.link, padding: rpxToPx(13) }}>跟卡</View>
+                        <View className="h24" style={{ color: MainColorType.link, padding: rpxToPx(13),paddingTop:rpxToPx(10),paddingBottom:rpxToPx(10) }}>跟卡</View>
                     </NewButton>
                 }
                 <NewButton btnStyle={{ paddingLeft: rpxToPx(20), paddingRight: rpxToPx(20) }} type={NewButtonType.custom} onClick={tapShare}>

+ 40 - 6
src/pages/moment/moment_main.tsx

@@ -34,10 +34,16 @@ import shareTitle from "./moment_unit";
 let useRoute;
 let useNavigation;
 let FlatList;
+let useActionSheet;
+let RefreshControl;
+let useSafeAreaInsets;
 if (process.env.TARO_ENV == 'rn') {
+    useActionSheet = require('@expo/react-native-action-sheet').useActionSheet
+    RefreshControl = require("react-native").RefreshControl
     useRoute = require("@react-navigation/native").useRoute
     useNavigation = require("@react-navigation/native").useNavigation
     FlatList = require('react-native').FlatList
+    useSafeAreaInsets = require('react-native-safe-area-context').useSafeAreaInsets
 }
 
 let timer;
@@ -64,6 +70,13 @@ export default function MomentMain() {
     const [pageTop, setPageTop] = useState(0)
     const scrollRef = useRef()
 
+    let showActionSheetWithOptions;
+    let insets:any
+    if (process.env.TARO_ENV == 'rn') {
+        showActionSheetWithOptions = useActionSheet()
+        insets = useSafeAreaInsets();
+    }
+
 
     let router
     let navigation;
@@ -366,18 +379,21 @@ export default function MomentMain() {
 
     function more() {
         showActionSheet({
+            showActionSheetWithOptions: showActionSheetWithOptions,
             title: '',
             itemList: ['个人主页', '我的搭子', '消息通知'],
             success: (index) => {
                 switch (index) {
                     case 0:
-                        jumpPage('/_moment/pages/home?uid=' + user.id)
+                        jumpPage('/_moment/pages/home?uid=' + user.id, 'UserHome', navigation, {
+                            uid: user.id
+                        })
                         break;
                     case 1:
-                        jumpPage('/_moment/pages/relation')
+                        jumpPage('/_moment/pages/relation', 'Relation', navigation)
                         break
                     case 2:
-                        jumpPage('/_moment/pages/message')
+                        jumpPage('/_moment/pages/message', 'Message', navigation)
                         break
                 }
             }
@@ -472,6 +488,7 @@ export default function MomentMain() {
     }
 
     function wxList() {
+        
         return <ScrollView style={{
             marginTop: navigationBarHeight,
             height: '90vh'
@@ -549,17 +566,34 @@ export default function MomentMain() {
         return <FlatList
             style={{
                 marginTop: navigationBarHeight,
-                height: screenHeight-navigationBarHeight
+                height: screenHeight - navigationBarHeight-(insets?insets.bottom:0)-40,
+                backgroundColor: '#fff'
             }}
             data={moments}
-            keyExtractor={item => item.link.event_id}
+            keyExtractor={(item,index) => {
+                // console.log(item,index)
+                return index
+            }}
             renderItem={({ item, index }) => <MomentItem data={item} del={
                 () => {
                     var list = JSON.parse(JSON.stringify(moments))
                     list.splice(index, 1)
                     setMoments(list)
                 }
-            } />}
+            }
+            />}
+            refreshControl={
+                <RefreshControl
+                    tintColor='black'
+                    colors={['black']} // 设置刷新指示器的颜色为白色
+                    progressBackgroundColor="black" // 设置刷新指示器的背景颜色为白色
+                    refreshing={isPulling}
+                    onRefresh={onRefresh}
+                />
+            }
+            onEndReached={loadMore} // 上拉加载更多
+            onEndReachedThreshold={0.5} // 当距离底部还有 50% 的高度时触发加载
+            ListFooterComponent={<ListFooter noMore={noMore} loading={loading} />} // 加载指示器
         />
     }
 

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

@@ -36,6 +36,8 @@ import LogRecord from '@/_record/pages/log_record';
 import Taro from '@tarojs/taro';
 import UserHome from '@/_moment/pages/home';
 import TimelineDetail from '@/_health/pages/timeline_detail';
+import Relation from '@/_moment/pages/relation';
+import Message from '@/_moment/pages/message';
 
 // import { View,Image } from '@tarojs/components';
 
@@ -267,6 +269,12 @@ export default function RNMain() {
         <Stack.Screen name='TimelineDetail' component={TimelineDetail} options={{
           headerBackTitle: ' '
         }} />
+        <Stack.Screen name='Relation' component={Relation} options={{
+          headerShown: false
+        }} />
+        <Stack.Screen name='Message' component={Message} options={{
+          headerBackTitle: ' '
+        }} />
 
         {/* <Stack.Screen name='NotificationSetting' component={NotificationSetting} options={{
           headerBackTitle: ' '

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott