leon 1 anno fa
parent
commit
8e1638c5ee

+ 1 - 1
android/app/build.gradle

@@ -144,7 +144,7 @@ aaptOptions.useNewCruncher = false
         applicationId app_id
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
-        versionCode 18
+        versionCode 20
         versionName "1.0.1"
         buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
 //        manifestPlaceholders = [

File diff suppressed because it is too large
+ 0 - 0
android/app/src/main/assets/index.android.bundle


File diff suppressed because it is too large
+ 0 - 0
android/app/src/main/assets/index.android.map


+ 3 - 0
android/app/src/main/java/com/hola/MainActivity.java

@@ -133,6 +133,9 @@ public class MainActivity extends ReactActivity {
             // 如果为 true,停止计时器并使用 receivedIntent 对象
             handler.removeCallbacks(this);
 
+            NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+            notificationManager.cancelAll();
+
             WritableMap payload = Arguments.createMap();
             payload.putString("category_id",intent.getStringExtra("category_id"));
             payload.putString("action_id",intent.getAction());

+ 2 - 1
ios/AppDelegate.mm

@@ -131,7 +131,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
 {
 //  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
-#if DEBUG
+#if DEBUGsss
   return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
 #else
   return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
@@ -229,6 +229,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler
 {
     //应用程序在后台,用户通过点击本地推送、远程推送进入app时调用此方法
+  self.timestamp = [[NSDate date] timeIntervalSince1970]*1000;
   self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(postNotificationData:) userInfo:response repeats:YES];
 }
 

BIN
ios/assets/src/assets/images/navi_back.png


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


BIN
src/assets/images/navi_back.png


+ 4 - 4
src/features/trackTimeDuration/actions/TrackTimeActions.tsx

@@ -19,7 +19,7 @@ export const startFast = (start_time: number, duration: number, logMethod: strin
         // duration = duration < 3600 * 1000 ? 3600 * 1000 : duration;
         const extra = {
             set_time: global.set_time,
-            confirm_time: new Date().getTime(),
+            confirm_time: logMethod=='NOTIFY_ONE_TAP'?global.set_time:new Date().getTime(),
             log_method: logMethod
         }
         recordCheck({
@@ -41,7 +41,7 @@ export const endFast = (start_time: number, logMethod: string) => {
     return new Promise((resolve, reject) => {
         const extra = {
             set_time: global.set_time,
-            confirm_time: new Date().getTime(),
+            confirm_time: logMethod=='NOTIFY_ONE_TAP'?global.set_time:new Date().getTime(),
             log_method: logMethod
         }
         recordCheck({
@@ -65,7 +65,7 @@ export const startSleep = (start_time: number, duration: number, logMethod: stri
     // duration = duration < 3600 * 1000 ? 3600 * 1000 : duration;
     const extra = {
         set_time: global.set_time,
-        confirm_time: new Date().getTime(),
+        confirm_time: logMethod=='NOTIFY_ONE_TAP'?global.set_time:new Date().getTime(),
         log_method: logMethod
     }
     return new Promise((resolve, reject) => {
@@ -86,7 +86,7 @@ export const startSleep = (start_time: number, duration: number, logMethod: stri
 export const endSleep = (start_time: number, logMethod: string) => {
     const extra = {
         set_time: global.set_time,
-        confirm_time: new Date().getTime(),
+        confirm_time: logMethod=='NOTIFY_ONE_TAP'?global.set_time:new Date().getTime(),
         log_method: logMethod
     }
     return new Promise((resolve, reject) => {

+ 10 - 10
src/features/trackTimeDuration/components/IndexConsole.tsx

@@ -98,7 +98,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                 })
                 global.set_time = timestamp;
                 setLogEvent('NOTIFY_ONE_TAP');
-                setLogEvent(timestamp)
+                // setLogEvent(timestamp)
                 switch (action_id) {
                     case 'START_TIMER_NOW':
                         {
@@ -109,7 +109,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                                 operateType = 'startSleep'
                             }
                             global.set_time = timestamp//new Date().getTime()
-                            pickerConfirm(timestamp)
+                            pickerConfirm(timestamp,'NOTIFY_ONE_TAP')
                             // pickerConfirm(new Date().getTime())
                         }
                         break;
@@ -163,7 +163,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                                 operateType = 'endSleep'
                             }
                             global.set_time = timestamp//new Date().getTime()
-                            pickerConfirm(timestamp)
+                            pickerConfirm(timestamp,'NOTIFY_ONE_TAP')
                             // pickerConfirm(new Date().getTime())
                         }
                         break;
@@ -472,7 +472,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                 // showEndTime={operateType == 'startFast' || operateType == 'startSleep'}
                 duration={duration}
                 onCancel={hidePicker} onChange={(e) => {
-                    pickerConfirm(e)
+                    pickerConfirm(e,null)
                     global.pauseIndexTimer = false
                     // hidePicker()
                 }} />
@@ -519,7 +519,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                 isTimeout={isTimeout}
                 isLoading={btnDisable}
                 onChange={(e) => {
-                    pickerConfirm(e)
+                    pickerConfirm(e,null)
                     global.pauseIndexTimer = false
                 }}
             />
@@ -579,7 +579,7 @@ export default function IndexConsole(props: { record: any, count: number, access
         jumpPage('/pages/common/H5?title=fast16cc 关注服务号&url=' + resource[0].url)
     }
 
-    function pickerConfirm(t1: number) {
+    function pickerConfirm(t1: number,event:any) {
         if (btnDisable) {
             return
         }
@@ -596,7 +596,7 @@ export default function IndexConsole(props: { record: any, count: number, access
 
         switch (operateType) {
             case 'startFast':
-                startFast(t1, fastDuration,logEvent).then(res => {
+                startFast(t1, fastDuration,event?event:logEvent).then(res => {
                     global.indexPageRefresh()
                     setFirstEnter(false)
                     hidePicker()
@@ -669,7 +669,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                 })
                 break
             case 'startSleep':
-                startSleep(t1, sleepDuration,logEvent).then(res => {
+                startSleep(t1, sleepDuration,event?event:logEvent).then(res => {
                     global.indexPageRefresh()
                     setFirstEnter(false)
                     hidePicker()
@@ -744,7 +744,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                 })
                 break
             case 'endSleep':
-                endSleep(t1,logEvent).then(res => {
+                endSleep(t1,event?event:logEvent).then(res => {
                     getLocalPush()
                     setBtnDisable(false)
                     global.indexPageRefresh()
@@ -767,7 +767,7 @@ export default function IndexConsole(props: { record: any, count: number, access
                 })
                 break
             case 'endFast':
-                endFast(t1,logEvent).then(res => {
+                endFast(t1,event?event:logEvent).then(res => {
                     getLocalPush()
                     setBtnDisable(false)
                     global.indexPageRefresh()

+ 5 - 1
src/pages/clock/ClockMain.tsx

@@ -975,7 +975,11 @@ export default function Page() {
                         <Text style={{ color: '#fff', fontSize: 15 }}>member status:{access && access.member && access.member.status}</Text>
                         {
                             access && access.member && access.member.status=='MEMBER' &&
-                            <Text style={{ color: '#fff', fontSize: 15 }}>会员过期时间:{TimeFormatter.countdown(access.member.expire)}</Text>
+                            <Text style={{ color: '#fff', fontSize: 15 }}>会员过期时间:{dayjs(access.member.expire).format('YYYY-MM-DD HH:mm:ss')}</Text>
+                        }
+                        {
+                            access && access.member && access.member.status=='MEMBER' &&
+                            <Text style={{ color: '#fff', fontSize: 15 }}>会员过期倒计时:{TimeFormatter.countdown(access.member.expire)}</Text>
                         }
                         <Text style={{ color: '#fff', fontSize: 15 }}>current status:{access.fast_sleep.current.qualification.status}</Text>
                         <Text style={{ color: '#fff', fontSize: 15 }}>previous status:{access.fast_sleep.previous.qualification.status}</Text>

+ 31 - 7
src/pages/store/product_list.tsx

@@ -9,10 +9,12 @@ import './product_list.scss'
 import { ColorType } from "@/context/themes/color";
 import { payInfo } from "@/services/user";
 import Taro from "@tarojs/taro";
+import showAlert from "@/components/basic/Alert";
 
-let useNavigation;
+let useNavigation, TouchableOpacity;
 if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
+    TouchableOpacity = require('react-native').TouchableOpacity
 }
 export default function ProductList() {
 
@@ -20,7 +22,7 @@ export default function ProductList() {
     const user = useSelector((state: any) => state.user);
     // - State for displaying an overlay view
     const [isPurchasing, setIsPurchasing] = useState(false);
-    const [errorCode,setErrorCode] = useState<any>(-1)
+    const [errorCode, setErrorCode] = useState<any>(-1)
 
     let navigation;
     if (useNavigation) {
@@ -28,7 +30,29 @@ export default function ProductList() {
     }
 
     useEffect(() => {
-        console.log(user)
+        if (navigation) {
+            navigation.setOptions({
+                gestureEnabled: !isPurchasing,
+                headerLeft: () => (<TouchableOpacity activeOpacity={1} style={{ marginLeft: 5, padding: 5 }} onPress={() => {
+                    if (!isPurchasing) {
+                        navigation.goBack()
+                    }
+                    else {
+                        showAlert({
+                            title: '支付进行中',
+                            content: '禁止返回',
+                            showCancel: false
+                        })
+                    }
+
+                }}>
+                    <Image style={{ width: 20, height: 20 }} src={require('@/assets/images/navi_back.png')} />
+                </TouchableOpacity>),
+            });
+        }
+    }, [isPurchasing])
+
+    useEffect(() => {
         if (process.env.TARO_ENV == 'rn') {
             if (kIsIOS) {
                 Purchases.configure({
@@ -45,8 +69,8 @@ export default function ProductList() {
             // getProducts();
             // console.log('aaaa')
             // setTimeout(() => {
-                getProducts();
-                // hi()
+            getProducts();
+            // hi()
             // }, 2000)
 
         }
@@ -63,7 +87,7 @@ export default function ProductList() {
                 setPackages((offerings as any).current.availablePackages);
             }
         } catch (e) {
-            console.log('product list offerings error',e.message)
+            console.log('product list offerings error', e.message)
         }
     }
 
@@ -145,7 +169,7 @@ export default function ProductList() {
             isPurchasing && <Text style={{ color: '#fff', fontSize: 40 }}>正在付款</Text>
         }
         {
-            errorCode!=-1 && <Text style={{ color: '#fff', fontSize: 40 }}>出错了,错误代码{errorCode}</Text>
+            errorCode != -1 && <Text style={{ color: '#fff', fontSize: 40 }}>出错了,错误代码{errorCode}</Text>
         }
     </View>
 }

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