|
|
@@ -6,19 +6,28 @@ import 'package:location/data/repositories/account_repository.dart';
|
|
|
import 'package:location/data/repositories/urgent_contact_repository.dart';
|
|
|
import 'package:location/handler/error_handler.dart';
|
|
|
import 'package:location/module/member/member_page.dart';
|
|
|
+import 'package:location/module/urgent_contact/urgent_contact_click_help_dialog.dart';
|
|
|
import 'package:location/popup/urgent_contact_more_action_popup.dart';
|
|
|
import 'package:location/resource/string.gen.dart';
|
|
|
import 'package:location/utils/toast_util.dart';
|
|
|
|
|
|
import '../../data/bean/contact_info.dart';
|
|
|
+import '../../data/bean/member_status_info.dart';
|
|
|
import '../../dialog/common_alert_dialog_impl.dart';
|
|
|
+import '../../utils/mmkv_util.dart';
|
|
|
import 'add_contact/add_urgent_contact_view.dart';
|
|
|
|
|
|
+///求助提示框记录
|
|
|
+const String _kChickHelpAlertKey = "urgent_chick_help_alder_key";
|
|
|
+
|
|
|
@injectable
|
|
|
class UrgentContactController extends BaseController {
|
|
|
final UrgentContactRepository _urgentContactRepository;
|
|
|
final AccountRepository accountRepository;
|
|
|
|
|
|
+ Rxn<MemberStatusInfo> get memberStatusInfo =>
|
|
|
+ accountRepository.memberStatusInfo;
|
|
|
+
|
|
|
RxList<ContactInfo> get contactList => _urgentContactRepository.contactList;
|
|
|
|
|
|
UrgentContactController(
|
|
|
@@ -27,6 +36,7 @@ class UrgentContactController extends BaseController {
|
|
|
@override
|
|
|
void onReady() {
|
|
|
super.onReady();
|
|
|
+ _onShowRequestHelpTip();
|
|
|
}
|
|
|
|
|
|
void back() {
|
|
|
@@ -47,6 +57,24 @@ class UrgentContactController extends BaseController {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ //弹出求助提示
|
|
|
+ void _onShowRequestHelpTip() {
|
|
|
+ if (Get.parameters != null) {
|
|
|
+ String isShowRequestTip = Get.parameters["isShowRequest"] ?? "0";
|
|
|
+ if (isShowRequestTip == "1") {
|
|
|
+ String? memberPageKeyStr = KVUtil.getString(_kChickHelpAlertKey, '');
|
|
|
+ if ((memberStatusInfo.value?.expired == true || memberStatusInfo.value?.expired == null) &&
|
|
|
+ (memberPageKeyStr ?? '').length == 0) {
|
|
|
+ ///永久化存储
|
|
|
+ KVUtil.putString(_kChickHelpAlertKey, _kChickHelpAlertKey);
|
|
|
+ UrgentContactClickHelpDialog.show(confirmOnTap: () {
|
|
|
+ MemberPage.start();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
void _setDefaultContact(ContactInfo contactInfo) {
|
|
|
_urgentContactRepository
|
|
|
.contactFavor(
|