Browse Source

Merge branch 'master' into dev

master
w-R 3 years ago
parent
commit
b55247f481
  1. 22
      README.md
  2. 80
      ios/Podfile.lock
  3. 49
      ios/Runner.xcodeproj/project.pbxproj
  4. 13
      lib/community/community_child_page.dart
  5. 265
      lib/community/community_details.dart
  6. 2
      lib/community/community_page.dart
  7. 176
      lib/community/community_view/community_dynamic.dart
  8. 29
      lib/community/release_dynamic.dart
  9. 1
      lib/home/huixiang_brand_page.dart
  10. 9
      lib/integral_store/integral_store_details_page.dart
  11. 3
      lib/main.dart
  12. 4
      lib/main_page.dart
  13. 20
      lib/mine/mine_page.dart
  14. 24
      lib/mine/mine_view/mine_view.dart
  15. 13
      lib/mine/recharge_page.dart
  16. 24
      lib/mine/vip_detail_page.dart
  17. 105
      lib/order/order_detail_page.dart
  18. 116
      lib/order/order_history_page.dart
  19. 84
      lib/order/order_utils.dart
  20. 166
      lib/order/order_view/order_address.dart
  21. 82
      lib/order/order_view/order_commodity.dart
  22. 147
      lib/order/order_view/order_pay_selected.dart
  23. 117
      lib/qr/qr_code_scan.dart
  24. 10
      lib/retrofit/data/comunity_comment.dart
  25. 135
      lib/retrofit/data/down_order.dart
  26. 713
      lib/retrofit/data/min_order_info.dart
  27. 1624
      lib/retrofit/data/order_info.dart
  28. 388
      lib/retrofit/data/order_product_vo.dart
  29. 619
      lib/retrofit/data/placeOrderFirst.dart
  30. 182
      lib/retrofit/data/product.dart
  31. 743
      lib/retrofit/data/settlement_bean.dart
  32. 20
      lib/retrofit/data/shoppingCart.dart
  33. 49
      lib/retrofit/data/store_info.dart
  34. 70
      lib/retrofit/min_api.dart
  35. 241
      lib/retrofit/min_api.g.dart
  36. 16
      lib/retrofit/retrofit_api.dart
  37. 3
      lib/retrofit/retrofit_api.g.dart
  38. 519
      lib/settlement/settlement.dart
  39. 165
      lib/settlement/settlement_view/activity.dart
  40. 203
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  41. 268
      lib/settlement/settlement_view/coupon.dart
  42. 357
      lib/settlement/settlement_view/distribution.dart
  43. 150
      lib/settlement/settlement_view/edit_phone.dart
  44. 163
      lib/settlement/settlement_view/pay_method.dart
  45. 174
      lib/settlement/settlement_view/settlement_activity.dart
  46. 166
      lib/settlement/settlement_view/settlement_coupon.dart
  47. 98
      lib/settlement/settlement_view/settlement_order_commodity.dart
  48. 53
      lib/store/scan.dart
  49. 594
      lib/store/store_order.dart
  50. 139
      lib/store/store_view/people_num.dart
  51. 116
      lib/store/store_view/product_sku.dart
  52. 1338
      lib/store/store_view/settlement.dart
  53. 182
      lib/store/store_view/shop_car.dart
  54. 111
      lib/store/store_view/shop_goods.dart
  55. 15
      lib/store/store_view/store_activity.dart
  56. 102
      lib/store/store_view/store_order_list.dart
  57. 17
      lib/union/union_page.dart
  58. 14
      lib/utils/flutter_utils.dart
  59. 16
      lib/utils/location.dart
  60. 29
      lib/view_widget/custom_image.dart
  61. 19
      lib/view_widget/no_data_view.dart
  62. 26
      lib/view_widget/selector_store_dialog.dart
  63. 16
      lib/web/web_page.dart
  64. 15
      lib/web/web_view/comment_list.dart
  65. 104
      lib/web/web_view/web_content.dart
  66. 27
      lib/web/web_view/web_header.dart
  67. 318
      pubspec.lock
  68. 34
      pubspec.yaml

22
README.md

@ -16,7 +16,7 @@ For help getting started with Flutter, view our
samples, guidance on mobile development, and a full API reference.
#1.0
登录页
发送验证码
@ -64,3 +64,23 @@ samples, guidance on mobile development, and a full API reference.
订单详情 (订单生成时间)
取消订单
取件码
#说明
huixiang_app/pubspec.yaml #依赖
接口build 依赖(注释了) 命令: 项目根目录 > flutter pub run build_runner build
# retrofit_generator: ^1.4.1+3
# build_runner: ^1.11.5
# json_serializable: ^3.5.1
http接口需要build生成 需要上面3个依赖
min_api.dart 调用小程序的接口
retrofit_api.dart 调用app的接口
main.dart 程序入口 三方sdk初始化 路由
华为开放平台 15827991714 密码: fmk7895123654 (有问题➕手机号码微信)
小米开放平台 83364300@qq.com 具体问 :(汪姐)
推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey)

80
ios/Podfile.lock

@ -1,4 +1,19 @@
PODS:
- AFNetworking (4.0.1):
- AFNetworking/NSURLSession (= 4.0.1)
- AFNetworking/Reachability (= 4.0.1)
- AFNetworking/Security (= 4.0.1)
- AFNetworking/Serialization (= 4.0.1)
- AFNetworking/UIKit (= 4.0.1)
- AFNetworking/NSURLSession (4.0.1):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (4.0.1)
- AFNetworking/Security (4.0.1)
- AFNetworking/Serialization (4.0.1)
- AFNetworking/UIKit (4.0.1):
- AFNetworking/NSURLSession
- BaiduMapKit/Base (6.2.0)
- BaiduMapKit/Map (6.2.0):
- BaiduMapKit/Base
@ -26,18 +41,19 @@ PODS:
- flutter_bmflocation (1.0.3):
- BMKLocationKit
- Flutter
- flutter_qr_reader (0.0.1):
- flutter_scankit (0.0.1):
- Flutter
- ScanKitFrameWork (~> 1.0.2.300)
- fluwx (0.0.1):
- Flutter
- WechatOpenSDK_Fuck (~> 1.9.2)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- image_cropper (0.0.4):
- Flutter
- TOCropViewController (~> 2.6.0)
- image_picker (0.0.1):
- image_pickers (0.0.1):
- AFNetworking
- Flutter
- ZLPhotoBrowser-objc (= 1.0.4)
- mob_sharesdk (4.4.0):
- mob_sharesdk/ShareSDK (= 4.4.0)
- MOBFoundation (>= 3.2.9)
@ -68,6 +84,10 @@ 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)
- shared_preferences (0.0.1):
- Flutter
- sharesdk_plugin (1.1.2):
@ -83,7 +103,8 @@ PODS:
- Flutter
- FMDB (>= 2.7.5)
- SSZipArchive (2.4.2)
- TOCropViewController (2.6.0)
- thumbnails (0.0.1):
- Flutter
- TPNS-iOS (1.3.3.0)
- tpns_flutter_plugin (1.1.2):
- Flutter
@ -96,6 +117,9 @@ PODS:
- Flutter
- webview_flutter (0.0.1):
- Flutter
- WechatOpenSDK_Fuck (1.9.2)
- ZLPhotoBrowser-objc (1.0.4):
- SDWebImage
DEPENDENCIES:
- Flutter (from `Flutter`)
@ -104,10 +128,9 @@ 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_qr_reader (from `.symlinks/plugins/flutter_qr_reader/ios`)
- flutter_scankit (from `.symlinks/plugins/flutter_scankit/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- image_pickers (from `.symlinks/plugins/image_pickers/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
@ -115,6 +138,7 @@ DEPENDENCIES:
- sharesdk_plugin (from `.symlinks/plugins/sharesdk_plugin/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- SSZipArchive (~> 2.4.2)
- thumbnails (from `.symlinks/plugins/thumbnails/ios`)
- tpns_flutter_plugin (from `.symlinks/plugins/tpns_flutter_plugin/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- video_player (from `.symlinks/plugins/video_player/ios`)
@ -123,14 +147,18 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- AFNetworking
- BaiduMapKit
- BMKLocationKit
- FMDB
- mob_sharesdk
- MOBFoundation
- ScanKitFrameWork
- SDWebImage
- SSZipArchive
- TOCropViewController
- TPNS-iOS
- WechatOpenSDK_Fuck
- ZLPhotoBrowser-objc
EXTERNAL SOURCES:
Flutter:
@ -145,14 +173,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios"
flutter_bmflocation:
:path: ".symlinks/plugins/flutter_bmflocation/ios"
flutter_qr_reader:
:path: ".symlinks/plugins/flutter_qr_reader/ios"
flutter_scankit:
:path: ".symlinks/plugins/flutter_scankit/ios"
fluwx:
:path: ".symlinks/plugins/fluwx/ios"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker:
:path: ".symlinks/plugins/image_picker/ios"
image_pickers:
:path: ".symlinks/plugins/image_pickers/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider:
@ -165,6 +191,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sharesdk_plugin/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
thumbnails:
:path: ".symlinks/plugins/thumbnails/ios"
tpns_flutter_plugin:
:path: ".symlinks/plugins/tpns_flutter_plugin/ios"
url_launcher:
@ -177,6 +205,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter/ios"
SPEC CHECKSUMS:
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8
BMKLocationKit: 097814ef672b1e57e86e6c1968d7892fb78002bf
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
@ -185,28 +214,31 @@ SPEC CHECKSUMS:
flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d
flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a
flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c
flutter_qr_reader: d930dde3b2cfe2b3d0bb7d66e5ff3e514300a5e5
fluwx: c64c2b84b965279aaa251a80b5b6a1cd0ef7bd45
flutter_scankit: 16936d86b3de3f83c122e763f4c24c5da214c78f
fluwx: c192ef1ea3617badb813fa1a761ffc5c9c12208a
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
image_pickers: 5e6ec7083f9363d014c0fb061f1b9cd97bb5e451
mob_sharesdk: c771f001e00739d24301a9fa250247601efe7a3c
MOBFoundation: 2abd23c80c33d1337d30dc4b0018ed914cef8f8e
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
ScanKitFrameWork: 0ad578f3db0ef9b64dd0f533d10d10a52ce93c80
SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sharesdk_plugin: 6d6634bb480174b607030f19fc9d84d68cfbf326
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SSZipArchive: e7b4f3d9e780c2acc1764cd88fbf2de28f26e5b2
TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38
thumbnails: bb4f4e9bb4b51c8ae4e6ad9a2fa81373f9b634ad
TPNS-iOS: 57a146496858ba2fb5d43e5f240feb19243b69cb
tpns_flutter_plugin: a366649c8ad71f19dfb864d3c994ed0480b69daa
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
wakelock: bfc7955c418d0db797614075aabbc58a39ab5107
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
webview_flutter: 3603125dfd3bcbc9d8d418c3f80aeecf331c068b
WechatOpenSDK_Fuck: aa8f4b0af902837e887a1d40c62f06c060c1dc98
ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736
PODFILE CHECKSUM: 7092aa3092b9508e0ccea9e76cd5fa33505dbb46
COCOAPODS: 1.10.1
COCOAPODS: 1.11.2

49
ios/Runner.xcodeproj/project.pbxproj

@ -657,6 +657,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
120EAF7195D9AB3BB1E8FA2B /* [CP] Copy Pods Resources */,
8ADBB1E9F51ACB25060865A4 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -763,6 +764,23 @@
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;
@ -892,7 +910,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@ -935,8 +953,7 @@
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_search\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_map\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_base\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/image_pickers\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"",
"\"${PODS_ROOT}/Headers/Public/permission_handler\"",
"\"${PODS_ROOT}/Headers/Public/shared_preferences\"",
@ -949,6 +966,7 @@
"\"${PODS_ROOT}/Headers/Private/fluwx\"",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -961,13 +979,12 @@
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.38;
ONLY_ACTIVE_ARCH = NO;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-l\"c++\"",
"-l\"image_cropper\"",
"-l\"image_picker\"",
"-l\"image_pickers\"",
"-l\"path_provider\"",
"-l\"flutter_bmflocation\"",
"-l\"flutter_baidu_mapapi_utils\"",
@ -1078,7 +1095,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -1128,7 +1145,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@ -1171,8 +1188,7 @@
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_search\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_map\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_base\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/image_pickers\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"",
"\"${PODS_ROOT}/Headers/Public/permission_handler\"",
"\"${PODS_ROOT}/Headers/Public/shared_preferences\"",
@ -1185,6 +1201,7 @@
"\"${PODS_ROOT}/Headers/Private/fluwx\"",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -1202,8 +1219,7 @@
"$(inherited)",
"-ObjC",
"-l\"c++\"",
"-l\"image_cropper\"",
"-l\"image_picker\"",
"-l\"image_pickers\"",
"-l\"path_provider\"",
"-l\"flutter_bmflocation\"",
"-l\"flutter_baidu_mapapi_utils\"",
@ -1300,8 +1316,7 @@
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_search\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_map\"",
"\"${PODS_ROOT}/Headers/Public/flutter_baidu_mapapi_base\"",
"\"${PODS_ROOT}/Headers/Public/image_cropper\"",
"\"${PODS_ROOT}/Headers/Public/image_picker\"",
"\"${PODS_ROOT}/Headers/Public/image_pickers\"",
"\"${PODS_ROOT}/Headers/Public/path_provider\"",
"\"${PODS_ROOT}/Headers/Public/permission_handler\"",
"\"${PODS_ROOT}/Headers/Public/shared_preferences\"",
@ -1314,6 +1329,7 @@
"\"${PODS_ROOT}/Headers/Private/fluwx\"",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -1326,13 +1342,12 @@
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.38;
ONLY_ACTIVE_ARCH = NO;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-l\"c++\"",
"-l\"image_cropper\"",
"-l\"image_picker\"",
"-l\"image_pickers\"",
"-l\"path_provider\"",
"-l\"flutter_bmflocation\"",
"-l\"flutter_baidu_mapapi_utils\"",

13
lib/community/community_child_page.dart

@ -100,10 +100,14 @@ class _CommunityChildPage extends State<CommunityChildPage> {
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
child: CommunityDynamic(comments[position],0,
child: CommunityDynamic(
comments[position],
0,
isList: true,
exitFull: () {
_onRefresh();
},),
setState(() {});
},
),
onTap: () {
Navigator.of(context).pushNamed(
'/router/community_details',
@ -115,7 +119,8 @@ class _CommunityChildPage extends State<CommunityChildPage> {
);
},
itemCount: comments.length,
));
),
);
},
);
}

265
lib/community/community_details.dart

@ -15,7 +15,9 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/comment_menu.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:huixiang/web/web_view/comment_list.dart';
import 'package:huixiang/web/web_view/input_comment.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -30,8 +32,7 @@ class CommunityDetails extends StatefulWidget {
}
}
class _CommunityDetails extends State<CommunityDetails>
with WidgetsBindingObserver {
class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObserver {
double height = 0;
double commentHeight = 60.h;
ComunityComment comunity;
@ -48,20 +49,24 @@ class _CommunityDetails extends State<CommunityDetails>
int commentTotal = 0;
Article article;
@override
void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (MediaQuery
.of(context)
.viewInsets
.bottom == 0) {
if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode());
if (mounted)
setState(() {
hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false;
});
}
} else {
if (mounted)
setState(() {
isKeyBoardShow = true;
});
@ -83,150 +88,65 @@ class _CommunityDetails extends State<CommunityDetails>
queryDetails() async {
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
BaseData<Article> baseData = await apiService
.informationInfo(comunity.id)
.catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
}
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
BaseData<Article> baseData = await apiService.informationInfo(comunity.id)
.catchError((onError) {
debugPrint(onError.toString());
});
if (baseData != null && baseData.isSuccess) {}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: "动态详情",
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.white,
leading: true,
leadingColor: Colors.black,
),
body: Container(
child: Column(
children: [
Expanded(
child: NestedScrollView(
headerSliverBuilder: (context, position) {
return [
SliverOverlapAbsorber(
handle:
NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver: SliverAppBar(
expandedHeight: (height == 0) ? 614 : height,
pinned: true,
backgroundColor: Colors.white,
title: Text(
"动态详情",
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
),
),
elevation: 0,
leading: GestureDetector(
onTap: () {
Navigator.of(context).pop();
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
CommunityDynamic(
comunity,
0,
exitFull: () {
setState(() {});
},
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(
//Colors.white,
background: Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top +
kToolbarHeight,
),
color: Colors.white,
child: CommunityDynamic(
comunity,0,exitFull: (){setState(() {
});},
itemCount: 3,
isDetails: true,
heightFun: (height) {
this.height = height +
MediaQuery.of(context).padding.top +
MediaQuery
.of(context)
.padding
.top +
kToolbarHeight +
24;
setState(() {});
if (mounted) setState(() {});
},
),
CommentList(
commentKey,
"${comunity?.likes ?? comunity?.likes ?? "0"}",
comunity.id,
isKeyBoardShow,
_reply,
_delCommentTips,
12.sp,
),
collapseMode: CollapseMode.pin,
),
bottom: PreferredSize(
preferredSize: Size(
MediaQuery.of(context).size.width,
46,
),
child: Container(
padding: EdgeInsets.all(16),
margin: EdgeInsets.only(top: 16.h),
color: Colors.white,
child: Row(
children: [
Text(
S.of(context).pinglun_(commentTotal.toString()),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xff1A1A1A),
),
),
SizedBox(
width: 16.w,
),
Text(
S.of(context).xihuan_(
"${comunity?.likes ?? comunity?.likes ?? "0"}"),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xff1A1A1A),
),
),
],
),
),
),
),
),
];
},
body: Container(
height: MediaQuery.of(context).size.height -
MediaQuery.of(context).padding.top +
kToolbarHeight - 68,
margin: EdgeInsets.only(top: 50 + kToolbarHeight),
child: Column(
children: [
if (memberList != null && memberList.length > 0)
Expanded(child: ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: memberList != null ? memberList.length : 0,
scrollDirection: Axis.vertical,
itemBuilder: (context, position) {
return Material(
color: Colors.white,
child: InkWell(
onTap: () {
showPressMenu(memberList[position].createUser,
memberList[position]);
},
child: CommunityComment(
memberList[position],
_queryCommentLike,
(memberList.length-1 == position)?1:0
),
),
);
},
)),
if (memberList == null || memberList.length == 0)
Container(
width: double.infinity,
@ -234,7 +154,9 @@ class _CommunityDetails extends State<CommunityDetails>
margin: EdgeInsets.only(top: 40),
padding: EdgeInsets.all(22.h),
child: Text(
S.of(context).zanwupinglun,
S
.of(context)
.zanwupinglun,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
@ -245,7 +167,6 @@ class _CommunityDetails extends State<CommunityDetails>
],
),
),
),
flex: 1,
),
@ -262,18 +183,21 @@ class _CommunityDetails extends State<CommunityDetails>
isLike: comunity.selfLike,
),
],
)));
),
),
);
}
////
_queryInformationLikes() async {
BaseData baseData = await apiService.informationLikes(comunity.id);
if (baseData != null && baseData.isSuccess) {
// commentKey.currentState.setState(() {});
commentKey.currentState.setState(() {});
setState(() {
if (comunity.selfLike ?? false)
comunity.likes -= 1;
else comunity.likes += 1;
else
comunity.likes += 1;
comunity.selfLike = !comunity.selfLike ?? false;
});
} else {
@ -290,7 +214,7 @@ class _CommunityDetails extends State<CommunityDetails>
"relationalType": 1
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
// commentKey.currentState.initState();
commentKey.currentState.initState();
commentTextController.text = "";
FocusScope.of(context).unfocus();
_queryMemberCommentList();
@ -305,49 +229,34 @@ class _CommunityDetails extends State<CommunityDetails>
scrollController.animateTo(
first.dy +
scrollController.offset -
(kToolbarHeight + MediaQuery.of(context).padding.top),
(kToolbarHeight + MediaQuery
.of(context)
.padding
.top),
duration: Duration(milliseconds: 300),
curve: Curves.easeIn);
curve: Curves.easeIn,
);
}
final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController();
contentHeight() {
double contentHeight = MediaQuery.of(context).size.height -
double contentHeight = MediaQuery
.of(context)
.size
.height -
kToolbarHeight -
MediaQuery.of(context).padding.top -
MediaQuery
.of(context)
.padding
.top -
160.h;
if ((contentHeight - 60.h) > (128.h * memberList.length)) {
commentHeight = contentHeight - (128.h * memberList.length);
}
}
showPressMenu(String userId, memberComment) {
if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode());
return;
}
SharedPreferences.getInstance().then((value) {
SmartDialog.show(
widget: CommentMenu(
(type) {
SmartDialog.dismiss();
if (type == "huifu") {
_reply(memberComment);
} else if (type == "shanchu") {
_delCommentTips();
}
},
isSelf: userId == value.getString("userId"),
),
alignmentTemp: Alignment.bottomCenter,
isUseAnimationTemp: true,
animationDurationTemp: Duration(milliseconds: 300),
);
});
}
///
_delCommentTips() {
SmartDialog.show(widget: Tips(() {
@ -359,7 +268,7 @@ class _CommunityDetails extends State<CommunityDetails>
delComment() async {
BaseData baseData = await apiService.delComment("");
if (baseData != null && baseData.isSuccess) {
// commentKey.currentState.initState();
commentKey.currentState.initState();
}
}
@ -370,30 +279,6 @@ class _CommunityDetails extends State<CommunityDetails>
hintText = S.of(context).huifu_("${memberComment.username}");
}
///
_queryCommentLike(String id) async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
String token = sharedPreferences.getString("token");
if (token == null || token == "") {
LoginTipsDialog().show(context);
return;
}
BaseData baseData = await apiService.commentLike(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
memberList.forEach((element) {
if (element.id == id) {
if (element.liked) {
element.likes -= 1;
element.liked = false;
} else {
element.likes += 1;
element.liked = true;
}
}
});
}
}
///
_queryMemberCommentList() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
@ -415,7 +300,7 @@ class _CommunityDetails extends State<CommunityDetails>
commentTotal = baseData.data.size;
memberList = baseData.data.list;
contentHeight();
setState(() {});
if (mounted) setState(() {});
}
}
}

2
lib/community/community_page.dart

