Showing
16 changed files
with
849 additions
and
145 deletions
assets/down.png
0 → 100644
495 Bytes
assets/up.png
0 → 100644
547 Bytes
| @@ -23,6 +23,7 @@ import 'app.dart'; | @@ -23,6 +23,7 @@ import 'app.dart'; | ||
| 23 | import 'net/dio_util.dart'; | 23 | import 'net/dio_util.dart'; |
| 24 | import 'net/http_url.dart'; | 24 | import 'net/http_url.dart'; |
| 25 | import 'pages/login/login_page.dart'; | 25 | import 'pages/login/login_page.dart'; |
| 26 | +import 'provider/order_food_provider.dart'; | ||
| 26 | import 'provider/user_model.dart'; | 27 | import 'provider/user_model.dart'; |
| 27 | import 'route/navigate_service.dart'; | 28 | import 'route/navigate_service.dart'; |
| 28 | import 'route/routes.dart'; | 29 | import 'route/routes.dart'; |
| @@ -53,6 +54,9 @@ Future<void> main() async { | @@ -53,6 +54,9 @@ Future<void> main() async { | ||
| 53 | ChangeNotifierProvider<OnlineCheckEditProvider>( | 54 | ChangeNotifierProvider<OnlineCheckEditProvider>( |
| 54 | create: (_) => OnlineCheckEditProvider(), | 55 | create: (_) => OnlineCheckEditProvider(), |
| 55 | ), | 56 | ), |
| 57 | + ChangeNotifierProvider<OrderFoodProvider>( | ||
| 58 | + create: (_) => OrderFoodProvider(), | ||
| 59 | + ), | ||
| 56 | ], | 60 | ], |
| 57 | child: MyApp(), | 61 | child: MyApp(), |
| 58 | )); | 62 | )); |
lib/models/order_info_model.dart
0 → 100644
| 1 | +import 'package:json_annotation/json_annotation.dart'; | ||
| 2 | + | ||
| 3 | +part 'order_info_model.g.dart'; | ||
| 4 | + | ||
| 5 | +@JsonSerializable() | ||
| 6 | +class OrderInfoModel extends Object { | ||
| 7 | + @JsonKey(name: 'ret') | ||
| 8 | + int ret; | ||
| 9 | + | ||
| 10 | + @JsonKey(name: 'data') | ||
| 11 | + OrderInfoSunModel data; | ||
| 12 | + | ||
| 13 | + @JsonKey(name: 'msg') | ||
| 14 | + String msg; | ||
| 15 | + | ||
| 16 | + OrderInfoModel( | ||
| 17 | + this.ret, | ||
| 18 | + this.data, | ||
| 19 | + this.msg, | ||
| 20 | + ); | ||
| 21 | + | ||
| 22 | + factory OrderInfoModel.fromJson(Map<String, dynamic> srcJson) => | ||
| 23 | + _$OrderInfoModelFromJson(srcJson); | ||
| 24 | + | ||
| 25 | + Map<String, dynamic> toJson() => _$OrderInfoModelToJson(this); | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +@JsonSerializable() | ||
| 29 | +class OrderInfoSunModel extends Object { | ||
| 30 | + @JsonKey(name: 'id') | ||
| 31 | + String id; | ||
| 32 | + | ||
| 33 | + @JsonKey(name: 'order_no') | ||
| 34 | + String orderNo; | ||
| 35 | + | ||
| 36 | + @JsonKey(name: 'out_trade_no') | ||
| 37 | + String outTradeNo; | ||
| 38 | + | ||
| 39 | + @JsonKey(name: 'openid') | ||
| 40 | + String openid; | ||
| 41 | + | ||
| 42 | + @JsonKey(name: 'sid') | ||
| 43 | + String sid; | ||
| 44 | + | ||
| 45 | + @JsonKey(name: 'rid') | ||
| 46 | + String rid; | ||
| 47 | + | ||
| 48 | + @JsonKey(name: 'sellername') | ||
| 49 | + String sellername; | ||
| 50 | + | ||
| 51 | + @JsonKey(name: 'tablename') | ||
| 52 | + String tablename; | ||
| 53 | + | ||
| 54 | + @JsonKey(name: 'wechat_no') | ||
| 55 | + String wechatNo; | ||
| 56 | + | ||
| 57 | + @JsonKey(name: 'bill_list') | ||
| 58 | + List<dynamic> billList; | ||
| 59 | + | ||
| 60 | + @JsonKey(name: 'price') | ||
| 61 | + String price; | ||
| 62 | + | ||
| 63 | + @JsonKey(name: 'should_price') | ||
| 64 | + String shouldPrice; | ||
| 65 | + | ||
| 66 | + @JsonKey(name: 'subsidy_type') | ||
| 67 | + String subsidyType; | ||
| 68 | + | ||
| 69 | + @JsonKey(name: 'subsidy_price') | ||
| 70 | + String subsidyPrice; | ||
| 71 | + | ||
| 72 | + @JsonKey(name: 'is_wine') | ||
| 73 | + String isWine; | ||
| 74 | + | ||
| 75 | + @JsonKey(name: 'is_pack') | ||
| 76 | + String isPack; | ||
| 77 | + | ||
| 78 | + @JsonKey(name: 'status') | ||
| 79 | + String status; | ||
| 80 | + | ||
| 81 | + @JsonKey(name: 'pay_time') | ||
| 82 | + String payTime; | ||
| 83 | + | ||
| 84 | + @JsonKey(name: 'confirm_time') | ||
| 85 | + String confirmTime; | ||
| 86 | + | ||
| 87 | + @JsonKey(name: 'remarks') | ||
| 88 | + String remarks; | ||
| 89 | + | ||
| 90 | + @JsonKey(name: 'attach') | ||
| 91 | + String attach; | ||
| 92 | + | ||
| 93 | + @JsonKey(name: 'currency') | ||
| 94 | + String currency; | ||
| 95 | + | ||
| 96 | + @JsonKey(name: 'detail') | ||
| 97 | + String detail; | ||
| 98 | + | ||
| 99 | + @JsonKey(name: 'description') | ||
| 100 | + String description; | ||
| 101 | + | ||
| 102 | + @JsonKey(name: 'profit_sharing') | ||
| 103 | + String profitSharing; | ||
| 104 | + | ||
| 105 | + @JsonKey(name: 'create_time') | ||
| 106 | + String createTime; | ||
| 107 | + | ||
| 108 | + @JsonKey(name: 'discount') | ||
| 109 | + List<dynamic> discount; | ||
| 110 | + | ||
| 111 | +//订单备注 | ||
| 112 | + String get orderRemark { | ||
| 113 | + String orderRemark = ''; | ||
| 114 | + if (isWine == '1' || isPack == '1') { | ||
| 115 | + orderRemark = '*顾客'; | ||
| 116 | + if (isWine == '1') { | ||
| 117 | + orderRemark += '有酒水要退'; | ||
| 118 | + } | ||
| 119 | + if (isPack == '1') { | ||
| 120 | + if (isWine == '1') { | ||
| 121 | + orderRemark += ',菜品需要打包'; | ||
| 122 | + } else { | ||
| 123 | + orderRemark += '菜品需要打包'; | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + return orderRemark; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + OrderInfoSunModel( | ||
| 131 | + this.id, | ||
| 132 | + this.orderNo, | ||
| 133 | + this.outTradeNo, | ||
| 134 | + this.openid, | ||
| 135 | + this.sid, | ||
| 136 | + this.rid, | ||
| 137 | + this.sellername, | ||
| 138 | + this.tablename, | ||
| 139 | + this.wechatNo, | ||
| 140 | + this.billList, | ||
| 141 | + this.price, | ||
| 142 | + this.shouldPrice, | ||
| 143 | + this.subsidyType, | ||
| 144 | + this.subsidyPrice, | ||
| 145 | + this.isWine, | ||
| 146 | + this.isPack, | ||
| 147 | + this.status, | ||
| 148 | + this.payTime, | ||
| 149 | + this.confirmTime, | ||
| 150 | + this.remarks, | ||
| 151 | + this.attach, | ||
| 152 | + this.currency, | ||
| 153 | + this.detail, | ||
| 154 | + this.description, | ||
| 155 | + this.profitSharing, | ||
| 156 | + this.createTime, | ||
| 157 | + this.discount, | ||
| 158 | + ); | ||
| 159 | + | ||
| 160 | + factory OrderInfoSunModel.fromJson(Map<String, dynamic> srcJson) => | ||
| 161 | + _$OrderInfoSunModelFromJson(srcJson); | ||
| 162 | + | ||
| 163 | + Map<String, dynamic> toJson() => _$OrderInfoSunModelToJson(this); | ||
| 164 | +} |
lib/models/order_info_model.g.dart
0 → 100644
| 1 | +// GENERATED CODE - DO NOT MODIFY BY HAND | ||
| 2 | + | ||
| 3 | +part of 'order_info_model.dart'; | ||
| 4 | + | ||
| 5 | +// ************************************************************************** | ||
| 6 | +// JsonSerializableGenerator | ||
| 7 | +// ************************************************************************** | ||
| 8 | + | ||
| 9 | +OrderInfoModel _$OrderInfoModelFromJson(Map<String, dynamic> json) { | ||
| 10 | + return OrderInfoModel( | ||
| 11 | + json['ret'] as int, | ||
| 12 | + json['data'] == null | ||
| 13 | + ? null | ||
| 14 | + : OrderInfoSunModel.fromJson(json['data'] as Map<String, dynamic>), | ||
| 15 | + json['msg'] as String); | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +Map<String, dynamic> _$OrderInfoModelToJson(OrderInfoModel instance) => | ||
| 19 | + <String, dynamic>{ | ||
| 20 | + 'ret': instance.ret, | ||
| 21 | + 'data': instance.data, | ||
| 22 | + 'msg': instance.msg | ||
| 23 | + }; | ||
| 24 | + | ||
| 25 | +OrderInfoSunModel _$OrderInfoSunModelFromJson(Map<String, dynamic> json) { | ||
| 26 | + return OrderInfoSunModel( | ||
| 27 | + json['id'] as String, | ||
| 28 | + json['order_no'] as String, | ||
| 29 | + json['out_trade_no'] as String, | ||
| 30 | + json['openid'] as String, | ||
| 31 | + json['sid'] as String, | ||
| 32 | + json['rid'] as String, | ||
| 33 | + json['sellername'] as String, | ||
| 34 | + json['tablename'] as String, | ||
| 35 | + json['wechat_no'] as String, | ||
| 36 | + json['bill_list'] as List, | ||
| 37 | + json['price'] as String, | ||
| 38 | + json['should_price'] as String, | ||
| 39 | + json['subsidy_type'] as String, | ||
| 40 | + json['subsidy_price'] as String, | ||
| 41 | + json['is_wine'] as String, | ||
| 42 | + json['is_pack'] as String, | ||
| 43 | + json['status'] as String, | ||
| 44 | + json['pay_time'] as String, | ||
| 45 | + json['confirm_time'] as String, | ||
| 46 | + json['remarks'] as String, | ||
| 47 | + json['attach'] as String, | ||
| 48 | + json['currency'] as String, | ||
| 49 | + json['detail'] as String, | ||
| 50 | + json['description'] as String, | ||
| 51 | + json['profit_sharing'] as String, | ||
| 52 | + json['create_time'] as String, | ||
| 53 | + json['discount'] as List); | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +Map<String, dynamic> _$OrderInfoSunModelToJson(OrderInfoSunModel instance) => | ||
| 57 | + <String, dynamic>{ | ||
| 58 | + 'id': instance.id, | ||
| 59 | + 'order_no': instance.orderNo, | ||
| 60 | + 'out_trade_no': instance.outTradeNo, | ||
| 61 | + 'openid': instance.openid, | ||
| 62 | + 'sid': instance.sid, | ||
| 63 | + 'rid': instance.rid, | ||
| 64 | + 'sellername': instance.sellername, | ||
| 65 | + 'tablename': instance.tablename, | ||
| 66 | + 'wechat_no': instance.wechatNo, | ||
| 67 | + 'bill_list': instance.billList, | ||
| 68 | + 'price': instance.price, | ||
| 69 | + 'should_price': instance.shouldPrice, | ||
| 70 | + 'subsidy_type': instance.subsidyType, | ||
| 71 | + 'subsidy_price': instance.subsidyPrice, | ||
| 72 | + 'is_wine': instance.isWine, | ||
| 73 | + 'is_pack': instance.isPack, | ||
| 74 | + 'status': instance.status, | ||
| 75 | + 'pay_time': instance.payTime, | ||
| 76 | + 'confirm_time': instance.confirmTime, | ||
| 77 | + 'remarks': instance.remarks, | ||
| 78 | + 'attach': instance.attach, | ||
| 79 | + 'currency': instance.currency, | ||
| 80 | + 'detail': instance.detail, | ||
| 81 | + 'description': instance.description, | ||
| 82 | + 'profit_sharing': instance.profitSharing, | ||
| 83 | + 'create_time': instance.createTime, | ||
| 84 | + 'discount': instance.discount | ||
| 85 | + }; |
| 1 | import 'package:json_annotation/json_annotation.dart'; | 1 | import 'package:json_annotation/json_annotation.dart'; |
| 2 | +import 'package:one_key/utils/utils.dart'; | ||
| 2 | 3 | ||
| 3 | part 'reserve_detail_model.g.dart'; | 4 | part 'reserve_detail_model.g.dart'; |
| 4 | 5 | ||
| @@ -126,6 +127,89 @@ class ReserveDetailSunModel extends Object { | @@ -126,6 +127,89 @@ class ReserveDetailSunModel extends Object { | ||
| 126 | @JsonKey(name: 'order') | 127 | @JsonKey(name: 'order') |
| 127 | Order order; | 128 | Order order; |
| 128 | 129 | ||
| 130 | + ///年月日 餐段 | ||
| 131 | + String get ddateStr { | ||
| 132 | + String ymd = ""; | ||
| 133 | + if (ddate != null) { | ||
| 134 | + DateTime dateTime = DateTime.fromMillisecondsSinceEpoch( | ||
| 135 | + int.parse(ddate.toString()) * 1000); | ||
| 136 | + ymd = dateTime.year.toString() + | ||
| 137 | + "/" + | ||
| 138 | + Utils.addZeroNumber(dateTime.month) + | ||
| 139 | + "/" + | ||
| 140 | + Utils.addZeroNumber(dateTime.day); | ||
| 141 | + } else { | ||
| 142 | + ymd = ddate.substring(0, 10); | ||
| 143 | + } | ||
| 144 | + switch (ddateSolt) { | ||
| 145 | + case "1": //早餐 | ||
| 146 | + return ymd + " 早餐"; | ||
| 147 | + case "2": //午餐 | ||
| 148 | + return ymd + " 午餐"; | ||
| 149 | + case "3": //晚餐 | ||
| 150 | + return ymd + " 晚餐"; | ||
| 151 | + default: | ||
| 152 | + return ymd; | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | +// 申请时间 | ||
| 157 | + String get cdateStr { | ||
| 158 | + DateTime dateTime = | ||
| 159 | + DateTime.fromMillisecondsSinceEpoch(int.parse(cdate.toString()) * 1000); | ||
| 160 | + return dateTime.year.toString() + | ||
| 161 | + "/" + | ||
| 162 | + Utils.addZeroNumber(dateTime.month) + | ||
| 163 | + "/" + | ||
| 164 | + Utils.addZeroNumber(dateTime.day) + | ||
| 165 | + " " + | ||
| 166 | + Utils.addZeroNumber(dateTime.hour) + | ||
| 167 | + ":" + | ||
| 168 | + Utils.addZeroNumber(dateTime.minute); | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + List<Map> get tableNameList { | ||
| 172 | + String tableInfo = ''; | ||
| 173 | + List<Map> tableNameList = []; //全部类型 | ||
| 174 | + //1散座 2包间 3卡座 | ||
| 175 | + List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称 | ||
| 176 | + List<String> tableNameSunList2 = []; //单个类型包含的所有桌子名称 | ||
| 177 | + List<String> tableNameSunList3 = []; //单个类型包含的所有桌子名称 | ||
| 178 | + for (int i = 0; i < tables.length; i++) { | ||
| 179 | + switch (tables[i].tid) { | ||
| 180 | + case '1': | ||
| 181 | + tableNameSunList1.add(tables[i].name); | ||
| 182 | + break; | ||
| 183 | + case '2': | ||
| 184 | + tableNameSunList2.add(tables[i].name); | ||
| 185 | + break; | ||
| 186 | + case '3': | ||
| 187 | + tableNameSunList3.add(tables[i].name); | ||
| 188 | + break; | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | + tableNameList = [ | ||
| 192 | + {'散座': tableNameSunList1}, | ||
| 193 | + {'包间': tableNameSunList2}, | ||
| 194 | + {'卡座': tableNameSunList3}, | ||
| 195 | + ]; //全部类型 | ||
| 196 | + | ||
| 197 | + return tableNameList; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + ///顾客姓名 | ||
| 201 | + String get rnameStr { | ||
| 202 | + // 预订人姓名:1:男 2:女 | ||
| 203 | + switch (sex) { | ||
| 204 | + case "1": | ||
| 205 | + return rname + '先生'; | ||
| 206 | + case "2": | ||
| 207 | + return rname + '女士'; | ||
| 208 | + default: | ||
| 209 | + return rname; | ||
| 210 | + } | ||
| 211 | + } | ||
| 212 | + | ||
| 129 | ReserveDetailSunModel( | 213 | ReserveDetailSunModel( |
| 130 | this.id, | 214 | this.id, |
| 131 | this.orderid, | 215 | this.orderid, |
lib/models/upload_img_model.dart
0 → 100644
| @@ -65,5 +65,9 @@ class HttpUrl { | @@ -65,5 +65,9 @@ class HttpUrl { | ||
| 65 | "?service=App.Reserve.Detail"; //订座详情页面 | 65 | "?service=App.Reserve.Detail"; //订座详情页面 |
| 66 | static const String get_qiniu_info = | 66 | static const String get_qiniu_info = |
| 67 | "?service=App.Qiniu.GetUploadToken"; //获取七牛上传token信息 | 67 | "?service=App.Qiniu.GetUploadToken"; //获取七牛上传token信息 |
| 68 | + static const String get_order_info = | ||
| 69 | + "?service=App.Customer.GetOrderInfo"; //获取账单详情 | ||
| 70 | + static const String update_order_info = | ||
| 71 | + "?service=App.Customer.UpdateOrderInfo"; // 商家确认账单 | ||
| 68 | 72 | ||
| 69 | } | 73 | } |
| @@ -4,8 +4,8 @@ import 'dart:async'; | @@ -4,8 +4,8 @@ import 'dart:async'; | ||
| 4 | 4 | ||
| 5 | import 'package:cached_network_image/cached_network_image.dart'; | 5 | import 'package:cached_network_image/cached_network_image.dart'; |
| 6 | import 'package:flutter/material.dart'; | 6 | import 'package:flutter/material.dart'; |
| 7 | -import 'package:flutter/services.dart'; | ||
| 8 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 8 | +import 'package:one_key/models/upload_img_model.dart'; | ||
| 9 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; | 9 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; |
| 10 | import 'package:one_key/pages/online_check/progress.dart'; | 10 | import 'package:one_key/pages/online_check/progress.dart'; |
| 11 | 11 | ||
| @@ -14,7 +14,6 @@ import 'package:one_key/res/colors.dart'; | @@ -14,7 +14,6 @@ import 'package:one_key/res/colors.dart'; | ||
| 14 | import 'package:one_key/utils/utils.dart'; | 14 | import 'package:one_key/utils/utils.dart'; |
| 15 | import 'package:one_key/widgets/MyDivider.dart'; | 15 | import 'package:one_key/widgets/MyDivider.dart'; |
| 16 | import 'package:one_key/widgets/v_empty_view.dart'; | 16 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 17 | -import 'package:path_provider/path_provider.dart'; | ||
| 18 | import 'package:photo/photo.dart'; | 17 | import 'package:photo/photo.dart'; |
| 19 | import 'package:provider/provider.dart'; | 18 | import 'package:provider/provider.dart'; |
| 20 | 19 | ||
| @@ -45,8 +44,7 @@ class ImgPickerWidget extends StatefulWidget { | @@ -45,8 +44,7 @@ class ImgPickerWidget extends StatefulWidget { | ||
| 45 | class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | 44 | class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { |
| 46 | final picker = ImagePicker(); | 45 | final picker = ImagePicker(); |
| 47 | OnlineCheckEditProvider _onlineCheckEditProvider; | 46 | OnlineCheckEditProvider _onlineCheckEditProvider; |
| 48 | - // 控制器,可以用于取消任务、获取上述的状态,进度等信息 | ||
| 49 | - PutController putController; | 47 | + |
| 50 | // 用户输入的文件名 | 48 | // 用户输入的文件名 |
| 51 | String key; | 49 | String key; |
| 52 | // 用户输入的 partSize | 50 | // 用户输入的 partSize |
| @@ -55,15 +53,15 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -55,15 +53,15 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 55 | String token; | 53 | String token; |
| 56 | 54 | ||
| 57 | /// storage 实例 | 55 | /// storage 实例 |
| 58 | - Storage storage; | ||
| 59 | - // 当前的进度 | ||
| 60 | - double progressValue = 0.01; | 56 | + final Storage storage = Storage(); |
| 57 | + // 控制器,可以用于取消任务、获取上述的状态,进度等信息 | ||
| 58 | + // PutController putController = PutController(); | ||
| 61 | // 当前的任务状态 | 59 | // 当前的任务状态 |
| 62 | - StorageStatus statusValue; | ||
| 63 | 60 | ||
| 64 | @override | 61 | @override |
| 65 | void initState() { | 62 | void initState() { |
| 66 | - storage = Storage(); | 63 | + // storage = Storage(); |
| 64 | + // putController = PutController(); | ||
| 67 | super.initState(); | 65 | super.initState(); |
| 68 | } | 66 | } |
| 69 | 67 | ||
| @@ -75,17 +73,19 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -75,17 +73,19 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 75 | ///#相机拍照,单图选择 | 73 | ///#相机拍照,单图选择 |
| 76 | Future _getFromPictureOrCamera(imageSource) async { | 74 | Future _getFromPictureOrCamera(imageSource) async { |
| 77 | final pickedFile = await picker.getImage(source: imageSource); | 75 | final pickedFile = await picker.getImage(source: imageSource); |
| 78 | - | ||
| 79 | setState(() { | 76 | setState(() { |
| 80 | if (pickedFile != null) { | 77 | if (pickedFile != null) { |
| 81 | - _onlineCheckEditProvider.imageListFile.add(File(pickedFile.path)); | ||
| 82 | - _onlineCheckEditProvider.statusMap[pickedFile.path] = false; | 78 | + UploadImgModel imgModel = UploadImgModel(); |
| 79 | + imgModel.file = File(pickedFile.path); | ||
| 80 | + imgModel.process = 0.01; | ||
| 81 | + _onlineCheckEditProvider.imageList.add(imgModel); | ||
| 83 | } else { | 82 | } else { |
| 84 | print('No image selected.'); | 83 | print('No image selected.'); |
| 85 | } | 84 | } |
| 86 | }); | 85 | }); |
| 87 | if (pickedFile != null) { | 86 | if (pickedFile != null) { |
| 88 | - startUpload(File(pickedFile.path)); | 87 | + startUpload(File(pickedFile.path), |
| 88 | + _onlineCheckEditProvider.imageList.length - 1, true); | ||
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| @@ -109,8 +109,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -109,8 +109,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 109 | // the check box disable color | 109 | // the check box disable color |
| 110 | itemRadio: 0.88, | 110 | itemRadio: 0.88, |
| 111 | // the content item radio | 111 | // the content item radio |
| 112 | - maxSelected: | ||
| 113 | - MAX_IMAGE_NUMBER - _onlineCheckEditProvider.imageListFile.length, | 112 | + maxSelected: MAX_IMAGE_NUMBER - _onlineCheckEditProvider.imageList.length, |
| 114 | // max picker image count | 113 | // max picker image count |
| 115 | // provider: I18nProvider.english, | 114 | // provider: I18nProvider.english, |
| 116 | provider: I18nProvider.chinese, | 115 | provider: I18nProvider.chinese, |
| @@ -138,57 +137,45 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -138,57 +137,45 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 138 | print("No pick item."); | 137 | print("No pick item."); |
| 139 | return; | 138 | return; |
| 140 | } else { | 139 | } else { |
| 141 | - List<String> r = []; | ||
| 142 | - for (var e in imgList) { | ||
| 143 | - var file = await e.file; | ||
| 144 | - r.add(file.absolute.path); | 140 | + for (int i = 0; i < imgList.length; i++) { |
| 141 | + var file = await imgList[i].file; | ||
| 145 | setState(() { | 142 | setState(() { |
| 146 | - _onlineCheckEditProvider.imageListFile.add(File(file.absolute.path)); | ||
| 147 | - _onlineCheckEditProvider.statusMap[file.absolute.path] = false; | 143 | + UploadImgModel imgModel = UploadImgModel(); |
| 144 | + imgModel.file = File(file.absolute.path); | ||
| 145 | + imgModel.process = 0.01; | ||
| 146 | + _onlineCheckEditProvider.imageList.add(imgModel); | ||
| 148 | }); | 147 | }); |
| 149 | - startUpload(File(file.absolute.path)); | 148 | + startUpload(File(file.absolute.path), |
| 149 | + _onlineCheckEditProvider.imageList.length - 1, false); | ||
| 150 | } | 150 | } |
| 151 | } | 151 | } |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | - ///七牛云sdk | ||
| 155 | - | ||
| 156 | - void onStatus(StorageStatus status) { | ||
| 157 | - print('状态变化: 当前任务状态:${status.toString()}'); | ||
| 158 | - setState(() => statusValue = status); | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | - ///任务进度变化:进度 | ||
| 162 | - void onProgress(double percent) { | ||
| 163 | - setState(() => progressValue = percent); | ||
| 164 | - print('任务进度变化:进度:${percent.toStringAsFixed(4)}'); | ||
| 165 | - } | ||
| 166 | - | ||
| 167 | - ///实际发送变化:进度 | ||
| 168 | - void onSendProgress(double percent) { | ||
| 169 | - setState(() => progressValue = percent); | ||
| 170 | - print('实际发送变化:进度:${percent.toStringAsFixed(4)}'); | ||
| 171 | - } | ||
| 172 | - | ||
| 173 | ///上传到七牛云 | 154 | ///上传到七牛云 |
| 174 | - void startUpload(File selectedFile) async { | ||
| 175 | - print('创建 PutController'); | ||
| 176 | - putController = PutController(); | ||
| 177 | - // _onlineCheckEditProvider.statusMapProgress[selectedFile.path] = | ||
| 178 | - // putController; | ||
| 179 | - print('添加实际发送进度订阅'); | ||
| 180 | - addDisposer(putController.addSendProgressListener(onSendProgress)); | 155 | + void startUpload(File selectedFile, int index, bool needInit) async { |
| 156 | + final PutController putController = PutController(); | ||
| 157 | + print(index); | ||
| 181 | 158 | ||
| 182 | - print('添加任务进度订阅'); | ||
| 183 | - addDisposer(putController.addProgressListener(onProgress)); | ||
| 184 | - | ||
| 185 | - print('添加状态订阅'); | ||
| 186 | - addDisposer(putController.addStatusListener(onStatus)); | 159 | + // 添加状态监听 |
| 160 | + putController.addStatusListener((StorageStatus status) { | ||
| 161 | + print('状态变化: 当前任务状态:${status.toString()}'); | ||
| 162 | + }); | ||
| 163 | + // 添加整体进度监听 | ||
| 164 | + putController.addProgressListener((percent) { | ||
| 165 | + print('${index}任务进度变化:进度:${percent.toStringAsFixed(4)}'); | ||
| 166 | + _onlineCheckEditProvider.imageList[index].process = percent; | ||
| 167 | + _onlineCheckEditProvider.notifyListeners(); | ||
| 168 | + }); | ||
| 169 | + // 添加实际发送进度订阅 | ||
| 170 | + putController.addSendProgressListener((percent) { | ||
| 171 | + // _onlineCheckEditProvider.imageList[index].process = percent; | ||
| 172 | + // setState(() {}); | ||
| 173 | + print('${index}实际发送变化:进度:${percent.toStringAsFixed(4)}'); | ||
| 174 | + }); | ||
| 187 | if (token == null || token == '') { | 175 | if (token == null || token == '') { |
| 188 | await _onlineCheckEditProvider.getQiniuInfo(context, {}); | 176 | await _onlineCheckEditProvider.getQiniuInfo(context, {}); |
| 189 | } | 177 | } |
| 190 | var usedToken = _onlineCheckEditProvider.qiniuInfoSunModel.token; | 178 | var usedToken = _onlineCheckEditProvider.qiniuInfoSunModel.token; |
| 191 | - | ||
| 192 | if (usedToken == null || usedToken == '') { | 179 | if (usedToken == null || usedToken == '') { |
| 193 | print('token 不能为空'); | 180 | print('token 不能为空'); |
| 194 | return; | 181 | return; |
| @@ -204,14 +191,16 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -204,14 +191,16 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 204 | ), | 191 | ), |
| 205 | ) | 192 | ) |
| 206 | ..then((PutResponse response) { | 193 | ..then((PutResponse response) { |
| 207 | - print('上传已完成: 原始响应数据: ${jsonEncode(response.rawData)}'); | 194 | + print('${index}上传已完成: 原始响应数据: ${jsonEncode(response.rawData)}'); |
| 208 | print('------------------------'); | 195 | print('------------------------'); |
| 209 | String imgUrl = _onlineCheckEditProvider.qiniuInfoSunModel.domain + | 196 | String imgUrl = _onlineCheckEditProvider.qiniuInfoSunModel.domain + |
| 210 | '/' + | 197 | '/' + |
| 211 | response.rawData['key']; | 198 | response.rawData['key']; |
| 212 | - _onlineCheckEditProvider.imageListUrl.add(imgUrl); | 199 | + _onlineCheckEditProvider.imageList[index].process = 1; |
| 200 | + _onlineCheckEditProvider.imageList[index].qiniuUrl = imgUrl; | ||
| 201 | + // 取消当前任务 | ||
| 202 | + putController.cancel(); | ||
| 213 | // _image | 203 | // _image |
| 214 | - _onlineCheckEditProvider.statusMap[selectedFile.path] = true; | ||
| 215 | _onlineCheckEditProvider.notifyListeners(); | 204 | _onlineCheckEditProvider.notifyListeners(); |
| 216 | }) | 205 | }) |
| 217 | ..catchError((dynamic error) { | 206 | ..catchError((dynamic error) { |
| @@ -292,8 +281,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -292,8 +281,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 292 | ), | 281 | ), |
| 293 | InkWell( | 282 | InkWell( |
| 294 | onTap: () { | 283 | onTap: () { |
| 295 | - // pickAsset(PickType.onlyImage); | ||
| 296 | - _getFromPictureOrCamera(ImageSource.gallery); | 284 | + pickAsset(PickType.onlyImage); |
| 285 | + // _getFromPictureOrCamera(ImageSource.gallery); | ||
| 297 | Navigator.pop(context); | 286 | Navigator.pop(context); |
| 298 | }, | 287 | }, |
| 299 | child: Container( | 288 | child: Container( |
| @@ -405,12 +394,11 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -405,12 +394,11 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 405 | Padding( | 394 | Padding( |
| 406 | padding: EdgeInsets.all(ScreenUtil().setWidth(40)), | 395 | padding: EdgeInsets.all(ScreenUtil().setWidth(40)), |
| 407 | child: _getGridImg( | 396 | child: _getGridImg( |
| 408 | - _onlineCheckEditProvider.imageListFile.length < MAX_IMAGE_NUMBER | ||
| 409 | - ? _onlineCheckEditProvider.imageListFile.length + 1 | ||
| 410 | - : _onlineCheckEditProvider.imageListFile.length, | 397 | + _onlineCheckEditProvider.imageList.length < MAX_IMAGE_NUMBER |
| 398 | + ? _onlineCheckEditProvider.imageList.length + 1 | ||
| 399 | + : _onlineCheckEditProvider.imageList.length, | ||
| 411 | context, | 400 | context, |
| 412 | - _onlineCheckEditProvider.imageListFile.length == | ||
| 413 | - MAX_IMAGE_NUMBER | 401 | + _onlineCheckEditProvider.imageList.length == MAX_IMAGE_NUMBER |
| 414 | ? true | 402 | ? true |
| 415 | : false), | 403 | : false), |
| 416 | ) | 404 | ) |
| @@ -477,13 +465,24 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -477,13 +465,24 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 477 | )), | 465 | )), |
| 478 | ); | 466 | ); |
| 479 | } | 467 | } |
| 480 | - return _provider.imageListFile.length < 1 | 468 | + return _provider.imageList.length < 1 |
| 481 | ? Text('') | 469 | ? Text('') |
| 482 | : InkWell( | 470 | : InkWell( |
| 483 | onTap: () { | 471 | onTap: () { |
| 484 | - ///没有上传完成的不可以点击 | ||
| 485 | - _showPhotoView( | ||
| 486 | - context, index, _provider.imageListUrl[index]); | 472 | + _onlineCheckEditProvider.imageQiniuUrlList = []; |
| 473 | + if (_onlineCheckEditProvider.imageList[index].qiniuUrl != | ||
| 474 | + null) { | ||
| 475 | + for (int i = 0; | ||
| 476 | + i < _onlineCheckEditProvider.imageList.length; | ||
| 477 | + i++) { | ||
| 478 | + _onlineCheckEditProvider.imageQiniuUrlList.add( | ||
| 479 | + _onlineCheckEditProvider.imageList[i].qiniuUrl); | ||
| 480 | + } | ||
| 481 | + | ||
| 482 | + ///没有上传完成的不可以点击 | ||
| 483 | + _showPhotoView( | ||
| 484 | + context, index, _provider.imageQiniuUrlList); | ||
| 485 | + } | ||
| 487 | }, | 486 | }, |
| 488 | child: Stack( | 487 | child: Stack( |
| 489 | children: [ | 488 | children: [ |
| @@ -491,14 +490,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -491,14 +490,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 491 | alignment: Alignment.topRight, | 490 | alignment: Alignment.topRight, |
| 492 | children: [ | 491 | children: [ |
| 493 | Image.file( | 492 | Image.file( |
| 494 | - _provider.imageListFile[index], | 493 | + _provider.imageList[index].file, |
| 495 | fit: BoxFit.cover, | 494 | fit: BoxFit.cover, |
| 496 | width: ScreenUtil().setWidth(100 * 2), | 495 | width: ScreenUtil().setWidth(100 * 2), |
| 497 | height: ScreenUtil().setWidth(100 * 2), | 496 | height: ScreenUtil().setWidth(100 * 2), |
| 498 | ), | 497 | ), |
| 499 | Offstage( | 498 | Offstage( |
| 500 | - offstage: !_provider | ||
| 501 | - .statusMap[_provider.imageListFile[index].path], | 499 | + offstage: _provider.imageList[index].process < 1, |
| 502 | child: GestureDetector( | 500 | child: GestureDetector( |
| 503 | child: Image.asset( | 501 | child: Image.asset( |
| 504 | Utils.getImgPath("delete"), | 502 | Utils.getImgPath("delete"), |
| @@ -508,10 +506,12 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -508,10 +506,12 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 508 | onTap: () { | 506 | onTap: () { |
| 509 | //点击删除按钮 | 507 | //点击删除按钮 |
| 510 | setState(() { | 508 | setState(() { |
| 511 | - _provider.imageListFile.removeWhere( | 509 | + _provider.imageList.removeWhere((element) => |
| 510 | + element == _provider.imageList[index]); | ||
| 511 | + _provider.imageQiniuUrlList.removeWhere( | ||
| 512 | (element) => | 512 | (element) => |
| 513 | element == | 513 | element == |
| 514 | - _provider.imageListFile[index]); | 514 | + _provider.imageQiniuUrlList[index]); |
| 515 | }); | 515 | }); |
| 516 | }, | 516 | }, |
| 517 | ), | 517 | ), |
| @@ -519,9 +519,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -519,9 +519,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 519 | ], | 519 | ], |
| 520 | ), | 520 | ), |
| 521 | Offstage( | 521 | Offstage( |
| 522 | - offstage: _provider | ||
| 523 | - .statusMap[_provider.imageListFile[index].path], | ||
| 524 | - child: Progress(progressValue), | 522 | + offstage: _provider.imageList[index].process == 1, |
| 523 | + child: Progress(_provider.imageList[index].process), | ||
| 525 | ) | 524 | ) |
| 526 | ], | 525 | ], |
| 527 | )); | 526 | )); |
| 1 | +import 'dart:convert'; | ||
| 2 | + | ||
| 1 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_screenutil/screenutil.dart'; | 4 | import 'package:flutter_screenutil/screenutil.dart'; |
| 3 | import 'package:one_key/pages/online_check/img_picker_widget.dart'; | 5 | import 'package:one_key/pages/online_check/img_picker_widget.dart'; |
| 4 | import 'package:one_key/provider/online_check_edit_provider.dart'; | 6 | import 'package:one_key/provider/online_check_edit_provider.dart'; |
| 7 | +import 'package:one_key/provider/order_food_provider.dart'; | ||
| 8 | +import 'package:one_key/provider/user_model.dart'; | ||
| 5 | import 'package:one_key/res/colors.dart'; | 9 | import 'package:one_key/res/colors.dart'; |
| 10 | +import 'package:one_key/utils/dialog_util.dart'; | ||
| 6 | import 'package:one_key/utils/navigator_util.dart'; | 11 | import 'package:one_key/utils/navigator_util.dart'; |
| 7 | import 'package:one_key/utils/utils.dart'; | 12 | import 'package:one_key/utils/utils.dart'; |
| 8 | import 'package:one_key/widgets/MyDivider.dart'; | 13 | import 'package:one_key/widgets/MyDivider.dart'; |
| 14 | +import 'package:one_key/widgets/common_button.dart'; | ||
| 9 | import 'package:one_key/widgets/h_empty_view.dart'; | 15 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 10 | import 'package:one_key/widgets/my_item.dart'; | 16 | import 'package:one_key/widgets/my_item.dart'; |
| 11 | import 'package:one_key/widgets/system_app_bar.dart'; | 17 | import 'package:one_key/widgets/system_app_bar.dart'; |
| @@ -14,7 +20,9 @@ import 'package:provider/provider.dart'; | @@ -14,7 +20,9 @@ import 'package:provider/provider.dart'; | ||
| 14 | 20 | ||
| 15 | class OnlineCheckEditPage extends StatefulWidget { | 21 | class OnlineCheckEditPage extends StatefulWidget { |
| 16 | final bool fromNotify; | 22 | final bool fromNotify; |
| 17 | - OnlineCheckEditPage({Key key, this.fromNotify = false}) : super(key: key); | 23 | + final String rid; |
| 24 | + OnlineCheckEditPage({Key key, this.fromNotify = false, this.rid}) | ||
| 25 | + : super(key: key); | ||
| 18 | 26 | ||
| 19 | @override | 27 | @override |
| 20 | _OnlineCheckEditPageState createState() => _OnlineCheckEditPageState(); | 28 | _OnlineCheckEditPageState createState() => _OnlineCheckEditPageState(); |
| @@ -25,12 +33,17 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -25,12 +33,17 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 25 | TextEditingController _editingController = TextEditingController(); | 33 | TextEditingController _editingController = TextEditingController(); |
| 26 | FocusNode _focusNode = FocusNode(); | 34 | FocusNode _focusNode = FocusNode(); |
| 27 | OnlineCheckEditProvider _onlineCheckEditProvider; | 35 | OnlineCheckEditProvider _onlineCheckEditProvider; |
| 36 | + OrderFoodProvider _orderFoodProvider; | ||
| 37 | + int btnState = -1; | ||
| 38 | + bool arrowStatus = true; // true合住 false展开 | ||
| 28 | 39 | ||
| 29 | @override | 40 | @override |
| 30 | void initState() { | 41 | void initState() { |
| 31 | super.initState(); | 42 | super.initState(); |
| 32 | WidgetsBinding.instance.addPostFrameCallback((_) { | 43 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 33 | _getQiniuInfo(); | 44 | _getQiniuInfo(); |
| 45 | + _getTableInfoData(); | ||
| 46 | + _getOrderInfo(); | ||
| 34 | }); | 47 | }); |
| 35 | _focusNode.addListener(() { | 48 | _focusNode.addListener(() { |
| 36 | if (_focusNode.hasFocus) { | 49 | if (_focusNode.hasFocus) { |
| @@ -38,15 +51,56 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -38,15 +51,56 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 38 | _editingController.text = '¥'; | 51 | _editingController.text = '¥'; |
| 39 | } else { | 52 | } else { |
| 40 | //失去焦点 | 53 | //失去焦点 |
| 41 | - _editingController.text = ''; | 54 | + // _editingController.text = ''; |
| 42 | } | 55 | } |
| 43 | }); | 56 | }); |
| 44 | } | 57 | } |
| 45 | 58 | ||
| 46 | @override | 59 | @override |
| 47 | void dispose() { | 60 | void dispose() { |
| 61 | + _focusNode.unfocus(); | ||
| 62 | + _onlineCheckEditProvider.imageList = []; | ||
| 63 | + _onlineCheckEditProvider.imageQiniuUrlList = []; | ||
| 48 | super.dispose(); | 64 | super.dispose(); |
| 49 | - // _onlineCheckEditProvider | 65 | + } |
| 66 | + | ||
| 67 | + ///接口获取桌位信息 | ||
| 68 | + _getTableInfoData() async { | ||
| 69 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 70 | + Map<String, String> params = { | ||
| 71 | + "openid": userModel.user.openid, | ||
| 72 | + "rid": widget.rid | ||
| 73 | + }; | ||
| 74 | + //明天完成 桌位名称信息 | ||
| 75 | + await _orderFoodProvider.getTableInfoData(context, params); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + _getOrderInfo() async { | ||
| 79 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 80 | + Map<String, String> params = {"rid": widget.rid}; | ||
| 81 | + //remark信息获取 | ||
| 82 | + await _onlineCheckEditProvider.getOrderInfo(context, params); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + ///商家确认账单操作 | ||
| 86 | + _updateOrderInfo() async { | ||
| 87 | + for (int i = 0; i < _onlineCheckEditProvider.imageList.length; i++) { | ||
| 88 | + _onlineCheckEditProvider.imageQiniuUrlList | ||
| 89 | + .add(_onlineCheckEditProvider.imageList[i].qiniuUrl); | ||
| 90 | + } | ||
| 91 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 92 | + Map<String, String> params = { | ||
| 93 | + "price": _editingController.text, | ||
| 94 | + "rid": widget.rid, | ||
| 95 | + 'bill_list': json.encode(_onlineCheckEditProvider.imageQiniuUrlList) | ||
| 96 | + }; | ||
| 97 | + print(pragma); | ||
| 98 | + //明天完成 桌位名称信息 | ||
| 99 | + bool result = | ||
| 100 | + await _onlineCheckEditProvider.updateOrderInfo(context, params); | ||
| 101 | + if (result) { | ||
| 102 | + //跳转至在线买单处理完的详情页面 | ||
| 103 | + } | ||
| 50 | } | 104 | } |
| 51 | 105 | ||
| 52 | ///获取七牛云token | 106 | ///获取七牛云token |
| @@ -82,31 +136,135 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -82,31 +136,135 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 82 | 136 | ||
| 83 | ///桌位信息、应收金额 | 137 | ///桌位信息、应收金额 |
| 84 | Widget _getTabAndMoneyInfoWidget() { | 138 | Widget _getTabAndMoneyInfoWidget() { |
| 139 | + String showTable = ''; | ||
| 140 | + bool showArrow = false; | ||
| 141 | + //1散座 2包间 3卡座 | ||
| 142 | + List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称 | ||
| 143 | + List<String> tableNameSunList2 = []; //单个类型包含的所有桌子名称 | ||
| 144 | + List<String> tableNameSunList3 = []; //单个类型包含的所有桌子名称 | ||
| 145 | + if (_orderFoodProvider.reserveDetailSunModel != null) { | ||
| 146 | + tableNameSunList1 = | ||
| 147 | + _orderFoodProvider.reserveDetailSunModel.tableNameList[0]['散座']; | ||
| 148 | + tableNameSunList2 = | ||
| 149 | + _orderFoodProvider.reserveDetailSunModel.tableNameList[1]['包间']; | ||
| 150 | + tableNameSunList3 = | ||
| 151 | + _orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座']; | ||
| 152 | + if (tableNameSunList2.length > 0) { | ||
| 153 | + showTable = '【包间】${tableNameSunList2[0]}'; | ||
| 154 | + showArrow = true; | ||
| 155 | + } else if (tableNameSunList3.length > 0) { | ||
| 156 | + showTable = '【卡座】${tableNameSunList3[0]}'; | ||
| 157 | + showArrow = true; | ||
| 158 | + } else if (tableNameSunList1.length > 0) { | ||
| 159 | + showTable = '【散座】${tableNameSunList1[0]}'; | ||
| 160 | + showArrow = true; | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + | ||
| 85 | return Container( | 164 | return Container( |
| 86 | decoration: BoxDecoration( | 165 | decoration: BoxDecoration( |
| 87 | color: Colors.white, | 166 | color: Colors.white, |
| 88 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))), | 167 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))), |
| 89 | child: Column( | 168 | child: Column( |
| 90 | children: [ | 169 | children: [ |
| 91 | - Container( | ||
| 92 | - padding: EdgeInsets.symmetric( | ||
| 93 | - horizontal: ScreenUtil().setWidth(40), | ||
| 94 | - vertical: ScreenUtil().setWidth(36)), | ||
| 95 | - child: Row( | 170 | + InkWell( |
| 171 | + onTap: () { | ||
| 172 | + if (showArrow) { | ||
| 173 | + //有arrow | ||
| 174 | + arrowStatus = !arrowStatus; | ||
| 175 | + _orderFoodProvider.notifyListeners(); | ||
| 176 | + } | ||
| 177 | + }, | ||
| 178 | + child: Container( | ||
| 179 | + padding: EdgeInsets.symmetric( | ||
| 180 | + horizontal: ScreenUtil().setWidth(40), | ||
| 181 | + vertical: ScreenUtil().setWidth(36)), | ||
| 182 | + child: Row( | ||
| 183 | + children: [ | ||
| 184 | + Text( | ||
| 185 | + '桌位信息', | ||
| 186 | + style: TextStyle( | ||
| 187 | + fontSize: ScreenUtil().setSp(32), | ||
| 188 | + color: MyColours.color_707070), | ||
| 189 | + ), | ||
| 190 | + Spacer(), | ||
| 191 | + Text( | ||
| 192 | + _orderFoodProvider.reserveDetailSunModel != null | ||
| 193 | + ? showTable | ||
| 194 | + : '', | ||
| 195 | + style: TextStyle( | ||
| 196 | + fontSize: ScreenUtil().setSp(32), | ||
| 197 | + color: MyColours.color_353535), | ||
| 198 | + ), | ||
| 199 | + Offstage( | ||
| 200 | + offstage: !showArrow, | ||
| 201 | + child: Row( | ||
| 202 | + children: [ | ||
| 203 | + HEmptyView(20), | ||
| 204 | + Image.asset( | ||
| 205 | + arrowStatus | ||
| 206 | + ? Utils.getImgPath('down') | ||
| 207 | + : Utils.getImgPath('up'), | ||
| 208 | + width: ScreenUtil().setWidth(24), | ||
| 209 | + height: ScreenUtil().setWidth(12)) | ||
| 210 | + ], | ||
| 211 | + ), | ||
| 212 | + ) | ||
| 213 | + ], | ||
| 214 | + ), | ||
| 215 | + ), | ||
| 216 | + ), | ||
| 217 | + Offstage( | ||
| 218 | + offstage: arrowStatus, | ||
| 219 | + child: Column( | ||
| 220 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 96 | children: [ | 221 | children: [ |
| 97 | - Text( | ||
| 98 | - '桌位信息', | ||
| 99 | - style: TextStyle( | ||
| 100 | - fontSize: ScreenUtil().setSp(32), | ||
| 101 | - color: MyColours.color_707070), | ||
| 102 | - ), | ||
| 103 | - Spacer(), | ||
| 104 | - Text( | ||
| 105 | - '[包间]秦皇岛', | ||
| 106 | - style: TextStyle( | ||
| 107 | - fontSize: ScreenUtil().setSp(32), | ||
| 108 | - color: MyColours.color_353535), | ||
| 109 | - ) | 222 | + tableNameSunList2.length > 0 |
| 223 | + ? Padding( | ||
| 224 | + padding: EdgeInsets.fromLTRB( | ||
| 225 | + ScreenUtil().setWidth(60), | ||
| 226 | + ScreenUtil().setWidth(0), | ||
| 227 | + ScreenUtil().setWidth(60), | ||
| 228 | + ScreenUtil().setWidth(10)), | ||
| 229 | + child: Text( | ||
| 230 | + '【包间】${Utils.listToString(tableNameSunList2)}', | ||
| 231 | + style: TextStyle( | ||
| 232 | + fontSize: ScreenUtil().setSp(32), | ||
| 233 | + color: MyColours.color_353535), | ||
| 234 | + ), | ||
| 235 | + ) | ||
| 236 | + : Container(), | ||
| 237 | + tableNameSunList3.length > 0 | ||
| 238 | + ? Padding( | ||
| 239 | + padding: EdgeInsets.fromLTRB( | ||
| 240 | + ScreenUtil().setWidth(60), | ||
| 241 | + ScreenUtil().setWidth(0), | ||
| 242 | + ScreenUtil().setWidth(60), | ||
| 243 | + ScreenUtil().setWidth(10)), | ||
| 244 | + child: Text( | ||
| 245 | + '【卡座】${Utils.listToString(tableNameSunList3)}', | ||
| 246 | + style: TextStyle( | ||
| 247 | + fontSize: ScreenUtil().setSp(32), | ||
| 248 | + color: MyColours.color_353535), | ||
| 249 | + ), | ||
| 250 | + ) | ||
| 251 | + : Container(), | ||
| 252 | + tableNameSunList1.length > 0 | ||
| 253 | + ? Padding( | ||
| 254 | + padding: EdgeInsets.fromLTRB( | ||
| 255 | + ScreenUtil().setWidth(60), | ||
| 256 | + ScreenUtil().setWidth(0), | ||
| 257 | + ScreenUtil().setWidth(60), | ||
| 258 | + ScreenUtil().setWidth(10)), | ||
| 259 | + child: Text( | ||
| 260 | + '【散座】${Utils.listToString(tableNameSunList1)}', | ||
| 261 | + style: TextStyle( | ||
| 262 | + fontSize: ScreenUtil().setSp(32), | ||
| 263 | + color: MyColours.color_353535), | ||
| 264 | + ), | ||
| 265 | + ) | ||
| 266 | + : Container(), | ||
| 267 | + VEmptyView(36), | ||
| 110 | ], | 268 | ], |
| 111 | ), | 269 | ), |
| 112 | ), | 270 | ), |
| @@ -159,13 +317,21 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -159,13 +317,21 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 159 | print(value); | 317 | print(value); |
| 160 | // currentRemark = value; | 318 | // currentRemark = value; |
| 161 | // print(); | 319 | // print(); |
| 320 | + setState(() { | ||
| 321 | + if (value != '¥' && value.trim().length > 0) { | ||
| 322 | + btnState = 1; | ||
| 323 | + } else { | ||
| 324 | + btnState = -1; | ||
| 325 | + } | ||
| 326 | + }); | ||
| 162 | }, | 327 | }, |
| 163 | onEditingComplete: () { | 328 | onEditingComplete: () { |
| 164 | print('fff'); | 329 | print('fff'); |
| 165 | - _editingController.text = ''; | 330 | + _focusNode.unfocus(); |
| 331 | + // _editingController.text = ''; | ||
| 166 | // _needNode.unfocus(); | 332 | // _needNode.unfocus(); |
| 167 | }, | 333 | }, |
| 168 | - // keyboardType: TextInputType.number, | 334 | + keyboardType: TextInputType.number, |
| 169 | )) | 335 | )) |
| 170 | ], | 336 | ], |
| 171 | ), | 337 | ), |
| @@ -175,6 +341,8 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -175,6 +341,8 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 175 | ); | 341 | ); |
| 176 | } | 342 | } |
| 177 | 343 | ||
| 344 | + /// | ||
| 345 | + | ||
| 178 | ///顾客信息 | 346 | ///顾客信息 |
| 179 | Widget _customInfoItemWidget(String title, String subTitle) { | 347 | Widget _customInfoItemWidget(String title, String subTitle) { |
| 180 | return Row( | 348 | return Row( |
| @@ -236,13 +404,29 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -236,13 +404,29 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 236 | ScreenUtil().setWidth(36)), | 404 | ScreenUtil().setWidth(36)), |
| 237 | child: Column( | 405 | child: Column( |
| 238 | children: [ | 406 | children: [ |
| 239 | - _customInfoItemWidget('买单顾客', 'ffff'), | 407 | + _customInfoItemWidget( |
| 408 | + '买单顾客', | ||
| 409 | + _orderFoodProvider.reserveDetailSunModel != null | ||
| 410 | + ? _orderFoodProvider.reserveDetailSunModel.rnameStr | ||
| 411 | + : ''), | ||
| 240 | VEmptyView(24), | 412 | VEmptyView(24), |
| 241 | - _customInfoItemWidget('顾客电话', 'ffff'), | 413 | + _customInfoItemWidget( |
| 414 | + '顾客电话', | ||
| 415 | + _orderFoodProvider.reserveDetailSunModel != null | ||
| 416 | + ? _orderFoodProvider.reserveDetailSunModel.phone | ||
| 417 | + : ''), | ||
| 242 | VEmptyView(24), | 418 | VEmptyView(24), |
| 243 | - _customInfoItemWidget('到店时间', 'ffff'), | 419 | + _customInfoItemWidget( |
| 420 | + '到店时间', | ||
| 421 | + _orderFoodProvider.reserveDetailSunModel != null | ||
| 422 | + ? _orderFoodProvider.reserveDetailSunModel.ddateStr | ||
| 423 | + : ''), | ||
| 244 | VEmptyView(24), | 424 | VEmptyView(24), |
| 245 | - _customInfoItemWidget('申请时间', 'ffff') | 425 | + _customInfoItemWidget( |
| 426 | + '申请时间', | ||
| 427 | + _orderFoodProvider.reserveDetailSunModel != null | ||
| 428 | + ? _orderFoodProvider.reserveDetailSunModel.cdateStr | ||
| 429 | + : '') | ||
| 246 | ], | 430 | ], |
| 247 | ), | 431 | ), |
| 248 | ) | 432 | ) |
| @@ -256,6 +440,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -256,6 +440,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 256 | Widget build(BuildContext context) { | 440 | Widget build(BuildContext context) { |
| 257 | _onlineCheckEditProvider = | 441 | _onlineCheckEditProvider = |
| 258 | Provider.of<OnlineCheckEditProvider>(context, listen: true); | 442 | Provider.of<OnlineCheckEditProvider>(context, listen: true); |
| 443 | + _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); | ||
| 259 | return Scaffold( | 444 | return Scaffold( |
| 260 | backgroundColor: MyColours.color_f5f5f5, | 445 | backgroundColor: MyColours.color_f5f5f5, |
| 261 | appBar: SystemAppBar( | 446 | appBar: SystemAppBar( |
| @@ -268,38 +453,70 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -268,38 +453,70 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 268 | } | 453 | } |
| 269 | }, | 454 | }, |
| 270 | ), | 455 | ), |
| 271 | - body: SingleChildScrollView( | ||
| 272 | - controller: _scrollController, | ||
| 273 | - child: Padding( | ||
| 274 | - padding: EdgeInsets.symmetric( | ||
| 275 | - horizontal: ScreenUtil().setWidth(20), | ||
| 276 | - vertical: ScreenUtil().setWidth(40)), | ||
| 277 | - child: Column( | ||
| 278 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 279 | - children: [ | ||
| 280 | - //图标 | ||
| 281 | - _getLogoWidget(), | ||
| 282 | - VEmptyView(40), | ||
| 283 | - _getTabAndMoneyInfoWidget(), | ||
| 284 | - VEmptyView(10), | ||
| 285 | - // 备注信息 | ||
| 286 | - Container( | ||
| 287 | - padding: EdgeInsets.symmetric( | ||
| 288 | - horizontal: ScreenUtil().setWidth(20)), | ||
| 289 | - child: Text( | ||
| 290 | - '*贾森基德款式经典福克斯肌肤快速反击', | ||
| 291 | - style: TextStyle( | ||
| 292 | - fontSize: ScreenUtil().setSp(28), | ||
| 293 | - color: MyColours.color_FD5656), | ||
| 294 | - ), | ||
| 295 | - ), | ||
| 296 | - VEmptyView(20), | ||
| 297 | - ImgPickerWidget(scrollController: _scrollController), | ||
| 298 | - VEmptyView(20), | ||
| 299 | - _customInfoWidget() | ||
| 300 | - ], | ||
| 301 | - )), | ||
| 302 | - ), | 456 | + body: Padding( |
| 457 | + padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)), | ||
| 458 | + child: Column( | ||
| 459 | + children: [ | ||
| 460 | + Expanded( | ||
| 461 | + child: SingleChildScrollView( | ||
| 462 | + controller: _scrollController, | ||
| 463 | + child: Column( | ||
| 464 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 465 | + children: [ | ||
| 466 | + VEmptyView(40), | ||
| 467 | + //图标 | ||
| 468 | + _getLogoWidget(), | ||
| 469 | + VEmptyView(40), | ||
| 470 | + _getTabAndMoneyInfoWidget(), | ||
| 471 | + VEmptyView(10), | ||
| 472 | + // 备注信息 | ||
| 473 | + Offstage( | ||
| 474 | + offstage: | ||
| 475 | + _onlineCheckEditProvider.orderInfoSunModel != | ||
| 476 | + null | ||
| 477 | + ? _onlineCheckEditProvider | ||
| 478 | + .orderInfoSunModel.orderRemark == | ||
| 479 | + '' | ||
| 480 | + : true, | ||
| 481 | + child: Container( | ||
| 482 | + padding: EdgeInsets.symmetric( | ||
| 483 | + horizontal: ScreenUtil().setWidth(20)), | ||
| 484 | + child: Text( | ||
| 485 | + _onlineCheckEditProvider.orderInfoSunModel != | ||
| 486 | + null | ||
| 487 | + ? _onlineCheckEditProvider | ||
| 488 | + .orderInfoSunModel.orderRemark | ||
| 489 | + : '', | ||
| 490 | + style: TextStyle( | ||
| 491 | + fontSize: ScreenUtil().setSp(28), | ||
| 492 | + color: MyColours.color_FD5656), | ||
| 493 | + ), | ||
| 494 | + ), | ||
| 495 | + ), | ||
| 496 | + VEmptyView(20), | ||
| 497 | + ImgPickerWidget(scrollController: _scrollController), | ||
| 498 | + VEmptyView(20), | ||
| 499 | + _customInfoWidget() | ||
| 500 | + ], | ||
| 501 | + ))), | ||
| 502 | + Padding( | ||
| 503 | + padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(16), 0, | ||
| 504 | + ScreenUtil().setWidth(16), ScreenUtil().setWidth(40)), | ||
| 505 | + child: CommonButton( | ||
| 506 | + width: double.infinity, | ||
| 507 | + height: 84, | ||
| 508 | + fontSize: 34, | ||
| 509 | + content: '发送给顾客', | ||
| 510 | + state: btnState, | ||
| 511 | + onPress: () async { | ||
| 512 | + DialogUtil.confirmDialog( | ||
| 513 | + context, _editingController.text, 426, onTap: () { | ||
| 514 | + _updateOrderInfo(); | ||
| 515 | + }); | ||
| 516 | + }, | ||
| 517 | + )) | ||
| 518 | + ], | ||
| 519 | + )), | ||
| 303 | ); | 520 | ); |
| 304 | } | 521 | } |
| 305 | } | 522 | } |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | import 'package:one_key/constant/constant.dart'; | 2 | import 'package:one_key/constant/constant.dart'; |
| 3 | +import 'package:one_key/models/order_info_model.dart'; | ||
| 3 | import 'package:one_key/models/qiniu_info_model.dart'; | 4 | import 'package:one_key/models/qiniu_info_model.dart'; |
| 5 | +import 'package:one_key/models/upload_img_model.dart'; | ||
| 4 | import 'package:one_key/net/base_resp.dart'; | 6 | import 'package:one_key/net/base_resp.dart'; |
| 5 | import 'package:one_key/net/dio_util.dart'; | 7 | import 'package:one_key/net/dio_util.dart'; |
| 6 | import 'package:one_key/net/http_url.dart'; | 8 | import 'package:one_key/net/http_url.dart'; |
| 7 | import 'package:one_key/utils/utils.dart'; | 9 | import 'package:one_key/utils/utils.dart'; |
| 8 | 10 | ||
| 9 | class OnlineCheckEditProvider extends ChangeNotifier { | 11 | class OnlineCheckEditProvider extends ChangeNotifier { |
| 10 | - List imageListFile = []; //本地图片显示 | ||
| 11 | - List imageListUrl = []; //七牛云地址 | ||
| 12 | - Map statusMap = {}; //图片上传状态 <bool> true显示图片 ******* false显示进度 | 12 | + List<UploadImgModel> imageList = []; //图片信息列表 |
| 13 | + List<String> imageQiniuUrlList = []; //七牛云地址列表 | ||
| 13 | QiniuInfoSunModel qiniuInfoSunModel; | 14 | QiniuInfoSunModel qiniuInfoSunModel; |
| 14 | - // Map statusMapProgress = {}; //图片上传状态 <bool> true显示图片 ******* false显示进度 | 15 | + OrderInfoSunModel orderInfoSunModel; |
| 15 | 16 | ||
| 16 | /// 获取七牛上传token信息 | 17 | /// 获取七牛上传token信息 |
| 17 | Future<QiniuInfoSunModel> getQiniuInfo( | 18 | Future<QiniuInfoSunModel> getQiniuInfo( |
| @@ -35,4 +36,49 @@ class OnlineCheckEditProvider extends ChangeNotifier { | @@ -35,4 +36,49 @@ class OnlineCheckEditProvider extends ChangeNotifier { | ||
| 35 | } | 36 | } |
| 36 | } | 37 | } |
| 37 | } | 38 | } |
| 39 | + | ||
| 40 | + ///获取账单详情 | ||
| 41 | + getOrderInfo(BuildContext context, Map<String, String> params, | ||
| 42 | + {isShowLoading = true}) async { | ||
| 43 | + BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | ||
| 44 | + .request<Map<String, dynamic>>( | ||
| 45 | + context, Method.get, HttpUrl.get_order_info, | ||
| 46 | + data: params, showLoading: false) | ||
| 47 | + .catchError((error) {}); | ||
| 48 | + if (baseResp.code == Constant.status_success) { | ||
| 49 | + if (baseResp.data.isEmpty) { | ||
| 50 | + } else { | ||
| 51 | + //解析解析 | ||
| 52 | + orderInfoSunModel = OrderInfoModel.fromJson(baseResp.responseData).data; | ||
| 53 | + } | ||
| 54 | + notifyListeners(); | ||
| 55 | + } else { | ||
| 56 | + if (baseResp != null) { | ||
| 57 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + ///商家确认账单 | ||
| 63 | + updateOrderInfo(BuildContext context, Map<String, String> params, | ||
| 64 | + {isShowLoading = true}) async { | ||
| 65 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 66 | + .request<dynamic>(context, Method.get, HttpUrl.update_order_info, | ||
| 67 | + data: params, showLoading: false) | ||
| 68 | + .catchError((error) {}); | ||
| 69 | + if (baseResp.code == Constant.status_success) { | ||
| 70 | + //解析解析 | ||
| 71 | + if (baseResp.data == 1) { | ||
| 72 | + print('成功'); | ||
| 73 | + return true; | ||
| 74 | + } else { | ||
| 75 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 76 | + } | ||
| 77 | + } else { | ||
| 78 | + if (baseResp != null) { | ||
| 79 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + return false; | ||
| 83 | + } | ||
| 38 | } | 84 | } |
| @@ -179,9 +179,9 @@ var handleHasOrderFoodHandler = new Handler( | @@ -179,9 +179,9 @@ var handleHasOrderFoodHandler = new Handler( | ||
| 179 | ///提前买单编辑页面 | 179 | ///提前买单编辑页面 |
| 180 | var handleOnlineCheckEditHandler = new Handler( | 180 | var handleOnlineCheckEditHandler = new Handler( |
| 181 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | 181 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { |
| 182 | - // String rid = params["rid"].first; | 182 | + String rid = params["rid"].first; |
| 183 | bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first); | 183 | bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first); |
| 184 | return ChangeNotifierProvider<OrderFoodProvider>( | 184 | return ChangeNotifierProvider<OrderFoodProvider>( |
| 185 | create: (_) => OrderFoodProvider(), | 185 | create: (_) => OrderFoodProvider(), |
| 186 | - child: OnlineCheckEditPage(fromNotify: fromNotify)); | 186 | + child: OnlineCheckEditPage(fromNotify: fromNotify,rid:rid)); |
| 187 | }); | 187 | }); |
| @@ -269,7 +269,6 @@ class DialogUtil { | @@ -269,7 +269,6 @@ class DialogUtil { | ||
| 269 | }); | 269 | }); |
| 270 | messageModel.showMessageDialog = false; | 270 | messageModel.showMessageDialog = false; |
| 271 | } | 271 | } |
| 272 | - | ||
| 273 | 272 | ||
| 274 | //解析返回显示的日期 | 273 | //解析返回显示的日期 |
| 275 | static String _parseDateDay(DateTime dateTime) { | 274 | static String _parseDateDay(DateTime dateTime) { |
| @@ -798,6 +797,82 @@ class DialogUtil { | @@ -798,6 +797,82 @@ class DialogUtil { | ||
| 798 | }); | 797 | }); |
| 799 | } | 798 | } |
| 800 | 799 | ||
| 800 | + static Future confirmDialog(BuildContext context, String title, double height, | ||
| 801 | + {GestureTapCallback onTap, double fontSize = 36}) async { | ||
| 802 | + String showTitle = title; | ||
| 803 | + if (showTitle.startsWith('¥')) { | ||
| 804 | + showTitle = title.substring(1, title.length); | ||
| 805 | + } | ||
| 806 | + final action = await showDialog( | ||
| 807 | + context: context, | ||
| 808 | + barrierDismissible: true, | ||
| 809 | + builder: (BuildContext context) { | ||
| 810 | + return Center( | ||
| 811 | + child: Container( | ||
| 812 | + height: ScreenUtil().setWidth(height), | ||
| 813 | + width: ScreenUtil().setWidth(280 * 2), | ||
| 814 | + decoration: BoxDecoration( | ||
| 815 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))), | ||
| 816 | + child: Card( | ||
| 817 | + shape: RoundedRectangleBorder( | ||
| 818 | + borderRadius: BorderRadius.all( | ||
| 819 | + Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角 | ||
| 820 | + child: Column( | ||
| 821 | + children: [ | ||
| 822 | + VEmptyView(20), | ||
| 823 | + InkWell( | ||
| 824 | + onTap: () { | ||
| 825 | + Navigator.of(context).pop(); | ||
| 826 | + }, | ||
| 827 | + child: Container( | ||
| 828 | + height: ScreenUtil().setWidth(48), | ||
| 829 | + color: Colors.white, | ||
| 830 | + padding: | ||
| 831 | + EdgeInsets.only(right: ScreenUtil().setWidth(36)), | ||
| 832 | + alignment: Alignment.centerRight, | ||
| 833 | + child: Image.asset(Utils.getImgPath('close1'), | ||
| 834 | + width: ScreenUtil().setWidth(20), | ||
| 835 | + height: ScreenUtil().setWidth(20)), | ||
| 836 | + ), | ||
| 837 | + ), | ||
| 838 | + VEmptyView(36), | ||
| 839 | + Text('应收金额', | ||
| 840 | + style: TextStyle( | ||
| 841 | + color: MyColours.color_707070, | ||
| 842 | + fontSize: ScreenUtil().setSp(30), | ||
| 843 | + )), | ||
| 844 | + VEmptyView(16), | ||
| 845 | + Container( | ||
| 846 | + height: ScreenUtil().setWidth(46 * 2), | ||
| 847 | + child: | ||
| 848 | + Text('¥ ${double.parse(showTitle).toStringAsFixed(2)}', | ||
| 849 | + style: TextStyle( | ||
| 850 | + color: MyColours.color_353535, | ||
| 851 | + fontSize: ScreenUtil().setSp(66), | ||
| 852 | + )), | ||
| 853 | + ), | ||
| 854 | + VEmptyView(34), | ||
| 855 | + Padding( | ||
| 856 | + padding: EdgeInsets.symmetric( | ||
| 857 | + horizontal: ScreenUtil().setWidth(68 * 2)), | ||
| 858 | + child: CommonButton( | ||
| 859 | + width: double.infinity, | ||
| 860 | + height: 84, | ||
| 861 | + fontSize: 34, | ||
| 862 | + content: '确定发送', | ||
| 863 | + state: 1, | ||
| 864 | + onPress: onTap, | ||
| 865 | + )), | ||
| 866 | + VEmptyView(50), | ||
| 867 | + ], | ||
| 868 | + ), | ||
| 869 | + ), | ||
| 870 | + ), | ||
| 871 | + ); | ||
| 872 | + }, | ||
| 873 | + ); | ||
| 874 | + } | ||
| 875 | + | ||
| 801 | static Future openAlertDialog(BuildContext context, String title, | 876 | static Future openAlertDialog(BuildContext context, String title, |
| 802 | String content, String btnTitle, double height, | 877 | String content, String btnTitle, double height, |
| 803 | {GestureTapCallback onTap, double fontSize = 36}) async { | 878 | {GestureTapCallback onTap, double fontSize = 36}) async { |
| @@ -807,8 +882,9 @@ class DialogUtil { | @@ -807,8 +882,9 @@ class DialogUtil { | ||
| 807 | builder: (BuildContext context) { | 882 | builder: (BuildContext context) { |
| 808 | return Center( | 883 | return Center( |
| 809 | child: Container( | 884 | child: Container( |
| 885 | + padding: | ||
| 886 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(72)), | ||
| 810 | height: ScreenUtil().setWidth(height), | 887 | height: ScreenUtil().setWidth(height), |
| 811 | - width: ScreenUtil().setWidth(280 * 2), | ||
| 812 | decoration: BoxDecoration( | 888 | decoration: BoxDecoration( |
| 813 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), | 889 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), |
| 814 | child: Card( | 890 | child: Card( |
| @@ -132,7 +132,8 @@ class NavigatorUtil { | @@ -132,7 +132,8 @@ class NavigatorUtil { | ||
| 132 | /// 提前买单编辑页面 | 132 | /// 提前买单编辑页面 |
| 133 | static void goOnlineCheckEditPage(BuildContext context, | 133 | static void goOnlineCheckEditPage(BuildContext context, |
| 134 | {String rid, fromNotify = false, replace = false}) { | 134 | {String rid, fromNotify = false, replace = false}) { |
| 135 | - _navigateTo(context, "${Routes.online_check_edit}?fromNotify=${fromNotify}", | 135 | + _navigateTo(context, |
| 136 | + "${Routes.online_check_edit}?fromNotify=${fromNotify}&rid=${rid}", | ||
| 136 | replace: replace); | 137 | replace: replace); |
| 137 | } | 138 | } |
| 138 | } | 139 | } |
| @@ -212,6 +212,21 @@ class Utils { | @@ -212,6 +212,21 @@ class Utils { | ||
| 212 | return false; | 212 | return false; |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | + static String listToString(List<String> list) { | ||
| 216 | + if (list == null) { | ||
| 217 | + return null; | ||
| 218 | + } | ||
| 219 | + String result; | ||
| 220 | + list.forEach((string) { | ||
| 221 | + if (result == null) { | ||
| 222 | + result = string; | ||
| 223 | + } else { | ||
| 224 | + result = '$result,$string'; | ||
| 225 | + } | ||
| 226 | + }); | ||
| 227 | + return result.toString(); | ||
| 228 | + } | ||
| 229 | + | ||
| 215 | /// 获取日期 今天 明天 后天等等 | 230 | /// 获取日期 今天 明天 后天等等 |
| 216 | static int getDdate(List dateList) { | 231 | static int getDdate(List dateList) { |
| 217 | String ymyStr = ""; //年月日 | 232 | String ymyStr = ""; //年月日 |
| @@ -27,7 +27,7 @@ class CommonButton extends StatelessWidget { | @@ -27,7 +27,7 @@ class CommonButton extends StatelessWidget { | ||
| 27 | switch (state) { | 27 | switch (state) { |
| 28 | case -1: | 28 | case -1: |
| 29 | boxDecoration = BoxDecoration( | 29 | boxDecoration = BoxDecoration( |
| 30 | - color: MyColours.color_d8d8d8, | 30 | + color: MyColours.color_74BBBE, |
| 31 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), | 31 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), |
| 32 | ); | 32 | ); |
| 33 | fontColor = MyColours.color_ffffff; | 33 | fontColor = MyColours.color_ffffff; |
-
Please register or login to post a comment