|
|
@ -56,6 +56,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
_easyRefreshController.dispose();
|
|
|
|
_easyRefreshController.dispose();
|
|
|
|
super.dispose();
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// _load() async {
|
|
|
|
// _load() async {
|
|
|
|
// // print("123123131313131231231231231313123131232311313131231231");
|
|
|
|
// // print("123123131313131231231231231313123131232311313131231231");
|
|
|
|
// vle = await service.isRunning();
|
|
|
|
// vle = await service.isRunning();
|
|
|
@ -88,6 +89,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
// vle = false;
|
|
|
|
// vle = false;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// getRes() async{
|
|
|
|
// getRes() async{
|
|
|
|
// var res=await apiClient.request(API.app.trialVip);
|
|
|
|
// var res=await apiClient.request(API.app.trialVip);
|
|
|
|
// if(res.code==0){
|
|
|
|
// if(res.code==0){
|
|
|
@ -98,87 +100,91 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
|
|
return CloudScaffold(
|
|
|
|
return CloudScaffold(
|
|
|
|
systemStyle: const SystemUiOverlayStyle(
|
|
|
|
systemStyle: const SystemUiOverlayStyle(
|
|
|
|
statusBarIconBrightness: Brightness.dark,
|
|
|
|
statusBarIconBrightness: Brightness.dark,
|
|
|
|
// systemNavigationBarColor: Colors.white,
|
|
|
|
// systemNavigationBarColor: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
path: Assets.images.bg.path,
|
|
|
|
path: Assets.images.bg.path,
|
|
|
|
bodyColor: Colors.white,
|
|
|
|
bodyColor: Colors.white,
|
|
|
|
extendBody: true,
|
|
|
|
extendBody: true,
|
|
|
|
body: Expanded(child: Column(
|
|
|
|
body: Expanded(
|
|
|
|
children: [
|
|
|
|
child: Column(
|
|
|
|
Expanded(
|
|
|
|
children: [
|
|
|
|
child:EasyRefresh(
|
|
|
|
Expanded(
|
|
|
|
firstRefresh: true,
|
|
|
|
child: EasyRefresh(
|
|
|
|
header: MaterialHeader(),
|
|
|
|
firstRefresh: true,
|
|
|
|
onRefresh: () async {
|
|
|
|
header: MaterialHeader(),
|
|
|
|
// _load();
|
|
|
|
onRefresh: () async {
|
|
|
|
_getRequests();
|
|
|
|
// _load();
|
|
|
|
// await UserTool.userProvider.updateUserInfo();
|
|
|
|
_getRequests();
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
|
// await UserTool.userProvider.updateUserInfo();
|
|
|
|
// var res=await apiClient.request(API.app.trialVip);
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
|
if(UserTool.userProvider.userInfo.isTrial!=0){
|
|
|
|
// var res=await apiClient.request(API.app.trialVip);
|
|
|
|
showDialog(context: context, builder: (context){
|
|
|
|
if (UserTool.userProvider.userInfo.isTrial == 0) {
|
|
|
|
return const AppDialog();
|
|
|
|
showDialog(
|
|
|
|
});
|
|
|
|
context: context,
|
|
|
|
}
|
|
|
|
builder: (context) {
|
|
|
|
// print(UserTool.userProvider.userInfo.end * 1000);
|
|
|
|
return const AppDialog();
|
|
|
|
// print(DateTime.now().millisecondsSinceEpoch);
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
if (UserTool.userProvider.userInfo.isVip != 1) {
|
|
|
|
// print(UserTool.userProvider.userInfo.end * 1000);
|
|
|
|
isVip = false;
|
|
|
|
// print(DateTime.now().millisecondsSinceEpoch);
|
|
|
|
vle = false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
isVip = true;
|
|
|
|
|
|
|
|
vle = await service.isRunning();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//service.isRunning() as bool;
|
|
|
|
|
|
|
|
// endDate = DateUtil.formatDateMs(
|
|
|
|
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
vle = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},child:ListView(children: [
|
|
|
|
|
|
|
|
_getUser(),
|
|
|
|
|
|
|
|
72.hb,
|
|
|
|
|
|
|
|
_getBanner(),
|
|
|
|
|
|
|
|
120.hb,
|
|
|
|
|
|
|
|
_getSwitch2(),
|
|
|
|
|
|
|
|
_getSwitch(Assets.icons.privacy.path, "隐私政策", false),
|
|
|
|
|
|
|
|
_getSwitch(Assets.icons.permissions.path, "权限说明", false),
|
|
|
|
|
|
|
|
_getSwitch(Assets.icons.sms.path, "短信标签", false),
|
|
|
|
|
|
|
|
// const Spacer(),
|
|
|
|
|
|
|
|
182.hb,
|
|
|
|
|
|
|
|
UserTool.userProvider.isLogin
|
|
|
|
|
|
|
|
? PloneBottom(
|
|
|
|
|
|
|
|
border: false,
|
|
|
|
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
var cancel = CloudToast.loading;
|
|
|
|
|
|
|
|
var base = await apiClient.request(API.app.logout,
|
|
|
|
|
|
|
|
showMessage: true);
|
|
|
|
|
|
|
|
if (base.code == 0) {
|
|
|
|
|
|
|
|
UserTool.userProvider.logout();
|
|
|
|
|
|
|
|
Get.offAll(const TabNavigator());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cancel();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
textColor: const Color(0xFF1890FF),
|
|
|
|
|
|
|
|
color1: const Color(0xFFEBF5FF),
|
|
|
|
|
|
|
|
color2: const Color(0xFFEBF5FF),
|
|
|
|
|
|
|
|
text: "退出登录",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: const SizedBox()],) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
),],
|
|
|
|
|
|
|
|
),)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
if (UserTool.userProvider.userInfo.isVip != 1) {
|
|
|
|
|
|
|
|
isVip = false;
|
|
|
|
|
|
|
|
vle = false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
isVip = true;
|
|
|
|
|
|
|
|
vle = await service.isRunning();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//service.isRunning() as bool;
|
|
|
|
|
|
|
|
// endDate = DateUtil.formatDateMs(
|
|
|
|
|
|
|
|
// UserTool.userProvider.userInfo.end * 1000,
|
|
|
|
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
vle = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: ListView(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
_getUser(),
|
|
|
|
|
|
|
|
72.hb,
|
|
|
|
|
|
|
|
_getBanner(),
|
|
|
|
|
|
|
|
120.hb,
|
|
|
|
|
|
|
|
_getSwitch2(),
|
|
|
|
|
|
|
|
_getSwitch(Assets.icons.privacy.path, "隐私政策", false),
|
|
|
|
|
|
|
|
_getSwitch(
|
|
|
|
|
|
|
|
Assets.icons.permissions.path, "权限说明", false),
|
|
|
|
|
|
|
|
_getSwitch(Assets.icons.sms.path, "短信标签", false),
|
|
|
|
|
|
|
|
// const Spacer(),
|
|
|
|
|
|
|
|
182.hb,
|
|
|
|
|
|
|
|
UserTool.userProvider.isLogin
|
|
|
|
|
|
|
|
? PloneBottom(
|
|
|
|
|
|
|
|
border: false,
|
|
|
|
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
var cancel = CloudToast.loading;
|
|
|
|
|
|
|
|
var base = await apiClient.request(
|
|
|
|
|
|
|
|
API.app.logout,
|
|
|
|
|
|
|
|
showMessage: true);
|
|
|
|
|
|
|
|
if (base.code == 0) {
|
|
|
|
|
|
|
|
UserTool.userProvider.logout();
|
|
|
|
|
|
|
|
Get.offAll(const TabNavigator());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cancel();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
textColor: const Color(0xFF1890FF),
|
|
|
|
|
|
|
|
color1: const Color(0xFFEBF5FF),
|
|
|
|
|
|
|
|
color2: const Color(0xFFEBF5FF),
|
|
|
|
|
|
|
|
text: "退出登录",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: const SizedBox()
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
))),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//头像
|
|
|
|
//头像
|
|
|
@ -189,7 +195,6 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
|
|
|
|
if (!userProvider.isLogin) {
|
|
|
|
if (!userProvider.isLogin) {
|
|
|
|
Get.to(() => const LoginPage());
|
|
|
|
Get.to(() => const LoginPage());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -273,8 +278,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_getRequests() async {
|
|
|
|
_getRequests() async {
|
|
|
|
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);
|
|
|
|
UserTool.userProvider.updateUserInfo();
|
|
|
|
UserTool.userProvider.updateUserInfo();
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
|
if (UserTool.userProvider.isLogin) {
|
|
|
@ -335,7 +339,9 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
_getVip(),
|
|
|
|
_getVip(),
|
|
|
|
16.hb,
|
|
|
|
16.hb,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
isVip ? "${DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d)}到期" : "解锁全部功能",
|
|
|
|
isVip
|
|
|
|
|
|
|
|
? "${DateUtil.formatDateMs(UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d)}到期"
|
|
|
|
|
|
|
|
: "解锁全部功能",
|
|
|
|
style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24),
|
|
|
|
style: TextStyle(color: Colors.white, fontSize: BaseStyle.fontSize24),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -373,6 +379,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//内容
|
|
|
|
//内容
|
|
|
|
_getSwitch2() {
|
|
|
|
_getSwitch2() {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
@ -402,7 +409,6 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
// await prefs.setBool("kg", value);
|
|
|
|
// await prefs.setBool("kg", value);
|
|
|
|
// print("这是数据${prefs.getBool("kg")}");
|
|
|
|
// print("这是数据${prefs.getBool("kg")}");
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
|
|
if (isVip) {
|
|
|
|
if (isVip) {
|
|
|
|
vle = value;
|
|
|
|
vle = value;
|
|
|
|
// prefs.setBool("kg", vle);
|
|
|
|
// prefs.setBool("kg", vle);
|
|
|
@ -424,6 +430,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
prefs.remove("kg");
|
|
|
|
prefs.remove("kg");
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
prefs.setBool("kg", vle);
|
|
|
|
service.invoke("stopService");
|
|
|
|
service.invoke("stopService");
|
|
|
|
|
|
|
|
|
|
|
|
///有问题??
|
|
|
|
///有问题??
|
|
|
|
// exit(0);
|
|
|
|
// exit(0);
|
|
|
|
// UserTool.userProvider.setKg(vle);
|
|
|
|
// UserTool.userProvider.setKg(vle);
|
|
|
@ -436,8 +443,7 @@ class _UserPageState extends State<UserPage> {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
BotToast.showText(text: "还没有开通会员,不可使用该功能");
|
|
|
|
BotToast.showText(text: "还没有开通会员,不可使用该功能");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
);
|
|
|
|
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|