From 25002323deed0544c04410100890a1e4dbfb9cab Mon Sep 17 00:00:00 2001 From: ante <448468458@qq.com> Date: Mon, 15 Apr 2024 14:09:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=98=9F=E6=98=9F?= =?UTF-8?q?=E9=94=81=20ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/flavorizr.yaml | 2 +- star_lock/ios/Podfile.lock | 23 ++- star_lock/lib/appRouters.dart | 12 +- star_lock/lib/app_settings/app_colors.dart | 16 +- star_lock/lib/flavors.dart | 27 ++- .../main/lockMian/lockMain/lockMain_page.dart | 115 ++++-------- .../lockMain/xhj/lockMain_xhj_logic.dart | 29 ++++ .../lockMain/xhj/lockMain_xhj_page.dart | 164 ++++++++++++++++++ .../lockMain/xhj/lockMain_xhj_state.dart | 9 + star_lock/lib/mine/mall/lockMall_page.dart | 18 +- .../message/messageList/messageList_page.dart | 125 +++++++------ .../minePersonInfo_page.dart | 106 ++++++----- star_lock/lib/nav/navPages.dart | 3 +- .../starLockApplication.dart | 5 +- 14 files changed, 452 insertions(+), 202 deletions(-) create mode 100644 star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart create mode 100644 star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart create mode 100644 star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_state.dart diff --git a/star_lock/flavorizr.yaml b/star_lock/flavorizr.yaml index e411ad41..fc7e6810 100644 --- a/star_lock/flavorizr.yaml +++ b/star_lock/flavorizr.yaml @@ -95,7 +95,7 @@ flavors: bundleId: "com.skychip.lock" xhj: app: - name: "鑫锁" + name: "星星锁" icon: "assets/icon/xhj.png" android: applicationId: "com.xhjcn.lock" diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock index 2f22946c..780716ea 100644 --- a/star_lock/ios/Podfile.lock +++ b/star_lock/ios/Podfile.lock @@ -57,8 +57,12 @@ PODS: - fluttertoast (0.0.2): - Flutter - Toast - - g711_flutter (0.0.1): + - fluwx (0.0.1): - Flutter + - fluwx/pay (= 0.0.1) + - fluwx/pay (0.0.1): + - Flutter + - WechatOpenSDK-XCFramework (~> 2.0.4) - google_maps_flutter_ios (0.0.1): - Flutter - GoogleMaps (< 9.0) @@ -88,7 +92,7 @@ PODS: - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - permission_handler_apple (9.1.1): + - permission_handler_apple (9.3.0): - Flutter - ReachabilitySwift (5.0.0) - shared_preferences_foundation (0.0.1): @@ -107,6 +111,7 @@ PODS: - FlutterMacOS - webview_flutter_wkwebview (0.0.1): - Flutter + - WechatOpenSDK-XCFramework (2.0.4) DEPENDENCIES: - aj_captcha_flutter (from `.symlinks/plugins/aj_captcha_flutter/ios`) @@ -128,7 +133,7 @@ DEPENDENCIES: - flutter_pcm_sound (from `.symlinks/plugins/flutter_pcm_sound/ios`) - flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - - g711_flutter (from `.symlinks/plugins/g711_flutter/ios`) + - fluwx (from `.symlinks/plugins/fluwx/ios`) - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) - image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) @@ -164,6 +169,7 @@ SPEC REPOS: - JPush - ReachabilitySwift - Toast + - WechatOpenSDK-XCFramework EXTERNAL SOURCES: aj_captcha_flutter: @@ -202,8 +208,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_voice_processor/ios" fluttertoast: :path: ".symlinks/plugins/fluttertoast/ios" - g711_flutter: - :path: ".symlinks/plugins/g711_flutter/ios" + fluwx: + :path: ".symlinks/plugins/fluwx/ios" google_maps_flutter_ios: :path: ".symlinks/plugins/google_maps_flutter_ios/ios" image_gallery_saver: @@ -249,7 +255,7 @@ SPEC CHECKSUMS: AMapLocation: 5248aec2455ebb5d104b367813c946430a2ee033 app_settings: 017320c6a680cdc94c799949d95b84cb69389ebc audio_service: f509d65da41b9521a61f1c404dd58651f265a567 - audio_session: 4f3e461722055d21515cf3261b64c973c062f345 + audio_session: 088d2483ebd1dc43f51d253d4a1c517d9a2e7207 audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40 auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68 @@ -263,7 +269,7 @@ SPEC CHECKSUMS: flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82 fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 - g711_flutter: 8f2769052d2cf3549f83d11e1c42d81d94441123 + fluwx: daa284756ce53442b3d0417ceeda66e981906811 google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458 GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4 image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb @@ -276,7 +282,7 @@ SPEC CHECKSUMS: network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c - permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 + permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec @@ -285,6 +291,7 @@ SPEC CHECKSUMS: url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579 webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 + WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index c877b545..1d86c55a 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -1,5 +1,6 @@ import 'package:get/get.dart'; import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart'; +import 'package:star_lock/flavors.dart'; import 'package:star_lock/login/register/starLock_register_binding.dart'; import 'package:star_lock/main/accessoriesList/accessoriesList_page.dart'; import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart'; @@ -29,6 +30,7 @@ import 'package:star_lock/main/lockDetail/palm/addPalm/addPalm_page.dart'; import 'package:star_lock/main/lockDetail/palm/addPalmType/addPalmTypeManage/addPalmTypeManage_page.dart'; import 'package:star_lock/main/lockDetail/palm/palmList/palmList_page.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_page.dart'; +import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart'; import 'package:star_lock/mine/about/webviewShow_page.dart'; import 'package:star_lock/mine/mine/safeVerify/safeVerify_page.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/mineBindPhoneOrEmail_page.dart'; @@ -453,7 +455,9 @@ abstract class AppRouters { ), GetPage( name: Routers.starLockMain, - page: () => const StarLockMainPage(), + page: () => F.sw( + defaultCall: () => StarLockMainPage(), + xhjCall: () => const StarLockMainXHJPage()), ), GetPage( name: Routers.starLockMinePage, @@ -465,7 +469,7 @@ abstract class AppRouters { ), GetPage( name: Routers.lockMallPage, - page: () => const LockMallPage(), + page: () => LockMallPage(), ), GetPage( name: Routers.addLockPage, @@ -729,7 +733,7 @@ abstract class AppRouters { ), GetPage( name: Routers.minePersonInfoPage, - page: () => const MinePersonInfoPage(), + page: () => MinePersonInfoPage(), ), GetPage( name: Routers.minePersonInfoEditNamePage, @@ -761,7 +765,7 @@ abstract class AppRouters { ), GetPage( name: Routers.messageListPage, - page: () => const MessageListPage(), + page: () => MessageListPage(), ), GetPage( name: Routers.supportStaffPage, diff --git a/star_lock/lib/app_settings/app_colors.dart b/star_lock/lib/app_settings/app_colors.dart index caec2e39..63c142b3 100644 --- a/star_lock/lib/app_settings/app_colors.dart +++ b/star_lock/lib/app_settings/app_colors.dart @@ -1,10 +1,15 @@ import 'dart:ui'; import 'package:flutter/material.dart'; +import 'package:fluwx/fluwx.dart'; +import 'package:star_lock/flavors.dart'; class AppColors { // static Color mainColor = const Color(0xFF385DEA); - static Color mainColor = const Color(0xFF4777EE); + static Color get mainColor => F.sw( + defaultCall: () => const Color(0xFF4777EE), + xhjCall: () => const Color(0xFF68c1b9)); + static Color mainBackgroundColor = const Color(0xFFF5F5F5); static Color primaryTopColor = const Color(0xFF021B38); @@ -25,6 +30,7 @@ class AppColors { //check box color static Color checkBoxSelectedColor = touristColor; + static Color get checkBoxUnselectedColor => const Color(0xFFFFFFFF); static Color checkBoxOverlayColor = checkBoxUnselectedColor.withOpacity(0.3); @@ -69,6 +75,7 @@ class AppColors { static Color wifiDisableColor = const Color(0xFFA8A8A8); static Color get paginationColor => const Color(0xFF01295C).withOpacity(45); + static Color get paginationActiveColor => const Color(0xFFFFFFFF).withOpacity(65); @@ -128,8 +135,9 @@ class AppColors { static const msgNoticeTextColor = Color.fromRGBO(139, 148, 176, 1); //消息提醒字体颜色 static const alphaBgViewColor = Color.fromRGBO(0, 0, 0, 0.2); //透明度背景 - static Color openPassageModeColor = const Color(0xFFEB2A3B);// 首页开启常开模式颜色(红色) - static Color listTimeYellowColor = const Color(0xFFF3BA37);// 首页时间过期颜色(黄色) + static Color openPassageModeColor = const Color(0xFFEB2A3B); // 首页开启常开模式颜色(红色) + static Color listTimeYellowColor = const Color(0xFFF3BA37); // 首页时间过期颜色(黄色) - static Color get lockDetailBottomBtnUneable => const Color(0xFF808080);// 首页时间灰色颜色(灰色) + static Color get lockDetailBottomBtnUneable => + const Color(0xFF808080); // 首页时间灰色颜色(灰色) } diff --git a/star_lock/lib/flavors.dart b/star_lock/lib/flavors.dart index 84e28c0b..ac37d365 100644 --- a/star_lock/lib/flavors.dart +++ b/star_lock/lib/flavors.dart @@ -18,6 +18,8 @@ class StarLockAMapKey { const StarLockAMapKey({required this.iosKey, required this.androidKey}); } +typedef dynamic fCallFunction(); + class F { static Flavor? appFlavor; @@ -26,6 +28,24 @@ class F { static String get name => appFlavor?.name ?? ''; + //便捷判断并返回值 + static dynamic sw( + {required fCallFunction defaultCall, fCallFunction? xhjCall}) { + if (xhjCall == null) { + return defaultCall(); + } + switch (appFlavor) { + case Flavor.xhj: + return xhjCall(); + case Flavor.local: + case Flavor.dev: + case Flavor.pre: + case Flavor.sky: + default: + return defaultCall(); + } + } + static bool get debug { switch (appFlavor) { case Flavor.local: @@ -54,7 +74,7 @@ class F { case Flavor.sky: return '锁通通'; case Flavor.xhj: - return '鑫锁'; + return '星星锁'; default: throw Exception('flavor[$name] title not found'); } @@ -71,7 +91,7 @@ class F { case Flavor.sky: return '锁通通'; case Flavor.xhj: - return '鑫锁'; + return '星星锁'; default: throw Exception('flavor[$name] title not found'); } @@ -89,7 +109,8 @@ class F { case Flavor.sky: return 'https://lock.skychip.top'; case Flavor.xhj: - return 'https://lock.xhjcn.ltd'; + // 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/lockMain/lockMain_page.dart b/star_lock/lib/main/lockMian/lockMain/lockMain_page.dart index cf12e539..805efc39 100644 --- a/star_lock/lib/main/lockMian/lockMain/lockMain_page.dart +++ b/star_lock/lib/main/lockMian/lockMain/lockMain_page.dart @@ -22,20 +22,20 @@ import '../lockList/lockList_page.dart'; import 'lockMain_logic.dart'; class StarLockMainPage extends StatefulWidget { - const StarLockMainPage({Key? key}) : super(key: key); + StarLockMainPage({Key? key, this.showAppBar = true, this.showDrawer = true}) + : super(key: key); + bool showAppBar; + bool showDrawer; @override State createState() => _StarLockMainPageState(); } -// GlobalKey<_StarLockMainPageState> starLockMainKey = GlobalKey(); class _StarLockMainPageState extends State with BaseWidget { final logic = Get.put(LockMainLogic()); final state = Get.find().state; Future getHttpData() async { - // await logic.getStarLockInfo(); - // setState(() {}); logic.getStarLockInfo().then((LockListInfoEntity value) { if (mounted) { setState(() {}); @@ -46,7 +46,7 @@ class _StarLockMainPageState extends State with BaseWidget { @override void initState() { super.initState(); - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { logic.pageNo = 1; getHttpData(); }); @@ -57,60 +57,38 @@ class _StarLockMainPageState extends State with BaseWidget { @override void didChangeDependencies() { super.didChangeDependencies(); - // WidgetsBinding.instance!.addPostFrameCallback((_) { - // getHttpData(); - // }); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: const Color(0xFFF5F5F5), - appBar: TitleAppBar( - barTitle: F.navTitle, - haveBack: false, - haveOtherLeftWidget: true, - leftWidget: Builder( - builder: (context) => IconButton( - icon: Image.asset( - "images/main/mainLeft_menu_icon.png", - color: Colors.white, - width: 44.w, - height: 44.w, - ), - onPressed: () { - // _globalKey.currentState!.openDrawer(); - Scaffold.of(context).openDrawer(); - }, - )), - backgroundColor: AppColors.mainColor, - // actionsList: [ - // TextButton( - // child: const Text("", style: TextStyle(color: Colors.white)), - // onPressed: () { - // Navigator.pushNamed(context, Routers.starLockLoginPage); - // }, - // ), - // ], - ), - drawer: Drawer( - width: 1.sw / 3 * 2, - child: const StarLockMinePage(), - ), - // body: FutureBuilder( - // future: logic.getStarLockInfo(), // 异步操作 - // builder: (BuildContext context, AsyncSnapshot snapshot) { - // if (snapshot.connectionState == ConnectionState.waiting) { - // // return CircularProgressIndicator(); // 显示加载指示器 - // return Container(); - // } else if (snapshot.hasError) { - // // return Text('Error: ${snapshot.error}'); // 显示错误 - // return unHaveData(); - // } else { - // return getDataReturnUI(snapshot.data!.groupList!.length ?? 0); // 显示获取的数据 - // } - // }, - // ), + appBar: widget.showAppBar + ? TitleAppBar( + barTitle: F.navTitle, + haveBack: false, + haveOtherLeftWidget: true, + leftWidget: Builder( + builder: (context) => IconButton( + icon: Image.asset( + "images/main/mainLeft_menu_icon.png", + color: Colors.white, + width: 44.w, + height: 44.w, + ), + onPressed: () { + Scaffold.of(context).openDrawer(); + }, + )), + backgroundColor: AppColors.mainColor, + ) + : null, + drawer: widget.showDrawer + ? Drawer( + width: 1.sw / 3 * 2, + child: const StarLockMinePage(), + ) + : null, body: EasyRefreshTool( onRefresh: () { SchedulerBinding.instance.addPostFrameCallback((_) { @@ -120,13 +98,6 @@ class _StarLockMainPageState extends State with BaseWidget { }); }, child: getDataReturnUI(state.dataLength.value)), - // body:smartRefresher( - // logic.refreshController, - // onRefresh:logic.onRefresh, - // onLoading:logic.onLoading, - // child:Obx(() => getDataReturnUI(state.dataLength.value))), - // body: getLockList(), - // body: unHaveData(), ); } @@ -140,11 +111,12 @@ class _StarLockMainPageState extends State with BaseWidget { case 1: // 只有一条数据 Storage.setBool(ifIsDemoModeOrNot, false); - print("state.lockListInfoEntity.value.data!.groupList![0].lockList![0]:${state.lockListInfoGroupEntity.value.groupList![0].lockList![0].endDate}"); + print( + "state.lockListInfoEntity.value.data!.groupList![0].lockList![0]:${state.lockListInfoGroupEntity.value.groupList![0].lockList![0].endDate}"); returnWidget = LockDetailPage( isOnlyOneData: true, - lockListInfoItemEntity: state - .lockListInfoGroupEntity.value.groupList![0].lockList![0]); + lockListInfoItemEntity: + state.lockListInfoGroupEntity.value.groupList![0].lockList![0]); break; case 2: // 有多条数据 @@ -156,8 +128,6 @@ class _StarLockMainPageState extends State with BaseWidget { returnWidget = NoData(); break; } - // Future.delayed(const Duration(seconds: 1)); - // Future.delayed(const Duration(milliseconds: 200)); return returnWidget; } @@ -175,12 +145,6 @@ class _StarLockMainPageState extends State with BaseWidget { children: [ SizedBox( width: 330.w, - // height: 330.w, - // margin: EdgeInsets.only(top: 180.h), - // decoration: BoxDecoration( - // border: Border.all(width: 4.w, color: AppColors.mainColor), - // borderRadius: BorderRadius.circular(110.w), - // ), child: InkWell( child: Padding( padding: const EdgeInsets.all(30.0), @@ -193,11 +157,8 @@ class _StarLockMainPageState extends State with BaseWidget { onTap: () { //实现回调函数 Navigator.pushNamed( - context, Routers.selectLockTypePage, - // arguments: { - // "url": ConstConfig.privacAgreementUrl, - // "title": '隐私政策' - // } + context, + Routers.selectLockTypePage, ); }, )), @@ -235,10 +196,10 @@ class _StarLockMainPageState extends State with BaseWidget { void onHide() {} late StreamSubscription _teamEvent; + void _initLoadDataAction() { print("监听刷新首页数据消息"); _teamEvent = eventBus.on().listen((event) { - // getLockInfo(); logic.pageNo = 1; getHttpData(); print("收到刷新首页数据消息"); diff --git a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart new file mode 100644 index 00000000..31602b82 --- /dev/null +++ b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart @@ -0,0 +1,29 @@ +import 'dart:async'; +import 'package:connectivity_plus/connectivity_plus.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_state.dart'; +import 'package:star_lock/tools/baseGetXController.dart'; + +class LockMainXHJLogic extends BaseGetXController { + final LockMainXHJState state = LockMainXHJState(); + + void setIndex(int index) { + state.index = index; + update(); + } + + @override + void onReady() { + super.onReady(); + } + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart new file mode 100644 index 00000000..5ed23c91 --- /dev/null +++ b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart @@ -0,0 +1,164 @@ +import 'dart:async'; +import 'dart:ui'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.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/baseWidget.dart'; +import 'package:star_lock/main/lockMian/lockMain/lockMain_page.dart'; +import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart'; +import 'package:star_lock/mine/mall/lockMall_page.dart'; +import 'package:star_lock/mine/message/messageList/messageList_page.dart'; +import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart'; +import 'package:star_lock/tools/noData.dart'; +import 'package:star_lock/tools/submitBtn.dart'; + +class StarLockMainXHJPage extends StatefulWidget { + const StarLockMainXHJPage({Key? key}) : super(key: key); + + @override + State createState() => _StarLockMainXHJPageState(); +} + +class _StarLockMainXHJPageState extends State + with BaseWidget { + @override + void initState() { + super.initState(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: LockMainXHJLogic(), + builder: (LockMainXHJLogic logic) { + return Scaffold( + backgroundColor: const Color(0xFFF5F5F5), + body: SafeArea( + bottom: false, + child: Stack( + children: [ + pageView( + widget: StarLockMainPage( + showAppBar: false, + showDrawer: false, + ), + logic: logic, + index: 0, + ), + pageView( + widget: MessageListPage( + showAppBar: false, + ), + logic: logic, + index: 1), + pageView( + widget: LockMallPage( + showAppBar: false, + ), + logic: logic, + index: 2), + pageView( + widget: MinePersonInfoPage( + showAppBar: false, + ), + logic: logic, + index: 3), + ], + ), + ), + bottomNavigationBar: Container( + height: 100.h + Get.bottomBarHeight, + decoration: const BoxDecoration( + color: Colors.transparent, + border: Border( + top: BorderSide( + color: Colors.black, // 设置边框颜色 + width: 0.3, // 设置边框宽度 + ), + ), + ), + child: Row( + children: [ + // navigationBarItem(Icons.start, '场景', false, () { + // logic.setIndex(0); + // }), + navigationBarItem(Icons.devices, '设备', logic, 0, () { + logic.setIndex(0); + }), + navigationBarItem(Icons.message, '消息', logic, 1, () { + logic.setIndex(1); + }), + navigationBarItem(Icons.shopping_cart, '商城', logic, 2, () { + logic.setIndex(2); + }), + navigationBarItem(Icons.account_circle, '我的', logic, 3, () { + logic.setIndex(3); + }), + ], + ), + ), + ); + }); + } + + //布局 + Widget pageView( + {required Widget widget, + required LockMainXHJLogic logic, + required int index}) { + return Positioned.fill( + child: Offstage( + offstage: logic.state.index != index, + child: widget, + ), + ); + } + + //底部按钮 + Widget navigationBarItem(IconData icon, String text, LockMainXHJLogic logic, + int index, var onTop) { + bool check = logic.state.index == index; + return Expanded( + child: GestureDetector( + onTap: onTop, + child: Container( + color: Colors.transparent, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 8.h), + child: Icon( + icon, + size: 32.r, + color: + check ? AppColors.mainColor : AppColors.darkGrayTextColor, + ), + ), + Text( + text, + style: TextStyle( + fontSize: 16.sp, + color: + check ? AppColors.mainColor : AppColors.darkGrayTextColor, + ), + ), + ], + ), + ), + ), + ); + } + + @override + void dispose() { + super.dispose(); + } +} diff --git a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_state.dart b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_state.dart new file mode 100644 index 00000000..01f310fb --- /dev/null +++ b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_state.dart @@ -0,0 +1,9 @@ + +import 'dart:async'; + +import 'package:get/get.dart'; + +class LockMainXHJState { + int index = 0; + +} \ No newline at end of file diff --git a/star_lock/lib/mine/mall/lockMall_page.dart b/star_lock/lib/mine/mall/lockMall_page.dart index 8c713af0..f93202f6 100644 --- a/star_lock/lib/mine/mall/lockMall_page.dart +++ b/star_lock/lib/mine/mall/lockMall_page.dart @@ -7,7 +7,8 @@ import 'package:star_lock/tools/titleAppBar.dart'; import 'package:webview_flutter/webview_flutter.dart'; class LockMallPage extends StatefulWidget { - const LockMallPage({Key? key}) : super(key: key); + LockMallPage({Key? key, this.showAppBar = true}) : super(key: key); + bool showAppBar; @override State createState() => _LockMallPageState(); @@ -33,11 +34,13 @@ class _LockMallPageState extends State { child: Scaffold( resizeToAvoidBottomInset: false, backgroundColor: const Color(0xFFFFFFFF), - appBar: TitleAppBar( - barTitle: getWebTitle(), - haveBack: true, - backgroundColor: AppColors.mainColor, - ), + appBar: widget.showAppBar + ? TitleAppBar( + barTitle: getWebTitle(), + haveBack: true, + backgroundColor: AppColors.mainColor, + ) + : null, body: Obx(() => Column( children: [ Container( @@ -45,7 +48,8 @@ class _LockMallPageState extends State { child: LinearProgressIndicator( value: state.webProgress.value, backgroundColor: Colors.grey, - valueColor: AlwaysStoppedAnimation(AppColors.mainColor), + valueColor: + AlwaysStoppedAnimation(AppColors.mainColor), ), ), Expanded( diff --git a/star_lock/lib/mine/message/messageList/messageList_page.dart b/star_lock/lib/mine/message/messageList/messageList_page.dart index cd34b08e..1ff5ef1b 100644 --- a/star_lock/lib/mine/message/messageList/messageList_page.dart +++ b/star_lock/lib/mine/message/messageList/messageList_page.dart @@ -14,18 +14,20 @@ import 'messageList_logic.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; class MessageListPage extends StatefulWidget { - const MessageListPage({Key? key}) : super(key: key); + MessageListPage({Key? key, this.showAppBar = true}) : super(key: key); + bool showAppBar; @override State createState() => _MessageListPageState(); } -class _MessageListPageState extends State with TickerProviderStateMixin { +class _MessageListPageState extends State + with TickerProviderStateMixin { final logic = Get.put(MessageListLogic()); final state = Get.find().state; - void getHttpData(){ - logic.messageListDataRequest().then((MessageListEntity value){ + void getHttpData() { + logic.messageListDataRequest().then((MessageListEntity value) { setState(() {}); }); } @@ -41,58 +43,61 @@ class _MessageListPageState extends State with TickerProviderSt Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.message!.tr, - haveBack: true, - backgroundColor: AppColors.mainColor), - body: EasyRefreshTool( - onRefresh: (){ - logic.pageNo = 1; - getHttpData(); - }, - onLoad: (){ - getHttpData(); - }, - child: Obx(() { - return state.itemDataList.value.isEmpty - ? NoData() - : SlidableAutoCloseBehavior( - child: ListView.builder( - itemCount: state.itemDataList.value.length, - itemBuilder: (c, index) { - MessageItemEntity messageItemEntity = state.itemDataList.value[index]; - return Slidable( - key:ValueKey(messageItemEntity.id), - endActionPane: ActionPane( - extentRatio: 0.2, - motion: const ScrollMotion(), - children: [ - SlidableAction( - onPressed: (BuildContext context){ - logic.deletMessageDataRequest(messageItemEntity.id!, (){ - logic.pageNo = 1; - getHttpData(); - }); - }, - backgroundColor: Colors.red, - foregroundColor: Colors.white, - label: '删除', - padding: EdgeInsets.only(left: 5.w, right: 5.w), - ), - ], - ), - child: _messageListItem(messageItemEntity, () { - Get.toNamed(Routers.messageDetailPage, arguments: {"messageItemEntity": messageItemEntity}); - }), - ); - }), - ); - }) - ), + appBar: widget.showAppBar + ? TitleAppBar( + barTitle: TranslationLoader.lanKeys!.message!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor) + : null, + body: EasyRefreshTool(onRefresh: () { + logic.pageNo = 1; + getHttpData(); + }, onLoad: () { + getHttpData(); + }, child: Obx(() { + return state.itemDataList.value.isEmpty + ? NoData() + : SlidableAutoCloseBehavior( + child: ListView.builder( + itemCount: state.itemDataList.value.length, + itemBuilder: (c, index) { + MessageItemEntity messageItemEntity = + state.itemDataList.value[index]; + return Slidable( + key: ValueKey(messageItemEntity.id), + endActionPane: ActionPane( + extentRatio: 0.2, + motion: const ScrollMotion(), + children: [ + SlidableAction( + onPressed: (BuildContext context) { + logic.deletMessageDataRequest( + messageItemEntity.id!, () { + logic.pageNo = 1; + getHttpData(); + }); + }, + backgroundColor: Colors.red, + foregroundColor: Colors.white, + label: '删除', + padding: EdgeInsets.only(left: 5.w, right: 5.w), + ), + ], + ), + child: _messageListItem(messageItemEntity, () { + Get.toNamed(Routers.messageDetailPage, arguments: { + "messageItemEntity": messageItemEntity + }); + }), + ); + }), + ); + })), ); } - Widget _messageListItem(MessageItemEntity messageItemEntity, Function() action) { + Widget _messageListItem( + MessageItemEntity messageItemEntity, Function() action) { return GestureDetector( onTap: action, child: Container( @@ -117,7 +122,10 @@ class _MessageListPageState extends State with TickerProviderSt maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 22.sp, color: messageItemEntity.readAt! == 0 ? AppColors.blackColor : AppColors.placeholderTextColor), + fontSize: 22.sp, + color: messageItemEntity.readAt! == 0 + ? AppColors.blackColor + : AppColors.placeholderTextColor), ), ), ], @@ -128,7 +136,14 @@ class _MessageListPageState extends State with TickerProviderSt children: [ // Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 40.w, height: 40.w,), // SizedBox(width: 10.w,), - Text(DateTool().dateToYMDHNString(messageItemEntity.createdAt!.toString()), style: TextStyle(fontSize: 18.sp, color: messageItemEntity.readAt! == 0 ? AppColors.blackColor : AppColors.placeholderTextColor)), + Text( + DateTool().dateToYMDHNString( + messageItemEntity.createdAt!.toString()), + style: TextStyle( + fontSize: 18.sp, + color: messageItemEntity.readAt! == 0 + ? AppColors.blackColor + : AppColors.placeholderTextColor)), ], ), SizedBox(width: 20.h), diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart index 6be361c2..7f368dea 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -14,7 +13,8 @@ import '../../../tools/titleAppBar.dart'; import '../../../translations/trans_lib.dart'; class MinePersonInfoPage extends StatefulWidget { - const MinePersonInfoPage({Key? key}) : super(key: key); + MinePersonInfoPage({Key? key, this.showAppBar = true}) : super(key: key); + bool showAppBar; @override State createState() => _MinePersonInfoPageState(); @@ -28,34 +28,43 @@ class _MinePersonInfoPageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.personalInformation!.tr, - haveBack: true, - backgroundColor: AppColors.mainColor), + appBar: widget.showAppBar + ? TitleAppBar( + barTitle: TranslationLoader.lanKeys!.personalInformation!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor) + : 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), - ), - action: () async { - _openModalBottomSheet(); - }, - )), + 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! : "", + rightTitle: state.mineInfoData.value.nickname != null + ? state.mineInfoData.value.nickname! + : "", isHaveLine: true, isHaveDirection: true, action: () { - Navigator.pushNamed(context, Routers.minePersonInfoEditNamePage, + Navigator.pushNamed( + context, Routers.minePersonInfoEditNamePage, arguments: {'mineInfoData': state.mineInfoData.value}) .then((value) => logic.getUserInfoRequest()); })), @@ -69,13 +78,18 @@ class _MinePersonInfoPageState extends State { 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()); + 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()); + Navigator.pushNamed( + context, Routers.mineBindPhoneOrEmailPage, arguments: { + 'mobile': state.mineInfoData.value.mobile!, + 'isFrom': '1' + }).then((value) => logic.getUserInfoRequest()); } })), Obx(() => CommonItem( @@ -88,13 +102,18 @@ class _MinePersonInfoPageState extends State { 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()); + 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()); + Navigator.pushNamed( + context, Routers.mineBindPhoneOrEmailPage, arguments: { + 'isFrom': '2', + 'email': state.mineInfoData.value.email! + }).then((value) => logic.getUserInfoRequest()); } })), CommonItem( @@ -103,24 +122,30 @@ class _MinePersonInfoPageState extends State { isHaveLine: true, isHaveDirection: true, action: () { - Navigator.pushNamed(context, Routers.minePersonInfoResetPasswordPage); + Navigator.pushNamed( + context, Routers.minePersonInfoResetPasswordPage); }), Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr, - rightTitle: state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置" : "", + rightTitle: + state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置" : "", isHaveLine: true, isHaveDirection: true, action: () { if (state.mineInfoData.value.haveSafeAnswer == 0) { - Navigator.pushNamed(context, Routers.minePersonInfoSetSafetyProblemPage) + Navigator.pushNamed( + context, Routers.minePersonInfoSetSafetyProblemPage) .then((value) => logic.getUserInfoRequest()); } else { - Navigator.pushNamed(context, Routers.minePersonInfoViewSafetyProblemPage); + Navigator.pushNamed( + context, Routers.minePersonInfoViewSafetyProblemPage); } })), Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr, - rightTitle: state.mineInfoData.value.countryName != null ? state.mineInfoData.value.countryName! : "", + rightTitle: state.mineInfoData.value.countryName != null + ? state.mineInfoData.value.countryName! + : "", isHaveLine: false, isHaveDirection: false)), ], @@ -152,7 +177,8 @@ class _MinePersonInfoPageState extends State { Future _openModalBottomSheet() async { showModalBottomSheet( context: context, - shape: RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.circular(10)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadiusDirectional.circular(10)), builder: (BuildContext context) { return AlertBottomWidget( topTitle: '', diff --git a/star_lock/lib/nav/navPages.dart b/star_lock/lib/nav/navPages.dart index 2391fc87..b4f1ddbd 100644 --- a/star_lock/lib/nav/navPages.dart +++ b/star_lock/lib/nav/navPages.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:star_lock/mine/mine/starLockMine_page.dart'; @@ -16,7 +15,7 @@ class NavPages extends StatefulWidget { class _NavPagesState extends State { int _currentIndex = 0; final List _listPage = [ - const StarLockMainPage(), + StarLockMainPage(), // StarLockMinePage(key: starLockMineKey), ]; diff --git a/star_lock/lib/starLockApplication/starLockApplication.dart b/star_lock/lib/starLockApplication/starLockApplication.dart index e0789be5..1d32a39f 100644 --- a/star_lock/lib/starLockApplication/starLockApplication.dart +++ b/star_lock/lib/starLockApplication/starLockApplication.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:star_lock/flavors.dart'; import 'package:star_lock/login/login/starLock_login_page.dart'; +import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart'; import 'package:star_lock/tools/appFirstEnterHandle.dart'; import 'package:star_lock/debug/debug_tool.dart'; import 'package:star_lock/tools/storage.dart'; @@ -42,7 +43,9 @@ class _StarLockApplicationState extends State { } else if (snapshot.hasData) { if (snapshot.data!) { // 如果用户已登录,返回主页面 - return const StarLockMainPage(); + return F.sw( + defaultCall: () => StarLockMainPage(), + xhjCall: () => const StarLockMainXHJPage()); } else { // 如果用户未登录,返回登录页面 return const StarLockLoginPage(); From 73aa9b736fcb45939c2b76f194c405e010a44151 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Mon, 15 Apr 2024 14:53:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=94=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E6=A0=B9=E6=8D=AE=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=BF=94=E5=9B=9E=E6=9D=83=E9=99=90=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=9C=89=E8=99=B9=E8=86=9C=E3=80=81=E6=89=8B=E6=8E=8C=202?= =?UTF-8?q?=EF=BC=8C=E8=99=B9=E8=86=9C=E3=80=81=E6=89=8B=E6=8E=8C=E7=9A=84?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E6=B7=BB=E5=8A=A0=203=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=81=9C=E6=AD=A2=E8=AF=AD=E9=9F=B3=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E7=9A=84=E6=96=B9=E6=B3=95=204=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=95=B0=E6=8D=AEjson=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/assets/DoorLockLogEntity.json | 77 ----------------- star_lock/images/lan/lan_en.json | 5 +- star_lock/images/lan/lan_keys.json | 5 +- star_lock/images/lan/lan_zh.json | 5 +- .../lockDetail/iris/addIris/addIris_page.dart | 2 +- .../addIrisTypeManage_page.dart | 2 +- .../iris/irisList/irisList_page.dart | 4 +- .../lockDetail/lockDetail_page.dart | 36 ++++---- .../monitoring/lockMonitoring_logic.dart | 12 ++- .../monitoring/lockMonitoring_page.dart | 2 +- .../realTimePicture_logic.dart | 2 +- .../realTimePicture/realTimePicture_page.dart | 6 +- .../lockMian/entity/lockListInfo_entity.dart | 85 ++++++++++--------- star_lock/lib/talk/call/callTalk.dart | 10 ++- star_lock/lib/talk/udp/udp_reciverData.dart | 2 +- star_lock/lib/talk/udp/udp_talkClass.dart | 2 +- 16 files changed, 107 insertions(+), 150 deletions(-) delete mode 100644 star_lock/assets/DoorLockLogEntity.json diff --git a/star_lock/assets/DoorLockLogEntity.json b/star_lock/assets/DoorLockLogEntity.json deleted file mode 100644 index 258e0dc2..00000000 --- a/star_lock/assets/DoorLockLogEntity.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "errorCode": 0, - "description": "success", - "errorMsg": "success", - "data": { - "list": [{ - "recordId": 42672, - "lockId": 1744, - "lockAlias": "T9A_d7d74b2f66b8", - "recordType": 130, - "recordTypeName": "防拆报警", - "username": "", - "operateDate": 1705852800000, - "imagesUrl": null, - "videoUrl": null, - "headUrl": "", - "userid": "" - }, - { - "recordId": 42660, - "lockId": 1744, - "lockAlias": "T9A_d7d74b2f66b8", - "recordType": 220, - "recordTypeName": "逗留检测", - "username": "", - "operateDate": 1706494730335, - "imagesUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706494718\/54c5044a-93bd-466d-a123-e1face292841.jpg", - "videoUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706494718\/08a2b732-536b-4f06-9d20-778fdf94f137.mp4", - "headUrl": "", - "userid": "" - }, - { - "recordId": 42659, - "lockId": 1744, - "lockAlias": "T9A_d7d74b2f66b8", - "recordType": 220, - "recordTypeName": "逗留检测", - "username": "", - "operateDate": 1706494672036, - "imagesUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706494660\/d85dcea0-c402-4f68-8664-5641a0feabe3.jpg", - "videoUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706494660\/f3de0384-63f8-4177-9611-d8c43707afce.mp4", - "headUrl": "", - "userid": "" - }, - { - "recordId": 42658, - "lockId": 1744, - "lockAlias": "T9A_d7d74b2f66b8", - "recordType": 130, - "recordTypeName": "防拆报警", - "username": "", - "operateDate": 1706493793884, - "imagesUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706493778\/f43ec840-ddaa-4d94-b759-7ae4384edd8f.jpg", - "videoUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706493778\/b4a90c5c-d86f-4995-8365-d7e21a67a48d.mp4", - "headUrl": "", - "userid": "" - }, - { - "recordId": 42657, - "lockId": 1744, - "lockAlias": "T9A_d7d74b2f66b8", - "recordType": 130, - "recordTypeName": "防拆报警", - "username": "", - "operateDate": 1706493715812, - "imagesUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706493702\/928c2b1d-1cd4-4d7f-9e61-e9315f8c4547.jpg", - "videoUrl": "http:\/\/oss-pre-starlock.star-lock.cn\/starchart\/T9A_d7d74b2f66b8-1706493702\/29e8b8e4-cd79-436d-a384-3e50dacf5cc8.mp4", - "headUrl": "", - "userid": "" - } - ], - "pageNo": 1, - "pageSize": 5, - "pages": 4, - "total": 18 - } -} \ No newline at end of file diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 1e994b2d..c4b8d276 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -678,5 +678,8 @@ "权限被拒绝": "Permission denied", "请手动在系统设置中开启": "Please manually enable it in the system settings", "权限以继续使用应用": "Permission to continue using the application.", - "去设置": "Go set it up" + "去设置": "Go set it up", + + "虹膜":"iris", + "手掌":"palm" } diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index db7f805f..f300317b 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -677,5 +677,8 @@ "权限被拒绝": "权限被拒绝", "请手动在系统设置中开启": "请手动在系统设置中开启", "权限以继续使用应用": "权限以继续使用应用。", - "去设置": "去设置" + "去设置": "去设置", + + "虹膜":"虹膜", + "手掌":"手掌" } diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 1edc5369..9dda9e72 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -679,5 +679,8 @@ "权限被拒绝": "权限被拒绝", "请手动在系统设置中开启": "请手动在系统设置中开启", "权限以继续使用应用": "权限以继续使用应用。", - "去设置": "去设置" + "去设置": "去设置", + + "虹膜":"虹膜", + "手掌":"手掌" } diff --git a/star_lock/lib/main/lockDetail/iris/addIris/addIris_page.dart b/star_lock/lib/main/lockDetail/iris/addIris/addIris_page.dart index 72787529..187566b3 100644 --- a/star_lock/lib/main/lockDetail/iris/addIris/addIris_page.dart +++ b/star_lock/lib/main/lockDetail/iris/addIris/addIris_page.dart @@ -24,7 +24,7 @@ class _AddIrisPageState extends State { return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( - barTitle: "${TranslationLoader.lanKeys!.addTip!.tr}虹膜", + barTitle: "${TranslationLoader.lanKeys!.addTip!.tr}${'虹膜'.tr}", haveBack: true, backgroundColor: AppColors.mainColor), body: ListView( diff --git a/star_lock/lib/main/lockDetail/iris/addIrisType/addIrisTypeManage/addIrisTypeManage_page.dart b/star_lock/lib/main/lockDetail/iris/addIrisType/addIrisTypeManage/addIrisTypeManage_page.dart index 7ee02f0b..d31196e9 100644 --- a/star_lock/lib/main/lockDetail/iris/addIrisType/addIrisTypeManage/addIrisTypeManage_page.dart +++ b/star_lock/lib/main/lockDetail/iris/addIrisType/addIrisTypeManage/addIrisTypeManage_page.dart @@ -28,7 +28,7 @@ class _AddIrisTypeManagePageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: "${TranslationLoader.lanKeys!.addTip!.tr}虹膜", + barTitle: "${TranslationLoader.lanKeys!.addTip!.tr}${'虹膜'.tr}", haveBack: true, backgroundColor: AppColors.mainColor), body: Column( diff --git a/star_lock/lib/main/lockDetail/iris/irisList/irisList_page.dart b/star_lock/lib/main/lockDetail/iris/irisList/irisList_page.dart index c9cdd639..94ee0f97 100644 --- a/star_lock/lib/main/lockDetail/iris/irisList/irisList_page.dart +++ b/star_lock/lib/main/lockDetail/iris/irisList/irisList_page.dart @@ -32,7 +32,7 @@ class _IrisListPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: '虹膜', + barTitle: '虹膜'.tr, haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ @@ -66,7 +66,7 @@ class _IrisListPageState extends State { ), Expanded(child: _buildMainUI()), AddBottomWhiteBtn( - btnName: '${TranslationLoader.lanKeys!.add!.tr}虹膜', + btnName: '${TranslationLoader.lanKeys!.add!.tr}${'虹膜'.tr}', onClick: () async { // var data = // await Get.toNamed(Routers.addFaceTypeManagePage, arguments: { diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 583b288f..f4c94e90 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -678,23 +678,27 @@ class _LockDetailPageState extends State ); } - showWidgetArr.add( - bottomItem('images/main/icon_iris.png', '虹膜', - state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.irisListPage, arguments: { - "lockId": state.keyInfos.value.lockId, - }); - }), - ); + if (state.keyInfos.value.lockFeature!.isSupportIris == 1) { + showWidgetArr.add( + bottomItem('images/main/icon_iris.png', '虹膜'.tr, + state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { + Get.toNamed(Routers.irisListPage, arguments: { + "lockId": state.keyInfos.value.lockId, + }); + }), + ); + } - showWidgetArr.add( - bottomItem('images/main/icon_palm.png', '手掌', - state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.palmListPage, arguments: { - "lockId": state.keyInfos.value.lockId, - }); - }), - ); + if (state.keyInfos.value.lockFeature!.palmVein == 1) { + showWidgetArr.add( + bottomItem('images/main/icon_palm.png', '手掌'.tr, + state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { + Get.toNamed(Routers.palmListPage, arguments: { + "lockId": state.keyInfos.value.lockId, + }); + }), + ); + } //可视对讲门锁新增->监控 if (state.keyInfos.value.lockFeature!.videoIntercom == 1) { diff --git a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart index d4e6c733..a9289aea 100644 --- a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart +++ b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_logic.dart @@ -148,7 +148,9 @@ class LockMonitoringLogic extends BaseGetXController { //开始录音 Future startProcessing() async { - CallTalk().finishPcmSound(); + if (state.isProcessing.value) { + CallTalk().stopPlaySound(); + } state.isButtonDisabled.value = true; state.voiceProcessor?.addFrameListener(_onFrame); @@ -169,6 +171,9 @@ class LockMonitoringLogic extends BaseGetXController { } Future _onFrame(List frame) async { + if (state.isProcessing.value) { + CallTalk().stopPlaySound(); + } state.allFrames.add(frame); // 将帧添加到状态变量中 List concatenatedFrames = concatenateFrames(state.allFrames); // 连接所有帧 Get.log("pcm数据:$concatenatedFrames"); @@ -199,6 +204,9 @@ class LockMonitoringLogic extends BaseGetXController { } Future stopProcessing() async { + if (state.isProcessing.value) { + CallTalk().stopPlaySound(); + } state.isButtonDisabled.value = true; try { await state.voiceProcessor?.stop(); @@ -410,7 +418,7 @@ class LockMonitoringLogic extends BaseGetXController { void onClose() { // TODO: implement onClose print("锁详情界面销毁了"); - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); stopProcessing(); _getUDPStatusRefreshUIEvent!.cancel(); state.getTVDataRefreshUIEvent!.cancel(); diff --git a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_page.dart b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_page.dart index bc040719..c79c0607 100644 --- a/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_page.dart +++ b/star_lock/lib/main/lockDetail/monitoring/monitoring/lockMonitoring_page.dart @@ -233,7 +233,7 @@ class _LockMonitoringPageState extends State { bottomBtnItemWidget( "images/main/icon_lockDetail_hangUp.png", "挂断", Colors.red, () async { logic.stopProcessing(); - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); // 挂断 if (state.isClickHangUp.value == false) { logic.initiateUdpHangUpAction(3); diff --git a/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_logic.dart b/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_logic.dart index 8b96f863..7b9dbcba 100644 --- a/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_logic.dart +++ b/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_logic.dart @@ -318,7 +318,7 @@ class RealTimePictureLogic extends BaseGetXController { void onClose() { // TODO: implement onClose print("锁详情界面销毁了"); - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); _getTVDataRefreshUIEvent!.cancel(); _getUDPStatusRefreshUIEvent!.cancel(); if (state.oneMinuteTimeTimer != null) { diff --git a/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_page.dart b/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_page.dart index 13969237..25dbad23 100644 --- a/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_page.dart +++ b/star_lock/lib/main/lockDetail/realTimePicture/realTimePicture_page.dart @@ -261,7 +261,7 @@ class _RealTimePicturePageState extends State "images/main/icon_lockDetail_hangUp.png", "挂断", Colors.red, () async { // 挂断 logic.udpHangUpAction(); - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); Get.back(); }), bottomBtnItemWidget("images/main/icon_lockDetail_monitoringUnlock.png", @@ -401,7 +401,7 @@ class _RealTimePicturePageState extends State void _handleFailure() { // 在这里处理失败的逻辑 - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); state.realTimePicTimer.cancel(); state.autoBackTimer.cancel(); if (state.animationController != null) { @@ -414,7 +414,7 @@ class _RealTimePicturePageState extends State state.animationController.dispose(); state.realTimePicTimer.cancel(); state.autoBackTimer.cancel(); - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); super.dispose(); } } diff --git a/star_lock/lib/main/lockMian/entity/lockListInfo_entity.dart b/star_lock/lib/main/lockMian/entity/lockListInfo_entity.dart index 76518ca9..d359e0b0 100644 --- a/star_lock/lib/main/lockMian/entity/lockListInfo_entity.dart +++ b/star_lock/lib/main/lockMian/entity/lockListInfo_entity.dart @@ -11,7 +11,9 @@ class LockListInfoEntity { errorCode = json['errorCode']; description = json['description']; errorMsg = json['errorMsg']; - data = json['data'] != null ? LockListInfoGroupEntity.fromJson(json['data']) : null; + data = json['data'] != null + ? LockListInfoGroupEntity.fromJson(json['data']) + : null; } Map toJson() { @@ -33,7 +35,8 @@ class LockListInfoGroupEntity { int? pages; int? total; - LockListInfoGroupEntity({this.groupList, this.pageNo, this.pageSize, this.pages, this.total}); + LockListInfoGroupEntity( + {this.groupList, this.pageNo, this.pageSize, this.pages, this.total}); LockListInfoGroupEntity.fromJson(Map json) { if (json['groupList'] != null) { @@ -125,32 +128,32 @@ class LockListInfoItemEntity { LockListInfoItemEntity( {this.keyId, - this.lockId, - this.lockName, - this.lockAlias, - this.electricQuantity, - this.fwVersion, - this.hwVersion, - this.keyType, - this.passageMode, - this.userType, - this.startDate, - this.endDate, - this.weekDays, - this.remoteEnable, - this.faceAuthentication, - this.lastFaceValidateTime, - this.keyRight, - this.keyStatus, - this.isLockOwner, - this.bluetooth, - this.lockFeature, - this.lockSetting, - this.sendDate, - this.lockUserNo, - this.electricQuantityDate, - this.electricQuantityStandby, - this.senderUserId}); + this.lockId, + this.lockName, + this.lockAlias, + this.electricQuantity, + this.fwVersion, + this.hwVersion, + this.keyType, + this.passageMode, + this.userType, + this.startDate, + this.endDate, + this.weekDays, + this.remoteEnable, + this.faceAuthentication, + this.lastFaceValidateTime, + this.keyRight, + this.keyStatus, + this.isLockOwner, + this.bluetooth, + this.lockFeature, + this.lockSetting, + this.sendDate, + this.lockUserNo, + this.electricQuantityDate, + this.electricQuantityStandby, + this.senderUserId}); LockListInfoItemEntity.fromJson(Map json) { keyId = json['keyId']; @@ -236,10 +239,10 @@ class Bluetooth { Bluetooth( {this.bluetoothDeviceId, - this.bluetoothDeviceName, - this.publicKey, - this.privateKey, - this.signKey}); + this.bluetoothDeviceName, + this.publicKey, + this.privateKey, + this.signKey}); Bluetooth.fromJson(Map json) { bluetoothDeviceId = json['bluetoothDeviceId']; @@ -266,18 +269,20 @@ class LockFeature { int? fingerprint; int? fingerVein; int? palmVein; + int? isSupportIris; int? d3Face; int? bluetoothRemoteControl; int? videoIntercom; LockFeature( {this.password, - this.icCard, - this.fingerprint, - this.fingerVein, - this.palmVein, - this.d3Face, - this.bluetoothRemoteControl, - this.videoIntercom}); + this.icCard, + this.fingerprint, + this.fingerVein, + this.palmVein, + this.isSupportIris, + this.d3Face, + this.bluetoothRemoteControl, + this.videoIntercom}); LockFeature.fromJson(Map json) { password = json['password']; @@ -285,6 +290,7 @@ class LockFeature { fingerprint = json['fingerprint']; fingerVein = json['fingerVein']; palmVein = json['palmVein']; + isSupportIris = json['isSupportIris']; d3Face = json['d3Face']; bluetoothRemoteControl = json['bluetoothRemoteControl']; videoIntercom = json['videoIntercom']; @@ -297,6 +303,7 @@ class LockFeature { data['fingerprint'] = fingerprint; data['fingerVein'] = fingerVein; data['palmVein'] = palmVein; + data['isSupportIris'] = isSupportIris; data['d3Face'] = d3Face; data['bluetoothRemoteControl'] = bluetoothRemoteControl; data['videoIntercom'] = videoIntercom; diff --git a/star_lock/lib/talk/call/callTalk.dart b/star_lock/lib/talk/call/callTalk.dart index b71cdef2..b313d2c8 100644 --- a/star_lock/lib/talk/call/callTalk.dart +++ b/star_lock/lib/talk/call/callTalk.dart @@ -145,8 +145,14 @@ class CallTalk { } } - //停止接收音频数据 - void finishPcmSound() { + void stopPlaySound() { + FlutterPcmSound.pause(); + FlutterPcmSound.clear(); + FlutterPcmSound.stop(); + } + + //停止接收音视频数据 + void finishAVData() { // FlutterPcmSound.setup(sampleRate: 8000, channelCount: 1); FlutterPcmSound.pause(); FlutterPcmSound.clear(); diff --git a/star_lock/lib/talk/udp/udp_reciverData.dart b/star_lock/lib/talk/udp/udp_reciverData.dart index 631cb774..c8624dd1 100644 --- a/star_lock/lib/talk/udp/udp_reciverData.dart +++ b/star_lock/lib/talk/udp/udp_reciverData.dart @@ -203,7 +203,7 @@ class CommandUDPReciverManager { break; case 30: { - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); // 监视结束 if ((data[7] & 0x3) == 1) { diff --git a/star_lock/lib/talk/udp/udp_talkClass.dart b/star_lock/lib/talk/udp/udp_talkClass.dart index dac2e50d..b253a883 100644 --- a/star_lock/lib/talk/udp/udp_talkClass.dart +++ b/star_lock/lib/talk/udp/udp_talkClass.dart @@ -188,7 +188,7 @@ class UDPTalkClass { isBeCall = false; // isEndCall = true; // LockMonitoringState().isClickHangUp.value = false; - CallTalk().finishPcmSound(); + CallTalk().finishAVData(); eventBus.fire(GetUDPStatusRefreshUI(UDPTalkClass().status)); Get.back(); From 52ea9866a863d0dad30af97eed8ee065153c4f9d Mon Sep 17 00:00:00 2001 From: ante <448468458@qq.com> Date: Mon, 15 Apr 2024 16:20:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockMain/xhj/lockMain_xhj_page.dart | 34 +++++---- star_lock/lib/mine/mall/lockMall_logic.dart | 7 +- star_lock/lib/mine/mall/lockMall_page.dart | 76 ++++++++++--------- star_lock/lib/mine/mall/lockMall_state.dart | 4 +- .../minePersonInfo_page.dart | 27 ++++++- star_lock/lib/tools/tf_loginInput.dart | 14 ++-- 6 files changed, 101 insertions(+), 61 deletions(-) diff --git a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart index 5ed23c91..e3cea087 100644 --- a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart +++ b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart @@ -53,23 +53,27 @@ class _StarLockMainXHJPageState extends State index: 0, ), pageView( - widget: MessageListPage( - showAppBar: false, - ), - logic: logic, - index: 1), + widget: MessageListPage( + showAppBar: false, + ), + logic: logic, + index: 1, + ), pageView( - widget: LockMallPage( - showAppBar: false, - ), - logic: logic, - index: 2), + widget: LockMallPage( + showAppBar: false, + ), + logic: logic, + index: 2, + ), pageView( - widget: MinePersonInfoPage( - showAppBar: false, - ), - logic: logic, - index: 3), + widget: MinePersonInfoPage( + showAppBar: false, + showAbout: true, + ), + logic: logic, + index: 3, + ), ], ), ), diff --git a/star_lock/lib/mine/mall/lockMall_logic.dart b/star_lock/lib/mine/mall/lockMall_logic.dart index 57f62ad8..9705be81 100644 --- a/star_lock/lib/mine/mall/lockMall_logic.dart +++ b/star_lock/lib/mine/mall/lockMall_logic.dart @@ -13,7 +13,10 @@ import 'package:webview_flutter/webview_flutter.dart'; import '../../tools/baseGetXController.dart'; class LockMallLogic extends BaseGetXController { - final LockMallState state = LockMallState(); + late LockMallState state; + + LockMallLogic({required bool allowReturn}) + : state = LockMallState(allowReturn: allowReturn); //获取商城跳转地址 Future getMallURLRequest() async { @@ -96,7 +99,7 @@ class LockMallLogic extends BaseGetXController { if (canGoBack) { await state.mallWebView.goBack(); } else { - Get.back(); + if (state.allowReturn) Get.back(); } return false; } diff --git a/star_lock/lib/mine/mall/lockMall_page.dart b/star_lock/lib/mine/mall/lockMall_page.dart index f93202f6..6d648536 100644 --- a/star_lock/lib/mine/mall/lockMall_page.dart +++ b/star_lock/lib/mine/mall/lockMall_page.dart @@ -7,17 +7,16 @@ import 'package:star_lock/tools/titleAppBar.dart'; import 'package:webview_flutter/webview_flutter.dart'; class LockMallPage extends StatefulWidget { - LockMallPage({Key? key, this.showAppBar = true}) : super(key: key); + LockMallPage({Key? key, this.showAppBar = true, this.allowReturn = true}) + : super(key: key); bool showAppBar; + bool allowReturn; @override State createState() => _LockMallPageState(); } class _LockMallPageState extends State { - final logic = Get.put(LockMallLogic()); - final state = Get.find().state; - @override void initState() { super.initState(); @@ -28,41 +27,46 @@ class _LockMallPageState extends State { // FIXME 如果未登录状态,应先跳转登录页 // FIXME url应该使用接口获取,接口名称 “获取商城跳转地址:/mall/getUrl“ POST请求,无参数,需要登录 // String url = 'https://ge.mall.star-lock.cn/quick_login?id=4&key=1ffb9d37109b8351ebb04ccfcca02c8e'; - return PopScope( - onPopInvoked: logic.canGoBack, - canPop: false, - child: Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: const Color(0xFFFFFFFF), - appBar: widget.showAppBar - ? TitleAppBar( - barTitle: getWebTitle(), - haveBack: true, - backgroundColor: AppColors.mainColor, - ) - : null, - body: Obx(() => Column( - children: [ - Container( - padding: EdgeInsets.only(bottom: 10.w), - child: LinearProgressIndicator( - value: state.webProgress.value, - backgroundColor: Colors.grey, - valueColor: - AlwaysStoppedAnimation(AppColors.mainColor), - ), - ), - Expanded( - child: WebViewWidget(controller: state.mallWebView), - ), - ], - ))), - ); + return GetBuilder( + init: LockMallLogic(allowReturn: widget.allowReturn), + builder: (LockMallLogic logic) { + return PopScope( + onPopInvoked: logic.canGoBack, + canPop: false, + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFFFFFFFF), + appBar: widget.showAppBar + ? TitleAppBar( + barTitle: getWebTitle(logic), + haveBack: true, + backgroundColor: AppColors.mainColor, + ) + : null, + body: Obx(() => Column( + children: [ + Container( + padding: EdgeInsets.only(bottom: 10.w), + child: LinearProgressIndicator( + value: logic.state.webProgress.value, + backgroundColor: Colors.grey, + valueColor: AlwaysStoppedAnimation( + AppColors.mainColor), + ), + ), + Expanded( + child: WebViewWidget( + controller: logic.state.mallWebView), + ), + ], + ))), + ); + }); } - String getWebTitle() { + String getWebTitle(LockMallLogic logic) { String webTitleStr = "配件商城".tr; - state.mallWebView.getTitle().then((result) { + logic.state.mallWebView.getTitle().then((result) { webTitleStr = result!; }); return webTitleStr; diff --git a/star_lock/lib/mine/mall/lockMall_state.dart b/star_lock/lib/mine/mall/lockMall_state.dart index e0c4bb72..a9636f15 100644 --- a/star_lock/lib/mine/mall/lockMall_state.dart +++ b/star_lock/lib/mine/mall/lockMall_state.dart @@ -4,8 +4,11 @@ import 'package:star_lock/webview/webview_logic.dart'; import 'package:webview_flutter/webview_flutter.dart'; class LockMallState { + LockMallState({required this.allowReturn}); + var lockMallUrl = "".obs; var webProgress = 0.0.obs; + bool allowReturn; late WebViewController mallWebView = initWebViewController(); //初始化webView控制器 @@ -16,5 +19,4 @@ class LockMallState { allWebView.setUserAgent(WebViewLogic.userAgent); return allWebView; } - } diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart index 7f368dea..0d5e1802 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/flavors.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart'; import 'package:star_lock/tools/custom_bottom_sheet.dart'; @@ -13,8 +14,10 @@ import '../../../tools/titleAppBar.dart'; import '../../../translations/trans_lib.dart'; class MinePersonInfoPage extends StatefulWidget { - MinePersonInfoPage({Key? key, this.showAppBar = true}) : super(key: key); + MinePersonInfoPage({Key? key, this.showAppBar = true, this.showAbout = false}) + : super(key: key); bool showAppBar; + bool showAbout; @override State createState() => _MinePersonInfoPageState(); @@ -146,8 +149,28 @@ class _MinePersonInfoPageState extends State { rightTitle: state.mineInfoData.value.countryName != null ? state.mineInfoData.value.countryName! : "", - isHaveLine: false, + 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!.about!.tr, + isHaveLine: false, + isHaveDirection: true, + action: () { + Get.back(); + Get.toNamed(Routers.aboutPage); + }, + ), ], )); } diff --git a/star_lock/lib/tools/tf_loginInput.dart b/star_lock/lib/tools/tf_loginInput.dart index 9bd285e0..34a08940 100644 --- a/star_lock/lib/tools/tf_loginInput.dart +++ b/star_lock/lib/tools/tf_loginInput.dart @@ -9,6 +9,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; typedef BlockStrCallback = void Function(dynamic textStr); typedef BlockClickCallback = void Function(); + class LoginInput extends StatelessWidget { TextEditingController? controller; FocusNode? focusNode; @@ -24,6 +25,7 @@ class LoginInput extends StatelessWidget { Widget? rightSlot; BlockStrCallback? onchangeAction; BlockClickCallback? onTapAction; + LoginInput( {Key? key, required this.controller, @@ -58,7 +60,7 @@ class LoginInput extends StatelessWidget { onChanged: onchangeAction, onTap: onTapAction, autofocus: false, - inputFormatters:inputFormatters, + inputFormatters: inputFormatters, decoration: InputDecoration( //输入里面输入文字内边距设置 contentPadding: const EdgeInsets.only( @@ -69,10 +71,12 @@ class LoginInput extends StatelessWidget { hintText: hintText, //不需要输入框下划线 border: InputBorder.none, - suffixIcon: isSuffixIcon! ? IconButton( - icon: const Icon(Icons.clear), - onPressed: controller!.clear, - ) : null, + suffixIcon: (isSuffixIcon ?? false) + ? IconButton( + icon: const Icon(Icons.clear), + onPressed: controller!.clear, + ) + : null, //左边图标设置 icon: isHaveLeftWidget == true ? leftWidget