yblunan@gmail.com vor 4 Wochen
Ursprung
Commit
fb0d37cd7f

+ 4 - 4
ios/LoanAssistant.xcodeproj/project.pbxproj

@@ -372,11 +372,11 @@
 				);
 				OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
 				PRODUCT_BUNDLE_IDENTIFIER = com.cdloan.assistant;
-				PRODUCT_NAME = "LoanAssistant";
+				PRODUCT_NAME = LoanAssistant;
 				SWIFT_OBJC_BRIDGING_HEADER = "LoanAssistant/LoanAssistant-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1";
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Debug;
@@ -403,10 +403,10 @@
 				);
 				OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
 				PRODUCT_BUNDLE_IDENTIFIER = com.cdloan.assistant;
-				PRODUCT_NAME = "LoanAssistant";
+				PRODUCT_NAME = LoanAssistant;
 				SWIFT_OBJC_BRIDGING_HEADER = "LoanAssistant/LoanAssistant-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
-				TARGETED_DEVICE_FAMILY = "1";
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Release;

+ 3 - 3
ios/Podfile.lock

@@ -2681,7 +2681,7 @@ SPEC CHECKSUMS:
   EXUpdates: 1457ed285cd7c5e9d4c388ace518af55fa4b21ec
   EXUpdatesInterface: 39d05400a9226c438565dbaaa8447b5f0672ba45
   FBLazyVector: 061f518bbd81677ed8a8317e2ae60b8779495808
-  hermes-engine: e4ecc5957f671df3fa4828a33b435bd6955c25a5
+  hermes-engine: f4c4bf9a6979a9d777e0e4696e56be72362744d6
   libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7
   libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f
   libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
@@ -2697,7 +2697,7 @@ SPEC CHECKSUMS:
   React: 3e14066ac707b3e369d09e2e923d8bee7f8c33ff
   React-callinvoker: bd7959a24564feaf5e4c8c11789e64884da13482
   React-Core: f060f4e14e9301685ce63ea65fbe903bf3397e45
-  React-Core-prebuilt: e958d0ca3f8828f37f35c4cff2594b6e080fd991
+  React-Core-prebuilt: 0bd7bd67a89706f97a8d6150c409951862aecfc2
   React-CoreModules: 89a1a544297be88ca4cdff317423f9e0d0c192a4
   React-cxxreact: 81b1bfa305b1b759cc0fe18327644816216e5993
   React-debug: 234fddb309822e13b9b442ef1bdca8d2b8c3cbf2
@@ -2760,7 +2760,7 @@ SPEC CHECKSUMS:
   ReactAppDependencyProvider: 2b19d66e5ddfe8dc7afb6338a4626156cbf2bab1
   ReactCodegen: 43f0948182edee9407c7b977fb059455dfeb9361
   ReactCommon: c6e81cc1ae185fa84863f3ea1d58caac4be741d7
-  ReactNativeDependencies: e3081feec6a8266d996ca8ce3d5707360258baf8
+  ReactNativeDependencies: bcf3a9cabdc4c83653b9318342a4025f5a2effc1
   RNGestureHandler: 0ea8153746a92b3744d4eaadade647debedf646e
   RNReanimated: 86e5991396f1aa514db90d6c79d4c3e37a37bb10
   RNScreens: 02e62f995ceb94ea465864b3bf4d4767b87f0362

+ 2 - 8
src/app/(tabs)/analytics.tsx

