Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
96f7dd0338
@ -12,8 +12,7 @@ class SendEmailNotificationPage extends StatefulWidget {
|
|||||||
const SendEmailNotificationPage({Key? key}) : super(key: key);
|
const SendEmailNotificationPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SendEmailNotificationPage> createState() =>
|
State<SendEmailNotificationPage> createState() => _SendEmailNotificationPageState();
|
||||||
_SendEmailNotificationPageState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
||||||
@ -21,87 +20,80 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
_emailController.text =
|
_emailController.text = "亲爱的用户 \n\n你收到电子钥匙,请试用APP(www.baidu.com)或小程序开锁 \n\n星锁";
|
||||||
"亲爱的用户 \n\n你收到电子钥匙,请试用APP(www.baidu.com)或小程序开锁 \n\n星锁";
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(barTitle: "邮件通知", haveBack: true, backgroundColor: AppColors.mainColor),
|
||||||
barTitle: "邮件通知",
|
body: SingleChildScrollView(
|
||||||
haveBack: true,
|
child: Column(
|
||||||
backgroundColor: AppColors.mainColor),
|
children: [
|
||||||
body: Column(
|
CommonItem(
|
||||||
children: [
|
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||||
CommonItem(
|
rightTitle: "786612630@qq.com",
|
||||||
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
isHaveLine: true,
|
||||||
rightTitle: "786612630@qq.com",
|
),
|
||||||
isHaveLine: true,
|
CommonItem(
|
||||||
),
|
leftTitel: "类型",
|
||||||
CommonItem(
|
rightTitle: "个人邮件",
|
||||||
leftTitel: "类型",
|
|
||||||
rightTitle: "个人邮件",
|
|
||||||
isHaveDirection: true,
|
|
||||||
),
|
|
||||||
Container(height: 10.h),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: "模板",
|
|
||||||
rightTitle: "默认模板",
|
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true),
|
),
|
||||||
Container(
|
Container(height: 10.h),
|
||||||
height: 360.h,
|
CommonItem(leftTitel: "模板", rightTitle: "默认模板", isHaveDirection: true, isHaveLine: true),
|
||||||
color: Colors.white,
|
Container(
|
||||||
padding: EdgeInsets.only(
|
height: 360.h,
|
||||||
left: 20.w, right: 20.w, top: 20.h, bottom: 20.h),
|
color: Colors.white,
|
||||||
child: TextField(
|
padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.h, bottom: 20.h),
|
||||||
maxLines: 8,
|
child: TextField(
|
||||||
maxLength: 1000,
|
maxLines: 8,
|
||||||
textAlign: TextAlign.start,
|
maxLength: 1000,
|
||||||
controller: _emailController,
|
textAlign: TextAlign.start,
|
||||||
style: TextStyle(
|
controller: _emailController,
|
||||||
color: Colors.black,
|
style: TextStyle(
|
||||||
fontSize: 22.sp,
|
color: Colors.black,
|
||||||
),
|
fontSize: 22.sp,
|
||||||
decoration: InputDecoration(
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
///设置边框四个角的弧度
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
|
||||||
|
|
||||||
///用来配置边框的样式
|
|
||||||
borderSide: const BorderSide(
|
|
||||||
///设置边框的颜色
|
|
||||||
color: Color(0xffB2B2B2),
|
|
||||||
|
|
||||||
///设置边框的粗细
|
|
||||||
width: 0.5,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
///设置边框四个角的弧度
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
||||||
|
|
||||||
///用来配置输入框获取焦点时的颜色
|
///用来配置边框的样式
|
||||||
focusedBorder: OutlineInputBorder(
|
borderSide: const BorderSide(
|
||||||
///设置边框四个角的弧度
|
///设置边框的颜色
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
color: Color(0xffB2B2B2),
|
||||||
|
|
||||||
///用来配置边框的样式
|
///设置边框的粗细
|
||||||
borderSide: const BorderSide(
|
width: 0.5,
|
||||||
///设置边框的颜色
|
),
|
||||||
color: Color(0xffB2B2B2),
|
),
|
||||||
|
|
||||||
///设置边框的粗细
|
///用来配置输入框获取焦点时的颜色
|
||||||
width: 1,
|
focusedBorder: OutlineInputBorder(
|
||||||
|
///设置边框四个角的弧度
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
||||||
|
|
||||||
|
///用来配置边框的样式
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
///设置边框的颜色
|
||||||
|
color: Color(0xffB2B2B2),
|
||||||
|
|
||||||
|
///设置边框的粗细
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Container(height: 40.h),
|
||||||
Container(height: 40.h),
|
SubmitBtn(
|
||||||
SubmitBtn(
|
btnName: '发送',
|
||||||
btnName: '发送',
|
fontSize: 28.sp,
|
||||||
fontSize: 28.sp,
|
borderRadius: 20.w,
|
||||||
borderRadius: 20.w,
|
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
onClick: () {}),
|
||||||
onClick: () {}),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
|
StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
|
||||||
void _initRefreshLockDetailInfoDataEventAction() {
|
void _initRefreshLockDetailInfoDataEventAction() {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_lockRefreshLockDetailInfoDataEvent = eventBus.on<RefreshLockDetailInfoDataEvent>().listen((event) {
|
_lockRefreshLockDetailInfoDataEvent =
|
||||||
|
eventBus.on<RefreshLockDetailInfoDataEvent>().listen((event) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -110,12 +111,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
BlueManage().connectDeviceName =
|
BlueManage().connectDeviceName =
|
||||||
state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
||||||
|
|
||||||
List<int> publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
List<int> publicKeyData =
|
||||||
|
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
||||||
var saveStrList = changeIntListToStringList(publicKeyData);
|
var saveStrList = changeIntListToStringList(publicKeyData);
|
||||||
Storage.setStringList(saveBluePublicKey, saveStrList);
|
Storage.setStringList(saveBluePublicKey, saveStrList);
|
||||||
|
|
||||||
// 私钥
|
// 私钥
|
||||||
List<int> privateKeyData = state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
|
List<int> privateKeyData =
|
||||||
|
state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
|
||||||
var savePrivateKeyList = changeIntListToStringList(privateKeyData);
|
var savePrivateKeyList = changeIntListToStringList(privateKeyData);
|
||||||
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
|
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
|
||||||
|
|
||||||
@ -138,9 +141,19 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
children: [
|
children: [
|
||||||
Visibility(
|
Visibility(
|
||||||
visible:
|
visible:
|
||||||
((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) && // 限时、循环
|
((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
(DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 && DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) && // 0到30天
|
state.keyInfos.value.keyType ==
|
||||||
(state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收
|
XSConstantMacro.keyTypeLoop) && // 限时、循环
|
||||||
|
(DateTool().compareTimeGetDaysFromNow(
|
||||||
|
state.keyInfos.value.endDate!) <=
|
||||||
|
15 &&
|
||||||
|
DateTool().compareTimeGetDaysFromNow(
|
||||||
|
state.keyInfos.value.endDate!) >=
|
||||||
|
0) && // 0到30天
|
||||||
|
(state.keyInfos.value.keyStatus ==
|
||||||
|
XSConstantMacro.keyStatusNormalUse ||
|
||||||
|
state.keyInfos.value.keyStatus ==
|
||||||
|
XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收
|
||||||
)
|
)
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
@ -234,9 +247,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// logic.getStarLockStatus();
|
// logic.getStarLockStatus();
|
||||||
ShowTipView().showSureAlertDialog("${"锁更新时间:".tr}${DateTool().dateToYMDHNString(state
|
ShowTipView().showSureAlertDialog(
|
||||||
.keyInfos.value.electricQuantityDate!
|
"${"锁更新时间:".tr}${DateTool().dateToYMDHNString(state.keyInfos.value.electricQuantityDate!.toString())}");
|
||||||
.toString())}");
|
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
@ -263,11 +275,16 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w),
|
Image.asset(showElectricIcon(state.electricQuantity.value),
|
||||||
|
width: 30.w, height: 24.w),
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
Text("--%", style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
|
Text("--%",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: AppColors.darkGrayTextColor)),
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
Icon(Icons.info, // 使用内置的 warning 图标,它是一个叹号
|
Icon(
|
||||||
|
Icons.info, // 使用内置的 warning 图标,它是一个叹号
|
||||||
color: AppColors.mainColor, // 设置图标颜色为红色
|
color: AppColors.mainColor, // 设置图标颜色为红色
|
||||||
size: 25.w, // 设置图标大小为 30
|
size: 25.w, // 设置图标大小为 30
|
||||||
),
|
),
|
||||||
@ -561,11 +578,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// 设置
|
// 设置
|
||||||
showWidgetArr.add(bottomItem(
|
showWidgetArr.add(bottomItem('images/main/icon_main_set.png',
|
||||||
'images/main/icon_main_set.png',
|
TranslationLoader.lanKeys!.set!.tr, true, true, () {
|
||||||
TranslationLoader.lanKeys!.set!.tr,
|
|
||||||
true,
|
|
||||||
true, () {
|
|
||||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||||
"lockId": state.keyInfos.value.lockId,
|
"lockId": state.keyInfos.value.lockId,
|
||||||
"isOnlyOneData": state.isOnlyOneData
|
"isOnlyOneData": state.isOnlyOneData
|
||||||
@ -729,17 +743,16 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
TranslationLoader.lanKeys!.messageReminding!.tr,
|
TranslationLoader.lanKeys!.messageReminding!.tr,
|
||||||
state.openDoorBtnisUneable.value,
|
state.openDoorBtnisUneable.value,
|
||||||
state.bottomBtnisEable.value, () {
|
state.bottomBtnisEable.value, () {
|
||||||
Get.toNamed(Routers.msgNotificationPage);
|
Get.toNamed(Routers.msgNotificationPage, arguments: {
|
||||||
|
"lockId": state.keyInfos.value.lockId,
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
endWiddget.add(
|
endWiddget.add(
|
||||||
// 设置
|
// 设置
|
||||||
bottomItem(
|
bottomItem('images/main/icon_main_set.png',
|
||||||
'images/main/icon_main_set.png',
|
TranslationLoader.lanKeys!.set!.tr, true, true, () {
|
||||||
TranslationLoader.lanKeys!.set!.tr,
|
|
||||||
true,
|
|
||||||
true, () {
|
|
||||||
// logic.clickItemBtnAction(10);
|
// logic.clickItemBtnAction(10);
|
||||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||||
"lockId": state.keyInfos.value.lockId,
|
"lockId": state.keyInfos.value.lockId,
|
||||||
@ -752,7 +765,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable, bool bottomBtnisEable, Function() onClick) {
|
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable,
|
||||||
|
bool bottomBtnisEable, Function() onClick) {
|
||||||
var width = 42.w;
|
var width = 42.w;
|
||||||
var height = 42.h;
|
var height = 42.h;
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
|
|||||||
@ -371,7 +371,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.msgNotificationPage);
|
Get.toNamed(Routers.msgNotificationPage, arguments: {
|
||||||
|
'lockSetInfoData': state.lockSetInfoData.value
|
||||||
|
});
|
||||||
})),
|
})),
|
||||||
//猫眼设置
|
//猫眼设置
|
||||||
Visibility(
|
Visibility(
|
||||||
|
|||||||
@ -67,11 +67,13 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
// ),
|
// ),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '开门通知',
|
leftTitel: '开门通知',
|
||||||
rightTitle: "已启用",
|
rightTitle: "",
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.openDoorNotifyPage);
|
Get.toNamed(Routers.openDoorNotifyPage, arguments: {
|
||||||
|
'lockSetInfoData': state.lockSetInfoData.value,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
|
|||||||
@ -1,9 +1,18 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
class MsgNotificationState {
|
class MsgNotificationState {
|
||||||
|
var lockSetInfoData = LockSetInfoData().obs;
|
||||||
var isCheck = false.obs;
|
var isCheck = false.obs;
|
||||||
var isLeaveHomeOpenDoor = false.obs; //离家开门
|
var isLeaveHomeOpenDoor = false.obs; //离家开门
|
||||||
var isDoorNotShut = false.obs; //门未关好
|
var isDoorNotShut = false.obs; //门未关好
|
||||||
var isSomeoneRing = false.obs; //有人按门铃
|
var isSomeoneRing = false.obs; //有人按门铃
|
||||||
var isSomeoneAppeared = false.obs; //有人出现在门口
|
var isSomeoneAppeared = false.obs; //有人出现在门口
|
||||||
|
|
||||||
|
MsgNotificationState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
if (map['lockSetInfoData'] != null) {
|
||||||
|
lockSetInfoData.value = map['lockSetInfoData'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,16 @@
|
|||||||
|
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/versionUndate/versionUndate_entity.dart';
|
||||||
import 'openDoorNotify_state.dart';
|
import 'openDoorNotify_state.dart';
|
||||||
|
|
||||||
class OpenDoorNotifyLogic extends BaseGetXController {
|
class OpenDoorNotifyLogic extends BaseGetXController {
|
||||||
final OpenDoorNotifyState state = OpenDoorNotifyState();
|
final OpenDoorNotifyState state = OpenDoorNotifyState();
|
||||||
|
|
||||||
|
// 获取锁消息设置
|
||||||
|
void getLockNoticeSetting() async {
|
||||||
|
VersionUndateEntity entity = await ApiRepository.to.getLockNoticeSetting(
|
||||||
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
|
);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,8 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
logic.getLockNoticeSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -1,7 +1,16 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
class OpenDoorNotifyState {
|
class OpenDoorNotifyState {
|
||||||
|
var lockSetInfoData = LockSetInfoData().obs;
|
||||||
var pageNum = 1.obs; //请求页码
|
var pageNum = 1.obs; //请求页码
|
||||||
final pageSize = 20.obs; //请求每页数据条数
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
final itemDataList = [].obs;
|
final itemDataList = [].obs;
|
||||||
|
|
||||||
|
OpenDoorNotifyState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
if (map['lockSetInfoData'] != null) {
|
||||||
|
lockSetInfoData.value = map['lockSetInfoData'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart';
|
||||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||||
import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
||||||
@ -23,8 +24,7 @@ class MinePersonInfoPage extends StatefulWidget {
|
|||||||
State<MinePersonInfoPage> createState() => _MinePersonInfoPageState();
|
State<MinePersonInfoPage> createState() => _MinePersonInfoPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
class _MinePersonInfoPageState extends State<MinePersonInfoPage> with WidgetsBindingObserver {
|
||||||
with WidgetsBindingObserver {
|
|
||||||
final logic = Get.put(MinePersonInfoLogic());
|
final logic = Get.put(MinePersonInfoLogic());
|
||||||
final state = Get.find<MinePersonInfoLogic>().state;
|
final state = Get.find<MinePersonInfoLogic>().state;
|
||||||
|
|
||||||
@ -88,8 +88,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
action: () async {
|
action: () async {
|
||||||
//安卓平台下首次进入应用需向用户告知获取权限用途弹窗
|
//安卓平台下首次进入应用需向用户告知获取权限用途弹窗
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
AppFirstEnterHandle()
|
AppFirstEnterHandle().getAppFirstEnter(context, isAgreeCamera);
|
||||||
.getAppFirstEnter(context, isAgreeCamera);
|
|
||||||
var getFlag = await Storage.getString(isAgreeCamera);
|
var getFlag = await Storage.getString(isAgreeCamera);
|
||||||
if (getFlag == isAgreeCamera) {
|
if (getFlag == isAgreeCamera) {
|
||||||
_openModalBottomSheet();
|
_openModalBottomSheet();
|
||||||
@ -101,16 +100,13 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
),
|
),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.nickName!.tr,
|
leftTitel: TranslationLoader.lanKeys!.nickName!.tr,
|
||||||
rightTitle: state.mineInfoData.value.nickname != null
|
rightTitle: state.mineInfoData.value.nickname != null ? state.mineInfoData.value.nickname! : "",
|
||||||
? state.mineInfoData.value.nickname!
|
|
||||||
: "",
|
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.minePersonInfoEditNamePage,
|
||||||
context, Routers.minePersonInfoEditNamePage, arguments: {
|
arguments: {'nickName': state.mineInfoData.value.nickname})
|
||||||
'nickName': state.mineInfoData.value.nickname
|
.then((value) => logic.getUserInfoRequest());
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr,
|
leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr,
|
||||||
@ -122,16 +118,13 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
action: () {
|
action: () {
|
||||||
//有手机号 则去修改手机号 否则去绑定新的手机号 isFrom:1 短信,2 邮箱
|
//有手机号 则去修改手机号 否则去绑定新的手机号 isFrom:1 短信,2 邮箱
|
||||||
if (state.mineInfoData.value.mobile!.isNotEmpty) {
|
if (state.mineInfoData.value.mobile!.isNotEmpty) {
|
||||||
Navigator.pushNamed(context, Routers.mineUnbindPhoneOrEmailPage, arguments: {
|
Navigator.pushNamed(context, Routers.mineUnbindPhoneOrEmailPage,
|
||||||
'mobile': state.mineInfoData.value.mobile!,
|
arguments: {'mobile': state.mineInfoData.value.mobile!, 'isFrom': '1'})
|
||||||
'isFrom': '1'
|
.then((value) => logic.getUserInfoRequest());
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
} else {
|
} else {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.mineBindPhoneOrEmailPage,
|
||||||
context, Routers.mineBindPhoneOrEmailPage, arguments: {
|
arguments: {'mobile': state.mineInfoData.value.mobile!, 'isFrom': '1'})
|
||||||
'mobile': state.mineInfoData.value.mobile!,
|
.then((value) => logic.getUserInfoRequest());
|
||||||
'isFrom': '1'
|
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
@ -144,18 +137,13 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
action: () {
|
action: () {
|
||||||
//有邮箱 则去修改邮箱 否则去绑定新的邮箱 isFrom:1 短信,2 邮箱
|
//有邮箱 则去修改邮箱 否则去绑定新的邮箱 isFrom:1 短信,2 邮箱
|
||||||
if (state.mineInfoData.value.email!.isNotEmpty) {
|
if (state.mineInfoData.value.email!.isNotEmpty) {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.mineUnbindPhoneOrEmailPage,
|
||||||
context, Routers.mineUnbindPhoneOrEmailPage,
|
arguments: {'isFrom': '2', 'email': state.mineInfoData.value.email!})
|
||||||
arguments: {
|
.then((value) => logic.getUserInfoRequest());
|
||||||
'isFrom': '2',
|
|
||||||
'email': state.mineInfoData.value.email!
|
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
} else {
|
} else {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.mineBindPhoneOrEmailPage,
|
||||||
context, Routers.mineBindPhoneOrEmailPage, arguments: {
|
arguments: {'isFrom': '2', 'email': state.mineInfoData.value.email!})
|
||||||
'isFrom': '2',
|
.then((value) => logic.getUserInfoRequest());
|
||||||
'email': state.mineInfoData.value.email!
|
|
||||||
}).then((value) => logic.getUserInfoRequest());
|
|
||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -164,30 +152,24 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.minePersonInfoResetPasswordPage);
|
||||||
context, Routers.minePersonInfoResetPasswordPage);
|
|
||||||
}),
|
}),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
|
leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr,
|
||||||
rightTitle:
|
rightTitle: state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置" : "",
|
||||||
state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置" : "",
|
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
if (state.mineInfoData.value.haveSafeAnswer == 0) {
|
if (state.mineInfoData.value.haveSafeAnswer == 0) {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.minePersonInfoSetSafetyProblemPage)
|
||||||
context, Routers.minePersonInfoSetSafetyProblemPage)
|
|
||||||
.then((value) => logic.getUserInfoRequest());
|
.then((value) => logic.getUserInfoRequest());
|
||||||
} else {
|
} else {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.minePersonInfoViewSafetyProblemPage);
|
||||||
context, Routers.minePersonInfoViewSafetyProblemPage);
|
|
||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||||
rightTitle: state.mineInfoData.value.countryName != null
|
rightTitle: state.mineInfoData.value.countryName != null ? state.mineInfoData.value.countryName! : "",
|
||||||
? state.mineInfoData.value.countryName!
|
|
||||||
: "",
|
|
||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: false)),
|
isHaveDirection: false)),
|
||||||
],
|
],
|
||||||
@ -221,7 +203,9 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _requestPhotoPermission() async {
|
Future<void> _requestPhotoPermission() async {
|
||||||
var status = await Permission.photos.request();
|
//针对andriud33以下的设备兼容
|
||||||
|
bool isAndroid33 = AppPlatform.isAndroid && AppPlatform.getSdkIntValue() >= 33;
|
||||||
|
var status = isAndroid33 ? await Permission.photos.request() : await Permission.storage.request();
|
||||||
if (status.isGranted) {
|
if (status.isGranted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.hasPhotoPermission.value = true; // 如果权限被授予,更新状态变量
|
state.hasPhotoPermission.value = true; // 如果权限被授予,更新状态变量
|
||||||
@ -271,8 +255,7 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
Future _openModalBottomSheet() async {
|
Future _openModalBottomSheet() async {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.circular(10)),
|
||||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertBottomWidget(
|
return AlertBottomWidget(
|
||||||
topTitle: '',
|
topTitle: '',
|
||||||
@ -281,13 +264,9 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
int getSelectIndex = value;
|
int getSelectIndex = value;
|
||||||
if (getSelectIndex == 0) {
|
if (getSelectIndex == 0) {
|
||||||
//拍照选项
|
//拍照选项
|
||||||
state.hasCameraPermission.value == true
|
state.hasCameraPermission.value == true ? selectCamera() : _requestCameraPermission();
|
||||||
? selectCamera()
|
|
||||||
: _requestCameraPermission();
|
|
||||||
} else if (getSelectIndex == 1) {
|
} else if (getSelectIndex == 1) {
|
||||||
state.hasPhotoPermission.value == true
|
state.hasPhotoPermission.value == true ? selectImage() : _requestPhotoPermission();
|
||||||
? selectImage()
|
|
||||||
: _requestPhotoPermission();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -296,8 +275,8 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
|
|||||||
|
|
||||||
///拍摄照片
|
///拍摄照片
|
||||||
selectCamera() async {
|
selectCamera() async {
|
||||||
XFile? photo = await state.imagePicker.pickImage(
|
XFile? photo =
|
||||||
source: ImageSource.camera, preferredCameraDevice: CameraDevice.rear);
|
await state.imagePicker.pickImage(source: ImageSource.camera, preferredCameraDevice: CameraDevice.rear);
|
||||||
if (photo != null) {
|
if (photo != null) {
|
||||||
state.image = photo;
|
state.image = photo;
|
||||||
// logic.getUpTokenRequest();
|
// logic.getUpTokenRequest();
|
||||||
|
|||||||
@ -190,4 +190,7 @@ abstract class Api {
|
|||||||
'/lockSetting/updateCatEyeConfig'; //猫眼相关设置
|
'/lockSetting/updateCatEyeConfig'; //猫眼相关设置
|
||||||
|
|
||||||
final String updateFaceConfigURL = '/lockSetting/updateFaceConfig'; //面容相关设置
|
final String updateFaceConfigURL = '/lockSetting/updateFaceConfig'; //面容相关设置
|
||||||
|
|
||||||
|
final String getLockNoticeSettingURL =
|
||||||
|
'/lockSetting/getLockNoticeSetting'; //获取锁消息设置
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1747,6 +1747,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
'faceAutoLightScreen': faceAutoLightScreen,
|
'faceAutoLightScreen': faceAutoLightScreen,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 获取锁消息设置
|
||||||
|
Future<Response> getLockNoticeSetting(int lockId) => post(
|
||||||
|
getLockNoticeSettingURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -1779,4 +1779,11 @@ class ApiRepository {
|
|||||||
lockId, faceAutoLightScreen);
|
lockId, faceAutoLightScreen);
|
||||||
return VersionUndateEntity.fromJson(res.body);
|
return VersionUndateEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取锁消息设置
|
||||||
|
Future<VersionUndateEntity> getLockNoticeSetting(
|
||||||
|
{required int lockId}) async {
|
||||||
|
final res = await apiProvider.getLockNoticeSetting(lockId);
|
||||||
|
return VersionUndateEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class CallTalk {
|
|||||||
}
|
}
|
||||||
// 视频数据
|
// 视频数据
|
||||||
else {
|
else {
|
||||||
print('********视频数据来了');
|
// print('********视频数据来了');
|
||||||
// 音视频数据开始下标
|
// 音视频数据开始下标
|
||||||
var bagLen = bb[POS_blen + 2] + bb[POS_blen + 3] * 256;
|
var bagLen = bb[POS_blen + 2] + bb[POS_blen + 3] * 256;
|
||||||
// print('音视频数据开始下标 bagLen:$bagLen');
|
// print('音视频数据开始下标 bagLen:$bagLen');
|
||||||
@ -101,8 +101,8 @@ class CallTalk {
|
|||||||
var getList = bb.sublist(POS_data, bb.length);
|
var getList = bb.sublist(POS_data, bb.length);
|
||||||
iframe!.bb!.addAll(getList);
|
iframe!.bb!.addAll(getList);
|
||||||
}
|
}
|
||||||
print(
|
// print(
|
||||||
'iframe.bagNum: ${iframe!.bagNum} iframe.bagReceive: ${iframe!.bagReceive}');
|
// 'iframe.bagNum: ${iframe!.bagNum} iframe.bagReceive: ${iframe!.bagReceive}');
|
||||||
|
|
||||||
// 如果收到的包数等于总包数,说明这一帧数据已经接收完毕
|
// 如果收到的包数等于总包数,说明这一帧数据已经接收完毕
|
||||||
if (iframe!.bagNum == iframe!.bagReceive) {
|
if (iframe!.bagNum == iframe!.bagReceive) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user