From 0ba6d29ec48e9630982699fca9ab30325938a736 Mon Sep 17 00:00:00 2001 From: fmk Date: Tue, 26 Oct 2021 18:49:38 +0800 Subject: [PATCH 1/3] safety --- README.md | 8 +- ios/Podfile.lock | 10 - ios/Runner.xcodeproj/project.pbxproj | 23 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- lib/community/community_child_page.dart | 1 + .../community_view/community_dynamic.dart | 34 +- lib/home/home_page.dart | 49 +- lib/home/home_view/coupon.dart | 27 +- lib/mine/mine_view/mine_view.dart | 6 +- lib/order/order_utils.dart | 11 +- lib/order/order_view/order_address.dart | 4 +- lib/order/write_off_page.dart | 2 +- lib/qr/qr_code_scan.dart | 160 +- lib/retrofit/data/base_data.g.dart | 37 - lib/retrofit/data/min_order_info.dart | 6 +- lib/retrofit/data/page.g.dart | 41 - lib/retrofit/data/placeOrderFirst.dart | 4 +- lib/retrofit/data/settleOrderInfo.dart | 190 +-- lib/retrofit/min_api.dart | 4 + lib/retrofit/min_api.g.dart | 383 ----- lib/retrofit/retrofit_api.g.dart | 1348 ----------------- lib/settlement/settlement.dart | 51 +- .../settlement_view/pay_method.dart | 61 +- .../settlement_order_commodity.dart | 3 +- lib/store/scan.dart | 7 +- lib/store/store_order.dart | 484 +++--- lib/store/store_view/shop_car.dart | 11 +- lib/store/store_view/shop_goods.dart | 58 +- lib/store/store_view/store_info.dart | 89 +- pubspec.lock | 14 +- pubspec.yaml | 3 +- 31 files changed, 755 insertions(+), 2376 deletions(-) delete mode 100644 lib/retrofit/data/base_data.g.dart delete mode 100644 lib/retrofit/data/page.g.dart delete mode 100644 lib/retrofit/min_api.g.dart delete mode 100644 lib/retrofit/retrofit_api.g.dart diff --git a/README.md b/README.md index 03bc7567..cbc20081 100644 --- a/README.md +++ b/README.md @@ -83,4 +83,10 @@ samples, guidance on mobile development, and a full API reference. 小米开放平台 83364300@qq.com 具体问 :(汪姐) - 推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey) \ No newline at end of file + 推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey) + + https://pos.platform.lotus-wallet.com/app/ 生产环境 + http://192.168.10.236:8765/app/ 测试环境 + https://pos.platform.lotus-wallet.com/app/ 生产环境 + http://192.168.10.236:8766/app/ 测试环境 + \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8e55d92b..39240c2f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -41,9 +41,6 @@ PODS: - flutter_bmflocation (1.0.3): - BMKLocationKit - Flutter - - flutter_scankit (0.0.1): - - Flutter - - ScanKitFrameWork (~> 1.0.2.300) - fluwx (0.0.1): - Flutter - WechatOpenSDK_Fuck (~> 1.9.2) @@ -84,7 +81,6 @@ PODS: - Flutter - "permission_handler (5.1.0+2)": - Flutter - - ScanKitFrameWork (1.0.2.300) - SDWebImage (5.12.1): - SDWebImage/Core (= 5.12.1) - SDWebImage/Core (5.12.1) @@ -128,7 +124,6 @@ DEPENDENCIES: - flutter_baidu_mapapi_search (from `.symlinks/plugins/flutter_baidu_mapapi_search/ios`) - flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/ios`) - flutter_bmflocation (from `.symlinks/plugins/flutter_bmflocation/ios`) - - flutter_scankit (from `.symlinks/plugins/flutter_scankit/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`) - image_pickers (from `.symlinks/plugins/image_pickers/ios`) - package_info (from `.symlinks/plugins/package_info/ios`) @@ -153,7 +148,6 @@ SPEC REPOS: - FMDB - mob_sharesdk - MOBFoundation - - ScanKitFrameWork - SDWebImage - SSZipArchive - TPNS-iOS @@ -173,8 +167,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios" flutter_bmflocation: :path: ".symlinks/plugins/flutter_bmflocation/ios" - flutter_scankit: - :path: ".symlinks/plugins/flutter_scankit/ios" fluwx: :path: ".symlinks/plugins/fluwx/ios" image_pickers: @@ -214,7 +206,6 @@ SPEC CHECKSUMS: flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c - flutter_scankit: 16936d86b3de3f83c122e763f4c24c5da214c78f fluwx: c192ef1ea3617badb813fa1a761ffc5c9c12208a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a image_pickers: 5e6ec7083f9363d014c0fb061f1b9cd97bb5e451 @@ -223,7 +214,6 @@ SPEC CHECKSUMS: package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 - ScanKitFrameWork: 0ad578f3db0ef9b64dd0f533d10d10a52ce93c80 SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d sharesdk_plugin: 6d6634bb480174b607030f19fc9d84d68cfbf326 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f085d3f6..93bbe164 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -657,7 +657,6 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 120EAF7195D9AB3BB1E8FA2B /* [CP] Copy Pods Resources */, - 8ADBB1E9F51ACB25060865A4 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -764,23 +763,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 8ADBB1E9F51ACB25060865A4 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -912,6 +894,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -925,6 +908,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; @@ -1147,6 +1131,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1160,6 +1145,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; @@ -1288,6 +1274,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c5375023..fb2dffc4 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -40,7 +40,7 @@ { child: Row( children: [ MImage( - widget?.comment?.memberInfo?.avatar ?? "", - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), + widget?.comment?.memberInfo?.avatar ?? "", + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), SizedBox( width: 8, ), @@ -337,12 +338,17 @@ class _CommunityDynamic extends State { physics: NeverScrollableScrollPhysics(), itemBuilder: (context, position) { return Container( - child: MImage( - subjectInfo.images[position], - fit: BoxFit.cover, - aspectRatio: 1, - errorSrc: "assets/image/default_2_1.png", - fadeSrc: "assets/image/default_2_1.png", + child: InkWell( + onTap: () { + ImagePickers.previewImages(subjectInfo.images, position); + }, + child: MImage( + subjectInfo.images[position], + fit: BoxFit.cover, + aspectRatio: 1, + errorSrc: "assets/image/default_2_1.png", + fadeSrc: "assets/image/default_2_1.png", + ), ), ); }, diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 983718a5..02ac9a0f 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -26,9 +26,12 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/request_permission.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:qrscan/qrscan.dart' as scanner; class HomePage extends StatefulWidget { final GestureTapCallback callback; @@ -216,7 +219,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { margin: EdgeInsets.only(right: 12.w), child: GestureDetector( onTap: () { - // Navigator.of(context).pushNamed('/router/system_msg_page'); + Navigator.of(context).pushNamed('/router/system_msg_page'); }, child: SvgPicture.asset( "assets/svg/tixing.svg", @@ -229,7 +232,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { margin: EdgeInsets.only(right: 16.w), child: GestureDetector( onTap: () { - // Navigator.of(context).pushNamed('/router/system_msg_page'); + toScan(); }, child: SvgPicture.asset( "assets/svg/saoyisao.svg", @@ -318,6 +321,48 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { ); } + toScan() async { + if (await Permission.camera.isPermanentlyDenied) { + showCupertinoDialog( + context: context, + builder: (context) { + return RequestPermission( + "assets/image/icon_camera_permission_tips.png", + S.of(context).ninxiangjiquanxianweikaiqi, + S.of(context).weilekaipaizhaoxuanzhetouxiang, + S.of(context).kaiqiquanxian, + (result) async { + if (result) { + await openAppSettings(); + } + }, + heightRatioWithWidth: 0.82, + ); + }); + } else if (await Permission.camera.isGranted) { + // http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 + // var result = await Navigator.of(context).pushNamed('/router/qr_scan'); + String result = await scanner.scan(); + Uri uri = Uri.parse(result); + String tableId = uri.queryParameters["tableId"]; + String tenantCode = uri.queryParameters["tenantCode"]; + String shopId = uri.queryParameters["shopId"]; + if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") { + Navigator.of(context).pushNamed( + '/router/store_order', + arguments: { + "id": shopId, + "tenant": tenantCode, + "storeName": "", + "tableId": int.tryParse(tableId), + }, + ); + } + } else { + await Permission.camera.request(); + } + } + _toDetails(index) async { Navigator.of(context).pushNamed( '/router/integral_store_page', diff --git a/lib/home/home_view/coupon.dart b/lib/home/home_view/coupon.dart index 26376d19..63718bef 100644 --- a/lib/home/home_view/coupon.dart +++ b/lib/home/home_view/coupon.dart @@ -229,19 +229,20 @@ class _CouponView extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text( - (coupon.useStartTime == null && - coupon.useEndTime == null) - ? S.of(context).quantian - : "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}", - style: TextStyle( - color: Color(0xFF868686), - fontWeight: MyFontWeight.semi_bold, - fontSize: 10.sp, - ), - ), Expanded( - child: Container(), + child: Text( + (coupon.useStartTime == null && + coupon.useEndTime == null) + ? S.of(context).quantian + : "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + color: Color(0xFF868686), + fontWeight: MyFontWeight.semi_bold, + fontSize: 10.sp, + ), + ), flex: 1, ), GestureDetector( @@ -249,7 +250,7 @@ class _CouponView extends State { if((coupon?.status??0) == 0) receiveCoupon(coupon?.id??""); }, - child:RoundButton( + child: RoundButton( text: ((coupon?.status??0) == 0) ? "领取" : "已领取", textColor: Colors.white, backgroup: ((coupon?.status??0) == 0)?Color(0xFF32A060):Colors.grey, diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index ac4a545e..101c09fe 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -8,6 +8,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:qrscan/qrscan.dart' as scanner; class MineView extends StatefulWidget { final UserInfo userInfo; @@ -90,8 +91,9 @@ class _MineView extends State { ); }); } else if (await Permission.camera.isGranted) { - ///http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 - var result = await Navigator.of(context).pushNamed('/router/qr_scan'); + // http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 + // var result = await Navigator.of(context).pushNamed('/router/qr_scan'); + String result = await scanner.scan(); Uri uri = Uri.parse(result); String tableId = uri.queryParameters["tableId"]; String tenantCode = uri.queryParameters["tenantCode"]; diff --git a/lib/order/order_utils.dart b/lib/order/order_utils.dart index 1b9a73e4..150e1df0 100644 --- a/lib/order/order_utils.dart +++ b/lib/order/order_utils.dart @@ -1,5 +1,6 @@ +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:fluwx/fluwx.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; @@ -7,6 +8,7 @@ import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/utils/min.dart'; +import 'package:huixiang/view_widget/tips_dialog.dart'; class OrderUtils { @@ -14,7 +16,7 @@ class OrderUtils { static carryOnPay(payChannel, MinApiService minService, OrderInfo orderInfo, Function queryDetails) async { PlaceOrderFirst placeOrderFirst = PlaceOrderFirst(); - placeOrderFirst.addressId = orderInfo.addressExt.addressId; + placeOrderFirst.addressId = orderInfo.addressExt == null ? "" : orderInfo.addressExt.addressId; placeOrderFirst.isSubscribe = orderInfo.isSubscribe; placeOrderFirst.isTakeOut = orderInfo.isTakeOut; placeOrderFirst.notes = orderInfo.notes; @@ -73,9 +75,12 @@ class OrderUtils { BaseData baseData = await minService .settlementApi(placeOrderFirst.toJson()) .catchError((error) {}); - if (baseData != null && baseData.isSuccess) { + // if (baseData != null && baseData.isSuccess) { + // + // } else { queryDetails(); - } + SmartDialog.show(widget: Tips((){}, text: "${baseData.msg}",)); + // } } } diff --git a/lib/order/order_view/order_address.dart b/lib/order/order_view/order_address.dart index ce4e50f5..536b12de 100644 --- a/lib/order/order_view/order_address.dart +++ b/lib/order/order_view/order_address.dart @@ -257,8 +257,8 @@ class _OrderAddress extends State { } aginOrder(storeId, storeName) { - Navigator.of(context).pushNamed('/router/union_detail_page', - arguments: {"id": storeId, "storeName": storeName}); + // Navigator.of(context).pushNamed('/router/union_detail_page', + // arguments: {"id": storeId, "storeName": storeName}); if(widget.orderInfo.storeVO.posType.code == "NORMALSTORE") { Scan.toScan( diff --git a/lib/order/write_off_page.dart b/lib/order/write_off_page.dart index b7cd6997..2f8428fb 100644 --- a/lib/order/write_off_page.dart +++ b/lib/order/write_off_page.dart @@ -71,7 +71,7 @@ class _WriteOffPage extends State { height: 8.h, ), Text( - S.of(context).youxiaoqi( + (coupon.useStartTime == null || coupon.useEndTime == null) ? "" : S.of(context).youxiaoqi( "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]}-${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}"), style: TextStyle( fontSize: 12.sp, diff --git a/lib/qr/qr_code_scan.dart b/lib/qr/qr_code_scan.dart index 8561242d..1067aa4b 100644 --- a/lib/qr/qr_code_scan.dart +++ b/lib/qr/qr_code_scan.dart @@ -1,7 +1,7 @@ import 'dart:ui'; import 'package:flutter/material.dart'; -import 'package:flutter_scankit/scan_kit_widget.dart'; +// import 'package:flutter_scankit/scan_kit_widget.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -17,85 +17,85 @@ class QrCodeScanPage extends StatefulWidget { class _QrCodeScanPage extends State { - ScanKitController _controller; - final screenWidth = window.physicalSize.width; - final screenHeight = window.physicalSize.height; - - @override - void initState() { - super.initState(); - } - - @override + // ScanKitController _controller; + // final screenWidth = window.physicalSize.width; + // final screenHeight = window.physicalSize.height; + // + // @override + // void initState() { + // super.initState(); + // } + // + // @override Widget build(BuildContext context) { - return Scaffold( - body: Container( - child: Stack( - children: [ - Positioned( - child: Column( - children: [ - Expanded( - child: ScanKitWidget( - callback: (controller) { - _controller = controller; - controller.onResult.listen((result) { - debugPrint("scanning result:$result"); - Navigator.of(context).pop(result); - }); - }, - continuouslyScan: false, - boundingBox: Rect.fromLTRB(0, 0, screenWidth, screenHeight), - ), - flex: 1, - ), - ], - ), - top: 0, - bottom: 0, - left: 0, - right: 0, - ), - Positioned( - child: MyAppBar( - title: "扫码", - titleColor: Colors.white, - leadingColor: Colors.white, - brightness: Brightness.dark, - background: Colors.transparent, - action: Container( - alignment: Alignment.center, - margin: EdgeInsets.only(right: 16.w), - child: GestureDetector( - onTap: () { - _controller.pickPhoto(); - }, - child: Text( - S.of(context).xiangce, - style: TextStyle( - color: Colors.black, - fontSize: 18.sp, - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ), - top: 0, - left: 0, - right: 0, - ), - ], - ), - ), - ); - } - - @override - void dispose() { - // if (this._controller != null) { - // this._controller.dispose(); - // } - super.dispose(); + // return Scaffold( + // body: Container( + // child: Stack( + // children: [ + // Positioned( + // child: Column( + // children: [ + // Expanded( + // child: ScanKitWidget( + // callback: (controller) { + // _controller = controller; + // controller.onResult.listen((result) { + // debugPrint("scanning result:$result"); + // Navigator.of(context).pop(result); + // }); + // }, + // continuouslyScan: false, + // boundingBox: Rect.fromLTRB(0, 0, screenWidth, screenHeight), + // ), + // flex: 1, + // ), + // ], + // ), + // top: 0, + // bottom: 0, + // left: 0, + // right: 0, + // ), + // Positioned( + // child: MyAppBar( + // title: "扫码", + // titleColor: Colors.white, + // leadingColor: Colors.white, + // brightness: Brightness.dark, + // background: Colors.transparent, + // action: Container( + // alignment: Alignment.center, + // margin: EdgeInsets.only(right: 16.w), + // child: GestureDetector( + // onTap: () { + // _controller.pickPhoto(); + // }, + // child: Text( + // S.of(context).xiangce, + // style: TextStyle( + // color: Colors.black, + // fontSize: 18.sp, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // ), + // ), + // top: 0, + // left: 0, + // right: 0, + // ), + // ], + // ), + // ), + // ); } + // + // @override + // void dispose() { + // // if (this._controller != null) { + // // this._controller.dispose(); + // // } + // super.dispose(); + // } } diff --git a/lib/retrofit/data/base_data.g.dart b/lib/retrofit/data/base_data.g.dart deleted file mode 100644 index 3a4ba372..00000000 --- a/lib/retrofit/data/base_data.g.dart +++ /dev/null @@ -1,37 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'base_data.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -BaseData _$BaseDataFromJson( - Map json, - T Function(Object json) fromJsonT, -) { - return BaseData() - ..code = json['code'] as int - ..data = fromJsonT(json['data']) - ..extra = json['extra'] - ..isError = json['isError'] as bool - ..isSuccess = json['isSuccess'] as bool - ..msg = json['msg'] as String - ..path = json['path'] as String - ..timestamp = json['timestamp'] as String; -} - -Map _$BaseDataToJson( - BaseData instance, - Object Function(T value) toJsonT, -) => - { - 'code': instance.code, - 'data': toJsonT(instance.data), - 'extra': instance.extra, - 'isError': instance.isError, - 'isSuccess': instance.isSuccess, - 'msg': instance.msg, - 'path': instance.path, - 'timestamp': instance.timestamp, - }; diff --git a/lib/retrofit/data/min_order_info.dart b/lib/retrofit/data/min_order_info.dart index 917d4842..6979e2d9 100644 --- a/lib/retrofit/data/min_order_info.dart +++ b/lib/retrofit/data/min_order_info.dart @@ -67,7 +67,7 @@ class MinOrderInfo { dynamic discountType, dynamic discountMoney, dynamic overTime, - List orderProductVOList, + List orderProductVOList, dynamic moneyReturnList, dynamic goodsReturnList, dynamic moneyReturnVOList, @@ -235,7 +235,7 @@ class MinOrderInfo { if (json['orderProductVOList'] != null) { this.orderProductVOList = []; json['orderProductVOList'].forEach((v) { - this.orderProductVOList.add(OrderProductListBean.fromJson(v)); + this.orderProductVOList.add(OrderProductVOList.fromJson(v)); }); } this.moneyReturnList = json['moneyReturnList']; @@ -319,7 +319,7 @@ class MinOrderInfo { dynamic discountType; dynamic discountMoney; dynamic overTime; - List orderProductVOList; + List orderProductVOList; dynamic moneyReturnList; dynamic goodsReturnList; dynamic moneyReturnVOList; diff --git a/lib/retrofit/data/page.g.dart b/lib/retrofit/data/page.g.dart deleted file mode 100644 index e40a14ae..00000000 --- a/lib/retrofit/data/page.g.dart +++ /dev/null @@ -1,41 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'page.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -PageInfo _$PageInfoFromJson( - Map json, - D Function(Object json) fromJsonD, -) { - return PageInfo() - ..pageNum = json['pageNum'] as int - ..current = json['current'] - ..pageSize = json['pageSize'] as int - ..size = json['size'] - ..pages = json['pages'] - ..hasPreviousPage = json['hasPreviousPage'] as bool - ..hasNextPage = json['hasNextPage'] as bool - ..total = json['total'] as String - ..list = (json['list'] as List)?.map(fromJsonD)?.toList() - ..records = (json['records'] as List)?.map(fromJsonD)?.toList(); -} - -Map _$PageInfoToJson( - PageInfo instance, - Object Function(D value) toJsonD, -) => - { - 'pageNum': instance.pageNum, - 'current': instance.current, - 'pageSize': instance.pageSize, - 'size': instance.size, - 'pages': instance.pages, - 'hasPreviousPage': instance.hasPreviousPage, - 'hasNextPage': instance.hasNextPage, - 'total': instance.total, - 'list': instance.list?.map(toJsonD)?.toList(), - 'records': instance.records?.map(toJsonD)?.toList(), - }; diff --git a/lib/retrofit/data/placeOrderFirst.dart b/lib/retrofit/data/placeOrderFirst.dart index 8ae1e446..8dc1d2df 100644 --- a/lib/retrofit/data/placeOrderFirst.dart +++ b/lib/retrofit/data/placeOrderFirst.dart @@ -21,7 +21,7 @@ class PlaceOrderFirst { PromotionInfoDTOBean promotionInfoDTO; String recMobile; List orderProductVOList; - List shoppingCartSkuItemList; + List shoppingCartSkuItemList; List skuItemDTOList; num source; String storeId; @@ -76,7 +76,7 @@ class PlaceOrderFirst { placeOrderFirst.recMobile = json['recMobile']; placeOrderFirst.shoppingCartSkuItemList = []..addAll( (json['shoppingCartSkuItemList'] as List ?? []) - .map((o) => OrderProductListBean.fromJson(o))); + .map((o) => OrderProductVOList.fromJson(o))); placeOrderFirst.orderProductVOList = []..addAll( (json['orderProductVOList'] as List ?? []) .map((o) => OrderProductVOList.fromJson(o))); diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index ba8b2f93..1346d9f8 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -1,4 +1,6 @@ +import 'package:huixiang/retrofit/data/order_product_vo.dart'; + class SettleOrderInfo { int orderNum; int productNum; @@ -12,7 +14,7 @@ class SettleOrderInfo { List couponList; String threshold; String freePostAge; - List orderProductList; + List orderProductList; static SettleOrderInfo fromJson(Map map) { if (map == null) return null; @@ -34,7 +36,7 @@ class SettleOrderInfo { settleOrderInfoBean.threshold = map['threshold']; settleOrderInfoBean.freePostAge = map['freePostAge']; settleOrderInfoBean.orderProductList = List()..addAll( - (map['orderProductList'] as List ?? []).map((o) => OrderProductListBean.fromJson(o)) + (map['orderProductList'] as List ?? []).map((o) => OrderProductVOList.fromJson(o)) ); return settleOrderInfoBean; } @@ -84,98 +86,98 @@ class SettleOrderInfo { /// status : null /// batch : null -class OrderProductListBean { - dynamic id; - dynamic createTime; - dynamic createUser; - dynamic updateTime; - dynamic updateUser; - dynamic tenantCode; - dynamic storeId; - dynamic orderId; - dynamic actInfo; - String productId; - String productName; - String skuId; - String skuNameStr; - dynamic skuImg; - int buyNum; - dynamic refundNum; - dynamic type; - dynamic reason; - double weight; - String applyPrice; - String sellPrice; - dynamic postPay; - dynamic isDelete; - dynamic discountAmount; - dynamic discountPercent; - dynamic status; - dynamic batch; - - static OrderProductListBean fromJson(Map map) { - if (map == null) return null; - OrderProductListBean orderProductListBean = OrderProductListBean(); - orderProductListBean.id = map['id']; - orderProductListBean.createTime = map['createTime']; - orderProductListBean.createUser = map['createUser']; - orderProductListBean.updateTime = map['updateTime']; - orderProductListBean.updateUser = map['updateUser']; - orderProductListBean.tenantCode = map['tenantCode']; - orderProductListBean.storeId = map['storeId']; - orderProductListBean.orderId = map['orderId']; - orderProductListBean.actInfo = map['actInfo']; - orderProductListBean.productId = map['productId']; - orderProductListBean.productName = map['productName']; - orderProductListBean.skuId = map['skuId']; - orderProductListBean.skuNameStr = map['skuNameStr']; - orderProductListBean.skuImg = map['skuImg']; - orderProductListBean.buyNum = map['buyNum']; - orderProductListBean.refundNum = map['refundNum']; - orderProductListBean.type = map['type']; - orderProductListBean.reason = map['reason']; - orderProductListBean.weight = map['weight']; - orderProductListBean.applyPrice = map['applyPrice']; - orderProductListBean.sellPrice = map['sellPrice']; - orderProductListBean.postPay = map['postPay']; - orderProductListBean.isDelete = map['isDelete']; - orderProductListBean.discountAmount = map['discountAmount']; - orderProductListBean.discountPercent = map['discountPercent']; - orderProductListBean.status = map['status']; - orderProductListBean.batch = map['batch']; - return orderProductListBean; - } - - Map toJson() => { - "id": id, - "createTime": createTime, - "createUser": createUser, - "updateTime": updateTime, - "updateUser": updateUser, - "tenantCode": tenantCode, - "storeId": storeId, - "orderId": orderId, - "actInfo": actInfo, - "productId": productId, - "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, - }; -} +// class OrderProductListBean { +// dynamic id; +// dynamic createTime; +// dynamic createUser; +// dynamic updateTime; +// dynamic updateUser; +// dynamic tenantCode; +// dynamic storeId; +// dynamic orderId; +// dynamic actInfo; +// String productId; +// String productName; +// String skuId; +// String skuNameStr; +// dynamic skuImg; +// int buyNum; +// dynamic refundNum; +// dynamic type; +// dynamic reason; +// double weight; +// String applyPrice; +// String sellPrice; +// dynamic postPay; +// dynamic isDelete; +// dynamic discountAmount; +// dynamic discountPercent; +// dynamic status; +// dynamic batch; +// +// static OrderProductListBean fromJson(Map map) { +// if (map == null) return null; +// OrderProductListBean orderProductListBean = OrderProductListBean(); +// orderProductListBean.id = map['id']; +// orderProductListBean.createTime = map['createTime']; +// orderProductListBean.createUser = map['createUser']; +// orderProductListBean.updateTime = map['updateTime']; +// orderProductListBean.updateUser = map['updateUser']; +// orderProductListBean.tenantCode = map['tenantCode']; +// orderProductListBean.storeId = map['storeId']; +// orderProductListBean.orderId = map['orderId']; +// orderProductListBean.actInfo = map['actInfo']; +// orderProductListBean.productId = map['productId']; +// orderProductListBean.productName = map['productName']; +// orderProductListBean.skuId = map['skuId']; +// orderProductListBean.skuNameStr = map['skuNameStr']; +// orderProductListBean.skuImg = map['skuImg']; +// orderProductListBean.buyNum = map['buyNum']; +// orderProductListBean.refundNum = map['refundNum']; +// orderProductListBean.type = map['type']; +// orderProductListBean.reason = map['reason']; +// orderProductListBean.weight = map['weight']; +// orderProductListBean.applyPrice = map['applyPrice']; +// orderProductListBean.sellPrice = map['sellPrice']; +// orderProductListBean.postPay = map['postPay']; +// orderProductListBean.isDelete = map['isDelete']; +// orderProductListBean.discountAmount = map['discountAmount']; +// orderProductListBean.discountPercent = map['discountPercent']; +// orderProductListBean.status = map['status']; +// orderProductListBean.batch = map['batch']; +// return orderProductListBean; +// } +// +// Map toJson() => { +// "id": id, +// "createTime": createTime, +// "createUser": createUser, +// "updateTime": updateTime, +// "updateUser": updateUser, +// "tenantCode": tenantCode, +// "storeId": storeId, +// "orderId": orderId, +// "actInfo": actInfo, +// "productId": productId, +// "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, +// }; +// } /// id : "1448907890034212864" /// storeId : "1333246101343436800" diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 89783777..92b5cdab 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -131,6 +131,10 @@ abstract class MinApiService { debugPrint(msg, wrapWidth: maxStrLength); } + /// 会员信息 + @GET("/member/info") + Future memberInfo(); + ///小程序查询分组及商品列表 @POST("product/findMiNiGroupList") Future>> findMiNiGroupList( diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart deleted file mode 100644 index 18b5a5d8..00000000 --- a/lib/retrofit/min_api.g.dart +++ /dev/null @@ -1,383 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'min_api.dart'; - -// ************************************************************************** -// RetrofitGenerator -// ************************************************************************** - -class _MinApiService implements MinApiService { - _MinApiService(this._dio, {this.baseUrl}) { - ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.236:8765/app/'; - } - - final Dio _dio; - - String baseUrl; - - @override - Future>> findMiNiGroupList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - 'product/findMiNiGroupList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map( - (i) => FindMiNiGroupList.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future> miNiDetail(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/product/queryMiNiProductDetail?id=$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => MiNiDetail.fromJson(json), - ); - return value; - } - - @override - Future>> addShoppingCart(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('shoppingcart', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map( - (i) => ShoppingCart.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future>> getShoppingCart(tableId) async { - ArgumentError.checkNotNull(tableId, 'tableId'); - const _extra = {}; - final queryParameters = {r'tableId': tableId}; - final _data = {}; - final _result = await _dio.request>('shoppingcart', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map( - (i) => ShoppingCart.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future> clearShoppingCart() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - 'shoppingcart/delCart', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as bool, - ); - return value; - } - - @override - Future>> shoppingCart1(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('shoppingcart', - queryParameters: queryParameters, - options: RequestOptions( - method: 'PUT', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map( - (i) => ShoppingCart.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future>> shoppingCartSingle(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - 'shoppingcart/single', - queryParameters: queryParameters, - options: RequestOptions( - method: 'PUT', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map( - (i) => ShoppingCart.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future> getOrderInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - 'order/getOrderInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => SettleOrderInfo.fromJson(json), - ); - return value; - } - - @override - Future> getOrderDetails(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - 'order/getOrderDetail', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => MinOrderInfo.fromJson(json), - ); - return value; - } - - @override - Future>> queryAddress() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - 'address/queryMemberAddress', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map
((i) => Address.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future> placeOrderFirst(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - 'order/placeOrderFirst', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => DownOrder.fromJson(json), - ); - return value; - } - - @override - Future> addOrder(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('order/addOrder', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => DownOrder.fromJson(json), - ); - return value; - } - - @override - Future> settlementWx(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('order/settlement', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => WxPay.fromJson(json), - ); - return value; - } - - @override - Future> settlementApi(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('order/settlement', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> queryStoreInfo1(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('store/getStore', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> getParentInfo(tableId) async { - ArgumentError.checkNotNull(tableId, 'tableId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - 'order/getParentInfo?tableId=$tableId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } -} diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart deleted file mode 100644 index 1024cdf2..00000000 --- a/lib/retrofit/retrofit_api.g.dart +++ /dev/null @@ -1,1348 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'retrofit_api.dart'; - -// ************************************************************************** -// RetrofitGenerator -// ************************************************************************** - -class _ApiService implements ApiService { - _ApiService(this._dio, {this.baseUrl}) { - ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.236:8766/app/'; - } - - final Dio _dio; - - String baseUrl; - - @override - Future> upload(data, folderId) async { - ArgumentError.checkNotNull(data, 'data'); - ArgumentError.checkNotNull(folderId, 'folderId'); - const _extra = {}; - final queryParameters = {}; - final _data = FormData(); - _data.files.add(MapEntry( - 'file', - MultipartFile.fromFileSync(data.path, - filename: data.path.split(Platform.pathSeparator).last))); - if (folderId != null) { - _data.fields.add(MapEntry('folderId', folderId.toString())); - } - final _result = await _dio.request>('/file/upload', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => UploadResult.fromJson(json), - ); - return value; - } - - @override - Future searchPoi(lat, lng, keywords, size, page) async { - ArgumentError.checkNotNull(lat, 'lat'); - ArgumentError.checkNotNull(lng, 'lng'); - ArgumentError.checkNotNull(keywords, 'keywords'); - ArgumentError.checkNotNull(size, 'size'); - ArgumentError.checkNotNull(page, 'page'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request( - 'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = _result.data; - return value; - } - - @override - Future> memberLogin(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/auth/platform/memberLogin', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> sendVerify(mobile) async { - ArgumentError.checkNotNull(mobile, 'mobile'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/sendVerify/$mobile', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> creditGoods(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoods/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => Goods.fromJson(json), - ), - ); - return value; - } - - @override - Future>> goodsCategory(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditGoodsCategory/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => GoodsCategory.fromJson(json), - ), - ); - return value; - } - - @override - Future> creditGoodsById(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/creditGoods/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => Goods.fromJson(json), - ); - return value; - } - - @override - Future> queryInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/info', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => UserInfo.fromJson(json), - ); - return value; - } - - @override - Future> editInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/member/editMemberInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> signInInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/signInInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => SignInfo.fromJson(json), - ); - return value; - } - - @override - Future> signIn() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/signIn', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> recharge(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/wallet/recharge', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => WxPay.fromJson(json), - ); - return value; - } - - @override - Future> receiveCoupon(couponId) async { - ArgumentError.checkNotNull(couponId, 'couponId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/coupon/receive?couponId=$couponId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> creditOrderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => ExchangeOrder.fromJson(json), - ), - ); - return value; - } - - @override - Future> creditOrder(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/creditOrder/create', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> addAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/add', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> deleteAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/delete', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> queryAddress(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/detail/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> queryMemberAddress() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/address/queryMemberAddress', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map
((i) => Address.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future> updateAddress(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/address/update', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> queryCoupon(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/centreList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => Coupon.fromJson(json), - ), - ); - return value; - } - - @override - Future>> queryCard(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/coupon/packageList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => Coupon.fromJson(json), - ), - ); - return value; - } - - @override - Future>> queryStore(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/store/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map((i) => Store.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future>> informationList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => Activity.fromJson(json), - ), - ); - return value; - } - - @override - Future> informationInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/information/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData
.fromJson( - _result.data, - (json) => Article.fromJson(json), - ); - return value; - } - - @override - Future> activityInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/information/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => Activity.fromJson(json), - ); - return value; - } - - @override - Future> creditOrderReceive(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> queryHome() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/home', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => BrandData.fromJson(json), - ); - return value; - } - - @override - Future> queryStoreInfo(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/store/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> queryArticle(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/information/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo
.fromJson( - json, - (json) => Article.fromJson(json), - ), - ); - return value; - } - - @override - Future>> queryBanner(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/banner/page', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => BannerData.fromJson(json), - ), - ); - return value; - } - - @override - Future> queryHomeBrand() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/home/brand', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> minLogin(storeId) async { - ArgumentError.checkNotNull(storeId, 'storeId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/auth/mini/login/$storeId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> queryBillInfo(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/member/listBill', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => UserBill.fromJson(json), - ), - ); - return value; - } - - @override - Future>> rankList() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/member/rankList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map((i) => Rank.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future>> orderList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/order/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => OrderInfo.fromJson(json), - ), - ); - return value; - } - - @override - Future> orderDetail(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/order/orderDetail?id=$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => OrderInfo.fromJson(json), - ); - return value; - } - - @override - Future> continuePay(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/order/continuePay', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> receiveToCard(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/creditOrder/receive/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> vipList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/member/vipList', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => (json as List) - .map((i) => VipCard.fromJson(i as Map)) - .toList()); - return value; - } - - @override - Future> vipDetail(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/member/vipDetail', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => VipCard.fromJson(json), - ); - return value; - } - - @override - Future>> msgList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/app-msg/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => Message.fromJson(json), - ), - ); - return value; - } - - @override - Future> queryMsg(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>('/app-msg/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> informationLikes(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/information/likes/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> memberComment(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/memberComment', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future>> memberCommentList(param) async { - ArgumentError.checkNotNull(param, 'param'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>( - '/memberComment/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => MemberCommentList.fromJson(json), - ), - ); - return value; - } - - @override - Future> commentLike(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/memberComment/likes/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> delComment(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/memberComment/delete/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> shippingTrace(shipperCode, logisticCode) async { - ArgumentError.checkNotNull(shipperCode, 'shipperCode'); - ArgumentError.checkNotNull(logisticCode, 'logisticCode'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/order/getShippingTrace/$shipperCode/$logisticCode', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => Logistics.fromJson(json), - ); - return value; - } - - @override - Future> report(map) async { - ArgumentError.checkNotNull(map, 'map'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(map ?? {}); - final _result = await _dio.request>('/other/report', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as bool, - ); - return value; - } - - @override - Future> orderCancel(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/order/cancel/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as bool, - ); - return value; - } - - @override - Future> settlement(map) async { - ArgumentError.checkNotNull(map, 'map'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(map ?? {}); - final _result = await _dio.request>( - '/order/settlement', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as String, - ); - return value; - } - - @override - Future> trend(map) async { - ArgumentError.checkNotNull(map, 'map'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(map ?? {}); - final _result = await _dio.request>( - '/information/trend', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as bool, - ); - return value; - } - - @override - Future>> trendList(map) async { - ArgumentError.checkNotNull(map, 'map'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(map ?? {}); - final _result = await _dio.request>( - '/information/trend-list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => ComunityComment.fromJson(json), - ), - ); - return value; - } - - @override - Future>> followList(map) async { - ArgumentError.checkNotNull(map, 'map'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(map ?? {}); - final _result = await _dio.request>( - '/member/follow/list', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData>.fromJson( - _result.data, - (json) => PageInfo.fromJson( - json, - (json) => ListData.fromJson(json), - ), - ); - return value; - } - - @override - Future> follow(followId) async { - ArgumentError.checkNotNull(followId, 'followId'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/follow/$followId', - queryParameters: queryParameters, - options: RequestOptions( - method: 'PUT', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> deleteTrend(id) async { - ArgumentError.checkNotNull(id, 'id'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/information/trend/$id', - queryParameters: queryParameters, - options: RequestOptions( - method: 'DELETE', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => json as dynamic, - ); - return value; - } - - @override - Future> socialInfo() async { - const _extra = {}; - final queryParameters = {}; - final _data = {}; - final _result = await _dio.request>( - '/member/socialInfo', - queryParameters: queryParameters, - options: RequestOptions( - method: 'GET', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => SocialInfo.fromJson(json), - ); - return value; - } -} diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index ba1c21e0..85c25e69 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:fluwx/fluwx.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; @@ -12,8 +13,6 @@ import 'package:huixiang/retrofit/data/down_order.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart'; import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; -import 'package:huixiang/retrofit/data/settlement_bean.dart'; -import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/min_api.dart'; @@ -28,6 +27,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; +import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -56,6 +56,7 @@ class _Settlement extends State { String parentId = ""; int payChannel = 4; int tableId = 0; + int numberOfPeople = 0; Address address; CouponListBean couponListBean; @@ -71,6 +72,7 @@ class _Settlement extends State { parentCode = widget.arguments["parentCode"] ?? ""; parentId = widget.arguments["parentId"] ?? ""; storeInfo = widget.arguments["storeInfo"]; + numberOfPeople = widget.arguments["numberOfPeople"] ?? 0; if (tableId == 0) { placeOrder = true; @@ -111,6 +113,7 @@ class _Settlement extends State { settleOrderInfo = baseData.data; if (settleOrderInfo.orderProductList == null || settleOrderInfo.orderProductList.length == 0) { + placeOrder = true; queryOrderDetails(parentId); } }); @@ -119,6 +122,7 @@ class _Settlement extends State { ///查看订单详情 queryOrderDetails(id) async { + print("ididididididid: $id"); BaseData baseData = await minService.getOrderDetails({ "id": id, }).catchError((error) {}); @@ -196,7 +200,7 @@ class _Settlement extends State { placeOrderFirst.isSubscribe = false; placeOrderFirst.isTakeOut = selectedBtn; placeOrderFirst.notes = remakers; - placeOrderFirst.numberOfPeople = "0"; + placeOrderFirst.numberOfPeople = "$numberOfPeople"; placeOrderFirst.orderSource = 2; placeOrderFirst.orderType = "0"; placeOrderFirst.orderTypeId = 0; @@ -232,23 +236,32 @@ class _Settlement extends State { } else { ///火锅店下单, 等待结算 BaseData baseData; - if (parentId == "") { - baseData = await minService - .placeOrderFirst(placeOrderFirst.toJson()) - .catchError((error) { - print("error: $error"); - }); + if (parentId == "") { // 下单 + if (placeOrder) { // 结算 + querySettlement(); + } else { // 下单 + baseData = await minService + .placeOrderFirst(placeOrderFirst.toJson()) + .catchError((error) { + print("error: $error"); + }); + } } else { - baseData = await minService - .addOrder(placeOrderFirst.toJson()) - .catchError((error) { - print("error: $error"); - }); + if (placeOrder) { // 结算 + querySettlement(); + } else { //加菜 + baseData = await minService + .addOrder(placeOrderFirst.toJson()) + .catchError((error) { + print("error: $error"); + }); + } } if (baseData != null && baseData.isSuccess) { placeOrder = true; this.downOrder = baseData.data; - queryOrderDetails(parentId); + queryOrderDetails( + (parentId == null || parentId == "") ? baseData.data.id : parentId); setState(() {}); } } @@ -257,7 +270,7 @@ class _Settlement extends State { ///结算 querySettlement() async { placeOrderFirst.id = parentId != "" ? parentId : downOrder.id; - placeOrderFirst.orderProductVOList = downOrder.orderProductVOList; + placeOrderFirst.orderProductVOList = downOrder == null ? minOrderInfo.orderProductVOList : downOrder.orderProductVOList; if (placeOrderFirst.payChannel == 1) { if (!(await Min.isInitialize())) { // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, @@ -295,6 +308,8 @@ class _Settlement extends State { .catchError((error) {}); if (baseData != null && baseData.isSuccess) { toOrderDetails(placeOrderFirst.id); + } else { + SmartDialog.show(widget: Tips((){}, text: "${baseData.msg}",)); } } } @@ -377,8 +392,8 @@ class _Settlement extends State { couponCount(), ), - ///支付方式 - PayMethod(payChannelCheck), + if (placeOrder) ///支付方式 + PayMethod(payChannelCheck), ], ), ), diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 5cf2be66..aaef5b4f 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -1,11 +1,11 @@ - +import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class PayMethod extends StatefulWidget { - final Function(int payChannel) payChannelCheck; PayMethod(this.payChannelCheck); @@ -14,10 +14,25 @@ class PayMethod extends StatefulWidget { State createState() { return _PayMethod(); } - } class _PayMethod extends State { + String money = "0"; + String balance = "0"; + + @override + void initState() { + super.initState(); + + SharedPreferences.getInstance().then((value) { + Map memberInfo = + jsonDecode(value.getString("minMember")); + balance = memberInfo["balance"]; + money = memberInfo["money"]; + setState(() {}); + }); + } + @override Widget build(BuildContext context) { return Container( @@ -68,16 +83,32 @@ class _PayMethod extends State { widget.payChannelCheck(4); }, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ checkView(1), + Expanded( + child: Container(), + flex: 1, + ), + Text( + "¥$money", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + width: 10, + ), Text( S.of(context).pingtaiyue, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), - fontWeight: MyFontWeight.semi_bold,), + fontWeight: MyFontWeight.semi_bold, + ), ), ], ), @@ -93,10 +124,25 @@ class _PayMethod extends State { widget.payChannelCheck(3); }, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ checkView(2), + Expanded( + child: Container(), + flex: 1, + ), + Text( + "¥$balance", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + width: 10, + ), Text( S.of(context).dianpuyue, style: TextStyle( @@ -159,5 +205,4 @@ class _PayMethod extends State { ), ); } - -} \ No newline at end of file +} diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 8e351e4a..91ca1a96 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart'; +import 'package:huixiang/retrofit/data/order_product_vo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; @@ -113,7 +114,7 @@ class _SettlementOrderCommodity extends State { return widgets; } - Widget commodityItem(OrderProductListBean productList) { + Widget commodityItem(OrderProductVOList productList) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), child: Row( diff --git a/lib/store/scan.dart b/lib/store/scan.dart index be947359..332e4713 100644 --- a/lib/store/scan.dart +++ b/lib/store/scan.dart @@ -1,9 +1,8 @@ - - import 'package:flutter/cupertino.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:qrscan/qrscan.dart' as scanner; class Scan { @@ -26,8 +25,8 @@ class Scan { ); }); } else if (await Permission.camera.isGranted) { - var result = await Navigator.of(context).pushNamed('/router/qr_scan'); - + // var result = await Navigator.of(context).pushNamed('/router/qr_scan'); + String result = await scanner.scan(); if (result != null && result != "") { Uri uri = Uri.parse(result); String table = uri.queryParameters["tableId"]; diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 78dde134..809352fb 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:ai_decimal_accuracy/ai_decimal_accuracy.dart'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; @@ -115,6 +117,9 @@ class _StoreOrderPage extends State storeId: storeId, showLoading: false, ); + + queryMemberInfo(); + queryShopCar().then((value) { this.shopCarGoods = value; setState(() {}); @@ -127,6 +132,18 @@ class _StoreOrderPage extends State }); } + queryMemberInfo() async { + BaseData baseData = await minService.memberInfo() + .catchError((error){debugPrint(error);}); + if (baseData != null && baseData.isSuccess) { + SharedPreferences.getInstance().then( + (value) => { + value.setString('minMember', jsonEncode(baseData.data)), + }, + ); + } + } + ///获取父订单(火锅订单加菜前调用) getParentInfo() async { BaseData baseData = await minService.getParentInfo("$tableId") @@ -161,8 +178,7 @@ class _StoreOrderPage extends State /// 查询店铺信息 queryStoreInfo() async { - BaseData baseData = - await apiService.queryStoreInfo(storeId).catchError((error) { + BaseData baseData = await apiService.queryStoreInfo(storeId).catchError((error) { debugPrint(error); }); if (baseData != null && baseData.isSuccess) { @@ -192,182 +208,184 @@ class _StoreOrderPage extends State return true; } }, - child: Stack( - children: [ - Positioned( - left: 0, - right: 0, - top: 0, - bottom: 54.h, - child: NestedScrollView( - controller: controller, - dragStartBehavior: DragStartBehavior.start, - physics: BouncingScrollPhysics(), - headerSliverBuilder: (BuildContext context, bool innerScrolled) { - return [ - SliverOverlapAbsorber( - handle: NestedScrollView.sliverOverlapAbsorberHandleFor( - context), - sliver: SliverAppBar( - expandedHeight: - (storeInfo != null && storeInfo.couponVOList != null) - ? 470.h - : 365.h, - floating: false, - snap: false, - pinned: true, - stretch: false, - brightness: Brightness.light, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, + child: Container( + color: Colors.white, + child: Stack( + children: [ + Positioned( + left: 0, + right: 0, + top: 0, + bottom: 54.h, + child: NestedScrollView( + controller: controller, + dragStartBehavior: DragStartBehavior.start, + physics: BouncingScrollPhysics(), + headerSliverBuilder: (BuildContext context, bool innerScrolled) { + return [ + SliverOverlapAbsorber( + handle: NestedScrollView.sliverOverlapAbsorberHandleFor( + context), + sliver: SliverAppBar( + expandedHeight: + (storeInfo != null && storeInfo.couponVOList != null) + ? 470.h + : 365.h, + floating: false, + snap: false, + pinned: true, + stretch: false, + brightness: Brightness.light, + leading: GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + alignment: Alignment.centerRight, + margin: EdgeInsets.only(left: 10), + padding: EdgeInsets.all(6), + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + size: 24, + ), ), ), - ), - flexibleSpace: FlexibleSpaceBar( - title: Title( - controller, - storeInfo != null ? storeInfo.storeName : '', - ), - collapseMode: CollapseMode.pin, - stretchModes: [ - StretchMode.zoomBackground, - StretchMode.fadeTitle, - StretchMode.blurBackground, - ], - background: Container( - color: Colors.white, - child: Stack( - children: [ - Positioned( - child: Column( - children: [ - buildSwiper(), - Expanded( - child: Container( - color: Colors.transparent, - ), - flex: 1, - ), - ], - ), - top: 0, - bottom: 0, - left: 0, - right: 0, - ), - Positioned( - child: Container( + flexibleSpace: FlexibleSpaceBar( + title: Title( + controller, + storeInfo != null ? storeInfo.storeName : '', + ), + collapseMode: CollapseMode.pin, + stretchModes: [ + StretchMode.zoomBackground, + StretchMode.fadeTitle, + StretchMode.blurBackground, + ], + background: Container( + color: Colors.white, + child: Stack( + children: [ + Positioned( child: Column( children: [ - ///门店信息 - StoreInfoView(storeInfo), - - ///门店对应优惠券 - if (storeInfo != null && - storeInfo.couponVOList != null) - UnionCoupon( - storeInfo, - _receiveCoupon, - coupon: true, + buildSwiper(), + Expanded( + child: Container( + color: Colors.transparent, ), - - if (storeInfo == null || - storeInfo.couponVOList == null) - SizedBox( - height: 8, - ), - - ///门店对应VIP信息 - Vip(storeInfo, () {}, false), + flex: 1, + ), ], ), + top: 0, + bottom: 0, + left: 0, + right: 0, ), - top: 110.h, - bottom: 0, - left: 0, - right: 0, - ), - ], + Positioned( + child: Container( + child: Column( + children: [ + ///门店信息 + StoreInfoView(storeInfo), + + ///门店对应优惠券 + if (storeInfo != null && + storeInfo.couponVOList != null) + UnionCoupon( + storeInfo, + _receiveCoupon, + coupon: true, + ), + + if (storeInfo == null || + storeInfo.couponVOList == null) + SizedBox( + height: 8, + ), + + ///门店对应VIP信息 + Vip(storeInfo, () {}, false), + ], + ), + ), + top: 110.h, + bottom: 0, + left: 0, + right: 0, + ), + ], + ), ), ), - ), - backgroundColor: Color(0x33FAFAFA), - centerTitle: false, - elevation: 0, - bottom: PreferredSize( - preferredSize: Size( - MediaQuery.of(context).size.width, - 38, - ), - child: Container( - padding: EdgeInsets.symmetric(horizontal: 10.w), - width: MediaQuery.of(context).size.width, - child: TabBar( - controller: tabcontroller, - automaticIndicatorColorAdjustment: true, - isScrollable: true, - indicatorWeight: 1, - indicatorColor: Color(0xFFFAFAFA), - labelPadding: EdgeInsets.only( - left: 8.w, - right: 8.w, - ), - indicatorSize: TabBarIndicatorSize.label, - unselectedLabelStyle: TextStyle( - fontSize: 15.sp, - fontWeight: FontWeight.w400, - ), - labelStyle: TextStyle( - color: Colors.black, - fontSize: 18.sp, - fontWeight: FontWeight.bold, + backgroundColor: Color(0x33FAFAFA), + centerTitle: false, + elevation: 0, + bottom: PreferredSize( + preferredSize: Size( + MediaQuery.of(context).size.width, + 38, + ), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 10.w), + width: MediaQuery.of(context).size.width, + child: TabBar( + controller: tabcontroller, + automaticIndicatorColorAdjustment: true, + isScrollable: true, + indicatorWeight: 1, + indicatorColor: Color(0xFFFAFAFA), + labelPadding: EdgeInsets.only( + left: 8.w, + right: 8.w, + ), + indicatorSize: TabBarIndicatorSize.label, + unselectedLabelStyle: TextStyle( + fontSize: 15.sp, + fontWeight: FontWeight.w400, + ), + labelStyle: TextStyle( + color: Colors.black, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + labelColor: Colors.black, + tabs: [ + MyTab(text: S.of(context).diancan), + MyTab(text: S.of(context).xindianhuodong), + ], ), - labelColor: Colors.black, - tabs: [ - MyTab(text: S.of(context).diancan), - MyTab(text: S.of(context).xindianhuodong), - ], ), ), ), ), - ), - ]; - }, - body: TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - ///点餐 - StoreOrderListPage( - widget.arguments, - activitys, - storeInfo, - shopCarGoods, - controller, - minToken, - tenant, - _queryMiNiDetail, - ), + ]; + }, + body: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + ///点餐 + StoreOrderListPage( + widget.arguments, + activitys, + storeInfo, + shopCarGoods, + controller, + minToken, + tenant, + _queryMiNiDetail, + ), - ///星店活动, - StoreActivity( - widget.arguments, - activitys, - ), - ], - controller: tabcontroller, - ), - ), /*SmartRefresher( + ///星店活动, + StoreActivity( + widget.arguments, + activitys, + ), + ], + controller: tabcontroller, + ), + ), /*SmartRefresher( controller: refreshController = RefreshController(initialRefresh: false), enablePullDown: true, @@ -379,89 +397,90 @@ class _StoreOrderPage extends State }, child: ),*/ - ), - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Stack( - alignment: Alignment.bottomLeft, - children: [ - Container( - height: 54.h, - color: Color(0xFFFAFAFA), - child: Row( - children: [ - Spacer(), - Text( - S.of(context).heji, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, + ), + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Stack( + alignment: Alignment.bottomLeft, + children: [ + Container( + height: 54.h, + color: Color(0xFFFAFAFA), + child: Row( + children: [ + Spacer(), + Text( + S.of(context).heji, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), ), - ), - Text( - "¥${shopCarGoods != null ? shopCarGoods.cartSum : "0.0"}", - style: TextStyle( - fontSize: 20.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), + Text( + "¥${shopCarGoods != null ? shopCarGoods.cartSum : "0.0"}", + style: TextStyle( + fontSize: 20.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), ), - ), - Spacer(), - GestureDetector( + Spacer(), + GestureDetector( + onTap: () { + toDownOrder(); + }, + child: RoundButton( + width: 103.w, + height: 54.h, + text: S.current.jiesuan, + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFF32A060), + radius: 0, + fontSize: 16.sp, + padding: EdgeInsets.symmetric(vertical: 5.h), + ), + ), + ], + ), + ), + Stack( + children: [ + InkWell( onTap: () { - toDownOrder(); + showShoppingCart(); }, + child: Image.asset( + "assets/image/shopp.png", + width: 88, + height: 88, + fit: BoxFit.fitWidth, + ), + ), + Positioned( + right: 15, + top: 14, child: RoundButton( - width: 103.w, - height: 54.h, - text: S.current.jiesuan, + width: 17, + height: 17, + text: "${count()}", textColor: Colors.white, fontWeight: MyFontWeight.regular, backgroup: Color(0xFF32A060), - radius: 0, - fontSize: 16.sp, - padding: EdgeInsets.symmetric(vertical: 5.h), + fontSize: 12.sp, + radius: 100, ), ), ], ), - ), - Stack( - children: [ - InkWell( - onTap: () { - showShoppingCart(); - }, - child: Image.asset( - "assets/image/shopp.png", - width: 88, - height: 88, - fit: BoxFit.fitWidth, - ), - ), - Positioned( - right: 15, - top: 14, - child: RoundButton( - width: 17, - height: 17, - text: "${count()}", - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFF32A060), - fontSize: 12.sp, - radius: 100, - ), - ), - ], - ), - ], + ], + ), ), - ), - ], + ], + ), ), ); } @@ -536,6 +555,7 @@ class _StoreOrderPage extends State "parentCode": parentCode, "parentId": parentId, "shoppingCart": shopCarGoods, + "numberOfPeople": numberOfPeople, }, ); getParentInfo(); diff --git a/lib/store/store_view/shop_car.dart b/lib/store/store_view/shop_car.dart index 6ef893ca..1519123d 100644 --- a/lib/store/store_view/shop_car.dart +++ b/lib/store/store_view/shop_car.dart @@ -177,6 +177,7 @@ class _ShopCar extends State { Spacer(), GestureDetector( onTap: () { + SmartDialog.dismiss(); widget.toDownOrder(); }, child: RoundButton( @@ -188,8 +189,7 @@ class _ShopCar extends State { backgroup: Color(0xFF32A060), radius: 0, fontSize: 16.sp, - padding: - EdgeInsets.symmetric(vertical: 5.h), + padding: EdgeInsets.symmetric(vertical: 5.h), ), ), ], @@ -220,10 +220,9 @@ class _ShopCar extends State { backgroup: Color(0xFF32A060), fontSize: 12.sp, radius: 100, - callback: () { - // Navigator.of(context) - // .pushNamed('/router/test_page'); - }, + // callback: () { + // Navigator.of(context).pushNamed('/router/test_page'); + // }, ), ), ], diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 790c1acd..57a45d5a 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -110,9 +110,9 @@ class _ShopGoods extends State { ), Row( children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ Row( children: [ Text( @@ -127,7 +127,7 @@ class _ShopGoods extends State { width: 4, ), Text( - "¥${widget.productListBean != null ? widget.productListBean.price : widget.shoppingCartSkuItemListBean.skuPrice}", + "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice}", style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 11.sp, @@ -136,31 +136,31 @@ class _ShopGoods extends State { ), ], ), - Row( - children: [ - Text( - S.of(context).yuanjia, - style: TextStyle( - color: Color(0xFFA29E9E), - fontSize: 9.sp, - fontWeight: MyFontWeight.regular, - ), - ), - SizedBox( - width: 4, - ), - Text( - "¥${widget.productListBean != null ? widget.productListBean.applyPrice : widget.shoppingCartSkuItemListBean.skuPrice}", - style: TextStyle( - color: Color(0xFFA29E9E), - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - ), - ], - ), + // Row( + // children: [ + // Text( + // S.of(context).yuanjia, + // style: TextStyle( + // color: Color(0xFFA29E9E), + // fontSize: 9.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // SizedBox( + // width: 4, + // ), + // Text( + // "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}", + // style: TextStyle( + // color: Color(0xFFA29E9E), + // fontSize: 10.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // ], + // ), + // ], + // ), Spacer(), if (!widget.isShopCart) Stack( diff --git a/lib/store/store_view/store_info.dart b/lib/store/store_view/store_info.dart index e43ca190..e7cd4870 100644 --- a/lib/store/store_view/store_info.dart +++ b/lib/store/store_view/store_info.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; @@ -6,9 +7,9 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/round_button.dart'; +import 'package:url_launcher/url_launcher.dart'; class StoreInfoView extends StatefulWidget { - final StoreInfo storeInfo; StoreInfoView(this.storeInfo); @@ -56,7 +57,9 @@ class _StoreInfoView extends State { Container( alignment: Alignment.centerLeft, child: Text( - widget.storeInfo != null ? (widget.storeInfo.storeName ?? "") : "", + widget.storeInfo != null + ? (widget.storeInfo.storeName ?? "") + : "", overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 18.sp, @@ -68,9 +71,11 @@ class _StoreInfoView extends State { Row( children: [ Text( - S.of(context).ren(widget.storeInfo != null - ? widget.storeInfo.perCapitaConsumption - : "",), + S.of(context).ren( + widget.storeInfo != null + ? widget.storeInfo.perCapitaConsumption + : "", + ), overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 12.sp, @@ -86,7 +91,9 @@ class _StoreInfoView extends State { : "")), ), Text( - widget.storeInfo != null ? widget.storeInfo.address : "", + widget.storeInfo != null + ? widget.storeInfo.address + : "", maxLines: 2, textAlign: TextAlign.justify, style: TextStyle( @@ -103,7 +110,7 @@ class _StoreInfoView extends State { MImage( widget.storeInfo != null ? widget.storeInfo.logo : "", width: 70, - height:70, + height: 70, fit: BoxFit.cover, errorSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png", @@ -121,12 +128,12 @@ class _StoreInfoView extends State { Expanded( child: Text( S.of(context).yingyeshijian(widget.storeInfo == null - ? "" : (widget.storeInfo.openStartTime == null && - widget.storeInfo.openEndTime == null) - ? S.of(context).quantian - : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " - "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}" - ), + ? "" + : (widget.storeInfo.openStartTime == null && + widget.storeInfo.openEndTime == null) + ? S.of(context).quantian + : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " + "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"), style: TextStyle( color: Color(0xFF353535), fontWeight: MyFontWeight.regular, @@ -138,7 +145,16 @@ class _StoreInfoView extends State { width: 16.w, ), InkWell( - onTap: () {}, + onTap: () { + Navigator.of(context).pushNamed( + '/router/location_map', + arguments: { + "lat": widget.storeInfo.latitude, + "lng": widget.storeInfo.longitude, + "storeName": widget.storeInfo.storeName, + }, + ); + }, child: Image.asset( "assets/image/icon_union_location.png", width: 24.w, @@ -149,7 +165,9 @@ class _StoreInfoView extends State { width: 16.w, ), InkWell( - onTap: () {}, + onTap: () { + showCallMobile(); + }, child: Image.asset( "assets/image/icon_union_call.png", width: 24, @@ -163,6 +181,47 @@ class _StoreInfoView extends State { ); } + + showCallMobile() { + showCupertinoModalPopup( + context: context, + builder: (context) { + return CupertinoActionSheet( + title: Text(S.of(context).bodadianhua), + actions: [ + if (widget.storeInfo != null && + widget.storeInfo.tel != null && + widget.storeInfo.tel != "") + CupertinoActionSheetAction( + child: Text(widget.storeInfo.tel), + onPressed: () { + callMobile(widget.storeInfo.tel); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + ], + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(S.of(context).quxiao), + isDestructiveAction: true, + ), + ); + }); + } + + callMobile(mobile) async { + String url = "tel:$mobile"; + if (await canLaunch(url)) { + await launch(url); + } else { + throw 'Could not launch $url'; + } + } + List itemServer(String businessService) { if (businessService == null || businessService == "") return []; var list = businessService.split(","); diff --git a/pubspec.lock b/pubspec.lock index 418f36f6..69f32184 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -263,13 +263,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.11" - flutter_scankit: - dependency: "direct main" - description: - name: flutter_scankit - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.2.0" flutter_screenutil: dependency: "direct main" description: @@ -581,6 +574,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" + qrscan: + dependency: "direct main" + description: + name: qrscan + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.2" quiver: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b315fcaa..42981c5c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -58,7 +58,8 @@ dependencies: #多图, 裁剪 image_pickers: ^2.0.0 - flutter_scankit: ^1.2.0 +# flutter_scankit: ^1.2.0 + qrscan: ^0.3.2 path_provider: ^1.2.0 cached_network_image: ^2.0.0 From e123367e1174dec655331045bf8f55bc15f69cdf Mon Sep 17 00:00:00 2001 From: fmk Date: Tue, 26 Oct 2021 18:49:43 +0800 Subject: [PATCH 2/3] safety --- lib/retrofit/data/base_data.g.dart | 37 + lib/retrofit/data/page.g.dart | 41 + lib/retrofit/min_api.g.dart | 403 +++++++++ lib/retrofit/retrofit_api.g.dart | 1348 ++++++++++++++++++++++++++++ 4 files changed, 1829 insertions(+) create mode 100644 lib/retrofit/data/base_data.g.dart create mode 100644 lib/retrofit/data/page.g.dart create mode 100644 lib/retrofit/min_api.g.dart create mode 100644 lib/retrofit/retrofit_api.g.dart diff --git a/lib/retrofit/data/base_data.g.dart b/lib/retrofit/data/base_data.g.dart new file mode 100644 index 00000000..3a4ba372 --- /dev/null +++ b/lib/retrofit/data/base_data.g.dart @@ -0,0 +1,37 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_data.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseData _$BaseDataFromJson( + Map json, + T Function(Object json) fromJsonT, +) { + return BaseData() + ..code = json['code'] as int + ..data = fromJsonT(json['data']) + ..extra = json['extra'] + ..isError = json['isError'] as bool + ..isSuccess = json['isSuccess'] as bool + ..msg = json['msg'] as String + ..path = json['path'] as String + ..timestamp = json['timestamp'] as String; +} + +Map _$BaseDataToJson( + BaseData instance, + Object Function(T value) toJsonT, +) => + { + 'code': instance.code, + 'data': toJsonT(instance.data), + 'extra': instance.extra, + 'isError': instance.isError, + 'isSuccess': instance.isSuccess, + 'msg': instance.msg, + 'path': instance.path, + 'timestamp': instance.timestamp, + }; diff --git a/lib/retrofit/data/page.g.dart b/lib/retrofit/data/page.g.dart new file mode 100644 index 00000000..e40a14ae --- /dev/null +++ b/lib/retrofit/data/page.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'page.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PageInfo _$PageInfoFromJson( + Map json, + D Function(Object json) fromJsonD, +) { + return PageInfo() + ..pageNum = json['pageNum'] as int + ..current = json['current'] + ..pageSize = json['pageSize'] as int + ..size = json['size'] + ..pages = json['pages'] + ..hasPreviousPage = json['hasPreviousPage'] as bool + ..hasNextPage = json['hasNextPage'] as bool + ..total = json['total'] as String + ..list = (json['list'] as List)?.map(fromJsonD)?.toList() + ..records = (json['records'] as List)?.map(fromJsonD)?.toList(); +} + +Map _$PageInfoToJson( + PageInfo instance, + Object Function(D value) toJsonD, +) => + { + 'pageNum': instance.pageNum, + 'current': instance.current, + 'pageSize': instance.pageSize, + 'size': instance.size, + 'pages': instance.pages, + 'hasPreviousPage': instance.hasPreviousPage, + 'hasNextPage': instance.hasNextPage, + 'total': instance.total, + 'list': instance.list?.map(toJsonD)?.toList(), + 'records': instance.records?.map(toJsonD)?.toList(), + }; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart new file mode 100644 index 00000000..1c1cc751 --- /dev/null +++ b/lib/retrofit/min_api.g.dart @@ -0,0 +1,403 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'min_api.dart'; + +// ************************************************************************** +// RetrofitGenerator +// ************************************************************************** + +class _MinApiService implements MinApiService { + _MinApiService(this._dio, {this.baseUrl}) { + ArgumentError.checkNotNull(_dio, '_dio'); + baseUrl ??= 'http://192.168.10.236:8765/app/'; + } + + final Dio _dio; + + String baseUrl; + + @override + Future> memberInfo() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/info', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> findMiNiGroupList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'product/findMiNiGroupList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => FindMiNiGroupList.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> miNiDetail(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/product/queryMiNiProductDetail?id=$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => MiNiDetail.fromJson(json), + ); + return value; + } + + @override + Future>> addShoppingCart(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('shoppingcart', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => ShoppingCart.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future>> getShoppingCart(tableId) async { + ArgumentError.checkNotNull(tableId, 'tableId'); + const _extra = {}; + final queryParameters = {r'tableId': tableId}; + final _data = {}; + final _result = await _dio.request>('shoppingcart', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => ShoppingCart.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> clearShoppingCart() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'shoppingcart/delCart', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as bool, + ); + return value; + } + + @override + Future>> shoppingCart1(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('shoppingcart', + queryParameters: queryParameters, + options: RequestOptions( + method: 'PUT', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => ShoppingCart.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future>> shoppingCartSingle(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'shoppingcart/single', + queryParameters: queryParameters, + options: RequestOptions( + method: 'PUT', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map( + (i) => ShoppingCart.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> getOrderInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'order/getOrderInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => SettleOrderInfo.fromJson(json), + ); + return value; + } + + @override + Future> getOrderDetails(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'order/getOrderDetail', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => MinOrderInfo.fromJson(json), + ); + return value; + } + + @override + Future>> queryAddress() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'address/queryMemberAddress', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map
((i) => Address.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> placeOrderFirst(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + 'order/placeOrderFirst', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => DownOrder.fromJson(json), + ); + return value; + } + + @override + Future> addOrder(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('order/addOrder', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => DownOrder.fromJson(json), + ); + return value; + } + + @override + Future> settlementWx(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('order/settlement', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => WxPay.fromJson(json), + ); + return value; + } + + @override + Future> settlementApi(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('order/settlement', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> queryStoreInfo1(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('store/getStore', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> getParentInfo(tableId) async { + ArgumentError.checkNotNull(tableId, 'tableId'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + 'order/getParentInfo?tableId=$tableId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } +} diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart new file mode 100644 index 00000000..1024cdf2 --- /dev/null +++ b/lib/retrofit/retrofit_api.g.dart @@ -0,0 +1,1348 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'retrofit_api.dart'; + +// ************************************************************************** +// RetrofitGenerator +// ************************************************************************** + +class _ApiService implements ApiService { + _ApiService(this._dio, {this.baseUrl}) { + ArgumentError.checkNotNull(_dio, '_dio'); + baseUrl ??= 'http://192.168.10.236:8766/app/'; + } + + final Dio _dio; + + String baseUrl; + + @override + Future> upload(data, folderId) async { + ArgumentError.checkNotNull(data, 'data'); + ArgumentError.checkNotNull(folderId, 'folderId'); + const _extra = {}; + final queryParameters = {}; + final _data = FormData(); + _data.files.add(MapEntry( + 'file', + MultipartFile.fromFileSync(data.path, + filename: data.path.split(Platform.pathSeparator).last))); + if (folderId != null) { + _data.fields.add(MapEntry('folderId', folderId.toString())); + } + final _result = await _dio.request>('/file/upload', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => UploadResult.fromJson(json), + ); + return value; + } + + @override + Future searchPoi(lat, lng, keywords, size, page) async { + ArgumentError.checkNotNull(lat, 'lat'); + ArgumentError.checkNotNull(lng, 'lng'); + ArgumentError.checkNotNull(keywords, 'keywords'); + ArgumentError.checkNotNull(size, 'size'); + ArgumentError.checkNotNull(page, 'page'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request( + 'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = _result.data; + return value; + } + + @override + Future> memberLogin(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/auth/platform/memberLogin', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> sendVerify(mobile) async { + ArgumentError.checkNotNull(mobile, 'mobile'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/auth/sendVerify/$mobile', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> creditGoods(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/creditGoods/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => Goods.fromJson(json), + ), + ); + return value; + } + + @override + Future>> goodsCategory(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/creditGoodsCategory/page', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => GoodsCategory.fromJson(json), + ), + ); + return value; + } + + @override + Future> creditGoodsById(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/creditGoods/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => Goods.fromJson(json), + ); + return value; + } + + @override + Future> queryInfo() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/info', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => UserInfo.fromJson(json), + ); + return value; + } + + @override + Future> editInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/member/editMemberInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> signInInfo() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/member/signInInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => SignInfo.fromJson(json), + ); + return value; + } + + @override + Future> signIn() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/signIn', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> recharge(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/wallet/recharge', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => WxPay.fromJson(json), + ); + return value; + } + + @override + Future> receiveCoupon(couponId) async { + ArgumentError.checkNotNull(couponId, 'couponId'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/coupon/receive?couponId=$couponId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> creditOrderList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/creditOrder/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => ExchangeOrder.fromJson(json), + ), + ); + return value; + } + + @override + Future> creditOrder(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/creditOrder/create', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> addAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/address/add', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> deleteAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/address/delete', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> queryAddress(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/address/detail/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> queryMemberAddress() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/address/queryMemberAddress', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map
((i) => Address.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> updateAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/address/update', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> queryCoupon(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/coupon/centreList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => Coupon.fromJson(json), + ), + ); + return value; + } + + @override + Future>> queryCard(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/coupon/packageList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => Coupon.fromJson(json), + ), + ); + return value; + } + + @override + Future>> queryStore(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/store/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map((i) => Store.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future>> informationList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/information/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => Activity.fromJson(json), + ), + ); + return value; + } + + @override + Future> informationInfo(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/information/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData
.fromJson( + _result.data, + (json) => Article.fromJson(json), + ); + return value; + } + + @override + Future> activityInfo(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/information/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => Activity.fromJson(json), + ); + return value; + } + + @override + Future> creditOrderReceive(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/creditOrder/receive/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> queryHome() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/home/home', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => BrandData.fromJson(json), + ); + return value; + } + + @override + Future> queryStoreInfo(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/store/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> queryArticle(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/information/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo
.fromJson( + json, + (json) => Article.fromJson(json), + ), + ); + return value; + } + + @override + Future>> queryBanner(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/banner/page', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => BannerData.fromJson(json), + ), + ); + return value; + } + + @override + Future> queryHomeBrand() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/home/brand', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> minLogin(storeId) async { + ArgumentError.checkNotNull(storeId, 'storeId'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/auth/mini/login/$storeId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> queryBillInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/member/listBill', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => UserBill.fromJson(json), + ), + ); + return value; + } + + @override + Future>> rankList() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/rankList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map((i) => Rank.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future>> orderList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/order/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => OrderInfo.fromJson(json), + ), + ); + return value; + } + + @override + Future> orderDetail(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/order/orderDetail?id=$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => OrderInfo.fromJson(json), + ); + return value; + } + + @override + Future> continuePay(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/order/continuePay', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> receiveToCard(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/creditOrder/receive/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> vipList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/member/vipList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map((i) => VipCard.fromJson(i as Map)) + .toList()); + return value; + } + + @override + Future> vipDetail(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/member/vipDetail', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => VipCard.fromJson(json), + ); + return value; + } + + @override + Future>> msgList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/app-msg/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => Message.fromJson(json), + ), + ); + return value; + } + + @override + Future> queryMsg(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/app-msg/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> informationLikes(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/information/likes/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> memberComment(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/memberComment', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future>> memberCommentList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/memberComment/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => MemberCommentList.fromJson(json), + ), + ); + return value; + } + + @override + Future> commentLike(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/memberComment/likes/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> delComment(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/memberComment/delete/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> shippingTrace(shipperCode, logisticCode) async { + ArgumentError.checkNotNull(shipperCode, 'shipperCode'); + ArgumentError.checkNotNull(logisticCode, 'logisticCode'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/order/getShippingTrace/$shipperCode/$logisticCode', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => Logistics.fromJson(json), + ); + return value; + } + + @override + Future> report(map) async { + ArgumentError.checkNotNull(map, 'map'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(map ?? {}); + final _result = await _dio.request>('/other/report', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as bool, + ); + return value; + } + + @override + Future> orderCancel(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/order/cancel/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as bool, + ); + return value; + } + + @override + Future> settlement(map) async { + ArgumentError.checkNotNull(map, 'map'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/order/settlement', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as String, + ); + return value; + } + + @override + Future> trend(map) async { + ArgumentError.checkNotNull(map, 'map'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/information/trend', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as bool, + ); + return value; + } + + @override + Future>> trendList(map) async { + ArgumentError.checkNotNull(map, 'map'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/information/trend-list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => ComunityComment.fromJson(json), + ), + ); + return value; + } + + @override + Future>> followList(map) async { + ArgumentError.checkNotNull(map, 'map'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/member/follow/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => ListData.fromJson(json), + ), + ); + return value; + } + + @override + Future> follow(followId) async { + ArgumentError.checkNotNull(followId, 'followId'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/member/follow/$followId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'PUT', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> deleteTrend(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/information/trend/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'DELETE', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => json as dynamic, + ); + return value; + } + + @override + Future> socialInfo() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/member/socialInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => SocialInfo.fromJson(json), + ); + return value; + } +} From f82d54df81485cd7e5474719abc2203462c2c496 Mon Sep 17 00:00:00 2001 From: fmk Date: Tue, 26 Oct 2021 19:15:09 +0800 Subject: [PATCH 3/3] safety --- lib/store/store_view/shop_goods.dart | 2 +- lib/web/web_page.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 57a45d5a..d3d97bb1 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -127,7 +127,7 @@ class _ShopGoods extends State { width: 4, ), Text( - "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice}", + "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}", style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 11.sp, diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index c5fc53be..2b45d671 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -271,7 +271,7 @@ class _WebPage extends State with WidgetsBindingObserver { /// 富文本的评论 CommentList( commentKey, - article?.likes ?? activity?.likes ?? "0", + article?.likes ?? "${activity?.likes}" ?? "0", article?.id ?? activity?.id, isKeyBoardShow, _reply,