Daisy 4c9dd152ca 1,修复密码详情分享报错问题
2,完成密码模块系统邮件通知、短信通知发送的对接及兼容
2024-06-12 16:49:39 +08:00

64 lines
2.1 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_entity.dart';
class SendEmailNotificationState {
SendEmailNotificationState() {
if (Get.arguments['receiver'] != null) {
getReceiver.value = Get.arguments['receiver'];
}
if (Get.arguments['keyId'] != null) {
getKeyId.value = Get.arguments['keyId'];
}
if (Get.arguments['channelType'] != null) {
channelType.value = Get.arguments['channelType'];
updateNotifyTypeText();
// if (channelType.value == 1) {
// if (notifyTypeSelect.value == 1) {
// getNotifyTypeText.value = '系统短信';
// } else {
// getNotifyTypeText.value = '个人短信';
// }
// } else {
// if (notifyTypeSelect.value == 1) {
// getNotifyTypeText.value = '系统邮件';
// } else {
// getNotifyTypeText.value = '个人邮件';
// }
// }
}
}
RxString getReceiver = ''.obs;
final TextEditingController templateContentController =
TextEditingController();
final TextEditingController receiverController = TextEditingController();
RxInt notifyTypeSelect = 1.obs; //1 代表系统2 代表个人
RxInt channelType = 0.obs; //1 代表短信2 代表邮件
RxString getNotifyTypeText = ''.obs;
RxList<EmailNotificationItem> emailTemplateList =
<EmailNotificationItem>[].obs;
Rx<EmailNotificationItem> currentNotifyItem = EmailNotificationItem().obs;
RxInt getKeyId = 0.obs; //获取钥匙成功得到的keyId
RxString countryCode = '86'.obs;
RxString countryName = '中国'.obs;
Future<void> updateNotifyTypeText() async {
if (channelType.value == 1) {
if (notifyTypeSelect.value == 1) {
getNotifyTypeText.value = '系统短信';
} else {
getNotifyTypeText.value = '个人短信';
}
} else {
if (notifyTypeSelect.value == 1) {
getNotifyTypeText.value = '系统邮件';
} else {
getNotifyTypeText.value = '个人邮件';
}
}
}
}