|
|
@ -122,6 +122,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
_getRequests();
|
|
|
|
_getRequests();
|
|
|
|
// await UserTool.userProvider.updateUserInfo();
|
|
|
|
// await UserTool.userProvider.updateUserInfo();
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
|
|
|
|
|
|
|
|
|
// var res=await apiClient.request(API.app.trialVip);
|
|
|
|
// var res=await apiClient.request(API.app.trialVip);
|
|
|
|
if (UserTool.userProvider.userInfo.isTrial == 0) {
|
|
|
|
if (UserTool.userProvider.userInfo.isTrial == 0) {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
@ -145,7 +146,9 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
vle = false;
|
|
|
|
vle = false;
|
|
|
|
|
|
|
|
Get.to(()=>const LoginPage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -293,14 +296,17 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
isVip = true;
|
|
|
|
isVip = true;
|
|
|
|
vle = await service.isRunning();
|
|
|
|
vle = await service.isRunning();
|
|
|
|
|
|
|
|
_easyRefreshController.callRefresh();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//service.isRunning() as bool;
|
|
|
|
//service.isRunning() as bool;
|
|
|
|
// endDate = DateUtil.formatDateMs(
|
|
|
|
// endDate = DateUtil.formatDateMs(
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
vle = false;
|
|
|
|
vle = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -420,20 +426,25 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
print("true");
|
|
|
|
print("true");
|
|
|
|
prefs.remove("kg");
|
|
|
|
prefs.remove("kg");
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
|
|
|
|
// Future.delayed(const Duration(seconds: 1), () async {
|
|
|
|
|
|
|
|
// service.startService();
|
|
|
|
|
|
|
|
// });
|
|
|
|
service.startService();
|
|
|
|
service.startService();
|
|
|
|
// WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// initializeService();
|
|
|
|
// initializeService();
|
|
|
|
// UserTool.userProvider.setKg(vle)
|
|
|
|
// UserTool.userProvider.setKg(vle)
|
|
|
|
// initializeService();
|
|
|
|
// initializeService();
|
|
|
|
initializeService();
|
|
|
|
// initializeService();
|
|
|
|
BotToast.showText(text: " 你开启了该功能");
|
|
|
|
BotToast.showText(text: " 你开启了该功能");
|
|
|
|
// initializeService();
|
|
|
|
// initializeService();
|
|
|
|
// print("这是数据${prefs.getBool("kg")}");
|
|
|
|
// print("这是数据${prefs.getBool("kg")}");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
prefs.remove("kg");
|
|
|
|
prefs.remove("kg");
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
|
|
|
|
// Future.delayed(const Duration(seconds: 1), () async {
|
|
|
|
|
|
|
|
// service.invoke("stopService");
|
|
|
|
|
|
|
|
// });
|
|
|
|
service.invoke("stopService");
|
|
|
|
service.invoke("stopService");
|
|
|
|
|
|
|
|
|
|
|
|
///有问题??
|
|
|
|
///有问题??
|
|
|
|
// exit(0);
|
|
|
|
// exit(0);
|
|
|
|
// UserTool.userProvider.setKg(vle);
|
|
|
|
// UserTool.userProvider.setKg(vle);
|
|
|
@ -476,18 +487,24 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
));
|
|
|
|
));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "卡密兑换":
|
|
|
|
case "卡密兑换":
|
|
|
|
|
|
|
|
|
|
|
|
Navigator.of(context)
|
|
|
|
Navigator.of(context)
|
|
|
|
.push(
|
|
|
|
.push(
|
|
|
|
MaterialPageRoute(builder: (_) => const UserCardPage()),
|
|
|
|
MaterialPageRoute(builder: (_) => const UserCardPage()),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.then((val) => _easyRefreshController.callRefresh());
|
|
|
|
.then((val) => _getRequests()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// _easyRefreshController.callRefresh()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
|
|
|
child: ListTile(
|
|
|
|
child: ListTile(
|
|
|
|