From dfabb8f4dfa05b34e84f4c6c43dbfdcb53a4fcf7 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Fri, 9 Aug 2024 11:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E7=A5=A8=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=9B=20pdf=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=EF=BC=88flutter=5Fpdfview=EF=BC=89=EF=BC=9B=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=91=E7=A5=A8=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 4 + lib/main.dart | 3 + .../invoices_manage/invoices_detail_page.dart | 820 +++++++++ .../invoices_manage/invoices_history.dart | 10 +- .../invoices_manage/invoices_title_info.dart | 1 + lib/order/invoices_manage/pdf_screen.dart | 179 ++ lib/retrofit/data/invoices_detail_info.dart | 1515 +++++++++++++++++ lib/retrofit/retrofit_api.dart | 5 + lib/retrofit/retrofit_api.g.dart | 22 + pubspec.lock | 28 +- pubspec.yaml | 4 +- 11 files changed, 2579 insertions(+), 12 deletions(-) create mode 100644 lib/order/invoices_manage/invoices_detail_page.dart create mode 100644 lib/order/invoices_manage/pdf_screen.dart create mode 100644 lib/retrofit/data/invoices_detail_info.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index b47d05c0..0d70196a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -168,6 +168,10 @@ android { exclude 'assets/main_icon_zoomin.png' exclude 'assets/cfg/a/mode_1/reduct.sty' exclude 'assets/SDK_Default_Traffic_Texture_SevereCongestion.png' + pickFirst 'lib/x86/libc++_shared.so' + pickFirst 'lib/x86_64/libc++_shared.so' + pickFirst 'lib/armeabi-v7a/libc++_shared.so' + pickFirst 'lib/arm64-v8a/libc++_shared.so' } aaptOptions { additionalParameters '--auto-add-overlay' diff --git a/lib/main.dart b/lib/main.dart index 301c616f..882d4d1e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -171,6 +171,7 @@ import 'mine/release_page.dart'; import 'mine/roll_center_page.dart'; import 'order/invoices_manage/add_invoices_title.dart'; import 'order/invoices_manage/edit_invoices_info.dart'; +import 'order/invoices_manage/invoices_detail_page.dart'; import 'order/invoices_manage/invoices_history.dart'; import 'order/invoices_manage/invoices_manage_page.dart'; import 'order/invoices_manage/invoices_title_info.dart'; @@ -593,5 +594,7 @@ Map routers = { InvoicesHistory(), '/router/edit_invoices_info': (context, {arguments}) => EditInvoicesInfo(arguments:arguments), + '/router/invoices_detail_page': (context, {arguments}) => + InvoicesDetailPage(arguments:arguments), }; diff --git a/lib/order/invoices_manage/invoices_detail_page.dart b/lib/order/invoices_manage/invoices_detail_page.dart new file mode 100644 index 00000000..60c72891 --- /dev/null +++ b/lib/order/invoices_manage/invoices_detail_page.dart @@ -0,0 +1,820 @@ +import 'dart:async'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/order/invoices_manage/pdf_screen.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:shimmer/shimmer.dart'; +import 'package:url_launcher/url_launcher.dart'; + +import '../../community/photo_view_gallery_screen.dart'; +import '../../retrofit/data/base_data.dart'; +import '../../retrofit/data/invoices_detail_info.dart'; +import '../../retrofit/retrofit_api.dart'; +import '../../utils/flutter_utils.dart'; +import '../../utils/font_weight.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_appbar.dart'; +import '../../view_widget/my_footer.dart'; + +class InvoicesDetailPage extends StatefulWidget { + final Map arguments; + + InvoicesDetailPage({this.arguments}); + + @override + State createState() { + return _InvoicesDetailPage(); + } +} + +class _InvoicesDetailPage extends State { + ApiService apiService; + InvoicesDetailInfo invoicesDetailInfo; + String remotePDFpath = ""; + String networkError = ""; + int networkStatus = 0; + final RefreshController refreshController = RefreshController(); + + @override + void initState() { + super.initState(); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService( + Dio(), + context: context, + token: value.getString('token'), + ), + queryInvoices(widget?.arguments["id"] ?? ""), + }); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + } + + ///发票详情 + queryInvoices(id) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = + await apiService.invoiceDetail(id).catchError((error) { + networkError = AppUtils.dioErrorTypeToString(error.type); + networkStatus = -1; + setState(() {}); + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (baseData != null && baseData.isSuccess) { + invoicesDetailInfo = baseData.data; + createFileOfPdfUrl().then((f) { + setState(() { + remotePDFpath = f.path; + }); + }); + refreshController.refreshCompleted(); + networkStatus = 1; + setState(() {}); + } else { + refreshController.refreshFailed(); + refreshController.loadFailed(); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + + ///从网络下载 PDF 文件。 + Future createFileOfPdfUrl() async { + Completer completer = Completer(); + print("Start download file from internet!"); + try { + final url = invoicesDetailInfo?.ossUrl ?? ""; + final filename = url.substring(url.lastIndexOf("/") + 1); + var request = await HttpClient().getUrl(Uri.parse(url)); + var response = await request.close(); + var bytes = await consolidateHttpClientResponseBytes(response); + var dir = await getApplicationDocumentsDirectory(); + print("Download files"); + print("${dir.path}/$filename"); + File file = File("${dir.path}/$filename"); + + await file.writeAsBytes(bytes, flush: true); + completer.complete(file); + } catch (e) { + throw Exception('Error parsing asset file!'); + } + return completer.future; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + resizeToAvoidBottomInset: false, + appBar: MyAppBar( + title: "发票详情", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + ), + body: networkStatus == -1 + ? noNetwork() + : (networkStatus == 0 + ? invoicesSm() + : SmartRefresher( + controller: refreshController, + enablePullDown: true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + queryInvoices(widget?.arguments["id"] ?? ""); + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + margin: EdgeInsets.only(top: 12.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 18.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "电子发票资讯", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + ), + ), + Padding( + padding: EdgeInsets.only( + top: 16.h, bottom: 18.h), + child: Row( + children: [ + Expanded( + child: Text( + "发票状态", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + invoicesState( + invoicesDetailInfo?.state ?? + ""), + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: Row( + children: [ + Expanded( + child: Text( + "发票抬头", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Expanded( + child: Text( + invoicesDetailInfo + ?.invoiceHeaderName ?? + "", + maxLines: 1, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.end, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: Row( + children: [ + Expanded( + child: Text( + "申请时间", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + invoicesDetailInfo?.reviewerTime ?? + "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + ), + Row( + children: [ + Expanded( + child: Text( + "开票金额", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Text( + invoicesDetailInfo?.money ?? "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ) + ], + ), + ), + GestureDetector( + onTap: () { + if ((invoicesDetailInfo?.ossUrl ?? "") + .endsWith("pdf")) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PDFScreen( + path: remotePDFpath, + inlet: 0, + ), + ), + ); + } else { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PhotoViewGalleryScreen( + images: [ + invoicesDetailInfo?.ossUrl ?? "" + ], //传入图片list + index: 0, //传入当前点击的图片的index + ), + )); + } + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 17.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + "1张发票,含${invoicesDetailInfo?.orderList?.length ?? 0}个订单", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )), + Padding( + padding: EdgeInsets.only(right: 6.w), + child: Text( + "查看", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Icon(Icons.arrow_forward_ios, + color: Color(0xFF181818), size: 14.sp) + ], + ), + ), + ), + ], + ), + )), + Row( + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if ((invoicesDetailInfo?.ossUrl ?? "") + .endsWith("pdf")) { + showPdfAlertDialog(); + } else { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PhotoViewGalleryScreen( + images: [ + invoicesDetailInfo?.ossUrl ?? "" + ], //传入图片list + index: 0, //传入当前点击的图片的index + ), + )); + } + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 16.h), + margin: EdgeInsets.only( + bottom: 34.h, right: 9.5.w, left: 14.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(45), + border: Border.all( + color: Color(0xff32A060), + width: 1.w, + ), + ), + width: double.infinity, + alignment: Alignment.center, + child: Text( + "查看电子发票", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + )), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + launchBrowser(); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 16.h), + margin: EdgeInsets.only( + bottom: 34.h, left: 9.5.w, right: 14.w), + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.circular(45), + ), + width: double.infinity, + alignment: Alignment.center, + child: Text( + "下载电子发票", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + )), + ], + ) + ], + ), + ), + )), + ); + } + + ///发票状态 + String invoicesState(state) { + if (state == "UN_AUDIT") { + return "待审核"; + } else if (state == "AUDIT_PASS") { + return "开票成功"; + } else if (state == "AUDIT_VOID") { + return "已作废"; + } else if (state == "AUDIT_FAIL") { + return "开票失败"; + } else { + return ""; + } + } + + ///查看电子发票 + showPdfAlertDialog() { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return PDFScreen(path: remotePDFpath, inlet: 1); + }, + ); + } + + ///打开浏览器 + launchBrowser() async { + String url = invoicesDetailInfo?.ossUrl ?? ""; + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + + Widget invoicesSm() { + return Container( + margin: EdgeInsets.only(top: 12.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.symmetric(horizontal: 17.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: + EdgeInsets.symmetric(vertical: 16.h, horizontal: 18.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 90.w, + height: 20.h, + ), + ), + Padding( + padding: EdgeInsets.only(top: 16.h, bottom: 18.h), + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 18.h), + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + ], + ), + ), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 58.w, + height: 20.h, + ), + ), + ], + ) + ], + ), + ), + Container( + padding: + EdgeInsets.symmetric(vertical: 16.h, horizontal: 17.w), + margin: EdgeInsets.symmetric(vertical: 12.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 124.w, + height: 20.h, + ), + ), + Spacer(), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 28.w, + height: 20.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 18.w, + height: 20.h, + ), + ), + ], + ), + ), + ], + ), + )), + Row( + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + // padding: EdgeInsets.symmetric(vertical: 16.h), + margin: + EdgeInsets.only(bottom: 34.h, right: 9.5.w, left: 14.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(45), + ), + width: 164.w, + height: 48.h, + ), + ), + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + // padding: EdgeInsets.symmetric(vertical: 16.h), + margin: + EdgeInsets.only(bottom: 34.h, right: 9.5.w, left: 14.w), + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(45), + ), + width: 164.w, + height: 48.h, + ), + ), + ], + ), + ], + ), + ); + } + + Widget noNetwork() { + return Container( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + // "无法连接到网络", + networkError.substring(0, networkError.indexOf(",")), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.bold), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 10.h), + child: Text( + "请检查网络设置或稍后重试", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + queryInvoices(widget?.arguments["id"] ?? ""); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h), + child: Text( + "重试", + style: TextStyle( + fontSize: 14.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular), + )), + ) + ], + ), + ); + } +} diff --git a/lib/order/invoices_manage/invoices_history.dart b/lib/order/invoices_manage/invoices_history.dart index 88fd78d7..79a4c3b5 100644 --- a/lib/order/invoices_manage/invoices_history.dart +++ b/lib/order/invoices_manage/invoices_history.dart @@ -200,7 +200,13 @@ class _InvoicesHistory extends State { itemBuilder: (context, position) { return GestureDetector( behavior: HitTestBehavior.opaque, - onTap: () {}, + onTap: () { + if(records[position].state == "AUDIT_PASS") + Navigator.of(context) + .pushNamed('/router/invoices_detail_page',arguments: { + "id":records[position].id ?? "" + }); + }, child: invoicesHistoryList(records[position]), ); }, @@ -302,6 +308,8 @@ class _InvoicesHistory extends State { return "已作废"; }else if (state =="AUDIT_FAIL") { return "开票失败"; + }else { + return ""; } } diff --git a/lib/order/invoices_manage/invoices_title_info.dart b/lib/order/invoices_manage/invoices_title_info.dart index 13188916..8d56dd2b 100644 --- a/lib/order/invoices_manage/invoices_title_info.dart +++ b/lib/order/invoices_manage/invoices_title_info.dart @@ -130,6 +130,7 @@ class _InvoicesTitleInfo extends State { Future.delayed(Duration(milliseconds: 500), () { SmartDialog.showToast("删除信息成功", alignment: Alignment.center); }); + networkStatus = 1; } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } diff --git a/lib/order/invoices_manage/pdf_screen.dart b/lib/order/invoices_manage/pdf_screen.dart new file mode 100644 index 00000000..ed87f604 --- /dev/null +++ b/lib/order/invoices_manage/pdf_screen.dart @@ -0,0 +1,179 @@ +import 'dart:async'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_pdfview/flutter_pdfview.dart'; + +class PDFScreen extends StatefulWidget { + final String path; + final int inlet; + + PDFScreen({Key key, this.path,this.inlet}) : super(key: key); + + _PDFScreenState createState() => _PDFScreenState(); +} + +class _PDFScreenState extends State with WidgetsBindingObserver { + final Completer _controller = Completer(); + int pages = 0; + int currentPage = 0; + int pageTotal =0; + bool isReady = false; + String errorMessage = ''; + + @override + Widget build(BuildContext context) { + return widget.inlet == 1 ?Material( + type: MaterialType.transparency, + child: Stack( + children: [ + Center( + child: Container( + height:250, + decoration: BoxDecoration( + color: Colors.transparent, + ), + child: PDFView( + filePath: widget.path, + enableSwipe: true, + swipeHorizontal: true, + autoSpacing: false, + pageFling: true, + pageSnap: true, + defaultPage: currentPage, + fitPolicy: FitPolicy.BOTH, + preventLinkNavigation: + false, // if set to true the link is handled in flutter + onRender: (_pages) { + setState(() { + pages = _pages; + isReady = true; + }); + }, + onError: (error) { + setState(() { + errorMessage = error.toString(); + }); + print(error.toString()); + }, + onPageError: (page, error) { + setState(() { + errorMessage = '$page: ${error.toString()}'; + }); + print('$page: ${error.toString()}'); + }, + onViewCreated: (PDFViewController pdfViewController) { + _controller.complete(pdfViewController); + }, + onLinkHandler: (String uri) { + print('goto uri: $uri'); + }, + onPageChanged: (int page, int total) { + print('page change: $page/$total'); + setState(() { + currentPage = page; + pageTotal = total; + }); + }, + ), + ), + ), + errorMessage.isEmpty + ? !isReady + ? Center( + child: CircularProgressIndicator(), + ) + : Container() + : Center( + child: Text(errorMessage), + ), + //pdfindex显示 + Positioned( + width: MediaQuery.of(context).size.width, + bottom:45, + child: Center( + child: Text("${currentPage+1}/${pageTotal}",style: TextStyle(color: Colors.white,fontSize: 16)), + ), + ), + ], + ), + ):Scaffold( + body: Stack( + children: [ + PDFView( + filePath: widget.path, + enableSwipe: true, + swipeHorizontal: true, + autoSpacing: false, + pageFling: true, + pageSnap: true, + defaultPage: currentPage, + fitPolicy: FitPolicy.BOTH, + preventLinkNavigation: + false, // if set to true the link is handled in flutter + onRender: (_pages) { + setState(() { + pages = _pages; + isReady = true; + }); + }, + onError: (error) { + setState(() { + errorMessage = error.toString(); + }); + print(error.toString()); + }, + onPageError: (page, error) { + setState(() { + errorMessage = '$page: ${error.toString()}'; + }); + print('$page: ${error.toString()}'); + }, + onViewCreated: (PDFViewController pdfViewController) { + _controller.complete(pdfViewController); + }, + onLinkHandler: (String uri) { + print('goto uri: $uri'); + }, + onPageChanged: (int page, int total) { + print('page change: $page/$total'); + setState(() { + currentPage = page; + pageTotal = total; + }); + }, + ), + errorMessage.isEmpty + ? !isReady + ? Center( + child: CircularProgressIndicator(), + ) + : Container() + : Center( + child: Text(errorMessage), + ), + //pdfindex显示 + Positioned( + bottom: 45, + width: MediaQuery.of(context).size.width, + child: Center( + child: Text("${currentPage+1}/${pageTotal}",style: TextStyle(color: Colors.black,fontSize: 16)), + ), + ), + Positioned(//右上角关闭按钮 + right: 10, + top: MediaQuery.of(context).padding.top, + child: IconButton( + icon: Icon(Icons.close,size: 30,color: Colors.black,), + onPressed: (){ + Navigator.of(context).pop(); + }, + ), + ), + ], + ), + + ); + + } +} \ No newline at end of file diff --git a/lib/retrofit/data/invoices_detail_info.dart b/lib/retrofit/data/invoices_detail_info.dart new file mode 100644 index 00000000..754baf5b --- /dev/null +++ b/lib/retrofit/data/invoices_detail_info.dart @@ -0,0 +1,1515 @@ +/// id : "1797587255380934656" +/// createTime : "2024-06-03 19:12:54" +/// createUser : "1623178240350748672" +/// updateTime : "2024-06-03 19:16:11" +/// updateUser : "0" +/// phone : "" +/// receivingPhone : null +/// mid : "1623178240350748672" +/// orderIds : ["1797582782189273088"] +/// money : "0.01" +/// type : "ELECTRONIC" +/// headerId : "1797580038447562752" +/// state : "AUDIT_PASS" +/// reviewerTime : "2024-06-03 19:16:11" +/// reviewerBy : "1" +/// ossUrl : "http://file.oa.yixinhuixiang.com/2024/05/30/f11bc4871f78466898e7aa9b79c9b3b2.pdf" +/// reason : "" +/// isDelete : 0 +/// invoiceHeaderName : "回乡信息技术(上海)有限公司武汉分公司" +/// invoiceHeaderCode : "91420106MA49J8GY8D" +/// orderList : [{"id":"1797582782189273088","createTime":"2024-06-03 18:55:07","createUser":"1623178240350748672","updateTime":"2024-06-03 18:55:07","updateUser":"1623178240350748672","tenantCode":"1187","storeId":"1509811680584925184","storeName":"桑葚认养2022","tableId":"0","responsible":null,"orderType":0,"clearTable":false,"mid":"1623178240350748672","parentId":"0","parentCode":null,"orderCode":"202406031855070001","dayFlowCode":"518","orderStatus":4,"sendStatus":0,"payStatus":1,"haveTimes":false,"invoicing":true,"memberAccount":"AA_oODK34oXp-4O8zQhg4OzFbEIL9Yo","owner":"1610225796515889152","logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"refundStatus":0,"addressExt":{"addressId":"1777546429707845632","country":null,"countryId":null,"province":"湖北省","provinceId":null,"city":"武汉市","cityId":null,"district":"江岸区","districtId":null,"cityInfo":"江岸区会议中心","address":"中海中心","recName":"","recMobile":"17612711844","longitude":"114.3096","latitude":"30.59982"},"contactsExtList":[{"name":"兰东","mobile":"17612711844","idcard":""}],"postFee":"0.00","totalPackagingFee":"0.00","couponSubPrice":"0.00","removeDecimal":"0.00","isSubscribe":false,"subcribeTime":null,"sendTime":null,"confirmTime":null,"returnMoneyTime":null,"notes":"","prepayId":"WxPayMpOrderResult(appId=wx4ffd76994dc95086, timeStamp=1717412111, nonceStr=p82DnfDFYGFJzPi5, packageValue=prepay_id=wx031855122394490fad3a1b3b449dd20000, signType=MD5, paySign=35926ED291B7426675A6B6E35C890095)","payTime":"2024-06-03 18:55:30","payChannel":1,"payNum":"","promotionId":"0","actId":"0","couponId":"0","isDelete":0,"isTakeOut":0,"batch":1,"orderDiscountPrice":"0.00","dishesDiscountPrice":"0.00","orderPercentPrice":"0.00","activityNoPrice":"0.00","activityDiscountPrice":"0.00","uniqueDiscountType":"AUTO","totalDiscountPrice":null,"vipDayDiscountPrice":"0.00","orderSource":1,"benefitDiscountAmount":"0.00","vipDiscountPrice":"0.00","orderMerge":null,"canSettlement":true,"endRefundTime":null,"orderProductList":[{"id":"1797582782721949696","createTime":"2024-06-03 18:55:08","createUser":"1623178240350748672","updateTime":"2024-06-03 18:55:08","updateUser":"1623178240350748672","tenantCode":"1187","storeId":"1509811680584925184","orderId":"1797582782189273088","actInfo":null,"productId":"1777275921871405056","times":null,"usedTimes":null,"productName":"牡丹花认养测试","skuId":"1777291794300534784","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"200.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":1,"ticketType":"ADOPT_WARRANT","ticketDays":"365","takeType":null,"skuTickets":["牡丹花挂牌*1","有机牡丹籽油250ml*1"],"ticketStyle":"{\"mainImage\":\"https://pos.upload.lotus-wallet.com/1185/2022/03/9ac1a67d-b9cd-4430-80c2-4f33670939cd.png\",\"identityImage\":\"https://pos.upload.lotus-wallet.com/1185/2022/03/9ac1a67d-b9cd-4430-80c2-4f33670939cd.png\",\"identityName\":\"认养花卉\",\"signature\":\"牡丹认养\"}","setMealDataList":null,"packagingFee":"0.00"}],"businessType":null,"paySum":"0.01","useInvoice":null,"payedPrice":"0.01","finalPayPrice":null,"isEnableSubscribePay":null,"invoiceId":null,"invoiceState":null,"posType":null}] +/// headertype : "COMPANY" +/// companyAddr : "" +/// companyPhone : "" +/// bank : "" +/// bankNumber : "" + +class InvoicesDetailInfo { + InvoicesDetailInfo({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String phone, + dynamic receivingPhone, + String mid, + List orderIds, + String money, + String type, + String headerId, + String state, + String reviewerTime, + String reviewerBy, + String ossUrl, + String reason, + num isDelete, + String invoiceHeaderName, + String invoiceHeaderCode, + List orderList, + String headertype, + String companyAddr, + String companyPhone, + String bank, + String bankNumber,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _phone = phone; + _receivingPhone = receivingPhone; + _mid = mid; + _orderIds = orderIds; + _money = money; + _type = type; + _headerId = headerId; + _state = state; + _reviewerTime = reviewerTime; + _reviewerBy = reviewerBy; + _ossUrl = ossUrl; + _reason = reason; + _isDelete = isDelete; + _invoiceHeaderName = invoiceHeaderName; + _invoiceHeaderCode = invoiceHeaderCode; + _orderList = orderList; + _headertype = headertype; + _companyAddr = companyAddr; + _companyPhone = companyPhone; + _bank = bank; + _bankNumber = bankNumber; +} + + InvoicesDetailInfo.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _phone = json['phone']; + _receivingPhone = json['receivingPhone']; + _mid = json['mid']; + _orderIds = json['orderIds'] != null ? json['orderIds'].cast() : []; + _money = json['money']; + _type = json['type']; + _headerId = json['headerId']; + _state = json['state']; + _reviewerTime = json['reviewerTime']; + _reviewerBy = json['reviewerBy']; + _ossUrl = json['ossUrl']; + _reason = json['reason']; + _isDelete = json['isDelete']; + _invoiceHeaderName = json['invoiceHeaderName']; + _invoiceHeaderCode = json['invoiceHeaderCode']; + if (json['orderList'] != null) { + _orderList = []; + json['orderList'].forEach((v) { + _orderList.add(OrderList.fromJson(v)); + }); + } + _headertype = json['headertype']; + _companyAddr = json['companyAddr']; + _companyPhone = json['companyPhone']; + _bank = json['bank']; + _bankNumber = json['bankNumber']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _phone; + dynamic _receivingPhone; + String _mid; + List _orderIds; + String _money; + String _type; + String _headerId; + String _state; + String _reviewerTime; + String _reviewerBy; + String _ossUrl; + String _reason; + num _isDelete; + String _invoiceHeaderName; + String _invoiceHeaderCode; + List _orderList; + String _headertype; + String _companyAddr; + String _companyPhone; + String _bank; + String _bankNumber; +InvoicesDetailInfo copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String phone, + dynamic receivingPhone, + String mid, + List orderIds, + String money, + String type, + String headerId, + String state, + String reviewerTime, + String reviewerBy, + String ossUrl, + String reason, + num isDelete, + String invoiceHeaderName, + String invoiceHeaderCode, + List orderList, + String headertype, + String companyAddr, + String companyPhone, + String bank, + String bankNumber, +}) => InvoicesDetailInfo( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + phone: phone ?? _phone, + receivingPhone: receivingPhone ?? _receivingPhone, + mid: mid ?? _mid, + orderIds: orderIds ?? _orderIds, + money: money ?? _money, + type: type ?? _type, + headerId: headerId ?? _headerId, + state: state ?? _state, + reviewerTime: reviewerTime ?? _reviewerTime, + reviewerBy: reviewerBy ?? _reviewerBy, + ossUrl: ossUrl ?? _ossUrl, + reason: reason ?? _reason, + isDelete: isDelete ?? _isDelete, + invoiceHeaderName: invoiceHeaderName ?? _invoiceHeaderName, + invoiceHeaderCode: invoiceHeaderCode ?? _invoiceHeaderCode, + orderList: orderList ?? _orderList, + headertype: headertype ?? _headertype, + companyAddr: companyAddr ?? _companyAddr, + companyPhone: companyPhone ?? _companyPhone, + bank: bank ?? _bank, + bankNumber: bankNumber ?? _bankNumber, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get phone => _phone; + dynamic get receivingPhone => _receivingPhone; + String get mid => _mid; + List get orderIds => _orderIds; + String get money => _money; + String get type => _type; + String get headerId => _headerId; + String get state => _state; + String get reviewerTime => _reviewerTime; + String get reviewerBy => _reviewerBy; + String get ossUrl => _ossUrl; + String get reason => _reason; + num get isDelete => _isDelete; + String get invoiceHeaderName => _invoiceHeaderName; + String get invoiceHeaderCode => _invoiceHeaderCode; + List get orderList => _orderList; + String get headertype => _headertype; + String get companyAddr => _companyAddr; + String get companyPhone => _companyPhone; + String get bank => _bank; + String get bankNumber => _bankNumber; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['phone'] = _phone; + map['receivingPhone'] = _receivingPhone; + map['mid'] = _mid; + map['orderIds'] = _orderIds; + map['money'] = _money; + map['type'] = _type; + map['headerId'] = _headerId; + map['state'] = _state; + map['reviewerTime'] = _reviewerTime; + map['reviewerBy'] = _reviewerBy; + map['ossUrl'] = _ossUrl; + map['reason'] = _reason; + map['isDelete'] = _isDelete; + map['invoiceHeaderName'] = _invoiceHeaderName; + map['invoiceHeaderCode'] = _invoiceHeaderCode; + if (_orderList != null) { + map['orderList'] = _orderList.map((v) => v.toJson()).toList(); + } + map['headertype'] = _headertype; + map['companyAddr'] = _companyAddr; + map['companyPhone'] = _companyPhone; + map['bank'] = _bank; + map['bankNumber'] = _bankNumber; + return map; + } + +} + +/// id : "1797582782189273088" +/// createTime : "2024-06-03 18:55:07" +/// createUser : "1623178240350748672" +/// updateTime : "2024-06-03 18:55:07" +/// updateUser : "1623178240350748672" +/// tenantCode : "1187" +/// storeId : "1509811680584925184" +/// storeName : "桑葚认养2022" +/// tableId : "0" +/// responsible : null +/// orderType : 0 +/// clearTable : false +/// mid : "1623178240350748672" +/// parentId : "0" +/// parentCode : null +/// orderCode : "202406031855070001" +/// dayFlowCode : "518" +/// orderStatus : 4 +/// sendStatus : 0 +/// payStatus : 1 +/// haveTimes : false +/// invoicing : true +/// memberAccount : "AA_oODK34oXp-4O8zQhg4OzFbEIL9Yo" +/// owner : "1610225796515889152" +/// logisticsId : "0" +/// shipperCode : "" +/// logisticsName : "" +/// logisticsNum : "" +/// logisticsCase : null +/// refundStatus : 0 +/// addressExt : {"addressId":"1777546429707845632","country":null,"countryId":null,"province":"湖北省","provinceId":null,"city":"武汉市","cityId":null,"district":"江岸区","districtId":null,"cityInfo":"江岸区会议中心","address":"中海中心","recName":"","recMobile":"17612711844","longitude":"114.3096","latitude":"30.59982"} +/// contactsExtList : [{"name":"兰东","mobile":"17612711844","idcard":""}] +/// postFee : "0.00" +/// totalPackagingFee : "0.00" +/// couponSubPrice : "0.00" +/// removeDecimal : "0.00" +/// isSubscribe : false +/// subcribeTime : null +/// sendTime : null +/// confirmTime : null +/// returnMoneyTime : null +/// notes : "" +/// prepayId : "WxPayMpOrderResult(appId=wx4ffd76994dc95086, timeStamp=1717412111, nonceStr=p82DnfDFYGFJzPi5, packageValue=prepay_id=wx031855122394490fad3a1b3b449dd20000, signType=MD5, paySign=35926ED291B7426675A6B6E35C890095)" +/// payTime : "2024-06-03 18:55:30" +/// payChannel : 1 +/// payNum : "" +/// promotionId : "0" +/// actId : "0" +/// couponId : "0" +/// isDelete : 0 +/// isTakeOut : 0 +/// batch : 1 +/// orderDiscountPrice : "0.00" +/// dishesDiscountPrice : "0.00" +/// orderPercentPrice : "0.00" +/// activityNoPrice : "0.00" +/// activityDiscountPrice : "0.00" +/// uniqueDiscountType : "AUTO" +/// totalDiscountPrice : null +/// vipDayDiscountPrice : "0.00" +/// orderSource : 1 +/// benefitDiscountAmount : "0.00" +/// vipDiscountPrice : "0.00" +/// orderMerge : null +/// canSettlement : true +/// endRefundTime : null +/// orderProductList : [{"id":"1797582782721949696","createTime":"2024-06-03 18:55:08","createUser":"1623178240350748672","updateTime":"2024-06-03 18:55:08","updateUser":"1623178240350748672","tenantCode":"1187","storeId":"1509811680584925184","orderId":"1797582782189273088","actInfo":null,"productId":"1777275921871405056","times":null,"usedTimes":null,"productName":"牡丹花认养测试","skuId":"1777291794300534784","skuNameStr":"","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"200.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":1,"ticketType":"ADOPT_WARRANT","ticketDays":"365","takeType":null,"skuTickets":["牡丹花挂牌*1","有机牡丹籽油250ml*1"],"ticketStyle":"{\"mainImage\":\"https://pos.upload.lotus-wallet.com/1185/2022/03/9ac1a67d-b9cd-4430-80c2-4f33670939cd.png\",\"identityImage\":\"https://pos.upload.lotus-wallet.com/1185/2022/03/9ac1a67d-b9cd-4430-80c2-4f33670939cd.png\",\"identityName\":\"认养花卉\",\"signature\":\"牡丹认养\"}","setMealDataList":null,"packagingFee":"0.00"}] +/// businessType : null +/// paySum : "0.01" +/// useInvoice : null +/// payedPrice : "0.01" +/// finalPayPrice : null +/// isEnableSubscribePay : null +/// invoiceId : null +/// invoiceState : null +/// posType : null + +class OrderList { + OrderList({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + String storeId, + String storeName, + String tableId, + dynamic responsible, + num orderType, + bool clearTable, + String mid, + String parentId, + dynamic parentCode, + String orderCode, + String dayFlowCode, + num orderStatus, + num sendStatus, + num payStatus, + bool haveTimes, + bool invoicing, + String memberAccount, + String owner, + String logisticsId, + String shipperCode, + String logisticsName, + String logisticsNum, + dynamic logisticsCase, + num refundStatus, + AddressExt addressExt, + List contactsExtList, + String postFee, + String totalPackagingFee, + String couponSubPrice, + String removeDecimal, + bool isSubscribe, + dynamic subcribeTime, + dynamic sendTime, + dynamic confirmTime, + dynamic returnMoneyTime, + String notes, + String prepayId, + String payTime, + num payChannel, + String payNum, + String promotionId, + String actId, + String couponId, + num isDelete, + num isTakeOut, + num batch, + String orderDiscountPrice, + String dishesDiscountPrice, + String orderPercentPrice, + String activityNoPrice, + String activityDiscountPrice, + String uniqueDiscountType, + dynamic totalDiscountPrice, + String vipDayDiscountPrice, + num orderSource, + String benefitDiscountAmount, + String vipDiscountPrice, + dynamic orderMerge, + bool canSettlement, + dynamic endRefundTime, + List orderProductList, + dynamic businessType, + String paySum, + dynamic useInvoice, + String payedPrice, + dynamic finalPayPrice, + dynamic isEnableSubscribePay, + dynamic invoiceId, + dynamic invoiceState, + dynamic posType,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _tenantCode = tenantCode; + _storeId = storeId; + _storeName = storeName; + _tableId = tableId; + _responsible = responsible; + _orderType = orderType; + _clearTable = clearTable; + _mid = mid; + _parentId = parentId; + _parentCode = parentCode; + _orderCode = orderCode; + _dayFlowCode = dayFlowCode; + _orderStatus = orderStatus; + _sendStatus = sendStatus; + _payStatus = payStatus; + _haveTimes = haveTimes; + _invoicing = invoicing; + _memberAccount = memberAccount; + _owner = owner; + _logisticsId = logisticsId; + _shipperCode = shipperCode; + _logisticsName = logisticsName; + _logisticsNum = logisticsNum; + _logisticsCase = logisticsCase; + _refundStatus = refundStatus; + _addressExt = addressExt; + _contactsExtList = contactsExtList; + _postFee = postFee; + _totalPackagingFee = totalPackagingFee; + _couponSubPrice = couponSubPrice; + _removeDecimal = removeDecimal; + _isSubscribe = isSubscribe; + _subcribeTime = subcribeTime; + _sendTime = sendTime; + _confirmTime = confirmTime; + _returnMoneyTime = returnMoneyTime; + _notes = notes; + _prepayId = prepayId; + _payTime = payTime; + _payChannel = payChannel; + _payNum = payNum; + _promotionId = promotionId; + _actId = actId; + _couponId = couponId; + _isDelete = isDelete; + _isTakeOut = isTakeOut; + _batch = batch; + _orderDiscountPrice = orderDiscountPrice; + _dishesDiscountPrice = dishesDiscountPrice; + _orderPercentPrice = orderPercentPrice; + _activityNoPrice = activityNoPrice; + _activityDiscountPrice = activityDiscountPrice; + _uniqueDiscountType = uniqueDiscountType; + _totalDiscountPrice = totalDiscountPrice; + _vipDayDiscountPrice = vipDayDiscountPrice; + _orderSource = orderSource; + _benefitDiscountAmount = benefitDiscountAmount; + _vipDiscountPrice = vipDiscountPrice; + _orderMerge = orderMerge; + _canSettlement = canSettlement; + _endRefundTime = endRefundTime; + _orderProductList = orderProductList; + _businessType = businessType; + _paySum = paySum; + _useInvoice = useInvoice; + _payedPrice = payedPrice; + _finalPayPrice = finalPayPrice; + _isEnableSubscribePay = isEnableSubscribePay; + _invoiceId = invoiceId; + _invoiceState = invoiceState; + _posType = posType; +} + + OrderList.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _tenantCode = json['tenantCode']; + _storeId = json['storeId']; + _storeName = json['storeName']; + _tableId = json['tableId']; + _responsible = json['responsible']; + _orderType = json['orderType']; + _clearTable = json['clearTable']; + _mid = json['mid']; + _parentId = json['parentId']; + _parentCode = json['parentCode']; + _orderCode = json['orderCode']; + _dayFlowCode = json['dayFlowCode']; + _orderStatus = json['orderStatus']; + _sendStatus = json['sendStatus']; + _payStatus = json['payStatus']; + _haveTimes = json['haveTimes']; + _invoicing = json['invoicing']; + _memberAccount = json['memberAccount']; + _owner = json['owner']; + _logisticsId = json['logisticsId']; + _shipperCode = json['shipperCode']; + _logisticsName = json['logisticsName']; + _logisticsNum = json['logisticsNum']; + _logisticsCase = json['logisticsCase']; + _refundStatus = json['refundStatus']; + _addressExt = json['addressExt'] != null ? AddressExt.fromJson(json['addressExt']) : null; + if (json['contactsExtList'] != null) { + _contactsExtList = []; + json['contactsExtList'].forEach((v) { + _contactsExtList.add(ContactsExtList.fromJson(v)); + }); + } + _postFee = json['postFee']; + _totalPackagingFee = json['totalPackagingFee']; + _couponSubPrice = json['couponSubPrice']; + _removeDecimal = json['removeDecimal']; + _isSubscribe = json['isSubscribe']; + _subcribeTime = json['subcribeTime']; + _sendTime = json['sendTime']; + _confirmTime = json['confirmTime']; + _returnMoneyTime = json['returnMoneyTime']; + _notes = json['notes']; + _prepayId = json['prepayId']; + _payTime = json['payTime']; + _payChannel = json['payChannel']; + _payNum = json['payNum']; + _promotionId = json['promotionId']; + _actId = json['actId']; + _couponId = json['couponId']; + _isDelete = json['isDelete']; + _isTakeOut = json['isTakeOut']; + _batch = json['batch']; + _orderDiscountPrice = json['orderDiscountPrice']; + _dishesDiscountPrice = json['dishesDiscountPrice']; + _orderPercentPrice = json['orderPercentPrice']; + _activityNoPrice = json['activityNoPrice']; + _activityDiscountPrice = json['activityDiscountPrice']; + _uniqueDiscountType = json['uniqueDiscountType']; + _totalDiscountPrice = json['totalDiscountPrice']; + _vipDayDiscountPrice = json['vipDayDiscountPrice']; + _orderSource = json['orderSource']; + _benefitDiscountAmount = json['benefitDiscountAmount']; + _vipDiscountPrice = json['vipDiscountPrice']; + _orderMerge = json['orderMerge']; + _canSettlement = json['canSettlement']; + _endRefundTime = json['endRefundTime']; + if (json['orderProductList'] != null) { + _orderProductList = []; + json['orderProductList'].forEach((v) { + _orderProductList.add(OrderProductList.fromJson(v)); + }); + } + _businessType = json['businessType']; + _paySum = json['paySum']; + _useInvoice = json['useInvoice']; + _payedPrice = json['payedPrice']; + _finalPayPrice = json['finalPayPrice']; + _isEnableSubscribePay = json['isEnableSubscribePay']; + _invoiceId = json['invoiceId']; + _invoiceState = json['invoiceState']; + _posType = json['posType']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _tenantCode; + String _storeId; + String _storeName; + String _tableId; + dynamic _responsible; + num _orderType; + bool _clearTable; + String _mid; + String _parentId; + dynamic _parentCode; + String _orderCode; + String _dayFlowCode; + num _orderStatus; + num _sendStatus; + num _payStatus; + bool _haveTimes; + bool _invoicing; + String _memberAccount; + String _owner; + String _logisticsId; + String _shipperCode; + String _logisticsName; + String _logisticsNum; + dynamic _logisticsCase; + num _refundStatus; + AddressExt _addressExt; + List _contactsExtList; + String _postFee; + String _totalPackagingFee; + String _couponSubPrice; + String _removeDecimal; + bool _isSubscribe; + dynamic _subcribeTime; + dynamic _sendTime; + dynamic _confirmTime; + dynamic _returnMoneyTime; + String _notes; + String _prepayId; + String _payTime; + num _payChannel; + String _payNum; + String _promotionId; + String _actId; + String _couponId; + num _isDelete; + num _isTakeOut; + num _batch; + String _orderDiscountPrice; + String _dishesDiscountPrice; + String _orderPercentPrice; + String _activityNoPrice; + String _activityDiscountPrice; + String _uniqueDiscountType; + dynamic _totalDiscountPrice; + String _vipDayDiscountPrice; + num _orderSource; + String _benefitDiscountAmount; + String _vipDiscountPrice; + dynamic _orderMerge; + bool _canSettlement; + dynamic _endRefundTime; + List _orderProductList; + dynamic _businessType; + String _paySum; + dynamic _useInvoice; + String _payedPrice; + dynamic _finalPayPrice; + dynamic _isEnableSubscribePay; + dynamic _invoiceId; + dynamic _invoiceState; + dynamic _posType; +OrderList copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + String storeId, + String storeName, + String tableId, + dynamic responsible, + num orderType, + bool clearTable, + String mid, + String parentId, + dynamic parentCode, + String orderCode, + String dayFlowCode, + num orderStatus, + num sendStatus, + num payStatus, + bool haveTimes, + bool invoicing, + String memberAccount, + String owner, + String logisticsId, + String shipperCode, + String logisticsName, + String logisticsNum, + dynamic logisticsCase, + num refundStatus, + AddressExt addressExt, + List contactsExtList, + String postFee, + String totalPackagingFee, + String couponSubPrice, + String removeDecimal, + bool isSubscribe, + dynamic subcribeTime, + dynamic sendTime, + dynamic confirmTime, + dynamic returnMoneyTime, + String notes, + String prepayId, + String payTime, + num payChannel, + String payNum, + String promotionId, + String actId, + String couponId, + num isDelete, + num isTakeOut, + num batch, + String orderDiscountPrice, + String dishesDiscountPrice, + String orderPercentPrice, + String activityNoPrice, + String activityDiscountPrice, + String uniqueDiscountType, + dynamic totalDiscountPrice, + String vipDayDiscountPrice, + num orderSource, + String benefitDiscountAmount, + String vipDiscountPrice, + dynamic orderMerge, + bool canSettlement, + dynamic endRefundTime, + List orderProductList, + dynamic businessType, + String paySum, + dynamic useInvoice, + String payedPrice, + dynamic finalPayPrice, + dynamic isEnableSubscribePay, + dynamic invoiceId, + dynamic invoiceState, + dynamic posType, +}) => OrderList( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + tenantCode: tenantCode ?? _tenantCode, + storeId: storeId ?? _storeId, + storeName: storeName ?? _storeName, + tableId: tableId ?? _tableId, + responsible: responsible ?? _responsible, + orderType: orderType ?? _orderType, + clearTable: clearTable ?? _clearTable, + mid: mid ?? _mid, + parentId: parentId ?? _parentId, + parentCode: parentCode ?? _parentCode, + orderCode: orderCode ?? _orderCode, + dayFlowCode: dayFlowCode ?? _dayFlowCode, + orderStatus: orderStatus ?? _orderStatus, + sendStatus: sendStatus ?? _sendStatus, + payStatus: payStatus ?? _payStatus, + haveTimes: haveTimes ?? _haveTimes, + invoicing: invoicing ?? _invoicing, + memberAccount: memberAccount ?? _memberAccount, + owner: owner ?? _owner, + logisticsId: logisticsId ?? _logisticsId, + shipperCode: shipperCode ?? _shipperCode, + logisticsName: logisticsName ?? _logisticsName, + logisticsNum: logisticsNum ?? _logisticsNum, + logisticsCase: logisticsCase ?? _logisticsCase, + refundStatus: refundStatus ?? _refundStatus, + addressExt: addressExt ?? _addressExt, + contactsExtList: contactsExtList ?? _contactsExtList, + postFee: postFee ?? _postFee, + totalPackagingFee: totalPackagingFee ?? _totalPackagingFee, + couponSubPrice: couponSubPrice ?? _couponSubPrice, + removeDecimal: removeDecimal ?? _removeDecimal, + isSubscribe: isSubscribe ?? _isSubscribe, + subcribeTime: subcribeTime ?? _subcribeTime, + sendTime: sendTime ?? _sendTime, + confirmTime: confirmTime ?? _confirmTime, + returnMoneyTime: returnMoneyTime ?? _returnMoneyTime, + notes: notes ?? _notes, + prepayId: prepayId ?? _prepayId, + payTime: payTime ?? _payTime, + payChannel: payChannel ?? _payChannel, + payNum: payNum ?? _payNum, + promotionId: promotionId ?? _promotionId, + actId: actId ?? _actId, + couponId: couponId ?? _couponId, + isDelete: isDelete ?? _isDelete, + isTakeOut: isTakeOut ?? _isTakeOut, + batch: batch ?? _batch, + orderDiscountPrice: orderDiscountPrice ?? _orderDiscountPrice, + dishesDiscountPrice: dishesDiscountPrice ?? _dishesDiscountPrice, + orderPercentPrice: orderPercentPrice ?? _orderPercentPrice, + activityNoPrice: activityNoPrice ?? _activityNoPrice, + activityDiscountPrice: activityDiscountPrice ?? _activityDiscountPrice, + uniqueDiscountType: uniqueDiscountType ?? _uniqueDiscountType, + totalDiscountPrice: totalDiscountPrice ?? _totalDiscountPrice, + vipDayDiscountPrice: vipDayDiscountPrice ?? _vipDayDiscountPrice, + orderSource: orderSource ?? _orderSource, + benefitDiscountAmount: benefitDiscountAmount ?? _benefitDiscountAmount, + vipDiscountPrice: vipDiscountPrice ?? _vipDiscountPrice, + orderMerge: orderMerge ?? _orderMerge, + canSettlement: canSettlement ?? _canSettlement, + endRefundTime: endRefundTime ?? _endRefundTime, + orderProductList: orderProductList ?? _orderProductList, + businessType: businessType ?? _businessType, + paySum: paySum ?? _paySum, + useInvoice: useInvoice ?? _useInvoice, + payedPrice: payedPrice ?? _payedPrice, + finalPayPrice: finalPayPrice ?? _finalPayPrice, + isEnableSubscribePay: isEnableSubscribePay ?? _isEnableSubscribePay, + invoiceId: invoiceId ?? _invoiceId, + invoiceState: invoiceState ?? _invoiceState, + posType: posType ?? _posType, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get tenantCode => _tenantCode; + String get storeId => _storeId; + String get storeName => _storeName; + String get tableId => _tableId; + dynamic get responsible => _responsible; + num get orderType => _orderType; + bool get clearTable => _clearTable; + String get mid => _mid; + String get parentId => _parentId; + dynamic get parentCode => _parentCode; + String get orderCode => _orderCode; + String get dayFlowCode => _dayFlowCode; + num get orderStatus => _orderStatus; + num get sendStatus => _sendStatus; + num get payStatus => _payStatus; + bool get haveTimes => _haveTimes; + bool get invoicing => _invoicing; + String get memberAccount => _memberAccount; + String get owner => _owner; + String get logisticsId => _logisticsId; + String get shipperCode => _shipperCode; + String get logisticsName => _logisticsName; + String get logisticsNum => _logisticsNum; + dynamic get logisticsCase => _logisticsCase; + num get refundStatus => _refundStatus; + AddressExt get addressExt => _addressExt; + List get contactsExtList => _contactsExtList; + String get postFee => _postFee; + String get totalPackagingFee => _totalPackagingFee; + String get couponSubPrice => _couponSubPrice; + String get removeDecimal => _removeDecimal; + bool get isSubscribe => _isSubscribe; + dynamic get subcribeTime => _subcribeTime; + dynamic get sendTime => _sendTime; + dynamic get confirmTime => _confirmTime; + dynamic get returnMoneyTime => _returnMoneyTime; + String get notes => _notes; + String get prepayId => _prepayId; + String get payTime => _payTime; + num get payChannel => _payChannel; + String get payNum => _payNum; + String get promotionId => _promotionId; + String get actId => _actId; + String get couponId => _couponId; + num get isDelete => _isDelete; + num get isTakeOut => _isTakeOut; + num get batch => _batch; + String get orderDiscountPrice => _orderDiscountPrice; + String get dishesDiscountPrice => _dishesDiscountPrice; + String get orderPercentPrice => _orderPercentPrice; + String get activityNoPrice => _activityNoPrice; + String get activityDiscountPrice => _activityDiscountPrice; + String get uniqueDiscountType => _uniqueDiscountType; + dynamic get totalDiscountPrice => _totalDiscountPrice; + String get vipDayDiscountPrice => _vipDayDiscountPrice; + num get orderSource => _orderSource; + String get benefitDiscountAmount => _benefitDiscountAmount; + String get vipDiscountPrice => _vipDiscountPrice; + dynamic get orderMerge => _orderMerge; + bool get canSettlement => _canSettlement; + dynamic get endRefundTime => _endRefundTime; + List get orderProductList => _orderProductList; + dynamic get businessType => _businessType; + String get paySum => _paySum; + dynamic get useInvoice => _useInvoice; + String get payedPrice => _payedPrice; + dynamic get finalPayPrice => _finalPayPrice; + dynamic get isEnableSubscribePay => _isEnableSubscribePay; + dynamic get invoiceId => _invoiceId; + dynamic get invoiceState => _invoiceState; + dynamic get posType => _posType; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['tenantCode'] = _tenantCode; + map['storeId'] = _storeId; + map['storeName'] = _storeName; + map['tableId'] = _tableId; + map['responsible'] = _responsible; + map['orderType'] = _orderType; + map['clearTable'] = _clearTable; + map['mid'] = _mid; + map['parentId'] = _parentId; + map['parentCode'] = _parentCode; + map['orderCode'] = _orderCode; + map['dayFlowCode'] = _dayFlowCode; + map['orderStatus'] = _orderStatus; + map['sendStatus'] = _sendStatus; + map['payStatus'] = _payStatus; + map['haveTimes'] = _haveTimes; + map['invoicing'] = _invoicing; + map['memberAccount'] = _memberAccount; + map['owner'] = _owner; + map['logisticsId'] = _logisticsId; + map['shipperCode'] = _shipperCode; + map['logisticsName'] = _logisticsName; + map['logisticsNum'] = _logisticsNum; + map['logisticsCase'] = _logisticsCase; + map['refundStatus'] = _refundStatus; + if (_addressExt != null) { + map['addressExt'] = _addressExt.toJson(); + } + if (_contactsExtList != null) { + map['contactsExtList'] = _contactsExtList.map((v) => v.toJson()).toList(); + } + map['postFee'] = _postFee; + map['totalPackagingFee'] = _totalPackagingFee; + map['couponSubPrice'] = _couponSubPrice; + map['removeDecimal'] = _removeDecimal; + map['isSubscribe'] = _isSubscribe; + map['subcribeTime'] = _subcribeTime; + map['sendTime'] = _sendTime; + map['confirmTime'] = _confirmTime; + map['returnMoneyTime'] = _returnMoneyTime; + map['notes'] = _notes; + map['prepayId'] = _prepayId; + map['payTime'] = _payTime; + map['payChannel'] = _payChannel; + map['payNum'] = _payNum; + map['promotionId'] = _promotionId; + map['actId'] = _actId; + map['couponId'] = _couponId; + map['isDelete'] = _isDelete; + map['isTakeOut'] = _isTakeOut; + map['batch'] = _batch; + map['orderDiscountPrice'] = _orderDiscountPrice; + map['dishesDiscountPrice'] = _dishesDiscountPrice; + map['orderPercentPrice'] = _orderPercentPrice; + map['activityNoPrice'] = _activityNoPrice; + map['activityDiscountPrice'] = _activityDiscountPrice; + map['uniqueDiscountType'] = _uniqueDiscountType; + map['totalDiscountPrice'] = _totalDiscountPrice; + map['vipDayDiscountPrice'] = _vipDayDiscountPrice; + map['orderSource'] = _orderSource; + map['benefitDiscountAmount'] = _benefitDiscountAmount; + map['vipDiscountPrice'] = _vipDiscountPrice; + map['orderMerge'] = _orderMerge; + map['canSettlement'] = _canSettlement; + map['endRefundTime'] = _endRefundTime; + if (_orderProductList != null) { + map['orderProductList'] = _orderProductList.map((v) => v.toJson()).toList(); + } + map['businessType'] = _businessType; + map['paySum'] = _paySum; + map['useInvoice'] = _useInvoice; + map['payedPrice'] = _payedPrice; + map['finalPayPrice'] = _finalPayPrice; + map['isEnableSubscribePay'] = _isEnableSubscribePay; + map['invoiceId'] = _invoiceId; + map['invoiceState'] = _invoiceState; + map['posType'] = _posType; + return map; + } + +} + +/// id : "1797582782721949696" +/// createTime : "2024-06-03 18:55:08" +/// createUser : "1623178240350748672" +/// updateTime : "2024-06-03 18:55:08" +/// updateUser : "1623178240350748672" +/// tenantCode : "1187" +/// storeId : "1509811680584925184" +/// orderId : "1797582782189273088" +/// actInfo : null +/// productId : "1777275921871405056" +/// times : null +/// usedTimes : null +/// productName : "牡丹花认养测试" +/// skuId : "1777291794300534784" +/// skuNameStr : "" +/// skuImg : "" +/// buyNum : 1 +/// refundNum : 0 +/// type : 0 +/// reason : null +/// weight : 0.0 +/// applyPrice : "200.00" +/// sellPrice : "0.01" +/// postPay : "0.00" +/// isDelete : 0 +/// discountAmount : "0.00" +/// discountPercent : 100 +/// status : true +/// batch : 1 +/// deliveries : 1 +/// ticketType : "ADOPT_WARRANT" +/// ticketDays : "365" +/// takeType : null +/// skuTickets : ["牡丹花挂牌*1","有机牡丹籽油250ml*1"] +/// ticketStyle : "{\"mainImage\":\"https://pos.upload.lotus-wallet.com/1185/2022/03/9ac1a67d-b9cd-4430-80c2-4f33670939cd.png\",\"identityImage\":\"https://pos.upload.lotus-wallet.com/1185/2022/03/9ac1a67d-b9cd-4430-80c2-4f33670939cd.png\",\"identityName\":\"认养花卉\",\"signature\":\"牡丹认养\"}" +/// setMealDataList : null +/// packagingFee : "0.00" + +class OrderProductList { + OrderProductList({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + String storeId, + String orderId, + dynamic actInfo, + String productId, + dynamic times, + dynamic usedTimes, + String productName, + String skuId, + String skuNameStr, + String skuImg, + num buyNum, + num refundNum, + num type, + dynamic reason, + num weight, + String applyPrice, + String sellPrice, + String postPay, + num isDelete, + String discountAmount, + num discountPercent, + bool status, + num batch, + num deliveries, + String ticketType, + String ticketDays, + dynamic takeType, + List skuTickets, + String ticketStyle, + dynamic setMealDataList, + String packagingFee,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _tenantCode = tenantCode; + _storeId = storeId; + _orderId = orderId; + _actInfo = actInfo; + _productId = productId; + _times = times; + _usedTimes = usedTimes; + _productName = productName; + _skuId = skuId; + _skuNameStr = skuNameStr; + _skuImg = skuImg; + _buyNum = buyNum; + _refundNum = refundNum; + _type = type; + _reason = reason; + _weight = weight; + _applyPrice = applyPrice; + _sellPrice = sellPrice; + _postPay = postPay; + _isDelete = isDelete; + _discountAmount = discountAmount; + _discountPercent = discountPercent; + _status = status; + _batch = batch; + _deliveries = deliveries; + _ticketType = ticketType; + _ticketDays = ticketDays; + _takeType = takeType; + _skuTickets = skuTickets; + _ticketStyle = ticketStyle; + _setMealDataList = setMealDataList; + _packagingFee = packagingFee; +} + + OrderProductList.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _tenantCode = json['tenantCode']; + _storeId = json['storeId']; + _orderId = json['orderId']; + _actInfo = json['actInfo']; + _productId = json['productId']; + _times = json['times']; + _usedTimes = json['usedTimes']; + _productName = json['productName']; + _skuId = json['skuId']; + _skuNameStr = json['skuNameStr']; + _skuImg = json['skuImg']; + _buyNum = json['buyNum']; + _refundNum = json['refundNum']; + _type = json['type']; + _reason = json['reason']; + _weight = json['weight']; + _applyPrice = json['applyPrice']; + _sellPrice = json['sellPrice']; + _postPay = json['postPay']; + _isDelete = json['isDelete']; + _discountAmount = json['discountAmount']; + _discountPercent = json['discountPercent']; + _status = json['status']; + _batch = json['batch']; + _deliveries = json['deliveries']; + _ticketType = json['ticketType']; + _ticketDays = json['ticketDays']; + _takeType = json['takeType']; + _skuTickets = json['skuTickets'] != null ? json['skuTickets'].cast() : []; + _ticketStyle = json['ticketStyle']; + _setMealDataList = json['setMealDataList']; + _packagingFee = json['packagingFee']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _tenantCode; + String _storeId; + String _orderId; + dynamic _actInfo; + String _productId; + dynamic _times; + dynamic _usedTimes; + String _productName; + String _skuId; + String _skuNameStr; + String _skuImg; + num _buyNum; + num _refundNum; + num _type; + dynamic _reason; + num _weight; + String _applyPrice; + String _sellPrice; + String _postPay; + num _isDelete; + String _discountAmount; + num _discountPercent; + bool _status; + num _batch; + num _deliveries; + String _ticketType; + String _ticketDays; + dynamic _takeType; + List _skuTickets; + String _ticketStyle; + dynamic _setMealDataList; + String _packagingFee; +OrderProductList copyWith({ String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String tenantCode, + String storeId, + String orderId, + dynamic actInfo, + String productId, + dynamic times, + dynamic usedTimes, + String productName, + String skuId, + String skuNameStr, + String skuImg, + num buyNum, + num refundNum, + num type, + dynamic reason, + num weight, + String applyPrice, + String sellPrice, + String postPay, + num isDelete, + String discountAmount, + num discountPercent, + bool status, + num batch, + num deliveries, + String ticketType, + String ticketDays, + dynamic takeType, + List skuTickets, + String ticketStyle, + dynamic setMealDataList, + String packagingFee, +}) => OrderProductList( id: id ?? _id, + createTime: createTime ?? _createTime, + createUser: createUser ?? _createUser, + updateTime: updateTime ?? _updateTime, + updateUser: updateUser ?? _updateUser, + tenantCode: tenantCode ?? _tenantCode, + storeId: storeId ?? _storeId, + orderId: orderId ?? _orderId, + actInfo: actInfo ?? _actInfo, + productId: productId ?? _productId, + times: times ?? _times, + usedTimes: usedTimes ?? _usedTimes, + productName: productName ?? _productName, + skuId: skuId ?? _skuId, + skuNameStr: skuNameStr ?? _skuNameStr, + skuImg: skuImg ?? _skuImg, + buyNum: buyNum ?? _buyNum, + refundNum: refundNum ?? _refundNum, + type: type ?? _type, + reason: reason ?? _reason, + weight: weight ?? _weight, + applyPrice: applyPrice ?? _applyPrice, + sellPrice: sellPrice ?? _sellPrice, + postPay: postPay ?? _postPay, + isDelete: isDelete ?? _isDelete, + discountAmount: discountAmount ?? _discountAmount, + discountPercent: discountPercent ?? _discountPercent, + status: status ?? _status, + batch: batch ?? _batch, + deliveries: deliveries ?? _deliveries, + ticketType: ticketType ?? _ticketType, + ticketDays: ticketDays ?? _ticketDays, + takeType: takeType ?? _takeType, + skuTickets: skuTickets ?? _skuTickets, + ticketStyle: ticketStyle ?? _ticketStyle, + setMealDataList: setMealDataList ?? _setMealDataList, + packagingFee: packagingFee ?? _packagingFee, +); + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get tenantCode => _tenantCode; + String get storeId => _storeId; + String get orderId => _orderId; + dynamic get actInfo => _actInfo; + String get productId => _productId; + dynamic get times => _times; + dynamic get usedTimes => _usedTimes; + String get productName => _productName; + String get skuId => _skuId; + String get skuNameStr => _skuNameStr; + String get skuImg => _skuImg; + num get buyNum => _buyNum; + num get refundNum => _refundNum; + num get type => _type; + dynamic get reason => _reason; + num get weight => _weight; + String get applyPrice => _applyPrice; + String get sellPrice => _sellPrice; + String get postPay => _postPay; + num get isDelete => _isDelete; + String get discountAmount => _discountAmount; + num get discountPercent => _discountPercent; + bool get status => _status; + num get batch => _batch; + num get deliveries => _deliveries; + String get ticketType => _ticketType; + String get ticketDays => _ticketDays; + dynamic get takeType => _takeType; + List get skuTickets => _skuTickets; + String get ticketStyle => _ticketStyle; + dynamic get setMealDataList => _setMealDataList; + String get packagingFee => _packagingFee; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['tenantCode'] = _tenantCode; + map['storeId'] = _storeId; + map['orderId'] = _orderId; + map['actInfo'] = _actInfo; + map['productId'] = _productId; + map['times'] = _times; + map['usedTimes'] = _usedTimes; + map['productName'] = _productName; + map['skuId'] = _skuId; + map['skuNameStr'] = _skuNameStr; + map['skuImg'] = _skuImg; + map['buyNum'] = _buyNum; + map['refundNum'] = _refundNum; + map['type'] = _type; + map['reason'] = _reason; + map['weight'] = _weight; + map['applyPrice'] = _applyPrice; + map['sellPrice'] = _sellPrice; + map['postPay'] = _postPay; + map['isDelete'] = _isDelete; + map['discountAmount'] = _discountAmount; + map['discountPercent'] = _discountPercent; + map['status'] = _status; + map['batch'] = _batch; + map['deliveries'] = _deliveries; + map['ticketType'] = _ticketType; + map['ticketDays'] = _ticketDays; + map['takeType'] = _takeType; + map['skuTickets'] = _skuTickets; + map['ticketStyle'] = _ticketStyle; + map['setMealDataList'] = _setMealDataList; + map['packagingFee'] = _packagingFee; + return map; + } + +} + +/// name : "兰东" +/// mobile : "17612711844" +/// idcard : "" + +class ContactsExtList { + ContactsExtList({ + String name, + String mobile, + String idcard,}){ + _name = name; + _mobile = mobile; + _idcard = idcard; +} + + ContactsExtList.fromJson(dynamic json) { + _name = json['name']; + _mobile = json['mobile']; + _idcard = json['idcard']; + } + String _name; + String _mobile; + String _idcard; +ContactsExtList copyWith({ String name, + String mobile, + String idcard, +}) => ContactsExtList( name: name ?? _name, + mobile: mobile ?? _mobile, + idcard: idcard ?? _idcard, +); + String get name => _name; + String get mobile => _mobile; + String get idcard => _idcard; + + Map toJson() { + final map = {}; + map['name'] = _name; + map['mobile'] = _mobile; + map['idcard'] = _idcard; + return map; + } + +} + +/// addressId : "1777546429707845632" +/// country : null +/// countryId : null +/// province : "湖北省" +/// provinceId : null +/// city : "武汉市" +/// cityId : null +/// district : "江岸区" +/// districtId : null +/// cityInfo : "江岸区会议中心" +/// address : "中海中心" +/// recName : "" +/// recMobile : "17612711844" +/// longitude : "114.3096" +/// latitude : "30.59982" + +class AddressExt { + AddressExt({ + String addressId, + dynamic country, + dynamic countryId, + String province, + dynamic provinceId, + String city, + dynamic cityId, + String district, + dynamic districtId, + String cityInfo, + String address, + String recName, + String recMobile, + String longitude, + String latitude,}){ + _addressId = addressId; + _country = country; + _countryId = countryId; + _province = province; + _provinceId = provinceId; + _city = city; + _cityId = cityId; + _district = district; + _districtId = districtId; + _cityInfo = cityInfo; + _address = address; + _recName = recName; + _recMobile = recMobile; + _longitude = longitude; + _latitude = latitude; +} + + AddressExt.fromJson(dynamic json) { + _addressId = json['addressId']; + _country = json['country']; + _countryId = json['countryId']; + _province = json['province']; + _provinceId = json['provinceId']; + _city = json['city']; + _cityId = json['cityId']; + _district = json['district']; + _districtId = json['districtId']; + _cityInfo = json['cityInfo']; + _address = json['address']; + _recName = json['recName']; + _recMobile = json['recMobile']; + _longitude = json['longitude']; + _latitude = json['latitude']; + } + String _addressId; + dynamic _country; + dynamic _countryId; + String _province; + dynamic _provinceId; + String _city; + dynamic _cityId; + String _district; + dynamic _districtId; + String _cityInfo; + String _address; + String _recName; + String _recMobile; + String _longitude; + String _latitude; +AddressExt copyWith({ String addressId, + dynamic country, + dynamic countryId, + String province, + dynamic provinceId, + String city, + dynamic cityId, + String district, + dynamic districtId, + String cityInfo, + String address, + String recName, + String recMobile, + String longitude, + String latitude, +}) => AddressExt( addressId: addressId ?? _addressId, + country: country ?? _country, + countryId: countryId ?? _countryId, + province: province ?? _province, + provinceId: provinceId ?? _provinceId, + city: city ?? _city, + cityId: cityId ?? _cityId, + district: district ?? _district, + districtId: districtId ?? _districtId, + cityInfo: cityInfo ?? _cityInfo, + address: address ?? _address, + recName: recName ?? _recName, + recMobile: recMobile ?? _recMobile, + longitude: longitude ?? _longitude, + latitude: latitude ?? _latitude, +); + String get addressId => _addressId; + dynamic get country => _country; + dynamic get countryId => _countryId; + String get province => _province; + dynamic get provinceId => _provinceId; + String get city => _city; + dynamic get cityId => _cityId; + String get district => _district; + dynamic get districtId => _districtId; + String get cityInfo => _cityInfo; + String get address => _address; + String get recName => _recName; + String get recMobile => _recMobile; + String get longitude => _longitude; + String get latitude => _latitude; + + Map toJson() { + final map = {}; + map['addressId'] = _addressId; + map['country'] = _country; + map['countryId'] = _countryId; + map['province'] = _province; + map['provinceId'] = _provinceId; + map['city'] = _city; + map['cityId'] = _cityId; + map['district'] = _district; + map['districtId'] = _districtId; + map['cityInfo'] = _cityInfo; + map['address'] = _address; + map['recName'] = _recName; + map['recMobile'] = _recMobile; + map['longitude'] = _longitude; + map['latitude'] = _latitude; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 6c6f2a94..89992773 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -41,6 +41,7 @@ import 'data/headlines_list_details.dart'; import 'data/home_rank.dart'; import 'data/invitation_list.dart'; import 'data/invoice_list.dart'; +import 'data/invoices_detail_info.dart'; import 'data/invoices_history_list.dart'; import 'data/ip_data.dart'; import 'data/logistics.dart'; @@ -641,4 +642,8 @@ abstract class ApiService { ///开票历史 @POST("invoice/page") Future> invoicePage(@Body() Map param); + + ///发票详情 + @GET("invoice/detail{id}") + Future> invoiceDetail(@Path("id") String id); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 73e9cdfb..1687b97c 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -2464,4 +2464,26 @@ class _ApiService implements ApiService { ); return value; } + + @override + Future> invoiceDetail(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'invoice/detail/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => InvoicesDetailInfo.fromJson(json), + ); + return value; + } } diff --git a/pubspec.lock b/pubspec.lock index 60df8c48..29986636 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -229,10 +229,10 @@ packages: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + sha256: "13a6ccf6a459a125b3fcdb6ec73bd5ff90822e071207c663bfd1f70062d51d18" url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.2" + version: "1.2.1" file: dependency: transitive description: @@ -315,6 +315,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.0.3" + flutter_pdfview: + dependency: "direct main" + description: + name: flutter_pdfview + sha256: a9055bf920c7095bf08c2781db431ba23577aa5da5a056a7152dc89a18fbec6f + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.2" flutter_screenutil: dependency: "direct main" description: @@ -481,10 +489,10 @@ packages: dependency: "direct main" description: name: image_gallery_saver - sha256: be812580c7a320d3bf583af89cac6b376f170d48000aca75215a73285a3223a0 + sha256: "0aba74216a4d9b0561510cb968015d56b701ba1bd94aace26aacdd8ae5761816" url: "https://pub.flutter-io.cn" source: hosted - version: "1.7.1" + version: "2.0.3" image_pickers: dependency: "direct main" description: @@ -689,10 +697,10 @@ packages: dependency: transitive description: name: path_provider_windows - sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6 + sha256: a34ecd7fb548f8e57321fd8e50d865d266941b54e6c3b7758cf8f37c24116905 url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.6" + version: "2.0.7" permission_handler: dependency: "direct main" description: @@ -1215,10 +1223,10 @@ packages: dependency: transitive description: name: wakelock_windows - sha256: "857f77b3fe6ae82dd045455baa626bc4b93cb9bb6c86bf3f27c182167c3a5567" + sha256: "108b1b73711f1664ee462e73af34a9286ff496e27d4d8371e2fb4da8fde4cdac" url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.1" + version: "0.2.0" webview_flutter: dependency: transitive description: @@ -1239,10 +1247,10 @@ packages: dependency: transitive description: name: win32 - sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4 + sha256: c0e3a4f7be7dae51d8f152230b86627e3397c1ba8c3fa58e63d44a9f3edc9cef url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.4" + version: "2.6.1" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 37ad775e..4cffcde9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,6 +17,8 @@ dependencies: tobias: 2.4.1 + #pdf展示 + flutter_pdfview: ^1.3.2 gradient_widgets: ^0.6.0 @@ -81,7 +83,7 @@ dependencies: path_provider: ^2.0.4 network_to_file_image: ^4.0.1 - image_gallery_saver: ^1.7.0 + image_gallery_saver: ^2.0.3 flutter_html: ^2.1.5 #2.1.0 chewie_audio: ^1.1.2