From 5cdb5e7ff9c9c249af8881c807df3fe9ed15de29 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Wed, 31 Aug 2022 11:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/providers/user_provider.dart | 4 ++-- lib/ui/home/home_page.dart | 5 ++-- lib/ui/login/login_page.dart | 2 +- lib/ui/user/members_page.dart | 15 ++++++------ lib/ui/user/user_page.dart | 35 ++++++++++++++++++++++++++++ lib/ui/widget/plone_back_button.dart | 6 ++++- 6 files changed, 54 insertions(+), 13 deletions(-) diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index 8af5941..1dde2a9 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -80,7 +80,7 @@ class UserProvider extends ChangeNotifier { if (base.code == 0) { await prefs.remove('conSms'); await prefs.setString('conSms', (UserTool.userProvider.userInfo.tag)==""?"${base - .data['content']}":"[${UserTool.userProvider.userInfo.tag}]${base + .data['content']}":"【${UserTool.userProvider.userInfo.tag}】${base .data['content']}"); service.invoke("stopService"); if(prefs.getBool('kg')!){ @@ -102,7 +102,7 @@ class UserProvider extends ChangeNotifier { if (base.code == 0) { await prefs.remove('refSms'); await prefs.setString('refSms', (UserTool.userProvider.userInfo.tag)==""?"${base - .data['content']}":"[${UserTool.userProvider.userInfo.tag}]${base + .data['content']}":"【${UserTool.userProvider.userInfo.tag}】${base .data['content']}" ); service.invoke("stopService"); if(prefs.getBool('kg')!){ diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index e453f8f..0e9c1f7 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -114,10 +114,11 @@ class _HomePageState extends State with WidgetsBindingObserver { onTap: () { if(!(sms && plone && callLog && kg)){ if(!(sms && plone && callLog )){ - BotToast.showText(text: '功能开关未开启'); + Get.to(()=>const PrivacyRightsPage(name: "权限说明")); // Get.to(()=>const TabNavigator(index: 1,)); }else{ - Get.to(()=>const PrivacyRightsPage(name: "权限说明")); + BotToast.showText(text: '功能开关未开启'); + } } // print(); diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart index 9108997..0029904 100644 --- a/lib/ui/login/login_page.dart +++ b/lib/ui/login/login_page.dart @@ -355,7 +355,7 @@ class _LoginPageState extends State { TextSpan( text: '《短信帮手隐私协议》', style: TextStyle(color: kPrimaryColor, fontSize: 12 * 2.sp), - recognizer: _recognizer(context, 1)), + recognizer: _recognizer(context, 2)), ])) ], ), diff --git a/lib/ui/user/members_page.dart b/lib/ui/user/members_page.dart index 11312d9..5a308f1 100644 --- a/lib/ui/user/members_page.dart +++ b/lib/ui/user/members_page.dart @@ -74,6 +74,7 @@ class _MembersPageState extends State { } void _paySuccess() { _easyRefreshController.callRefresh(); + // Get.offAll(const TabNavigator(index: 1,)); } @override Widget build(BuildContext context) { @@ -121,15 +122,15 @@ class _MembersPageState extends State { Get.snackbar('提示', "请先选择充值月份"); } else { if (_selectIndex == 0) { - print("这是数据${_piceList[_selectIndex].pice}"); - _wxPayFunc(_piceList[_selectIndex].pice); + // print("这是数据${_chooseItem?.pice}"); + _wxPayFunc(_chooseItem?.pice); } else { var result = await isAliPayInstalled(); // 这里判断是否安装支付宝 if (!result) { Get.snackbar('提示', "请先安装支付宝"); } else { - _aliPay(); + _aliPay(_chooseItem?.pice); // aliPay("paySign").then((payResult) { // // map["paySign"]是请求接口返回的字符串直接放进去就好了 // print("支付宝:$payResult"); @@ -249,14 +250,14 @@ class _MembersPageState extends State { ); } - Future _wxPayFunc(double pay) async { + Future _wxPayFunc(double? pay) async { bool isInstalled = await fluwx.isWeChatInstalled; if (!isInstalled) { BotToast.showText(text: "请先安装微信"); return; } //调起支付 - _wxPay(pay); + _wxPay(pay!); // var wxPayModel = WxPayModel.fromJson({ // "prepayId": "wx121434071826969924754d7d3309520000", // "partnerId": "1622850618", @@ -291,9 +292,9 @@ class _MembersPageState extends State { // } // } // - Future _aliPay() async { + Future _aliPay(double? pay) async { var base = await apiClient.request(API.pay.alipay, data: { - 'amount': nowPrice,//注释 + 'amount': pay,//注释 // 'amount': 0.01, }); if (base.code == 0) { diff --git a/lib/ui/user/user_page.dart b/lib/ui/user/user_page.dart index 4a72bad..6f30052 100644 --- a/lib/ui/user/user_page.dart +++ b/lib/ui/user/user_page.dart @@ -63,6 +63,23 @@ class _UserPageState extends State { super.initState(); // _easyRefreshController.callRefresh(); // UserTool.userProvider.updateUserInfo(); + // if (UserTool.userProvider.isLogin) { + // // print(UserTool.userProvider.userInfo.end * 1000); + // // print(DateTime.now().millisecondsSinceEpoch); + // 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; + // } } @@ -84,6 +101,7 @@ class _UserPageState extends State { header: MaterialHeader(), onRefresh: () async { // _load(); + _getRequests(); // await UserTool.userProvider.updateUserInfo(); if (UserTool.userProvider.isLogin) { // print(UserTool.userProvider.userInfo.end * 1000); @@ -237,6 +255,23 @@ class _UserPageState extends State { UserTool.userProvider.userInfo.end * 1000, format: DateFormats.y_mo_d); UserTool.userProvider.updateUserInfo(); + if (UserTool.userProvider.isLogin) { + // print(UserTool.userProvider.userInfo.end * 1000); + // print(DateTime.now().millisecondsSinceEpoch); + 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(() {}); } diff --git a/lib/ui/widget/plone_back_button.dart b/lib/ui/widget/plone_back_button.dart index 5773d4b..9cbb82f 100644 --- a/lib/ui/widget/plone_back_button.dart +++ b/lib/ui/widget/plone_back_button.dart @@ -18,7 +18,11 @@ class CloudBackButton extends StatelessWidget { ? Padding( padding: isSpecial ? EdgeInsets.only(left: 8.w) : EdgeInsets.zero, child: IconButton( - onPressed: () => Navigator.pop(context,true), + onPressed: () { + print("返回传值"); + Navigator.pop(context,true); + + }, icon: Icon( CupertinoIcons.chevron_back, color: color,