fix:修复版本号,并且修复发送钥匙的 bug

This commit is contained in:
anfe 2024-06-04 14:57:18 +08:00
parent bd2f9fa4ac
commit 5d689749d1
4 changed files with 31 additions and 26 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -20,13 +20,16 @@ import 'package:star_lock/tools/storage.dart';
class SendElectronicKeyViewLogic extends BaseGetXController {
SendElectronicKeyViewLogic(this.type);
String type;
final SendElectronicKeyViewState state = SendElectronicKeyViewState();
int? keyId;
String? emailOrPhone;
List<dynamic> get weekDayStr {
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
return state.weekdaysList
.map((e) => TimeUtils.translateWeekday(e))
.toList();
}
@override
@ -178,6 +181,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
? state.idCardController.text
: '');
if (entity.errorCode!.codeIsSuccessful) {
emailOrPhone = state.emailOrPhoneController.text;
state.createUser.value = 0;
state.isSendSuccess = true;
keyId = entity.data!.keyId;
@ -185,6 +189,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
update();
eventBus.fire(ElectronicKeyListRefreshUI());
} else {
emailOrPhone = null;
if (entity.errorCode == 425) {
//
update();
@ -249,12 +254,12 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
}
final NoticeTemplateEntity entity = await ApiRepository.to
.getNoticeTemplate(
lockId: CommonDataManage().currentKeyInfo.lockId!,
keyId: keyId!,
channelType: isPhone ? 1 : 2);
lockId: CommonDataManage().currentKeyInfo.lockId!,
keyId: keyId!,
channelType: isPhone ? 1 : 2);
if (entity.errorCode!.codeIsSuccessful) {
final List<Item?> list =
entity.data!.list!.where((Item item) => item.isUse == 0).toList();
entity.data!.list!.where((Item item) => item.isUse == 0).toList();
if (list.isNotEmpty) {
final Item item = list.first!;
final String template = item.template ?? '';

View File

@ -422,27 +422,27 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
// _openModalBottomSheet();
// },
// ),
OutLineBtn(
btnName:
logic.state.emailOrPhoneController.text.contains('@') ? '邮件通知' : '短信通知',
onClick: () {
if (logic.state.emailOrPhoneController.text.contains('@')) {
Get.toNamed(Routers.sendEmailNotificationPage);
} else {
logic.sendMsg(isPhone: true);
}
},
),
if (logic.emailOrPhone != null)
OutLineBtn(
btnName: logic.emailOrPhone!.contains('@') ? '邮件通知' : '短信通知',
onClick: () {
if (logic.emailOrPhone!.contains('@')) {
Get.toNamed(Routers.sendEmailNotificationPage);
} else {
logic.sendMsg(isPhone: true);
}
},
),
SizedBox(
height: 10.h,
),
OutLineBtn(
btnName: '微信通知',
onClick: () {
logic.sendMsg(
isPhone: logic.state.emailOrPhoneController.text.contains('@'));
},
),
if (logic.emailOrPhone != null)
OutLineBtn(
btnName: '微信通知',
onClick: () {
logic.sendMsg(isPhone: logic.emailOrPhone!.contains('@'));
},
),
],
);
}

View File

@ -62,9 +62,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.53+2024052803xhj 线上环境,提审 sky 线上环境提审
# 1.0.53+2024052804xhj 线上环境,提审 修改鑫锁名字为星星锁
# 1.0.54+2024053001xhj 线上环境,对外发布,提交测试
# 1.0.56+202406401xhj 线上环境,对外发布,提交测试
# 1.0.56+2024060401xhj 线上环境,对外发布,提交测试
version: 1.0.56+202406401
version: 1.0.56+2024060401
environment:
sdk: '>=2.12.0 <3.0.0'