diff --git a/lib/constants/api.dart b/lib/constants/api.dart index c8dc7e2..da42ee8 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -10,7 +10,6 @@ class API { return 'http://api.dxbs.vip'; } else { // return 'http://10.0.2.2:8088/'; - return 'http://api.dxbs.vip/'; } } @@ -48,6 +47,8 @@ class _App { String get delete => '/app/user/content/delete'; ///选择自定义短信 String get checked => '/app/user/content/checked'; + ///查找短信 + String get find => '/app/user/content/find'; ///更新VIP状态(已合并至用户信息) String get updateVip => '/app/user/updateVip'; } diff --git a/lib/main.dart b/lib/main.dart index 7213531..8c7d186 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -76,7 +76,7 @@ class _MyAppState extends State { // final service = FlutterBackgroundService(); _Getpermission(); registerWxApi( - appId: "wxd930ea5d5a228f5f", + appId: "wx3a0b41d12afef4e2", // universalLink:"http://api.dxbs.vip/ " ); } diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index 634a2b8..12f0d8e 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -16,6 +16,10 @@ class UserProvider extends ChangeNotifier { late UserInfoModel _userInfo; UserInfoModel get userInfo => _userInfo; + late String _contentCon; + String get contentCon=>_contentCon; + late String _contentRef; + String get contentRef=>_contentRef; Future init() async { if (HiveStore.appBox?.containsKey('token') ?? false) { @@ -42,6 +46,8 @@ Future setKg(bool lockage) async{ _isLogin = true; //每次打开app更新用户信息 await updateUserInfo(); + await updateConSms(); + await updateRefSms(); } Future logout() async { @@ -61,4 +67,23 @@ Future setKg(bool lockage) async{ notifyListeners(); } + Future updateConSms() async { + var base = await apiClient.request(API.app.find,data: {'status': 1}); + if (base.code == 0) { + _contentCon = base.data['content']; + } else { + CloudToast.show(base.msg); + } + notifyListeners(); + } + + Future updateRefSms() async { + var base = await apiClient.request(API.app.find,data: {'status': 2}); + if (base.code == 0) { + _contentRef = base.data['content']; + } else { + CloudToast.show(base.msg); + } + notifyListeners(); + } } diff --git a/lib/ui/home/call.dart b/lib/ui/home/call.dart index e28dc4c..10cc8ad 100644 --- a/lib/ui/home/call.dart +++ b/lib/ui/home/call.dart @@ -62,6 +62,7 @@ void onStart(ServiceInstance service ) async { Timer.periodic(const Duration(seconds: 1), (timer) async { CallState state = await Telephony.instance.callState; callState = state.name; + // bool? kg=prefs.getBool("kg"); // print("这是数据$kg"); // kg= await HiveStore.appBox!.get("kg"); diff --git a/lib/ui/home/content_connect_page.dart b/lib/ui/home/content_connect_page.dart index dccd62d..8222e88 100644 --- a/lib/ui/home/content_connect_page.dart +++ b/lib/ui/home/content_connect_page.dart @@ -111,6 +111,7 @@ class _ContentConnectPageState extends State { if (res.code == 0) { setState(() {}); UserTool.userProvider.updateUserInfo(); + UserTool.userProvider.updateConSms(); _easyRefreshController.callRefresh(); } else { CloudToast.show(res.msg); diff --git a/lib/ui/home/content_refuse_page.dart b/lib/ui/home/content_refuse_page.dart index 09a97cf..a31c829 100644 --- a/lib/ui/home/content_refuse_page.dart +++ b/lib/ui/home/content_refuse_page.dart @@ -112,6 +112,7 @@ class _ContentRefusePageState extends State { if (res.code == 0) { setState(() {}); userProvider.updateUserInfo(); + userProvider.updateRefSms(); _easyRefreshController.callRefresh(); } else { CloudToast.show(res.msg); diff --git a/lib/ui/loading.dart b/lib/ui/loading.dart index b2214dd..b4007e8 100644 --- a/lib/ui/loading.dart +++ b/lib/ui/loading.dart @@ -36,17 +36,14 @@ class _LoadingState extends State { Future.delayed(const Duration(milliseconds: 1000), () async { await initialAll(); if (!await userProvider.init()) { - await Get.offAll(() => const LoginPage()); + await Get.offAll(() => const TabNavigator()); + // await Get.offAll(() => const LoginPage()); } else { Navigator.of(context).pushReplacementNamed("/TabNavigator"); + // await Get.offAll(() => const TabNavigator()); } }); - // Future.delayed(const Duration(seconds: 3),(){ - // //3秒后跳转到其他路由 - // Navigator.of(context).pushReplacementNamed("/TabNavigator"); - // }); - } @override diff --git a/lib/ui/widget/putup_widget.dart b/lib/ui/widget/putup_widget.dart index b11b38f..e136a81 100644 --- a/lib/ui/widget/putup_widget.dart +++ b/lib/ui/widget/putup_widget.dart @@ -36,11 +36,7 @@ class SortWidget extends StatelessWidget { required this.childAspectRatio, this.haveButton = false, required this.pickItem}); -// @override -// void initState() { -// super.initState(); -// } @override Widget build(BuildContext context) {