@ -32,7 +32,7 @@ class _CommunityPage extends State<CommunityPage>
super.initState();
if (tabcontroller == null)
tabcontroller = TabController(length: lables.length, vsync: this);
tabcontroller = TabController(length: lables.length, vsync: this, initialIndex: 1);
}
_toRelease() async {

176
lib/community/community_view/community_dynamic.dart

@ -1,3 +1,6 @@
import 'dart:io';
import 'dart:ui';
import 'package:chewie/chewie.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
@ -12,8 +15,10 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:video_player/video_player.dart';
import 'package:thumbnails/thumbnails.dart';
class CommunityDynamic extends StatefulWidget {
final int itemCount;
@ -22,7 +27,7 @@ class CommunityDynamic extends StatefulWidget {
final int commentType;
final Function removalDynamic;
final Function exitFull;
final bool isList;
final ComunityComment comment;
CommunityDynamic(
@ -33,7 +38,8 @@ class CommunityDynamic extends StatefulWidget {
this.heightFun,
this.isDetails = false,
this.removalDynamic,
this.exitFull
this.exitFull,
this.isList = false,
}) : super(key: key);
@override
@ -47,14 +53,62 @@ class _CommunityDynamic extends State<CommunityDynamic> {
double height = 0;
ApiService apiService;
VideoPlayerController videoPlayerController;
ChewieController chewieAudioController;
Chewie chewies;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
SharedPreferences.getInstance().then(
(value) => {
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
),
},
);
initVideo();
}
String filePath;
initVideo() async {
if (widget.comment.subjectInfo.type == "video" &&
widget.comment.subjectInfo.video.isNotEmpty) {
if (widget.isList) {
videoPlayerController = VideoPlayerController.network(
widget.comment.subjectInfo.video,
)..initialize().then((value) {});
} else {
videoPlayerController = VideoPlayerController.network(
widget.comment.subjectInfo.video,
)..initialize().then((value) {
chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController,
aspectRatio: videoPlayerController.value.aspectRatio,
//
autoPlay: false,
//
looping: false,
//
allowFullScreen: true,
//
materialProgressColors: chewie.ChewieProgressColors(
playedColor: Colors.white,
handleColor: Colors.white,
backgroundColor: Colors.grey,
bufferedColor: Colors.transparent,
),
autoInitialize: true,
);
chewieAudioController.addListener(_fullScreenListener);
if (mounted) setState(() {});
});
}
}
}
////
_vipFollow(followId) async {
@ -244,7 +298,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Container(
height: 16,
color: Color(0xFFF7F7F7),
)
),
],
);
}
@ -254,10 +308,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
if (subjectInfo == null) {
return Container();
}
Widget widget = Container();
Widget itemWidget = Container();
if (subjectInfo.type == "image" && subjectInfo.images.length > 0) {
if (subjectInfo.images.length == 1) {
widget = Container(
itemWidget = Container(
child: MImage(
subjectInfo.images[0],
fit: BoxFit.cover,
@ -268,7 +322,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
);
} else {
widget = GridView.builder(
itemWidget = GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: (subjectInfo.images.length == 2 ||
subjectInfo.images.length == 4)
@ -295,14 +349,16 @@ class _CommunityDynamic extends State<CommunityDynamic> {
itemCount: subjectInfo.images.length,
);
}
} else if (subjectInfo.type == "video" &&
subjectInfo.video.isNotEmpty) {
widget = videoWidget(
} else if (subjectInfo.type == "video" && subjectInfo.video.isNotEmpty) {
itemWidget = videoWidget(
MediaQuery.of(context).size.width - 32,
MediaQuery.of(context).size.width /1.5,
subjectInfo.video);
videoPlayerController != null
? (MediaQuery.of(context).size.width - 32) /
videoPlayerController.value.aspectRatio
: MediaQuery.of(context).size.width / 2,
!widget.isList ? subjectInfo.video : widget.comment.coverImg,
);
}
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
@ -311,63 +367,77 @@ class _CommunityDynamic extends State<CommunityDynamic> {
SizedBox(
height: 16.h,
),
widget,
itemWidget,
],
);
}
VideoPlayerController videoPlayerController;
ChewieController chewieAudioController;
Chewie chewies;
@override
void dispose() {
super.dispose();
Widget videoWidget(double width, double height, src) {
print("src : $src");
chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController =
VideoPlayerController.network(
src,
),
aspectRatio: width / height,
//
autoPlay: false,
//
looping: false,
//
allowFullScreen: true,
// systemOverlaysAfterFullScreen: [],
// systemOverlaysOnEnterFullScreen: [],
// deviceOrientationsAfterFullScreen: [],
// deviceOrientationsOnEnterFullScreen: [],
//
materialProgressColors: chewie.ChewieProgressColors(
playedColor: Colors.white,
handleColor: Colors.white,
backgroundColor: Colors.grey,
bufferedColor: Colors.transparent,
),
autoInitialize: true,
);
if (chewieAudioController != null) {
chewieAudioController.pause();
chewieAudioController.dispose();
chewieAudioController = null;
}
chewieAudioController.addListener(_fullScreenListener);
if (videoPlayerController != null) {
videoPlayerController.pause();
videoPlayerController.dispose();
}
}
Widget videoWidget(double width, double height, src) {
print("src : $src");
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaleFactor: 0.9,
),
child: Container(
width: MediaQuery.of(context).size.width - 17,
height: (MediaQuery.of(context).size.width) / (width / height),
child: !widget.isList
? (chewieAudioController != null
? Container(
width: width,
height: height,
child: chewies = Chewie(
controller: chewieAudioController,
),
)
: Container(
width: width,
height: height,
))
: Container(
width: width,
height: width / 7 * 5,
color: Colors.black,
child: Stack(
children: [
Center(
child: MImage(
src,
aspectRatio: videoPlayerController != null
? videoPlayerController.value.aspectRatio
: (width / 7 * 5),
fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
),
Center(
child: Icon(
Icons.play_circle_outline,
color: Colors.white,
size: 60,
),
),
],
),
),
);
}
Future<void> _fullScreenListener() async {
print("object: isPlaying: ${videoPlayerController.value.isPlaying}");
print("object: isFullScreen: ${chewieAudioController.isFullScreen}");
if (!chewieAudioController.isFullScreen) {
Future.delayed(Duration(seconds: 1), () {
widget.exitFull();

29
lib/community/release_dynamic.dart

@ -14,6 +14,7 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:thumbnails/thumbnails.dart';
class ReleaseDynamic extends StatefulWidget {
@override
@ -136,11 +137,13 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
List<String> remoteImageUrls = [];
String remoteVideoUrl = "";
String remoteVideoCoverImg = "";
if (mediaPaths.length > 0) {
if (dynamicType == 1) {
remoteImageUrls = mediaPaths.map((e) => e.remotePath).toList();
} else if (dynamicType == 2) {
remoteVideoUrl = mediaPaths[0].remotePath;
remoteVideoCoverImg = mediaPaths[0].thumbPath;
}
}
@ -149,6 +152,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
"subject": dynamicText,
"subjectType": subjectType,
"video": remoteVideoUrl,
"coverImg": remoteVideoCoverImg,
}).catchError((onError) {
EasyLoading.dismiss();
});
@ -172,8 +176,31 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
element.path != null &&
element.path != "" &&
await File(element.path).exists())) {
File file = File(element.path);
if (dynamicType == 2) {
String thumbnail;
if (element.thumbPath != null && element.thumbPath != "" && await File(element.thumbPath).exists()) {
thumbnail = element.thumbPath;
} else {
thumbnail = await Thumbnails.getThumbnail(
videoFile: file.path,
imageType: ThumbFormat.WEBP,
quality: 10,
);
}
if (thumbnail != null && thumbnail != "" && await File(thumbnail).exists()) {
BaseData<UploadResult> baseData = await apiService.upload(
File(thumbnail),
123123123,
);
if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data;
mediaPaths[mediaPaths.indexOf(element)].thumbPath = uploadResult.url;
}
}
}
BaseData<UploadResult> baseData = await apiService.upload(
File(element.path),
file,
123123123,
);
if (baseData != null && baseData.isSuccess) {

1
lib/home/huixiang_brand_page.dart

@ -182,7 +182,6 @@ class _BrandPage extends State<BrandPage>
child: Html(
data: value.content,
customImageRenders: {
base64DataUriMatcher(): base64ImageRender(),
assetUriMatcher(): assetImageRender(),
networkSourceMatcher(extension: "svg"): svgNetworkImageRender(),
networkSourceMatcher(): networkImageRender(

9
lib/integral_store/integral_store_details_page.dart

@ -100,19 +100,10 @@ class _IntegralStoreDetailsPage extends State {
child: Html(
data: goods != null ? goods.detail : "",
customImageRenders: {
base64DataUriMatcher(): base64ImageRender(),
assetUriMatcher(): assetImageRender(),
networkSourceMatcher(extension: "svg"):
svgNetworkImageRender(),
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
// return Image.asset("assets/image/default_1.png",);
return Container();
},
// mapUrl: (url) {
// print("objectUrl: $url");
// return "$url?imageMogr2/format/webp/blur/1x0/quality/75";
// }
),
},
),

3
lib/main.dart

@ -54,7 +54,7 @@ import 'package:huixiang/setting/permission_setting_page.dart';
import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart';
import 'package:huixiang/store/store_order.dart';
import 'package:huixiang/store/store_view/settlement.dart';
import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_page.dart';
@ -304,7 +304,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/qr_share': (context, {arguments}) => QrSharePage(),
'/router/main_page': (context, {arguments}) => MainPage(),
'/router/test_page': (context, {arguments}) => TestPage(),
// '/router/ui_test': (context, {arguments}) => UITest(),
'/router/communityFollow': (context, {arguments}) => CommunityFollow(),
'/router/releasePage': (context, {arguments}) => ReleasePage(),
'/router/activity_list': (context, {arguments}) => ActivityList(),

4
lib/main_page.dart

@ -229,7 +229,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
}
}
final PageController pageController = PageController(initialPage: 1);
final PageController pageController = PageController(initialPage: 0);
@override
Widget build(BuildContext context) {
@ -279,7 +279,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
);
}
var clickIndex = 1;
var clickIndex = 0;
Widget bottomNavigationItem(text, index) {
var isSelected = index == clickIndex;

20
lib/mine/mine_page.dart

@ -55,8 +55,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
@override
void dispose() {
super.dispose();
if (_refreshController != null)
_refreshController.dispose();
if (_refreshController != null) _refreshController.dispose();
}
@override
@ -67,12 +66,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}");
if (event.type < 3) {
if (mounted)
setState(() {});
if (mounted) setState(() {});
}
if (event.type == 3) {
if (mounted)
setState(() {});
if (mounted) setState(() {});
}
});
}
@ -86,8 +83,12 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
value.getString('user') != "") {
userInfo = UserInfo.fromJson(jsonDecode(value.getString('user')));
}
apiService = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
showLoading: false,
);
BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) {
@ -231,7 +232,6 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
}
///
Widget buildNotice() {
return Container(
@ -305,7 +305,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
}
////
/////
Widget attention(){
return Container(
margin: EdgeInsets.only(left: 16,top: 10),

24
lib/mine/mine_view/mine_view.dart

@ -23,7 +23,6 @@ class MineView extends StatefulWidget {
}
class _MineView extends State<MineView> {
@override
Widget build(BuildContext context) {
return Column(
@ -91,7 +90,23 @@ class _MineView extends State<MineView> {
);
});
} else if (await Permission.camera.isGranted) {
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');
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();
}
@ -145,13 +160,16 @@ class _MineView extends State<MineView> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
widget.userInfo == null
? Text(
? InkWell(
child: Text(
S.of(context).denglu,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF353535),
),
),
onTap: widget.toUserInfo,
)
: Row(
children: [

13
lib/mine/recharge_page.dart

@ -207,9 +207,9 @@ class _RechargePage extends State<RechargePage> {
}
int amount = int.tryParse(money);
if (checkIndex == 1) {
if (amount < 10) {
SmartDialog.showToast(S.of(context).chongzhizuixiaojine(10), alignment: Alignment.center);
SmartDialog.showToast(S.of(context).chongzhizuixiaojine(10),
alignment: Alignment.center);
return;
}
@ -220,13 +220,15 @@ class _RechargePage extends State<RechargePage> {
await Min.initialize();
}
BaseData<WxPay> baseData = await apiService.recharge({"amount": amount, "rechargeType": 2});
BaseData<WxPay> baseData =
await apiService.recharge({"amount": amount, "rechargeType": 2});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data;
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/");
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
@ -234,7 +236,8 @@ class _RechargePage extends State<RechargePage> {
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign);
sign: wxPay.sign,
);
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
});

24
lib/mine/vip_detail_page.dart

@ -4,9 +4,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/utils/painter_bg.dart';
@ -432,8 +433,25 @@ class _VipDetailPage extends State<VipDetailPage> {
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/union_detail_page',
arguments: {"id": store.id});
// Navigator.of(context).pushNamed('/router/union_detail_page',
// arguments: {"id": store.id});
if(store.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
store.id,
store.tenantCode,
store.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": store.id,
"tenant": store.tenantCode,
"storeName": store.storeName
},
);
}
},
child: Text(
S.of(context).chakan,

105
lib/order/order_detail_page.dart

@ -1,19 +1,28 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_address.dart';
import 'package:huixiang/order/order_view/order_commodity.dart';
import 'package:huixiang/order/order_view/order_info.dart';
import 'package:huixiang/order/order_view/order_pay_selected.dart';
import 'package:huixiang/order/order_view/order_status.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
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/retrofit/retrofit_api.dart';
import 'package:huixiang/settlement/settlement_view/pay_method.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'order_utils.dart';
class OrderDetailPage extends StatefulWidget {
final arguments;
@ -27,6 +36,7 @@ class OrderDetailPage extends StatefulWidget {
class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService;
MinApiService minService;
@override
void initState() {
@ -42,6 +52,34 @@ class _OrderDetailPage extends State<OrderDetailPage> {
});
}
///
minLogin() async {
apiService.minLogin(orderInfo.storeId)
.catchError((onError) {debugPrint(onError);})
.then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
}
});
}
OrderInfo orderInfo;
int payStatus = 0;
int orderStatus = 0;
@ -49,11 +87,10 @@ class _OrderDetailPage extends State<OrderDetailPage> {
int isTakeOut = 0;
int refundStatus = 0;
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
queryDetails() async {
BaseData<OrderInfo> baseData =
await apiService.orderDetail(widget.arguments["id"]);
BaseData<OrderInfo> baseData = await apiService
.orderDetail(widget.arguments["id"])
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
orderInfo = baseData.data;
payStatus = orderInfo.payStatus;
@ -67,10 +104,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
print("order orderStatus: $orderStatus");
print("order sendStatus: $sendStatus");
print("order isTakeOut: $isTakeOut");
minLogin();
if (mounted)
setState(() {
statusTitle();
});
}
}
@ -100,32 +138,25 @@ class _OrderDetailPage extends State<OrderDetailPage> {
titleColor: Colors.white,
background: Colors.transparent,
leadingColor: Colors.white,
// toolbarHeight: (orderStatus >= 4 ? 118.h : 118.h) +
// MediaQuery.of(context).padding.top +
// kToolbarHeight,
brightness: Brightness.dark,
// bottom: PreferredSize(
// preferredSize: Size(
// double.infinity,
// orderStatus >= 4 ? 118.h : 118,
// ),
// child:
// ),
),
body: Container(
child:
/*Column(
children: [
Expanded(
child:*/
SingleChildScrollView(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
child: Column(
children: [
///
OrderStatus(orderStatus, isTakeOut, sendStatus, payStatus,
refundStatus, title, center, orderInfo),
OrderStatus(
orderStatus,
isTakeOut,
sendStatus,
payStatus,
refundStatus,
title,
center,
orderInfo,
),
///
OrderAddress(
@ -136,13 +167,13 @@ class _OrderDetailPage extends State<OrderDetailPage> {
refundStatus,
title,
center,
paySelected,
_orderCancel,
orderInfo),
orderInfo,
),
///
OrderCommodity(orderInfo),
// if (payStatus == 0) couponRemarks(),
/*(payStatus == 0) ? paySelector() : */
///
OrderInfoView(orderInfo),
@ -154,19 +185,13 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
),
),
// flex: 1,
// ),
// if (payStatus == 0)
// bottomPay(),
// ],
// ),
),
),
left: 0,
right: 0,
top: 0,
bottom: 0,
)
),
],
);
}
@ -174,6 +199,19 @@ class _OrderDetailPage extends State<OrderDetailPage> {
String title = "";
String center = "";
paySelected() async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected();
},
);
if (payChannel != null && payChannel > 0) {
OrderUtils.carryOnPay(payChannel, minService, orderInfo, queryDetails);
}
}
statusTitle() {
if (isTakeOut == 0) {
if (payStatus == 0) {
@ -261,7 +299,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
}
}
Widget couponRemarks() {
return Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 2.h),

116
lib/order/order_history_page.dart

@ -2,10 +2,16 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_utils.dart';
import 'package:huixiang/order/order_view/order_pay_selected.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/status_utils.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
@ -19,7 +25,6 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class OrderHistoryPage extends StatefulWidget {
final Map arguments;
OrderHistoryPage({this.arguments});
@ -39,7 +44,8 @@ class _OrderHistoryPage extends State<OrderHistoryPage>
void didChangeDependencies() {
super.didChangeDependencies();
if (tabController == null)
tabController = TabController(initialIndex: widget.arguments["status"], length: 4, vsync: this);
tabController = TabController(
initialIndex: widget.arguments["status"], length: 4, vsync: this);
_pages = [
OrderHistoryList(0),
@ -224,7 +230,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
)
),
],
),
child: Column(
@ -437,11 +443,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
orderInfo.refundStatus,
orderInfo.dayFlowCode, (type) {
if (type == 0) {
String storeId = (orderInfo != null &&
orderInfo.storeVO != null)
? (orderInfo.storeVO.id ?? "")
: "";
aginOrder(storeId);
aginOrder(orderInfo);
} else if (type == 1) {
SmartDialog.show(
widget: Tips(
@ -453,26 +455,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
} else if (type == 2) {
orderCancel(orderInfo.id);
} else if (type == 3) {
SmartDialog.show(
widget: Tips(
() {
SmartDialog.dismiss();
},
text: "暂不支持此功能",
));
orderInfo.tenantCode;
orderInfo.id;
///
// Map param = {
// "id": orderInfo.id,
// "orderProductVOList": orderInfo
// .orderDetail.orderProductList
// .map((e) => e.toJson())
// .toList(),
// "payChannel": 1,
// "orderType": 0
// };
// toPay(param);
minLogin(orderInfo);
} else if (type == 4) {
Navigator.of(context).pushNamed(
'/router/logistics_information_page',
@ -498,10 +481,51 @@ class _OrderHistoryList extends State<OrderHistoryList>
);
}
toPay(Map param) async {
apiService.settlement(param).catchError((error) {
minLogin(OrderInfo orderInfo) {
apiService.minLogin(orderInfo.storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
));
}
});
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected();
},
);
if (payChannel != null && payChannel > 0) {
OrderUtils.carryOnPay(payChannel, minService, orderInfo, () {
SmartDialog.showToast("订单支付成功");
Future.delayed(Duration(seconds: 1), () {
_onRefresh();
});
});
}
}
orderCancel(String orderId) async {
@ -512,9 +536,33 @@ class _OrderHistoryList extends State<OrderHistoryList>
}
}
aginOrder(storeId) {
Navigator.of(context)
.pushNamed('/router/union_detail_page', arguments: {"id": storeId});
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if(orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
orderInfo.storeVO.id,
orderInfo.tenantCode,
orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": orderInfo.storeVO.id,
"tenant": orderInfo.tenantCode,
"storeName": orderInfo.storeVO.storeName
},
);
}
}
String totalPrice(orderInfo) {
@ -528,7 +576,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
return "$totalPrice";
}
List<Widget> goodsItem(List<ProductList> products) {
List<Widget> goodsItem(List<OrderProductVOList> products) {
if (products == null) return [];
if (products.length > 3) {
products = products.sublist(0, 3);

84
lib/order/order_utils.dart

@ -0,0 +1,84 @@
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
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';
class OrderUtils {
static carryOnPay(payChannel, MinApiService minService, OrderInfo orderInfo, Function queryDetails) async {
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst();
placeOrderFirst.addressId = orderInfo.addressExt.addressId;
placeOrderFirst.isSubscribe = orderInfo.isSubscribe;
placeOrderFirst.isTakeOut = orderInfo.isTakeOut;
placeOrderFirst.notes = orderInfo.notes;
placeOrderFirst.id = orderInfo.id;
placeOrderFirst.orderProductVOList = orderInfo.orderDetail.orderProductList;
placeOrderFirst.numberOfPeople = "0";
placeOrderFirst.orderSource = orderInfo.orderSource;
placeOrderFirst.orderType = "${orderInfo.orderType}";
placeOrderFirst.orderTypeId = 0;
placeOrderFirst.parentCode = orderInfo.parentCode; //
placeOrderFirst.parentId = orderInfo.parentId; //
placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId = orderInfo.promotionId;
placeOrderFirst.promotionInfoDTO.couponId = orderInfo.couponId;
placeOrderFirst.recMobile = "";
placeOrderFirst.shoppingCartSkuItemList = [];
placeOrderFirst.skuItemDTOList = [];
placeOrderFirst.source = 1;
placeOrderFirst.storeId = orderInfo.storeId;
placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = orderInfo.tableId;
if (placeOrderFirst.payChannel == 1) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
BaseData<WxPay> baseData = await minService
.settlementWx(placeOrderFirst.toJson())
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data;
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
prepayId: wxPay.prepayId,
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
queryDetails();
});
}
} else {
BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson())
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
queryDetails();
}
}
}
}

166
lib/order/order_view/order_address.dart

@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/round_button.dart';
@ -19,6 +20,7 @@ class OrderAddress extends StatefulWidget {
final String title;
final String center;
final Function orderCancel;
final Function() carryOnPay;
final OrderInfo orderInfo;
OrderAddress(
@ -29,8 +31,9 @@ class OrderAddress extends StatefulWidget {
this.refundStatus,
this.title,
this.center,
this.carryOnPay,
this.orderCancel,
this.orderInfo);
this.orderInfo,);
@override
State<StatefulWidget> createState() {
@ -195,7 +198,7 @@ class _OrderAddress extends State<OrderAddress> {
GestureDetector(
onTap: () {
if (widget.payStatus == 0) {
carryOnPay();
widget.carryOnPay();
} else {
String storeId = (widget.orderInfo != null &&
widget.orderInfo.storeVO != null)
@ -256,79 +259,98 @@ class _OrderAddress extends State<OrderAddress> {
aginOrder(storeId, storeName) {
Navigator.of(context).pushNamed('/router/union_detail_page',
arguments: {"id": storeId, "storeName": storeName});
}
carryOnPay() async {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84.w,
height: 140.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"app暂不支持支付,\n请前往对应小程序处理",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
SizedBox(
height: 30.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: "取消",
textColor: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: "好的",
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
],
),
],
),
),
if(widget.orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan(
context,
widget.orderInfo.storeVO.id,
widget.orderInfo.tenantCode,
widget.orderInfo.storeVO.storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": widget.orderInfo.storeVO.id,
"tenant": widget.orderInfo.tenantCode,
"storeName": widget.orderInfo.storeVO.storeName
},
);
}
}
// carryOnPay() async {
// showDialog(
// context: context,
// builder: (context) {
// return AlertDialog(
// content: Container(
// width: MediaQuery.of(context).size.width - 84.w,
// height: 140.h,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text(
// "app暂不支持支付,\n请前往对应小程序处理",
// textAlign: TextAlign.center,
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: FontWeight.bold,
// color: Colors.black,
// ),
// ),
// SizedBox(
// height: 30.h,
// ),
// Row(
// children: [
// Expanded(
// child: InkWell(
// child: BorderText(
// text: "取消",
// textColor: Color(0xFF32A060),
// fontSize: 16.sp,
// fontWeight: FontWeight.bold,
// borderColor: Color(0xFF32A060),
// radius: 4,
// padding: EdgeInsets.all(12),
// borderWidth: 1,
// ),
// onTap: () {
// Navigator.of(context).pop();
// },
// ),
// flex: 1,
// ),
// SizedBox(
// width: 16.w,
// ),
// Expanded(
// child: InkWell(
// child: RoundButton(
// text: "好的",
// textColor: Colors.white,
// radius: 4,
// padding: EdgeInsets.all(12),
// backgroup: Color(0xFF32A060),
// fontSize: 16.sp,
// fontWeight: FontWeight.bold,
// ),
// onTap: () {
// Navigator.of(context).pop();
// },
// ),
// flex: 1,
// ),
// ],
// ),
// ],
// ),
// ),
// );
// },
// );
// }
}

82
lib/order/order_view/order_commodity.dart

@ -1,16 +1,15 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/data/settlement_bean.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/separator.dart';
class OrderCommodity extends StatefulWidget {
final OrderInfo orderInfo;
OrderCommodity(this.orderInfo);
@ -19,7 +18,6 @@ class OrderCommodity extends StatefulWidget {
State<StatefulWidget> createState() {
return _OrderCommodity();
}
}
class _OrderCommodity extends State<OrderCommodity> {
@ -66,38 +64,57 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
List<Widget> commodityList() {
if (widget.orderInfo == null) return [];
List<Widget> widgets = [];
if (widget.orderInfo.productList != null) {
widgets
.addAll(widget.orderInfo.productList.map((e) => commodityItem(e)).toList());
widgets.addAll(
widget.orderInfo.productList.map((e) => commodityItem(e)).toList());
}
widgets.add(SizedBox(height: 20.h));
if (widget.orderInfo.isTakeOut != 0) {
//
widgets.add(discountItem(
widgets.add(
discountItem(
Color(0xFFFF7A1A),
widget.orderInfo.isTakeOut == 1
? S.of(context).peisongfei
: S.of(context).yunfei,
"",
"+${widget.orderInfo.postFee}"));
"+${widget.orderInfo.postFee}",
),
);
}
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.couponDTO != null) {
//
widgets.add(discountItem(
widgets.add(
discountItem(
Color(0xFFFF7A1A),
S.of(context).youhuiquan,
widget.orderInfo.orderDetail.couponDTO.name,
widget.orderInfo.orderDetail.couponDTO.money));
widget.orderInfo.orderDetail.couponDTO.money,
),
);
}
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.activityPrice != null &&
double.tryParse(widget.orderInfo.orderDetail.activityPrice ?? "0") > 0) {
//
widgets.add(
discountItem(
Color(0xFFFF7A1A),
"活动",
widget.orderInfo.orderDetail.promotionName,
"- ${widget.orderInfo.orderDetail.activityPrice}",
),
);
}
if (widget.orderInfo.storeVO != null && widget.orderInfo.storeVO.couponVO != null) {
if (widget.orderInfo.storeVO != null &&
widget.orderInfo.storeVO.couponVO != null) {
// widgets.add(discountItem(Color(0xFF32A060),
// orderInfo.storeVO.couponVO.storeName,
// S.of(context).huodongjianmianpeisongfei(orderInfo.storeVO.couponVO.discountAmount),
@ -119,7 +136,7 @@ class _OrderCommodity extends State<OrderCommodity> {
return widgets;
}
Widget commodityItem(ProductList productList) {
Widget commodityItem(OrderProductVOList productList) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
@ -171,8 +188,8 @@ class _OrderCommodity extends State<OrderCommodity> {
Expanded(
flex: 1,
child: Text(
productList.weight != null
? "${productList.weight}kg"
productList.skuNameStr != null
? "${productList.skuNameStr}"
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -329,39 +346,50 @@ class _OrderCommodity extends State<OrderCommodity> {
children: [
Expanded(
child: Text(
S.of(context).gongjijianshangpin(
(widget.orderInfo != null && widget.orderInfo.productList != null)
S.of(context).gongjijianshangpin((widget.orderInfo != null &&
widget.orderInfo.productList != null)
? widget.orderInfo.productList.length
: "0"),
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.semi_bold
),
fontWeight: MyFontWeight.semi_bold),
),
flex: 1,
),
Container(
child: Text(
"已优惠:¥${widget.orderInfo.orderDetail.activityPrice}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7B7B7B),
fontWeight: MyFontWeight.medium,
),
),
),
SizedBox(
width: 15.w,
),
Container(
child: Text(
S.of(context).jiesuanjine,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
fontWeight:MyFontWeight.semi_bold
),
fontWeight: MyFontWeight.semi_bold),
),
),
SizedBox(
width: 5.w,
),
Text(
totalPrice(),
"${widget.orderInfo.orderDetail.paySumPrice}"
/*totalPrice()*/,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold
),
fontWeight: MyFontWeight.semi_bold),
)
],
),
@ -374,9 +402,9 @@ class _OrderCommodity extends State<OrderCommodity> {
double.tryParse(widget.orderInfo.postFee));
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.couponDTO != null) {
totalPrice -= double.tryParse(widget.orderInfo.orderDetail.couponDTO.money);
totalPrice -=
double.tryParse(widget.orderInfo.orderDetail.couponDTO.money);
}
return "$totalPrice";
}
}

147
lib/order/order_view/order_pay_selected.dart

@ -0,0 +1,147 @@
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';
class OrderPaySelected extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _OrderPaySelected();
}
}
class _OrderPaySelected extends State<OrderPaySelected> {
@override
Widget build(BuildContext context) {
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return Container(
width: double.infinity,
height: 200,
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 20.h,
bottom: 20.h,
),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color(0x000000).withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12.0,
),
],
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: MyFontWeight.regular,
),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop(4);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).pingtaiyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,),
),
checkView(1),
],
),
),
SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop(3);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).dianpuyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
checkView(2),
],
),
),
SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop(1);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.png"),
Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
),
checkView(3),
],
),
),
],
),
);
},
);
}
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(left: 16.w),
alignment: Alignment.center,
child: Image.asset(
/*checkIndex != index
? */"assets/image/icon_radio_unselected.png",
// : "assets/image/icon_radio_selected.png",
width: 15.w,
height: 15.h,
),
);
}
}

117
lib/qr/qr_code_scan.dart

