feed_back_controller.dart 1023 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import 'package:get/get.dart';
  2. import 'package:get/get_core/src/get_main.dart';
  3. import 'package:injectable/injectable.dart';
  4. import 'package:location/base/base_controller.dart';
  5. import 'package:location/handler/event_handler.dart';
  6. import 'package:location/resource/string.gen.dart';
  7. import 'package:location/utils/toast_util.dart';
  8. import '../../data/consts/event_id.dart';
  9. import '../../sdk/qiyu/qi_yu_helper.dart';
  10. @injectable
  11. class FeedBackController extends BaseController {
  12. final RxString _content = RxString('');
  13. String get content => _content.value;
  14. void back() {
  15. Get.back();
  16. }
  17. set content(String value) {
  18. _content.value = value;
  19. }
  20. void submit() {
  21. if (content.isEmpty) {
  22. ToastUtil.show(StringName.feedBackHint);
  23. return;
  24. }
  25. EventHandler.report(EventId.event_8004002,
  26. params: {EventId.eventFeedbackId: content});
  27. ToastUtil.show(StringName.feedBackSuccess);
  28. Get.back();
  29. }
  30. void onCustomerServiceClick() {
  31. QiYuHelper.openCustomService();
  32. }
  33. }