From 68d49842cd4ca455d6c1241f39725c6b00567154 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Thu, 25 Aug 2022 08:53:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=9B=BE=E7=89=87=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= 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 | 15 ++++++++------- lib/ui/user/user_page.dart | 20 ++++++++++++-------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/lib/ui/home/call.dart b/lib/ui/home/call.dart index e506109..b2e597f 100644 --- a/lib/ui/home/call.dart +++ b/lib/ui/home/call.dart @@ -61,18 +61,17 @@ void onStart(ServiceInstance service) async { service.stopSelf(); }); - Timer.periodic(const Duration(seconds: 1), (timer) async { final SharedPreferences prefs = await SharedPreferences.getInstance(); CallState state = await Telephony.instance.callState; callState = state.name; String? ref=prefs.getString('refSms'); String? con=prefs.getString('conSms'); - print(ref); + print("这是数据$ref"); // bool? kg= prefs.getBool("kg"); // // bool? kg= prefs.getBool("kg"); - print("这是数据${prefs.getBool("kg")}"); + // print("这是数据${prefs.getBool("kg")}"); // print("这是数据$kg"); // kg = UserTool.userProvider.kg; // print("这是数据${prefs.getBool("kg")}"); diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 3d1cfa9..812b070 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -201,12 +201,13 @@ _getBody() { ), ], ),), - const Spacer() - ,Image.asset( - image, - width: 166.w, - height: 152.w, - fit: BoxFit.fill, - ),],))); + const Spacer(), + Padding(padding: EdgeInsets.only(top: 40.w),child: Image.asset( + image, + width: 166.w, + height: 152.w, + fit: BoxFit.fill, + ),) + ,],))); } } diff --git a/lib/ui/user/user_page.dart b/lib/ui/user/user_page.dart index 1bf03db..f6b3ad6 100644 --- a/lib/ui/user/user_page.dart +++ b/lib/ui/user/user_page.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:bot_toast/bot_toast.dart'; import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; @@ -49,13 +51,15 @@ class _UserPageState extends State { void initState() { super.initState(); if ( UserTool.userProvider.isLogin) { - if (UserTool.userProvider.userInfo.end<=DateTime.now().millisecondsSinceEpoch ) { - isVip = false; - vle =false; - } else { - vle =true; - isVip = true; - } + Timer.periodic(Duration(seconds: 1), (timer) { + if (UserTool.userProvider.userInfo.isVip==1 && UserTool.userProvider.userInfo.end>=DateTime.now().millisecondsSinceEpoch ) { + isVip = false; + vle =false; + } else { + vle =true; + isVip = true; + } + }); endDate=DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d); }else{ vle = false; @@ -295,7 +299,7 @@ class _UserPageState extends State { // await prefs.setBool("kg", value); // print("这是数据${prefs.getBool("kg")}"); setState(() { - if(isVip){ + if(!isVip){ vle=value; // prefs.setBool("kg", vle);