@ -1,10 +1,10 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_qr_reader/flutter_qr_reader.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.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';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:permission_handler/permission_handler.dart';
@ -16,18 +16,14 @@ class QrCodeScanPage extends StatefulWidget {
}
class _QrCodeScanPage extends State<QrCodeScanPage> {
GlobalKey<_QrCodeScanPage> qrViewKey = GlobalKey();
QrReaderViewController viewController;
ScanKitController _controller;
final screenWidth = window.physicalSize.width;
final screenHeight = window.physicalSize.height;
@override
void initState() {
super.initState();
readerHeight = 812;
Future.delayed(Duration(seconds: 1), () {
buildReaderView();
});
}
@override
@ -37,19 +33,23 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
child: Stack(
children: [
Positioned(
child: qrReaderView != null
? Column(
child: Column(
children: [
Expanded(
child: qrReaderView,
flex: readerHeight.toInt(),
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,
),
// Expanded(child: qrReaderView, flex: readerHeight,),
],
)
: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
),
top: 0,
bottom: 0,
@ -68,12 +68,12 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
margin: EdgeInsets.only(right: 16.w),
child: GestureDetector(
onTap: () {
openStorage();
_controller.pickPhoto();
},
child: Text(
S.of(context).xiangce,
style: TextStyle(
color: Colors.white,
color: Colors.black,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
@ -91,80 +91,11 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
);
}
QrReaderView qrReaderView;
double readerHeight;
buildReaderView() async {
double screenWidth = MediaQuery.of(context).size.width;
readerHeight = 1920.0 / 1080.0 * screenWidth;
print("object: $readerHeight");
qrReaderView = await QrReaderView(
key: qrViewKey,
callback: onScan,
width: MediaQuery.of(context).size.width,
height: readerHeight,
);
setState(() {});
}
///
openStorage() async {
if (await Permission.storage.isGranted) {
List<Media> medias = await ImagePickers.pickerPaths(
galleryMode: GalleryMode.image,
selectCount: 1,
showGif: true,
showCamera: false,
compressSize: 500,
uiConfig: UIConfig(
uiThemeColor: Color(0xFFFFFFFF),
),
cropConfig: CropConfig(
enableCrop: true,
width: 200,
height: 200,
),
);
if (medias == null || medias.length == 0) return;
String filePath = medias[0].path;
final String data = await FlutterQrReader.imgScan(filePath);
showData(data);
} else {
await Permission.storage.request();
openStorage();
}
}
void _startCameraResult(String data, List<Offset> offset) {
showData(data);
this.viewController.stopCamera();
}
Future onScan(QrReaderViewController viewController) async {
this.viewController = viewController;
await this.viewController.startCamera(_startCameraResult);
}
showData(String data) {
SmartDialog.show(
widget: Tips(
() {},
text: "$data",
),
onDismiss: () {
Future.delayed(Duration(seconds: 1), () {
this.viewController.startCamera(_startCameraResult);
});
},
);
}
@override
void dispose() {
if (this.viewController != null) {
this.viewController.stopCamera();
}
// if (this._controller != null) {
// this._controller.dispose();
// }
super.dispose();
}
}

10
lib/retrofit/data/comunity_comment.dart

@ -20,7 +20,8 @@ class ComunityComment {
int comments,
bool selfLike,
bool selfFollow,
String createTime,}){
String createTime,
String coverImg,}){
this.id = id;
this.subject = subject;
this.subjectInfo = subjectInfo;
@ -31,6 +32,7 @@ class ComunityComment {
this.selfLike = selfLike;
this.selfFollow = selfFollow;
this.createTime = createTime;
this.coverImg = coverImg;
}
ComunityComment.fromJson(dynamic json) {
@ -44,6 +46,7 @@ class ComunityComment {
this.selfLike = json['selfLike'];
this.selfFollow = json['selfFollow'];
this.createTime = json['createTime'];
this.coverImg = json['coverImg'];
}
String id;
String subject;
@ -55,6 +58,7 @@ class ComunityComment {
bool selfLike;
bool selfFollow;
String createTime;
String coverImg;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
@ -72,6 +76,7 @@ class ComunityComment {
map['selfLike'] = this.selfLike;
map['selfFollow'] = this.selfFollow;
map['createTime'] = this.createTime;
map['coverImg'] = this.coverImg;
return map;
}
@ -118,7 +123,8 @@ class SubjectInfo {
SubjectInfo({
String type,
List<String> images,
String video,}){
String video,
String coverImg,}){
this.type = type;
this.images = images;
this.video = video;

135
lib/retrofit/data/down_order.dart

@ -0,0 +1,135 @@
import 'package:huixiang/retrofit/data/order_product_vo.dart';
class DownOrder {
DownOrder({
String id,
String orderCode,
dynamic storeId,
dynamic storeName,
dynamic orderStatus,
dynamic returnType,
dynamic shipperCode,
dynamic logisticsNum,
String orderSum,
dynamic accountPay,
dynamic discountAmount,
dynamic postFee,
dynamic paySum,
dynamic overTime,
List<OrderProductVOList> orderProductVOList,
dynamic moneyReturnList,
dynamic goodsReturnList,
dynamic tablePrice,
dynamic parentCode,
String parentId,
dynamic peopleNum,
int orderSource,
}) {
this.id = id;
this.orderCode = orderCode;
this.storeId = storeId;
this.storeName = storeName;
this.orderStatus = orderStatus;
this.returnType = returnType;
this.shipperCode = shipperCode;
this.logisticsNum = logisticsNum;
this.orderSum = orderSum;
this.accountPay = accountPay;
this.discountAmount = discountAmount;
this.postFee = postFee;
this.paySum = paySum;
this.overTime = overTime;
this.orderProductVOList = orderProductVOList;
this.moneyReturnList = moneyReturnList;
this.goodsReturnList = goodsReturnList;
this.tablePrice = tablePrice;
this.parentCode = parentCode;
this.parentId = parentId;
this.peopleNum = peopleNum;
this.orderSource = orderSource;
}
DownOrder.fromJson(dynamic json) {
this.id = json['id'];
this.orderCode = json['orderCode'];
this.storeId = json['storeId'];
this.storeName = json['storeName'];
this.orderStatus = json['orderStatus'];
this.returnType = json['returnType'];
this.shipperCode = json['shipperCode'];
this.logisticsNum = json['logisticsNum'];
this.orderSum = json['orderSum'];
this.accountPay = json['accountPay'];
this.discountAmount = json['discountAmount'];
this.postFee = json['postFee'];
this.paySum = json['paySum'];
this.overTime = json['overTime'];
if (json['orderProductVOList'] != null) {
this.orderProductVOList = [];
json['orderProductVOList'].forEach((v) {
this.orderProductVOList.add(OrderProductVOList.fromJson(v));
});
}
this.moneyReturnList = json['moneyReturnList'];
this.goodsReturnList = json['goodsReturnList'];
this.tablePrice = json['tablePrice'];
this.parentCode = json['parentCode'];
this.parentId = json['parentId'];
this.peopleNum = json['peopleNum'];
this.orderSource = json['orderSource'];
}
String id;
String orderCode;
dynamic storeId;
dynamic storeName;
dynamic orderStatus;
dynamic returnType;
dynamic shipperCode;
dynamic logisticsNum;
String orderSum;
dynamic accountPay;
dynamic discountAmount;
dynamic postFee;
dynamic paySum;
dynamic overTime;
List<OrderProductVOList> orderProductVOList;
dynamic moneyReturnList;
dynamic goodsReturnList;
dynamic tablePrice;
dynamic parentCode;
String parentId;
dynamic peopleNum;
int orderSource;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = this.id;
map['orderCode'] = this.orderCode;
map['storeId'] = this.storeId;
map['storeName'] = this.storeName;
map['orderStatus'] = this.orderStatus;
map['returnType'] = this.returnType;
map['shipperCode'] = this.shipperCode;
map['logisticsNum'] = this.logisticsNum;
map['orderSum'] = this.orderSum;
map['accountPay'] = this.accountPay;
map['discountAmount'] = this.discountAmount;
map['postFee'] = this.postFee;
map['paySum'] = this.paySum;
map['overTime'] = this.overTime;
if (this.orderProductVOList != null) {
map['orderProductVOList'] =
this.orderProductVOList.map((v) => v.toJson()).toList();
}
map['moneyReturnList'] = this.moneyReturnList;
map['goodsReturnList'] = this.goodsReturnList;
map['tablePrice'] = this.tablePrice;
map['parentCode'] = this.parentCode;
map['parentId'] = this.parentId;
map['peopleNum'] = this.peopleNum;
map['orderSource'] = this.orderSource;
return map;
}
}

713
lib/retrofit/data/min_order_info.dart

@ -0,0 +1,713 @@
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
class MinOrderInfo {
MinOrderInfo({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String tenantCode,
String storeId,
String storeName,
String tableId,
int orderType,
bool clearTable,
String mid,
String parentId,
String parentCode,
String orderCode,
String dayFlowCode,
int orderStatus,
int sendStatus,
int payStatus,
String memberAccount,
String logisticsId,
String shipperCode,
String logisticsName,
String logisticsNum,
dynamic logisticsCase,
int refundStatus,
dynamic addressExt,
String postFee,
String orderSum,
String paySum,
String paySumSub,
String accountPay,
String couponSubPrice,
String customPrice,
String removeDecimal,
bool isSubscribe,
dynamic subcribeTime,
dynamic sendTime,
dynamic confirmTime,
dynamic returnMoneyTime,
String notes,
dynamic prepayId,
dynamic payTime,
int payChannel,
dynamic payNum,
String promotionId,
String couponId,
int isDelete,
int isTakeOut,
int batch,
String orderDiscountPrice,
String dishesDiscountPrice,
String orderPercentPrice,
String finalPayPrice,
String activityNoPrice,
String activityDiscountPrice,
String totalDiscountPrice,
int orderSource,
dynamic address,
dynamic discountPercent,
dynamic discountAmount,
dynamic discountType,
dynamic discountMoney,
dynamic overTime,
List<OrderProductListBean> orderProductVOList,
dynamic moneyReturnList,
dynamic goodsReturnList,
dynamic moneyReturnVOList,
dynamic goodsReturnVOList,
dynamic moneyReturnActionHistoryList,
dynamic goodsReturnActionHistoryList,
String currentTime,
dynamic tablePrice,
String tableName,
String balance,
String money,
dynamic prodNum,
bool onCredit,
OrderInfoVo orderInfoVo,
String endPayTime,
String orderSumPrice,}){
this.id = id;
this.createTime = createTime;
this.createUser = createUser;
this.updateTime = updateTime;
this.updateUser = updateUser;
this.tenantCode = tenantCode;
this.storeId = storeId;
this.storeName = storeName;
this.tableId = tableId;
this.orderType = orderType;
this.clearTable = clearTable;
this.mid = mid;
this.parentId = parentId;
this.parentCode = parentCode;
this.orderCode = orderCode;
this.dayFlowCode = dayFlowCode;
this.orderStatus = orderStatus;
this.sendStatus = sendStatus;
this.payStatus = payStatus;
this.memberAccount = memberAccount;
this.logisticsId = logisticsId;
this.shipperCode = shipperCode;
this.logisticsName = logisticsName;
this.logisticsNum = logisticsNum;
this.logisticsCase = logisticsCase;
this.refundStatus = refundStatus;
this.addressExt = addressExt;
this.postFee = postFee;
this.orderSum = orderSum;
this.paySum = paySum;
this.paySumSub = paySumSub;
this.accountPay = accountPay;
this.couponSubPrice = couponSubPrice;
this.customPrice = customPrice;
this.removeDecimal = removeDecimal;
this.isSubscribe = isSubscribe;
this.subcribeTime = subcribeTime;
this.sendTime = sendTime;
this.confirmTime = confirmTime;
this.returnMoneyTime = returnMoneyTime;
this.notes = notes;
this.prepayId = prepayId;
this.payTime = payTime;
this.payChannel = payChannel;
this.payNum = payNum;
this.promotionId = promotionId;
this.couponId = couponId;
this.isDelete = isDelete;
this.isTakeOut = isTakeOut;
this.batch = batch;
this.orderDiscountPrice = orderDiscountPrice;
this.dishesDiscountPrice = dishesDiscountPrice;
this.orderPercentPrice = orderPercentPrice;
this.finalPayPrice = finalPayPrice;
this.activityNoPrice = activityNoPrice;
this.activityDiscountPrice = activityDiscountPrice;
this.totalDiscountPrice = totalDiscountPrice;
this.orderSource = orderSource;
this.address = address;
this.discountPercent = discountPercent;
this.discountAmount = discountAmount;
this.discountType = discountType;
this.discountMoney = discountMoney;
this.overTime = overTime;
this.orderProductVOList = orderProductVOList;
this.moneyReturnList = moneyReturnList;
this.goodsReturnList = goodsReturnList;
this.moneyReturnVOList = moneyReturnVOList;
this.goodsReturnVOList = goodsReturnVOList;
this.moneyReturnActionHistoryList = moneyReturnActionHistoryList;
this.goodsReturnActionHistoryList = goodsReturnActionHistoryList;
this.currentTime = currentTime;
this.tablePrice = tablePrice;
this.tableName = tableName;
this.balance = balance;
this.money = money;
this.prodNum = prodNum;
this.onCredit = onCredit;
this.orderInfoVo = orderInfoVo;
this.endPayTime = endPayTime;
this.orderSumPrice = orderSumPrice;
}
MinOrderInfo.fromJson(dynamic json) {
this.id = json['id'];
this.createTime = json['createTime'];
this.createUser = json['createUser'];
this.updateTime = json['updateTime'];
this.updateUser = json['updateUser'];
this.tenantCode = json['tenantCode'];
this.storeId = json['storeId'];
this.storeName = json['storeName'];
this.tableId = json['tableId'];
this.orderType = json['orderType'];
this.clearTable = json['clearTable'];
this.mid = json['mid'];
this.parentId = json['parentId'];
this.parentCode = json['parentCode'];
this.orderCode = json['orderCode'];
this.dayFlowCode = json['dayFlowCode'];
this.orderStatus = json['orderStatus'];
this.sendStatus = json['sendStatus'];
this.payStatus = json['payStatus'];
this.memberAccount = json['memberAccount'];
this.logisticsId = json['logisticsId'];
this.shipperCode = json['shipperCode'];
this.logisticsName = json['logisticsName'];
this.logisticsNum = json['logisticsNum'];
this.logisticsCase = json['logisticsCase'];
this.refundStatus = json['refundStatus'];
this.addressExt = json['addressExt'];
this.postFee = json['postFee'];
this.orderSum = json['orderSum'];
this.paySum = json['paySum'];
this.paySumSub = json['paySumSub'];
this.accountPay = json['accountPay'];
this.couponSubPrice = json['couponSubPrice'];
this.customPrice = json['customPrice'];
this.removeDecimal = json['removeDecimal'];
this.isSubscribe = json['isSubscribe'];
this.subcribeTime = json['subcribeTime'];
this.sendTime = json['sendTime'];
this.confirmTime = json['confirmTime'];
this.returnMoneyTime = json['returnMoneyTime'];
this.notes = json['notes'];
this.prepayId = json['prepayId'];
this.payTime = json['payTime'];
this.payChannel = json['payChannel'];
this.payNum = json['payNum'];
this.promotionId = json['promotionId'];
this.couponId = json['couponId'];
this.isDelete = json['isDelete'];
this.isTakeOut = json['isTakeOut'];
this.batch = json['batch'];
this.orderDiscountPrice = json['orderDiscountPrice'];
this.dishesDiscountPrice = json['dishesDiscountPrice'];
this.orderPercentPrice = json['orderPercentPrice'];
this.finalPayPrice = json['finalPayPrice'];
this.activityNoPrice = json['activityNoPrice'];
this.activityDiscountPrice = json['activityDiscountPrice'];
this.totalDiscountPrice = json['totalDiscountPrice'];
this.orderSource = json['orderSource'];
this.address = json['address'];
this.discountPercent = json['discountPercent'];
this.discountAmount = json['discountAmount'];
this.discountType = json['discountType'];
this.discountMoney = json['discountMoney'];
this.overTime = json['overTime'];
if (json['orderProductVOList'] != null) {
this.orderProductVOList = [];
json['orderProductVOList'].forEach((v) {
this.orderProductVOList.add(OrderProductListBean.fromJson(v));
});
}
this.moneyReturnList = json['moneyReturnList'];
this.goodsReturnList = json['goodsReturnList'];
this.moneyReturnVOList = json['moneyReturnVOList'];
this.goodsReturnVOList = json['goodsReturnVOList'];
this.moneyReturnActionHistoryList = json['moneyReturnActionHistoryList'];
this.goodsReturnActionHistoryList = json['goodsReturnActionHistoryList'];
this.currentTime = json['currentTime'];
this.tablePrice = json['tablePrice'];
this.tableName = json['tableName'];
this.balance = json['balance'];
this.money = json['money'];
this.prodNum = json['prodNum'];
this.onCredit = json['onCredit'];
this.orderInfoVo = json['orderInfoVo'] != null ? OrderInfoVo.fromJson(json['orderInfoVo']) : null;
this.endPayTime = json['endPayTime'];
this.orderSumPrice = json['orderSumPrice'];
}
String id;
String createTime;
String createUser;
String updateTime;
String updateUser;
String tenantCode;
String storeId;
String storeName;
String tableId;
int orderType;
bool clearTable;
String mid;
String parentId;
String parentCode;
String orderCode;
String dayFlowCode;
int orderStatus;
int sendStatus;
int payStatus;
String memberAccount;
String logisticsId;
String shipperCode;
String logisticsName;
String logisticsNum;
dynamic logisticsCase;
int refundStatus;
dynamic addressExt;
String postFee;
String orderSum;
String paySum;
String paySumSub;
String accountPay;
String couponSubPrice;
String customPrice;
String removeDecimal;
bool isSubscribe;
dynamic subcribeTime;
dynamic sendTime;
dynamic confirmTime;
dynamic returnMoneyTime;
String notes;
dynamic prepayId;
dynamic payTime;
int payChannel;
dynamic payNum;
String promotionId;
String couponId;
int isDelete;
int isTakeOut;
int batch;
String orderDiscountPrice;
String dishesDiscountPrice;
String orderPercentPrice;
String finalPayPrice;
String activityNoPrice;
String activityDiscountPrice;
String totalDiscountPrice;
int orderSource;
dynamic address;
dynamic discountPercent;
dynamic discountAmount;
dynamic discountType;
dynamic discountMoney;
dynamic overTime;
List<OrderProductListBean> orderProductVOList;
dynamic moneyReturnList;
dynamic goodsReturnList;
dynamic moneyReturnVOList;
dynamic goodsReturnVOList;
dynamic moneyReturnActionHistoryList;
dynamic goodsReturnActionHistoryList;
String currentTime;
dynamic tablePrice;
String tableName;
String balance;
String money;
dynamic prodNum;
bool onCredit;
OrderInfoVo orderInfoVo;
String endPayTime;
String orderSumPrice;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = this.id;
map['createTime'] = this.createTime;
map['createUser'] = this.createUser;
map['updateTime'] = this.updateTime;
map['updateUser'] = this.updateUser;
map['tenantCode'] = this.tenantCode;
map['storeId'] = this.storeId;
map['storeName'] = this.storeName;
map['tableId'] = this.tableId;
map['orderType'] = this.orderType;
map['clearTable'] = this.clearTable;
map['mid'] = this.mid;
map['parentId'] = this.parentId;
map['parentCode'] = this.parentCode;
map['orderCode'] = this.orderCode;
map['dayFlowCode'] = this.dayFlowCode;
map['orderStatus'] = this.orderStatus;
map['sendStatus'] = this.sendStatus;
map['payStatus'] = this.payStatus;
map['memberAccount'] = this.memberAccount;
map['logisticsId'] = this.logisticsId;
map['shipperCode'] = this.shipperCode;
map['logisticsName'] = this.logisticsName;
map['logisticsNum'] = this.logisticsNum;
map['logisticsCase'] = this.logisticsCase;
map['refundStatus'] = this.refundStatus;
map['addressExt'] = this.addressExt;
map['postFee'] = this.postFee;
map['orderSum'] = this.orderSum;
map['paySum'] = this.paySum;
map['paySumSub'] = this.paySumSub;
map['accountPay'] = this.accountPay;
map['couponSubPrice'] = this.couponSubPrice;
map['customPrice'] = this.customPrice;
map['removeDecimal'] = this.removeDecimal;
map['isSubscribe'] = this.isSubscribe;
map['subcribeTime'] = this.subcribeTime;
map['sendTime'] = this.sendTime;
map['confirmTime'] = this.confirmTime;
map['returnMoneyTime'] = this.returnMoneyTime;
map['notes'] = this.notes;
map['prepayId'] = this.prepayId;
map['payTime'] = this.payTime;
map['payChannel'] = this.payChannel;
map['payNum'] = this.payNum;
map['promotionId'] = this.promotionId;
map['couponId'] = this.couponId;
map['isDelete'] = this.isDelete;
map['isTakeOut'] = this.isTakeOut;
map['batch'] = this.batch;
map['orderDiscountPrice'] = this.orderDiscountPrice;
map['dishesDiscountPrice'] = this.dishesDiscountPrice;
map['orderPercentPrice'] = this.orderPercentPrice;
map['finalPayPrice'] = this.finalPayPrice;
map['activityNoPrice'] = this.activityNoPrice;
map['activityDiscountPrice'] = this.activityDiscountPrice;
map['totalDiscountPrice'] = this.totalDiscountPrice;
map['orderSource'] = this.orderSource;
map['address'] = this.address;
map['discountPercent'] = this.discountPercent;
map['discountAmount'] = this.discountAmount;
map['discountType'] = this.discountType;
map['discountMoney'] = this.discountMoney;
map['overTime'] = this.overTime;
if (this.orderProductVOList != null) {
map['orderProductVOList'] = this.orderProductVOList.map((v) => v.toJson()).toList();
}
map['moneyReturnList'] = this.moneyReturnList;
map['goodsReturnList'] = this.goodsReturnList;
map['moneyReturnVOList'] = this.moneyReturnVOList;
map['goodsReturnVOList'] = this.goodsReturnVOList;
map['moneyReturnActionHistoryList'] = this.moneyReturnActionHistoryList;
map['goodsReturnActionHistoryList'] = this.goodsReturnActionHistoryList;
map['currentTime'] = this.currentTime;
map['tablePrice'] = this.tablePrice;
map['tableName'] = this.tableName;
map['balance'] = this.balance;
map['money'] = this.money;
map['prodNum'] = this.prodNum;
map['onCredit'] = this.onCredit;
if (this.orderInfoVo != null) {
map['orderInfoVo'] = this.orderInfoVo.toJson();
}
map['endPayTime'] = this.endPayTime;
map['orderSumPrice'] = this.orderSumPrice;
return map;
}
}
/// orderNum : 0
/// productNum : 0
/// mins : 1
/// memberVO : {"vipNo":"1406879717390286848","nickname":"","headimg":"","userType":true,"sex":"0","level":1,"addressId":null,"remark":null,"phone":"15827991714","createTime":"2021-07-10 15:44:23","birth":"1993-02-19","balance":"0.00","money":"9999608.09","points":"1147","isBind":true,"memberRankVo":{"id":"1402947503522840576","rankName":"黄金会员","rankOrigin":8888,"rankContent":"","rankImg":"","status":true,"nextId":"1402947503522840577","nextName":"钻石会员","nextOrigin":null},"age":28}
/// postAge : "0.00"
/// price : "208.00"
/// orderSum : "208.00"
/// discountAmount : null
/// promotionInfoList : null
/// couponList : null
/// threshold : "0"
/// freePostAge : "0"
/// orderProductList : null
class OrderInfoVo {
OrderInfoVo({
int orderNum,
int productNum,
int mins,
MemberVO memberVO,
String postAge,
String price,
String orderSum,
dynamic discountAmount,
dynamic promotionInfoList,
dynamic couponList,
String threshold,
String freePostAge,
dynamic orderProductList,}){
this.orderNum = orderNum;
this.productNum = productNum;
this.mins = mins;
this.memberVO = memberVO;
this.postAge = postAge;
this.price = price;
this.orderSum = orderSum;
this.discountAmount = discountAmount;
this.promotionInfoList = promotionInfoList;
this.couponList = couponList;
this.threshold = threshold;
this.freePostAge = freePostAge;
this.orderProductList = orderProductList;
}
OrderInfoVo.fromJson(dynamic json) {
this.orderNum = json['orderNum'];
this.productNum = json['productNum'];
this.mins = json['mins'];
this.memberVO = json['memberVO'] != null ? MemberVO.fromJson(json['memberVO']) : null;
this.postAge = json['postAge'];
this.price = json['price'];
this.orderSum = json['orderSum'];
this.discountAmount = json['discountAmount'];
this.promotionInfoList = json['promotionInfoList'];
this.couponList = json['couponList'];
this.threshold = json['threshold'];
this.freePostAge = json['freePostAge'];
this.orderProductList = json['orderProductList'];
}
int orderNum;
int productNum;
int mins;
MemberVO memberVO;
String postAge;
String price;
String orderSum;
dynamic discountAmount;
dynamic promotionInfoList;
dynamic couponList;
String threshold;
String freePostAge;
dynamic orderProductList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['orderNum'] = this.orderNum;
map['productNum'] = this.productNum;
map['mins'] = this.mins;
if (this.memberVO != null) {
map['memberVO'] = this.memberVO.toJson();
}
map['postAge'] = this.postAge;
map['price'] = this.price;
map['orderSum'] = this.orderSum;
map['discountAmount'] = this.discountAmount;
map['promotionInfoList'] = this.promotionInfoList;
map['couponList'] = this.couponList;
map['threshold'] = this.threshold;
map['freePostAge'] = this.freePostAge;
map['orderProductList'] = this.orderProductList;
return map;
}
}
/// vipNo : "1406879717390286848"
/// nickname : ""
/// headimg : ""
/// userType : true
/// sex : "0"
/// level : 1
/// addressId : null
/// remark : null
/// phone : "15827991714"
/// createTime : "2021-07-10 15:44:23"
/// birth : "1993-02-19"
/// balance : "0.00"
/// money : "9999608.09"
/// points : "1147"
/// isBind : true
/// memberRankVo : {"id":"1402947503522840576","rankName":"黄金会员","rankOrigin":8888,"rankContent":"","rankImg":"","status":true,"nextId":"1402947503522840577","nextName":"钻石会员","nextOrigin":null}
/// age : 28
class MemberVO {
MemberVO({
String vipNo,
String nickname,
String headimg,
bool userType,
String sex,
int level,
dynamic addressId,
dynamic remark,
String phone,
String createTime,
String birth,
String balance,
String money,
String points,
bool isBind,
MemberRankVo memberRankVo,
int age,}){
this.vipNo = vipNo;
this.nickname = nickname;
this.headimg = headimg;
this.userType = userType;
this.sex = sex;
this.level = level;
this.addressId = addressId;
this.remark = remark;
this.phone = phone;
this.createTime = createTime;
this.birth = birth;
this.balance = balance;
this.money = money;
this.points = points;
this.isBind = isBind;
this.memberRankVo = memberRankVo;
this.age = age;
}
MemberVO.fromJson(dynamic json) {
this.vipNo = json['vipNo'];
this.nickname = json['nickname'];
this.headimg = json['headimg'];
this.userType = json['userType'];
this.sex = json['sex'];
this.level = json['level'];
this.addressId = json['addressId'];
this.remark = json['remark'];
this.phone = json['phone'];
this.createTime = json['createTime'];
this.birth = json['birth'];
this.balance = json['balance'];
this.money = json['money'];
this.points = json['points'];
this.isBind = json['isBind'];
this.memberRankVo = json['memberRankVo'] != null ? MemberRankVo.fromJson(json['memberRankVo']) : null;
this.age = json['age'];
}
String vipNo;
String nickname;
String headimg;
bool userType;
String sex;
int level;
dynamic addressId;
dynamic remark;
String phone;
String createTime;
String birth;
String balance;
String money;
String points;
bool isBind;
MemberRankVo memberRankVo;
int age;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['vipNo'] = this.vipNo;
map['nickname'] = this.nickname;
map['headimg'] = this.headimg;
map['userType'] = this.userType;
map['sex'] = this.sex;
map['level'] = this.level;
map['addressId'] = this.addressId;
map['remark'] = this.remark;
map['phone'] = this.phone;
map['createTime'] = this.createTime;
map['birth'] = this.birth;
map['balance'] = this.balance;
map['money'] = this.money;
map['points'] = this.points;
map['isBind'] = this.isBind;
if (this.memberRankVo != null) {
map['memberRankVo'] = this.memberRankVo.toJson();
}
map['age'] = this.age;
return map;
}
}
/// id : "1402947503522840576"
/// rankName : "黄金会员"
/// rankOrigin : 8888
/// rankContent : ""
/// rankImg : ""
/// status : true
/// nextId : "1402947503522840577"
/// nextName : "钻石会员"
/// nextOrigin : null
class MemberRankVo {
MemberRankVo({
String id,
String rankName,
int rankOrigin,
String rankContent,
String rankImg,
bool status,
String nextId,
String nextName,
dynamic nextOrigin,}){
this.id = id;
this.rankName = rankName;
this.rankOrigin = rankOrigin;
this.rankContent = rankContent;
this.rankImg = rankImg;
this.status = status;
this.nextId = nextId;
this.nextName = nextName;
this.nextOrigin = nextOrigin;
}
MemberRankVo.fromJson(dynamic json) {
this.id = json['id'];
this.rankName = json['rankName'];
this.rankOrigin = json['rankOrigin'];
this.rankContent = json['rankContent'];
this.rankImg = json['rankImg'];
this.status = json['status'];
this.nextId = json['nextId'];
this.nextName = json['nextName'];
this.nextOrigin = json['nextOrigin'];
}
String id;
String rankName;
int rankOrigin;
String rankContent;
String rankImg;
bool status;
String nextId;
String nextName;
dynamic nextOrigin;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = this.id;
map['rankName'] = this.rankName;
map['rankOrigin'] = this.rankOrigin;
map['rankContent'] = this.rankContent;
map['rankImg'] = this.rankImg;
map['status'] = this.status;
map['nextId'] = this.nextId;
map['nextName'] = this.nextName;
map['nextOrigin'] = this.nextOrigin;
return map;
}
}

1624
lib/retrofit/data/order_info.dart

File diff suppressed because it is too large Load Diff

388
lib/retrofit/data/order_product_vo.dart

@ -0,0 +1,388 @@
class OrderProductVOList {
OrderProductVOList({
ActInfo actInfo,
AdditionalComment additionalComment,
int buyNum,
String canApplyIntervention,
Comment comment,
String commentStatus,
String discountAmount,
String id,
String productId,
String productName,
String returnCode,
String returnStatus,
String returnType,
String sellPrice,
String skuId,
String skuImg,
String skuNameStr,
}) {
this.actInfo = actInfo;
this.additionalComment = additionalComment;
this.buyNum = buyNum;
this.canApplyIntervention = canApplyIntervention;
this.comment = comment;
this.commentStatus = commentStatus;
this.discountAmount = discountAmount;
this.id = id;
this.productId = productId;
this.productName = productName;
this.returnCode = returnCode;
this.returnStatus = returnStatus;
this.returnType = returnType;
this.sellPrice = sellPrice;
this.skuId = skuId;
this.skuImg = skuImg;
this.skuNameStr = skuNameStr;
}
OrderProductVOList.fromJson(dynamic json) {
this.actInfo =
json['actInfo'] != null ? ActInfo.fromJson(json['actInfo']) : null;
this.additionalComment = json['additionalComment'] != null
? AdditionalComment.fromJson(json['additionalComment'])
: null;
this.buyNum = json['buyNum'];
this.canApplyIntervention = json['canApplyIntervention'];
this.comment =
json['comment'] != null ? Comment.fromJson(json['comment']) : null;
this.commentStatus = json['commentStatus'];
this.discountAmount = json['discountAmount'];
this.id = json['id'];
this.productId = json['productId'];
this.productName = json['productName'];
this.returnCode = json['returnCode'];
this.returnStatus = json['returnStatus'];
this.returnType = json['returnType'];
this.sellPrice = json['sellPrice'];
this.skuId = json['skuId'];
this.skuImg = json['skuImg'];
this.skuNameStr = json['skuNameStr'];
}
ActInfo actInfo;
AdditionalComment additionalComment;
int buyNum;
String canApplyIntervention;
Comment comment;
String commentStatus;
String discountAmount;
String id;
String productId;
String productName;
String returnCode;
String returnStatus;
String returnType;
String sellPrice;
String skuId;
String skuImg;
String skuNameStr;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (this.actInfo != null) {
map['actInfo'] = this.actInfo.toJson();
}
if (this.additionalComment != null) {
map['additionalComment'] = this.additionalComment.toJson();
}
map['buyNum'] = this.buyNum;
map['canApplyIntervention'] = this.canApplyIntervention;
if (this.comment != null) {
map['comment'] = this.comment.toJson();
}
map['commentStatus'] = this.commentStatus;
map['discountAmount'] = this.discountAmount;
map['id'] = this.id;
map['productId'] = this.productId;
map['productName'] = this.productName;
map['returnCode'] = this.returnCode;
map['returnStatus'] = this.returnStatus;
map['returnType'] = this.returnType;
map['sellPrice'] = this.sellPrice;
map['skuId'] = this.skuId;
map['skuImg'] = this.skuImg;
map['skuNameStr'] = this.skuNameStr;
return map;
}
}
/// couponDiscountAmount : 0
/// couponDiscountRate : 0
/// couponId : 0
/// couponType : 0
/// discountAmount : 0
/// discountRate : 0
/// promotionId : 0
/// promotionType : 0
class ActInfo {
ActInfo({
String couponDiscountAmount,
int couponDiscountRate,
String couponId,
int couponType,
String discountAmount,
int discountRate,
String promotionId,
int promotionType,
}) {
this.couponDiscountAmount = couponDiscountAmount;
this.couponDiscountRate = couponDiscountRate;
this.couponId = couponId;
this.couponType = couponType;
this.discountAmount = discountAmount;
this.discountRate = discountRate;
this.promotionId = promotionId;
this.promotionType = promotionType;
}
ActInfo.fromJson(dynamic json) {
this.couponDiscountAmount = json['couponDiscountAmount'];
this.couponDiscountRate = json['couponDiscountRate'];
this.couponId = json['couponId'];
this.couponType = json['couponType'];
this.discountAmount = json['discountAmount'];
this.discountRate = json['discountRate'];
this.promotionId = json['promotionId'];
this.promotionType = json['promotionType'];
}
String couponDiscountAmount;
int couponDiscountRate;
String couponId;
int couponType;
String discountAmount;
int discountRate;
String promotionId;
int promotionType;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponDiscountAmount'] = this.couponDiscountAmount;
map['couponDiscountRate'] = this.couponDiscountRate;
map['couponId'] = this.couponId;
map['couponType'] = this.couponType;
map['discountAmount'] = this.discountAmount;
map['discountRate'] = this.discountRate;
map['promotionId'] = this.promotionId;
map['promotionType'] = this.promotionType;
return map;
}
}
class AdditionalComment {
AdditionalComment({
int bizType,
String commentImgs,
bool commentImgsFlag,
int commentStar,
String commentText,
int descStar,
bool hideFlag,
int id,
bool isDelete,
int likeNum,
int logisticsStar,
int mid,
int orderProductId,
int parentId,
int productId,
bool sensitiveFlag,
int serviceStar,
int storeId,
}) {
this.bizType = bizType;
this.commentImgs = commentImgs;
this.commentImgsFlag = commentImgsFlag;
this.commentStar = commentStar;
this.commentText = commentText;
this.descStar = descStar;
this.hideFlag = hideFlag;
this.id = id;
this.isDelete = isDelete;
this.likeNum = likeNum;
this.logisticsStar = logisticsStar;
this.mid = mid;
this.orderProductId = orderProductId;
this.parentId = parentId;
this.productId = productId;
this.sensitiveFlag = sensitiveFlag;
this.serviceStar = serviceStar;
this.storeId = storeId;
}
AdditionalComment.fromJson(dynamic json) {
this.bizType = json['bizType'];
this.commentImgs = json['commentImgs'];
this.commentImgsFlag = json['commentImgsFlag'];
this.commentStar = json['commentStar'];
this.commentText = json['commentText'];
this.descStar = json['descStar'];
this.hideFlag = json['hideFlag'];
this.id = json['id'];
this.isDelete = json['isDelete'];
this.likeNum = json['likeNum'];
this.logisticsStar = json['logisticsStar'];
this.mid = json['mid'];
this.orderProductId = json['orderProductId'];
this.parentId = json['parentId'];
this.productId = json['productId'];
this.sensitiveFlag = json['sensitiveFlag'];
this.serviceStar = json['serviceStar'];
this.storeId = json['storeId'];
}
int bizType;
String commentImgs;
bool commentImgsFlag;
int commentStar;
String commentText;
int descStar;
bool hideFlag;
int id;
bool isDelete;
int likeNum;
int logisticsStar;
int mid;
int orderProductId;
int parentId;
int productId;
bool sensitiveFlag;
int serviceStar;
int storeId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = this.bizType;
map['commentImgs'] = this.commentImgs;
map['commentImgsFlag'] = this.commentImgsFlag;
map['commentStar'] = this.commentStar;
map['commentText'] = this.commentText;
map['descStar'] = this.descStar;
map['hideFlag'] = this.hideFlag;
map['id'] = this.id;
map['isDelete'] = this.isDelete;
map['likeNum'] = this.likeNum;
map['logisticsStar'] = this.logisticsStar;
map['mid'] = this.mid;
map['orderProductId'] = this.orderProductId;
map['parentId'] = this.parentId;
map['productId'] = this.productId;
map['sensitiveFlag'] = this.sensitiveFlag;
map['serviceStar'] = this.serviceStar;
map['storeId'] = this.storeId;
return map;
}
}
class Comment {
Comment({
int bizType,
String commentImgs,
bool commentImgsFlag,
int commentStar,
String commentText,
int descStar,
bool hideFlag,
int id,
bool isDelete,
int likeNum,
int logisticsStar,
int mid,
int orderProductId,
int parentId,
int productId,
bool sensitiveFlag,
int serviceStar,
int storeId,
}) {
this.bizType = bizType;
this.commentImgs = commentImgs;
this.commentImgsFlag = commentImgsFlag;
this.commentStar = commentStar;
this.commentText = commentText;
this.descStar = descStar;
this.hideFlag = hideFlag;
this.id = id;
this.isDelete = isDelete;
this.likeNum = likeNum;
this.logisticsStar = logisticsStar;
this.mid = mid;
this.orderProductId = orderProductId;
this.parentId = parentId;
this.productId = productId;
this.sensitiveFlag = sensitiveFlag;
this.serviceStar = serviceStar;
this.storeId = storeId;
}
Comment.fromJson(dynamic json) {
this.bizType = json['bizType'];
this.commentImgs = json['commentImgs'];
this.commentImgsFlag = json['commentImgsFlag'];
this.commentStar = json['commentStar'];
this.commentText = json['commentText'];
this.descStar = json['descStar'];
this.hideFlag = json['hideFlag'];
this.id = json['id'];
this.isDelete = json['isDelete'];
this.likeNum = json['likeNum'];
this.logisticsStar = json['logisticsStar'];
this.mid = json['mid'];
this.orderProductId = json['orderProductId'];
this.parentId = json['parentId'];
this.productId = json['productId'];
this.sensitiveFlag = json['sensitiveFlag'];
this.serviceStar = json['serviceStar'];
this.storeId = json['storeId'];
}
int bizType;
String commentImgs;
bool commentImgsFlag;
int commentStar;
String commentText;
int descStar;
bool hideFlag;
int id;
bool isDelete;
int likeNum;
int logisticsStar;
int mid;
int orderProductId;
int parentId;
int productId;
bool sensitiveFlag;
int serviceStar;
int storeId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = this.bizType;
map['commentImgs'] = this.commentImgs;
map['commentImgsFlag'] = this.commentImgsFlag;
map['commentStar'] = this.commentStar;
map['commentText'] = this.commentText;
map['descStar'] = this.descStar;
map['hideFlag'] = this.hideFlag;
map['id'] = this.id;
map['isDelete'] = this.isDelete;
map['likeNum'] = this.likeNum;
map['logisticsStar'] = this.logisticsStar;
map['mid'] = this.mid;
map['orderProductId'] = this.orderProductId;
map['parentId'] = this.parentId;
map['productId'] = this.productId;
map['sensitiveFlag'] = this.sensitiveFlag;
map['serviceStar'] = this.serviceStar;
map['storeId'] = this.storeId;
return map;
}
}

