From b53f7028e6c8bd91f07da361e3dc1418f7aca884 Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Mon, 29 Apr 2024 14:30:36 +0800 Subject: [PATCH] =?UTF-8?q?=20feat:=E5=AE=8C=E6=88=90=E6=88=91=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/lib/flavors.dart | 4 +- .../lockMian/lockList/lockList_xhj_page.dart | 19 +- star_lock/lib/mine/mall/lockMall_page.dart | 11 +- .../minePersonInfo_page.dart | 361 ++++++++++-------- star_lock/lib/tools/commonItem.dart | 2 +- star_lock/lib/tools/titleAppBar.dart | 10 +- 6 files changed, 227 insertions(+), 180 deletions(-) diff --git a/star_lock/lib/flavors.dart b/star_lock/lib/flavors.dart index 7cc0ef63..19d54133 100644 --- a/star_lock/lib/flavors.dart +++ b/star_lock/lib/flavors.dart @@ -109,8 +109,8 @@ class F { case Flavor.sky: return 'https://lock.skychip.top'; case Flavor.xhj: - // return 'https://lock.xhjcn.ltd'; - return 'https://pre.lock.star-lock.cn'; + return 'https://lock.xhjcn.ltd'; + // return 'https://pre.lock.star-lock.cn'; default: throw Exception('flavor[$name] apiPrefix not found'); } diff --git a/star_lock/lib/main/lockMian/lockList/lockList_xhj_page.dart b/star_lock/lib/main/lockMian/lockList/lockList_xhj_page.dart index 7f05d2e1..6bdd40b6 100644 --- a/star_lock/lib/main/lockMian/lockList/lockList_xhj_page.dart +++ b/star_lock/lib/main/lockMian/lockList/lockList_xhj_page.dart @@ -99,7 +99,7 @@ class _LockListXHJPageState extends State with RouteAware { child: GridView.extent( padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w), maxCrossAxisExtent: Get.width * .6, - childAspectRatio: 1.4, + childAspectRatio: 1.2, crossAxisSpacing: 15.w, mainAxisSpacing: 15.h, shrinkWrap: true, @@ -185,9 +185,10 @@ class _LockListXHJPageState extends State with RouteAware { borderRadius: BorderRadius.circular(20.w), ), child: Padding( - padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 20.h), + padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 10.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -197,13 +198,6 @@ class _LockListXHJPageState extends State with RouteAware { height: 32.r, color: AppColors.mainColor, ), - Spacer(), - Text( - logic.getUseKeyTypeStr( - keyInfo.startDate, keyInfo.endDate, keyInfo.keyType), - style: TextStyle( - fontSize: 18.sp, color: AppColors.darkGrayTextColor), - ) ], ), SizedBox( @@ -313,6 +307,13 @@ class _LockListXHJPageState extends State with RouteAware { ), ], ), + Text( + Characters(logic.getUseKeyTypeStr( + keyInfo.startDate, keyInfo.endDate, keyInfo.keyType)) + .join('\u{200B}'), + style: TextStyle( + fontSize: 18.sp, color: AppColors.darkGrayTextColor), + ) ], ), ), diff --git a/star_lock/lib/mine/mall/lockMall_page.dart b/star_lock/lib/mine/mall/lockMall_page.dart index 911f0594..0a123dbb 100644 --- a/star_lock/lib/mine/mall/lockMall_page.dart +++ b/star_lock/lib/mine/mall/lockMall_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/flavors.dart'; import 'package:star_lock/mine/mall/lockMall_logic.dart'; import 'package:star_lock/tools/titleAppBar.dart'; import 'package:webview_flutter/webview_flutter.dart'; @@ -37,7 +38,15 @@ class _LockMallPageState extends State { ? TitleAppBar( barTitle: getWebTitle(logic), haveBack: logic.state.canGoBack || logic.state.allowReturn, - backgroundColor: AppColors.mainColor, + backgroundColor: F.sw( + defaultCall: () => AppColors.mainColor, + xhjCall: () => Colors.white), + titleColor: F.sw( + defaultCall: () => null, + xhjCall: () => AppColors.blackColor), + iconColor: F.sw( + defaultCall: () => null, + xhjCall: () => AppColors.blackColor), backAction: () => logic.canGoBack(false), ) : null, diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart index 61b95e05..b61e14f1 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart @@ -39,174 +39,215 @@ class _MinePersonInfoPageState extends State { : null, body: Column( children: [ - Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.avatar!.tr, - rightTitle: "", - allHeight: 100.h, - isHaveLine: true, - isHaveDirection: true, - isHaveRightWidget: true, - rightWidget: ClipRRect( - borderRadius: BorderRadius.circular(36.w), - child: CustomNetworkImage( - url: state.headUrl.value, - defaultUrl: 'images/controls_user.png', - width: 72.w, - height: 72.w), + Container( + width: 1.sw, + height: 0.2.sw, + margin: EdgeInsets.symmetric(horizontal: 15.w), + padding: EdgeInsets.symmetric(horizontal: 25.w), + decoration: BoxDecoration( + image: const DecorationImage( + image: AssetImage('images/xhj_main_bg.jpg'), + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.circular(20.r), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.15), + offset: const Offset(0, 0), + blurRadius: 10.r, + spreadRadius: 0, ), - action: () async { - _openModalBottomSheet(); - }, - )), - Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.nickName!.tr, - rightTitle: state.mineInfoData.value.nickname != null - ? state.mineInfoData.value.nickname! - : "", - isHaveLine: true, - isHaveDirection: true, - action: () { - Navigator.pushNamed( - context, Routers.minePersonInfoEditNamePage, - arguments: {'mineInfoData': state.mineInfoData.value}) - .then((value) => logic.getUserInfoRequest()); - })), - Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr, - rightTitle: state.mineInfoData.value.mobile != null - ? state.mineInfoData.value.mobile! - : TranslationLoader.lanKeys!.goBind!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - //有手机号 则去修改手机号 否则去绑定新的手机号 isFrom:1 短信,2 邮箱 - if (state.mineInfoData.value.mobile!.isNotEmpty) { - Navigator.pushNamed( - context, Routers.mineUnbindPhoneOrEmailPage, - arguments: { - 'mobile': state.mineInfoData.value.mobile!, - 'isFrom': '1' - }).then((value) => logic.getUserInfoRequest()); - } else { - Navigator.pushNamed( - context, Routers.mineBindPhoneOrEmailPage, arguments: { - 'mobile': state.mineInfoData.value.mobile!, - 'isFrom': '1' - }).then((value) => logic.getUserInfoRequest()); - } - })), - Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.email!.tr, - rightTitle: state.mineInfoData.value.email != null - ? state.mineInfoData.value.email! - : TranslationLoader.lanKeys!.goBind!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - //有邮箱 则去修改邮箱 否则去绑定新的邮箱 isFrom:1 短信,2 邮箱 - if (state.mineInfoData.value.email!.isNotEmpty) { - Navigator.pushNamed( - context, Routers.mineUnbindPhoneOrEmailPage, - arguments: { - 'isFrom': '2', - 'email': state.mineInfoData.value.email! - }).then((value) => logic.getUserInfoRequest()); - } else { - Navigator.pushNamed( - context, Routers.mineBindPhoneOrEmailPage, arguments: { - 'isFrom': '2', - 'email': state.mineInfoData.value.email! - }).then((value) => logic.getUserInfoRequest()); - } - })), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.resetPasswords!.tr, - rightTitle: "", - isHaveLine: true, - isHaveDirection: true, - action: () { - Navigator.pushNamed( - context, Routers.minePersonInfoResetPasswordPage); - }), - Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr, - rightTitle: - state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置".tr : "", - isHaveLine: true, - isHaveDirection: true, - action: () { - if (state.mineInfoData.value.haveSafeAnswer == 0) { - Navigator.pushNamed( - context, Routers.minePersonInfoSetSafetyProblemPage) - .then((value) => logic.getUserInfoRequest()); - } else { - Navigator.pushNamed( - context, Routers.minePersonInfoViewSafetyProblemPage); - } - })), - Obx(() => CommonItem( - leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr, - rightTitle: state.mineInfoData.value.countryName != null - ? state.mineInfoData.value.countryName! - : "", - isHaveLine: true, - isHaveDirection: false)), - if (F.isLite == false && widget.showAbout) - CommonItem( - leftTitel: TranslationLoader.lanKeys!.valueAddedServices!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.back(); - Get.toNamed(Routers.valueAddedServicesPage); - }, + ], ), - if (widget.showAbout) - CommonItem( - leftTitel: TranslationLoader.lanKeys!.set!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.back(); - Get.toNamed(Routers.mineSetPage); - }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '系统设置', + style: TextStyle( + color: AppColors.blackColor, + fontSize: 28.sp, + fontWeight: FontWeight.w600, + ), + ), + Text( + '系统的全局配置在此项内进行设置', + style: TextStyle( + color: AppColors.blackColor.withOpacity(0.6), + fontSize: 20.sp, + fontWeight: FontWeight.w600, + ), + ), + ], ), - if (widget.showAbout) - CommonItem( - leftTitel: TranslationLoader.lanKeys!.about!.tr, - isHaveLine: false, - isHaveDirection: true, - action: () { - Get.back(); - Get.toNamed(Routers.aboutPage); - }, + ), + SizedBox( + height: 20.h, + ), + Container( + margin: EdgeInsets.symmetric(vertical: 10.h, horizontal: 15.w), + child: ClipRRect( + borderRadius: BorderRadius.circular(20.r), + child: Column( + children: [ + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.avatar!.tr, + rightTitle: "", + allHeight: 100.h, + isHaveLine: true, + isHaveDirection: true, + isHaveRightWidget: true, + rightWidget: ClipRRect( + borderRadius: BorderRadius.circular(36.w), + child: CustomNetworkImage( + url: state.headUrl.value, + defaultUrl: 'images/controls_user.png', + width: 72.w, + height: 72.w), + ), + action: () async { + _openModalBottomSheet(); + }, + )), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.nickName!.tr, + rightTitle: state.mineInfoData.value.nickname != null + ? state.mineInfoData.value.nickname! + : "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.minePersonInfoEditNamePage, + arguments: { + 'mineInfoData': state.mineInfoData.value + }).then((value) => logic.getUserInfoRequest()); + })), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr, + rightTitle: state.mineInfoData.value.mobile != null + ? state.mineInfoData.value.mobile! + : TranslationLoader.lanKeys!.goBind!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + //有手机号 则去修改手机号 否则去绑定新的手机号 isFrom:1 短信,2 邮箱 + if (state.mineInfoData.value.mobile!.isNotEmpty) { + Navigator.pushNamed( + context, Routers.mineUnbindPhoneOrEmailPage, + arguments: { + 'mobile': state.mineInfoData.value.mobile!, + 'isFrom': '1' + }).then((value) => logic.getUserInfoRequest()); + } else { + Navigator.pushNamed( + context, Routers.mineBindPhoneOrEmailPage, + arguments: { + 'mobile': state.mineInfoData.value.mobile!, + 'isFrom': '1' + }).then((value) => logic.getUserInfoRequest()); + } + })), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.email!.tr, + rightTitle: state.mineInfoData.value.email != null + ? state.mineInfoData.value.email! + : TranslationLoader.lanKeys!.goBind!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + //有邮箱 则去修改邮箱 否则去绑定新的邮箱 isFrom:1 短信,2 邮箱 + if (state.mineInfoData.value.email!.isNotEmpty) { + Navigator.pushNamed( + context, Routers.mineUnbindPhoneOrEmailPage, + arguments: { + 'isFrom': '2', + 'email': state.mineInfoData.value.email! + }).then((value) => logic.getUserInfoRequest()); + } else { + Navigator.pushNamed( + context, Routers.mineBindPhoneOrEmailPage, + arguments: { + 'isFrom': '2', + 'email': state.mineInfoData.value.email! + }).then((value) => logic.getUserInfoRequest()); + } + })), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.resetPasswords!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Navigator.pushNamed( + context, Routers.minePersonInfoResetPasswordPage); + }), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr, + rightTitle: state.mineInfoData.value.haveSafeAnswer == 0 + ? "去设置".tr + : "", + isHaveLine: true, + isHaveDirection: true, + action: () { + if (state.mineInfoData.value.haveSafeAnswer == 0) { + Navigator.pushNamed(context, + Routers.minePersonInfoSetSafetyProblemPage) + .then((value) => logic.getUserInfoRequest()); + } else { + Navigator.pushNamed(context, + Routers.minePersonInfoViewSafetyProblemPage); + } + })), + Obx(() => CommonItem( + leftTitel: + TranslationLoader.lanKeys!.countryAndRegion!.tr, + rightTitle: state.mineInfoData.value.countryName != null + ? state.mineInfoData.value.countryName! + : "", + isHaveLine: true, + isHaveDirection: false)), + if (F.isLite == false && widget.showAbout) + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.valueAddedServices!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.back(); + Get.toNamed(Routers.valueAddedServicesPage); + }, + ), + if (widget.showAbout) + CommonItem( + leftTitel: TranslationLoader.lanKeys!.set!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.back(); + Get.toNamed(Routers.mineSetPage); + }, + ), + if (widget.showAbout) + CommonItem( + leftTitel: TranslationLoader.lanKeys!.about!.tr, + isHaveLine: false, + isHaveDirection: true, + action: () { + Get.back(); + Get.toNamed(Routers.aboutPage); + }, + ), + ], + ), ), + ), ], )); } - // 显示权限被永久拒绝的提示对话框 - // void showPermissionDeniedDialog() { - // showDialog( - // context: context, - // builder: (BuildContext context) { - // return AlertDialog( - // title: const Text('权限被拒绝'), - // content: const Text('请手动在系统设置中开启相册权限以继续使用应用。'), - // actions: [ - // TextButton( - // child: const Text('去设置'), - // onPressed: () { - // Navigator.of(context).pop(); // 关闭对话框 - // openAppSettings(); // 打开系统设置页面 - // }, - // ), - // ], - // ); - // }, - // ); - // } - Future _openModalBottomSheet() async { showModalBottomSheet( context: context, diff --git a/star_lock/lib/tools/commonItem.dart b/star_lock/lib/tools/commonItem.dart index 9b785898..3cf2bf79 100644 --- a/star_lock/lib/tools/commonItem.dart +++ b/star_lock/lib/tools/commonItem.dart @@ -83,7 +83,7 @@ class CommonItem extends StatelessWidget { ), ], ), - isHaveDirection! ? SizedBox(width: 3.w) : Container(), + isHaveDirection! ? SizedBox(width: 15.w) : Container(), isHaveDirection! ? Image.asset( 'images/icon_right_grey.png', diff --git a/star_lock/lib/tools/titleAppBar.dart b/star_lock/lib/tools/titleAppBar.dart index 5d59fec9..57c8265f 100644 --- a/star_lock/lib/tools/titleAppBar.dart +++ b/star_lock/lib/tools/titleAppBar.dart @@ -40,8 +40,6 @@ class TitleAppBar extends AppBar { class _TitleAppBarState extends State { @override Widget build(BuildContext context) { - Color defaultColor = F.sw( - defaultCall: () => Colors.white, xhjCall: () => AppColors.blackColor); return AppBar( elevation: 0, leading: widget.haveOtherLeftWidget! @@ -49,7 +47,7 @@ class _TitleAppBarState extends State { : (widget.haveBack ?? false ? IconButton( icon: Icon(Icons.arrow_back_ios, - color: widget.iconColor ?? defaultColor), + color: widget.iconColor ?? Colors.white), onPressed: () { if (widget.backAction != null) { widget.backAction!(); @@ -61,14 +59,12 @@ class _TitleAppBarState extends State { } }) : Container()), - backgroundColor: F.sw( - defaultCall: () => widget.backgroundColor ?? defaultColor, - xhjCall: () => Colors.white), + backgroundColor: widget.backgroundColor ?? Colors.white, title: widget.haveTitleWidget! ? widget.titleWidget : Text(widget.barTitle ?? '', style: TextStyle( - color: widget.titleColor ?? defaultColor, + color: widget.titleColor ?? Colors.white, fontSize: 28.sp, fontWeight: FontWeight.w600)), centerTitle: true,