Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
This commit is contained in:
commit
a487a22580
@ -125,7 +125,9 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
margin: EdgeInsets.only(
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
onClick: () {
|
||||
deleteKeyRequest();
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -249,6 +251,19 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
}
|
||||
}
|
||||
|
||||
//删除电子钥匙名称请求
|
||||
Future<void> deleteKeyRequest() async {
|
||||
ElectronicKeyListEntity entity =
|
||||
await ApiRepository.to.deleteElectronicKey('0');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("删除电子钥匙成功");
|
||||
Toast.show(msg: "删除成功");
|
||||
setState(() {
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void showCupertinoAlertDialog(
|
||||
BuildContext context,
|
||||
) {
|
||||
|
||||
@ -428,12 +428,26 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
),
|
||||
OutLineBtn(
|
||||
btnName: '标记为已入住',
|
||||
onClick: () {},
|
||||
onClick: () {
|
||||
updateRoomCheckIn();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||
Future<void> updateRoomCheckIn() async {
|
||||
var entity = await ApiRepository.to.updateSetting('0', '1', '13');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("标记为已入住成功啦啦啦啦啦");
|
||||
Toast.show(msg: "标记成功");
|
||||
setState(() {});
|
||||
} else {
|
||||
Toast.show(msg: '操作失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex) {
|
||||
return SizedBox(
|
||||
|
||||
@ -3,7 +3,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||
import 'package:star_lock/tools/shareModule/sharePopup.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -163,7 +166,9 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
||||
margin: EdgeInsets.only(
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
onClick: () {
|
||||
deletePwdRequest();
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -232,6 +237,19 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
||||
);
|
||||
}
|
||||
|
||||
//删除密码请求
|
||||
Future<void> deletePwdRequest() async {
|
||||
PasswordKeyEntity entity =
|
||||
await ApiRepository.to.deleteKeyboardPwd('0', '1', '1');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("删除密码成功");
|
||||
Toast.show(msg: "删除成功");
|
||||
setState(() {
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void showCupertinoAlertDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
|
||||
@ -34,4 +34,5 @@ abstract class Api {
|
||||
final String clearOperationRecordURL = '/lockRecords/clear'; //清空操作记录
|
||||
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
||||
final String lockGroupListURL = '/authorizedAdmin/listGroup'; //锁分组列表
|
||||
final String updateSettingURL = '/room/updateSetting'; //标记房态
|
||||
}
|
||||
|
||||
@ -250,24 +250,19 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
// 获取锁信息
|
||||
Future<Response> getLockInfo(
|
||||
String lastUpdateDate,
|
||||
String pageNo) =>
|
||||
post(
|
||||
getLockInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
'lastUpdateDate': lastUpdateDate,
|
||||
"pageNo": pageNo,
|
||||
}));
|
||||
Future<Response> getLockInfo(String lastUpdateDate, String pageNo) => post(
|
||||
getLockInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
'lastUpdateDate': lastUpdateDate,
|
||||
"pageNo": pageNo,
|
||||
}));
|
||||
|
||||
// 删除锁
|
||||
Future<Response> deletLockInfo(
|
||||
String lockId) =>
|
||||
post(
|
||||
deletLockURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
Future<Response> deletLockInfo(String lockId) => post(
|
||||
deletLockURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}));
|
||||
|
||||
Future<Response> passwordKeyList(
|
||||
String keyStatus,
|
||||
@ -337,6 +332,10 @@ class ApiProvider extends BaseProvider {
|
||||
'keyboardPwdId': keyboardPwdId,
|
||||
'deleteType': deleteType
|
||||
}));
|
||||
|
||||
Future<Response> updateSetting(String lockId, String isOn, String type) =>
|
||||
post(updateSettingURL.toUrl,
|
||||
jsonEncode({'lockId': lockId, 'isOn': isOn, 'type': type}));
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -177,24 +177,17 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 绑定蓝牙管理员
|
||||
Future<SaveLockEntity> bindingBlueAdmin({
|
||||
required String bindingDate,
|
||||
required String hotelMode,
|
||||
required String lockAlias,
|
||||
required Map lockData,
|
||||
required String nbInitSuccess,
|
||||
required Map position,
|
||||
required Map bluetooth,
|
||||
required String deviceNo}) async {
|
||||
final res = await apiProvider.bindingBlueAdmin(
|
||||
bindingDate,
|
||||
hotelMode,
|
||||
lockAlias,
|
||||
lockData,
|
||||
nbInitSuccess,
|
||||
position,
|
||||
bluetooth,
|
||||
deviceNo);
|
||||
Future<SaveLockEntity> bindingBlueAdmin(
|
||||
{required String bindingDate,
|
||||
required String hotelMode,
|
||||
required String lockAlias,
|
||||
required Map lockData,
|
||||
required String nbInitSuccess,
|
||||
required Map position,
|
||||
required Map bluetooth,
|
||||
required String deviceNo}) async {
|
||||
final res = await apiProvider.bindingBlueAdmin(bindingDate, hotelMode,
|
||||
lockAlias, lockData, nbInitSuccess, position, bluetooth, deviceNo);
|
||||
return SaveLockEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -250,18 +243,14 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
// 获取锁信息
|
||||
Future<LockMainEntity> getLockInfo({
|
||||
required String lastUpdateDate,
|
||||
required String pageNo}) async {
|
||||
final res = await apiProvider.getLockInfo(
|
||||
lastUpdateDate,
|
||||
pageNo);
|
||||
Future<LockMainEntity> getLockInfo(
|
||||
{required String lastUpdateDate, required String pageNo}) async {
|
||||
final res = await apiProvider.getLockInfo(lastUpdateDate, pageNo);
|
||||
return LockMainEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 删除锁
|
||||
Future<LockMainEntity> deletLockData({
|
||||
required String lockId}) async {
|
||||
Future<LockMainEntity> deletLockData({required String lockId}) async {
|
||||
final res = await apiProvider.deletLockInfo(lockId);
|
||||
return LockMainEntity.fromJson(res.body);
|
||||
}
|
||||
@ -311,16 +300,23 @@ class ApiRepository {
|
||||
}
|
||||
|
||||
//删除电子钥匙
|
||||
Future<LockGroupListEntity> deleteElectronicKey(String type) async {
|
||||
final res = await apiProvider.deleteElectronicKey(type);
|
||||
return LockGroupListEntity.fromJson(res.body);
|
||||
Future<ElectronicKeyListEntity> deleteElectronicKey(String keyId) async {
|
||||
final res = await apiProvider.deleteElectronicKey(keyId);
|
||||
return ElectronicKeyListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//删除密码
|
||||
Future<LockGroupListEntity> deleteKeyboardPwd(
|
||||
Future<PasswordKeyEntity> deleteKeyboardPwd(
|
||||
String keyId, String keyboardPwdId, String deleteType) async {
|
||||
final res =
|
||||
await apiProvider.deleteKeyboardPwd(keyId, keyboardPwdId, deleteType);
|
||||
return LockGroupListEntity.fromJson(res.body);
|
||||
return PasswordKeyEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
//标记房态
|
||||
Future<PasswordKeyEntity> updateSetting(
|
||||
String lockId, String isOn, String type) async {
|
||||
final res = await apiProvider.deleteKeyboardPwd(lockId, isOn, type);
|
||||
return PasswordKeyEntity.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user