619
lib/retrofit/data/placeOrderFirst.dart

@ -1,491 +1,136 @@
import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
/// addressId : 0
/// isSubscribe : true
/// isTakeOut : 0
/// notes : ""
/// numberOfPeople : 0
/// orderSource : 0
/// orderType : 0
/// orderTypeId : 0
/// parentCode : ""
/// parentId : 0
/// payChannel : 0
/// promotionInfoDTO : {"couponId":0,"promotionId":0}
/// recMobile : ""
/// shoppingCartSkuItemList : []
/// skuItemDTOList : [{"buyNum":0,"couponId":0,"couponName":"","discountPercent":0,"orderId":0,"orderProductId":0,"platterList":[{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}],"promotionId":0,"promotionName":"","refundNum":0,"skuId":0}]
/// source : 0
/// storeId : 0
/// subcribeTime : ""
/// tableId : 0
class PlaceOrderFirst {
PlaceOrderFirst({
String addressId,
bool isSubscribe,
int isTakeOut,
String notes,
String numberOfPeople,
int orderSource,
int orderType,
int orderTypeId,
String parentCode,
int parentId,
int payChannel,
PlaceOrderFirstPromotionInfoDTO promotionInfoDTO,
String recMobile,
List<ShoppingCartSkuItemListBean> shoppingCartSkuItemList,
List<SkuItemDTOList> skuItemDTOList,
int source,
String storeId,
String subcribeTime,
int tableId,}){
_addressId = addressId;
_isSubscribe = isSubscribe;
_isTakeOut = isTakeOut;
_notes = notes;
_numberOfPeople = numberOfPeople;
_orderSource = orderSource;
_orderType = orderType;
_orderTypeId = orderTypeId;
_parentCode = parentCode;
_parentId = parentId;
_payChannel = payChannel;
_promotionInfoDTO = promotionInfoDTO;
_recMobile = recMobile;
_skuItemDTOList = skuItemDTOList;
_shoppingCartSkuItemList = shoppingCartSkuItemList;
_source = source;
_storeId = storeId;
_subcribeTime = subcribeTime;
_tableId = tableId;
}
PlaceOrderFirst.fromJson(dynamic json) {
_addressId = json['addressId'];
_isSubscribe = json['isSubscribe'];
_isTakeOut = json['isTakeOut'];
_notes = json['notes'];
_numberOfPeople = json['numberOfPeople'];
_orderSource = json['orderSource'];
_orderType = json['orderType'];
_orderTypeId = json['orderTypeId'];
_parentCode = json['parentCode'];
_parentId = json['parentId'];
_payChannel = json['payChannel'];
_promotionInfoDTO = json['promotionInfoDTO'] != null ? PlaceOrderFirstPromotionInfoDTO.fromJson(json['promotionInfoDTO']) : null;
_recMobile = json['recMobile'];
if (json['skuItemDTOList'] != null) {
_skuItemDTOList = [];
json['skuItemDTOList'].forEach((v) {
_skuItemDTOList.add(SkuItemDTOList.fromJson(v));
});
}
if (json['shoppingCartSkuItemList'] != null) {
_shoppingCartSkuItemList = [];
json['shoppingCartSkuItemList'].forEach((v) {
_shoppingCartSkuItemList.add(ShoppingCartSkuItemListBean.fromJson(v));
});
}
_source = json['source'];
_storeId = json['storeId'];
_subcribeTime = json['subcribeTime'];
_tableId = json['tableId'];
}
String _addressId;
bool _isSubscribe;
int _isTakeOut;
String _notes;
String _numberOfPeople;
int _orderSource;
int _orderType;
int _orderTypeId;
String _parentCode;
int _parentId;
int _payChannel;
PlaceOrderFirstPromotionInfoDTO _promotionInfoDTO;
String _recMobile;
List<SkuItemDTOList> _skuItemDTOList;
List<ShoppingCartSkuItemListBean> _shoppingCartSkuItemList;
int _source;
String _storeId;
String _subcribeTime;
int _tableId;
set addressId(String value) {
_addressId = value;
}
String get addressId => _addressId;
bool get isSubscribe => _isSubscribe;
int get isTakeOut => _isTakeOut;
String get notes => _notes;
String get numberOfPeople => _numberOfPeople;
int get orderSource => _orderSource;
int get orderType => _orderType;
int get orderTypeId => _orderTypeId;
String get parentCode => _parentCode;
int get parentId => _parentId;
int get payChannel => _payChannel;
PlaceOrderFirstPromotionInfoDTO get promotionInfoDTO => _promotionInfoDTO;
String get recMobile => _recMobile;
List<SkuItemDTOList> get skuItemDTOList => _skuItemDTOList;
List<ShoppingCartSkuItemListBean> get shoppingCartSkuItemList => _shoppingCartSkuItemList;
int get source => _source;
String get storeId => _storeId;
String get subcribeTime => _subcribeTime;
int get tableId => _tableId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['addressId'] = _addressId;
map['isSubscribe'] = _isSubscribe;
map['isTakeOut'] = _isTakeOut;
map['notes'] = _notes;
map['numberOfPeople'] = _numberOfPeople;
map['orderSource'] = _orderSource;
map['orderType'] = _orderType;
map['orderTypeId'] = _orderTypeId;
map['parentCode'] = _parentCode;
map['parentId'] = _parentId;
map['payChannel'] = _payChannel;
if (_promotionInfoDTO != null) {
map['promotionInfoDTO'] = _promotionInfoDTO.toJson();
}
map['recMobile'] = _recMobile;
if (_skuItemDTOList != null) {
map['skuItemDTOList'] = _skuItemDTOList.map((v) => v.toJson()).toList();
}
if (_shoppingCartSkuItemList != null) {
map['shoppingCartSkuItemList'] = _shoppingCartSkuItemList.map((v) => v.toJson()).toList();
}
map['source'] = _source;
map['storeId'] = _storeId;
map['subcribeTime'] = _subcribeTime;
map['tableId'] = _tableId;
return map;
}
set isSubscribe(bool value) {
_isSubscribe = value;
}
set isTakeOut(int value) {
_isTakeOut = value;
}
set notes(String value) {
_notes = value;
}
set numberOfPeople(String value) {
_numberOfPeople = value;
}
set orderSource(int value) {
_orderSource = value;
}
set orderType(int value) {
_orderType = value;
}
set orderTypeId(int value) {
_orderTypeId = value;
}
set parentCode(String value) {
_parentCode = value;
}
set parentId(int value) {
_parentId = value;
}
set payChannel(int value) {
_payChannel = value;
}
set promotionInfoDTO(PlaceOrderFirstPromotionInfoDTO value) {
_promotionInfoDTO = value;
}
set recMobile(String value) {
_recMobile = value;
}
set skuItemDTOList(List<SkuItemDTOList> value) {
_skuItemDTOList = value;
}
set shoppingCartSkuItemList(List<ShoppingCartSkuItemListBean> value) {
_shoppingCartSkuItemList = value;
}
set source(int value) {
_source = value;
}
set storeId(String value) {
_storeId = value;
}
set subcribeTime(String value) {
_subcribeTime = value;
}
set tableId(int value) {
_tableId = value;
}
}
/// buyNum : 0
/// couponId : 0
/// couponName : ""
/// discountPercent : 0
/// orderId : 0
/// orderProductId : 0
/// platterList : [{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}]
/// promotionId : 0
/// promotionName : ""
/// refundNum : 0
/// skuId : 0
class SkuItemDTOList {
SkuItemDTOList({
int buyNum,
int couponId,
String couponName,
int discountPercent,
int orderId,
int orderProductId,
List<PlatterList> platterList,
int promotionId,
String promotionName,
int refundNum,
String skuId,}){
_buyNum = buyNum;
_couponId = couponId;
_couponName = couponName;
_discountPercent = discountPercent;
_orderId = orderId;
_orderProductId = orderProductId;
_platterList = platterList;
_promotionId = promotionId;
_promotionName = promotionName;
_refundNum = refundNum;
_skuId = skuId;
}
SkuItemDTOList.fromJson(dynamic json) {
_buyNum = json['buyNum'];
_couponId = json['couponId'];
_couponName = json['couponName'];
_discountPercent = json['discountPercent'];
_orderId = json['orderId'];
_orderProductId = json['orderProductId'];
if (json['platterList'] != null) {
_platterList = [];
json['platterList'].forEach((v) {
_platterList.add(PlatterList.fromJson(v));
});
}
_promotionId = json['promotionId'];
_promotionName = json['promotionName'];
_refundNum = json['refundNum'];
_skuId = json['skuId'];
}
int _buyNum;
int _couponId;
String _couponName;
int _discountPercent;
int _orderId;
int _orderProductId;
List<PlatterList> _platterList;
int _promotionId;
String _promotionName;
int _refundNum;
String _skuId;
int get buyNum => _buyNum;
int get couponId => _couponId;
String get couponName => _couponName;
int get discountPercent => _discountPercent;
int get orderId => _orderId;
int get orderProductId => _orderProductId;
List<PlatterList> get platterList => _platterList;
int get promotionId => _promotionId;
String get promotionName => _promotionName;
int get refundNum => _refundNum;
String get skuId => _skuId;
set buyNum(int value) {
_buyNum = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['buyNum'] = _buyNum;
map['couponId'] = _couponId;
map['couponName'] = _couponName;
map['discountPercent'] = _discountPercent;
map['orderId'] = _orderId;
map['orderProductId'] = _orderProductId;
if (_platterList != null) {
map['platterList'] = _platterList.map((v) => v.toJson()).toList();
}
map['promotionId'] = _promotionId;
map['promotionName'] = _promotionName;
map['refundNum'] = _refundNum;
map['skuId'] = _skuId;
return map;
}
set couponId(int value) {
_couponId = value;
}
set couponName(String value) {
_couponName = value;
}
set discountPercent(int value) {
_discountPercent = value;
}
set orderId(int value) {
_orderId = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set platterList(List<PlatterList> value) {
_platterList = value;
}
set promotionId(int value) {
_promotionId = value;
}
set promotionName(String value) {
_promotionName = value;
}
set refundNum(int value) {
_refundNum = value;
}
set skuId(String value) {
_skuId = value;
}
}
/// deleted : true
/// id : 0
/// productId : 0
/// required : true
/// skuId : 0
class PlatterList {
PlatterList({
bool deleted,
int id,
String productId,
bool required,
String skuId,}){
_deleted = deleted;
_id = id;
_productId = productId;
_required = required;
_skuId = skuId;
}
PlatterList.fromJson(dynamic json) {
_deleted = json['deleted'];
_id = json['id'];
_productId = json['productId'];
_required = json['required'];
_skuId = json['skuId'];
}
bool _deleted;
int _id;
String _productId;
bool _required;
String _skuId;
bool get deleted => _deleted;
int get id => _id;
String get productId => _productId;
bool get required => _required;
String get skuId => _skuId;
set deleted(bool value) {
_deleted = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['deleted'] = _deleted;
map['id'] = _id;
map['productId'] = _productId;
map['required'] = _required;
map['skuId'] = _skuId;
return map;
}
set id(int value) {
_id = value;
}
set productId(String value) {
_productId = value;
}
set required(bool value) {
_required = value;
}
set skuId(String value) {
_skuId = value;
}
}
/// couponId : 0
/// promotionId : 0
class PlaceOrderFirstPromotionInfoDTO {
PlaceOrderFirstPromotionInfoDTO({
String couponId,
String promotionId,}){
_couponId = couponId;
_promotionId = promotionId;
}
PlaceOrderFirstPromotionInfoDTO.fromJson(dynamic json) {
_couponId = json['couponId'];
_promotionId = json['promotionId'];
}
String _couponId;
String _promotionId;
set couponId(String value) {
_couponId = value;
}
String get couponId => _couponId;
String get promotionId => _promotionId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponId'] = _couponId;
map['promotionId'] = _promotionId;
return map;
}
set promotionId(String value) {
_promotionId = value;
}
int cartNum;
String cartSum;
String addressId;
bool isSubscribe;
num isTakeOut;
String notes;
String id;
String numberOfPeople;
num orderSource;
String orderType;
num orderTypeId;
String parentCode;
String parentId;
num payChannel;
PromotionInfoDTOBean promotionInfoDTO;
String recMobile;
List<OrderProductVOList> orderProductVOList;
List<OrderProductListBean> shoppingCartSkuItemList;
List<dynamic> skuItemDTOList;
num source;
String storeId;
String subcribeTime;
String tableId;
PlaceOrderFirst(
{
this.cartNum,
this.cartSum,
this.addressId,
this.isSubscribe,
this.isTakeOut,
this.notes,
this.id,
this.numberOfPeople,
this.orderSource,
this.orderType,
this.orderTypeId,
this.parentCode,
this.parentId,
this.payChannel,
this.promotionInfoDTO,
this.recMobile,
this.orderProductVOList,
this.shoppingCartSkuItemList,
this.skuItemDTOList,
this.source,
this.storeId,
this.subcribeTime,
this.tableId});
static PlaceOrderFirst fromJson(Map<String, dynamic> json) {
if (json == null) return null;
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst();
placeOrderFirst.cartNum = json['cartNum'];
placeOrderFirst.cartSum = json['cartSum'];
placeOrderFirst.addressId = json['addressId'];
placeOrderFirst.isSubscribe = json['isSubscribe'];
placeOrderFirst.isTakeOut = json['isTakeOut'];
placeOrderFirst.notes = json['notes'];
placeOrderFirst.id = json['id'];
placeOrderFirst.numberOfPeople = json['numberOfPeople'];
placeOrderFirst.orderSource = json['orderSource'];
placeOrderFirst.orderType = json['orderType'];
placeOrderFirst.orderTypeId = json['orderTypeId'];
placeOrderFirst.parentCode = json['parentCode'];
placeOrderFirst.parentId = json['parentId'];
placeOrderFirst.payChannel = json['payChannel'];
placeOrderFirst.promotionInfoDTO =
PromotionInfoDTOBean.fromJson(json['promotionInfoDTO']);
placeOrderFirst.recMobile = json['recMobile'];
placeOrderFirst.shoppingCartSkuItemList = []..addAll(
(json['shoppingCartSkuItemList'] as List ?? [])
.map((o) => OrderProductListBean.fromJson(o)));
placeOrderFirst.orderProductVOList = []..addAll(
(json['orderProductVOList'] as List ?? [])
.map((o) => OrderProductVOList.fromJson(o)));
placeOrderFirst.skuItemDTOList = json['skuItemDTOList'];
placeOrderFirst.source = json['source'];
placeOrderFirst.storeId = json['storeId'];
placeOrderFirst.subcribeTime = json['subcribeTime'];
placeOrderFirst.tableId = json['tableId'];
return placeOrderFirst;
}
Map<String, dynamic> toJson() => {
"cartNum": cartNum,
"cartSum": cartSum,
"addressId": addressId,
"isSubscribe": isSubscribe,
"isTakeOut": isTakeOut,
"notes": notes,
"id": id,
"numberOfPeople": numberOfPeople,
"orderSource": orderSource,
"orderType": orderType,
"orderTypeId": orderTypeId,
"parentCode": parentCode,
"parentId": parentId,
"payChannel": payChannel,
"promotionInfoDTO": promotionInfoDTO == null ? null : promotionInfoDTO.toJson(),
"recMobile": recMobile,
"shoppingCartSkuItemList": shoppingCartSkuItemList == null ? null : shoppingCartSkuItemList.map((e) => e.toJson()).toList(),
"orderProductVOList": orderProductVOList == null ? null : orderProductVOList.map((e) => e.toJson()).toList(),
"skuItemDTOList": skuItemDTOList,
"source": source,
"storeId": storeId,
"subcribeTime": subcribeTime,
"tableId": tableId,
};
}
class PromotionInfoDTOBean {
String couponId;
String promotionId;
PromotionInfoDTOBean({this.couponId, this.promotionId});
static PromotionInfoDTOBean fromJson(Map<String, dynamic> json) {
if (json == null) return null;
PromotionInfoDTOBean promotionInfoDTOBean = PromotionInfoDTOBean();
promotionInfoDTOBean.couponId = json['couponId'];
promotionInfoDTOBean.promotionId = json['promotionId'];
return promotionInfoDTOBean;
}
Map<String, dynamic> toJson() => {
"couponId": couponId,
"promotionId": promotionId,
};
}

182
lib/retrofit/data/product.dart

@ -0,0 +1,182 @@
class ProductList {
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
dynamic _tenantCode;
String _storeId;
String _orderId;
String _productId;
String _productName;
String _skuId;
String _skuNameStr;
String _skuImg;
int _buyNum;
int _refundNum;
double _weight;
String _applyPrice;
String _sellPrice;
String _postPay;
int _isDelete;
String _discountAmount;
int _discountPercent;
bool _status;
int _batch;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
dynamic get tenantCode => _tenantCode;
String get storeId => _storeId;
String get orderId => _orderId;
String get productId => _productId;
String get productName => _productName;
String get skuId => _skuId;
String get skuNameStr => _skuNameStr;
String get skuImg => _skuImg;
int get buyNum => _buyNum;
int get refundNum => _refundNum;
double get weight => _weight;
String get applyPrice => _applyPrice;
String get sellPrice => _sellPrice;
String get postPay => _postPay;
int get isDelete => _isDelete;
String get discountAmount => _discountAmount;
int get discountPercent => _discountPercent;
bool get status => _status;
int get batch => _batch;
ProductList(
{String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
dynamic tenantCode,
String storeId,
String orderId,
String productId,
String productName,
String skuId,
String skuNameStr,
String skuImg,
int buyNum,
int refundNum,
double weight,
String applyPrice,
String sellPrice,
String postPay,
int isDelete,
String discountAmount,
int discountPercent,
bool status,
int batch}) {
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_tenantCode = tenantCode;
_storeId = storeId;
_orderId = orderId;
_productId = productId;
_productName = productName;
_skuId = skuId;
_skuNameStr = skuNameStr;
_skuImg = skuImg;
_buyNum = buyNum;
_refundNum = refundNum;
_weight = weight;
_applyPrice = applyPrice;
_sellPrice = sellPrice;
_postPay = postPay;
_isDelete = isDelete;
_discountAmount = discountAmount;
_discountPercent = discountPercent;
_status = status;
_batch = batch;
}
ProductList.fromJson(dynamic json) {
_id = json["id"];
_createTime = json["createTime"];
_createUser = json["createUser"];
_updateTime = json["updateTime"];
_updateUser = json["updateUser"];
_tenantCode = json["tenantCode"];
_storeId = json["storeId"];
_orderId = json["orderId"];
_productId = json["productId"];
_productName = json["productName"];
_skuId = json["skuId"];
_skuNameStr = json["skuNameStr"];
_skuImg = json["skuImg"];
_buyNum = json["buyNum"];
_refundNum = json["refundNum"];
_weight = json["weight"];
_applyPrice = json["applyPrice"];
_sellPrice = json["sellPrice"];
_postPay = json["postPay"];
_isDelete = json["isDelete"];
_discountAmount = json["discountAmount"];
_discountPercent = json["discountPercent"];
_status = json["status"];
_batch = json["batch"];
}
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["id"] = _id;
map["createTime"] = _createTime;
map["createUser"] = _createUser;
map["updateTime"] = _updateTime;
map["updateUser"] = _updateUser;
map["tenantCode"] = _tenantCode;
map["storeId"] = _storeId;
map["orderId"] = _orderId;
map["productId"] = _productId;
map["productName"] = _productName;
map["skuId"] = _skuId;
map["skuNameStr"] = _skuNameStr;
map["skuImg"] = _skuImg;
map["buyNum"] = _buyNum;
map["refundNum"] = _refundNum;
map["weight"] = _weight;
map["applyPrice"] = _applyPrice;
map["sellPrice"] = _sellPrice;
map["postPay"] = _postPay;
map["isDelete"] = _isDelete;
map["discountAmount"] = _discountAmount;
map["discountPercent"] = _discountPercent;
map["status"] = _status;
map["batch"] = _batch;
return map;
}
}

743
lib/retrofit/data/settlement_bean.dart

