Merge branch 'release' of https://gitee.com/starlock-cn/app-starlock into release
This commit is contained in:
commit
ad91e4d17a
@ -646,9 +646,9 @@
|
||||
"消息详情": "Message details",
|
||||
"创建时间": "Creation time",
|
||||
"管理员详情": "Administrator details",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using a coercion card will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using a coercion card will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"请不要将胁迫卡用于日常开锁": "Please do not use coercion cards for daily unlocking",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using coercion fingerprints will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using coercion fingerprints will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"请不要将胁迫指纹用于日常开锁": "Please do not use coercion fingerprints for daily unlocking",
|
||||
"创建公司": "Create company",
|
||||
"公司名称不能超过30个字符": "Company name cannot exceed 30 characters",
|
||||
|
||||
@ -671,9 +671,9 @@
|
||||
"消息详情": "消息详情",
|
||||
"创建时间": "创建时间",
|
||||
"管理员详情": "管理员详情",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫卡用于日常开锁": "请不要将胁迫卡用于日常开锁",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫指纹用于日常开锁": "请不要将胁迫指纹用于日常开锁",
|
||||
"创建公司": "创建公司",
|
||||
"公司名称不能超过30个字符": "公司名称不能超过30个字符",
|
||||
|
||||
@ -646,9 +646,9 @@
|
||||
"消息详情": "消息详情",
|
||||
"创建时间": "创建时间",
|
||||
"管理员详情": "管理员详情",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫卡用于日常开锁": "请不要将胁迫卡用于日常开锁",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫指纹用于日常开锁": "请不要将胁迫指纹用于日常开锁",
|
||||
"创建公司": "创建公司",
|
||||
"公司名称不能超过30个字符": "公司名称不能超过30个字符",
|
||||
|
||||
@ -608,7 +608,7 @@
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1430;
|
||||
LastUpgradeCheck = 1510;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1430"
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
40
lib/login/login/app_get_version.dart
Normal file
40
lib/login/login/app_get_version.dart
Normal file
@ -0,0 +1,40 @@
|
||||
class GetAppInfo {
|
||||
GetAppInfo({this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
GetAppInfo.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
if (json['data'] is Map) {
|
||||
data = Data.fromJson(json['data']);
|
||||
}
|
||||
}
|
||||
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
data['data'] = this.data;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
wechatServiceUrl = json['wechat_service_url'];
|
||||
}
|
||||
|
||||
String? wechatServiceUrl;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['wechat_service_url'] = wechatServiceUrl;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
@ -35,6 +36,12 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
haveBack: false,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: [
|
||||
const IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: Colors.white,
|
||||
)),
|
||||
TextButton(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.register!.tr,
|
||||
@ -239,22 +246,24 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
child: SizedBox(
|
||||
width: 10.sp,
|
||||
)),
|
||||
if (F.isLite) Container() else GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text('演示模式'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp,
|
||||
color: AppColors.mainColor)),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||
},
|
||||
)
|
||||
if (F.isLite)
|
||||
Container()
|
||||
else
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text('演示模式'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.mainColor)),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_state.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
@ -33,7 +36,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
top: 120.h,
|
||||
top: 110.h,
|
||||
),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
@ -41,12 +44,24 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'${"欢迎使用".tr}${F.title}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 48.sp,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${"欢迎使用".tr}${F.title}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 48.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: CustomerTool.openCustomerService,
|
||||
icon: Icon(
|
||||
Icons.support_agent,
|
||||
color: AppColors.mainColor,
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
GestureDetector(
|
||||
|
||||
@ -197,7 +197,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
required String endTime}) async {
|
||||
final AuthorizedAdminSendEntity entity = await ApiRepository.to
|
||||
.sendElectronicKey(
|
||||
createUser: state.isCreateUser.value ? '1' : '0',
|
||||
createUser: state.createUser.value,
|
||||
countryCode: state.countryCode.value,
|
||||
usernameType: '1',
|
||||
endDate: int.parse(endDate),
|
||||
@ -224,18 +224,20 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
? state.idCardController.text
|
||||
: '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.isCreateUser.value = false;
|
||||
state.createUser.value = 0;
|
||||
state.isSendSuccess.value = true;
|
||||
state.addUserId.value = entity.data!.receiverUser!.id.toString();
|
||||
keyId = entity.data!.keyId;
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
} else {
|
||||
//用户未注册
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
update();
|
||||
ShowTipView().showIosTipWithContentDialog(
|
||||
'${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}',
|
||||
sendElectronicKeyRequest);
|
||||
'${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', () {
|
||||
state.createUser.value = 1;
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ class AuthorizedAdminState {
|
||||
RxString countryName = '中国'.obs;
|
||||
RxString countryCode = '86'.obs;
|
||||
RxList weekdaysList = [].obs;
|
||||
RxBool isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
||||
RxInt createUser = 0.obs; //用户未注册时传1 已注册传0
|
||||
|
||||
RxInt seletType = 0.obs;
|
||||
String pwdShareStr = '您好,您的授权管理员生成成功';
|
||||
|
||||
@ -281,7 +281,7 @@ class _AddCardPageState extends State<AddCardPage>
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 20.h),
|
||||
child: Text(
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫卡用于日常开锁".tr}",
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息会推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫卡用于日常开锁".tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
)),
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.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';
|
||||
@ -16,40 +16,39 @@ import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
SendElectronicKeyViewLogic(this.type);
|
||||
String type;
|
||||
final SendElectronicKeyViewState state = SendElectronicKeyViewState();
|
||||
|
||||
SendElectronicKeyViewLogic(this.type);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
Storage.getBool(ifIsDemoModeOrNot)
|
||||
.then((value) => state.isDemoMode = value ?? false);
|
||||
.then((bool? value) => state.isDemoMode = value ?? false);
|
||||
}
|
||||
|
||||
//发送钥匙请求
|
||||
Future<void> sendElectronicKeyRequest() async {
|
||||
if (state.emailOrPhoneController.text.isEmpty) {
|
||||
showToast("请输入接收者账号".tr);
|
||||
showToast('请输入接收者账号'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
var startDate = "0";
|
||||
var endDate = "0";
|
||||
var startTime = "0";
|
||||
var endTime = "0";
|
||||
var startDate = '0';
|
||||
var endDate = '0';
|
||||
var startTime = '0';
|
||||
var endTime = '0';
|
||||
int typeValue;
|
||||
switch (type) {
|
||||
case '0':
|
||||
// 限时
|
||||
if (state.timeLimitBeginTime.isEmpty) {
|
||||
showToast("请选择开始时间".tr);
|
||||
showToast('请选择开始时间'.tr);
|
||||
return;
|
||||
}
|
||||
if (state.timeLimitEndTime.isEmpty) {
|
||||
showToast("请选择结束时间".tr);
|
||||
showToast('请选择结束时间'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -58,11 +57,11 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
DateTool().dateToTimestamp(state.timeLimitBeginTime, 1).toString();
|
||||
endDate =
|
||||
DateTool().dateToTimestamp(state.timeLimitEndTime, 1).toString();
|
||||
startTime = "0";
|
||||
endTime = "0";
|
||||
startTime = '0';
|
||||
endTime = '0';
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
showToast('失效时间要大于生效时间'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -76,7 +75,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
case '3':
|
||||
typeValue = XSConstantMacro.keyTypeLoop;
|
||||
if (state.cycleBeginTime.isEmpty) {
|
||||
showToast("请选择有效期".tr);
|
||||
showToast('请选择有效期'.tr);
|
||||
return;
|
||||
}
|
||||
startDate =
|
||||
@ -96,12 +95,12 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
//如果打开了实名认证,需要弹出输入身份证信息框
|
||||
if (state.isAuthentication.value == true) {
|
||||
if (state.realNameController.text.isEmpty) {
|
||||
showToast("请输入真实姓名".tr);
|
||||
showToast('请输入真实姓名'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.idCardController.text.isEmpty) {
|
||||
showToast("请输入身份证号".tr);
|
||||
showToast('请输入身份证号'.tr);
|
||||
return;
|
||||
}
|
||||
//弹出身份证信息确认框
|
||||
@ -137,37 +136,40 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
required int typeValue,
|
||||
required String getKeyType,
|
||||
}) async {
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
createUser: state.isCreateUser == true ? "1" : "0",
|
||||
countryCode: state.countryCode,
|
||||
usernameType: RegularExpression()
|
||||
.isPhoneNumber(state.emailOrPhoneController.text) ==
|
||||
true
|
||||
? '1'
|
||||
: '2',
|
||||
endDate: int.parse(endDate),
|
||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '0',
|
||||
keyType: getKeyType,
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId.toString(),
|
||||
operatorUid: '',
|
||||
receiverUsername: state.emailOrPhoneController.text,
|
||||
remarks: '',
|
||||
startDate: int.parse(startDate),
|
||||
weekDays: state.weekdaysList,
|
||||
startTime: int.parse(startTime),
|
||||
endTime: int.parse(endTime),
|
||||
isOnlyManageSelf: 0,
|
||||
realName: state.isRequireAuth.value == true
|
||||
? state.realNameController.text
|
||||
: "",
|
||||
idCardNumber: state.isRequireAuth.value == true
|
||||
? state.idCardController.text
|
||||
: "");
|
||||
final AuthorizedAdminSendEntity entity = await ApiRepository.to
|
||||
.sendElectronicKey(
|
||||
createUser: state.createUser.value,
|
||||
countryCode: state.countryCode,
|
||||
usernameType: RegularExpression()
|
||||
.isPhoneNumber(state.emailOrPhoneController.text) ==
|
||||
true
|
||||
? '1'
|
||||
: '2',
|
||||
endDate: int.parse(endDate),
|
||||
faceAuthentication:
|
||||
state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '0',
|
||||
keyType: getKeyType,
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId.toString(),
|
||||
operatorUid: '',
|
||||
receiverUsername: state.emailOrPhoneController.text,
|
||||
remarks: '',
|
||||
startDate: int.parse(startDate),
|
||||
weekDays: state.weekdaysList,
|
||||
startTime: int.parse(startTime),
|
||||
endTime: int.parse(endTime),
|
||||
isOnlyManageSelf: 0,
|
||||
realName: state.isRequireAuth.value == true
|
||||
? state.realNameController.text
|
||||
: '',
|
||||
idCardNumber: state.isRequireAuth.value == true
|
||||
? state.idCardController.text
|
||||
: '');
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.createUser.value = 0;
|
||||
state.isSendSuccess = true;
|
||||
resetData();
|
||||
update();
|
||||
@ -175,10 +177,10 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
} else {
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser = true;
|
||||
update();
|
||||
ShowTipView().showIosTipWithContentDialog(
|
||||
'${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', () {
|
||||
state.createUser.value = 1;
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
}
|
||||
@ -231,19 +233,20 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void resetData() {
|
||||
state.emailOrPhoneController.text = "";
|
||||
state.keyNameController.text = "";
|
||||
state.realNameController.text = "";
|
||||
state.idCardController.text = "";
|
||||
state.emailOrPhoneController.text = '';
|
||||
state.keyNameController.text = '';
|
||||
state.realNameController.text = '';
|
||||
state.idCardController.text = '';
|
||||
state.timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时开始时间
|
||||
state.timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时结束时间
|
||||
state.cycleBeginTime = ""; // 循环开始时间
|
||||
state.cycleEndTime = ""; // 循环结束时间
|
||||
state.effectiveDateTime = ""; // 生效时间
|
||||
state.failureDateTime = ""; // 失效时间
|
||||
state.cycleBeginTime = ''; // 循环开始时间
|
||||
state.cycleEndTime = ''; // 循环结束时间
|
||||
state.effectiveDateTime = ''; // 生效时间
|
||||
state.failureDateTime = ''; // 失效时间
|
||||
state.weekdaysList = [];
|
||||
state.createUser.value = 0;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.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/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_logic.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/NativeInteractionTool.dart';
|
||||
@ -127,7 +128,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
final result = await Navigator.pushNamed(
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
@ -158,7 +159,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
PDuration selectDate = PDuration.parse(
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTime.parse(logic.state.timeLimitBeginTime));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
@ -172,7 +173,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
rightTitle: logic.state.timeLimitEndTime,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
PDuration selectDate = PDuration.parse(
|
||||
final PDuration selectDate = PDuration.parse(
|
||||
DateTime.tryParse(logic.state.timeLimitEndTime));
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
|
||||
@ -194,8 +195,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
leftTitel: TranslationLoader.lanKeys!.realNameAuthentication!.tr,
|
||||
rightTitle: '',
|
||||
isTipsImg: true,
|
||||
isHaveLine:
|
||||
logic.state.isRequireAuth.value == true ? true : false,
|
||||
isHaveLine: logic.state.isRequireAuth.value,
|
||||
tipsImgAction: () {
|
||||
ShowTipView().showSureAlertDialog(
|
||||
'人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。'.tr);
|
||||
@ -236,7 +236,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result =
|
||||
final result =
|
||||
await Get.toNamed(Routers.seletKeyCyclicDatePage, arguments: {
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
@ -254,15 +254,16 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
}
|
||||
}),
|
||||
Visibility(
|
||||
visible: logic.state.weekdaysList.isNotEmpty ? true : false,
|
||||
visible: logic.state.weekdaysList.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: '有效日'.tr,
|
||||
rightTitle: logic.state.weekdaysList.join(',').toString(),
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
final result = await Get.toNamed(
|
||||
Routers.seletKeyCyclicDatePage,
|
||||
arguments: <String, Object>{
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
'endDate': logic.state.cycleEndTime,
|
||||
@ -287,7 +288,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||
final result = await Get.toNamed(
|
||||
Routers.seletKeyCyclicDatePage,
|
||||
arguments: {
|
||||
'validityValue': logic.state.weekdaysList,
|
||||
'starDate': logic.state.cycleBeginTime,
|
||||
@ -367,7 +369,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
// 发送电子钥匙成功
|
||||
Widget sendElectronicKeySucceed(SendElectronicKeyViewLogic logic) {
|
||||
return Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 250.h,
|
||||
width: 1.sw,
|
||||
@ -428,7 +430,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
|
||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||
Future<void> updateRoomCheckIn(SendElectronicKeyViewLogic logic) async {
|
||||
var entity = await ApiRepository.to.setRoomStatusData(
|
||||
final LoginEntity entity = await ApiRepository.to.setRoomStatusData(
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId!,
|
||||
roomStatus: 1,
|
||||
);
|
||||
@ -526,7 +528,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
? true
|
||||
: false),
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||
rightTitle: '',
|
||||
@ -565,7 +567,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
);
|
||||
}
|
||||
|
||||
Future _openModalBottomSheet() async {
|
||||
Future<void> _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
@ -604,7 +606,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
}
|
||||
|
||||
List<Widget> initBottomSheetList() {
|
||||
List<Widget> widgetList = [];
|
||||
final List<Widget> widgetList = [];
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友'.tr, 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信'.tr, 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件'.tr, 2));
|
||||
@ -643,17 +645,17 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
);
|
||||
}
|
||||
|
||||
_jumpSmartDeviceRoute(int itemIndex) {
|
||||
void _jumpSmartDeviceRoute(int itemIndex) {
|
||||
Get.back();
|
||||
switch (itemIndex) {
|
||||
case 0:
|
||||
//微信好友
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
final String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
case 1:
|
||||
//短信
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
final String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
case 2:
|
||||
@ -662,7 +664,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
break;
|
||||
case 3:
|
||||
//更多
|
||||
String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
final String pwdShareStr = '您好,您的电子钥匙生成成功'.tr;
|
||||
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -13,28 +13,28 @@ class SendElectronicKeyViewState {
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
|
||||
var isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||
var isAuthentication = false.obs; //是否可以实名认证
|
||||
RxBool isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||
RxBool isAuthentication = false.obs; //是否可以实名认证
|
||||
|
||||
var timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
String timeLimitBeginTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时开始时间
|
||||
var timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||
String timeLimitEndTime = DateTool().dateToYMDHNString(
|
||||
DateTime.now().millisecondsSinceEpoch.toString()); // 限时结束时间
|
||||
var cycleBeginTime = ""; // 循环开始时间
|
||||
var cycleEndTime = ""; // 循环结束时间
|
||||
var effectiveDateTime = ""; // 生效时间
|
||||
var failureDateTime = ""; // 失效时间
|
||||
var weekdaysList = [];
|
||||
String cycleBeginTime = ''; // 循环开始时间
|
||||
String cycleEndTime = ''; // 循环结束时间
|
||||
String effectiveDateTime = ''; // 生效时间
|
||||
String failureDateTime = ''; // 失效时间
|
||||
List<int> weekdaysList = <int>[];
|
||||
|
||||
var isSendSuccess = false;
|
||||
var countryName = '中国'.tr;
|
||||
var countryCode = '86';
|
||||
var isCreateUser = false; //用户未注册时传1 已注册传0
|
||||
var isDemoMode = false;
|
||||
var isRequireAuth = false.obs; //是否需要实名认证的必填项
|
||||
bool isSendSuccess = false;
|
||||
String countryName = '中国'.tr;
|
||||
String countryCode = '86';
|
||||
RxInt createUser = 0.obs; //用户未注册时传1 已注册传0
|
||||
bool isDemoMode = false;
|
||||
RxBool isRequireAuth = false.obs; //是否需要实名认证的必填项
|
||||
|
||||
final timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||
final permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||
final onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||
final cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||
final String timeLimitTips = '接收者在有效期内可以不限次数使用'; //限时
|
||||
final String permanentTips = '接收者可以使用此App开关锁'; //永久
|
||||
final String onceLimitTips = '单次钥匙有效期为1小时,只能使用一次'; //单次
|
||||
final String cycleLimitTips = '接收者可以在有效期内的固定时间段里,不限次数使用'; //循环
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left:20.w, right: 20.w, bottom: 20.h),
|
||||
child: Text(
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫指纹用于日常开锁".tr}",
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息会推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫指纹用于日常开锁".tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
)
|
||||
|
||||
@ -45,7 +45,7 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: Stack(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
pageView(
|
||||
widget: StarLockMainPage(
|
||||
showAppBar: false,
|
||||
@ -102,7 +102,7 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
navigationBarItem(Icons.key,
|
||||
TranslationLoader.lanKeys!.device!.tr, logic, 0, () {
|
||||
logic.setIndex(0);
|
||||
@ -142,8 +142,8 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
||||
|
||||
//底部按钮
|
||||
Widget navigationBarItem(IconData icon, String text, LockMainXHJLogic logic,
|
||||
int index, var onTop) {
|
||||
bool check = logic.state.index == index;
|
||||
int index, GestureTapCallback? onTop) {
|
||||
final bool check = logic.state.index == index;
|
||||
return Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: onTop,
|
||||
@ -151,7 +151,7 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 8.h),
|
||||
child: Icon(
|
||||
|
||||
@ -24,7 +24,8 @@ class MessageListXHJPage extends StatefulWidget {
|
||||
State<MessageListXHJPage> createState() => _MessageListXHJPageState();
|
||||
}
|
||||
|
||||
class _MessageListXHJPageState extends State<MessageListXHJPage> with TickerProviderStateMixin {
|
||||
class _MessageListXHJPageState extends State<MessageListXHJPage>
|
||||
with TickerProviderStateMixin {
|
||||
final MessageListLogic logic = Get.put(MessageListLogic());
|
||||
final MessageListState state = Get.find<MessageListLogic>().state;
|
||||
|
||||
@ -45,31 +46,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage> with TickerProv
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: widget.showAppBar
|
||||
? TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.message!.tr,
|
||||
haveBack: true,
|
||||
actionsList: <Widget>[
|
||||
TextButton(
|
||||
child: Text(
|
||||
'清空'.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () async {
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
ShowTipView().showIosTipWithContentDialog('是否清空?'.tr,
|
||||
() async {
|
||||
logic.deletAllMessageDataRequest();
|
||||
});
|
||||
} else {
|
||||
logic.showToast('演示模式'.tr);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
backgroundColor: AppColors.mainColor)
|
||||
: null,
|
||||
appBar: null,
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
@ -135,7 +112,7 @@ class _MessageListXHJPageState extends State<MessageListXHJPage> with TickerProv
|
||||
final MessageItemEntity messageItemEntity =
|
||||
state.itemDataList[index];
|
||||
return Slidable(
|
||||
key: ValueKey(messageItemEntity.id),
|
||||
key: ValueKey<String?>(messageItemEntity.id),
|
||||
endActionPane: ActionPane(
|
||||
extentRatio: 0.2,
|
||||
motion: const ScrollMotion(),
|
||||
@ -169,6 +146,25 @@ class _MessageListXHJPageState extends State<MessageListXHJPage> with TickerProv
|
||||
),
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
backgroundColor: AppColors.mainColor,
|
||||
child: Icon(
|
||||
Icons.delete_sweep,
|
||||
color: AppColors.blackColor,
|
||||
),
|
||||
onPressed: () async {
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
ShowTipView().showIosTipWithContentDialog('是否清空?'.tr, () async {
|
||||
logic.deletAllMessageDataRequest();
|
||||
});
|
||||
} else {
|
||||
logic.showToast('演示模式'.tr);
|
||||
}
|
||||
},
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(100.r))),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
@ -352,6 +353,12 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
|
||||
action: () {
|
||||
logic.showToast('功能暂未开放'.tr);
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.supportStaff!.tr,
|
||||
isHaveLine: widget.showAbout,
|
||||
isHaveDirection: true,
|
||||
action: CustomerTool.openCustomerService,
|
||||
),
|
||||
if (widget.showAbout)
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.about!.tr,
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_logic.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedServicesNoteAndEmailDetail_state.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_arg.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -139,8 +140,13 @@ class _ValueAddedServicesNoteAndEmailDetailPageState
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context,
|
||||
Routers.valueAddedServicesBuyAndUseRecordManagePage);
|
||||
if (type == 1) {
|
||||
Get.toNamed(Routers.valueAddedServicesRecordPage,
|
||||
arguments: UseRecordListArg.sms);
|
||||
} else if (type == 2) {
|
||||
Get.toNamed(Routers.valueAddedServicesRecordPage,
|
||||
arguments: UseRecordListArg.email);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 90,
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_arg.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_entity.dart';
|
||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/value_added_services_record_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
@ -58,6 +59,17 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
String getBuyRecordListTitle(RecordItem itemData) {
|
||||
if (itemData.type == UseRecordListArg.sms['type']) {
|
||||
return '${itemData.smsCount}条';
|
||||
} else if (itemData.type == UseRecordListArg.email['type']) {
|
||||
return '${itemData.emailCount}封';
|
||||
} else if (itemData.type == UseRecordListArg.cloudauth['type']) {
|
||||
return '实名认证/${itemData.cloudauthCount}次';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
@ -89,14 +89,15 @@ class _PurchaseRecords extends StatelessWidget {
|
||||
? ListView.builder(
|
||||
itemCount: buyRecordList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return _recordKeyItem(buyRecordList[index]);
|
||||
return _recordKeyItem(buyRecordList[index], logic);
|
||||
})
|
||||
: NoData(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _recordKeyItem(RecordItem itemData) {
|
||||
Widget _recordKeyItem(
|
||||
RecordItem itemData, ValueAddedServicesRecordLogic logic) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h),
|
||||
@ -122,7 +123,7 @@ class _PurchaseRecords extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
Text('实名认证/${itemData.cloudauthCount}次',
|
||||
Text(logic.getBuyRecordListTitle(itemData),
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor)),
|
||||
],
|
||||
|
||||
@ -239,4 +239,5 @@ abstract class Api {
|
||||
|
||||
final String lockDataUploadUrl = '/lockRecords/lockDataUpload'; // 锁数据上传
|
||||
final String getNoticeTemplateURL = '/key/getNoticeTemplate'; //获取短信或者邮箱模板
|
||||
final String appGetAppInfoURL = '/app/getAppInfo'; //获取APP基本信息
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'countryCode': countryCode,
|
||||
'account': account,
|
||||
"channel": channel,
|
||||
'channel': channel,
|
||||
'codeType': codeType,
|
||||
'xWidth': xWidth,
|
||||
}));
|
||||
@ -28,10 +28,10 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'receiverType': receiverType,
|
||||
'countryCode': countryCode,
|
||||
"account": account,
|
||||
'account': account,
|
||||
'password': password,
|
||||
'verificationCode': verificationCode,
|
||||
'platId': "2",
|
||||
'platId': '2',
|
||||
}));
|
||||
|
||||
// post(
|
||||
@ -71,10 +71,10 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'loginType': loginType,
|
||||
'password': password,
|
||||
"platId": "2",
|
||||
'uniqueid': "477E6814-289D-402A-9F49-F89A8BD05D63",
|
||||
'platId': '2',
|
||||
'uniqueid': '477E6814-289D-402A-9F49-F89A8BD05D63',
|
||||
'countryCode': countryCode,
|
||||
"username": username
|
||||
'username': username
|
||||
}));
|
||||
|
||||
Future<Response> resetPassword(
|
||||
@ -89,9 +89,9 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'countryCode': countryCode,
|
||||
'account': account,
|
||||
"date": date,
|
||||
'date': date,
|
||||
'newPassword': newPassword,
|
||||
"uniqueid": uniqueid,
|
||||
'uniqueid': uniqueid,
|
||||
'verificationCode': verificationCode,
|
||||
}));
|
||||
|
||||
@ -114,7 +114,7 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'endDate': endDate,
|
||||
'keyId': keyId,
|
||||
"keyStatus": keyStatus,
|
||||
'keyStatus': keyStatus,
|
||||
'lockId': lockId,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
@ -124,7 +124,7 @@ class ApiProvider extends BaseProvider {
|
||||
}));
|
||||
|
||||
Future<Response> sendElectronicKey(
|
||||
String createUser,
|
||||
int createUser,
|
||||
String countryCode,
|
||||
String usernameType,
|
||||
int endDate,
|
||||
@ -178,13 +178,15 @@ class ApiProvider extends BaseProvider {
|
||||
bool isUnShowLoading,
|
||||
) =>
|
||||
post(
|
||||
uploadElectricQuantityURL.toUrl,
|
||||
jsonEncode({
|
||||
'electricQuantity': electricQuantity,
|
||||
'electricQuantityStandby': electricQuantityStandby,
|
||||
'lockId': lockId,
|
||||
}),
|
||||
isUnShowLoading: isUnShowLoading);
|
||||
uploadElectricQuantityURL.toUrl,
|
||||
jsonEncode({
|
||||
'electricQuantity': electricQuantity,
|
||||
'electricQuantityStandby': electricQuantityStandby,
|
||||
'lockId': lockId,
|
||||
}),
|
||||
isUnShowLoading: isUnShowLoading,
|
||||
isShowErrMsg: false,
|
||||
);
|
||||
|
||||
Future<Response> modifyKeyName(
|
||||
String keyId,
|
||||
@ -300,9 +302,9 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
'lockEventType': lockEventType,
|
||||
"pageNo": pageNo,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
"startDate": startDate,
|
||||
'startDate': startDate,
|
||||
'endDate': endDate,
|
||||
}));
|
||||
|
||||
@ -317,11 +319,13 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
// 查询锁记录最后时间
|
||||
Future<Response> getLockRecordLastUploadDataTime(String lockId) => post(
|
||||
getLockRecordLastUploadDataTimeURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}),
|
||||
isUnShowLoading: true);
|
||||
getLockRecordLastUploadDataTimeURL.toUrl,
|
||||
jsonEncode({
|
||||
'lockId': lockId,
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
isShowErrMsg: false,
|
||||
);
|
||||
|
||||
// 获取手机联网token
|
||||
Future<Response> getLockNetToken(String lockId) => post(
|
||||
@ -354,7 +358,7 @@ class ApiProvider extends BaseProvider {
|
||||
post(
|
||||
bindingBlueAdminURL.toUrl,
|
||||
jsonEncode({
|
||||
"lockAlias": lockAlias,
|
||||
'lockAlias': lockAlias,
|
||||
'position': position,
|
||||
'bluetooth': bluetooth,
|
||||
'lockInfo': lockInfo,
|
||||
@ -370,7 +374,7 @@ class ApiProvider extends BaseProvider {
|
||||
getLockInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
'lastUpdateDate': lastUpdateDate,
|
||||
"pageNo": pageNo,
|
||||
'pageNo': pageNo,
|
||||
}));
|
||||
|
||||
// 获取锁信息列表
|
||||
@ -379,7 +383,7 @@ class ApiProvider extends BaseProvider {
|
||||
post(
|
||||
getStarLockInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
"pageNo": pageNo,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize,
|
||||
}),
|
||||
isUnShowLoading: isUnShowLoading);
|
||||
@ -529,8 +533,8 @@ class ApiProvider extends BaseProvider {
|
||||
'isCoerced': isCoerced,
|
||||
'hoursStart': hoursStart,
|
||||
'hoursEnd': hoursEnd,
|
||||
"keyboardPwdType": keyboardPwdType,
|
||||
"pwdRight": pwdRight
|
||||
'keyboardPwdType': keyboardPwdType,
|
||||
'pwdRight': pwdRight
|
||||
}));
|
||||
|
||||
Future<Response> clearOperationRecord(String lockId) =>
|
||||
@ -1283,11 +1287,11 @@ class ApiProvider extends BaseProvider {
|
||||
'startTime': startTime,
|
||||
'endTime': endTime,
|
||||
'faceType': faceType,
|
||||
"weekDay": weekDay,
|
||||
'weekDay': weekDay,
|
||||
'faceName': faceName,
|
||||
'addType': addType,
|
||||
"isCoerced": isCoerced,
|
||||
"faceRight": faceRight
|
||||
'isCoerced': isCoerced,
|
||||
'faceRight': faceRight
|
||||
}));
|
||||
|
||||
// 删除人脸
|
||||
@ -1631,7 +1635,7 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode({
|
||||
'countryCode': countryCode,
|
||||
'account': account,
|
||||
"channel": channel,
|
||||
'channel': channel,
|
||||
'codeType': codeType,
|
||||
'xWidth': xWidth,
|
||||
}));
|
||||
@ -1679,9 +1683,9 @@ class ApiProvider extends BaseProvider {
|
||||
post(
|
||||
changePasswordURL.toUrl,
|
||||
jsonEncode({
|
||||
"date": date,
|
||||
'date': date,
|
||||
'newPassword': newPassword,
|
||||
"oldPassword": oldPassword,
|
||||
'oldPassword': oldPassword,
|
||||
}));
|
||||
|
||||
//获取安全信息列表
|
||||
@ -1689,7 +1693,7 @@ class ApiProvider extends BaseProvider {
|
||||
post(
|
||||
getQuestionListURL.toUrl,
|
||||
jsonEncode({
|
||||
"operatorUid": operatorUid,
|
||||
'operatorUid': operatorUid,
|
||||
'countryCode': countryCode,
|
||||
}));
|
||||
|
||||
@ -1700,12 +1704,12 @@ class ApiProvider extends BaseProvider {
|
||||
//设置安全信息
|
||||
Future<Response> setSafeAnswer(List questionAndAnswerList) => post(
|
||||
setSafeAnswerURL.toUrl,
|
||||
jsonEncode({"questionAndAnswerList": questionAndAnswerList}));
|
||||
jsonEncode({'questionAndAnswerList': questionAndAnswerList}));
|
||||
|
||||
//修改安全信息
|
||||
Future<Response> updateSafeAnswer(List questionAndAnswerList) => post(
|
||||
updateSafeAnswerURL.toUrl,
|
||||
jsonEncode({"questionAndAnswerList": questionAndAnswerList}));
|
||||
jsonEncode({'questionAndAnswerList': questionAndAnswerList}));
|
||||
|
||||
// 获取上传文件的upToken 再调用updateUserInfo
|
||||
Future<Response> getUpHeadToken(
|
||||
@ -1716,10 +1720,10 @@ class ApiProvider extends BaseProvider {
|
||||
post(
|
||||
getUpTokenURL.toUrl,
|
||||
jsonEncode({
|
||||
"module": "avatar",
|
||||
"userId": userId,
|
||||
"filename": filename,
|
||||
"size": size,
|
||||
'module': 'avatar',
|
||||
'userId': userId,
|
||||
'filename': filename,
|
||||
'size': size,
|
||||
}));
|
||||
|
||||
// 文件上传
|
||||
@ -1731,17 +1735,17 @@ class ApiProvider extends BaseProvider {
|
||||
//获取解绑手机号Token
|
||||
Future<Response> unbindPhoneToken(String verificationCode) => post(
|
||||
unbindPhoneTokenURL.toUrl,
|
||||
jsonEncode({"verificationCode": verificationCode}));
|
||||
jsonEncode({'verificationCode': verificationCode}));
|
||||
|
||||
//获取解绑邮箱Token
|
||||
Future<Response> unbindEmailToken(String verificationCode) => post(
|
||||
unbindEmailTokenURL.toUrl,
|
||||
jsonEncode({"verificationCode": verificationCode}));
|
||||
jsonEncode({'verificationCode': verificationCode}));
|
||||
|
||||
//推送绑定DeviceID
|
||||
Future<Response> pushBindAppId(String deviceId, int deviceType) => post(
|
||||
pushBindAppIdURL.toUrl,
|
||||
jsonEncode({"deviceId": deviceId, "deviceType": deviceType}));
|
||||
jsonEncode({'deviceId': deviceId, 'deviceType': deviceType}));
|
||||
|
||||
// 消息列表
|
||||
Future<Response> messageListLoadData(String pageNo, String pageSize) => post(
|
||||
@ -2106,8 +2110,7 @@ class ApiProvider extends BaseProvider {
|
||||
'recordType': recordType,
|
||||
'records': records
|
||||
}),
|
||||
isUnShowLoading: isUnShowLoading
|
||||
);
|
||||
isUnShowLoading: isUnShowLoading);
|
||||
|
||||
// 获取短信或者邮箱模板
|
||||
Future<Response<dynamic>> getNoticeTemplate(
|
||||
@ -2119,6 +2122,11 @@ class ApiProvider extends BaseProvider {
|
||||
'keyId': keyId,
|
||||
'channelType': channelType,
|
||||
}));
|
||||
|
||||
// 获取App基本信息
|
||||
Future<Response<dynamic>> getAppInfo() =>
|
||||
post(appGetAppInfoURL.toUrl, jsonEncode(<String, int>{}),
|
||||
isShowErrMsg: false);
|
||||
}
|
||||
|
||||
extension ExtensionString on String {
|
||||
|
||||
@ -34,9 +34,10 @@ class BaseProvider extends GetConnect with Api {
|
||||
Progress? uploadProgress,
|
||||
bool? isUnShowLoading = false, // 是否显示loading
|
||||
bool? isUserBaseUrl = true, // 文件上传不使用baseUrl
|
||||
bool? isShowErrMsg = true, // 文件上传不使用baseUrl
|
||||
}) async {
|
||||
AppLog.log('post: url:$url body:$body');
|
||||
if (isUnShowLoading == false){
|
||||
if (isUnShowLoading == false) {
|
||||
EasyLoading.show();
|
||||
}
|
||||
if (isUserBaseUrl == false) {
|
||||
@ -54,8 +55,9 @@ class BaseProvider extends GetConnect with Api {
|
||||
if (EasyLoading.isShow) await EasyLoading.dismiss(animation: true);
|
||||
|
||||
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
if (res.statusCode == null) {
|
||||
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr, duration: 2000.milliseconds);
|
||||
if (res.statusCode == null && isShowErrMsg!) {
|
||||
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr,
|
||||
duration: 2000.milliseconds);
|
||||
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
}
|
||||
var rs = {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/notice_template_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||
@ -167,7 +168,7 @@ class ApiRepository {
|
||||
|
||||
//发送电子钥匙
|
||||
Future<AuthorizedAdminSendEntity> sendElectronicKey(
|
||||
{required String createUser,
|
||||
{required int createUser,
|
||||
required String countryCode,
|
||||
required String usernameType,
|
||||
required int endDate,
|
||||
@ -2150,4 +2151,11 @@ class ApiRepository {
|
||||
await apiProvider.getNoticeTemplate(lockId, keyId, channelType);
|
||||
return NoticeTemplateEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 电子钥匙获取短信模板
|
||||
Future<GetAppInfo> getAppInfo() async {
|
||||
final Response<dynamic> res =
|
||||
await apiProvider.getAppInfo();
|
||||
return GetAppInfo.fromJson(res.body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart';
|
||||
import 'package:star_lock/mine/about/debug/debug_tool.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||
@ -41,6 +44,7 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
} else if (snapshot.hasData) {
|
||||
if (snapshot.data!) {
|
||||
// 如果用户已登录,返回主页面
|
||||
getAppInfo();
|
||||
return F.sw(
|
||||
skyCall: () => StarLockMainPage(),
|
||||
xhjCall: () => const StarLockMainXHJPage());
|
||||
@ -76,4 +80,9 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
AppFirstEnterHandle().getAppFirstEnter(isShowUpdateVersion);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,34 +8,36 @@ import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/app_get_version.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/customer_tool.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
|
||||
class AppFirstEnterHandle {
|
||||
Future getAppFirstEnter(String flagStr) async {
|
||||
var getFlag = await Storage.getString(flagStr);
|
||||
Future<void> getAppFirstEnter(String flagStr) async {
|
||||
final dynamic getFlag = await Storage.getString(flagStr);
|
||||
switch (flagStr) {
|
||||
case isAgreePrivacy: // 隐私协议
|
||||
{
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
showPrivacyAgreementAlert();
|
||||
}
|
||||
if (getFlag != isAgreePrivacy) {
|
||||
await showPrivacyAgreementAlert();
|
||||
}
|
||||
getAppInfo();
|
||||
break;
|
||||
case isAgreePosition: // 位置权限
|
||||
{
|
||||
if (getFlag != isAgreePosition) showPositionAlert();
|
||||
if (getFlag != isAgreePosition) {
|
||||
showPositionAlert();
|
||||
}
|
||||
break;
|
||||
case isAgreeCamera: // 相机权限
|
||||
{
|
||||
if (getFlag != isAgreeCamera) showCameraAlert();
|
||||
if (getFlag != isAgreeCamera) {
|
||||
showCameraAlert();
|
||||
}
|
||||
break;
|
||||
case isShowUpdateVersion: // 版本更新
|
||||
{
|
||||
if (getFlag != isShowUpdateVersion) VersionUndateTool();
|
||||
if (getFlag != isShowUpdateVersion) {
|
||||
VersionUndateTool();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -44,8 +46,8 @@ class AppFirstEnterHandle {
|
||||
}
|
||||
|
||||
//隐私协议弹窗
|
||||
void showPrivacyAgreementAlert() {
|
||||
showCupertinoDialog(
|
||||
Future<void> showPrivacyAgreementAlert() async {
|
||||
await showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return PopScope(
|
||||
@ -57,6 +59,11 @@ class AppFirstEnterHandle {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getAppInfo() async {
|
||||
final GetAppInfo entity = await ApiRepository.to.getAppInfo();
|
||||
CustomerTool.init(entity.data?.wechatServiceUrl ?? '');
|
||||
}
|
||||
|
||||
//默认布局
|
||||
Widget _defaultPrivacyAgreementAlert(BuildContext context) {
|
||||
return CupertinoAlertDialog(
|
||||
|
||||
18
lib/tools/customer_tool.dart
Normal file
18
lib/tools/customer_tool.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
//客服工具类
|
||||
class CustomerTool {
|
||||
static String _customerServiceUrl = '';
|
||||
|
||||
//初始化
|
||||
static Future<void> init(String customerServiceUrl) async {
|
||||
_customerServiceUrl = customerServiceUrl;
|
||||
}
|
||||
|
||||
//打开客服
|
||||
static void openCustomerService() {
|
||||
if (_customerServiceUrl.isNotEmpty) {
|
||||
launchUrl(Uri.parse(_customerServiceUrl));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -61,8 +61,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.51+2024052801:xhj 线上环境,提审
|
||||
# 1.0.53+2024052803:xhj 线上环境,提审 sky 线上环境提审
|
||||
# 1.0.53+2024052804:xhj 线上环境,提审 修改鑫锁名字为星星锁
|
||||
# 1.0.54+2024053001:xhj 线上环境,对外发布,提交测试
|
||||
|
||||
version: 1.0.53+2024052804
|
||||
version: 1.0.54+2024053001
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user