|
...
|
...
|
@@ -3,6 +3,7 @@ import 'package:doublefeel_flutter/app/utils/dialog_utils.dart'; |
|
|
|
import 'package:doublefeel_flutter/core/network/api/user_api.dart';
|
|
|
|
import 'package:doublefeel_flutter/core/result/app_result.dart';
|
|
|
|
import 'package:doublefeel_flutter/core/util/app_toast.dart';
|
|
|
|
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
|
|
|
|
import 'package:doublefeel_flutter/pigeon/platform_api.g.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
...
|
...
|
@@ -35,7 +36,7 @@ class SubmitFeedbackController extends GetxController { |
|
|
|
Future<void> pickImages() async {
|
|
|
|
final remainingCount = maxImageCount - selectedImages.length;
|
|
|
|
if (remainingCount <= 0) {
|
|
|
|
AppToast.show('最多上传5个图片或视频');
|
|
|
|
AppToast.show(l10n.feedbackMaxImagesLimit(maxImageCount));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -46,7 +47,7 @@ class SubmitFeedbackController extends GetxController { |
|
|
|
imageQuality: 85,
|
|
|
|
);
|
|
|
|
} catch (_) {
|
|
|
|
AppToast.show('无法选择图片,请稍后重试');
|
|
|
|
AppToast.show(l10n.feedbackSelectImageError);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -65,12 +66,12 @@ class SubmitFeedbackController extends GetxController { |
|
|
|
|
|
|
|
Future<void> submit() async {
|
|
|
|
if (feedbackTextController.text.trim().isEmpty) {
|
|
|
|
AppToast.show('请输入问题和反馈');
|
|
|
|
AppToast.show(l10n.feedbackEmptyContentHint);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
final email = contactTextController.text.trim();
|
|
|
|
if (email.isNotEmpty && !_emailRegExp.hasMatch(email)) {
|
|
|
|
AppToast.show('邮箱格式错误,请重新输入');
|
|
|
|
AppToast.show(l10n.feedbackInvalidEmail);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Get.dialog(
|
|
...
|
...
|
@@ -105,9 +106,9 @@ class SubmitFeedbackController extends GetxController { |
|
|
|
case AppSuccess():
|
|
|
|
await DialogUtils.showCommonDialog(DialogMetaData(
|
|
|
|
iconAsset: null,
|
|
|
|
title: '反馈提交成功',
|
|
|
|
message: '谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。',
|
|
|
|
confirmText: '好的',
|
|
|
|
title: l10n.feedbackSubmitSuccessTitle,
|
|
|
|
message: l10n.feedbackSubmitSuccessMessage,
|
|
|
|
confirmText: l10n.feedbackSubmitSuccessConfirm,
|
|
|
|
));
|
|
|
|
Get.back();
|
|
|
|
case AppFailure(:final error):
|
...
|
...
|
|