@ -1,3 +1,5 @@
import 'package:huixiang/retrofit/data/order_product_vo.dart';
/// addressId : 0
/// buyNum : 0
/// id : 0
@ -7,6 +9,7 @@
/// promotionInfoDTO : {"couponId":0,"promotionId":0}
class SettlementBean {
SettlementBean({
int addressId,
int buyNum,
@ -138,743 +141,3 @@ class PromotionInfoDTO {
}
}
/// actInfo : {"couponDiscountAmount":0,"couponDiscountRate":0,"couponId":0,"couponType":0,"discountAmount":0,"discountRate":0,"promotionId":0,"promotionType":0}
/// additionalComment : {"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0}
/// buyNum : 0
/// canApplyIntervention : 0
/// comment : {"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0}
/// commentStatus : 0
/// discountAmount : 0
/// id : 0
/// productId : 0
/// productName : ""
/// returnCode : ""
/// returnStatus : 0
/// returnType : 0
/// sellPrice : 0
/// skuId : 0
/// skuImg : ""
/// skuNameStr : ""
class OrderProductVOList {
OrderProductVOList({
ActInfo actInfo,
AdditionalComment additionalComment,
int buyNum,
int canApplyIntervention,
Comment comment,
int commentStatus,
int discountAmount,
int id,
int productId,
String productName,
String returnCode,
int returnStatus,
int returnType,
int sellPrice,
int skuId,
String skuImg,
String skuNameStr,}){
_actInfo = actInfo;
_additionalComment = additionalComment;
_buyNum = buyNum;
_canApplyIntervention = canApplyIntervention;
_comment = comment;
_commentStatus = commentStatus;
_discountAmount = discountAmount;
_id = id;
_productId = productId;
_productName = productName;
_returnCode = returnCode;
_returnStatus = returnStatus;
_returnType = returnType;
_sellPrice = sellPrice;
_skuId = skuId;
_skuImg = skuImg;
_skuNameStr = skuNameStr;
}
OrderProductVOList.fromJson(dynamic json) {
_actInfo = json['actInfo'] != null ? ActInfo.fromJson(json['actInfo']) : null;
_additionalComment = json['additionalComment'] != null ? AdditionalComment.fromJson(json['additionalComment']) : null;
_buyNum = json['buyNum'];
_canApplyIntervention = json['canApplyIntervention'];
_comment = json['comment'] != null ? Comment.fromJson(json['comment']) : null;
_commentStatus = json['commentStatus'];
_discountAmount = json['discountAmount'];
_id = json['id'];
_productId = json['productId'];
_productName = json['productName'];
_returnCode = json['returnCode'];
_returnStatus = json['returnStatus'];
_returnType = json['returnType'];
_sellPrice = json['sellPrice'];
_skuId = json['skuId'];
_skuImg = json['skuImg'];
_skuNameStr = json['skuNameStr'];
}
ActInfo _actInfo;
AdditionalComment _additionalComment;
int _buyNum;
int _canApplyIntervention;
Comment _comment;
int _commentStatus;
int _discountAmount;
int _id;
int _productId;
String _productName;
String _returnCode;
int _returnStatus;
int _returnType;
int _sellPrice;
int _skuId;
String _skuImg;
String _skuNameStr;
ActInfo get actInfo => _actInfo;
AdditionalComment get additionalComment => _additionalComment;
int get buyNum => _buyNum;
int get canApplyIntervention => _canApplyIntervention;
Comment get comment => _comment;
int get commentStatus => _commentStatus;
int get discountAmount => _discountAmount;
int get id => _id;
int get productId => _productId;
String get productName => _productName;
String get returnCode => _returnCode;
int get returnStatus => _returnStatus;
int get returnType => _returnType;
int get sellPrice => _sellPrice;
int get skuId => _skuId;
String get skuImg => _skuImg;
String get skuNameStr => _skuNameStr;
set actInfo(ActInfo value) {
_actInfo = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actInfo != null) {
map['actInfo'] = _actInfo.toJson();
}
if (_additionalComment != null) {
map['additionalComment'] = _additionalComment.toJson();
}
map['buyNum'] = _buyNum;
map['canApplyIntervention'] = _canApplyIntervention;
if (_comment != null) {
map['comment'] = _comment.toJson();
}
map['commentStatus'] = _commentStatus;
map['discountAmount'] = _discountAmount;
map['id'] = _id;
map['productId'] = _productId;
map['productName'] = _productName;
map['returnCode'] = _returnCode;
map['returnStatus'] = _returnStatus;
map['returnType'] = _returnType;
map['sellPrice'] = _sellPrice;
map['skuId'] = _skuId;
map['skuImg'] = _skuImg;
map['skuNameStr'] = _skuNameStr;
return map;
}
set additionalComment(AdditionalComment value) {
_additionalComment = value;
}
set buyNum(int value) {
_buyNum = value;
}
set canApplyIntervention(int value) {
_canApplyIntervention = value;
}
set comment(Comment value) {
_comment = value;
}
set commentStatus(int value) {
_commentStatus = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set id(int value) {
_id = value;
}
set productId(int value) {
_productId = value;
}
set productName(String value) {
_productName = value;
}
set returnCode(String value) {
_returnCode = value;
}
set returnStatus(int value) {
_returnStatus = value;
}
set returnType(int value) {
_returnType = value;
}
set sellPrice(int value) {
_sellPrice = value;
}
set skuId(int value) {
_skuId = value;
}
set skuImg(String value) {
_skuImg = value;
}
set skuNameStr(String value) {
_skuNameStr = value;
}
}
/// bizType : 0
/// commentImgs : ""
/// commentImgsFlag : true
/// commentStar : 0
/// commentText : ""
/// descStar : 0
/// hideFlag : true
/// id : 0
/// isDelete : true
/// likeNum : 0
/// logisticsStar : 0
/// mid : 0
/// orderProductId : 0
/// parentId : 0
/// productId : 0
/// sensitiveFlag : true
/// serviceStar : 0
/// storeId : 0
class Comment {
Comment({
int bizType,
String commentImgs,
bool commentImgsFlag,
int commentStar,
String commentText,
int descStar,
bool hideFlag,
int id,
bool isDelete,
int likeNum,
int logisticsStar,
int mid,
int orderProductId,
int parentId,
int productId,
bool sensitiveFlag,
int serviceStar,
int storeId,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
Comment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_storeId = json['storeId'];
}
int _bizType;
String _commentImgs;
bool _commentImgsFlag;
int _commentStar;
String _commentText;
int _descStar;
bool _hideFlag;
int _id;
bool _isDelete;
int _likeNum;
int _logisticsStar;
int _mid;
int _orderProductId;
int _parentId;
int _productId;
bool _sensitiveFlag;
int _serviceStar;
int _storeId;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}
/// bizType : 0
/// commentImgs : ""
/// commentImgsFlag : true
/// commentStar : 0
/// commentText : ""
/// descStar : 0
/// hideFlag : true
/// id : 0
/// isDelete : true
/// likeNum : 0
/// logisticsStar : 0
/// mid : 0
/// orderProductId : 0
/// parentId : 0
/// productId : 0
/// sensitiveFlag : true
/// serviceStar : 0
/// storeId : 0
class AdditionalComment {
AdditionalComment({
int bizType,
String commentImgs,
bool commentImgsFlag,
int commentStar,
String commentText,
int descStar,
bool hideFlag,
int id,
bool isDelete,
int likeNum,
int logisticsStar,
int mid,
int orderProductId,
int parentId,
int productId,
bool sensitiveFlag,
int serviceStar,
int storeId,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
AdditionalComment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_storeId = json['storeId'];
}
int _bizType;
String _commentImgs;
bool _commentImgsFlag;
int _commentStar;
String _commentText;
int _descStar;
bool _hideFlag;
int _id;
bool _isDelete;
int _likeNum;
int _logisticsStar;
int _mid;
int _orderProductId;
int _parentId;
int _productId;
bool _sensitiveFlag;
int _serviceStar;
int _storeId;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}
/// couponDiscountAmount : 0
/// couponDiscountRate : 0
/// couponId : 0
/// couponType : 0
/// discountAmount : 0
/// discountRate : 0
/// promotionId : 0
/// promotionType : 0
class ActInfo {
ActInfo({
int couponDiscountAmount,
int couponDiscountRate,
int couponId,
int couponType,
int discountAmount,
int discountRate,
int promotionId,
int promotionType,}){
_couponDiscountAmount = couponDiscountAmount;
_couponDiscountRate = couponDiscountRate;
_couponId = couponId;
_couponType = couponType;
_discountAmount = discountAmount;
_discountRate = discountRate;
_promotionId = promotionId;
_promotionType = promotionType;
}
ActInfo.fromJson(dynamic json) {
_couponDiscountAmount = json['couponDiscountAmount'];
_couponDiscountRate = json['couponDiscountRate'];
_couponId = json['couponId'];
_couponType = json['couponType'];
_discountAmount = json['discountAmount'];
_discountRate = json['discountRate'];
_promotionId = json['promotionId'];
_promotionType = json['promotionType'];
}
int _couponDiscountAmount;
int _couponDiscountRate;
int _couponId;
int _couponType;
int _discountAmount;
int _discountRate;
int _promotionId;
int _promotionType;
int get couponDiscountAmount => _couponDiscountAmount;
int get couponDiscountRate => _couponDiscountRate;
int get couponId => _couponId;
int get couponType => _couponType;
int get discountAmount => _discountAmount;
int get discountRate => _discountRate;
int get promotionId => _promotionId;
int get promotionType => _promotionType;
set couponDiscountAmount(int value) {
_couponDiscountAmount = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponDiscountAmount'] = _couponDiscountAmount;
map['couponDiscountRate'] = _couponDiscountRate;
map['couponId'] = _couponId;
map['couponType'] = _couponType;
map['discountAmount'] = _discountAmount;
map['discountRate'] = _discountRate;
map['promotionId'] = _promotionId;
map['promotionType'] = _promotionType;
return map;
}
set couponDiscountRate(int value) {
_couponDiscountRate = value;
}
set couponId(int value) {
_couponId = value;
}
set couponType(int value) {
_couponType = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set discountRate(int value) {
_discountRate = value;
}
set promotionId(int value) {
_promotionId = value;
}
set promotionType(int value) {
_promotionType = value;
}
}

20
lib/retrofit/data/shoppingCart.dart

@ -7,13 +7,13 @@
/// tableId : 0
class ShoppingCart {
int cartSum;
String cartSum;
int numberOfPeople;
int selected;
List<ShoppingCartSkuItemListBean> shoppingCartSkuItemList;
int storeId;
String storeId;
String storeName;
int tableId;
String tableId;
static ShoppingCart fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -30,11 +30,11 @@ class ShoppingCart {
return shoppingCartBean;
}
Map toJson() => {
Map<String, dynamic> toJson() => {
"cartSum": cartSum,
"numberOfPeople": numberOfPeople,
"selected": selected,
"shoppingCartSkuItemList": shoppingCartSkuItemList,
"shoppingCartSkuItemList": shoppingCartSkuItemList == null ? null : shoppingCartSkuItemList.map((e) => e.toJson()).toList(),
"storeId": storeId,
"storeName": storeName,
"tableId": tableId,
@ -59,8 +59,8 @@ class ShoppingCart {
class ShoppingCartSkuItemListBean {
int buyNum;
String createTime;
int groupId;
int id;
String groupId;
String id;
List<PlatterListBean> platterList;
String productId;
String productName;
@ -68,10 +68,10 @@ class ShoppingCartSkuItemListBean {
int selected;
String skuImg;
String skuName;
int skuPrice;
String skuPrice;
int skuStock;
String storeId;
int tableId;
String tableId;
static ShoppingCartSkuItemListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -126,7 +126,7 @@ class PlatterListBean {
int id;
int productId;
bool required;
int skuId;
String skuId;
static PlatterListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;

49
lib/retrofit/data/store_info.dart

@ -38,6 +38,7 @@ class StoreInfo {
String remark;
String shipAddress;
String storeName;
StoreTable storeTable;
String tenantCode;
String updateTime;
String updateUser;
@ -94,6 +95,7 @@ class StoreInfo {
..remark = json['remark'] as String
..shipAddress = json['shipAddress'] as String
..storeName = json['storeName'] as String
..storeTable = json['storeTable'] != null ? StoreTable.fromJson(json['storeTable']) : null
..tenantCode = json['tenantCode'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
@ -138,6 +140,7 @@ class StoreInfo {
'remark': this.remark,
'shipAddress': this.shipAddress,
'storeName': this.storeName,
'storeTable': this.storeTable.toJson(),
'tenantCode': this.tenantCode,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
@ -151,3 +154,49 @@ class StoreInfo {
};
}
class StoreTable {
StoreTable();
String areaId;
String id;
int isDelete;
int numberOfPeople;
String remark;
String storeId;
int tableCapacity;
String tableName;
int tableSort;
int tableType;
String tenantCode;
factory StoreTable.fromJson(Map<String, dynamic> json) => StoreTable()
..areaId = json["areaId"]
..id = json["id"]
..isDelete = json["isDelete"]
..numberOfPeople = json["numberOfPeople"]
..remark = json["remark"]
..storeId = json["storeId"]
..tableCapacity = json["tableCapacity"]
..tableName = json["tableName"]
..tableSort = json["tableSort"]
..tableType = json["tableType"]
..tenantCode = json["tenantCode"];
Map<String, dynamic> toJson() => <String, dynamic>{
"areaId": this.areaId,
"id": this.id,
"isDelete": this.isDelete,
"numberOfPeople": this.numberOfPeople,
"remark": this.remark,
"storeId": this.storeId,
"tableCapacity": this.tableCapacity,
"tableName": this.tableName,
"tableSort": this.tableSort,
"tableType": this.tableType,
"tenantCode": this.tenantCode,
};
}

70
lib/retrofit/min_api.dart

@ -1,15 +1,16 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flare_flutter/flare_testing.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/settlement_bean.dart';
import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart';
@ -42,17 +43,18 @@ abstract class MinApiService {
BuildContext context,
String token,
String tenant,
String storeId,
bool showLoading = true,
bool pay = false,
}) {
Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"};
if (tenant != null && tenant != "") {
headers["tenant"] = tenant;
}
if (pay) {
headers["Environment"] = "app";
if (storeId != null && storeId != "") {
headers["store_id"] = storeId;
}
headers["Environment"] = "app";
dio.options = BaseOptions(
connectTimeout: 60000,
receiveTimeout: 60000,
@ -83,10 +85,9 @@ abstract class MinApiService {
EasyLoading.dismiss();
}
debugPrint("code = ${response.statusCode}");
// p(jsonEncode(response.data));
p(jsonEncode(response.data));
debugPrint(jsonEncode(response.data),
wrapWidth: response.data.toString().length);
// debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length);
Map map = response.data;
if (map["code"] != 0) {
@ -124,10 +125,10 @@ abstract class MinApiService {
static void p(String msg) {
int maxStrLength = 900;
while (msg.length > maxStrLength) {
debugPrint(msg.substring(0, maxStrLength));
debugPrint(msg.substring(0, maxStrLength), wrapWidth: maxStrLength);
msg = msg.substring(maxStrLength);
}
debugPrint(msg);
debugPrint(msg, wrapWidth: maxStrLength);
}
///
@ -141,21 +142,58 @@ abstract class MinApiService {
///
@POST("shoppingcart")
Future<BaseData<ShoppingCart>> shoppingCart(
@Body() Map<String, dynamic> param, Map<String, dynamic> header);
Future<BaseData<List<ShoppingCart>>> addShoppingCart(@Body() Map<String, dynamic> param);
///
@GET("shoppingcart") ///?tableId={tableId}
Future<BaseData<List<ShoppingCart>>> getShoppingCart(@Query("tableId") int tableId);
///
@GET("shoppingcart/delCart")
Future<BaseData<bool>> clearShoppingCart();
///
@PUT("shoppingcart")
Future<BaseData<List<ShoppingCart>>> shoppingCart1(@Body() Map<String, dynamic> param);
///
@PUT("shoppingcart/single")
Future<BaseData<List<ShoppingCart>>> shoppingCartSingle(@Body() Map<String, dynamic> param);
///
@POST("order/getOrderInfo")
Future<BaseData<SettleOrderInfo>> getOrderInfo(
@Body() Map<String, dynamic> param);
Future<BaseData<SettleOrderInfo>> getOrderInfo(@Body() Map<String, dynamic> param);
///
@POST("order/getOrderDetail")
Future<BaseData<MinOrderInfo>> getOrderDetails(@Body() Map<String, dynamic> param);
///
@GET("address/queryMemberAddress")
Future<BaseData<List<Address>>> queryAddress();
///
@POST("order/placeOrderFirst")
Future<BaseData> placeOrderFirst(@Body() Map<String, dynamic> param);
Future<BaseData<DownOrder>> placeOrderFirst(@Body() Map<String, dynamic> param);
///
@POST("order/addOrder")
Future<BaseData<DownOrder>> addOrder(@Body() Map<String, dynamic> param);
///
@POST("order/settlement")
Future<BaseData<WxPay>> settlementWx(@Body() Map<String, dynamic> param);
///
@POST("order/settlement")
Future<BaseData> settlementApi(@Body() Map<String, dynamic> param);
///
@POST("store/getStore")
Future<BaseData> queryStoreInfo1(@Body() Map<String, dynamic> param);
//
@GET("order/getParentInfo?tableId={tableId}")
Future<BaseData> getParentInfo(@Path("tableId") String tableId);
}

241
lib/retrofit/min_api.g.dart

@ -64,9 +64,8 @@ class _MinApiService implements MinApiService {
}
@override
Future<BaseData<ShoppingCart>> shoppingCart(param, header) async {
Future<BaseData<List<ShoppingCart>>> addShoppingCart(param) async {
ArgumentError.checkNotNull(param, 'param');
ArgumentError.checkNotNull(header, 'header');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
@ -79,13 +78,108 @@ class _MinApiService implements MinApiService {
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ShoppingCart>.fromJson(
final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data,
(json) => ShoppingCart.fromJson(json),
(json) => (json as List<dynamic>)
.map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<List<ShoppingCart>>> getShoppingCart(tableId) async {
ArgumentError.checkNotNull(tableId, 'tableId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{r'tableId': tableId};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('shoppingcart',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<bool>> clearShoppingCart() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'shoppingcart/delCart',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<bool>.fromJson(
_result.data,
(json) => json as bool,
);
return value;
}
@override
Future<BaseData<List<ShoppingCart>>> shoppingCart1(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('shoppingcart',
queryParameters: queryParameters,
options: RequestOptions(
method: 'PUT',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<List<ShoppingCart>>> shoppingCartSingle(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'shoppingcart/single',
queryParameters: queryParameters,
options: RequestOptions(
method: 'PUT',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<ShoppingCart>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<ShoppingCart>(
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<SettleOrderInfo>> getOrderInfo(param) async {
ArgumentError.checkNotNull(param, 'param');
@ -110,7 +204,52 @@ class _MinApiService implements MinApiService {
}
@override
Future<BaseData<dynamic>> placeOrderFirst(param) async {
Future<BaseData<MinOrderInfo>> getOrderDetails(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'order/getOrderDetail',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<MinOrderInfo>.fromJson(
_result.data,
(json) => MinOrderInfo.fromJson(json),
);
return value;
}
@override
Future<BaseData<List<Address>>> queryAddress() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'address/queryMemberAddress',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<Address>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<Address>((i) => Address.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<DownOrder>> placeOrderFirst(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
@ -125,9 +264,53 @@ class _MinApiService implements MinApiService {
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
final value = BaseData<DownOrder>.fromJson(
_result.data,
(json) => json as dynamic,
(json) => DownOrder.fromJson(json),
);
return value;
}
@override
Future<BaseData<DownOrder>> addOrder(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('order/addOrder',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<DownOrder>.fromJson(
_result.data,
(json) => DownOrder.fromJson(json),
);
return value;
}
@override
Future<BaseData<WxPay>> settlementWx(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('order/settlement',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<WxPay>.fromJson(
_result.data,
(json) => WxPay.fromJson(json),
);
return value;
}
@ -153,4 +336,48 @@ class _MinApiService implements MinApiService {
);
return value;
}
@override
Future<BaseData<dynamic>> queryStoreInfo1(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('store/getStore',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> getParentInfo(tableId) async {
ArgumentError.checkNotNull(tableId, 'tableId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'order/getParentInfo?tableId=$tableId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
}

16
lib/retrofit/retrofit_api.dart

@ -92,9 +92,9 @@ abstract class ApiService {
EasyLoading.dismiss();
}
debugPrint("code = ${response.statusCode}");
// p(jsonEncode(response.data));
p(jsonEncode(response.data));
debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length);
// debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length * 10);
Map map = response.data;
if (map["code"] != 0) {
@ -133,11 +133,11 @@ abstract class ApiService {
int maxStrLength = 900;
//1000
while (msg.length > maxStrLength) {
debugPrint(msg.substring(0, maxStrLength));
debugPrint(msg.substring(0, maxStrLength), wrapWidth: maxStrLength);
msg = msg.substring(maxStrLength);
}
//
print(msg);
debugPrint(msg, wrapWidth: maxStrLength);
}
///
@ -268,13 +268,11 @@ abstract class ApiService {
///
@POST("/information/list")
Future<BaseData<PageInfo<Article>>> queryArticle(
@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Article>>> queryArticle(@Body() Map<String, dynamic> param);
///banner查询
@POST("/banner/page")
Future<BaseData<PageInfo<BannerData>>> queryBanner(
@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<BannerData>>> queryBanner(@Body() Map<String, dynamic> param);
///
@GET("/home/brand")
@ -359,7 +357,7 @@ abstract class ApiService {
Future<BaseData<bool>> report(@Body() Map<String, String> map);
///
@GET("/order/orderCancel?id={id}")
@GET("/order/cancel/{id}")
Future<BaseData<bool>> orderCancel(@Path("id") String id);
///

3
lib/retrofit/retrofit_api.g.dart

@ -1168,7 +1168,7 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/order/orderCancel?id=$id',
'/order/cancel/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -1281,7 +1281,6 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<dynamic>> follow(followId) async {
ArgumentError.checkNotNull(followId, 'followId');

519
lib/settlement/settlement.dart

@ -0,0 +1,519 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
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:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
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';
import 'package:huixiang/settlement/settlement_view/activity_coupon_remarks.dart';
import 'package:huixiang/settlement/settlement_view/distribution.dart';
import 'package:huixiang/settlement/settlement_view/edit_phone.dart';
import 'package:huixiang/settlement/settlement_view/pay_method.dart';
import 'package:huixiang/settlement/settlement_view/settlement_activity.dart';
import 'package:huixiang/settlement/settlement_view/settlement_coupon.dart';
import 'package:huixiang/settlement/settlement_view/settlement_order_commodity.dart';
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:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class Settlement extends StatefulWidget {
final arguments;
Settlement({this.arguments});
@override
State<StatefulWidget> createState() {
return _Settlement();
}
}
class _Settlement extends State<Settlement> {
MinApiService minService;
Function(int type) callback;
StoreInfo storeInfo;
// ShoppingCart shopCarGoods;
SettleOrderInfo settleOrderInfo;
MinOrderInfo minOrderInfo;
int selectedBtn = 0;
String remakers = "";
String parentCode = "";
String parentId = "";
int payChannel = 4;
int tableId = 0;
Address address;
CouponListBean couponListBean;
PromotionInfoListBean promotion;
String mobile;
bool placeOrder = false;
@override
void initState() {
super.initState();
tableId = widget.arguments["tableId"] ?? 0;
parentCode = widget.arguments["parentCode"] ?? "";
parentId = widget.arguments["parentId"] ?? "";
storeInfo = widget.arguments["storeInfo"];
if (tableId == 0) {
placeOrder = true;
}
SharedPreferences.getInstance().then((value) {
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
String storeId = value.getString("storeId");
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
queryOrderInfo(null, selectedBtn, null, 0, null);
});
}
///
queryOrderInfo(
addressId,
isTake,
memberCouponId,
orderId,
promotionId,
) async {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId,
"isTake": isTake,
"memberCouponId": memberCouponId,
"orderId": orderId,
"promotionId": promotionId
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
settleOrderInfo = baseData.data;
if (settleOrderInfo.orderProductList == null ||
settleOrderInfo.orderProductList.length == 0) {
queryOrderDetails(parentId);
}
});
}
}
///
queryOrderDetails(id) async {
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": id,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
minOrderInfo = baseData.data;
});
}
}
queryAddress(int selectedBtn) async {
this.selectedBtn = selectedBtn;
if (address != null) {
queryOrderInfo(address.id, selectedBtn, null, 0, null);
return;
}
BaseData<List<Address>> baseDate =
await minService.queryAddress().catchError((error) {});
BMFCoordinate bmfCoordinate = BMFCoordinate(
double.tryParse(storeInfo.latitude),
double.tryParse(storeInfo.longitude),
);
if (baseDate != null && baseDate.isSuccess) {
address = baseDate.data[0];
for (int i = 1; i < baseDate.data.length; i++) {
Address address1 = baseDate.data[i];
BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert(
coordinate: BMFCoordinate(
double.tryParse(address.longitude),
double.tryParse(address.latitude),
),
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL);
BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert(
coordinate: BMFCoordinate(
double.tryParse(address1.longitude),
double.tryParse(address1.latitude),
),
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL);
double mi = await BMFCalculateUtils.getLocationDistance(
bmfCoordinate, coordinate);
double mi1 = await BMFCalculateUtils.getLocationDistance(
bmfCoordinate, coordinate1);
if (mi1 < mi) {
address = address1;
}
}
queryOrderInfo(address.id, selectedBtn, null, 0, null);
}
}
PlaceOrderFirst placeOrderFirst;
DownOrder downOrder;
///
queryPlaceOrderFirst() async {
for (int i = 0; i < settleOrderInfo.orderProductList.length; i++) {
settleOrderInfo.orderProductList.forEach((element1) {
if (settleOrderInfo.orderProductList[i].productId ==
element1.productId) {
settleOrderInfo.orderProductList[i].skuId = element1.skuId;
}
});
}
placeOrderFirst = PlaceOrderFirst();
placeOrderFirst.cartNum = settleOrderInfo.orderNum;
placeOrderFirst.cartSum = settleOrderInfo.price;
placeOrderFirst.addressId = address == null ? null : address.id;
placeOrderFirst.isSubscribe = false;
placeOrderFirst.isTakeOut = selectedBtn;
placeOrderFirst.notes = remakers;
placeOrderFirst.numberOfPeople = "0";
placeOrderFirst.orderSource = 2;
placeOrderFirst.orderType = "0";
placeOrderFirst.orderTypeId = 0;
placeOrderFirst.parentCode = parentCode; //
placeOrderFirst.parentId = parentId; //
placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId =
promotion != null ? promotion.id : "";
placeOrderFirst.promotionInfoDTO.couponId =
couponListBean != null ? couponListBean.id : "";
placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList;
placeOrderFirst.skuItemDTOList = [];
placeOrderFirst.source = 1;
placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = "$tableId";
if (tableId == 0) {
///
BaseData<DownOrder> baseData = await minService
.placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) {
print("error: $error");
});
if (baseData != null && baseData.isSuccess) {
placeOrder = true;
this.downOrder = baseData.data;
querySettlement();
}
} else {
///
BaseData<DownOrder> baseData;
if (parentId == "") {
baseData = await minService
.placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) {
print("error: $error");
});
} 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);
setState(() {});
}
}
}
///
querySettlement() async {
placeOrderFirst.id = parentId != "" ? parentId : downOrder.id;
placeOrderFirst.orderProductVOList = downOrder.orderProductVOList;
if (placeOrderFirst.payChannel == 1) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
BaseData<WxPay> baseData = await minService
.settlementWx(placeOrderFirst.toJson())
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data;
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
prepayId: wxPay.prepayId,
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
toOrderDetails(placeOrderFirst.id);
});
}
} else {
BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson())
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
toOrderDetails(placeOrderFirst.id);
}
}
}
toOrderDetails(String orderId) {
Navigator.of(context).popAndPushNamed(
'/router/order_details',
arguments: {
"id": orderId,
},
);
}
@override
Widget build(BuildContext context) {
return Stack(
children: [
Positioned(
top: 0,
left: 0,
right: 0,
child: Container(
height: 175.h,
color: Color(0xFF3A405A),
width: MediaQuery.of(context).size.width,
),
),
Positioned(
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
background: Color(0xFF3A405A),
leadingColor: Colors.white,
title: S.of(context).dingdanjiesuan,
titleColor: Colors.white,
brightness: Brightness.dark,
titleSize: 18.sp,
),
body: Container(
child: Column(
children: [
Expanded(
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
child: Column(
children: [
DistributionMode(
queryOrderInfo,
queryAddress,
storeInfo,
address,
),
SizedBox(
height: 16,
),
///
EditPhoneWidget(
storeInfo,
mobileChange,
),
///
SettlementOrderCommodity(
selectedBtn,
settleOrderInfo,
minOrderInfo,
),
////
ActivityCouponRemarks(
couponCart,
activityCart,
settleOrderInfo,
coupons,
promotions,
couponCount(),
),
///
PayMethod(payChannelCheck),
],
),
),
),
),
flex: 1,
),
Container(
height: 54.h,
color: Colors.white,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Spacer(),
Text(
S.of(context).heji,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
Text(
minOrderInfo != null
? "${minOrderInfo.orderSumPrice}"
: "${settleOrderInfo == null ? "0" : settleOrderInfo.price}",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
SizedBox(
width: 28,
),
RoundButton(
width: 103.w,
height: 54.h,
text: placeOrder ? S.current.jiesuan : "下单",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h,
),
callback: () {
queryPlaceOrderFirst();
},
),
],
),
),
],
),
),
),
left: 0,
right: 0,
top: 0,
bottom: 0,
),
],
);
}
payChannelCheck(int payChannel) {
this.payChannel = payChannel;
}
mobileChange(String mobile) {
this.mobile = mobile;
}
int couponCount() {
if (settleOrderInfo == null ||
settleOrderInfo.couponList == null ||
settleOrderInfo.couponList.length == 0) return 0;
int count = 0;
settleOrderInfo.couponList.forEach((element) {
if (element.tenantCode == "") {
count++;
}
});
return count;
}
String coupons = "";
String promotions = "";
///
couponCart() async {
CouponListBean couponBean = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return SettlementCoupon(settleOrderInfo, storeInfo,
couponBean: couponListBean);
},
);
if (couponBean != null) {
this.couponListBean = couponBean;
coupons = couponListBean.promotionName;
promotions = "";
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
couponListBean != null ? couponListBean.id : null,
0,
null,
);
}
}
///
activityCart() async {
// if (couponListBean != null) return;
PromotionInfoListBean pro = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return SettlementActivity(settleOrderInfo, storeInfo);
},
);
if (pro != null) {
this.promotion = pro;
promotions = promotion.name;
coupons = "";
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
null,
0,
promotion != null ? promotion.id : null,
);
}
}
}

165
lib/settlement/settlement_view/activity.dart

@ -0,0 +1,165 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/round_button.dart';
class ActivityWidget extends StatefulWidget {
final PromotionInfoListBean promotionInfoListBean;
final StoreInfo storeInfo;
final int index;
final Function() callback;
ActivityWidget(this.promotionInfoListBean, this.storeInfo, this.index, { this.callback, });
@override
State<StatefulWidget> createState() {
return _ActivityWidget();
}
}
class _ActivityWidget extends State<ActivityWidget> {
@override
Widget build(BuildContext context) {
return Container(
height: 177,
width: double.infinity,
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
children: [
Expanded(
child: Row(
children: [
MImage(
widget.promotionInfoListBean != null
? widget.promotionInfoListBean.image
: "",
fit: BoxFit.cover,
aspectRatio: 1,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.promotionInfoListBean != null
? (widget.promotionInfoListBean.name ?? "")
: "",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Colors.black,
),
),
Text(
widget.promotionInfoListBean != null
? (widget.promotionInfoListBean.description ?? "")
: "",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF727272),
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(
height: 8.w,
),
IconText(
"全场通用",
leftIcon: Icons.circle,
iconColor: Color(0xFF32A060),
iconSize: 6,
textStyle: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
IconText(
widget.promotionInfoListBean != null
? ("${widget.promotionInfoListBean.activityStartTime.split(" ")[0].replaceAll("-", ".")}-${widget.promotionInfoListBean.activityEndTime.split(" ")[0].replaceAll("-", ".")}")
: "",
leftIcon: Icons.circle,
iconColor: Color(0xFF32A060),
iconSize: 6,
textStyle: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
],
),
),
],
),
flex: 1,
),
SizedBox(
height: 12.w,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"*优惠券与活动不可同时选择",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFACACAC),
),
),
if (widget.promotionInfoListBean != null &&
widget.promotionInfoListBean.canPartake)
RoundButton(
text: "选择活动",
textColor: Colors.white,
padding: EdgeInsets.symmetric(
vertical: 4,
horizontal: 8,
),
backgroup: Color(0xFF32A060),
radius: 12,
callback: widget.callback,
)
else
Text(
"条件未达",
style: TextStyle(
color: Color(0xFF868686),
fontWeight: MyFontWeight.medium,
fontSize: 12.sp,
),
),
],
),
],
),
);
}
}

203
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -0,0 +1,203 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ActivityCouponRemarks extends StatefulWidget {
final Function() couponCart;
final Function() activityCart;
final String coupons;
final String promotions;
final SettleOrderInfo settleOrderInfo;
final int couponCount;
ActivityCouponRemarks(
this.couponCart,
this.activityCart,
this.settleOrderInfo,
this.coupons,
this.promotions,
this.couponCount,
);
@override
State<StatefulWidget> createState() {
return _ActivityCouponRemarks();
}
}
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(8),
),
height: 122.h,
margin: EdgeInsets.only(
left: 16,
right: 16,
top: 15,
),
padding: EdgeInsets.only(
left: 16,
right: 16,
top: 14,
bottom: 14,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
onTap: () {
widget.activityCart();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
S.of(context).huodong,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Text(
activityText(),
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
),
],
),
),
SizedBox(
height: 13,
),
InkWell(
onTap: () {
widget.couponCart();
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
S.of(context).youhuiquan,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Text(
couponText(),
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
),
],
),
),
SizedBox(
height: 13,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
S.of(context).beizhu,
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Text(
"口味、面包硬度等",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.semi_bold,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
),
],
),
],
),
);
}
String activityText() {
String promotion = "";
if (widget.promotions == null || widget.promotions == "") {
promotion = "未选择任何活动";
if (widget.settleOrderInfo == null || widget.settleOrderInfo.promotionInfoList == null) {
promotion = "暂无可选活动";
} else if (widget.coupons != null && widget.coupons != "") {
promotion = "活动与优惠券不可同享";
}
} else {
promotion = widget.promotions;
}
return promotion;
}
String couponText() {
String coupon = "";
if (widget.coupons == null || widget.coupons == "") {
coupon = "未选择任何优惠券";
if (widget.settleOrderInfo == null || widget.settleOrderInfo.couponList == null) {
coupon = "暂无可选优惠券";
} else if (widget.promotions != null && widget.promotions != "") {
coupon = "优惠券与活动不可同享";
}
} else {
coupon = widget.coupons;
}
return coupon;
}
}