@@ -115,10 +115,7 @@ export default function AnalyticsScreen() {
           选择客户
         </Text>
         <Pressable
-          className="flex-row items-center rounded-2xl bg-surface-container-low px-4 py-3.5"
-          style={({ pressed }) => ({
-            opacity: pressed ? 0.9 : 1,
-          })}
+          className="flex-row items-center rounded-2xl bg-surface-container-low px-4 py-3.5 active:opacity-90"
           onPress={handleSelectCustomer}
         >
           <Ionicons name="person-outline" size={18} color="#737686" />
@@ -142,10 +139,7 @@ export default function AnalyticsScreen() {
         {list?.list?.map((record) => (
           <Pressable
             key={record.id}
-            className="flex-row items-center rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-3.5"
-            style={({ pressed }) => ({
-              opacity: pressed ? 0.93 : 1,
-            })}
+            className="flex-row items-center rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-3.5 active:opacity-93"
           >
             <View
               className={`mr-3 h-11 w-11 items-center justify-center rounded-full ${record.status === 'completed'

+ 11 - 13
src/app/(tabs)/customer.tsx

@@ -1,3 +1,4 @@
+import { pressableStyle } from 'nativewind';
 import { StatusBadge } from '@/components/ui/status-badge';
 import type { ListResponse } from '@/utils/api';
 import api from '@/utils/api';
@@ -6,7 +7,7 @@ import { ActivityIndicator, Toast } from '@ant-design/react-native';
 import { Ionicons } from '@expo/vector-icons';
 import clsx from 'clsx';
 import { BlurView } from 'expo-blur';
-import { Stack } from 'expo-router';
+import { Link, Stack } from 'expo-router';
 import React, { useCallback, useEffect, useRef, useState } from 'react';
 import { Pressable, Text, TextInput, View } from 'react-native';
 import Animated, { Extrapolation, interpolate, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
@@ -40,10 +41,10 @@ function CustomerCard({ item }: { item: Customer }) {
   return (
     <Pressable
       className="rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-4"
-      style={({ pressed }) => ({
+      style={pressableStyle(({ pressed }) => ({
         opacity: pressed ? 0.93 : 1,
         transform: [{ scale: pressed ? 0.995 : 1 }],
-      })}
+      }))}
     >
       <View className="mb-3 flex-row items-start justify-between gap-3">
         <View className="flex-1 flex-row items-center gap-3">
@@ -76,14 +77,12 @@ function CustomerCard({ item }: { item: Customer }) {
 
       <View className="flex-row gap-3">
         <Pressable
-          className="flex-1 items-center rounded-xl bg-primary-container py-2.5"
-          style={({ pressed }) => ({ opacity: pressed ? 0.88 : 1 })}
+          className="flex-1 items-center rounded-xl bg-primary-container py-2.5 active:opacity-88"
         >
           <Text className="text-sm font-bold text-on-primary">{item.loan_status}</Text>
         </Pressable>
         <Pressable
-          className="flex-1 items-center rounded-xl bg-surface-container-high py-2.5"
-          style={({ pressed }) => ({ opacity: pressed ? 0.88 : 1 })}
+          className="flex-1 items-center rounded-xl bg-surface-container-high py-2.5 active:opacity-88"
         >
           <Text className="text-sm font-semibold text-on-surface">编辑资料</Text>
         </Pressable>
@@ -231,10 +230,9 @@ export default function CustomerScreens() {
             <Pressable
               key={key}
               onPress={() => handleSelectStatus(key as CustomerLoanStatus)}
-              className={clsx('rounded-md px-1 border border-transparent', {
+              className={clsx('rounded-md px-1 border border-transparent active:opacity-84', {
                 'border-primary-container': active,
               })}
-              style={({ pressed }) => ({ opacity: pressed ? 0.84 : 1 })}
             >
               <Text
                 className={clsx('text-sm font-bold text-on-surface-variant', {
@@ -307,17 +305,17 @@ export default function CustomerScreens() {
           </Animated.View>
         ),
       }} />
-      <View style={{bottom: insets.bottom + 44}} className="absolute pb-2 right-5">
+      <Link asChild href="/customer/add" style={{bottom: insets.bottom + 44 + 12}} className="absolute pb-2 right-5">
         <Pressable
           className="h-14 w-14 items-center justify-center rounded-full bg-primary-container"
-          style={({ pressed }) => ({
+          style={pressableStyle(({ pressed }) => ({
             opacity: pressed ? 0.88 : 1,
             transform: [{ scale: pressed ? 0.94 : 1 }],
-          })}
+          }))}
         >
           <Ionicons name="person-add" size={22} color="#ffffff" />
         </Pressable>
-      </View>
+      </Link>
     </>
   );
 }

+ 4 - 6
src/app/(tabs)/index.tsx

@@ -4,6 +4,7 @@ import { useCallback, useState } from 'react';
 import { Pressable, ScrollView, Text, View } from 'react-native';
 import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
 import { SectionHeader } from '@/components/ui/section-header';
+import { pressableStyle } from 'nativewind';
 import { StatusBadge } from '@/components/ui/status-badge';
 import UIButton from '@/components/ui/ui-button';
 import api from '@/utils/api';
@@ -193,10 +194,10 @@ export default function HomeScreen() {
               <Pressable
                 key={item.id}
                 className="flex-row items-center gap-3 rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-3.5"
-                style={({ pressed }) => ({
+                style={pressableStyle(({ pressed }) => ({
                   opacity: pressed ? 0.92 : 1,
                   transform: [{ scale: pressed ? 0.99 : 1 }],
-                })}
+                }))}
               >
                 <View
                   className="h-12 w-12 items-center justify-center rounded-full"
@@ -247,10 +248,7 @@ export default function HomeScreen() {
               本周 LPR 利率下调,建议优先推荐对流水稳定要求更高的产品。
             </Text>
             <Pressable
-              className="mt-4 self-start rounded-full bg-surface-container-lowest px-4 py-2.5"
-              style={({ pressed }) => ({
-                opacity: pressed ? 0.86 : 1,
-              })}
+              className="mt-4 self-start rounded-full bg-surface-container-lowest px-4 py-2.5 active:opacity-86"
             >
               <Text className="text-sm font-bold text-inverse-surface">立即了解</Text>
             </Pressable>

+ 3 - 2
src/app/(tabs)/profile.tsx

@@ -1,4 +1,5 @@
 import { ActivityIndicator, Modal, Toast } from '@ant-design/react-native';
+import { pressableStyle } from 'nativewind';
 import { Ionicons } from '@expo/vector-icons';
 import { Image } from 'expo-image';
 import { Pressable, ScrollView, Text, View } from 'react-native';
@@ -128,10 +129,10 @@ export default function ProfileScreen() {
         <Pressable
           onPress={handleLogout}
           className="mt-2 flex-row items-center justify-center gap-2 rounded-2xl bg-surface-container-low py-3.5"
-          style={({ pressed }) => ({
+          style={pressableStyle(({ pressed }) => ({
             opacity: pressed ? 0.86 : 1,
             transform: [{ scale: pressed ? 0.985 : 1 }],
-          })}
+          }))}
         >
           <Ionicons name="log-out-outline" size={20} color="#ba1a1a" />
           <Text className="text-base font-bold text-error">退出登录</Text>

+ 4 - 16
src/app/(tabs)/reports.tsx

@@ -172,10 +172,7 @@ export default function ReportsScreen() {
                 key={tab}
                 onPress={() => setActiveTab(tab)}
                 className={`flex-1 rounded-xl py-2.5 ${active ? 'bg-surface-container-lowest' : ''
-                  }`}
-                style={({ pressed }) => ({
-                  opacity: pressed ? 0.88 : 1,
-                })}
+                  } active:opacity-88`}
               >
                 <Text
                   className={`text-center text-sm font-bold ${active ? 'text-primary' : 'text-on-surface-variant'
@@ -193,10 +190,7 @@ export default function ReportsScreen() {
         {filteredReports.map((report) => (
           <Pressable
             key={report.id}
-            className="rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-4"
-            style={({ pressed }) => ({
-              opacity: pressed ? 0.93 : 1,
-            })}
+            className="rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-4 active:opacity-93"
           >
             <View className="mb-3 flex-row items-start justify-between gap-3">
               <View className="flex-1 flex-row items-center gap-3">
@@ -300,20 +294,14 @@ export default function ReportsScreen() {
             {report.status === '已完成' ? (
               <View className="mt-3 flex-row gap-2.5">
                 <Pressable
-                  className="flex-1 items-center rounded-xl bg-primary-container py-2.5"
-                  style={({ pressed }) => ({
-                    opacity: pressed ? 0.88 : 1,
-                  })}
+                  className="flex-1 items-center rounded-xl bg-primary-container py-2.5 active:opacity-88"
                 >
                   <Text className="text-sm font-bold text-on-primary">
                     {report.type === '征信报告' ? '查看详情' : '查看匹配'}
                   </Text>
                 </Pressable>
                 <Pressable
-                  className="flex-1 items-center rounded-xl bg-surface-container-high py-2.5"
-                  style={({ pressed }) => ({
-                    opacity: pressed ? 0.88 : 1,
-                  })}
+                  className="flex-1 items-center rounded-xl bg-surface-container-high py-2.5 active:opacity-88"
                 >
                   <Text className="text-sm font-semibold text-on-surface">
                     {report.type === '征信报告' ? '智能匹配' : '重新匹配'}

+ 3 - 2
src/app/customer/add.tsx

@@ -1,3 +1,4 @@
+import { pressableStyle } from "nativewind";
 import { DatePicker, Input, Modal, Radio, Toast } from "@ant-design/react-native";
 import { Ionicons } from "@expo/vector-icons";
 import { usePreventRemove, useRoute } from "@react-navigation/native";
@@ -253,9 +254,9 @@ function PickerField({
           ? "border-red-300 bg-red-50"
           : "border-outline-variant bg-surface-container-low"
           }`}
-        style={({ pressed }) => ({
+        style={pressableStyle(({ pressed }) => ({
           opacity: disabled ? 0.55 : pressed ? 0.9 : 1,
-        })}
+        }))}
       >
         <Text
           className={`flex-1 text-base ${hasValue ? "text-on-surface" : "text-outline"}`}

+ 4 - 4
src/app/customer/select.tsx

@@ -1,3 +1,4 @@
+import { pressableStyle } from 'nativewind';
 import { StatusBadge } from '@/components/ui/status-badge';
 import { Colors } from '@/constants/theme';
 import type { ListResponse } from '@/utils/api';
@@ -133,10 +134,10 @@ export default function CustomerSelectScreen() {
             <Pressable
                 onPress={() => handlePick(item)}
                 className="mb-2 flex-row items-center gap-3 rounded-2xl border border-outline-variant bg-surface-container-lowest px-4 py-3"
-                style={({ pressed }) => ({
+                style={pressableStyle(({ pressed }) => ({
                     opacity: pressed ? 0.85 : 1,
                     transform: [{ scale: pressed ? 0.995 : 1 }],
-                })}
+                }))}
             >
                 {currentId == item.id && <Ionicons name='checkmark-circle-sharp' size={20} color={Colors.tint} />}
                 <View className="h-10 w-10 items-center justify-center rounded-full bg-primary-fixed">
@@ -181,10 +182,9 @@ export default function CustomerSelectScreen() {
                         <Pressable
                             key={key}
                             onPress={() => handleSelectStatus(key as CustomerLoanStatus)}
-                            className={clsx("rounded-md px-1 border border-transparent", {
+                            className={clsx("rounded-md px-1 border border-transparent active:opacity-84", {
                                  'border-primary-container': active,
                             })}
-                            style={({ pressed }) => ({ opacity: pressed ? 0.84 : 1 })}
                         >
                             <Text
                                 className={clsx("text-sm font-bold text-on-surface-variant", {

+ 5 - 4
src/app/sign-in.tsx

@@ -1,3 +1,4 @@
+import { pressableStyle } from 'nativewind';
 import type { CaptchaRes } from '@/components/captcha-box';
 import CaptchaBox from '@/components/captcha-box';
 import { site } from '@/config.json';
@@ -235,10 +236,10 @@ export default function SignInScreen() {
                         onPress={() => setAuthMode(mode as 'sms' | 'password')}
                         className={`flex-1 rounded-xl px-4 py-3 ${active ? 'bg-surface-container-lowest' : ''
                           }`}
-                        style={({ pressed }) => ({
+                        style={pressableStyle(({ pressed }) => ({
                           opacity: loading ? 0.5 : pressed ? 0.86 : 1,
                           transform: [{ scale: pressed ? 0.99 : 1 }],
-                        })}
+                        }))}
                       >
                         <Text
                           className={`text-center text-base font-bold ${active ? 'text-primary' : 'text-on-surface-variant'
@@ -346,10 +347,10 @@ export default function SignInScreen() {
                   <Pressable
                     key={icon}
                     className="h-14 w-14 items-center justify-center rounded-full bg-surface-container-low"
-                    style={({ pressed }) => ({
+                    style={pressableStyle(({ pressed }) => ({
                       opacity: pressed ? 0.8 : 1,
                       transform: [{ scale: pressed ? 0.94 : 1 }],
-                    })}
+                    }))}
                   >
                     <Ionicons
                       name={icon as keyof typeof Ionicons.glyphMap}