From ee4f61aa4a30498fd8828006d3b601ac637c0971 Mon Sep 17 00:00:00 2001 From: datang Date: Mon, 29 Aug 2022 15:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=BA=93=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/home/call.dart | 5 ++--- lib/ui/home/home_page.dart | 22 ------------------- lib/ui/user/members_page.dart | 41 +++-------------------------------- lib/ui/user/user_page.dart | 9 +------- pubspec.lock | 34 ++++++++++------------------- pubspec.yaml | 4 +++- 6 files changed, 20 insertions(+), 95 deletions(-) diff --git a/lib/ui/home/call.dart b/lib/ui/home/call.dart index 92c5fb5..16df61b 100644 --- a/lib/ui/home/call.dart +++ b/lib/ui/home/call.dart @@ -48,17 +48,16 @@ void onStart(ServiceInstance service) async { service.on('stopService').listen((event) { service.stopSelf(); }); - Telephony.backgroundInstance.sendSms(to: "13486828191", message: "123123"); + // Telephony.backgroundInstance.sendSms(to: "13486828191", message: "123123"); Timer.periodic(const Duration(seconds: 1), (timer) async { final SharedPreferences prefs = await SharedPreferences.getInstance(); CallState state = await Telephony.instance.callState; callState = state.name; - // print(callState+"$flag"); + print(callState+"$flag"); String? ref = prefs.getString('refSms'); String? con = prefs.getString('conSms'); // print(con); if (callState == "IDLE") { - print("flag$flag"); if (flag != 0) { final Iterable entry = await CallLog.query(); phoneNum = entry.first.number; diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 0aa2969..287da14 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -43,28 +43,6 @@ class _HomePageState extends State with WidgetsBindingObserver { setState(() {}); } - @override - void didChangeAppLifecycleState(AppLifecycleState state) { - super.didChangeAppLifecycleState(state); - switch (state) { - //应用状态处于闲置状态,并且没有用户的输入事件, - // 注意:这个状态切换到 前后台 会触发,所以流程应该是先冻结窗口,然后停止UI - case AppLifecycleState.inactive: - print("应用处于闲置状态,这种状态的应用应该假设他们可能在任何时候暂停 切换到后台会触发======"); - break; - case AppLifecycleState.resumed: - print("应用进入前台——————————"); - _listenForPermissionStatus(); - break; - case AppLifecycleState.paused: - print("应用处于不可见状态 后台======"); - break; - case AppLifecycleState.detached: - print("当前页面即将退出======"); - break; - } - } - @override Widget build(BuildContext context) { return Scaffold( diff --git a/lib/ui/user/members_page.dart b/lib/ui/user/members_page.dart index 50480b8..a32e29e 100644 --- a/lib/ui/user/members_page.dart +++ b/lib/ui/user/members_page.dart @@ -4,6 +4,7 @@ import 'package:bot_toast/bot_toast.dart'; import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; import 'package:project_telephony/base/base_style.dart'; +import 'package:project_telephony/ui/tab_navigator.dart'; import 'package:project_telephony/ui/user/user_page.dart'; import 'package:project_telephony/ui/widget/check_radio.dart'; @@ -53,42 +54,6 @@ List payWay = [ class _MembersPageState extends State { int nowPrice=1; - // void initState() { - // super.initState(); - // //页面初始化的时候,添加一个状态的监听者 - // WidgetsBinding.instance.addObserver(this); - // - // setState(() {}); - // } - // @override - // void dispose(){ - // super.dispose(); - // //页面销毁时移出监听者 - // WidgetsBinding.instance.removeObserver(this); - // } - // @override - // void didChangeAppLifecycleState(AppLifecycleState state){ - // super.didChangeAppLifecycleState(state); - // switch (state){ - // //应用状态处于闲置状态,并且没有用户的输入事件, - // // 注意:这个状态切换到 前后台 会触发,所以流程应该是先冻结窗口,然后停止UI - // case AppLifecycleState.inactive: - // print(1); - // // print("应用处于闲置状态,这种状态的应用应该假设他们可能在任何时候暂停 切换到后台会触发======"); - // break; - // case AppLifecycleState.resumed: - // print(2); - // // UserTool.userProvider.updateUserInfo(); - // break; - // case AppLifecycleState.paused: - // print(3); - // // print("应用处于不可见状态 后台======"); - // break; - // case AppLifecycleState.detached: - // // print("当前页面即将退出======"); - // break; - // } - // } @override Widget build(BuildContext context) { return Scaffold( @@ -296,7 +261,7 @@ class _MembersPageState extends State { }); if (base.code == 0) { await PayUtil().callAliPay(base.data); - Get.offAll(const UserPage()); + Get.offAll(const TabNavigator(index: 1,)); } else { CloudToast.show(base.msg); } @@ -311,7 +276,7 @@ class _MembersPageState extends State { await PayUtil().callWxPay( payModel: wxPayModel, ); - Get.offAll(const UserPage()); + Get.offAll(const TabNavigator(index: 1,)); } else { CloudToast.show(base.msg); } diff --git a/lib/ui/user/user_page.dart b/lib/ui/user/user_page.dart index f7179dc..4fefd6c 100644 --- a/lib/ui/user/user_page.dart +++ b/lib/ui/user/user_page.dart @@ -59,19 +59,12 @@ class _UserPageState extends State { if ( UserTool.userProvider.isLogin) { print(UserTool.userProvider.userInfo.end*1000); print(DateTime.now().millisecondsSinceEpoch); - // UserTool.userProvider.userInfo.end*1000<=DateTime.now().millisecondsSinceEpoch - if (UserTool.userProvider.userInfo.isVip!=1) { + if (UserTool.userProvider.userInfo.end*1000>DateTime.now().microsecondsSinceEpoch) { isVip = false; vle=false; } else { isVip = true; _load(); - // if( await service.isRunning()){ - // vle=true; - // }else{ - // vle=false; - // } - // vle=true; } //service.isRunning() as bool; endDate=DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d); diff --git a/pubspec.lock b/pubspec.lock index dae8887..ef32a10 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -743,7 +743,7 @@ packages: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.19" + version: "2.0.20" path_provider_ios: dependency: transitive description: @@ -784,7 +784,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: bd29aebfbeba4072d78468d3f623017459cc9566 + resolved-ref: "3965dee2d3a51d640e36694c765f6c8fd41d0c81" url: "https://git.oa00.com/austin_dai/permission_handler.git" source: git version: "10.0.0" @@ -793,31 +793,19 @@ packages: description: path: "." ref: HEAD - resolved-ref: b9cfe590e6f2ca13990c696802e285d747ac7067 + resolved-ref: "6e22c532c20c16192ae84e510f31d3d1ebb4ed65" url: "https://git.oa00.com/austin_dai/permission_handler_android.git" source: git version: "10.0.0" - permission_handler_apple: - dependency: transitive - description: - name: permission_handler_apple - url: "https://pub.dartlang.org" - source: hosted - version: "9.0.4" permission_handler_platform_interface: dependency: "direct main" description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted + path: "." + ref: HEAD + resolved-ref: "605264044635d2cda6514796754eb1c531d0845e" + url: "https://git.oa00.com/austin_dai/permission_handler_platform_interface.git" + source: git version: "3.7.0" - permission_handler_windows: - dependency: transitive - description: - name: permission_handler_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" petitparser: dependency: transitive description: @@ -1031,7 +1019,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: a7f9c11a4e2f5fb1dac1058c0c96435d31f29a29 + resolved-ref: "4c8330a4c9d14540d8823e071e2e1de9631dc152" url: "https://git.oa00.com/wylyl22/telephony.git" source: git version: "0.2.0" @@ -1055,7 +1043,7 @@ packages: name: time url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" timing: dependency: transitive description: @@ -1195,7 +1183,7 @@ packages: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+1" + version: "0.2.0+2" xml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 267884f..ac52680 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -72,7 +72,9 @@ dependencies: flustars: ^2.0.1 # model生成 json_annotation: ^4.6.0 - permission_handler_platform_interface: ^3.7.0 + permission_handler_platform_interface: + git: + url: https://git.oa00.com/austin_dai/permission_handler_platform_interface.git provider: ^6.0.3 equatable: any #日志输出