Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
# Conflicts: # star_lock/images/lan/lan_en.json # star_lock/images/lan/lan_keys.json # star_lock/images/lan/lan_zh.json
This commit is contained in:
commit
881df8cac1
@ -796,6 +796,7 @@
|
|||||||
"购买":"Buy",
|
"购买":"Buy",
|
||||||
"实名认证为付费功能,请购买后再使用":"Real-name authentication is a paid function, please use it after purchase",
|
"实名认证为付费功能,请购买后再使用":"Real-name authentication is a paid function, please use it after purchase",
|
||||||
"密码不一致哦":"The passwords are inconsistent",
|
"密码不一致哦":"The passwords are inconsistent",
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
"退出添加":"Quit adding",
|
"退出添加":"Quit adding",
|
||||||
"管理员已满":"Admin full",
|
"管理员已满":"Admin full",
|
||||||
@ -809,4 +810,10 @@
|
|||||||
"锁上面添加密码已满": "Lock above add password is full",
|
"锁上面添加密码已满": "Lock above add password is full",
|
||||||
"密码已存在": "Password already exists",
|
"密码已存在": "Password already exists",
|
||||||
"请输入密码": "Please enter password"
|
"请输入密码": "Please enter password"
|
||||||
|
|
||||||
|
"真实姓名":"Real name",
|
||||||
|
"身份证号":"ID number",
|
||||||
|
"请输入真实姓名":"Please enter your real name",
|
||||||
|
"请输入身份证号":"Please enter your ID number"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -823,6 +823,7 @@
|
|||||||
"当前剩余数量":"当前剩余数量",
|
"当前剩余数量":"当前剩余数量",
|
||||||
"购买":"购买",
|
"购买":"购买",
|
||||||
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用",
|
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用",
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
"退出添加":"退出添加",
|
"退出添加":"退出添加",
|
||||||
"管理员已满":"管理员已满",
|
"管理员已满":"管理员已满",
|
||||||
@ -836,4 +837,10 @@
|
|||||||
"锁上面添加密码已满": "锁上面添加密码已满",
|
"锁上面添加密码已满": "锁上面添加密码已满",
|
||||||
"密码已存在": "密码已存在",
|
"密码已存在": "密码已存在",
|
||||||
"请输入密码": "请输入密码"
|
"请输入密码": "请输入密码"
|
||||||
|
|
||||||
|
"真实姓名":"真实姓名",
|
||||||
|
"身份证号":"身份证号",
|
||||||
|
"请输入真实姓名":"请输入真实姓名",
|
||||||
|
"请输入身份证号":"请输入身份证号"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -826,6 +826,7 @@
|
|||||||
"当前剩余数量":"当前剩余数量",
|
"当前剩余数量":"当前剩余数量",
|
||||||
"购买":"购买",
|
"购买":"购买",
|
||||||
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用",
|
"实名认证为付费功能,请购买后再使用":"实名认证为付费功能,请购买后再使用",
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
"退出添加":"退出添加",
|
"退出添加":"退出添加",
|
||||||
"管理员已满":"管理员已满",
|
"管理员已满":"管理员已满",
|
||||||
@ -839,4 +840,9 @@
|
|||||||
"锁上面添加密码已满": "锁上面添加密码已满",
|
"锁上面添加密码已满": "锁上面添加密码已满",
|
||||||
"密码已存在": "密码已存在",
|
"密码已存在": "密码已存在",
|
||||||
"请输入密码": "请输入密码"
|
"请输入密码": "请输入密码"
|
||||||
|
|
||||||
|
"真实姓名":"真实姓名",
|
||||||
|
"身份证号":"身份证号",
|
||||||
|
"请输入真实姓名":"请输入真实姓名",
|
||||||
|
"请输入身份证号":"请输入身份证号"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
username: state.emailOrPhone.value);
|
username: state.emailOrPhone.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
Storage.saveLoginData(entity.data);
|
Storage.saveLoginData(entity.data);
|
||||||
Storage.setBool(saveIsVip, entity.data!.isVip! == 0 ? false : true);
|
Storage.setBool(saveIsVip, entity.data!.isVip == 0 ? false : true);
|
||||||
eventBus.fire(MineInfoChangeRefreshUI());
|
eventBus.fire(MineInfoChangeRefreshUI());
|
||||||
// Get.back();
|
// Get.back();
|
||||||
// Get.toNamed(Routers.starLockMain);
|
// Get.toNamed(Routers.starLockMain);
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/blue/io_type.dart';
|
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
@ -117,7 +115,8 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
if (state.seletType.value == 0) {
|
if (state.seletType.value == 0) {
|
||||||
getKeyType = "2";
|
getKeyType = "2";
|
||||||
|
|
||||||
startDate = DateTool().dateToTimestamp(state.beginDate.value, 1).toString();
|
startDate =
|
||||||
|
DateTool().dateToTimestamp(state.beginDate.value, 1).toString();
|
||||||
endDate = DateTool().dateToTimestamp(state.endDate.value, 1).toString();
|
endDate = DateTool().dateToTimestamp(state.endDate.value, 1).toString();
|
||||||
startTime = "0";
|
startTime = "0";
|
||||||
endTime = "0";
|
endTime = "0";
|
||||||
@ -156,7 +155,9 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
weekDays: state.weekdaysList,
|
weekDays: state.weekdaysList,
|
||||||
startTime: int.parse(startTime),
|
startTime: int.parse(startTime),
|
||||||
endTime: int.parse(endTime),
|
endTime: int.parse(endTime),
|
||||||
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0);
|
isOnlyManageSelf: state.onlyManageYouCreatesUser.value ? 1 : 0,
|
||||||
|
realName: '',
|
||||||
|
idCardNumber: '');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.isCreateUser.value = false;
|
state.isCreateUser.value = false;
|
||||||
state.isSendSuccess.value = true;
|
state.isSendSuccess.value = true;
|
||||||
@ -169,7 +170,9 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
//用户未注册
|
//用户未注册
|
||||||
state.isCreateUser.value = true;
|
state.isCreateUser.value = true;
|
||||||
// _showDialog('${entity.errorMsg}');
|
// _showDialog('${entity.errorMsg}');
|
||||||
ShowTipView().showIosTipWithContentDialog('${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}', (){
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
|
'${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}',
|
||||||
|
() {
|
||||||
sendElectronicKeyRequest();
|
sendElectronicKeyRequest();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
|
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
|
||||||
|
|
||||||
import '../../../../../tools/showTipView.dart';
|
|
||||||
|
|
||||||
class SendElectronicKeyLogic extends BaseGetXController {
|
class SendElectronicKeyLogic extends BaseGetXController {
|
||||||
final SendElectronicKeyState state = SendElectronicKeyState();
|
final SendElectronicKeyState state = SendElectronicKeyState();
|
||||||
|
|||||||
@ -1,28 +1,11 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
|
||||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
|
||||||
import 'package:star_lock/tools/storage.dart';
|
|
||||||
|
|
||||||
import '../../../../../appRouters.dart';
|
|
||||||
import '../../../../../tools/CustomUnderlineTabIndicator.dart';
|
import '../../../../../tools/CustomUnderlineTabIndicator.dart';
|
||||||
import '../../../../../tools/NativeInteractionTool.dart';
|
|
||||||
import '../../../../../tools/commonDataManage.dart';
|
|
||||||
import '../../../../../tools/commonItem.dart';
|
|
||||||
import '../../../../../tools/dateTool.dart';
|
|
||||||
import '../../../../../tools/submitBtn.dart';
|
|
||||||
import '../../../../../tools/titleAppBar.dart';
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../../translations/trans_lib.dart';
|
import '../../../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
@ -107,8 +90,8 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
|
|||||||
controller: state.tabController,
|
controller: state.tabController,
|
||||||
children: _itemTabs
|
children: _itemTabs
|
||||||
.map((ItemView item) => SendElectronicKeyView(
|
.map((ItemView item) => SendElectronicKeyView(
|
||||||
type: item.type,
|
type: item.type,
|
||||||
))
|
))
|
||||||
.toList()),
|
.toList()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -119,7 +102,6 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
|
|||||||
ItemView(title: TranslationLoader.lanKeys!.once!.tr, type: "2"),
|
ItemView(title: TranslationLoader.lanKeys!.once!.tr, type: "2"),
|
||||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, type: "3"),
|
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, type: "3"),
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ItemView {
|
class ItemView {
|
||||||
|
|||||||
@ -1,27 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
|
|
||||||
import '../../../../../tools/dateTool.dart';
|
|
||||||
import '../../../../lockMian/entity/lockListInfo_entity.dart';
|
|
||||||
|
|
||||||
class SendElectronicKeyState {
|
class SendElectronicKeyState {
|
||||||
|
|
||||||
late TabController tabController;
|
late TabController tabController;
|
||||||
|
|
||||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||||
late Contact contact;
|
late Contact contact;
|
||||||
|
|
||||||
|
|
||||||
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||||
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||||
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||||
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||||
|
|
||||||
SendElectronicKeyState() {
|
SendElectronicKeyState() {}
|
||||||
// Map map = Get.arguments;
|
|
||||||
// if ((map["keyInfo"] != null)) {
|
|
||||||
// keyInfo.value = map["keyInfo"];
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
@ -40,22 +42,20 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case '0':
|
case '0':
|
||||||
// 限时
|
// 限时
|
||||||
if (state.timeLimitBeginTime.value.isEmpty) {
|
if (state.timeLimitBeginTime.isEmpty) {
|
||||||
showToast("请选择开始时间".tr);
|
showToast("请选择开始时间".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state.timeLimitEndTime.value.isEmpty) {
|
if (state.timeLimitEndTime.isEmpty) {
|
||||||
showToast("请选择结束时间".tr);
|
showToast("请选择结束时间".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typeValue = XSConstantMacro.keyTypeTime;
|
typeValue = XSConstantMacro.keyTypeTime;
|
||||||
startDate = DateTool()
|
startDate =
|
||||||
.dateToTimestamp(state.timeLimitBeginTime.value, 1)
|
DateTool().dateToTimestamp(state.timeLimitBeginTime, 1).toString();
|
||||||
.toString();
|
endDate =
|
||||||
endDate = DateTool()
|
DateTool().dateToTimestamp(state.timeLimitEndTime, 1).toString();
|
||||||
.dateToTimestamp(state.timeLimitEndTime.value, 1)
|
|
||||||
.toString();
|
|
||||||
startTime = "0";
|
startTime = "0";
|
||||||
endTime = "0";
|
endTime = "0";
|
||||||
|
|
||||||
@ -73,21 +73,17 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
case '3':
|
case '3':
|
||||||
typeValue = XSConstantMacro.keyTypeLoop;
|
typeValue = XSConstantMacro.keyTypeLoop;
|
||||||
if (state.cycleBeginTime.value.isEmpty) {
|
if (state.cycleBeginTime.isEmpty) {
|
||||||
showToast("请选择有效期".tr);
|
showToast("请选择有效期".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
startDate = DateTool()
|
startDate =
|
||||||
.dateToTimestamp(state.cycleBeginTime.value, 1)
|
DateTool().dateToTimestamp(state.cycleBeginTime, 1).toString();
|
||||||
.toString();
|
endDate = DateTool().dateToTimestamp(state.cycleEndTime, 1).toString();
|
||||||
endDate =
|
startTime =
|
||||||
DateTool().dateToTimestamp(state.cycleEndTime.value, 1).toString();
|
DateTool().dateToTimestamp(state.effectiveDateTime, 0).toString();
|
||||||
startTime = DateTool()
|
endTime =
|
||||||
.dateToTimestamp(state.effectiveDateTime.value, 0)
|
DateTool().dateToTimestamp(state.failureDateTime, 0).toString();
|
||||||
.toString();
|
|
||||||
endTime = DateTool()
|
|
||||||
.dateToTimestamp(state.failureDateTime.value, 0)
|
|
||||||
.toString();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
typeValue = XSConstantMacro.keyTypeTime;
|
typeValue = XSConstantMacro.keyTypeTime;
|
||||||
@ -96,15 +92,15 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
String getKeyType = typeValue.toString();
|
String getKeyType = typeValue.toString();
|
||||||
|
|
||||||
var entity = await ApiRepository.to.sendElectronicKey(
|
var entity = await ApiRepository.to.sendElectronicKey(
|
||||||
createUser: state.isCreateUser.value == true ? "1" : "0",
|
createUser: state.isCreateUser == true ? "1" : "0",
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode,
|
||||||
usernameType: isPhoneNumber(state.emailOrPhoneController.text) == true
|
usernameType: isPhoneNumber(state.emailOrPhoneController.text) == true
|
||||||
? '1'
|
? '1'
|
||||||
: '2',
|
: '2',
|
||||||
endDate: int.parse(endDate),
|
endDate: int.parse(endDate),
|
||||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
faceAuthentication: state.isAuthentication == true ? '1' : '2',
|
||||||
isCameraEnable: '2',
|
isCameraEnable: '2',
|
||||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
isRemoteUnlock: state.isRemoteUnlock == true ? '1' : '2',
|
||||||
keyNameForAdmin: state.keyNameController.text,
|
keyNameForAdmin: state.keyNameController.text,
|
||||||
keyRight: '0',
|
keyRight: '0',
|
||||||
keyType: getKeyType,
|
keyType: getKeyType,
|
||||||
@ -116,15 +112,23 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
weekDays: state.weekdaysList,
|
weekDays: state.weekdaysList,
|
||||||
startTime: int.parse(startTime),
|
startTime: int.parse(startTime),
|
||||||
endTime: int.parse(endTime),
|
endTime: int.parse(endTime),
|
||||||
isOnlyManageSelf: 0);
|
isOnlyManageSelf: 0,
|
||||||
|
realName: state.isRequireAuth.value == true
|
||||||
|
? state.realNameController.text
|
||||||
|
: "",
|
||||||
|
idCardNumber: state.isRequireAuth.value == true
|
||||||
|
? state.idCardController.text
|
||||||
|
: "");
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.isSendSuccess.value = true;
|
state.isSendSuccess = true;
|
||||||
resetData();
|
resetData();
|
||||||
|
update();
|
||||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||||
} else {
|
} else {
|
||||||
if (entity.errorCode == 425) {
|
if (entity.errorCode == 425) {
|
||||||
//用户未注册
|
//用户未注册
|
||||||
state.isCreateUser.value = true;
|
state.isCreateUser = true;
|
||||||
|
update();
|
||||||
ShowTipView().showIosTipWithContentDialog(
|
ShowTipView().showIosTipWithContentDialog(
|
||||||
'${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', () {
|
'${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', () {
|
||||||
sendElectronicKeyRequest();
|
sendElectronicKeyRequest();
|
||||||
@ -133,6 +137,24 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//检测实名认证是否支持开启
|
||||||
|
Future<void> keyCheckFace() async {
|
||||||
|
AdvancedFunctionRecordEntity entity = await ApiRepository.to.keyCheckFace(
|
||||||
|
countryCode: int.parse(state.countryCode),
|
||||||
|
account: state.emailOrPhoneController.text);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
ShowTipView().showBuyTipWithContentAlert(
|
||||||
|
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
|
||||||
|
sureClick: () {
|
||||||
|
Get.toNamed(Routers.advancedFeaturesWebPage,
|
||||||
|
arguments: {'isShop': false});
|
||||||
|
});
|
||||||
|
} else if (entity.errorCode! == 431) {
|
||||||
|
//431代表改用户没有身份证信息,需要弹出输入身份证信息框
|
||||||
|
state.isRequireAuth.value = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool isPhoneNumber(String input) {
|
bool isPhoneNumber(String input) {
|
||||||
// 手机号正则表达式,这里简化为11位数字
|
// 手机号正则表达式,这里简化为11位数字
|
||||||
final RegExp phoneRegExp = RegExp(r'^\d{11}$');
|
final RegExp phoneRegExp = RegExp(r'^\d{11}$');
|
||||||
@ -146,19 +168,38 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
return emailRegExp.hasMatch(input);
|
return emailRegExp.hasMatch(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextEditingController getCurrentController(int lineIndex) {
|
||||||
|
TextEditingController currentController = TextEditingController();
|
||||||
|
switch (lineIndex) {
|
||||||
|
case 1:
|
||||||
|
currentController = state.emailOrPhoneController;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
currentController = state.keyNameController;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
currentController = state.realNameController;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
currentController = state.idCardController;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
return currentController;
|
||||||
|
}
|
||||||
|
|
||||||
void resetData() {
|
void resetData() {
|
||||||
state.emailOrPhoneController.text = "";
|
state.emailOrPhoneController.text = "";
|
||||||
state.keyNameController.text = "";
|
state.keyNameController.text = "";
|
||||||
state.timeLimitBeginTime = DateTool()
|
state.timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
DateTime.now().millisecondsSinceEpoch.toString()); // 限时开始时间
|
||||||
.obs; // 限时开始时间
|
state.timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||||
state.timeLimitEndTime = DateTool()
|
DateTime.now().millisecondsSinceEpoch.toString()); // 限时结束时间
|
||||||
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
|
state.cycleBeginTime = ""; // 循环开始时间
|
||||||
.obs; // 限时结束时间
|
state.cycleEndTime = ""; // 循环结束时间
|
||||||
state.cycleBeginTime = "".obs; // 循环开始时间
|
state.effectiveDateTime = ""; // 生效时间
|
||||||
state.cycleEndTime = "".obs; // 循环结束时间
|
state.failureDateTime = ""; // 失效时间
|
||||||
state.effectiveDateTime = "".obs; // 生效时间
|
state.weekdaysList = [];
|
||||||
state.failureDateTime = "".obs; // 失效时间
|
update();
|
||||||
state.weekdaysList = [].obs;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,6 @@ import 'package:star_lock/tools/pickers/pickers.dart';
|
|||||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
|
||||||
import 'package:star_lock/tools/submitBtn.dart';
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
import 'package:star_lock/translations/trans_lib.dart';
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
|
|
||||||
@ -34,70 +33,69 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
with AutomaticKeepAliveClientMixin {
|
with AutomaticKeepAliveClientMixin {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
super.build(context);
|
||||||
return GetBuilder<SendElectronicKeyViewLogic>(
|
return GetBuilder<SendElectronicKeyViewLogic>(
|
||||||
tag: widget.type,
|
tag: widget.type,
|
||||||
init: SendElectronicKeyViewLogic(widget.type),
|
init: SendElectronicKeyViewLogic(widget.type),
|
||||||
builder: (SendElectronicKeyViewLogic logic) {
|
builder: (SendElectronicKeyViewLogic logic) {
|
||||||
return Obx(() {
|
if (logic.state.isSendSuccess == true) {
|
||||||
if (logic.state.isSendSuccess.value == true) {
|
return sendElectronicKeySucceed(logic);
|
||||||
return sendElectronicKeySucceed(logic);
|
} else {
|
||||||
} else {
|
switch (widget.type) {
|
||||||
switch (widget.type) {
|
case '0':
|
||||||
case '0':
|
// 限时
|
||||||
// 限时
|
return SingleChildScrollView(
|
||||||
return SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
keyInfoWidget(logic),
|
||||||
keyInfoWidget(logic),
|
keyTimeWidget(logic),
|
||||||
keyTimeWidget(logic),
|
remoteUnlockingWidget(logic),
|
||||||
remoteUnlockingWidget(logic),
|
keyRealNameWidget(logic),
|
||||||
keyRealNameWidget(logic),
|
keyBottomWidget(logic.state.timeLimitTips, logic)
|
||||||
keyBottomWidget(logic.state.timeLimitTips, logic)
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
case '1':
|
||||||
case '1':
|
// 永久
|
||||||
// 永久
|
return SingleChildScrollView(
|
||||||
return SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
keyInfoWidget(logic),
|
||||||
keyInfoWidget(logic),
|
remoteUnlockingWidget(logic),
|
||||||
remoteUnlockingWidget(logic),
|
keyRealNameWidget(logic),
|
||||||
keyRealNameWidget(logic),
|
keyBottomWidget(logic.state.permanentTips, logic)
|
||||||
keyBottomWidget(logic.state.permanentTips, logic)
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
case '2':
|
||||||
case '2':
|
// 单次
|
||||||
// 单次
|
return SingleChildScrollView(
|
||||||
return SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
keyInfoWidget(logic),
|
||||||
keyInfoWidget(logic),
|
remoteUnlockingWidget(logic),
|
||||||
remoteUnlockingWidget(logic),
|
keyRealNameWidget(logic),
|
||||||
keyRealNameWidget(logic),
|
keyBottomWidget(logic.state.onceLimitTips, logic)
|
||||||
keyBottomWidget(logic.state.onceLimitTips, logic)
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
case '3':
|
||||||
case '3':
|
// 循环
|
||||||
// 循环
|
return SingleChildScrollView(
|
||||||
return SingleChildScrollView(
|
child: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
keyInfoWidget(logic),
|
||||||
keyInfoWidget(logic),
|
keyPeriodValidityWidget(logic),
|
||||||
keyPeriodValidityWidget(logic),
|
remoteUnlockingWidget(logic),
|
||||||
remoteUnlockingWidget(logic),
|
keyRealNameWidget(logic),
|
||||||
keyRealNameWidget(logic),
|
keyBottomWidget(logic.state.cycleLimitTips, logic)
|
||||||
keyBottomWidget(logic.state.cycleLimitTips, logic)
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
default:
|
||||||
default:
|
return Container();
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +121,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
rightWidget: Text(
|
rightWidget: Text(
|
||||||
'${logic.state.countryName.value} +${logic.state.countryCode.value}',
|
'${logic.state.countryName} +${logic.state.countryCode}',
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
style:
|
style:
|
||||||
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
@ -133,8 +131,9 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
context, Routers.selectCountryRegionPage);
|
context, Routers.selectCountryRegionPage);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
result as Map<String, dynamic>;
|
result as Map<String, dynamic>;
|
||||||
logic.state.countryCode.value = result['code'];
|
logic.state.countryCode = result['code'];
|
||||||
logic.state.countryName.value = result['countryName'];
|
logic.state.countryName = result['countryName'];
|
||||||
|
logic.update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -153,33 +152,35 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
Widget keyTimeWidget(SendElectronicKeyViewLogic logic) {
|
Widget keyTimeWidget(SendElectronicKeyViewLogic logic) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
rightTitle: logic.state.timeLimitBeginTime.value,
|
rightTitle: logic.state.timeLimitBeginTime,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
PDuration selectDate = PDuration.parse(
|
PDuration selectDate = PDuration.parse(
|
||||||
DateTime.parse(logic.state.timeLimitBeginTime.value));
|
DateTime.parse(logic.state.timeLimitBeginTime));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||||
logic.state.timeLimitBeginTime.value =
|
logic.state.timeLimitBeginTime =
|
||||||
DateTool().getYMDHNDateString(p, 1);
|
DateTool().getYMDHNDateString(p, 1);
|
||||||
|
logic.update();
|
||||||
});
|
});
|
||||||
})),
|
}),
|
||||||
Obx(() => CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
rightTitle: logic.state.timeLimitEndTime.value,
|
rightTitle: logic.state.timeLimitEndTime,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
PDuration selectDate = PDuration.parse(
|
PDuration selectDate = PDuration.parse(
|
||||||
DateTime.tryParse(logic.state.timeLimitEndTime.value));
|
DateTime.tryParse(logic.state.timeLimitEndTime));
|
||||||
Pickers.showDatePicker(context,
|
Pickers.showDatePicker(context,
|
||||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||||
logic.state.timeLimitEndTime.value =
|
logic.state.timeLimitEndTime =
|
||||||
DateTool().getYMDHNDateString(p, 1);
|
DateTool().getYMDHNDateString(p, 1);
|
||||||
|
logic.update();
|
||||||
});
|
});
|
||||||
})),
|
}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -189,18 +190,37 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
Widget keyRealNameWidget(SendElectronicKeyViewLogic logic) {
|
Widget keyRealNameWidget(SendElectronicKeyViewLogic logic) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isTipsImg: true,
|
isTipsImg: true,
|
||||||
tipsImgAction: () {
|
isHaveLine:
|
||||||
ShowTipView().showSureAlertDialog(
|
logic.state.isRequireAuth.value == true ? true : false,
|
||||||
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。".tr);
|
tipsImgAction: () {
|
||||||
},
|
ShowTipView().showSureAlertDialog(
|
||||||
isHaveRightWidget: true,
|
"人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。".tr);
|
||||||
rightWidget: SizedBox(
|
},
|
||||||
width: 60.w, height: 50.h, child: _remoteSwitch(false, logic)),
|
isHaveRightWidget: true,
|
||||||
),
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w,
|
||||||
|
height: 50.h,
|
||||||
|
child: _remoteSwitch(false, logic)),
|
||||||
|
)),
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: logic.state.isRequireAuth.value,
|
||||||
|
child: CommonItem(
|
||||||
|
leftTitel: '真实姓名'.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
isHaveLine: true,
|
||||||
|
rightWidget: getTFWidget(false, '请输入真实姓名'.tr, 3, logic)))),
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: logic.state.isRequireAuth.value,
|
||||||
|
child: CommonItem(
|
||||||
|
leftTitel: '身份证号'.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: getTFWidget(false, '请输入身份证号'.tr, 4, logic)))),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -209,30 +229,31 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
Widget keyPeriodValidityWidget(SendElectronicKeyViewLogic logic) {
|
Widget keyPeriodValidityWidget(SendElectronicKeyViewLogic logic) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${logic.state.cycleBeginTime.value}\n${logic.state.cycleEndTime.value}",
|
"${logic.state.cycleBeginTime}\n${logic.state.cycleEndTime}",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result =
|
var result =
|
||||||
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||||
'validityValue': logic.state.weekdaysList,
|
'validityValue': logic.state.weekdaysList,
|
||||||
'starDate': logic.state.cycleBeginTime.value,
|
'starDate': logic.state.cycleBeginTime,
|
||||||
'endDate': logic.state.cycleEndTime.value,
|
'endDate': logic.state.cycleEndTime,
|
||||||
'starTime': logic.state.effectiveDateTime.value,
|
'starTime': logic.state.effectiveDateTime,
|
||||||
'endTime': logic.state.failureDateTime.value
|
'endTime': logic.state.failureDateTime
|
||||||
});
|
});
|
||||||
if (result != null && result.isNotEmpty) {
|
if (result != null && result.isNotEmpty) {
|
||||||
logic.state.weekdaysList.value = result['validityValue'];
|
logic.state.weekdaysList = result['validityValue'];
|
||||||
logic.state.cycleBeginTime.value = result['starDate'];
|
logic.state.cycleBeginTime = result['starDate'];
|
||||||
logic.state.cycleEndTime.value = result['endDate'];
|
logic.state.cycleEndTime = result['endDate'];
|
||||||
logic.state.effectiveDateTime.value = result['starTime'];
|
logic.state.effectiveDateTime = result['starTime'];
|
||||||
logic.state.failureDateTime.value = result['endTime'];
|
logic.state.failureDateTime = result['endTime'];
|
||||||
|
logic.update();
|
||||||
}
|
}
|
||||||
})),
|
}),
|
||||||
Obx(() => Visibility(
|
Visibility(
|
||||||
visible: logic.state.weekdaysList.isNotEmpty ? true : false,
|
visible: logic.state.weekdaysList.isNotEmpty ? true : false,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效日".tr,
|
leftTitel: "有效日".tr,
|
||||||
@ -243,43 +264,45 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||||
arguments: {
|
arguments: {
|
||||||
'validityValue': logic.state.weekdaysList,
|
'validityValue': logic.state.weekdaysList,
|
||||||
'starDate': logic.state.cycleBeginTime.value,
|
'starDate': logic.state.cycleBeginTime,
|
||||||
'endDate': logic.state.cycleEndTime.value,
|
'endDate': logic.state.cycleEndTime,
|
||||||
'starTime': logic.state.effectiveDateTime.value,
|
'starTime': logic.state.effectiveDateTime,
|
||||||
'endTime': logic.state.failureDateTime.value
|
'endTime': logic.state.failureDateTime
|
||||||
});
|
});
|
||||||
if (result != null && result.isNotEmpty) {
|
if (result != null && result.isNotEmpty) {
|
||||||
logic.state.weekdaysList.value = result['validityValue'];
|
logic.state.weekdaysList = result['validityValue'];
|
||||||
logic.state.cycleBeginTime.value = result['starDate'];
|
logic.state.cycleBeginTime = result['starDate'];
|
||||||
logic.state.cycleEndTime.value = result['endDate'];
|
logic.state.cycleEndTime = result['endDate'];
|
||||||
logic.state.effectiveDateTime.value = result['starTime'];
|
logic.state.effectiveDateTime = result['starTime'];
|
||||||
logic.state.failureDateTime.value = result['endTime'];
|
logic.state.failureDateTime = result['endTime'];
|
||||||
|
logic.update();
|
||||||
}
|
}
|
||||||
}))),
|
})),
|
||||||
Obx(() => Visibility(
|
Visibility(
|
||||||
visible: logic.state.effectiveDateTime.value.isNotEmpty,
|
visible: logic.state.effectiveDateTime.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效时间".tr,
|
leftTitel: "有效时间".tr,
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${logic.state.effectiveDateTime.value}-${logic.state.failureDateTime.value}",
|
"${logic.state.effectiveDateTime}-${logic.state.failureDateTime}",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||||
arguments: {
|
arguments: {
|
||||||
'validityValue': logic.state.weekdaysList,
|
'validityValue': logic.state.weekdaysList,
|
||||||
'starDate': logic.state.cycleBeginTime.value,
|
'starDate': logic.state.cycleBeginTime,
|
||||||
'endDate': logic.state.cycleEndTime.value,
|
'endDate': logic.state.cycleEndTime,
|
||||||
'starTime': logic.state.effectiveDateTime.value,
|
'starTime': logic.state.effectiveDateTime,
|
||||||
'endTime': logic.state.failureDateTime.value
|
'endTime': logic.state.failureDateTime
|
||||||
});
|
});
|
||||||
if (result != null && result.isNotEmpty) {
|
if (result != null && result.isNotEmpty) {
|
||||||
logic.state.weekdaysList.value = result['validityValue'];
|
logic.state.weekdaysList = result['validityValue'];
|
||||||
logic.state.cycleBeginTime.value = result['starDate'];
|
logic.state.cycleBeginTime = result['starDate'];
|
||||||
logic.state.cycleEndTime.value = result['endDate'];
|
logic.state.cycleEndTime = result['endDate'];
|
||||||
logic.state.effectiveDateTime.value = result['starTime'];
|
logic.state.effectiveDateTime = result['starTime'];
|
||||||
logic.state.failureDateTime.value = result['endTime'];
|
logic.state.failureDateTime = result['endTime'];
|
||||||
|
logic.update();
|
||||||
}
|
}
|
||||||
}))),
|
})),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -291,7 +314,6 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(20.w),
|
padding: EdgeInsets.all(20.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -316,7 +338,6 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
}),
|
}),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(right: 30.w),
|
padding: EdgeInsets.only(right: 30.w),
|
||||||
// color: Colors.red,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
@ -384,8 +405,9 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: '完成'.tr,
|
btnName: '完成'.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
logic.state.isSendSuccess.value = false;
|
logic.state.isSendSuccess = false;
|
||||||
logic.resetData();
|
logic.resetData();
|
||||||
|
logic.update();
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -424,9 +446,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: lineIndex == 1
|
controller: logic.getCurrentController(lineIndex),
|
||||||
? logic.state.emailOrPhoneController
|
|
||||||
: logic.state.keyNameController,
|
|
||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
inputFormatters: <TextInputFormatter>[
|
inputFormatters: <TextInputFormatter>[
|
||||||
@ -525,22 +545,17 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: isRemote
|
value:
|
||||||
? logic.state.isRemoteUnlock.value
|
isRemote ? logic.state.isRemoteUnlock : logic.state.isAuthentication,
|
||||||
: logic.state.isAuthentication.value,
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (isRemote) {
|
if (isRemote) {
|
||||||
logic.state.isRemoteUnlock.value = !logic.state.isRemoteUnlock.value;
|
logic.state.isRemoteUnlock = !logic.state.isRemoteUnlock;
|
||||||
} else {
|
} else {
|
||||||
logic.state.isAuthentication.value =
|
logic.state.isAuthentication = !logic.state.isAuthentication;
|
||||||
!logic.state.isAuthentication.value;
|
if (logic.state.isAuthentication) {
|
||||||
if (logic.state.isAuthentication.value) {
|
logic.keyCheckFace();
|
||||||
ShowTipView().showBuyTipWithContentAlert(
|
} else {
|
||||||
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
|
logic.state.isRequireAuth.value = false;
|
||||||
sureClick: () {
|
|
||||||
Get.toNamed(Routers.advancedFeaturesWebPage,
|
|
||||||
arguments: {'isShop': false});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3,34 +3,38 @@ import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
|
||||||
|
|
||||||
class SendElectronicKeyViewState {
|
class SendElectronicKeyViewState {
|
||||||
TextEditingController emailOrPhoneController = TextEditingController(); //邮箱/手机号输入框
|
TextEditingController emailOrPhoneController =
|
||||||
|
TextEditingController(); //邮箱/手机号输入框
|
||||||
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
||||||
|
TextEditingController realNameController = TextEditingController(); //真实姓名输入框
|
||||||
|
TextEditingController idCardController = TextEditingController(); //身份证号输入框
|
||||||
|
|
||||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||||
late Contact contact;
|
late Contact contact;
|
||||||
|
|
||||||
final isRemoteUnlock = false.obs; //是否允许远程开锁
|
bool isRemoteUnlock = false; //是否允许远程开锁
|
||||||
final isAuthentication = false.obs; //是否可以实名认证
|
bool isAuthentication = false; //是否可以实名认证
|
||||||
|
|
||||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时开始时间
|
var timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||||
var timeLimitEndTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;// 限时结束时间
|
DateTime.now().millisecondsSinceEpoch.toString()); // 限时开始时间
|
||||||
var cycleBeginTime = "".obs;// 循环开始时间
|
var timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||||
var cycleEndTime = "".obs;// 循环结束时间
|
DateTime.now().millisecondsSinceEpoch.toString()); // 限时结束时间
|
||||||
var effectiveDateTime = "".obs;// 生效时间
|
var cycleBeginTime = ""; // 循环开始时间
|
||||||
var failureDateTime = "".obs;// 失效时间
|
var cycleEndTime = ""; // 循环结束时间
|
||||||
var weekdaysList = [].obs;
|
var effectiveDateTime = ""; // 生效时间
|
||||||
|
var failureDateTime = ""; // 失效时间
|
||||||
|
var weekdaysList = [];
|
||||||
|
|
||||||
var isSendSuccess = false.obs;
|
var isSendSuccess = false;
|
||||||
var countryName = '中国'.tr.obs;
|
var countryName = '中国'.tr;
|
||||||
var countryCode = '86'.obs;
|
var countryCode = '86';
|
||||||
var isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
var isCreateUser = false; //用户未注册时传1 已注册传0
|
||||||
var isDemoMode = false;
|
var isDemoMode = false;
|
||||||
|
var isRequireAuth = false.obs; //是否需要实名认证的必填项
|
||||||
|
|
||||||
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||||
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||||
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||||
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
@ -11,13 +11,12 @@ class GroupEditLockLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//锁分组里面添加锁
|
//锁分组里面添加锁
|
||||||
Future<void> lockGroupAddLock(List lockIds) async {
|
Future<void> lockGroupAddLock(List lockIds) async {
|
||||||
if(lockIds.isEmpty){
|
if (lockIds.isEmpty) {
|
||||||
showToast("请选择锁".tr);
|
showToast("请选择锁".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var entity = await ApiRepository.to.lockGroupAddLock(
|
var entity = await ApiRepository.to.lockGroupAddLock(
|
||||||
lockIds: lockIds,
|
lockIds: lockIds, groupId: state.selectGroupListItem.keyGroupId!);
|
||||||
groupId: state.selectGroupListItem.keyGroupId!);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("添加成功");
|
showToast("添加成功");
|
||||||
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
||||||
@ -28,7 +27,7 @@ class GroupEditLockLogic extends BaseGetXController {
|
|||||||
|
|
||||||
//锁分组里面添加锁
|
//锁分组里面添加锁
|
||||||
Future<void> lockGroupDeletLock(List lockIds) async {
|
Future<void> lockGroupDeletLock(List lockIds) async {
|
||||||
if(lockIds.isEmpty){
|
if (lockIds.isEmpty) {
|
||||||
showToast("请选择锁".tr);
|
showToast("请选择锁".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -41,4 +40,11 @@ class GroupEditLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
onReady() async {
|
||||||
|
super.onReady();
|
||||||
|
|
||||||
|
var isVip = await Storage.getBool(saveIsVip);
|
||||||
|
state.isVip.value = isVip ?? false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||||
|
import 'package:star_lock/tools/advancedFunctionHandle.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
|
||||||
import '../../../../../../app_settings/app_colors.dart';
|
import '../../../../../../app_settings/app_colors.dart';
|
||||||
@ -26,61 +27,78 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: state.type == 0 ? TranslationLoader.lanKeys!.add!.tr : TranslationLoader.lanKeys!.delete!.tr,
|
barTitle: state.type == 0
|
||||||
|
? TranslationLoader.lanKeys!.add!.tr
|
||||||
|
: TranslationLoader.lanKeys!.delete!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: state.isVip.value ? false : true,
|
||||||
|
child: AdvancedFunctionHandle()
|
||||||
|
.topTipsAdvancedFeatures('开通高级功能后才可以对锁进行管理'.tr))),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.all(15.w),
|
margin: EdgeInsets.all(15.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(TranslationLoader.lanKeys!.selectTheLockToJoinTheGroup!.tr, style: TextStyle(fontSize: 25.sp)),
|
Text(
|
||||||
|
TranslationLoader
|
||||||
|
.lanKeys!.selectTheLockToJoinTheGroup!.tr,
|
||||||
|
style: TextStyle(fontSize: 25.sp)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () async {
|
Obx(() => Visibility(
|
||||||
var idList = [];
|
visible: state.isVip.value ? true : false,
|
||||||
for(int i = 0; i<state.lockList.length; i++){
|
child: SubmitBtn(
|
||||||
LockListItem lockListItem = state.lockList[i];
|
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
||||||
if(lockListItem.isChecked == true){
|
onClick: () async {
|
||||||
idList.add(lockListItem.lockId);
|
var idList = [];
|
||||||
}
|
for (int i = 0; i < state.lockList.length; i++) {
|
||||||
}
|
LockListItem lockListItem = state.lockList[i];
|
||||||
if(state.type == 0){
|
if (lockListItem.isChecked == true) {
|
||||||
// 添加
|
idList.add(lockListItem.lockId);
|
||||||
logic.lockGroupAddLock(idList);
|
}
|
||||||
}else if(state.type == 1){
|
}
|
||||||
// 删除
|
if (state.type == 0) {
|
||||||
logic.lockGroupDeletLock(idList);
|
// 添加
|
||||||
}
|
logic.lockGroupAddLock(idList);
|
||||||
}),
|
} else if (state.type == 1) {
|
||||||
|
// 删除
|
||||||
|
logic.lockGroupDeletLock(idList);
|
||||||
|
}
|
||||||
|
}))),
|
||||||
SizedBox(height: 20.h)
|
SizedBox(height: 20.h)
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMainUI(){
|
Widget _buildMainUI() {
|
||||||
return state.lockList.isNotEmpty
|
return state.lockList.isNotEmpty
|
||||||
? ListView.separated(
|
? ListView.separated(
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
LockListItem itemData = state.lockList[index];
|
LockListItem itemData = state.lockList[index];
|
||||||
return _listItemView(itemData);
|
return _listItemView(itemData);
|
||||||
},
|
},
|
||||||
itemCount: state.lockList.length,
|
itemCount: state.lockList.length,
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
return Divider(
|
return Divider(
|
||||||
height: 1.h,
|
height: 1.h,
|
||||||
color: AppColors.greyLineColor,
|
color: AppColors.greyLineColor,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
) : NoData();
|
)
|
||||||
|
: NoData();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _listItemView(LockListItem itemData) {
|
Widget _listItemView(LockListItem itemData) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: (){
|
onTap: () {
|
||||||
|
if (!state.isVip.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
itemData.isChecked = !itemData.isChecked;
|
itemData.isChecked = !itemData.isChecked;
|
||||||
});
|
});
|
||||||
@ -92,9 +110,18 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 20.w,),
|
SizedBox(
|
||||||
Image.asset('images/icon_lockGroup_item.png', width: 36, height: 36, fit: BoxFit.fill,),
|
width: 20.w,
|
||||||
SizedBox(width: 10.w,),
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/icon_lockGroup_item.png',
|
||||||
|
width: 36,
|
||||||
|
height: 36,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
itemData.lockAlias ?? '',
|
itemData.lockAlias ?? '',
|
||||||
style: TextStyle(fontSize: 24.sp),
|
style: TextStyle(fontSize: 24.sp),
|
||||||
@ -113,5 +140,4 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,24 +1,25 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||||
|
|
||||||
class GroupEditLockState {
|
class GroupEditLockState {
|
||||||
var lockList = <LockListItem>[];
|
var lockList = <LockListItem>[];
|
||||||
var type = 0;// 0添加 1删除
|
var type = 0; // 0添加 1删除
|
||||||
var selectGroupListItem = GroupListItem();
|
var selectGroupListItem = GroupListItem();
|
||||||
var ungrouped = GroupListItem();
|
var ungrouped = GroupListItem();
|
||||||
|
var isVip = false.obs;
|
||||||
|
|
||||||
GroupEditLockState() {
|
GroupEditLockState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
type = map["type"];
|
type = map["type"];
|
||||||
selectGroupListItem = map["groupListItem"];
|
selectGroupListItem = map["groupListItem"];
|
||||||
ungrouped = map["ungrouped"];
|
ungrouped = map["ungrouped"];
|
||||||
if(type == 0){
|
if (type == 0) {
|
||||||
lockList = ungrouped.lockList!;
|
lockList = ungrouped.lockList!;
|
||||||
}else{
|
} else {
|
||||||
lockList = selectGroupListItem.lockList!;
|
lockList = selectGroupListItem.lockList!;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i<lockList.length; i++){
|
for (int i = 0; i < lockList.length; i++) {
|
||||||
LockListItem lockListItem = lockList[i];
|
LockListItem lockListItem = lockList[i];
|
||||||
lockListItem.isChecked = false;
|
lockListItem.isChecked = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,12 +43,17 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
|||||||
// 处理操作按钮的点击事件-添加锁分组
|
// 处理操作按钮的点击事件-添加锁分组
|
||||||
state.changeNameController.text = "";
|
state.changeNameController.text = "";
|
||||||
// showCupertinoAlertDialog(context, true, 0);
|
// showCupertinoAlertDialog(context, true, 0);
|
||||||
ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, TranslationLoader.lanKeys!.pleaseEnter!.tr, (){
|
ShowTipView().showTFViewAlertDialog(
|
||||||
|
state.changeNameController,
|
||||||
|
TranslationLoader.lanKeys!.createNewGroup!.tr,
|
||||||
|
TranslationLoader.lanKeys!.pleaseEnter!.tr, () {
|
||||||
//发送编辑钥匙名称请求
|
//发送编辑钥匙名称请求
|
||||||
if (state.changeNameController.text.isNotEmpty) {
|
if (state.changeNameController.text.isNotEmpty) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
logic.addLockGroupRequest();
|
logic.addLockGroupRequest();
|
||||||
} else {
|
} else {
|
||||||
logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
logic.showToast(
|
||||||
|
TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -57,7 +62,10 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
|||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Obx(() => state.itemDataList.value.isEmpty ? NoData(): _buildMainUI())),
|
Expanded(
|
||||||
|
child: Obx(() => state.itemDataList.value.isEmpty
|
||||||
|
? NoData()
|
||||||
|
: _buildMainUI())),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -81,7 +89,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
child: Text(
|
child: Text(
|
||||||
'${TranslationLoader.lanKeys!.lockTrCount!.tr}:${state.lockNum.toString()}',
|
'${TranslationLoader.lanKeys!.lockTrCount!.tr}:${state.lockNum.toString()}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
),
|
),
|
||||||
@ -91,28 +99,32 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
GroupListItem itemData = state.itemDataList.value[index];
|
GroupListItem itemData = state.itemDataList.value[index];
|
||||||
if(itemData.groupType == 0){
|
if (itemData.groupType == 0) {
|
||||||
state.ungrouped = itemData;
|
state.ungrouped = itemData;
|
||||||
}
|
}
|
||||||
if (index < state.itemDataList.value.length) {
|
if (index < state.itemDataList.value.length) {
|
||||||
return LeftSlideActions(
|
return LeftSlideActions(
|
||||||
key: Key(itemData.keyGroupId!.toString()),
|
key: Key(itemData.keyGroupId!.toString()),
|
||||||
actionsWidth: itemData.groupType != 0 ? 200.w : 0,
|
actionsWidth: itemData.groupType != 0 ? 200.w : 0,
|
||||||
actions: itemData.groupType != 0 ? [
|
actions: itemData.groupType != 0
|
||||||
_buildEditBtn(itemData),
|
? [
|
||||||
_buildDeleteBtn(itemData),
|
_buildEditBtn(itemData),
|
||||||
] : [],
|
_buildDeleteBtn(itemData),
|
||||||
|
]
|
||||||
|
: [],
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||||
),
|
),
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel:
|
leftTitel:
|
||||||
'${itemData.keyGroupName}(${itemData.lockList?.length})',
|
'${itemData.keyGroupName}(${itemData.lockList?.length})',
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
allHeight: 70.h,
|
allHeight: 70.h,
|
||||||
action: () {
|
action: () {
|
||||||
|
Get.toNamed(Routers.lockItemListPage, arguments: {
|
||||||
Get.toNamed(Routers.lockItemListPage, arguments: {'groupListItem': itemData, "ungrouped": state.ungrouped});
|
'groupListItem': itemData,
|
||||||
|
"ungrouped": state.ungrouped
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -161,7 +173,7 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
// 省略: 弹出是否删除的确认对话框。
|
// 省略: 弹出是否删除的确认对话框。
|
||||||
// showIosTipViewDialog(context, groupListItem);
|
// showIosTipViewDialog(context, groupListItem);
|
||||||
ShowTipView().showIosTipWithContentDialog("分组下的锁将被移到未分组里".tr, (){
|
ShowTipView().showIosTipWithContentDialog("分组下的锁将被移到未分组里".tr, () {
|
||||||
logic.deleteLockGroupRequest(groupListItem.keyGroupId!);
|
logic.deleteLockGroupRequest(groupListItem.keyGroupId!);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -189,11 +201,15 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
|||||||
state.changeNameController.text = groupListItem.keyGroupName!;
|
state.changeNameController.text = groupListItem.keyGroupName!;
|
||||||
// showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!);
|
// showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!);
|
||||||
|
|
||||||
ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, TranslationLoader.lanKeys!.pleaseEnter!.tr, (){
|
ShowTipView().showTFViewAlertDialog(
|
||||||
|
state.changeNameController,
|
||||||
|
TranslationLoader.lanKeys!.createNewGroup!.tr,
|
||||||
|
TranslationLoader.lanKeys!.pleaseEnter!.tr, () {
|
||||||
if (state.changeNameController.text.isNotEmpty) {
|
if (state.changeNameController.text.isNotEmpty) {
|
||||||
logic.editLockGroupRequest(groupListItem.keyGroupId!);
|
logic.editLockGroupRequest(groupListItem.keyGroupId!);
|
||||||
} else {
|
} else {
|
||||||
logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
logic.showToast(
|
||||||
|
TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -232,5 +248,4 @@ class _LockGroupListPageState extends State<LockGroupListPage> {
|
|||||||
// }
|
// }
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/buy_record_list_entity.dart';
|
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_state.dart';
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
@ -29,13 +29,15 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
|||||||
if (!load) {
|
if (!load) {
|
||||||
buyPageNo = 1;
|
buyPageNo = 1;
|
||||||
}
|
}
|
||||||
BuyRecordListEntity entity = await ApiRepository.to.getBuyRecordList(
|
AdvancedFunctionRecordEntity entity =
|
||||||
|
await ApiRepository.to.getBuyRecordList(
|
||||||
type: type,
|
type: type,
|
||||||
recordType: 10,
|
recordType: 10,
|
||||||
pageNo: buyPageNo,
|
pageNo: buyPageNo,
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.buyRecordList.value = entity.data!.buyRecordlist!;
|
state.buyRecordList.value = entity.data!.recordList!;
|
||||||
|
state.buyRecordList.refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:easy_refresh/easy_refresh.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_logic.dart';
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_logic.dart';
|
||||||
import 'package:star_lock/tools/noData.dart';
|
import 'package:star_lock/tools/noData.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
@ -41,16 +42,16 @@ class _ValueAddedServicesRealNamePageState
|
|||||||
labelColor: AppColors.mainColor,
|
labelColor: AppColors.mainColor,
|
||||||
unselectedLabelColor: AppColors.darkGrayTextColor,
|
unselectedLabelColor: AppColors.darkGrayTextColor,
|
||||||
),
|
),
|
||||||
Expanded(
|
Obx(() => Expanded(
|
||||||
child: TabBarView(children: [
|
child: TabBarView(children: [
|
||||||
_PurchaseRecords(
|
_PurchaseRecords(
|
||||||
getRecordList: logic.state.buyRecordList.value,
|
getRecordList: logic.state.buyRecordList.value,
|
||||||
),
|
),
|
||||||
_PurchaseRecords(
|
_PurchaseRecords(
|
||||||
getRecordList: logic.state.useRecordList.value,
|
getRecordList: logic.state.useRecordList.value,
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -91,10 +92,54 @@ class _PurchaseRecordsState extends State<_PurchaseRecords> {
|
|||||||
? ListView.builder(
|
? ListView.builder(
|
||||||
itemCount: widget.getRecordList.length,
|
itemCount: widget.getRecordList.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return const SizedBox();
|
return _recordKeyItem(widget.getRecordList[index]);
|
||||||
})
|
})
|
||||||
: NoData(),
|
: NoData(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _recordKeyItem(RecordItem itemData) {
|
||||||
|
return Container(
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h),
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(left: 20.w, right: 20.w, top: 16.h, bottom: 16.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
itemData.createdAt!.length > 10
|
||||||
|
? itemData.createdAt!.substring(0, 10)
|
||||||
|
: itemData.createdAt!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
|
color: AppColors.blackColor,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Expanded(child: Container()),
|
||||||
|
Text('¥${itemData.amount}',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
|
color: AppColors.blackColor,
|
||||||
|
fontWeight: FontWeight.bold)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8.h,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text('实名认证/${itemData.cloudauthCount}次',
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22.sp, color: AppColors.darkGrayTextColor))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,6 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
class ValueAddedServicesRecordState {
|
class ValueAddedServicesRecordState {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
var buyRecordList = [].obs;
|
var buyRecordList = [].obs; //购买记录列表
|
||||||
var useRecordList = [].obs;
|
var useRecordList = [].obs; //使用记录列表
|
||||||
}
|
}
|
||||||
|
|||||||
@ -227,4 +227,5 @@ abstract class Api {
|
|||||||
final String deleteLockCloudStorageURL = '/lockCloudStorage/delete'; //删除云存
|
final String deleteLockCloudStorageURL = '/lockCloudStorage/delete'; //删除云存
|
||||||
final String getServiceUserPackageURL =
|
final String getServiceUserPackageURL =
|
||||||
'/v2/service/getUserPackage'; //获取增值服务用户余量包
|
'/v2/service/getUserPackage'; //获取增值服务用户余量包
|
||||||
|
final String isFaceAuthenticationURL = '/key/checkFace'; //检测实名认证是否支持开启
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,7 +142,9 @@ class ApiProvider extends BaseProvider {
|
|||||||
List weekDays,
|
List weekDays,
|
||||||
int startTime,
|
int startTime,
|
||||||
int endTime,
|
int endTime,
|
||||||
int isOnlyManageSelf) =>
|
int isOnlyManageSelf,
|
||||||
|
String realName,
|
||||||
|
String idCardNumber) =>
|
||||||
post(
|
post(
|
||||||
sendElectronicKeyURL.toUrl,
|
sendElectronicKeyURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -165,6 +167,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
'startTime': startTime,
|
'startTime': startTime,
|
||||||
'endTime': endTime,
|
'endTime': endTime,
|
||||||
'isOnlyManageSelf': isOnlyManageSelf,
|
'isOnlyManageSelf': isOnlyManageSelf,
|
||||||
|
'realName': realName,
|
||||||
|
'idCardNumber': idCardNumber
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> uploadElectricQuantity(
|
Future<Response> uploadElectricQuantity(
|
||||||
@ -452,7 +456,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
String startDate,
|
String startDate,
|
||||||
String endDate,
|
String endDate,
|
||||||
String addType,
|
String addType,
|
||||||
int? pwdRight,
|
int? pwdRight,
|
||||||
) =>
|
) =>
|
||||||
post(
|
post(
|
||||||
passwordKeyAddURL.toUrl,
|
passwordKeyAddURL.toUrl,
|
||||||
@ -2026,6 +2030,18 @@ class ApiProvider extends BaseProvider {
|
|||||||
'pageSize': pageSize,
|
'pageSize': pageSize,
|
||||||
'record_type': recordType,
|
'record_type': recordType,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 检测实名认证是否支持开启
|
||||||
|
Future<Response> keyCheckFace(
|
||||||
|
int countryCode,
|
||||||
|
String account,
|
||||||
|
) =>
|
||||||
|
post(
|
||||||
|
isFaceAuthenticationURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'countryCode': countryCode,
|
||||||
|
'account': account,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -179,7 +179,9 @@ class ApiRepository {
|
|||||||
required List weekDays,
|
required List weekDays,
|
||||||
required int startTime,
|
required int startTime,
|
||||||
required int endTime,
|
required int endTime,
|
||||||
required int isOnlyManageSelf}) async {
|
required int isOnlyManageSelf,
|
||||||
|
required String realName,
|
||||||
|
required String idCardNumber}) async {
|
||||||
final res = await apiProvider.sendElectronicKey(
|
final res = await apiProvider.sendElectronicKey(
|
||||||
createUser,
|
createUser,
|
||||||
countryCode,
|
countryCode,
|
||||||
@ -199,7 +201,9 @@ class ApiRepository {
|
|||||||
weekDays,
|
weekDays,
|
||||||
startTime,
|
startTime,
|
||||||
endTime,
|
endTime,
|
||||||
isOnlyManageSelf);
|
isOnlyManageSelf,
|
||||||
|
realName,
|
||||||
|
idCardNumber);
|
||||||
return AuthorizedAdminSendEntity.fromJson(res.body);
|
return AuthorizedAdminSendEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,13 +321,11 @@ class ApiRepository {
|
|||||||
|
|
||||||
//锁电量更新
|
//锁电量更新
|
||||||
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
||||||
{
|
{String? electricQuantity,
|
||||||
String? electricQuantity,
|
String? electricQuantityStandby,
|
||||||
String? electricQuantityStandby,
|
String? lockId}) async {
|
||||||
String? lockId
|
final res = await apiProvider.uploadElectricQuantity(
|
||||||
}) async {
|
electricQuantity!, electricQuantityStandby!, lockId!);
|
||||||
final res =
|
|
||||||
await apiProvider.uploadElectricQuantity(electricQuantity!, electricQuantityStandby!, lockId!);
|
|
||||||
return KeyOperationRecordEntity.fromJson(res.body);
|
return KeyOperationRecordEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,8 +467,7 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//自定义密码
|
//自定义密码
|
||||||
Future<PasswordKeyEntity> addPasswordKey(
|
Future<PasswordKeyEntity> addPasswordKey({
|
||||||
{
|
|
||||||
required String lockId,
|
required String lockId,
|
||||||
required String keyboardPwdName,
|
required String keyboardPwdName,
|
||||||
required String keyboardPwd,
|
required String keyboardPwd,
|
||||||
@ -2012,7 +2013,7 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取使用记录
|
// 获取使用记录
|
||||||
Future<BuyRecordListEntity> getBuyRecordList({
|
Future<AdvancedFunctionRecordEntity> getBuyRecordList({
|
||||||
required String type,
|
required String type,
|
||||||
required int pageNo,
|
required int pageNo,
|
||||||
required int recordType,
|
required int recordType,
|
||||||
@ -2020,7 +2021,7 @@ class ApiRepository {
|
|||||||
}) async {
|
}) async {
|
||||||
final res =
|
final res =
|
||||||
await apiProvider.getBuyRecordList(type, recordType, pageNo, pageSize);
|
await apiProvider.getBuyRecordList(type, recordType, pageNo, pageSize);
|
||||||
return BuyRecordListEntity.fromJson(res.body);
|
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取购买记录
|
// 获取购买记录
|
||||||
@ -2056,4 +2057,13 @@ class ApiRepository {
|
|||||||
type, pageNo, recordType, pageSize);
|
type, pageNo, recordType, pageSize);
|
||||||
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检测实名认证是否支持开启
|
||||||
|
Future<AdvancedFunctionRecordEntity> keyCheckFace({
|
||||||
|
required int countryCode,
|
||||||
|
required String account,
|
||||||
|
}) async {
|
||||||
|
final res = await apiProvider.keyCheckFace(countryCode, account);
|
||||||
|
return AdvancedFunctionRecordEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:star_lock/tools/showTFView.dart';
|
import 'package:star_lock/tools/showTFView.dart';
|
||||||
|
|
||||||
import '../translations/trans_lib.dart';
|
import '../translations/trans_lib.dart';
|
||||||
@ -132,13 +133,17 @@ class ShowTipView {
|
|||||||
title: Text(titleStr),
|
title: Text(titleStr),
|
||||||
actions: [
|
actions: [
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
child: Text(
|
||||||
|
'取消'.tr,
|
||||||
|
style: TextStyle(color: AppColors.mainColor),
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
child: Text('购买'.tr),
|
child:
|
||||||
|
Text('购买'.tr, style: TextStyle(color: AppColors.mainColor)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
sureClick();
|
sureClick();
|
||||||
|
|||||||
@ -170,7 +170,6 @@ dependencies:
|
|||||||
expandable: ^5.0.1
|
expandable: ^5.0.1
|
||||||
colorfilter_generator: ^0.0.8
|
colorfilter_generator: ^0.0.8
|
||||||
file_picker: ^5.3.1
|
file_picker: ^5.3.1
|
||||||
extended_text_field: 13.1.0
|
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user