1,通过个人手机短信发送密码给用户,Android端差异化处理
2,授权管理员模块发送成功后,通过邮件、短信发送给用户
This commit is contained in:
parent
74393a3d64
commit
a524642a88
@ -359,11 +359,13 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage>
|
|||||||
btnName:
|
btnName:
|
||||||
state.emailOrPhoneController.text.contains('@') ? '邮件通知' : '短信通知',
|
state.emailOrPhoneController.text.contains('@') ? '邮件通知' : '短信通知',
|
||||||
onClick: () {
|
onClick: () {
|
||||||
if (state.emailOrPhoneController.text.contains('@')) {
|
Get.toNamed(Routers.sendEmailNotificationPage,
|
||||||
Get.toNamed(Routers.sendEmailNotificationPage);
|
arguments: <String, Object?>{
|
||||||
} else {
|
'receiver': state.emailOrPhoneController.text,
|
||||||
logic.sendMsg(isPhone: true);
|
'channelType':
|
||||||
}
|
state.emailOrPhoneController.text.contains('@') ? 2 : 1,
|
||||||
|
'keyId': logic.keyId
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@ -416,12 +416,6 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
// OutLineBtn(
|
|
||||||
// btnName: '分享'.tr,
|
|
||||||
// onClick: () {
|
|
||||||
// _openModalBottomSheet();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
if (logic.emailOrPhone != null)
|
if (logic.emailOrPhone != null)
|
||||||
OutLineBtn(
|
OutLineBtn(
|
||||||
btnName: logic.state.userNameType.value == 1 ? '短信通知' : '邮件通知',
|
btnName: logic.state.userNameType.value == 1 ? '短信通知' : '邮件通知',
|
||||||
|
|||||||
@ -54,15 +54,32 @@ class SendEmailNotificationLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//发送邮件、短信
|
||||||
Future<void> sendPersonalSMSOrEmail() async {
|
Future<void> sendPersonalSMSOrEmail() async {
|
||||||
|
if (state.receiverController.text.isEmpty &&
|
||||||
|
state.getReceiver.value.isEmpty) {
|
||||||
|
showToast('请输入接收者');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (state.channelType.value == 1) {
|
if (state.channelType.value == 1) {
|
||||||
|
Uri smsUri;
|
||||||
//短信
|
//短信
|
||||||
final String phoneNumber = state.getReceiver.value.isEmpty
|
final String phoneNumber = state.getReceiver.value.isEmpty
|
||||||
? state.receiverController.text
|
? state.receiverController.text
|
||||||
: state.getReceiver.value;
|
: state.getReceiver.value;
|
||||||
final String message = state.templateContentController.text;
|
final String message = state.templateContentController.text;
|
||||||
final Uri smsUri =
|
|
||||||
Uri.parse('sms:$phoneNumber&body=${Uri.encodeComponent(message)}');
|
if (Platform.isAndroid) {
|
||||||
|
smsUri = Uri(
|
||||||
|
scheme: 'sms',
|
||||||
|
path: phoneNumber,
|
||||||
|
query: 'body=${Uri.encodeComponent(message)}',
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
smsUri =
|
||||||
|
Uri.parse('sms:$phoneNumber&body=${Uri.encodeComponent(message)}');
|
||||||
|
}
|
||||||
|
|
||||||
if (await canLaunchUrl(smsUri)) {
|
if (await canLaunchUrl(smsUri)) {
|
||||||
await launchUrl(smsUri);
|
await launchUrl(smsUri);
|
||||||
|
|||||||
@ -72,6 +72,8 @@ class AddAuthorizedAdministratorLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.isSendSuccess.value = true;
|
state.isSendSuccess.value = true;
|
||||||
state.isCreateUser.value = false;
|
state.isCreateUser.value = false;
|
||||||
|
state.getKeyId.value = entity.data!.keyId ?? 0;
|
||||||
|
|
||||||
// Toast.show(msg: "添加成功");
|
// Toast.show(msg: "添加成功");
|
||||||
|
|
||||||
eventBus.fire(AuthorizedAdministratorListPageRefreshUI());
|
eventBus.fire(AuthorizedAdministratorListPageRefreshUI());
|
||||||
|
|||||||
@ -478,14 +478,13 @@ class _AddAuthorizedAdministratorPageState
|
|||||||
btnName:
|
btnName:
|
||||||
state.emailOrPhoneController.text.contains('@') ? '邮件通知' : '短信通知',
|
state.emailOrPhoneController.text.contains('@') ? '邮件通知' : '短信通知',
|
||||||
onClick: () {
|
onClick: () {
|
||||||
if (state.emailOrPhoneController.text.contains('@')) {
|
Get.toNamed(Routers.sendEmailNotificationPage,
|
||||||
Get.toNamed(Routers.sendEmailNotificationPage);
|
arguments: <String, Object?>{
|
||||||
} else {
|
'receiver': state.emailOrPhoneController.text,
|
||||||
// _openModalBottomSheet();
|
'channelType':
|
||||||
NativeInteractionTool()
|
state.emailOrPhoneController.text.contains('@') ? 2 : 1,
|
||||||
.loadNativeShare(shareText: state.pwdShareStr);
|
'keyId': state.getKeyId.value
|
||||||
}
|
});
|
||||||
// Get.toNamed(state.emailOrPhoneController.text.contains("@")? Routers.sendEmailNotificationPage:Routers.sendEmailNotificationPage);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@ -34,4 +34,5 @@ class AddAuthorizedAdministratorState {
|
|||||||
final Rx<LockListInfoItemEntity> keyInfo = LockListInfoItemEntity().obs;
|
final Rx<LockListInfoItemEntity> keyInfo = LockListInfoItemEntity().obs;
|
||||||
|
|
||||||
String pwdShareStr = '您好,您的授权管理员生成成功';
|
String pwdShareStr = '您好,您的授权管理员生成成功';
|
||||||
|
RxInt getKeyId = 0.obs;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user