Merge branch 'master' of 192.168.2.201:laiiihz/akuCommunity

* 'master' of 192.168.2.201:laiiihz/akuCommunity:
  update delete dialog
  add delete dialog
hmxc
小赖 4 years ago
commit 7a742c0c56

@ -37,7 +37,7 @@ class UserInfoModel {
UserInfoModel.fromJson(Map<String, dynamic> json) { UserInfoModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
if (json['imgUrls'] != null) if (json['imgUrls'] != null&&(json['imgUrls'] as List).length!=0)
imgUrl = (json['imgUrls'] as List).first['url']; imgUrl = (json['imgUrls'] as List).first['url'];
name = json['name']; name = json['name'];
nickName = json['nickName']; nickName = json['nickName'];

@ -10,9 +10,11 @@ import 'package:akuCommunity/utils/bee_map.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/horizontal_image_view.dart'; import 'package:akuCommunity/widget/horizontal_image_view.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:akuCommunity/extensions/num_ext.dart'; import 'package:akuCommunity/extensions/num_ext.dart';
@ -143,6 +145,29 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
)); ));
} }
Widget _showDeletDialog() {
return CupertinoAlertDialog(
title: '删除订单'.text.black.size(34.sp).isIntrinsic.make(),
content: '您确定要删除订单吗?'.text.black.size(28.sp).isIntrinsic.make(),
actions: [
CupertinoDialogAction(
child: '先等等'.text.black.size(34.sp).isIntrinsic.make(),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
child: '删除订单'.text.color(Color(0xFFFF8200)).size(34.sp).bold.isIntrinsic.make(),
onPressed: () {
ManagerFunc.reportRepairDelete(_selected);
Get.back();
_easyRefreshController.callRefresh();
},
)
],
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context); UserProvider userProvider = Provider.of<UserProvider>(context);
@ -188,8 +213,7 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
MaterialButton( MaterialButton(
onPressed: _isEdit onPressed: _isEdit
? () { ? () {
ManagerFunc.reportRepairDelete(_selected); Get.dialog(_showDeletDialog());
_easyRefreshController.callRefresh();
} }
: () { : () {
userProvider.isLogin userProvider.isLogin

Loading…
Cancel
Save