268
lib/settlement/settlement_view/coupon.dart

@ -0,0 +1,268 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/separator.dart';
class CouponWidget extends StatefulWidget {
final CouponListBean couponList;
final StoreInfo storeInfo;
final bool selected;
CouponWidget(
this.couponList,
this.storeInfo, {
this.selected = false,
});
@override
State<StatefulWidget> createState() {
return _CouponWidget();
}
}
class _CouponWidget extends State<CouponWidget> {
@override
Widget build(BuildContext context) {
return Container(
height: 170,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 14.h, bottom: 8.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text(
"¥",
style: TextStyle(
fontSize: 22.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xff32A060),
),
),
SizedBox(
height: 4.h,
),
Text(
"${double.tryParse(widget.couponList.discountAmount).toInt()}",
style: TextStyle(
fontSize: 40.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
),
),
],
),
),
Text(
S
.of(context)
.manyuankeyong(widget.couponList.fullAmount),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff32A060),
),
),
],
),
flex: 1,
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
padding: EdgeInsets.fromLTRB(4, 2, 4, 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),
),
child: Text(
S.of(context).shangjiaquan,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFF7A1A),
),
),
),
SizedBox(
width: 8.w,
),
Expanded(
child: Text(
widget.storeInfo.storeName,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xff353535),
),
),
flex: 1,
),
],
),
Text(
widget.couponList.promotionName,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff727272),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
S.of(context).quanchangtongyong,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12.sp,
),
),
if (widget.couponList.usable)
Container(
margin: EdgeInsets.only(right: 23.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pop(widget.couponList);
},
child: Image.asset(
widget.selected
? "assets/image/icon_radio_unselected.png"
: "assets/image/icon_radio_selected.png",
width: 24,
height: 24,
),
),
),
],
),
],
),
),
],
),
),
flex: (widget.couponList?.isEx ?? false) ? 97 : 97,
),
Container(
padding: EdgeInsets.symmetric(horizontal: 23.w),
child: MySeparator(
width: 5.w,
height: 1.h,
color: Color(0xFF353535),
),
),
Expanded(
flex: (widget.couponList?.isEx ?? false) ? 56 : 42,
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 23.w,
vertical: 8.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).xiangqing,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 10.sp,
),
),
GestureDetector(
child: Icon(
(!(widget.couponList?.isEx ?? false))
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
), //
onTap: () {
setState(() {
widget.couponList.isEx =
!(widget.couponList.isEx ?? false);
});
},
),
],
),
if (widget.couponList?.isEx ?? false)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
S.of(context).shiyongriqi,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 10.sp,
),
),
Text(
(widget.couponList.useStartTime == null &&
widget.couponList.useEndTime == null)
? S.of(context).quantian
: "${widget.couponList.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${widget.couponList.useEndTime.replaceAll("-", ".").split(" ")[0]}",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 10.sp,
),
),
],
),
],
),
),
),
],
),
);
}
}

357
lib/settlement/settlement_view/distribution.dart

@ -0,0 +1,357 @@
import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class DistributionMode extends StatefulWidget {
final Function(
String addressId,
int isTake,
String memberCouponId,
int orderId,
String promotionId,
) queryOrderInfo;
final Function(int selectedBtn) queryAddress;
final StoreInfo storeInfo;
final Address address;
DistributionMode(
this.queryOrderInfo, this.queryAddress, this.storeInfo, this.address);
@override
State<StatefulWidget> createState() {
return _DistributionMode();
}
}
class _DistributionMode extends State<DistributionMode> {
List<String> addressBgs = [
"assets/svg/dingdan_ziqu.svg",
"assets/svg/dingdan_waimai.svg",
"assets/svg/dingdan_wuliu.svg",
];
BMFCoordinate myLatLng;
String distance = "0";
int selectedBtn = 0;
@override
void initState() {
super.initState();
startLocation();
}
///
void startLocation() async {
Location.getInstance()
.aMapFlutterLocation
.onResultCallback()
.listen((event) {
if (event != null &&
event["latitude"] != null &&
event["longitude"] != null) {
print("location: $event");
if (event["latitude"] is String && event["longitude"] is String) {
myLatLng = BMFCoordinate(double.tryParse(event["latitude"]),
double.tryParse(event["longitude"]));
} else {
myLatLng = BMFCoordinate(event["latitude"], event["longitude"]);
}
calculate();
Location.getInstance().stopLocation();
}
});
Location.getInstance().prepareLoc();
Location.getInstance().startLocation(context);
}
calculate() async {
BMFCoordinate bmfCoordinate = BMFCoordinate(
double.tryParse(widget.storeInfo.latitude),
double.tryParse(widget.storeInfo.longitude),
);
distance = await AppUtils.calculateDistance(bmfCoordinate, myLatLng);
setState(() {});
}
@override
Widget build(BuildContext context) {
return Container(
height: 143.h,
margin: EdgeInsets.only(
left: 16,
right: 16,
top: 10,
),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
color: Color(0x80FFFFFF),
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
addressBgs[selectedBtn],
width: double.infinity,
height: double.infinity,
fit: BoxFit.fill,
),
),
Column(
children: [
Container(
height: 50.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
selectedBtn = 0;
widget.queryOrderInfo(
null, selectedBtn, null, 0, null);
},
child: Container(
height: 50.h,
alignment: Alignment.center,
child: Text(
S.of(context).daodianziqu,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
),
),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
selectedBtn = 1;
widget.queryAddress(selectedBtn);
},
child: Container(
height: 50.h,
alignment: Alignment.center,
child: Text(
S.of(context).waimaipeisong,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
SmartDialog.showToast("该功能暂未开放!",
alignment: Alignment.center);
},
child: Container(
height: 50.h,
alignment: Alignment.center,
child: Text(
S.of(context).kuaidiwuliu,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
),
),
),
],
),
),
selectedBtn == 0
? Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Column(
children: [
Row(
children: [
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Text(
widget.storeInfo != null
? (widget.storeInfo.storeName ?? "")
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
height: 6,
),
Text(
widget.storeInfo != null
? widget.storeInfo.address
: "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
],
),
),
SizedBox(
width: 18,
),
Stack(
alignment: Alignment.center,
children: [
Column(
children: [
Image.asset(
"assets/image/map.png",
height: 61.h,
width: 61.w,
),
],
),
Column(
children: [
RoundButton(
width: 41.w,
height: 13,
text: distance.length > 3
? "${distance}km"
: "距离您${distance}km",
textColor: Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold,
radius: 7.5,
backgroup: Colors.white,
fontSize: 7.sp,
),
Image.asset(
"assets/image/landmark.png",
height: 24.h,
width: 24.w,
),
],
),
],
),
],
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
),
],
),
)
: Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_permission_location.png",
height: 24.h,
width: 24.w,
),
Text(
"张先生",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
width: 13,
),
Expanded(
child: Text(
"12309090909",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
),
),
InkWell(
onTap: () {
setState(() {
Navigator.of(context).popAndPushNamed(
'/router/manage_address_page');
});
},
child: Icon(
Icons.keyboard_arrow_right,
size: 24,
),
),
],
),
Padding(
padding: EdgeInsets.only(top: 4, left: 25),
child: Text(
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
),
],
),
),
],
),
],
),
);
}
}

150
lib/settlement/settlement_view/edit_phone.dart

@ -0,0 +1,150 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class EditPhoneWidget extends StatefulWidget {
final StoreInfo storeInfo;
final Function(String headMobile) mobileChange;
EditPhoneWidget(this.storeInfo, this.mobileChange);
@override
State<StatefulWidget> createState() {
return _EditPhoneWidget();
}
}
class _EditPhoneWidget extends State<EditPhoneWidget> {
bool isEdit = false;
TextEditingController _vc;
@override
void initState() {
// TODO: implement initState
super.initState();
_vc = TextEditingController(
text: widget.storeInfo != null ? widget.storeInfo.headMobile : "");
}
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(
left: 16,
right: 16,
),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(
horizontal: 12.w,
vertical: 15.h,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).yuliudianhua,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4C4C4C),
),
),
SizedBox(
width: 50,
),
Expanded(
child: isEdit
? Container(
height: 25.h,
alignment: Alignment.centerRight,
child: TextField(
controller: _vc,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF4C4C4C),
),
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.center,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
hintText: "",
hintStyle: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
textInputAction: TextInputAction.next,
inputFormatters: [LengthLimitingTextInputFormatter(11)],
cursorColor: Colors.grey,
),
)
: Container(
height: 25.h,
alignment: Alignment.centerRight,
child: Text(
widget.storeInfo != null
? widget.storeInfo.headMobile
: "",
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4C4C4C),
),
),
),
),
GestureDetector(
onTap: () {
String mobile = _vc.text;
if (mobile != null && AppUtils.isPhone(mobile)) {
widget.mobileChange(mobile);
widget.storeInfo.headMobile = mobile;
}
setState(() {
this.isEdit = !this.isEdit;
});
},
child: Container(
padding: EdgeInsets.all(8),
child: isEdit
? Icon(
Icons.check,
size: 14.w,
color: Color(0xFF32A060),
)
: Image.asset(
"assets/image/pen.png",
height: 14.h,
width: 14.w,
),
),
),
],
),
);
}
}

163
lib/settlement/settlement_view/pay_method.dart

@ -0,0 +1,163 @@
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';
class PayMethod extends StatefulWidget {
final Function(int payChannel) payChannelCheck;
PayMethod(this.payChannelCheck);
@override
State<StatefulWidget> createState() {
return _PayMethod();
}
}
class _PayMethod extends State<PayMethod> {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 12.h,
bottom: 4.h,
),
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 20.h,
bottom: 20.h,
),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color(0x000000).withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12.0,
),
],
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: MyFontWeight.regular,
),
),
),
GestureDetector(
onTap: () {
setState(() {
checkIndex = 1;
});
widget.payChannelCheck(4);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
checkView(1),
Text(
S.of(context).pingtaiyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,),
),
],
),
),
SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
setState(() {
checkIndex = 2;
});
widget.payChannelCheck(3);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
checkView(2),
Text(
S.of(context).dianpuyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
),
SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
setState(() {
checkIndex = 3;
widget.payChannelCheck(1);
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
checkView(3),
Spacer(),
Image.asset("assets/image/icon_we_chat.png"),
Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
),
],
),
),
],
),
);
}
var checkIndex = 1;
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(right: 16.w),
alignment: Alignment.center,
child: Image.asset(
checkIndex != index
? "assets/image/icon_radio_unselected.png"
: "assets/image/icon_radio_selected.png",
width: 15.w,
height: 15.h,
),
);
}
}

174
lib/settlement/settlement_view/settlement_activity.dart

@ -0,0 +1,174 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/settlement/settlement_view/activity.dart';
import 'package:huixiang/settlement/settlement_view/coupon.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class SettlementActivity extends StatefulWidget {
final StoreInfo storeInfo;
final SettleOrderInfo settleOrderInfo;
SettlementActivity(this.settleOrderInfo, this.storeInfo);
@override
State<StatefulWidget> createState() {
return _SettlementActivity();
}
}
class _SettlementActivity extends State<SettlementActivity> {
List<PromotionInfoListBean> promotionInfoCan = [];
List<PromotionInfoListBean> promotionInfoNo = [];
@override
void initState() {
super.initState();
promotionInfoCan.clear();
promotionInfoNo.clear();
if (widget.settleOrderInfo != null &&
widget.settleOrderInfo.promotionInfoList != null &&
widget.settleOrderInfo.promotionInfoList.length > 0) {
widget.settleOrderInfo.promotionInfoList.forEach((element) {
if (element.canPartake) {
promotionInfoCan.add(element);
} else {
promotionInfoNo.add(element);
}
});
setState(() {});
}
}
@override
Widget build(BuildContext context) {
return StatefulBuilder(
builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
width: double.infinity,
height: MediaQuery.of(context).size.height / 3 * 2,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: 8,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"可参加的活动(${promotionInfoCan.length})",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.png",
width: 24,
height: 24,
),
),
],
),
),
Container(
padding: EdgeInsets.only(
top: 8,
left: 16,
right: 16,
),
child: ListView.builder(
itemCount: (promotionInfoCan == null ||
promotionInfoCan.length == 0)
? 0
: promotionInfoCan.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return ActivityWidget(
promotionInfoCan[position],
widget.storeInfo,
position,
callback: (){
Navigator.of(context).pop(promotionInfoCan[position]);
},
);
},
),
),
if (promotionInfoNo != null || promotionInfoNo.length > 0)
Container(
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: 8,
),
child: Text(
"不可参加的活动",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
if (promotionInfoNo != null || promotionInfoNo.length > 0)
Container(
padding: EdgeInsets.only(
top: 8,
left: 16,
right: 16,
),
child: ListView.builder(
itemCount: (promotionInfoNo == null ||
promotionInfoNo.length == 0)
? 0
: promotionInfoNo.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return ActivityWidget(
promotionInfoNo[position],
widget.storeInfo,
position,
);
},
),
),
],
),
),
);
},
);
}
}

166
lib/settlement/settlement_view/settlement_coupon.dart

@ -0,0 +1,166 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/settlement/settlement_view/coupon.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class SettlementCoupon extends StatefulWidget {
final StoreInfo storeInfo;
final SettleOrderInfo settleOrderInfo;
final CouponListBean couponBean;
SettlementCoupon(
this.settleOrderInfo,
this.storeInfo, {
this.couponBean,
});
@override
State<StatefulWidget> createState() {
return _SettlementCoupon();
}
}
class _SettlementCoupon extends State<SettlementCoupon> {
List<CouponListBean> couponCan = [];
List<CouponListBean> couponNo = [];
@override
void initState() {
super.initState();
couponCan.clear();
couponNo.clear();
if (widget.settleOrderInfo != null &&
widget.settleOrderInfo.couponList != null &&
widget.settleOrderInfo.couponList.length > 0) {
widget.settleOrderInfo.couponList.forEach((element) {
if (element.usable) {
couponCan.add(element);
} else {
couponNo.add(element);
}
});
setState(() {});
}
}
@override
Widget build(BuildContext context) {
return StatefulBuilder(
builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
width: double.infinity,
height: MediaQuery.of(context).size.height / 3 * 2,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: 8,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"可用优惠券(${couponCan.length})",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/cancel.png",
width: 24,
height: 24,
),
),
],
),
),
Container(
padding: EdgeInsets.only(
top: 8,
left: 16,
right: 16,
),
child: ListView.builder(
itemCount: couponCan == null ? 0 : couponCan.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return CouponWidget(
couponCan[position],
widget.storeInfo,
selected: widget.couponBean == couponCan[position],
);
},
),
),
if (couponNo != null || couponNo.length > 0)
Container(
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: 8,
),
child: Text(
"不可用优惠券",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
if (couponNo != null || couponNo.length > 0)
Container(
padding: EdgeInsets.only(
top: 8,
left: 16,
right: 16,
),
child: ListView.builder(
itemCount: couponNo == null ? 0 : couponNo.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return CouponWidget(
couponNo[position],
widget.storeInfo,
);
},
),
),
],
),
),
);
},
);
}
}

98
lib/store/store_view/settlement_order_commodity.dart → lib/settlement/settlement_view/settlement_order_commodity.dart

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
@ -9,16 +9,18 @@ import 'package:huixiang/view_widget/separator.dart';
class SettlementOrderCommodity extends StatefulWidget {
final int isTakeOut;
final List<ProductListBean> orderInfo;
final List<Map<String, dynamic>> shopCarGood;
final SettleOrderInfo settleOrderInfo;
final MinOrderInfo minOrderInfo;
SettlementOrderCommodity(this.orderInfo, this.isTakeOut,this.shopCarGood,this.settleOrderInfo);
SettlementOrderCommodity(
this.isTakeOut, this.settleOrderInfo, this.minOrderInfo);
@override
State<StatefulWidget> createState() {
return _SettlementOrderCommodity();
}
}
class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
@ -66,24 +68,34 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
}
List<Widget> commodityList() {
if (widget.orderInfo == null) return [];
if (widget.settleOrderInfo == null) return [];
List<Widget> widgets = [];
if (widget.orderInfo != null) {
widgets.addAll(
widget.orderInfo.map((e) => commodityItem(e)).toList());
if (widget.minOrderInfo != null) {
widgets.addAll(widget.minOrderInfo.orderProductVOList
.map((e) => commodityItem(e))
.toList());
} else if (widget.settleOrderInfo != null) {
widgets.addAll(widget.settleOrderInfo.orderProductList
.map((e) => commodityItem(e))
.toList());
}
widgets.add(SizedBox(height: 20.h));
if (widget.isTakeOut != 0) {
//
widgets.add(discountItem(
widgets.add(
discountItem(
Color(0xFFFF7A1A),
widget.isTakeOut == 1
? S.of(context).peisongfei
: S.of(context).yunfei,
"",
"+${widget.settleOrderInfo?.postAge??"0"}"
));
(widget.minOrderInfo != null)
? "+${widget.minOrderInfo?.postFee ?? "0"}"
: "+${widget.settleOrderInfo?.postAge ?? "0"}",
),
);
}
widgets.add(Container(
@ -101,20 +113,13 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
return widgets;
}
Widget commodityItem(ProductListBean productList) {
Map<String,dynamic> goodsBuyInfo;
widget.shopCarGood.forEach((element) {
if(element["id"] == productList.id){
goodsBuyInfo = element;
return;
}
});
Widget commodityItem(OrderProductListBean productList) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
children: [
MImage(
productList.imgPath,
productList.skuImg,
width: 44.w,
height: 44,
fit: BoxFit.cover,
@ -145,7 +150,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
),
),
Text(
"x${goodsBuyInfo["count"]}",
"x${productList.buyNum}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
@ -160,8 +165,8 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
Expanded(
flex: 1,
child: Text(
productList.weight != null
? "${productList.weight}kg"
productList.skuNameStr != null
? "${productList.skuNameStr ?? ""}"
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -171,7 +176,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
),
),
Text(
S.of(context).yuan_(productList.price),
S.of(context).yuan_(productList.sellPrice),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12.sp,
@ -318,24 +323,42 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
children: [
Expanded(
child: Text(
S.of(context).gongjijianshangpin((widget.orderInfo != null &&
widget.orderInfo != null)
? widget.orderInfo.length
S.of(context).gongjijianshangpin((widget.minOrderInfo != null)
? ((widget.minOrderInfo != null)
? widget.minOrderInfo.orderProductVOList.length
: "0")
: (widget.settleOrderInfo != null)
? widget.settleOrderInfo.orderProductList.length
: "0"),
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.semi_bold),
fontWeight: MyFontWeight.semi_bold,
),
),
flex: 1,
),
Container(
child: Text(
"已优惠:¥${(widget.minOrderInfo != null) ? (widget.minOrderInfo.discountAmount ?? "0") : (widget.settleOrderInfo.discountAmount ?? "0")}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7B7B7B),
fontWeight: MyFontWeight.medium,
),
),
),
SizedBox(
width: 15.w,
),
Container(
child: Text(
S.of(context).jiesuanjine,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
fontWeight: MyFontWeight.semi_bold),
fontWeight: MyFontWeight.semi_bold,
),
),
),
SizedBox(
@ -347,19 +370,20 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold),
)
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
);
}
String totalPrice() {
if (widget.shopCarGood == null) return "";
double totalPrice = 0;
widget.shopCarGood.forEach((element) {
totalPrice += double.tryParse(element["price"]) * element["count"];
});
return "$totalPrice";
if (widget.minOrderInfo != null &&
widget.minOrderInfo.orderProductVOList != null) {
return "${widget.minOrderInfo.orderSumPrice}";
}
if (widget.settleOrderInfo.orderProductList == null) return "";
return "${widget.settleOrderInfo.price}";
}
}

53
lib/store/scan.dart

@ -0,0 +1,53 @@
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';
class Scan {
static toScan(context, id, tenantCode, storeName) 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) {
var result = await Navigator.of(context).pushNamed('/router/qr_scan');
if (result != null && result != "") {
Uri uri = Uri.parse(result);
String table = uri.queryParameters["tableId"];
if (table != null && table != "") {
int tableId = int.tryParse(table);
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": id,
"tenant": tenantCode,
"storeName": storeName,
"tableId": tableId,
},
);
}
}
} else {
await Permission.camera.request();
}
}
}

594
lib/store/store_order.dart

