1,修复星锁点分享界面少了发送密码到、分享
2,修复星锁类型选择的文字,少了句号。系统短信多了那字,是软件里。 3,修复接收者少了通讯录的头像。及选择通讯录相关逻辑操作 4,修复建议限制50位。接收者如是汉字或位数不够,英文弹框,通通锁提示操作失败。 5,星星锁电子钥匙、密码模块发送成功后,发送短信、邮箱接入最新API,解决发送不成功问题
This commit is contained in:
parent
98886b7d9f
commit
7f1642b09f
@ -364,7 +364,8 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
||||
'receiver': state.emailOrPhoneController.text,
|
||||
'channelType':
|
||||
state.emailOrPhoneController.text.contains('@') ? 2 : 1,
|
||||
'keyId': logic.keyId
|
||||
'keyId': logic.keyId,
|
||||
'unlockType': 1,
|
||||
});
|
||||
},
|
||||
),
|
||||
@ -501,18 +502,37 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
||||
);
|
||||
}
|
||||
|
||||
void _openModalBottomSheet() {
|
||||
Future _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
constraints: BoxConstraints(maxHeight: 270.h),
|
||||
constraints: BoxConstraints(maxHeight: 323.h),
|
||||
builder: (BuildContext context) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 180.h,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'分享',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
),
|
||||
Container(
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 160.h,
|
||||
color: Colors.white,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal, //横向滚动
|
||||
children: initBottomSheetList()),
|
||||
@ -521,18 +541,23 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
||||
height: 8.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: const EdgeInsets.only(bottom: 0, left: 0, right: 0),
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
@ -600,7 +625,14 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
||||
case 2:
|
||||
//邮件
|
||||
{
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
Get.toNamed(Routers.sendEmailNotificationPage,
|
||||
arguments: <String, Object?>{
|
||||
'receiver': state.emailOrPhoneController.text,
|
||||
'channelType':
|
||||
state.emailOrPhoneController.text.contains('@') ? 2 : 1,
|
||||
'keyId': logic.keyId,
|
||||
'unlockType': 1,
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
||||
@ -424,7 +424,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
arguments: <String, Object?>{
|
||||
'receiver': logic.emailOrPhone,
|
||||
'channelType': logic.state.userNameType.value,
|
||||
'keyId': logic.keyId
|
||||
'keyId': logic.keyId,
|
||||
'unlockType': 1
|
||||
});
|
||||
},
|
||||
),
|
||||
@ -582,18 +583,37 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _openModalBottomSheet() async {
|
||||
Future _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
constraints: BoxConstraints(maxHeight: 270.h),
|
||||
constraints: BoxConstraints(maxHeight: 323.h),
|
||||
builder: (BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 180.h,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'分享',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
),
|
||||
Container(
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 160.h,
|
||||
color: Colors.white,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal, //横向滚动
|
||||
children: initBottomSheetList()),
|
||||
@ -602,18 +622,23 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
height: 8.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: const EdgeInsets.only(bottom: 0, left: 0, right: 0),
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
@ -675,7 +700,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
||||
break;
|
||||
case 2:
|
||||
//邮件
|
||||
Get.toNamed(Routers.sendEmailNotificationPage);
|
||||
Get.toNamed(Routers.sendEmailNotificationPage,
|
||||
arguments: <String, Object?>{'unlockType': 1});
|
||||
break;
|
||||
case 3:
|
||||
//更多
|
||||
|
||||
@ -13,12 +13,18 @@ class SendEmailNotificationLogic extends BaseGetXController {
|
||||
|
||||
//获取电子钥匙通知模板 渠道:1短信 2邮箱
|
||||
Future<void> getKeyNoticeTemplate() async {
|
||||
final SendEmailNotificationEntity entity =
|
||||
await ApiRepository.to.getKeyNoticeTemplate(
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
keyId: state.getKeyId.value,
|
||||
channelType: state.channelType.value,
|
||||
);
|
||||
final SendEmailNotificationEntity entity;
|
||||
if (state.unlockType.value == 1) {
|
||||
entity = await ApiRepository.to.getKeyNoticeTemplate(
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
keyId: state.getKeyId.value,
|
||||
channelType: state.channelType.value);
|
||||
} else {
|
||||
entity = await ApiRepository.to.getPwdNoticeTemplate(
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
keyboardPwdId: state.getKeyId.value,
|
||||
channelType: state.channelType.value);
|
||||
}
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.emailTemplateList.value =
|
||||
entity.data?.list ?? <EmailNotificationItem>[];
|
||||
@ -37,17 +43,32 @@ class SendEmailNotificationLogic extends BaseGetXController {
|
||||
showToast('请输入接收者');
|
||||
return;
|
||||
}
|
||||
final SendEmailNotificationEntity entity =
|
||||
await ApiRepository.to.keyNoticeSubmit(
|
||||
receiverName: state.getReceiver.value.isEmpty
|
||||
? state.receiverController.text
|
||||
: state.getReceiver.value,
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
keyId: state.getKeyId.value,
|
||||
channelType: state.channelType.value,
|
||||
openDoorType: 1,
|
||||
templateType: state.currentNotifyItem.value.type ?? '',
|
||||
);
|
||||
final SendEmailNotificationEntity entity;
|
||||
if (state.unlockType.value == 1) {
|
||||
entity = await ApiRepository.to.keyNoticeSubmit(
|
||||
receiverName: state.getReceiver.value.isEmpty
|
||||
? state.receiverController.text
|
||||
: state.getReceiver.value,
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
keyId: state.getKeyId.value,
|
||||
channelType: state.channelType.value,
|
||||
openDoorType: state.unlockType.value,
|
||||
templateType: state.currentNotifyItem.value.type ?? '',
|
||||
countryCode: state.countryCode.value,
|
||||
);
|
||||
} else {
|
||||
entity = await ApiRepository.to.pwdNoticeSubmit(
|
||||
receiverName: state.getReceiver.value.isEmpty
|
||||
? state.receiverController.text
|
||||
: state.getReceiver.value,
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
|
||||
keyboardPwdId: state.getKeyId.value,
|
||||
channelType: state.channelType.value,
|
||||
openDoorType: state.unlockType.value,
|
||||
templateType: state.currentNotifyItem.value.type ?? '',
|
||||
countryCode: state.countryCode.value,
|
||||
);
|
||||
}
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('发送成功');
|
||||
Get.back();
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
@ -82,52 +84,77 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
||||
},
|
||||
)),
|
||||
Container(
|
||||
height: 360.h,
|
||||
// height: 360.h,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(
|
||||
left: 20.w, right: 20.w, top: 20.h, bottom: 20.h),
|
||||
child: TextField(
|
||||
maxLines: 8,
|
||||
maxLength: 1000,
|
||||
textAlign: TextAlign.start,
|
||||
controller: state.templateContentController,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 22.sp,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
///设置边框四个角的弧度
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
maxLines: 8,
|
||||
maxLength: 1000,
|
||||
textAlign: TextAlign.start,
|
||||
controller: state.templateContentController,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 22.sp,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
///设置边框四个角的弧度
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
||||
|
||||
///用来配置边框的样式
|
||||
borderSide: const BorderSide(
|
||||
///设置边框的颜色
|
||||
color: Color(0xffB2B2B2),
|
||||
///用来配置边框的样式
|
||||
borderSide: const BorderSide(
|
||||
///设置边框的颜色
|
||||
color: Color(0xffB2B2B2),
|
||||
|
||||
///设置边框的粗细
|
||||
width: 0.5,
|
||||
///设置边框的粗细
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
|
||||
///用来配置输入框获取焦点时的颜色
|
||||
focusedBorder: OutlineInputBorder(
|
||||
///设置边框四个角的弧度
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
||||
|
||||
///用来配置边框的样式
|
||||
borderSide: const BorderSide(
|
||||
///设置边框的颜色
|
||||
color: Color(0xffB2B2B2),
|
||||
|
||||
///设置边框的粗细
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
///用来配置输入框获取焦点时的颜色
|
||||
focusedBorder: OutlineInputBorder(
|
||||
///设置边框四个角的弧度
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.h)),
|
||||
|
||||
///用来配置边框的样式
|
||||
borderSide: const BorderSide(
|
||||
///设置边框的颜色
|
||||
color: Color(0xffB2B2B2),
|
||||
|
||||
///设置边框的粗细
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: state.templateContentController.text));
|
||||
EasyLoading.showToast('复制成功'.tr);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20.w, top: 0),
|
||||
child: const Icon(
|
||||
Icons.copy,
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(height: 40.h),
|
||||
_buildNewTemplateBtn(),
|
||||
SizedBox(height: 40.h),
|
||||
SubmitBtn(
|
||||
btnName: '发送'.tr,
|
||||
fontSize: 28.sp,
|
||||
@ -144,7 +171,42 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
); }
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNewTemplateBtn() {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
height: 60.h,
|
||||
margin: EdgeInsets.only(left: 0.w, right: 0.w),
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_btn_add.png',
|
||||
width: 28.w,
|
||||
height: 28.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 6.w,
|
||||
),
|
||||
Text(
|
||||
'新建模版',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.newSMSTemplatePage);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildReceiverItemWidget() {
|
||||
return Container(
|
||||
@ -165,7 +227,7 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Obx(() => Text(
|
||||
'+${state.countryCode.value}',
|
||||
'+${state.countryCode.value.toString()}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 20.sp),
|
||||
@ -183,7 +245,7 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
||||
await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryCode.value = int.parse(result['code']);
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
@ -191,6 +253,32 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
||||
else
|
||||
Container(),
|
||||
getReceiverTFWidget(),
|
||||
Container(
|
||||
width: 32.w,
|
||||
height: 32.w,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
image: DecorationImage(
|
||||
image: AssetImage('images/icon_addressBook.png'),
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
final Contact? currentContact =
|
||||
await logic.state.contactPicker.selectContact();
|
||||
logic.state.contact = currentContact!;
|
||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||
logic.state.receiverController.text = currentContact
|
||||
.phoneNumbers![0]
|
||||
.replaceAll(RegExp(r'\s+\b|\b\s'), '');
|
||||
}
|
||||
// if (currentContact.fullName!.isNotEmpty) {
|
||||
// logic.state.keyNameController.text = currentContact.fullName!;
|
||||
// }
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -210,7 +298,7 @@ class _SendEmailNotificationPageState extends State<SendEmailNotificationPage> {
|
||||
maxLines: 1,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.deny('\n'),
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
],
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.end,
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_entity.dart';
|
||||
|
||||
@ -12,6 +13,10 @@ class SendEmailNotificationState {
|
||||
getKeyId.value = Get.arguments['keyId'];
|
||||
}
|
||||
|
||||
if (Get.arguments['unlockType'] != null) {
|
||||
unlockType.value = Get.arguments['unlockType'];
|
||||
}
|
||||
|
||||
if (Get.arguments['channelType'] != null) {
|
||||
channelType.value = Get.arguments['channelType'];
|
||||
updateNotifyTypeText();
|
||||
@ -29,8 +34,11 @@ class SendEmailNotificationState {
|
||||
<EmailNotificationItem>[].obs;
|
||||
Rx<EmailNotificationItem> currentNotifyItem = EmailNotificationItem().obs;
|
||||
RxInt getKeyId = 0.obs; //获取钥匙成功得到的keyId
|
||||
RxString countryCode = '86'.obs;
|
||||
RxInt countryCode = 86.obs;
|
||||
RxString countryName = '中国'.obs;
|
||||
late Contact contact;
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
RxInt unlockType = 0.obs; //开锁方式 1:电子钥匙 2:密码
|
||||
|
||||
Future<void> updateNotifyTypeText() async {
|
||||
if (channelType.value == 1) {
|
||||
|
||||
@ -47,7 +47,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
height: 30.h,
|
||||
width: 30.w,
|
||||
),
|
||||
onPressed: openModalBottomSheet,
|
||||
onPressed: _openModalBottomSheet,
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -393,18 +393,37 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> openModalBottomSheet() async {
|
||||
Future<void> _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
constraints: BoxConstraints(maxHeight: 270.h),
|
||||
constraints: BoxConstraints(maxHeight: 323.h),
|
||||
builder: (BuildContext context) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'分享',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
),
|
||||
Container(
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 160.h,
|
||||
color: Colors.white,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal, //横向滚动
|
||||
children: initBottomSheetList()),
|
||||
@ -413,18 +432,23 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
height: 8.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: const EdgeInsets.only(bottom: 0, left: 0, right: 0),
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
@ -486,7 +510,8 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
arguments: <String, Object?>{
|
||||
'receiver': '',
|
||||
'channelType': itemIndex == 1 ? 1 : 2,
|
||||
'keyId': CommonDataManage().currentKeyInfo.keyId,
|
||||
'keyId': state.itemData.value.keyboardPwdId,
|
||||
'unlockType': 2
|
||||
});
|
||||
break;
|
||||
case 3: //更多
|
||||
|
||||
@ -146,6 +146,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
state.pwdController.text = '';
|
||||
if (entity.data != null) {
|
||||
state.getPwdStr.value = entity.data!.keyboardPwd!;
|
||||
state.getPwdID.value = entity.data!.keyboardPwdId!;
|
||||
}
|
||||
eventBus.fire(GetPasswordListRefreshUI());
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -660,13 +661,32 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
constraints: BoxConstraints(maxHeight: 270.h),
|
||||
constraints: BoxConstraints(maxHeight: 323.h),
|
||||
builder: (BuildContext context) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'分享',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: AppColors.blackColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
),
|
||||
Container(
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 160.h,
|
||||
color: Colors.white,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal, //横向滚动
|
||||
children: initBottomSheetList()),
|
||||
@ -675,18 +695,23 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
height: 8.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: const EdgeInsets.only(bottom: 0, left: 0, right: 0),
|
||||
width: ScreenUtil().screenWidth,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
@ -805,7 +830,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
arguments: <String, Object?>{
|
||||
'receiver': '',
|
||||
'channelType': itemIndex == 1 ? 1 : 2,
|
||||
'keyId': CommonDataManage().currentKeyInfo.keyId,
|
||||
'keyId': state.getPwdID.value,
|
||||
'unlockType': 2
|
||||
});
|
||||
break;
|
||||
case 3: //更多
|
||||
|
||||
@ -4,7 +4,6 @@ import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
|
||||
class PasswordKeyPerpetualState {
|
||||
|
||||
PasswordKeyPerpetualState() {
|
||||
Map map = Get.arguments;
|
||||
if (map['keyInfo'] != null) {
|
||||
@ -30,7 +29,8 @@ class PasswordKeyPerpetualState {
|
||||
RxInt loopEndHours = DateTime.now().hour.obs;
|
||||
RxString loopModeStr = '周末'.obs; //循环模式
|
||||
|
||||
RxString customBeginTime = DateTool().getNowDateWithType(2).obs; //默认为当前时间 开始时间
|
||||
RxString customBeginTime =
|
||||
DateTool().getNowDateWithType(2).obs; //默认为当前时间 开始时间
|
||||
RxString customEndTime = DateTool().getNowDateWithType(2).obs; //默认为当前时间 结束时间
|
||||
|
||||
final RxInt widgetType = 0.obs;
|
||||
@ -42,4 +42,5 @@ class PasswordKeyPerpetualState {
|
||||
|
||||
RxInt pwdNumber = 0.obs; // 密码编号
|
||||
late TabController tabController;
|
||||
RxInt getPwdID = 0.obs; // 获取密码ID
|
||||
}
|
||||
|
||||
@ -70,7 +70,8 @@ class _AddAuthorizedAdministratorPageState
|
||||
: state.lockIdList.value.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
final result = await Get.toNamed(Routers.massSendLockGroupListPage,
|
||||
final result = await Get.toNamed(
|
||||
Routers.massSendLockGroupListPage,
|
||||
arguments: <String, Object>{
|
||||
'keyLimits': '1',
|
||||
'lockIdList': state.lockIdList.value
|
||||
@ -94,7 +95,8 @@ class _AddAuthorizedAdministratorPageState
|
||||
isHaveRightWidget: true,
|
||||
isTipsImg: true,
|
||||
tipsImgAction: () {
|
||||
ShowTipView().showSureAlertDialog('授权管理员只能查看和管理自己下发的钥匙、密码等权限'.tr);
|
||||
ShowTipView()
|
||||
.showSureAlertDialog('授权管理员只能查看和管理自己下发的钥匙、密码等权限'.tr);
|
||||
},
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w,
|
||||
@ -128,7 +130,8 @@ class _AddAuthorizedAdministratorPageState
|
||||
: state.lockIdList.value.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
final result = await Get.toNamed(Routers.massSendLockGroupListPage,
|
||||
final result = await Get.toNamed(
|
||||
Routers.massSendLockGroupListPage,
|
||||
arguments: <String, Object>{
|
||||
'keyLimits': '1',
|
||||
'lockIdList': state.lockIdList.value
|
||||
@ -153,7 +156,8 @@ class _AddAuthorizedAdministratorPageState
|
||||
isHaveRightWidget: true,
|
||||
isTipsImg: true,
|
||||
tipsImgAction: () {
|
||||
ShowTipView().showSureAlertDialog('授权管理员只能查看和管理自己下发的钥匙、密码等权限'.tr);
|
||||
ShowTipView()
|
||||
.showSureAlertDialog('授权管理员只能查看和管理自己下发的钥匙、密码等权限'.tr);
|
||||
},
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w,
|
||||
@ -217,7 +221,8 @@ class _AddAuthorizedAdministratorPageState
|
||||
}
|
||||
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(bool isHaveBtn, String tfStr, TextEditingController editController) {
|
||||
Widget getTFWidget(
|
||||
bool isHaveBtn, String tfStr, TextEditingController editController) {
|
||||
return SizedBox(
|
||||
height: 65.h,
|
||||
width: 300.w,
|
||||
@ -487,7 +492,8 @@ class _AddAuthorizedAdministratorPageState
|
||||
'receiver': state.emailOrPhoneController.text,
|
||||
'channelType':
|
||||
state.emailOrPhoneController.text.contains('@') ? 2 : 1,
|
||||
'keyId': state.getKeyId.value
|
||||
'keyId': state.getKeyId.value,
|
||||
'unlockType': 1
|
||||
});
|
||||
},
|
||||
),
|
||||
@ -576,7 +582,13 @@ class _AddAuthorizedAdministratorPageState
|
||||
case 2:
|
||||
//邮件
|
||||
{
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage,
|
||||
arguments: <String, Object?>{
|
||||
'receiver': state.emailOrPhoneController.text,
|
||||
'channelType': 2,
|
||||
'keyId': state.getKeyId.value,
|
||||
'unlockType': 1
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
|
||||
@ -20,7 +20,7 @@ class CustomSMSTemplateListLogic extends BaseGetXController {
|
||||
}
|
||||
final CustomSMSTemplateListEntity entity = await ApiRepository.to
|
||||
.getSMSTemplateList(
|
||||
type: state.type.value,
|
||||
channelType: state.type.value,
|
||||
pageNo: pageNo,
|
||||
pageSize: int.parse(pageSize));
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
|
||||
@ -255,7 +255,7 @@ abstract class Api {
|
||||
|
||||
final String checkIpURL = '/checkIp/ip';
|
||||
final String keyNoticeTemplateURL = '/key/getNoticeTemplate'; //获取电子钥匙通知模板
|
||||
final String keyNoticeSubmitURL = '/key/noticeSubmit'; //发送短信、邮件通知
|
||||
final String keyNoticeSubmitURL = '/v2/key/noticeSubmit'; //发送短信、邮件通知
|
||||
final String lockUpdateLockInfo = '/lock/updateLockInfo'; //更新锁固件版本
|
||||
final String exportLockRecordsURL = '/lockRecords/export'; //导出锁操作记录
|
||||
}
|
||||
|
||||
@ -2199,11 +2199,11 @@ class ApiProvider extends BaseProvider {
|
||||
|
||||
// 获取短信模板列表
|
||||
Future<Response<dynamic>> getSMSTemplateList(
|
||||
int type, int pageNo, int pageSize) =>
|
||||
int channelType, int pageNo, int pageSize) =>
|
||||
post(
|
||||
smsTemplateListURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{
|
||||
'type': type,
|
||||
'channelType': channelType,
|
||||
'pageNo': pageNo,
|
||||
'pageSize': pageSize
|
||||
}),
|
||||
@ -2258,13 +2258,31 @@ class ApiProvider extends BaseProvider {
|
||||
jsonEncode(<String, dynamic>{
|
||||
'lockId': lockId,
|
||||
'keyId': keyId,
|
||||
'channelType': channelType
|
||||
'channelType': channelType,
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
|
||||
Future<Response<dynamic>> keyNoticeSubmit(String receiverName, int lockId,
|
||||
int keyId, int channelType, int openDoorType, String templateType) =>
|
||||
Future<Response<dynamic>> getPwdNoticeTemplate(
|
||||
int lockId, int keyboardPwdId, int channelType) =>
|
||||
post(
|
||||
keyNoticeTemplateURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{
|
||||
'lockId': lockId,
|
||||
'keyboardPwdId': keyboardPwdId,
|
||||
'channelType': channelType,
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
|
||||
Future<Response<dynamic>> keyNoticeSubmit(
|
||||
String receiverName,
|
||||
int lockId,
|
||||
int keyId,
|
||||
int channelType,
|
||||
int openDoorType,
|
||||
String templateType,
|
||||
int countryCode) =>
|
||||
post(
|
||||
keyNoticeSubmitURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{
|
||||
@ -2274,6 +2292,29 @@ class ApiProvider extends BaseProvider {
|
||||
'channelType': channelType,
|
||||
'openDoorType': openDoorType,
|
||||
'templateType': templateType,
|
||||
'countryCode': countryCode
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
|
||||
Future<Response<dynamic>> pwdNoticeSubmit(
|
||||
String receiverName,
|
||||
int lockId,
|
||||
int keyboardPwdId,
|
||||
int channelType,
|
||||
int openDoorType,
|
||||
String templateType,
|
||||
int countryCode) =>
|
||||
post(
|
||||
keyNoticeSubmitURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{
|
||||
'receiverName': receiverName,
|
||||
'lockId': lockId,
|
||||
'keyboardPwdId': keyboardPwdId,
|
||||
'channelType': channelType,
|
||||
'openDoorType': openDoorType,
|
||||
'templateType': templateType,
|
||||
'countryCode': countryCode
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
);
|
||||
|
||||
@ -2224,9 +2224,11 @@ class ApiRepository {
|
||||
|
||||
// 获取短信模板列表
|
||||
Future<CustomSMSTemplateListEntity> getSMSTemplateList(
|
||||
{required int type, required int pageNo, required int pageSize}) async {
|
||||
{required int channelType,
|
||||
required int pageNo,
|
||||
required int pageSize}) async {
|
||||
final Response<dynamic> res =
|
||||
await apiProvider.getSMSTemplateList(type, pageNo, pageSize);
|
||||
await apiProvider.getSMSTemplateList(channelType, pageNo, pageSize);
|
||||
return CustomSMSTemplateListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -2277,17 +2279,54 @@ class ApiRepository {
|
||||
return SendEmailNotificationEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 发送短信、邮件通知
|
||||
Future<SendEmailNotificationEntity> keyNoticeSubmit({
|
||||
required String receiverName,
|
||||
// 获取密码通知模板
|
||||
Future<SendEmailNotificationEntity> getPwdNoticeTemplate({
|
||||
required int lockId,
|
||||
required int keyId,
|
||||
required int keyboardPwdId,
|
||||
required int channelType,
|
||||
required int openDoorType,
|
||||
required String templateType,
|
||||
}) async {
|
||||
final Response<dynamic> res = await apiProvider.getPwdNoticeTemplate(
|
||||
lockId, keyboardPwdId, channelType);
|
||||
return SendEmailNotificationEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 电子钥匙发送短信、邮件通知
|
||||
Future<SendEmailNotificationEntity> keyNoticeSubmit(
|
||||
{required String receiverName,
|
||||
required int lockId,
|
||||
required int keyId,
|
||||
required int channelType,
|
||||
required int openDoorType,
|
||||
required String templateType,
|
||||
required int countryCode}) async {
|
||||
final Response<dynamic> res = await apiProvider.keyNoticeSubmit(
|
||||
receiverName, lockId, keyId, channelType, openDoorType, templateType);
|
||||
receiverName,
|
||||
lockId,
|
||||
keyId,
|
||||
channelType,
|
||||
openDoorType,
|
||||
templateType,
|
||||
countryCode);
|
||||
return SendEmailNotificationEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 密码发送短信、邮件通知
|
||||
Future<SendEmailNotificationEntity> pwdNoticeSubmit(
|
||||
{required String receiverName,
|
||||
required int lockId,
|
||||
required int keyboardPwdId,
|
||||
required int channelType,
|
||||
required int openDoorType,
|
||||
required String templateType,
|
||||
required int countryCode}) async {
|
||||
final Response<dynamic> res = await apiProvider.pwdNoticeSubmit(
|
||||
receiverName,
|
||||
lockId,
|
||||
keyboardPwdId,
|
||||
channelType,
|
||||
openDoorType,
|
||||
templateType,
|
||||
countryCode);
|
||||
return SendEmailNotificationEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
@ -68,8 +68,8 @@ class EmailNotifyTypeSelectAlert extends StatelessWidget {
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
isEmail
|
||||
? '邮件将从软件平台直接发给用户,请根据需要在软件那里购买邮件数量'
|
||||
: '短信将从软件平台直接发给用户,请根据需要在软件那里购买短信数量',
|
||||
? '邮件将从软件平台直接发给用户,请根据需要在软件里购买邮件数量。'
|
||||
: '短信将从软件平台直接发给用户,请根据需要在软件里购买短信数量。',
|
||||
style: TextStyle(fontSize: 18.sp),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user