fix: 增加ai助理、调整第三方协议

This commit is contained in:
liyi 2025-10-09 11:37:24 +08:00
parent b5dfd10baa
commit d3cd4adce8
11 changed files with 232 additions and 46 deletions

BIN
images/other/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
images/other/ai.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/other/matter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
images/other/tuya.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -18,6 +18,7 @@ import 'package:star_lock/main/lockDetail/iris/addIris/addIris_page.dart';
import 'package:star_lock/main/lockDetail/iris/addIrisType/addIrisTypeManage/addIrisTypeManage_page.dart';
import 'package:star_lock/main/lockDetail/iris/irisList/irisList_page.dart';
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/aiAssistant/ai_assistant_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeCustomMode/catEyeCustomMode_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/videoSlot/videoSlot_page.dart';
@ -532,6 +533,7 @@ abstract class Routers {
static const String permissionGuidancePage =
'/permissionGuidancePage'; //
static const String lockVoiceSettingPage = '/lockVoiceSetting'; //
static const String aiAssistant = '/aiAssistant';
}
abstract class AppRouters {
@ -1224,6 +1226,9 @@ abstract class AppRouters {
GetPage<dynamic>(
name: Routers.thirdPartyPlatformPage,
page: () => ThirdPartyPlatformPage()),
GetPage<dynamic>(
name: Routers.aiAssistant,
page: () => AiAssistantPage()),
//
// GetPage<dynamic>(name: Routers.h264View, page: () => H264WebView()), // webview播放页面
];

View File

@ -27,6 +27,11 @@ class EventSendModel {
Uuid? serviceId;
Uuid? characteristicId;
bool? allowLongWrite = false;
@override
String toString() {
return 'EventSendModel{data: $data, topic: $topic, sendChannel: $sendChannel, deviceId: $deviceId, serviceId: $serviceId, characteristicId: $characteristicId, allowLongWrite: $allowLongWrite}';
}
}
///

View File

@ -0,0 +1,7 @@
import 'package:star_lock/main/lockDetail/lockSet/aiAssistant/ai_assistant_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class AiAssistantLogic extends BaseGetXController{
final AiAssistantState state = AiAssistantState();
}

View File

@ -0,0 +1,90 @@
import 'package:flutter/cupertino.dart';
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/aiAssistant/ai_assistant_logic.dart';
import 'package:star_lock/main/lockDetail/lockSet/aiAssistant/ai_assistant_state.dart';
import 'package:star_lock/tools/commonItem.dart';
import 'package:star_lock/tools/titleAppBar.dart';
class AiAssistantPage extends StatefulWidget {
const AiAssistantPage({Key? key}) : super(key: key);
@override
State<AiAssistantPage> createState() => _AiAssistantPageState();
}
class _AiAssistantPageState extends State<AiAssistantPage> {
final AiAssistantLogic logic = Get.put(AiAssistantLogic());
final AiAssistantState state = Get.find<AiAssistantLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: TitleAppBar(barTitle: 'AI助理设置'.tr, haveBack: true, backgroundColor: AppColors.mainColor),
body: Container(
width: 1.sw,
padding: EdgeInsets.symmetric(horizontal: 20.w),
margin: EdgeInsets.only(top: 20.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
'images/other/ai.png',
height: 250.h,
fit: BoxFit.cover,
),
SizedBox(
height: 50.h,
),
Text(
'AI助理的支持依赖网络授权下载打开功能开关时请保证手机数据网络的正常连接'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.sp,
color: Colors.grey,
fontWeight: FontWeight.w500,
),
),
SizedBox(
height: 50.h,
),
CommonItem(
leftTitel: 'Ai语音菜单'.tr,
rightTitle: '',
isHaveLine: true,
// 线
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget: CupertinoSwitch(
value: false,
onChanged: (value) {},
),
action: () {
logic.showToast('功能待开放'.tr);
},
),
CommonItem(
leftTitel: 'Ai智能语音交互'.tr,
rightTitle: '',
isHaveLine: false,
// 线
isHaveDirection: false,
isHaveRightWidget: true,
rightWidget: CupertinoSwitch(
value: false,
onChanged: (value) {},
),
action: () {
logic.showToast('功能待开放'.tr);
},
)
],
),
),
);
}
}

View File

@ -0,0 +1,12 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
class AiAssistantState {
AiAssistantState() {
final map = Get.arguments;
lockSetInfoData.value = map['lockSetInfoData'];
}
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
}

View File

@ -553,6 +553,19 @@ class _LockSetPageState extends State<LockSetPage>
});
},
),
//
CommonItem(
leftTitel: 'AI助理'.tr,
rightTitle: '',
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.aiAssistant,
arguments: <String, LockSetInfoData>{
'lockSetInfoData': state.lockSetInfoData.value
});
},
),
// 广使
/* 2024-01-12 广 by DaisyWu
Obx(() => Visibility(

View File

@ -17,8 +17,7 @@ class ThirdPartyPlatformPage extends StatefulWidget {
class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
final ThirdPartyPlatformLogic logic = Get.put(ThirdPartyPlatformLogic());
final ThirdPartyPlatformState state =
Get.find<ThirdPartyPlatformLogic>().state;
final ThirdPartyPlatformState state = Get.find<ThirdPartyPlatformLogic>().state;
@override
Widget build(BuildContext context) {
@ -46,7 +45,61 @@ class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
}
Widget _buildBody() {
return ListView.builder(
return Stack(
children: [
// 1.
Container(
color: Colors.white,
padding: EdgeInsets.all(16.w),
),
// 2. 使 Row
Positioned(
top: 80.h,
left: 0,
right: 0,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, //
children: [
Image.asset(
'images/other/tuya.png',
height: 50.h,
fit: BoxFit.cover,
),
Image.asset(
'images/other/2.png', //
height: 80.h,
fit: BoxFit.cover,
),
Image.asset(
'images/other/matter.png',
width: 110.w,
fit: BoxFit.cover,
),
],
),
),
Positioned(
top: 220.h,
left: 20.w,
right: 20.w,
child: Text(
'第三方协议的支持依赖网络授权下载,打开功能开关时请保证手机数据网络的正常连接'.tr,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.sp,
color: Colors.grey,
fontWeight: FontWeight.w500,
),
),
),
Positioned(
left: 0,
right: 0,
top: 320.h,
bottom: 0,
child: ListView.builder(
itemCount: state.platFormSet.length,
itemBuilder: (BuildContext context, int index) {
// itemCount - 1
@ -65,8 +118,7 @@ class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
// Radio 使 id
value: platform,
// selectPlatFormIndex id
groupValue:
state.platFormSet.value[state.selectPlatFormIndex.value],
groupValue: state.platFormSet.value[state.selectPlatFormIndex.value],
//
activeColor: AppColors.mainColor,
// Radio
@ -74,8 +126,7 @@ class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
if (value != null) {
setState(() {
// id
final newIndex =
state.platFormSet.value.indexWhere((p) => p == value);
final newIndex = state.platFormSet.value.indexWhere((p) => p == value);
if (newIndex != -1) {
state.selectPlatFormIndex.value = newIndex;
}
@ -92,6 +143,9 @@ class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
},
shrinkWrap: true,
physics: const AlwaysScrollableScrollPhysics(),
),
),
],
);
}
}