| | |
| | | Functions("assets/images/mine/icon_mine_kefu.png", "在线客服", "kefu", false), |
| | | Functions( |
| | | "assets/images/mine/icon_mine_footmark.png", "轨迹足迹", "footmark", true), |
| | | Functions("assets/images/mine/icon_mine_functions.png", "功能使用", "functions", |
| | | true), |
| | | Functions( |
| | | "assets/images/mine/icon_mine_course.png", "使用教程", "course", false), |
| | | // Functions("assets/images/mine/icon_mine_functions.png", "功能使用", "functions", |
| | | // true), |
| | | // Functions( |
| | | // "assets/images/mine/icon_mine_course.png", "使用教程", "course", false), |
| | | Functions("assets/images/mine/icon_mine_share.png", "分享好友", "share", false), |
| | | Functions( |
| | | "assets/images/mine/icon_mine_advice.png", "意见反馈", "advice", false), |
| | |
| | | if (function.needLogin) { |
| | | bool login = await UserUtil.isLogin(); |
| | | if (!login) { |
| | | NavigatorUtil.navigateToNextPage( |
| | | context, LoginPage(title: ""), (data) {}); |
| | | NavigatorUtil.navigateToNextPage(context, LoginPage(title: ""), (data) { |
| | | _getUserInfo(); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | |
| | | context, MyTravelPage(uid: uid!), (data) {}); |
| | | break; |
| | | case "functions": |
| | | NavigatorUtil.navigateToNextPage( |
| | | context, TryFunctionsPage(title: ""), (data) {}); |
| | | NavigatorUtil.navigateToNextPage(context, TryFunctionsPage(title: ""), |
| | | (data) { |
| | | _getUserInfo(); |
| | | }); |
| | | break; |
| | | case "course": |
| | | ConfigUtil.getConfig(ConfigKey.course).then((value) { |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | Widget? ad = AdUtil.loadExpress( |
| | | await AdUtil.getAdInfo(AdPosition.mineExpress), MediaQuery.of(context).size.width - 20, 200, |
| | | (success, msg) { |
| | | await AdUtil.getAdInfo(AdPosition.mineExpress), |
| | | MediaQuery.of(context).size.width - 20, |
| | | 200, (success, msg) { |
| | | adDeleted = true; |
| | | setState(() { |
| | | adView = null; |
| | |
| | | if (user == null) { |
| | | setState(() { |
| | | isLogin = false; |
| | | userInfo = null; |
| | | }); |
| | | return; |
| | | } |
| | |
| | | var code = result!["code"]; |
| | | if (code == 0) { |
| | | UserInfo user = UserInfo.fromJson(result["data"]); |
| | | print(user); |
| | | //保存用户信息 |
| | | UserUtil.setUserInfo(user); |
| | | setState(() { |
| | | userInfo = user; |
| | | if (userInfo != null && |
| | | userInfo!.vipExpireTime != null && |
| | | userInfo!.vipExpireTime! > DateTime.now().millisecond) { |
| | | userInfo!.vipExpireTime! > DateTime.now().millisecondsSinceEpoch) { |
| | | isVIP = true; |
| | | } else { |
| | | isVIP = false; |
| | |
| | | isLogin = false; |
| | | }); |
| | | ToastUtil.toast("账号已被封禁"); |
| | | await UserUtil.logout(); |
| | | } else if (code == 80002) { |
| | | //账号被删除 |
| | | setState(() { |
| | | isLogin = false; |
| | | }); |
| | | ToastUtil.toast("账号已被删除"); |
| | | await UserUtil.logout(); |
| | | } |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | |
| | | Widget _getVIPLeftTime() { |
| | | List<TextSpan> spanList = [const TextSpan(text: '剩余')]; |
| | | if (userInfo != null && userInfo!.vipExpireTime != null) { |
| | | int leftTime = |
| | | userInfo!.vipExpireTime! - DateTime.now().millisecondsSinceEpoch; |
| | | leftTime = leftTime ~/ 1000; |
| | | if (leftTime >= 60 * 60 * 24) { |
| | | spanList.add(TextSpan( |
| | | text: '${leftTime ~/ (60 * 60 * 24)}', |
| | | style: const TextStyle(fontWeight: FontWeight.bold))); |
| | | spanList.add(const TextSpan(text: '天到期')); |
| | | } else if (leftTime >= 60 * 60) { |
| | | spanList.add(TextSpan( |
| | | text: '${leftTime ~/ (60 * 60)}', |
| | | style: const TextStyle(fontWeight: FontWeight.bold))); |
| | | spanList.add(const TextSpan(text: '小时到期')); |
| | | } else { |
| | | spanList.add(TextSpan( |
| | | text: '${leftTime ~/ (60)}', |
| | | style: const TextStyle(fontWeight: FontWeight.bold))); |
| | | spanList.add(const TextSpan(text: '分钟到期')); |
| | | } |
| | | } |
| | | |
| | | return Text.rich(TextSpan( |
| | | children: spanList, |
| | | style: const TextStyle(color: Colors.white, fontSize: 17.5), |
| | | )); |
| | | } |
| | | |
| | | List<Widget> getVIPContent() { |
| | | List<Widget> list = []; |
| | | list.add(Image.asset( |
| | | "assets/images/mine/icon_vip.png", |
| | | width: 44, |
| | | )); |
| | | if (isVIP) { |
| | | if (isVIP&&userInfo!=null) { |
| | | list.add(Container( |
| | | margin: const EdgeInsets.fromLTRB(6, 0, 0, 0), |
| | | child: const Text.rich(TextSpan( |
| | | children: <TextSpan>[ |
| | | TextSpan(text: '剩余'), |
| | | TextSpan( |
| | | text: '10', style: TextStyle(fontWeight: FontWeight.bold)), |
| | | TextSpan(text: '天到期'), |
| | | ], |
| | | style: TextStyle(color: Colors.white, fontSize: 17.5), |
| | | )))); |
| | | child: _getVIPLeftTime())); |
| | | } else { |
| | | list.add(Container( |
| | | margin: const EdgeInsets.fromLTRB(6, 0, 0, 0), |
| | |
| | | UserUtil.isLogin().then((value) { |
| | | if (!value) { |
| | | NavigatorUtil.navigateToNextPage( |
| | | context, |
| | | LoginPage(title: ""), |
| | | (data) {}); |
| | | context, LoginPage(title: ""), |
| | | (data) { |
| | | _getUserInfo(); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | |
| | | NavigatorUtil.navigateToNextPage( |
| | | context, |
| | | BrowserPage( |
| | | title: "会员", url: value!), |
| | | (data) {}); |
| | | title: "会员", |
| | | url: value!), (data) { |
| | | _getUserInfo(); |
| | | }); |
| | | } |
| | | }); |
| | | }); |