Ver código fonte

活动注册

周睿 1 ano atrás
pai
commit
5ca7edbdaf

+ 2 - 2
app_business/lib/service/api.dart

@@ -6,9 +6,8 @@ import 'package:app_business/generated/base.pb.dart' as pb;
 import 'package:app_business/generated/google/protobuf/timestamp.pb.dart' as pb;
 import 'package:app_business/generated/track_offical.pbgrpc.dart' as pb;
 import 'package:app_business/service/app.dart';
-import 'package:common_pub/model.dart';
 import 'package:grpc/grpc.dart';
-import 'package:track_common/model/map_info.dart';
+import 'package:track_common/model.dart';
 import 'package:track_common/track_common.dart';
 
 import 'abase.dart';
@@ -16,6 +15,7 @@ import 'abase.dart';
 export 'package:app_business/generated/google/protobuf/timestamp.pb.dart';
 export 'package:app_business/generated/track_offical.pbgrpc.dart'
     show ToMatchRegusterAddRequest, ToMatchRegusterListRequest;
+export 'package:fixnum/fixnum.dart' show Int64;
 
 typedef SmsType = pb.SmsType;
 typedef IdRequest = pb.IdRequest;

+ 5 - 5
app_business/lib/view/home/event_manage/event_manage.dart

@@ -102,8 +102,10 @@ class EventManage extends GetView<EventManagerController> {
             height: 22.76,
             child: SmallButton(
               color: const Color(0xffff0000),
-              onPressed: () {},
-              child: Text('删除'),
+              onPressed: () {
+                controller.deleteSignIn(one);
+              },
+              child: const Text('删除'),
             ))
       ]);
     });
@@ -133,9 +135,7 @@ class EventTitle extends GetView<EventManagerController> {
     ];
 
     if (selected) {
-      children.add(SizedBox(
-        height: 2,
-      ));
+      children.add(const SizedBox(height: 2));
       children.add(Container(
         decoration: const BoxDecoration(
             color: Color(0xfff1f1f1),

+ 30 - 3
app_business/lib/view/home/event_manage/event_manage_controller.dart

@@ -1,8 +1,7 @@
-import 'package:app_business/service/abase.dart';
 import 'package:app_business/service/api.dart';
-import 'package:fixnum/fixnum.dart';
 import 'package:track_common/service/map_watch.dart';
 import 'package:track_common/track_common.dart';
+import 'package:track_common/widget.dart';
 
 class EventInManage {
   int id = 0;
@@ -94,10 +93,38 @@ class EventManagerController extends GetxController {
   }
 
   Future<void> deleteEvent(EventInManage event) async {
-    await _api.stub.toMatchRegusterDel(IdRequest()..id = Int64(event.id));
+    Get.dialog(AppDialog(
+        title: const Text('删除比赛'),
+        content: const Text('确认删除?'),
+        onCancel: () => Get.back(),
+        onConfirm: () async {
+          _api.stub
+              .toMatchRegusterDel(IdRequest()..id = Int64(event.id))
+              .then((p0) {}, onError: (e) {
+            Get.snackbar('删除失败', '$e');
+          });
+          Get.back();
+        }));
   }
 
   Future<void> eventEdit(int id, EventRegisterInfo event) {
     return _api.eventEdit(id, event);
   }
+
+  Future<void> deleteSignIn(UserInManage user) async {
+    Get.dialog(AppDialog(
+        title: const Text('删除签到'),
+        content: const Text('确认删除?'),
+        onCancel: () => Get.back(),
+        onConfirm: () async {
+          _api.stub
+              .matchChackInsDel(IdRequest()..id = Int64(user.checkId))
+              .then((p0) {
+            debug('删除签到:${user.checkId}');
+          }, onError: (e) {
+            Get.snackbar('删除失败', '$e');
+          });
+          Get.back();
+        }));
+  }
 }

+ 1 - 1
libs/common_pub

@@ -1 +1 @@
-Subproject commit 4cff0a3c27b2d26f8a00a396fd8cbf1c2dda2bc9
+Subproject commit 4e2b200cfedb869a52074e541fed11e1b71de6d3

+ 1 - 0
libs/track_common/lib/widget.dart

@@ -1,3 +1,4 @@
+export 'package:common_pub/ui.dart';
 export 'package:flutter/material.dart';
 export 'package:get/get.dart';
 

+ 0 - 1
libs/track_common/lib/widget/line_chart.dart

@@ -10,7 +10,6 @@ class LineChartTitle {
 
 class LineChartElem {
   const LineChartElem(this.cols);
-
   final Iterable<Widget> cols;
 }