@ -3,17 +3,19 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/people_num.dart';
import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/store/store_view/shop_car.dart';
import 'package:huixiang/store/store_view/store_activity.dart';
@ -22,9 +24,9 @@ import 'package:huixiang/store/store_view/store_order_list.dart';
import 'package:huixiang/union/union_view/union_coupon.dart';
import 'package:huixiang/union/union_view/vip.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_tab.dart';
import 'package:huixiang/view_widget/receive_success.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -41,71 +43,68 @@ class StoreOrderPage extends StatefulWidget {
}
class _StoreOrderPage extends State<StoreOrderPage>
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin*/ {
with TickerProviderStateMixin {
TabController tabcontroller;
ApiService apiService;
MinApiService minService;
StoreInfo storeInfo;
List<Activity> activitys;
RefreshController refreshController;
int allCount = 0;
double allPrice = 0;
StoreOrderListPage storeOrderListPage;
List<Map<String, dynamic>> shopCarGoods = [];
List<FindMiNiGroupList> appletProducts = [];
List<ProductListBean> shopCar = [];
ScrollController controller = ScrollController();
ShoppingCart shopCarGoods;
int tableId = 0;
String parentId = "";
String parentCode = "";
String tenant = "";
String storeId = "";
int numberOfPeople = 0;
///token
String minToken;
@override
void initState() {
super.initState();
tableId = widget.arguments["tableId"] ?? 0;
tenant = widget.arguments["tenant"];
storeId = widget.arguments["id"];
debugPrint(
"store_param tableId:$tableId tenant:$tenant storeId:$storeId");
if (tabcontroller == null)
tabcontroller = TabController(
length: 2,
vsync: this,
);
minLogin();
queryStoreInfo();
}
_fc(int count, String productId, int allCount, double allPrice) {
if (count == 0) {
int index =
shopCarGoods.indexWhere((element) => element["id"] == productId);
shopCarGoods.removeAt(index);
}
setState(() {
this.allCount = allCount;
this.allPrice = allPrice;
SharedPreferences.getInstance().then((value) {
minLogin(value);
});
}
///
minLogin() async {
final SharedPreferences value = await SharedPreferences.getInstance();
minLogin(SharedPreferences shared) async {
EasyLoading.show(status: S.of(context).zhengzaijiazai);
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
token: shared.getString('token'),
showLoading: false,
);
apiService
.minLogin(widget.arguments["id"])
.catchError((onError) {})
.then((baseData) {
apiService.minLogin(storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = widget.arguments["tenant"];
minToken = minStoreInfo["token"];
queryStoreInfo();
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
minService = MinApiService(
@ -113,26 +112,60 @@ class _StoreOrderPage extends State<StoreOrderPage>
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
showLoading: false,
);
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
if (tableId > 0) {
getParentInfo();
}
EasyLoading.dismiss();
}
});
}
///
getParentInfo() async {
BaseData baseData = await minService.getParentInfo("$tableId")
.catchError((error) {debugPrint(error);});
if (baseData != null && baseData.isSuccess) {
if (baseData.data != null) {
parentId = baseData.data["id"];
parentCode = baseData.data["parentCode"];
} else {
///TODO:
queryStoreInfo1();
}
}
}
///
queryStoreInfo1() async {
BaseData baseData = await minService.queryStoreInfo1({
"getCoupon": true,
"storeId": storeId,
"tableId": tableId,
}).catchError((error) {
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
StoreInfo storeInfo = StoreInfo.fromJson(baseData.data);
if (storeInfo.storeTable != null) {
showPeopleNum(storeInfo.storeTable.tableName);
}
}
}
///
queryStoreInfo() async {
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
);
BaseData baseData = await apiService
.queryStoreInfo(widget.arguments["id"])
.catchError((error) {
// refreshController.refreshFailed();
BaseData baseData =
await apiService.queryStoreInfo(storeId).catchError((error) {
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
// refreshController.refreshCompleted();
storeInfo = StoreInfo.fromJson(baseData.data);
activitys = storeInfo.informationVOPageVO.list
.map((e) => Activity.fromJson(e))
@ -141,41 +174,43 @@ class _StoreOrderPage extends State<StoreOrderPage>
setState(() {});
}
}
EasyLoading.dismiss();
}
RefreshController refreshController;
bool dialogShowing = false;
@override
Widget build(BuildContext context) {
return Stack(
return WillPopScope(
onWillPop: () async {
if (dialogShowing) {
debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss();
return false;
} else {
return true;
}
},
child: Stack(
children: [
Positioned(
left: 0,
right: 0,
top: 0,
bottom: 54.h,
child: DefaultTabController(
length: 2,
child: SmartRefresher(
controller: refreshController =
RefreshController(initialRefresh: false),
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
queryStoreInfo();
},
child: NestedScrollView(
controller: controller,
dragStartBehavior: DragStartBehavior.start,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
physics: BouncingScrollPhysics(),
headerSliverBuilder: (BuildContext context, bool innerScrolled) {
return [
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: SliverAppBar(
expandedHeight: (storeInfo != null &&
storeInfo.couponVOList != null)
expandedHeight:
(storeInfo != null && storeInfo.couponVOList != null)
? 470.h
: 365.h,
floating: false,
@ -209,7 +244,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
StretchMode.fadeTitle,
StretchMode.blurBackground,
],
background: Stack(
background: Container(
color: Colors.white,
child: Stack(
children: [
Positioned(
child: Column(
@ -240,7 +277,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
storeInfo.couponVOList != null)
UnionCoupon(
storeInfo,
(a) {},
_receiveCoupon,
coupon: true,
),
@ -263,6 +300,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
],
),
),
),
backgroundColor: Color(0x33FAFAFA),
centerTitle: false,
elevation: 0,
@ -307,17 +345,18 @@ class _StoreOrderPage extends State<StoreOrderPage>
];
},
body: TabBarView(
physics: BouncingScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
children: [
///
StoreOrderListPage(
widget.arguments,
activitys,
storeInfo,
shopCarGoods,
controller,
minToken,
tenant,
_queryMiNiDetail,
_productListResult,
_fc,
),
///,
@ -328,9 +367,18 @@ class _StoreOrderPage extends State<StoreOrderPage>
],
controller: tabcontroller,
),
),
),
),
), /*SmartRefresher(
controller: refreshController =
RefreshController(initialRefresh: false),
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
queryStoreInfo();
},
child:
),*/
),
Positioned(
bottom: 0,
@ -354,7 +402,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
),
),
Text(
"$allPrice",
"${shopCarGoods != null ? shopCarGoods.cartSum : "0.0"}",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.medium,
@ -400,7 +448,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
child: RoundButton(
width: 17,
height: 17,
text: "$allCount",
text: "${count()}",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
@ -414,24 +462,87 @@ class _StoreOrderPage extends State<StoreOrderPage>
),
),
],
),
);
}
toDownOrder() {
if (shopCarGoods == null || shopCarGoods.length == 0) {
SmartDialog.showToast("请选择要购买的商品~");
///
_receiveCoupon(couponId) async {
BaseData baseData = await apiService.receiveCoupon(couponId);
if (baseData != null && baseData.isSuccess) {
queryStoreInfo();
showAlertDialog();
}
}
///
showAlertDialog() {
//
showDialog(
context: context,
builder: (BuildContext context) {
return ReceiveSuccess();
},
);
}
///
showPeopleNum(String tableName) async {
var people = await showDialog(
context: context,
barrierDismissible: false,
builder: (context) {
return PeopleNumView(tableName);
},
);
if (people != null && people > 0) {
setState(() {
this.numberOfPeople = people;
});
} else {
Navigator.of(context).pop();
}
}
///
int count() {
if (shopCarGoods == null ||
shopCarGoods.shoppingCartSkuItemList == null ||
shopCarGoods.shoppingCartSkuItemList.length == 0) return 0;
int count = 0;
shopCarGoods.shoppingCartSkuItemList.forEach((element) {
count += element.buyNum;
});
return count;
}
///
toDownOrder() async {
int num = count();
if (parentId == null || parentId == "") {
if (num == 0) {
SmartDialog.showToast("请先选择您要购买的商品!~");
return;
}
getShopCarGoods();
}
Navigator.of(context).pushNamed(
await Navigator.of(context).pushNamed(
'/router/settlement',
arguments: {
"storeInfo": storeInfo,
"shopGoods": shopCarGoods,
"shopProduct": shopCar,
"tableId": tableId,
"parentCode": parentCode,
"parentId": parentId,
"shoppingCart": shopCarGoods,
},
);
getParentInfo();
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
}
Widget buildSwiper() {
@ -471,149 +582,274 @@ class _StoreOrderPage extends State<StoreOrderPage>
);
}
_productListResult(List<FindMiNiGroupList> appletProducts) {
this.appletProducts = appletProducts;
}
///
getShopCarGoods() {
if (appletProducts == null || appletProducts.length == 0) return;
shopCar = [];
if (shopCarGoods != null && shopCarGoods.length > 0) {
shopCarGoods.forEach((element) {
appletProducts.forEach((element1) {
element1.productList.forEach((element2) {
if (element["id"] == element2.id) {
shopCar.add(element2);
}
});
});
});
}
}
/// key,UI
GlobalKey shopCartKey = GlobalKey();
///
showShoppingCart() {
getShopCarGoods();
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return ShopCar(
shopCar,
shopCarGoods,
queryShopCar().then((value) {
this.shopCarGoods = value;
dialogShowing = true;
SmartDialog.show(
widget: ShopCar(
shopCartKey,
this.shopCarGoods,
clearShopCar,
toDownOrder,
(int count, String productId, allCount, allPrice) {
print("shopCarCount: $allCount allPrice: $allPrice ");
setState(() {
this.allCount = allCount;
this.allPrice = allPrice;
});
},
);
shopCartAdd,
shopCartReduce,
),
onDismiss: () {
dialogShowing = false;
},
alignmentTemp: Alignment.bottomCenter,
);
});
}
///
clearShopCar() {
if (shopCarGoods != null) shopCarGoods.clear();
calculatePrice();
clearShopCar() async {
BaseData<bool> baseData = await minService.clearShoppingCart();
if (baseData.isSuccess) {
shopCarGoods = null;
setState(() {});
}
}
///
_queryMiNiDetail(String id) async {
EasyLoading.show(status: S.current.zhengzaijiazai);
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
if (baseData != null && baseData.isSuccess) {
showStoreSelector(baseData.data, id);
}
}
///
addsShoppingCart() async {
BaseData baseDate = await apiService.creditOrder({
"parentId": widget.arguments["parentId"],
"skuImg": null,
"skuNameStr": widget.arguments["skuNameStr"],
"skuPrice": widget.arguments["skuPrice"],
"skuStock": widget.arguments["skuStock"],
});
if (baseDate != null && baseDate.isSuccess) {}
}
///
showStoreSelector(MiNiDetail miNiDetail, String id) async {
var result = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return ProductSku(miNiDetail, id);
if (miNiDetail.attrList != null && miNiDetail.attrList.length == 1) {
_addShopCar(miNiDetail, [], 1);
} else {
EasyLoading.dismiss();
dialogShowing = true;
SmartDialog.show(
widget: ProductSku(
miNiDetail,
shopCarGoods,
id,
_addShopCar,
add,
reduce,
),
onDismiss: () {
dialogShowing = false;
},
alignmentTemp: Alignment.bottomCenter,
);
if (result != null) {
result["name"] = miNiDetail.productName;
miNiDetail.productSkuVOList.forEach((e0) {
String attr1 = "";
String attr2 = "";
e0.skuAttrList.forEach((e2) {
attr1 += e2.attrValueId;
}
}
///
Future _addShopCar(MiNiDetail miNiDetail, selectSkus, int count) async {
ProductSkuVOListBean productSku;
if (selectSkus!= null && selectSkus.length == 0) {
productSku = miNiDetail.productSkuVOList.first;
} else {
productSku = miNiDetail.productSkuVOList.firstWhere((element) {
bool gg = true;
selectSkus.forEach((element1) {
if (element.skuNameStr.indexOf(element1) < 0) {
gg = false;
return gg;
}
});
(result["attr"] as List).forEach((e1) {
attr2 += e1["attrValue"];
return gg;
});
if(attr1 == attr2){
result["skuId"] = e0.id;
return;
}
if (productSku == null) return;
String skuId = productSku.id;
String skuValue = selectSkus
.toString()
.replaceAll("[", "")
.replaceAll("]", "")
.replaceAll(",", "");
if (miNiDetail != null) {
BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({
"storeId": storeInfo.id,
"storeName": storeInfo.storeName ?? "",
"numberOfPeople": numberOfPeople,
"tableId": tableId,
"parentId": parentId,
"parentCode": parentCode,
"shoppingCartSkuItemList": [
{
"buyNum": count,
"id": skuId,
"productId": miNiDetail.id,
"productName": miNiDetail.productName,
"skuName": skuValue,
"storeId": storeInfo.id,
"skuPrice": productSku.applyPrice,
"skuStock": productSku.skuStock,
"tableId": tableId,
},
],
});
if (shopCarGoods == null || shopCarGoods.length == 0) {
shopCarGoods = [];
shopCarGoods.add(result);
} else {
Map<String, dynamic> map;
shopCarGoods.forEach((element) {
if (element["id"] == result["id"]) {
map = element;
}
EasyLoading.dismiss();
if (baseDate != null && baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
if (map != null) {
int index = shopCarGoods
.indexWhere((element) => element["id"] == result["id"]);
shopCarGoods.removeAt(index);
shopCarGoods.insert(index, result);
}
}
}
///
Future<ShoppingCart> queryShopCar() async {
BaseData<List<ShoppingCart>> baseDate =
await minService.getShoppingCart(tableId);
if (baseDate != null &&
baseDate.isSuccess &&
baseDate.data != null &&
baseDate.data.length > 0) {
return baseDate.data[0];
} else {
shopCarGoods.add(result);
return null;
}
}
calculatePrice();
///1
Future<ShoppingCart> shopCartAdd(
ShoppingCartSkuItemListBean cartSkuItem) async {
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum += 1;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
this.shopCarGoods = await queryShopCar();
if (shopCartKey != null) {
shopCartKey.currentState.setState(() {});
}
setState(() {});
}
return this.shopCarGoods;
}
///1
Future<ShoppingCart> shopCartReduce(
ShoppingCartSkuItemListBean cartSkuItem) async {
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum -= 1;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
this.shopCarGoods = await queryShopCar();
if (shopCartKey != null) {
shopCartKey.currentState.setState(() {});
}
setState(() {});
}
return this.shopCarGoods;
}
calculatePrice() {
AiDecimalAccuracy allPriceDecimal = AiDecimalAccuracy.zero;
int allCount = 0;
shopCarGoods.forEach((element2) {
if (element2["price"] != null && element2["price"] != "") {
double singlePrice = double.tryParse(element2["price"]);
allCount += element2["count"];
///1
add(MiNiDetail miNiDetail, selectSkus) async {
ProductSkuVOListBean productSku =
miNiDetail.productSkuVOList.firstWhere((element) {
return skuY(element, selectSkus);
});
AiDecimalAccuracy aiDecimalAccuracy =
AiDecimalAccuracy.fromInt(element2["count"]);
AiDecimalAccuracy aiPrice = AiDecimalAccuracy.tryParse("$singlePrice");
if (productSku == null) return;
String skuId = productSku.id;
if (shopCarGoods == null) {
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.id);
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
shopCarGoods.tableId = "$tableId";
if (shopSkuIndex >= 0) {
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum += 1;
ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods
.shoppingCartSkuItemList
.firstWhere((element) => skuId == element.id);
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
} else {
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
allPriceDecimal += (aiPrice * aiDecimalAccuracy);
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
}
}
///1
reduce(MiNiDetail miNiDetail, selectSkus) async {
ProductSkuVOListBean productSku =
miNiDetail.productSkuVOList.firstWhere((element) {
return skuY(element, selectSkus);
});
this.allCount = allCount;
this.allPrice = allPriceDecimal.toDouble();
if (productSku == null) return;
String skuId = productSku.id;
if (shopCarGoods == null) {
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods
.shoppingCartSkuItemList
.firstWhere((element) => skuId == element.skuId);
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.skuId);
if (shopSkuItem != null) {
if (shopSkuItem.buyNum > 1) {
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1;
}
} else {
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
shopCarGoods.tableId = "$tableId";
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods
.shoppingCartSkuItemList
.firstWhere((element) => skuId == element.id);
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
}
}
// @override
// bool get wantKeepAlive => true;
bool skuY(ProductSkuVOListBean productSku, selectSkus) {
bool gg = true;
selectSkus.forEach((element1) {
if (productSku.skuNameStr.indexOf(element1) < 0) {
gg = false;
return gg;
}
});
return gg;
}
}
class Title extends StatefulWidget {

139
lib/store/store_view/people_num.dart

@ -0,0 +1,139 @@
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
class PeopleNumView extends StatefulWidget {
final String tableName;
// final Function(int peopleNum) callback;
PeopleNumView(this.tableName);
@override
State<StatefulWidget> createState() {
return _PeopleNumView();
}
}
class _PeopleNumView extends State<PeopleNumView> {
int peopleNum = 1;
@override
Widget build(BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
children: [
Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
width: 295,
height: 247,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"桌位:${widget.tableName}",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF171717),
),
),
Text(
"请选择用餐人数:$peopleNum人",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF171717),
),
),
SizedBox(
height: 10,
),
Container(
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 5,
crossAxisSpacing: 24,
mainAxisSpacing: 18,
childAspectRatio: 1,
),
shrinkWrap: true,
itemCount: 10,
padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
setState(() {
peopleNum = position + 1;
});
},
child: Container(
decoration: BoxDecoration(
color: peopleNum == (position + 1)
? Color(0xFF32A060)
: Colors.transparent,
border: Border.all(
color: Color(0xFF32A060),
width: 1,
),
borderRadius: BorderRadius.circular(3),
),
alignment: Alignment.center,
child: Text(
"${position + 1}",
style: TextStyle(
color: peopleNum == (position + 1)
? Colors.white
: Color(0xFF32A060),
fontWeight: MyFontWeight.regular,
fontSize: 16.sp,
),
),
),
);
},
),
),
SizedBox(
height: 10,
),
RoundButton(
text: "确定",
width: 130.w,
height: 34.h,
textColor: Colors.white,
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
backgroup: Color(0xFF32A060),
radius: 4.w,
callback: () {
// widget.callback(peopleNum);
// SmartDialog.dismiss();
Navigator.of(context).pop(peopleNum);
},
),
],
),
),
],
),
],
);
}
}

116
lib/store/store_view/product_sku.dart

@ -1,16 +1,30 @@
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
class ProductSku extends StatefulWidget {
final MiNiDetail miNiDetail;
final String productId;
final Function(MiNiDetail miNiDetail, List<String> selectSkus, int count) addShopCar;
final Function(MiNiDetail miNiDetail, List<String> selectSkus) add;
final Function(MiNiDetail miNiDetail, List<String> selectSkus) reduce;
final ShoppingCart shopCarGoods;
ProductSku(this.miNiDetail, this.productId);
ProductSku(
this.miNiDetail,
this.shopCarGoods,
this.productId,
this.addShopCar,
this.add,
this.reduce,
);
@override
State<StatefulWidget> createState() {
@ -20,33 +34,55 @@ class ProductSku extends StatefulWidget {
class _ProductSku extends State<ProductSku> {
List<String> selectSkus = [];
int selectCount = 1;
Map<String, dynamic> tempSelected = {};
int count = 1;
@override
void initState() {
super.initState();
if (widget.miNiDetail != null) {
tempSelected["id"] = widget.productId;
tempSelected["count"] = 1;
tempSelected["price"] = widget.miNiDetail.price;
if (tempSelected["attr"] == null)
tempSelected["attr"] = [];
widget.miNiDetail.attrList.forEach((element) {
selectSkus.add(element.attrValueList[0].attrValue);
(tempSelected["attr"] as List).add({
"attrId": "${element.id}",
"attrValue": "${element.attrValueList[0].id}",
});
buildCount();
}
buildCount() {
count = 1;
ProductSkuVOListBean productSku = widget.miNiDetail.productSkuVOList.firstWhere((element) {
return skuY(element, selectSkus);
});
if (productSku == null) return;
String skuId = productSku.id;
if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return;
int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id);
if (shopSkuIndex >= 0) {
count = widget.shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum;
}
}
bool skuY(ProductSkuVOListBean productSku, selectSkus) {
bool gg = true;
selectSkus.forEach((element1) {
if (productSku.skuNameStr.indexOf(element1) < 0) {
gg = false;
return gg;
}
});
return gg;
}
@override
Widget build(BuildContext context) {
return StatefulBuilder(builder: (context1, state) {
return WillPopScope(
onWillPop: () async {
debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss();
return true;
},
child: StatefulBuilder(builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
padding: EdgeInsets.only(
@ -54,6 +90,7 @@ class _ProductSku extends State<ProductSku> {
left: 16,
right: 16,
),
height: MediaQuery.of(context).size.height / 3 * 2,
width: double.infinity,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
@ -95,7 +132,8 @@ class _ProductSku extends State<ProductSku> {
Padding(
padding: EdgeInsets.only(top: 4, bottom: 7),
child: Text(
"已选: " + (selectSkus.map((e) => "$e").toList().toString()),
"已选: " +
(selectSkus.map((e) => "$e").toList().toString()),
style: TextStyle(
color: Color(0xFF727272),
fontSize: 11.sp,
@ -128,7 +166,8 @@ class _ProductSku extends State<ProductSku> {
Spacer(),
InkWell(
onTap: () {
Navigator.of(context).pop();
// Navigator.of(context).pop();
SmartDialog.dismiss();
},
child: Image.asset(
"assets/image/icon_order_cancel.png",
@ -138,36 +177,24 @@ class _ProductSku extends State<ProductSku> {
),
],
),
if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0)
SizedBox(
height: 23,
),
if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0)
Expanded(
child: ListView.builder(
itemCount: widget.miNiDetail.attrList.length,
scrollDirection: Axis.vertical,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
return attrItem(
(index) {
if (tempSelected["attr"] == null) {
tempSelected["attr"] = [];
}
bool flag = false;
(tempSelected["attr"] as List).forEach((e0) {
if(e0["attrId"] == widget.miNiDetail.attrList[position].id){
e0["attrValue"] = widget.miNiDetail.attrList[position].attrValueList[index].id;
flag = true;
}
});
if(!flag)
(tempSelected["attr"] as List).add({
"attrId": "${widget.miNiDetail.attrList[position].id}",
"attrValue": "${widget.miNiDetail.attrList[position].attrValueList[index].id}",
});
state(() {
selectSkus[position] = widget.miNiDetail
.attrList[position].attrValueList[index].attrValue;
buildCount();
});
},
widget.miNiDetail.attrList[position],
@ -194,10 +221,11 @@ class _ProductSku extends State<ProductSku> {
),
InkWell(
onTap: () {
state(() {
if (selectCount > 1) selectCount--;
if (count > 1)
setState(() {
count -= 1;
});
tempSelected["count"] = selectCount;
widget.reduce(widget.miNiDetail, selectSkus);
},
child: Image.asset(
"assets/image/reduce.png",
@ -208,7 +236,7 @@ class _ProductSku extends State<ProductSku> {
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
selectCount.toString(),
"$count",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
@ -218,10 +246,10 @@ class _ProductSku extends State<ProductSku> {
),
InkWell(
onTap: () {
state(() {
selectCount++;
tempSelected["count"] = selectCount;
setState(() {
count += 1;
});
widget.add(widget.miNiDetail, selectSkus);
},
child: Image.asset(
"assets/image/add.png",
@ -244,7 +272,9 @@ class _ProductSku extends State<ProductSku> {
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
callback: () {
Navigator.of(context).pop(tempSelected);
// Navigator.of(context).pop();
SmartDialog.dismiss();
widget.addShopCar(widget.miNiDetail, selectSkus, 1);
},
),
SizedBox(
@ -253,10 +283,12 @@ class _ProductSku extends State<ProductSku> {
],
),
);
});
}),
);
}
Widget attrItem(Function fc, AttrListBean attrListBean, position) {
if (attrListBean.attrValueList != null && attrListBean.attrValueList.length > 0)
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -274,12 +306,16 @@ class _ProductSku extends State<ProductSku> {
sweetnessStore(fc, attrListBean.attrValueList, position),
],
);
else {
return Container();
}
}
Widget sweetnessStore(Function fc, List<AttrValueListBean> arrays, position) {
return GridView.builder(
itemCount: arrays.length,
shrinkWrap: true,
padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量

1338
lib/store/store_view/settlement.dart

File diff suppressed because it is too large Load Diff

182
lib/store/store_view/shop_car.dart

@ -1,69 +1,47 @@
import 'package:ai_decimal_accuracy/ai_decimal_accuracy.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/store/store_view/shop_goods.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ShopCar extends StatefulWidget {
final List<ProductListBean> productLists;
final Function(String id) queryMiNiDetail;
final Function() clearShopCar;
final Function() toDownOrder;
final List<Map<String, dynamic>> shopCarGoods;
final Function(ShoppingCartSkuItemListBean cart) shopCartAdd;
final Function(ShoppingCartSkuItemListBean cart) shopCartReduce;
final Function(int count, String productId, int allCount, double allPrice) fc;
ShoppingCart shopingCar;
ShopCar(
this.productLists,
this.shopCarGoods,
Key key,
this.shopingCar,
this.clearShopCar,
this.toDownOrder,
this.fc, {
this.shopCartAdd,
this.shopCartReduce, {
this.queryMiNiDetail,
});
}) : super(key: key);
@override
State<StatefulWidget> createState() {
return _ShopCar(this.shopCarGoods);
return _ShopCar();
}
}
class _ShopCar extends State<ShopCar> {
int allCount = 0;
double allPrice = 0.0;
final List<Map<String, dynamic>> shopCarGoods;
_ShopCar(this.shopCarGoods);
@override
void initState() {
super.initState();
if (shopCarGoods != null) {
AiDecimalAccuracy allPriceDecimal = AiDecimalAccuracy.zero;
shopCarGoods.forEach((element) {
if (element["price"] != null && element["price"] != "") {
double singlePrice = double.tryParse(element["price"]);
allCount += element["count"];
AiDecimalAccuracy aiDecimalAccuracy = AiDecimalAccuracy.fromInt(element["count"]);
AiDecimalAccuracy aiPrice = AiDecimalAccuracy.tryParse("$singlePrice");
allPriceDecimal += (aiPrice * aiDecimalAccuracy);
}
});
allPrice = allPriceDecimal.toDouble();
}
}
@override
Widget build(BuildContext context) {
return StatefulBuilder(
return WillPopScope(
onWillPop: () async {
debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss();
return true;
},
child: StatefulBuilder(
builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
@ -101,9 +79,7 @@ class _ShopCar extends State<ShopCar> {
),
InkWell(
onTap: () {
allPrice = 0;
allCount = 0;
widget.productLists.clear();
widget.shopingCar.shoppingCartSkuItemList.clear();
state(() {});
widget.clearShopCar();
},
@ -117,6 +93,13 @@ class _ShopCar extends State<ShopCar> {
),
),
Expanded(
child: Stack(
children: [
Positioned(
top: 0,
left: 0,
right: 0,
bottom: 54,
child: Container(
padding: EdgeInsets.only(
top: 8,
@ -124,58 +107,36 @@ class _ShopCar extends State<ShopCar> {
right: 16,
),
child: ListView.builder(
itemCount: widget.productLists == null
? 0
: widget.productLists.length,
itemCount: itemCount(),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: ShopGoods(
widget.productLists[position],
(int count, String productId) {
int index = shopCarGoods.indexWhere((element) => element["id"] == productId);
if (count == 0) {
shopCarGoods.removeAt(index);
int index1 = widget.productLists.indexWhere((element) => element.id == productId);
widget.productLists.removeAt(index1);
} else {
Map<String, dynamic> map;
print("productId: $productId");
shopCarGoods.forEach((element) {
if (element["id"] == productId) {
map = element;
}
});
map["count"] = count;
shopCarGoods[index] = map;
}
allCount = 0;
allPrice = 0;
shopCarGoods.forEach((element) {
if (element["price"] != null &&
element["price"] != "") {
double singlePrice =
double.tryParse(element["price"]);
allCount += element["count"];
allPrice += (singlePrice * element["count"]);
}
});
widget.fc(count, productId, allCount, allPrice);
state(() {});
return ShopGoods(
(ShoppingCartSkuItemListBean cart) async {
widget.shopingCar =
await widget.shopCartAdd(cart);
setState(() {});
},
shopCarGoods: _shopCarGoods(position),
(ShoppingCartSkuItemListBean cart) async {
widget.shopingCar =
await widget.shopCartReduce(cart);
setState(() {});
},
isShopCart: true,
count: widget.shopingCar
.shoppingCartSkuItemList[position].buyNum,
shoppingCartSkuItemListBean: widget.shopingCar
.shoppingCartSkuItemList[position],
queryMiNiDetail: widget.queryMiNiDetail,
),
);
},
),
),
),
Stack(
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Stack(
alignment: Alignment.bottomLeft,
children: [
Container(
@ -203,7 +164,10 @@ class _ShopCar extends State<ShopCar> {
),
),
Text(
"" + allPrice.toString(),
"" +
(widget.shopingCar == null
? "0.0"
: widget.shopingCar.cartSum),
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.medium,
@ -224,7 +188,8 @@ class _ShopCar extends State<ShopCar> {
backgroup: Color(0xFF32A060),
radius: 0,
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
padding:
EdgeInsets.symmetric(vertical: 5.h),
),
),
],
@ -234,7 +199,8 @@ class _ShopCar extends State<ShopCar> {
children: [
InkWell(
onTap: () {
Navigator.of(context).pop();
// Navigator.of(context).pop();
SmartDialog.dismiss();
},
child: Image.asset(
"assets/image/shopp.png",
@ -248,15 +214,15 @@ class _ShopCar extends State<ShopCar> {
child: RoundButton(
width: 17,
height: 17,
text: allCount.toString(),
text: "${count()}",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 12.sp,
radius: 100,
callback: () {
Navigator.of(context)
.pushNamed('/router/test_page');
// Navigator.of(context)
// .pushNamed('/router/test_page');
},
),
),
@ -264,20 +230,40 @@ class _ShopCar extends State<ShopCar> {
),
],
),
),
],
),
flex: 1,
),
],
),
);
},
),
);
}
Map<String, dynamic> _shopCarGoods(int position) {
Map<String, dynamic> map;
widget.shopCarGoods.forEach((element) {
if (widget.productLists[position].id == element["id"]) {
map = element;
int itemCount() {
if (widget.shopingCar == null ||
widget.shopingCar.shoppingCartSkuItemList == null ||
widget.shopingCar.shoppingCartSkuItemList.length == 0) return 0;
int index = widget.shopingCar.shoppingCartSkuItemList
.indexWhere((element) => element.buyNum == 0);
if (index >= 0) {
widget.shopingCar.shoppingCartSkuItemList.removeAt(index);
}
int count = widget.shopingCar.shoppingCartSkuItemList.length;
return count;
}
int count() {
if (widget.shopingCar == null ||
widget.shopingCar.shoppingCartSkuItemList == null ||
widget.shopingCar.shoppingCartSkuItemList.length == 0) return 0;
int count = 0;
widget.shopingCar.shoppingCartSkuItemList.forEach((element) {
count += element.buyNum;
});
return map;
return count;
}
}

111
lib/store/store_view/shop_goods.dart

@ -1,22 +1,30 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
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';
class ShopGoods extends StatefulWidget {
final ProductListBean product;
final Function(String id) queryMiNiDetail;
final Function(int count, String productId) fc;
final Map<String, dynamic> shopCarGoods;
final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) add;
final Function(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean)
reduce;
final ProductListBean productListBean;
final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean;
final int count;
final bool isShopCart;
ShopGoods(
this.product,
this.fc, {
this.add,
this.reduce, {
this.productListBean,
this.count = 0,
this.isShopCart = false,
this.queryMiNiDetail,
this.shopCarGoods,
this.shoppingCartSkuItemListBean,
});
@override
@ -26,10 +34,8 @@ class ShopGoods extends StatefulWidget {
}
class _ShopGoods extends State<ShopGoods> {
@override
Widget build(BuildContext context) {
int buyNum = _count();
return Container(
color: Colors.white,
padding: EdgeInsets.only(
@ -44,7 +50,11 @@ class _ShopGoods extends State<ShopGoods> {
children: [
SizedBox(width: 12.w),
MImage(
widget.product != null ? widget.product.imgPath : "",
widget.productListBean != null
? widget.productListBean.imgPath
: (widget.shoppingCartSkuItemListBean != null
? widget.shoppingCartSkuItemListBean.skuImg
: ""),
width: 70,
height: 70,
fit: BoxFit.cover,
@ -59,7 +69,9 @@ class _ShopGoods extends State<ShopGoods> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.product.productName,
widget.productListBean != null
? widget.productListBean.productName
: widget.shoppingCartSkuItemListBean.productName,
style: TextStyle(
color: Colors.black,
fontSize: 13.sp,
@ -69,11 +81,16 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox(
height: 2,
),
///{"id":"1442420413828169728","productId":"1432652566000304128","productName":"桂花乌龙茶","skuName":null,"buyNum":1,"skuStock":1000,"skuImg":"https://pos.upload.gznl.top/1177/2021/08/f855ffb8-d473-4f5f-93c9-5907b539b2fd.jpg",
///"skuPrice":"0.00","selected":1,"storeId":null,"groupId":"1426067376096411648","createTime":"2021-10-20 10:27:46","tableId":null,"platterList":null}
Row(
children: [
Expanded(
child: Text(
widget.product.shortName,
(widget.productListBean != null
? widget.productListBean.shortName
: widget.shoppingCartSkuItemListBean.skuName ?? ""),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
@ -110,7 +127,7 @@ class _ShopGoods extends State<ShopGoods> {
width: 4,
),
Text(
"¥${widget.product.price}",
"¥${widget.productListBean != null ? widget.productListBean.price : widget.shoppingCartSkuItemListBean.skuPrice}",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 11.sp,
@ -133,7 +150,7 @@ class _ShopGoods extends State<ShopGoods> {
width: 4,
),
Text(
"¥${widget.product.applyPrice}",
"¥${widget.productListBean != null ? widget.productListBean.applyPrice : widget.shoppingCartSkuItemListBean.skuPrice}",
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 10.sp,
@ -145,8 +162,12 @@ class _ShopGoods extends State<ShopGoods> {
],
),
Spacer(),
if (buyNum == 0)
RoundButton(
if (!widget.isShopCart)
Stack(
children: [
Container(
margin: EdgeInsets.only(right: 8, top: 4),
child: RoundButton(
width: 49.w,
text: S.of(context).xuanguige,
textColor: Colors.white,
@ -156,15 +177,36 @@ class _ShopGoods extends State<ShopGoods> {
fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
callback: () {
widget.queryMiNiDetail(widget.product.id);
widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId);
},
),
if (buyNum > 0)
),
Positioned(
right: 0,
child: Visibility(
visible: widget.count > 0,
child: RoundButton(
width: 17,
height: 17,
text: "${widget.count}",
textColor: Color(0xFF32A060),
fontWeight: MyFontWeight.regular,
backgroup: Colors.white,
fontSize: 12.sp,
radius: 100,
),
),
),
],
),
if (widget.isShopCart)
InkWell(
onTap: () {
reduceCount();
widget.fc(widget.shopCarGoods["count"], widget.product.id);
setState(() {});
widget.reduce(widget.shoppingCartSkuItemListBean);
},
child: Image.asset(
"assets/image/reduce.png",
@ -172,12 +214,12 @@ class _ShopGoods extends State<ShopGoods> {
height: 22,
),
),
if (buyNum > 0)
if (widget.isShopCart)
Container(
width: 30,
alignment: Alignment.center,
child: Text(
"$buyNum",
"${widget.count}",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
@ -185,12 +227,10 @@ class _ShopGoods extends State<ShopGoods> {
),
),
),
if (buyNum > 0)
if (widget.isShopCart)
InkWell(
onTap: () {
addCount();
widget.fc(widget.shopCarGoods["count"], widget.product.id);
setState(() {});
widget.add(widget.shoppingCartSkuItemListBean);
},
child: Image.asset(
"assets/image/add.png",
@ -207,23 +247,4 @@ class _ShopGoods extends State<ShopGoods> {
),
);
}
addCount() {
widget.shopCarGoods["count"] += 1;
}
reduceCount() {
widget.shopCarGoods["count"] -= 1;
}
int _count() {
if (widget.shopCarGoods == null) return 0;
if (widget.product.id == widget.shopCarGoods["id"]) {
return widget.shopCarGoods["count"];
}
return 0;
}
}

15
lib/store/store_view/store_activity.dart

@ -22,11 +22,20 @@ class _StoreActivity extends State<StoreActivity> {
@override
Widget build(BuildContext context) {
return (widget.activitys == null || widget.activitys.length == 0)
? NoDataView(
? Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h),
margin: EdgeInsets.only(
top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight),
),
color: Colors.white,
child: NoDataView(
isShowBtn: false,
text: "还没有活动~",
iconWidth: 220,
iconHeight: 140,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 180.h),
),
)
: Container(
width: MediaQuery.of(context).size.width,
@ -51,7 +60,7 @@ class _StoreActivity extends State<StoreActivity> {
'/router/web_page',
arguments: {
"activityId": widget.activitys[position].id,
"source": widget.arguments["id"]
"source": widget.arguments["id"],
},
);
}

102
lib/store/store_view/store_order_list.dart

@ -1,9 +1,10 @@
import 'package:ai_decimal_accuracy/ai_decimal_accuracy.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
@ -18,10 +19,11 @@ class StoreOrderListPage extends StatefulWidget {
final List<Activity> activitys;
final StoreInfo storeInfo;
final ScrollController controller;
final Function(int count, String productId, int allCount, double allPrice) fc;
final String minToken;
final String tenant;
final Function(String id) queryMiNiDetail;
final Function(List<FindMiNiGroupList> appletProducts) productListResult;
List<Map<String, dynamic>> shopCarGoods;
ShoppingCart shopCarGoods;
StoreOrderListPage(
this.arguments,
@ -29,9 +31,10 @@ class StoreOrderListPage extends StatefulWidget {
this.storeInfo,
this.shopCarGoods,
this.controller,
this.minToken,
this.tenant,
this.queryMiNiDetail,
this.productListResult,
this.fc);
);
@override
State<StatefulWidget> createState() {
@ -47,6 +50,9 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
List<FindMiNiGroupList> appletProducts;
List<ProductListBean> productListBeans = [];
ScrollController controller1 = ScrollController();
ScrollController controller2 = ScrollController();
@override
void initState() {
super.initState();
@ -57,29 +63,30 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
///
appletGoods() async {
SharedPreferences value = await SharedPreferences.getInstance();
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
token: widget.minToken,
tenant: widget.tenant,
storeId: widget.arguments["id"],
);
BaseData<List<FindMiNiGroupList>> baseData =
await minService.findMiNiGroupList(
{
await minService.findMiNiGroupList({
"id": widget.arguments["id"],
},
);
}).catchError((error) {
// refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
// refreshController.refreshCompleted();
setState(() {
appletProducts = baseData.data;
widget.productListResult(appletProducts);
productListBeans.clear();
if (appletProducts.length > 0)
productListBeans.addAll(appletProducts[0].productList);
productListBeans.addAll(appletProducts[isSelected].productList);
});
} else {
// refreshController.refreshFailed();
}
}
@ -93,6 +100,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
@ -101,6 +109,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
itemCount: appletProducts == null ? 0 : appletProducts.length,
controller: controller1,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(top: 0, bottom: 25),
itemBuilder: (context, position) {
return orderItem(appletProducts[position], position);
@ -112,6 +121,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
child: ListView.builder(
itemCount: productListBeans == null ? 0 : productListBeans.length,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
return goodsItem(position);
@ -123,9 +133,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
);
}
ScrollController controller1 = ScrollController();
ScrollController controller2 = ScrollController();
Widget orderItem(FindMiNiGroupList findMiNiGroupList, int index) {
int count = calculateItemCount(findMiNiGroupList);
return Container(
@ -196,11 +203,12 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
}
int calculateItemCount(FindMiNiGroupList findMiNiGroupList) {
if (widget.shopCarGoods == null) return 0;
int count = 0;
findMiNiGroupList.productList.forEach((element) {
widget.shopCarGoods.forEach((element1) {
if (element.id == element1["id"]) {
count += element1["count"];
widget.shopCarGoods.shoppingCartSkuItemList.forEach((element1) {
if (element.id == element1.productId) {
count += element1.buyNum;
}
});
});
@ -208,35 +216,37 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
}
Widget goodsItem(position) {
Map<String, dynamic> map;
widget.shopCarGoods.forEach((element) {
if (productListBeans[position].id == element["id"]) {
map = element;
ShoppingCartSkuItemListBean shoppingCartSkuItemListBean;
int count = 0;
if (widget.shopCarGoods != null) {
widget.shopCarGoods.shoppingCartSkuItemList.forEach((element) {
if (productListBeans[position].id == element.productId) {
if (shoppingCartSkuItemListBean == null) {
shoppingCartSkuItemListBean = element;
count = shoppingCartSkuItemListBean.buyNum;
} else {
count += element.buyNum;
}
});
return ShopGoods(
productListBeans[position],
(int count, String productId) {
int allCount = 0;
AiDecimalAccuracy allPrice = AiDecimalAccuracy.zero;
widget.shopCarGoods.forEach((element2) {
if (element2["price"] != null && element2["price"] != "") {
double singlePrice = double.tryParse(element2["price"]);
allCount += element2["count"];
AiDecimalAccuracy aiDecimalAccuracy =
AiDecimalAccuracy.fromInt(element2["count"]);
AiDecimalAccuracy aiPrice =
AiDecimalAccuracy.tryParse("$singlePrice");
allPrice += (aiPrice * aiDecimalAccuracy);
}
});
widget.fc(count, productId, allCount, allPrice.toDouble());
setState(() {});
}
return InkWell(
onTap: () {
widget.queryMiNiDetail(productListBeans[position].id);
},
child: ShopGoods(
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
// widget.add(productListBeans[position].id);
},
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
// widget.reduce(productListBeans[position].id);
},
productListBean: productListBeans[position],
count: count,
isShopCart: false,
queryMiNiDetail: widget.queryMiNiDetail,
shopCarGoods: map,
shoppingCartSkuItemListBean: shoppingCartSkuItemListBean,
),
);
}
}

17
lib/union/union_page.dart

@ -13,6 +13,7 @@ import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/classic_header.dart';
@ -263,13 +264,22 @@ class _UnionPage extends State<UnionPage>
},
child: ListView.builder(
itemCount: storeList == null ? 0 : storeList.length,
// padding: EdgeInsets.only(top: 8.h, bottom: 84.h + (375.h - 88.h) + 4.h),
padding: EdgeInsets.only(
top: 8.h, bottom: 84.h /* + (375.h - 88.h) + 4.h*/),
top: 8.h,
bottom: 84.h, /* + (375.h - 88.h) + 4.h*/
),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
return InkWell(
onTap: () {
if (storeList[position].posType.code == "NORMALSTORE") {
Scan.toScan(
context,
storeList[position].id,
storeList[position].tenantCode,
storeList[position].storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
@ -278,6 +288,7 @@ class _UnionPage extends State<UnionPage>
"storeName": storeList[position].storeName
},
);
}
},
child: buildStoreItem(storeList[position], position),
);

14
lib/utils/flutter_utils.dart

@ -8,6 +8,14 @@ import 'package:path_provider/path_provider.dart';
class AppUtils {
///线
static Future<String> calculateDistance(BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async {
double mi = await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
NumberFormat numberFormat = NumberFormat("#.#");
return "${numberFormat.format(mi / 1000)}";
}
static Future<BMFCoordinate> coordConvert(BMFCoordinate latLng) async {
return BMFCalculateUtils.coordConvert(
coordinate: latLng,
@ -15,6 +23,12 @@ class AppUtils {
toType: BMF_COORD_TYPE.COMMON);
}
static bool isPhone(mobile) {
RegExp exp = RegExp(
r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$');
return exp.hasMatch(mobile);
}
static double textScale(context) {
double textScaleFactor = MediaQuery.of(context).textScaleFactor;
// print("textScaleFactor: $textScaleFactor");

16
lib/utils/location.dart

@ -1,6 +1,3 @@
import 'dart:io';
import 'package:android_intent_plus/android_intent.dart';
@ -11,7 +8,6 @@ import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
class Location {
static Location _instance;
Location._internal() {
@ -74,8 +70,7 @@ class Location {
}
void stopLocation() {
if (aMapFlutterLocation != null)
aMapFlutterLocation.stopLocation();
if (aMapFlutterLocation != null) aMapFlutterLocation.stopLocation();
}
enableLocation(context) {
@ -121,12 +116,7 @@ class Location {
},
heightRatioWithWidth: 0.82,
);
});
},
);
}
}

29
lib/view_widget/custom_image.dart

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:flutter/material.dart';
@ -29,21 +31,27 @@ class MImage extends StatelessWidget {
@override
Widget build(BuildContext context) {
Widget image = LayoutBuilder(builder: (context, constraints) {
Widget image = LayoutBuilder(
builder: (context, constraints) {
String imageUrl = "";
if (src != null && src != "") {
if (src != null && src != "" && src.startsWith("http")) {
imageUrl =
"$src?imageMogr2/thumbnail/${constraints.constrainWidth() * scaleIndex}"
"x${constraints.constrainHeight() * scaleIndex}/format/webp/quality/100";
}
// print("constrainWidth: ${constraints.constrainWidth()}");
// print("constrainHeight: ${constraints.constrainHeight()}");
if (imageUrl == null || imageUrl == "") {
return Image.asset(
"assets/image/default_2_1.png",
fit: fit,
);
}
CachedNetworkImage cachedNetworkImage = CachedNetworkImage(
Widget cachedNetworkImage;
if (src.startsWith("http")) {
cachedNetworkImage = CachedNetworkImage(
imageUrl: imageUrl,
cacheManager: DefaultCacheManager(),
fadeInDuration: Duration(milliseconds: 300),
@ -67,8 +75,21 @@ class MImage extends StatelessWidget {
);
},
);
} else if (src.startsWith("file")) {
cachedNetworkImage = Image.file(
File(src),
fit: fit,
errorBuilder: (context, error, stackTrace) {
return Image.asset(
errorSrc,
fit: fit,
);
},
);
}
return cachedNetworkImage;
});
},
);
var clipRRect;
if (isCircle) {

19
lib/view_widget/no_data_view.dart

@ -6,13 +6,18 @@ class NoDataView extends StatelessWidget {
final bool isShowBtn;
final String text;
final double fontSize;
final double iconWidth;
final double iconHeight;
final EdgeInsets margin;
NoDataView(
{this.isShowBtn = true,
NoDataView({
this.isShowBtn = true,
this.text,
this.fontSize,
this.margin = const EdgeInsets.only(top: 30)});
this.iconWidth = 270,
this.iconHeight = 180,
this.margin = const EdgeInsets.only(top: 30),
});
@override
Widget build(BuildContext context) {
@ -21,7 +26,11 @@ class NoDataView extends StatelessWidget {
alignment: Alignment.center,
child: Column(
children: [
Image(image: AssetImage("assets/image/icon_empty.png")),
Image(
image: AssetImage("assets/image/icon_empty.png"),
width: iconWidth,
height: iconHeight,
),
SizedBox(
height: 35.h,
),
@ -46,7 +55,7 @@ class NoDataView extends StatelessWidget {
backgroup: Color(0xFF32A060),
radius: 4,
),
)
),
],
),
);

26
lib/view_widget/selector_store_dialog.dart

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
@ -101,9 +102,24 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
),
InkWell(
onTap: () {
Navigator.of(context).popAndPushNamed(
'/router/union_detail_page',
arguments: {"id": widget.stores[selectIndex].id});
if(widget.stores[selectIndex].posType.code == "NORMALSTORE") {
Scan.toScan(
context,
widget.stores[selectIndex].id,
widget.stores[selectIndex].tenantCode,
widget.stores[selectIndex].storeName,
);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": widget.stores[selectIndex].id,
"tenant": widget.stores[selectIndex].tenantCode,
"storeName": widget.stores[selectIndex].storeName
},
);
}
},
child: RoundButton(
text: S.of(context).queding,
@ -117,9 +133,9 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
horizontal: 42.w,
),
),
)
),
],
)
),
],
),
);

16
lib/web/web_page.dart

@ -260,20 +260,24 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
WebHeader(widget.arguments, activity, article, 16),
///
WebContent(activity, article, () {
WebContent(
activity,
article,
() {
setState(() {});
}),
},
),
///
CommentList(
commentKey,
widget.arguments,
activity,
article,
article?.likes ?? activity?.likes ?? "0",
article?.id ?? activity?.id,
isKeyBoardShow,
_reply,
_delCommentTips,
12.sp),
12.sp,
),
],
),
),

15
lib/web/web_view/comment_list.dart

@ -16,15 +16,15 @@ import 'package:like_button/like_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
class CommentList extends StatefulWidget {
final Map arguments;
final Activity activity;
final Article article;
final bool isKeyBoardShow;
final Function reply;
final Function delCommentTips;
final double fontSize;
final String relationalId;
final String like;
CommentList(Key key, this.arguments, this.activity, this.article,
CommentList(Key key, this.like, this.relationalId,
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize)
: super(key: key);
@ -57,6 +57,7 @@ class CommentListState extends State<CommentList> {
} else {
element.likes += 1;
element.liked = true;
}
}
});
@ -105,8 +106,7 @@ class CommentListState extends State<CommentList> {
width: 16.w,
),
Text(
S.of(context).xihuan_(
"${widget.article?.likes ?? widget.activity?.likes ?? "0"}"),
S.of(context).xihuan_("${widget.like ?? "0"}"),
style: TextStyle(
fontSize: widget.fontSize + 4,
fontWeight: FontWeight.bold,
@ -209,8 +209,7 @@ class CommentListState extends State<CommentList> {
await apiService.memberCommentList({
"pageNum": 1,
"pageSize": 100,
"relationalId":
widget.arguments["activityId"] ?? widget.arguments["articleId"],
"relationalId": widget.relationalId,
"relationalType": 1,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {

104
lib/web/web_view/web_content.dart

@ -44,7 +44,6 @@ class _WebContent extends State<WebContent> {
)
},
customImageRenders: {
base64DataUriMatcher(): base64ImageRender(),
assetUriMatcher(): assetImageRender(),
networkSourceMatcher(extension: "svg"):
svgNetworkImageRender(),
@ -54,57 +53,58 @@ class _WebContent extends State<WebContent> {
},
),
},
customRender: {
"video":
(context, parsedChild, attributes, element) {
var src = attributes['src'];
return videoWidget(
double.tryParse(attributes['width'] ?? ""),
double.tryParse(
element.attributes['height'] ?? ""),
(src != null &&
src != "" &&
src.endsWith(".mp4"))
? src
: element
.children.first.attributes["src"],
element.attributes["sandbox"]);
},
"iframe":
(context, parsedChild, attributes, element) {
var src = attributes['src'];
return videoWidget(
double.tryParse(attributes['width'] ?? ""),
double.tryParse(
element.attributes['height'] ?? ""),
(src != null &&
src != "" &&
src.endsWith(".mp4"))
? src
: element
.children.first.attributes["src"],
element.attributes["sandbox"]);
},
"audio":
(context, parsedChild, attributes, element) {
final sources = <String>[
if (element.attributes['src'] != null)
element.attributes['src'],
];
if (sources == null ||
sources.isEmpty ||
sources.first == null) {
return EmptyContentElement();
}
return audioWidget(
attributes['controls'] != null,
attributes['loop'] != null,
attributes['autoplay'] != null,
sources,
context.style.width ?? 300.w,
);
},
},
// customRender: {
// "video":
// (context, parsedChild) {
// var src = attributes['src'];
// parsedChild.toString()
// return videoWidget(
// double.tryParse(attributes['width'] ?? ""),
// double.tryParse(
// element.attributes['height'] ?? ""),
// (src != null &&
// src != "" &&
// src.endsWith(".mp4"))
// ? src
// : element
// .children.first.attributes["src"],
// element.attributes["sandbox"]);
// },
// "iframe":
// (context, parsedChild) {
// var src = attributes['src'];
// return videoWidget(
// double.tryParse(attributes['width'] ?? ""),
// double.tryParse(
// element.attributes['height'] ?? ""),
// (src != null &&
// src != "" &&
// src.endsWith(".mp4"))
// ? src
// : element
// .children.first.attributes["src"],
// element.attributes["sandbox"]);
// },
// "audio":
// (context, parsedChild) {
// final sources = <String>[
// if (element.attributes['src'] != null)
// element.attributes['src'],
// ];
// if (sources == null ||
// sources.isEmpty ||
// sources.first == null) {
// return EmptyContentElement();
// }
// return audioWidget(
// attributes['controls'] != null,
// attributes['loop'] != null,
// attributes['autoplay'] != null,
// sources,
// context.style.width ?? 300.w,
// );
// },
// },
);
}

27
lib/web/web_view/web_header.dart

@ -61,13 +61,26 @@ class _WebHeader extends State<WebHeader> {
widget.arguments["source"] == widget.activity.storeId) {
Navigator.of(context).pop();
} else {
Navigator.of(context).pushNamed(
'/router/union_detail_page',
arguments: {
"id": widget.activity.storeId,
"source": widget.arguments["activityId"]
},
);
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {
// "id": widget.activity.storeId,
// "source": widget.arguments["activityId"]
// },
// );
///TODO:
// if(widget.stores[selectIndex].posType.code == "NORMALSTORE") {
// toScan(widget.stores[selectIndex]);
// } else {
// Navigator.of(context).pushNamed(
// '/router/store_order',
// arguments: {
// "id": widget.activity.storeId,
// "tenant": widget.stores[selectIndex].tenantCode,
// "storeName": widget.activity.storeName
// },
// );
// }
}
}
},

318
pubspec.lock

@ -1,13 +1,6 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.flutter-io.cn"
source: hosted
version: "14.0.0"
ai_decimal_accuracy:
dependency: "direct main"
description:
@ -15,13 +8,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.41.2"
android_intent_plus:
dependency: "direct main"
description:
@ -29,13 +15,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
args:
dependency: transitive
description:
name: args
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.0"
async:
dependency: transitive
description:
@ -71,62 +50,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.6"
build:
dependency: transitive
description:
name: build
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.2"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.6"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.10"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.3"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.11.5"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.1.10"
built_collection:
dependency: transitive
description:
name: built_collection
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.3.2"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.1.0"
cached_network_image:
dependency: "direct main"
description:
@ -148,34 +71,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
chewie:
dependency: transitive
description:
name: chewie
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.2"
version: "1.2.2"
chewie_audio:
dependency: "direct main"
description:
name: chewie_audio
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
cli_util:
dependency: transitive
description:
name: cli_util
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.5"
version: "1.2.0"
clock:
dependency: transitive
description:
@ -183,13 +92,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
code_builder:
dependency: transitive
description:
name: code_builder
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.7.0"
collection:
dependency: transitive
description:
@ -211,20 +113,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.5"
css_colors:
dependency: transitive
description:
name: css_colors
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.16.2"
version: "0.17.1"
cupertino_icons:
dependency: "direct main"
description:
@ -232,13 +127,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.12"
dio:
dependency: "direct main"
description:
@ -274,13 +162,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.1.2"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.10.11"
flare_flutter:
dependency: "direct main"
description:
@ -348,19 +229,26 @@ packages:
name: flutter_html
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "2.1.5"
flutter_layout_grid:
dependency: transitive
description:
name: flutter_layout_grid
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.10.5"
version: "1.0.3"
flutter_localizations:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_math_fork:
dependency: transitive
description:
name: flutter_math_fork
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.3+1"
flutter_page_indicator:
dependency: transitive
description:
@ -375,13 +263,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.11"
flutter_qr_reader:
flutter_scankit:
dependency: "direct main"
description:
name: flutter_qr_reader
name: flutter_scankit
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
version: "1.2.0"
flutter_screenutil:
dependency: "direct main"
description:
@ -416,7 +304,7 @@ packages:
name: flutter_svg
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.20.0-nullsafety.3"
version: "0.22.0"
flutter_swiper:
dependency: "direct main"
description:
@ -447,14 +335,7 @@ packages:
name: font_awesome_flutter
url: "https://pub.flutter-io.cn"
source: hosted
version: "9.1.0"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.1"
version: "9.2.0"
graphs:
dependency: transitive
description:
@ -468,7 +349,7 @@ packages:
name: html
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.14.0+4"
version: "0.15.0"
http:
dependency: transitive
description:
@ -476,13 +357,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.2"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
http_parser:
dependency: transitive
description:
@ -496,14 +370,7 @@ packages:
name: image_pickers
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
import_js_library:
dependency: transitive
description:
name: import_js_library
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
version: "2.0.0+1"
intl:
dependency: "direct main"
description:
@ -511,13 +378,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.17.0"
io:
dependency: transitive
description:
name: io
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.5"
js:
dependency: transitive
description:
@ -532,13 +392,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.1"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.5.1"
keframe:
dependency: "direct main"
description:
@ -560,13 +413,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
matcher:
dependency: transitive
description:
@ -581,20 +427,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
mime:
nested:
dependency: transitive
description:
name: mime
name: nested
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
package_config:
version: "1.0.0"
numerus:
dependency: transitive
description:
name: package_config
name: numerus
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.3"
version: "1.1.1"
package_info:
dependency: "direct main"
description:
@ -700,13 +546,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
process:
dependency: transitive
description:
@ -714,20 +553,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.2.3"
pub_semver:
provider:
dependency: transitive
description:
name: pub_semver
name: provider
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.8"
version: "5.0.0"
pull_to_refresh:
dependency: "direct main"
description:
@ -755,7 +587,7 @@ packages:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.5"
version: "3.0.1+1"
retrofit:
dependency: "direct main"
description:
@ -763,13 +595,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.4+1"
retrofit_generator:
dependency: "direct dev"
description:
name: retrofit_generator
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.1+3"
rive:
dependency: "direct main"
description:
@ -833,32 +658,11 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.9"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.4+1"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.10+3"
source_span:
dependency: transitive
description:
@ -894,13 +698,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
string_scanner:
dependency: transitive
description:
@ -929,13 +726,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
timing:
dependency: transitive
thumbnails:
dependency: "direct main"
description:
name: timing
name: thumbnails
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.1+3"
version: "1.0.1"
tpns_flutter_plugin:
dependency: "direct main"
description:
@ -958,7 +755,7 @@ packages:
name: tuple
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
version: "2.0.0"
typed_data:
dependency: transitive
description:
@ -1028,70 +825,70 @@ packages:
name: video_player
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
version: "2.2.3"
video_player_platform_interface:
dependency: transitive
description:
name: video_player_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
version: "4.2.0"
video_player_web:
dependency: transitive
description:
name: video_player_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.4+1"
version: "2.0.4"
wakelock:
dependency: transitive
description:
name: wakelock
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.1+1"
wakelock_platform_interface:
version: "0.5.6"
wakelock_macos:
dependency: transitive
description:
name: wakelock_platform_interface
name: wakelock_macos
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.0+1"
wakelock_web:
version: "0.4.0"
wakelock_platform_interface:
dependency: transitive
description:
name: wakelock_web
name: wakelock_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.0+3"
watcher:
version: "0.3.0"
wakelock_web:
dependency: transitive
description:
name: watcher
name: wakelock_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
web_socket_channel:
version: "0.4.0"
wakelock_windows:
dependency: transitive
description:
name: web_socket_channel
name: wakelock_windows
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "0.2.0"
webview_flutter:
dependency: "direct main"
dependency: transitive
description:
name: webview_flutter
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.7"
version: "2.0.13"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.9"
version: "2.2.10"
xdg_directories:
dependency: transitive
description:
@ -1106,13 +903,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.1.2"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.13.0 <3.0.0"
flutter: ">=2.0.0"
flutter: ">=2.2.0"

34
pubspec.yaml

@ -21,11 +21,9 @@ dependencies:
git:
url: git://github.com/TencentCloud/TPNS-Flutter-Plugin
ref: V1.1.2
# tpns_flutter_plugin: ^1.1.0
like_button: ^2.0.2
cupertino_icons: ^1.0.2
# flutter_swiper_null_safety: ^1.0.2
flutter_swiper: ^1.1.6
flutter_staggered_grid_view: ^0.4.0 # Null safety
pull_to_refresh: ^2.0.0 # Null safety
@ -54,32 +52,25 @@ dependencies:
flutter_smart_dialog: ^2.1.6
barcode_widget: ^2.0.1
flutter_qr_reader: ^1.0.5
qr_flutter: ^4.0.0
url_launcher: ^5.0.0
# image_cropper: ^1.4.1
# image_picker_gallery_camera: ^0.1.6
#多图, 裁剪
image_pickers: ^2.0.0
# 数量,视频时长
# images_picker: ^1.2.4
# 多图,带UI
# wechat_assets_picker: ^4.2.2
flutter_scankit: ^1.2.0
path_provider: ^1.2.0
cached_network_image: ^2.0.0
flutter_html: ^1.3.0 #2.1.0
webview_flutter: ^1.0.7
flutter_html: ^2.1.5 #2.1.0
chewie_audio: ^1.1.2
# camera: ^0.5.8+17
photo_view: ^0.11.1
video_player: ^1.0.1
video_player: ^2.2.3
thumbnails: ^1.0.1
# media_info: ^0.9.0
# flutter_ffmpeg: ^0.4.2
package_info: ^2.0.2
@ -91,20 +82,17 @@ dependencies:
rive: ^0.6.8
flare_flutter: ^3.0.2
flutter_svg: ^0.20.0-nullsafety.3
flutter_svg: ^0.22.0
font_awesome_flutter: ^9.1.0
# flutter_bugly: ^0.3.3
# bitmap: ^0.1.2
# decimal: ^1.3.0
ai_decimal_accuracy: ^1.1.0
# zefyr: ^0.12.0
dev_dependencies:
flutter_test:
sdk: flutter
retrofit_generator: ^1.4.1+3
build_runner: ^1.11.5
json_serializable: ^3.5.1
# retrofit_generator: ^1.4.1+3
# build_runner: ^1.11.5
# json_serializable: ^3.5.1
flutter:

Loading…
Cancel
Save