diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-1024.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-1024.png index e197d3fd..dd686235 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-1024.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-1024.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png index 9bb0cbce..051cbe83 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png index c6e0db7c..686da8e1 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png index c6e0db7c..686da8e1 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png index b24129de..1a025182 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png index 2adf8d41..e80485fd 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29.png index 2adf8d41..e80485fd 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png index 8639c53a..f6df9432 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png index 8639c53a..f6df9432 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png index 60864de6..f3fbc54b 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40.png index c6e0db7c..686da8e1 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png index 6245695d..8bb31cad 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png index 99727f25..cb60b5db 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png index 99727f25..cb60b5db 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png index 5ba75721..efeb706e 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76.png index 748858a3..dbd63dbb 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png index cf40e6b2..fd006b56 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png index 1ab4560c..17337fa6 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份.png index bcd66b5b..3036d8e0 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@2x.png index c4d74b07..7b1506fd 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@2x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@3x.png index 5347cf27..176b34ef 100644 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@3x.png and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/引导页备份@3x.png differ diff --git a/lib/business_system/goods/on_sale/batch_shelf.dart b/lib/business_system/goods/on_sale/batch_shelf.dart index 3a501030..1e540bd7 100644 --- a/lib/business_system/goods/on_sale/batch_shelf.dart +++ b/lib/business_system/goods/on_sale/batch_shelf.dart @@ -349,7 +349,7 @@ class _BatchShelf extends State { Widget shelfGoodsItem(AdminProductVoList adminProductVoList){ return Container( - margin: EdgeInsets.only(bottom: 21.h), + margin: EdgeInsets.only(bottom: 21.h,left: 16.w), child: Row( children: [ MImage( diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart index 1d6e0e8b..bdf67831 100644 --- a/lib/business_system/mine/business_mine_page.dart +++ b/lib/business_system/mine/business_mine_page.dart @@ -38,6 +38,7 @@ class _BusinessMinePage extends State List records = []; double visiblePercentage; + @override void initState() { super.initState(); diff --git a/lib/business_system/mine/merchant_info.dart b/lib/business_system/mine/merchant_info.dart index 5017513b..fdaedd33 100644 --- a/lib/business_system/mine/merchant_info.dart +++ b/lib/business_system/mine/merchant_info.dart @@ -1,5 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/retrofit/data/business_store_list.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -46,6 +47,9 @@ class _MerchantInfo extends State { ///保存店铺信息 saveInfo() async { + EasyLoading.show( + status: S.current.zhengzaijiazai, + maskType: EasyLoadingMaskType.black); if (businessService == null) { businessService = BusinessApiService(Dio(), context: context, @@ -68,9 +72,11 @@ class _MerchantInfo extends State { "isAutoSendRefundAddress": 1 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { + EasyLoading.dismiss(); SmartDialog.showToast("店铺设置修改成功", alignment: Alignment.center); Navigator.of(context).pop(); } else { + EasyLoading.dismiss(); SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } diff --git a/lib/business_system/order/order_list.dart b/lib/business_system/order/order_list.dart index a9f1e131..6907f4de 100644 --- a/lib/business_system/order/order_list.dart +++ b/lib/business_system/order/order_list.dart @@ -160,7 +160,7 @@ class _OrderList extends State { margin: EdgeInsets.all(50.h), ) : Padding( - padding: EdgeInsets.symmetric(vertical: 16.w), + padding: EdgeInsets.only(top: 16.h), child: ListView.builder( itemCount: adminOrderDTOList?.length ?? 0, physics: BouncingScrollPhysics(), diff --git a/lib/business_system/order/order_write_off.dart b/lib/business_system/order/order_write_off.dart index 85fbcceb..32befafd 100644 --- a/lib/business_system/order/order_write_off.dart +++ b/lib/business_system/order/order_write_off.dart @@ -1,10 +1,15 @@ +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../retrofit/business_api.dart'; +import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/business_order_list.dart'; +import '../../utils/business_instance.dart'; import '../../view_widget/classic_header.dart'; import '../../view_widget/my_footer.dart'; @@ -25,6 +30,9 @@ class _OrderWriteOff extends State { List tickets; String productName; int nameIndex = 0; + BusinessApiService businessService; + List itemMap = []; + List skuTickets = []; @override void initState() { @@ -33,6 +41,66 @@ class _OrderWriteOff extends State { productName = widget.arguments["productName"]; } + ///单个核销 + singleWiped() async { + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.wiped({ + "pageNum":1, + "pageSize":10, + "productId":"", + "productSkuId":"", + "searchKey":"", + "state":"", + "storeId":"", + "ticketCode":"", + "ticketId":"", + "ticketItemIds":[], + "type":"" + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + SmartDialog.showToast("核销成功", alignment: Alignment.center); + Navigator.pop(context); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + ///多个核销 + severalWiped() async { + if (businessService == null) { + businessService = BusinessApiService(Dio(), + context: context, + token: BusinessInstance.instance.businessToken, + tenant: BusinessInstance.instance.businessTenant, + storeId: widget.arguments["storeId"]); + } + BaseData baseData = await businessService.posTicketRecharge({ + "itemMap":[{ + "productSkuld":tickets[nameIndex].productSkuId ?? "", + "skuTickets":[{ + "number":1, + "skuTicket":tickets[nameIndex].name ?? "", + "state":tickets[nameIndex].state ?? "", + }] + }], + "ticketCode":tickets[nameIndex].code ?? "", + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + SmartDialog.showToast("核销成功", alignment: Alignment.center); + Navigator.pop(context); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + + @override Widget build(BuildContext context) { return Scaffold( @@ -49,14 +117,16 @@ class _OrderWriteOff extends State { enablePullDown: true, enablePullUp: false, header: MyHeader( - color: Colors.white, + color: Color(0xFF30415B), ), footer: CustomFooter( builder: (context, mode) { return MyFooter(mode); }, ), - onRefresh: () {}, + onRefresh: () { + refreshController.refreshCompleted(); + }, physics: BouncingScrollPhysics(), scrollController: ScrollController(), child: SingleChildScrollView( @@ -67,21 +137,45 @@ class _OrderWriteOff extends State { children: [ basicInfo(), writeOffInfo(), - Container( - width: double.infinity, - alignment: Alignment.center, - margin: EdgeInsets.only(bottom:55.h,top: 125.h), - padding: EdgeInsets.symmetric(vertical:16.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(27), - color: Color(0xFF30415B) - ), - child: Text( - "确认核销", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 16.sp, - color: Colors.white, + GestureDetector( + onTap:(){ + if (itemMap.length != 0) itemMap.clear(); + tickets.forEach((element) { + if (element.isSelect) { + skuTickets.add({ + "number":1, + "skuTicket":element.name, + "state":element.state,}); + itemMap.add({ + "productSkuld":element.productSkuId, + "skuTickets":skuTickets + }); + } + }); + if (itemMap.length == 0) { + SmartDialog.showToast("请选择要核销的商品", + alignment: Alignment.center); + return; + } else { + severalWiped(); + } + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom:55.h,), + padding: EdgeInsets.symmetric(vertical:16.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B) + ), + child: Text( + "确认核销", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Colors.white, + ), ), ), ) @@ -229,6 +323,20 @@ class _OrderWriteOff extends State { ); }, ) + // ListView.builder( + // padding: EdgeInsets.zero, + // itemCount:3, + // scrollDirection: Axis.vertical, + // shrinkWrap: true, + // physics: BouncingScrollPhysics(), + // itemBuilder: (context, position) { + // return GestureDetector( + // onTap: () { + // }, + // child: writeOffInfoItems(), + // ); + // }, + // ) ], ), ); @@ -266,11 +374,11 @@ class _OrderWriteOff extends State { SizedBox(height:25.h,), if(tickets.state == 1) Checkbox( - value: writeOffCheck, + value: tickets.isSelect, onChanged: (a) { setState(() { - writeOffCheck = !writeOffCheck; - }); + tickets.isSelect = !tickets.isSelect; + }); }, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(2.0), @@ -313,4 +421,62 @@ class _OrderWriteOff extends State { ), ); } + + Widget writeOffInfoItems(){ + return Container( + width: double.infinity, + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: Text( + "哈哈哈哈哈", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + ), + )), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding(padding: EdgeInsets.only(right:10.w), + child: Text( + "已核销", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 12.sp, + color: Color(0xFF30415B), + ), + ),), + SizedBox(height:25.h,), + Checkbox( + value: writeOffCheck, + onChanged: (a) { + setState(() { + writeOffCheck = !writeOffCheck; + }); + }, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(2.0), + ), + checkColor: Color(0xFFFFFFFF), + fillColor:MaterialStateProperty.all(Color(0xFF30415B)), + ), + ], + )) + ], + ), + Container( + margin: EdgeInsets.only(bottom:11.h,top: 13.h), + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + ) + ], + ), + ); + } } diff --git a/lib/retrofit/business_api.dart b/lib/retrofit/business_api.dart index cd0580a9..a6edb949 100644 --- a/lib/retrofit/business_api.dart +++ b/lib/retrofit/business_api.dart @@ -257,4 +257,10 @@ abstract class BusinessApiService { Future wipedBatch( @Body() Map param); + + ///pos端核销接口 + @POST("member/posTicketRecharge") + Future posTicketRecharge( + @Body() Map param); + } diff --git a/lib/retrofit/business_api.g.dart b/lib/retrofit/business_api.g.dart index f8f9fdb3..2d51ad52 100644 --- a/lib/retrofit/business_api.g.dart +++ b/lib/retrofit/business_api.g.dart @@ -596,4 +596,26 @@ class _BusinessApiService implements BusinessApiService { ); return value; } + + @override + Future posTicketRecharge(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('member/posTicketRecharge', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json == null ? null : json, + ); + return value; + } } diff --git a/lib/retrofit/data/business_order_list.dart b/lib/retrofit/data/business_order_list.dart index 5c787ce7..849f59db 100644 --- a/lib/retrofit/data/business_order_list.dart +++ b/lib/retrofit/data/business_order_list.dart @@ -410,6 +410,7 @@ AdminOrderDtoList copyWith({ String id, bool get ticketStatus => _ticketStatus; List get tickets => _tickets; + Map toJson() { final map = {}; map['id'] = _id; @@ -683,6 +684,13 @@ Tickets copyWith({ String id, bool get canSubscribe => _canSubscribe; num get isDelete => _isDelete; String get tenantCode => _tenantCode; + bool _isSelect = false; + + bool get isSelect => _isSelect; + + set isSelect(bool value) { + _isSelect = value; + } Map toJson() { final map = {};