From 2e3bc1156364ad2d740dd3ed6f20cec77da3d97c Mon Sep 17 00:00:00 2001 From: liyi Date: Thu, 24 Jul 2025 16:17:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=B9=B3=E5=8F=B0=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockSet/lockSet/lockSet_page.dart | 15 ++- .../third_party_platform_logic.dart | 8 ++ .../third_party_platform_page.dart | 92 +++++++++++++++++++ .../third_party_platform_state.dart | 18 ++++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_logic.dart create mode 100644 lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_page.dart create mode 100644 lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index 43cbc989..045b2b2c 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -540,6 +540,19 @@ class _LockSetPageState extends State 'lockSetInfoData': state.lockSetInfoData.value }); })), + // 锁语音包设置 + CommonItem( + leftTitel: '第三方平台'.tr, + rightTitle: '', + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.thirdPartyPlatformPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }, + ), // 蓝牙广播(关闭则不能使用蓝牙主动开锁) /* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu Obx(() => Visibility( @@ -606,7 +619,7 @@ class _LockSetPageState extends State state.lockFeature.value.appUnlockOnline == 1, child: otherItem( leftTitle: '开锁时是否需联网'.tr, - isHaveLine: false, + isHaveLine: true, rightWidget: _openLockNeedOnlineSwitch()), ), ), diff --git a/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_logic.dart b/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_logic.dart new file mode 100644 index 00000000..b73156e2 --- /dev/null +++ b/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_logic.dart @@ -0,0 +1,8 @@ +import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart'; + +class ThirdPartyPlatformLogic { + ThirdPartyPlatformState state = ThirdPartyPlatformState(); + + void savePlatFormSetting() { + } +} diff --git a/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_page.dart b/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_page.dart new file mode 100644 index 00000000..6d7d1919 --- /dev/null +++ b/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_page.dart @@ -0,0 +1,92 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.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/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_logic.dart'; +import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart'; +import 'package:star_lock/tools/titleAppBar.dart'; + +class ThirdPartyPlatformPage extends StatefulWidget { + const ThirdPartyPlatformPage(); + + @override + State createState() => _ThirdPartyPlatformPageState(); +} + +class _ThirdPartyPlatformPageState extends State { + final ThirdPartyPlatformLogic logic = Get.put(ThirdPartyPlatformLogic()); + final ThirdPartyPlatformState state = + Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: TitleAppBar( + barTitle: '第三方平台设置'.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + onPressed: logic.savePlatFormSetting, + child: Text( + '保存'.tr, + style: TextStyle( + color: Colors.white, + fontSize: 24.sp, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ), + body: _buildBody(), + ); + } + + Widget _buildBody() { + return ListView.builder( + itemCount: state.platFormSet.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + onTap: () { + setState(() { + state.selectPlatFormIndex.value = index; + }); + }, + child: Container( + width: 1.sw, + padding: EdgeInsets.symmetric( + vertical: 12.h, + horizontal: 24.w, + ), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + state.platFormSet[index], + style: TextStyle( + wordSpacing: 2.w, + ), + ), + Visibility( + visible: state.selectPlatFormIndex.value == index, + child: Icon( + Icons.check_circle, + color: AppColors.mainColor, + size: 30.sp, + ), + ), + ], + ), + ), + ); + }, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + ); + } +} diff --git a/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart b/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart new file mode 100644 index 00000000..65bc92b8 --- /dev/null +++ b/lib/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart @@ -0,0 +1,18 @@ +import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart'; + +class ThirdPartyPlatformState { + ThirdPartyPlatformState() { + final map = Get.arguments; + lockSetInfoData.value = map['lockSetInfoData']; + } + + Rx lockSetInfoData = LockSetInfoData().obs; + + // 响应式字符串集合(自动触发 UI 更新) + final RxList platFormSet = List.of({ + '涂鸦智能'.tr, + }).obs; + + RxInt selectPlatFormIndex = 999.obs; +}