“DaisyWu” 7f1642b09f 1,修复星锁点分享界面少了发送密码到、分享
2,修复星锁类型选择的文字,少了句号。系统短信多了那字,是软件里。
3,修复接收者少了通讯录的头像。及选择通讯录相关逻辑操作
4,修复建议限制50位。接收者如是汉字或位数不够,英文弹框,通通锁提示操作失败。
5,星星锁电子钥匙、密码模块发送成功后,发送短信、邮箱接入最新API,解决发送不成功问题
2024-07-08 18:18:20 +08:00

59 lines
2.0 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: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';
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['unlockType'] != null) {
unlockType.value = Get.arguments['unlockType'];
}
if (Get.arguments['channelType'] != null) {
channelType.value = Get.arguments['channelType'];
updateNotifyTypeText();
}
}
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
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) {
if (notifyTypeSelect.value == 1) {
getNotifyTypeText.value = '系统短信';
} else {
getNotifyTypeText.value = '个人短信';
}
} else {
if (notifyTypeSelect.value == 1) {
getNotifyTypeText.value = '系统邮件';
} else {
getNotifyTypeText.value = '个人邮件';
}
}
}
}