Browse Source

Merge branch 'master' into dev

master
w-R 3 years ago
parent
commit
3c98660b02
  1. 6
      README.md
  2. 10
      ios/Podfile.lock
  3. 23
      ios/Runner.xcodeproj/project.pbxproj
  4. 2
      ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  5. 1
      lib/community/community_child_page.dart
  6. 9
      lib/community/community_view/community_dynamic.dart
  7. 49
      lib/home/home_page.dart
  8. 7
      lib/home/home_view/coupon.dart
  9. 6
      lib/mine/mine_view/mine_view.dart
  10. 11
      lib/order/order_utils.dart
  11. 4
      lib/order/order_view/order_address.dart
  12. 2
      lib/order/write_off_page.dart
  13. 158
      lib/qr/qr_code_scan.dart
  14. 6
      lib/retrofit/data/min_order_info.dart
  15. 4
      lib/retrofit/data/placeOrderFirst.dart
  16. 190
      lib/retrofit/data/settleOrderInfo.dart
  17. 4
      lib/retrofit/min_api.dart
  18. 20
      lib/retrofit/min_api.g.dart
  19. 29
      lib/settlement/settlement.dart
  20. 59
      lib/settlement/settlement_view/pay_method.dart
  21. 3
      lib/settlement/settlement_view/settlement_order_commodity.dart
  22. 7
      lib/store/scan.dart
  23. 24
      lib/store/store_order.dart
  24. 11
      lib/store/store_view/shop_car.dart
  25. 58
      lib/store/store_view/shop_goods.dart
  26. 79
      lib/store/store_view/store_info.dart
  27. 14
      pubspec.lock
  28. 3
      pubspec.yaml

6
README.md

@ -84,3 +84,9 @@ samples, guidance on mobile development, and a full API reference.
小米开放平台 83364300@qq.com 具体问 :(汪姐) 小米开放平台 83364300@qq.com 具体问 :(汪姐)
推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey) 推送:使用腾讯云推送 tpns 需扫码登录 (有问题同华为➕微信||或重新注册账号替换相关appKey)
https://pos.platform.lotus-wallet.com/app/ 生产环境
http://192.168.10.236:8765/app/ 测试环境
https://pos.platform.lotus-wallet.com/app/ 生产环境
http://192.168.10.236:8766/app/ 测试环境

10
ios/Podfile.lock

@ -41,9 +41,6 @@ PODS:
- flutter_bmflocation (1.0.3): - flutter_bmflocation (1.0.3):
- BMKLocationKit - BMKLocationKit
- Flutter - Flutter
- flutter_scankit (0.0.1):
- Flutter
- ScanKitFrameWork (~> 1.0.2.300)
- fluwx (0.0.1): - fluwx (0.0.1):
- Flutter - Flutter
- WechatOpenSDK_Fuck (~> 1.9.2) - WechatOpenSDK_Fuck (~> 1.9.2)
@ -84,7 +81,6 @@ PODS:
- Flutter - Flutter
- "permission_handler (5.1.0+2)": - "permission_handler (5.1.0+2)":
- Flutter - Flutter
- ScanKitFrameWork (1.0.2.300)
- SDWebImage (5.12.1): - SDWebImage (5.12.1):
- SDWebImage/Core (= 5.12.1) - SDWebImage/Core (= 5.12.1)
- SDWebImage/Core (5.12.1) - SDWebImage/Core (5.12.1)
@ -128,7 +124,6 @@ DEPENDENCIES:
- flutter_baidu_mapapi_search (from `.symlinks/plugins/flutter_baidu_mapapi_search/ios`) - flutter_baidu_mapapi_search (from `.symlinks/plugins/flutter_baidu_mapapi_search/ios`)
- flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/ios`) - flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/ios`)
- flutter_bmflocation (from `.symlinks/plugins/flutter_bmflocation/ios`) - flutter_bmflocation (from `.symlinks/plugins/flutter_bmflocation/ios`)
- flutter_scankit (from `.symlinks/plugins/flutter_scankit/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`) - fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_pickers (from `.symlinks/plugins/image_pickers/ios`) - image_pickers (from `.symlinks/plugins/image_pickers/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`) - package_info (from `.symlinks/plugins/package_info/ios`)
@ -153,7 +148,6 @@ SPEC REPOS:
- FMDB - FMDB
- mob_sharesdk - mob_sharesdk
- MOBFoundation - MOBFoundation
- ScanKitFrameWork
- SDWebImage - SDWebImage
- SSZipArchive - SSZipArchive
- TPNS-iOS - TPNS-iOS
@ -173,8 +167,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios" :path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios"
flutter_bmflocation: flutter_bmflocation:
:path: ".symlinks/plugins/flutter_bmflocation/ios" :path: ".symlinks/plugins/flutter_bmflocation/ios"
flutter_scankit:
:path: ".symlinks/plugins/flutter_scankit/ios"
fluwx: fluwx:
:path: ".symlinks/plugins/fluwx/ios" :path: ".symlinks/plugins/fluwx/ios"
image_pickers: image_pickers:
@ -214,7 +206,6 @@ SPEC CHECKSUMS:
flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d
flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a
flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c
flutter_scankit: 16936d86b3de3f83c122e763f4c24c5da214c78f
fluwx: c192ef1ea3617badb813fa1a761ffc5c9c12208a fluwx: c192ef1ea3617badb813fa1a761ffc5c9c12208a
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_pickers: 5e6ec7083f9363d014c0fb061f1b9cd97bb5e451 image_pickers: 5e6ec7083f9363d014c0fb061f1b9cd97bb5e451
@ -223,7 +214,6 @@ SPEC CHECKSUMS:
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
ScanKitFrameWork: 0ad578f3db0ef9b64dd0f533d10d10a52ce93c80
SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sharesdk_plugin: 6d6634bb480174b607030f19fc9d84d68cfbf326 sharesdk_plugin: 6d6634bb480174b607030f19fc9d84d68cfbf326

23
ios/Runner.xcodeproj/project.pbxproj

@ -657,7 +657,6 @@
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
120EAF7195D9AB3BB1E8FA2B /* [CP] Copy Pods Resources */, 120EAF7195D9AB3BB1E8FA2B /* [CP] Copy Pods Resources */,
8ADBB1E9F51ACB25060865A4 /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -764,23 +763,6 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 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 */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -912,6 +894,7 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0; IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -925,6 +908,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
@ -1147,6 +1131,7 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0; IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -1160,6 +1145,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
@ -1288,6 +1274,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;

2
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

@ -40,7 +40,7 @@
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Release" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"

1
lib/community/community_child_page.dart

@ -7,6 +7,7 @@ import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';

9
lib/community/community_view/community_dynamic.dart

@ -1,4 +1,4 @@
import 'dart:io';
import 'dart:ui'; import 'dart:ui';
import 'package:chewie/chewie.dart'; import 'package:chewie/chewie.dart';
@ -15,6 +15,8 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
@ -350,6 +352,10 @@ class _CommunityDynamic extends State<CommunityDynamic> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return Container( return Container(
child: InkWell(
onTap: () {
ImagePickers.previewImages(subjectInfo.images, position);
},
child: MImage( child: MImage(
subjectInfo.images[position], subjectInfo.images[position],
fit: BoxFit.cover, fit: BoxFit.cover,
@ -357,6 +363,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",
), ),
),
); );
}, },
itemCount: subjectInfo.images.length, itemCount: subjectInfo.images.length,

49
lib/home/home_page.dart

@ -26,9 +26,12 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:qrscan/qrscan.dart' as scanner;
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
final GestureTapCallback callback; final GestureTapCallback callback;
@ -216,7 +219,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
margin: EdgeInsets.only(right: 12.w), margin: EdgeInsets.only(right: 12.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
// Navigator.of(context).pushNamed('/router/system_msg_page'); Navigator.of(context).pushNamed('/router/system_msg_page');
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/tixing.svg", "assets/svg/tixing.svg",
@ -229,7 +232,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
margin: EdgeInsets.only(right: 16.w), margin: EdgeInsets.only(right: 16.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
// Navigator.of(context).pushNamed('/router/system_msg_page'); toScan();
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/saoyisao.svg", "assets/svg/saoyisao.svg",
@ -318,6 +321,48 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
toScan() async {
if (await Permission.camera.isPermanentlyDenied) {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_camera_permission_tips.png",
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
if (result) {
await openAppSettings();
}
},
heightRatioWithWidth: 0.82,
);
});
} else if (await Permission.camera.isGranted) {
// http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512
// var result = await Navigator.of(context).pushNamed('/router/qr_scan');
String result = await scanner.scan();
Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"];
String shopId = uri.queryParameters["shopId"];
if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": shopId,
"tenant": tenantCode,
"storeName": "",
"tableId": int.tryParse(tableId),
},
);
}
} else {
await Permission.camera.request();
}
}
_toDetails(index) async { _toDetails(index) async {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/integral_store_page', '/router/integral_store_page',

7
lib/home/home_view/coupon.dart

@ -229,19 +229,20 @@ class _CouponView extends State<CouponView> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Expanded(
child: Text(
(coupon.useStartTime == null && (coupon.useStartTime == null &&
coupon.useEndTime == null) coupon.useEndTime == null)
? S.of(context).quantian ? S.of(context).quantian
: "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}", : "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle( style: TextStyle(
color: Color(0xFF868686), color: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 10.sp, fontSize: 10.sp,
), ),
), ),
Expanded(
child: Container(),
flex: 1, flex: 1,
), ),
GestureDetector( GestureDetector(

6
lib/mine/mine_view/mine_view.dart

@ -8,6 +8,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:qrscan/qrscan.dart' as scanner;
class MineView extends StatefulWidget { class MineView extends StatefulWidget {
final UserInfo userInfo; final UserInfo userInfo;
@ -90,8 +91,9 @@ class _MineView extends State<MineView> {
); );
}); });
} else if (await Permission.camera.isGranted) { } else if (await Permission.camera.isGranted) {
///http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 // http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512
var result = await Navigator.of(context).pushNamed('/router/qr_scan'); // var result = await Navigator.of(context).pushNamed('/router/qr_scan');
String result = await scanner.scan();
Uri uri = Uri.parse(result); Uri uri = Uri.parse(result);
String tableId = uri.queryParameters["tableId"]; String tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"]; String tenantCode = uri.queryParameters["tenantCode"];

11
lib/order/order_utils.dart

@ -1,5 +1,6 @@
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart'; import 'package:fluwx/fluwx.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
@ -7,6 +8,7 @@ import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/utils/min.dart'; import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
class OrderUtils { class OrderUtils {
@ -14,7 +16,7 @@ class OrderUtils {
static carryOnPay(payChannel, MinApiService minService, OrderInfo orderInfo, Function queryDetails) async { static carryOnPay(payChannel, MinApiService minService, OrderInfo orderInfo, Function queryDetails) async {
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst(); PlaceOrderFirst placeOrderFirst = PlaceOrderFirst();
placeOrderFirst.addressId = orderInfo.addressExt.addressId; placeOrderFirst.addressId = orderInfo.addressExt == null ? "" : orderInfo.addressExt.addressId;
placeOrderFirst.isSubscribe = orderInfo.isSubscribe; placeOrderFirst.isSubscribe = orderInfo.isSubscribe;
placeOrderFirst.isTakeOut = orderInfo.isTakeOut; placeOrderFirst.isTakeOut = orderInfo.isTakeOut;
placeOrderFirst.notes = orderInfo.notes; placeOrderFirst.notes = orderInfo.notes;
@ -73,9 +75,12 @@ class OrderUtils {
BaseData baseData = await minService BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson()) .settlementApi(placeOrderFirst.toJson())
.catchError((error) {}); .catchError((error) {});
if (baseData != null && baseData.isSuccess) { // if (baseData != null && baseData.isSuccess) {
//
// } else {
queryDetails(); queryDetails();
} SmartDialog.show(widget: Tips((){}, text: "${baseData.msg}",));
// }
} }
} }

4
lib/order/order_view/order_address.dart

@ -257,8 +257,8 @@ class _OrderAddress extends State<OrderAddress> {
} }
aginOrder(storeId, storeName) { aginOrder(storeId, storeName) {
Navigator.of(context).pushNamed('/router/union_detail_page', // Navigator.of(context).pushNamed('/router/union_detail_page',
arguments: {"id": storeId, "storeName": storeName}); // arguments: {"id": storeId, "storeName": storeName});
if(widget.orderInfo.storeVO.posType.code == "NORMALSTORE") { if(widget.orderInfo.storeVO.posType.code == "NORMALSTORE") {
Scan.toScan( Scan.toScan(

2
lib/order/write_off_page.dart

@ -71,7 +71,7 @@ class _WriteOffPage extends State<WriteOffPage> {
height: 8.h, height: 8.h,
), ),
Text( Text(
S.of(context).youxiaoqi( (coupon.useStartTime == null || coupon.useEndTime == null) ? "" : S.of(context).youxiaoqi(
"${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]}-${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}"), "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]}-${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}"),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,

158
lib/qr/qr_code_scan.dart

@ -1,7 +1,7 @@
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_scankit/scan_kit_widget.dart'; // import 'package:flutter_scankit/scan_kit_widget.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -17,85 +17,85 @@ class QrCodeScanPage extends StatefulWidget {
class _QrCodeScanPage extends State<QrCodeScanPage> { class _QrCodeScanPage extends State<QrCodeScanPage> {
ScanKitController _controller; // ScanKitController _controller;
final screenWidth = window.physicalSize.width; // final screenWidth = window.physicalSize.width;
final screenHeight = window.physicalSize.height; // final screenHeight = window.physicalSize.height;
//
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
} // }
//
@override // @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( // return Scaffold(
body: Container( // body: Container(
child: Stack( // child: Stack(
children: [ // children: [
Positioned( // Positioned(
child: Column( // child: Column(
children: [ // children: [
Expanded( // Expanded(
child: ScanKitWidget( // child: ScanKitWidget(
callback: (controller) { // callback: (controller) {
_controller = controller; // _controller = controller;
controller.onResult.listen((result) { // controller.onResult.listen((result) {
debugPrint("scanning result:$result"); // debugPrint("scanning result:$result");
Navigator.of(context).pop(result); // Navigator.of(context).pop(result);
}); // });
}, // },
continuouslyScan: false, // continuouslyScan: false,
boundingBox: Rect.fromLTRB(0, 0, screenWidth, screenHeight), // boundingBox: Rect.fromLTRB(0, 0, screenWidth, screenHeight),
), // ),
flex: 1, // flex: 1,
), // ),
], // ],
), // ),
top: 0, // top: 0,
bottom: 0, // bottom: 0,
left: 0, // left: 0,
right: 0, // right: 0,
), // ),
Positioned( // Positioned(
child: MyAppBar( // child: MyAppBar(
title: "扫码", // title: "扫码",
titleColor: Colors.white, // titleColor: Colors.white,
leadingColor: Colors.white, // leadingColor: Colors.white,
brightness: Brightness.dark, // brightness: Brightness.dark,
background: Colors.transparent, // background: Colors.transparent,
action: Container( // action: Container(
alignment: Alignment.center, // alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w), // margin: EdgeInsets.only(right: 16.w),
child: GestureDetector( // child: GestureDetector(
onTap: () { // onTap: () {
_controller.pickPhoto(); // _controller.pickPhoto();
}, // },
child: Text( // child: Text(
S.of(context).xiangce, // S.of(context).xiangce,
style: TextStyle( // style: TextStyle(
color: Colors.black, // color: Colors.black,
fontSize: 18.sp, // fontSize: 18.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
), // ),
), // ),
), // ),
top: 0, // top: 0,
left: 0, // left: 0,
right: 0, // right: 0,
), // ),
], // ],
), // ),
), // ),
); // );
} }
//
@override // @override
void dispose() { // void dispose() {
// if (this._controller != null) { // // if (this._controller != null) {
// this._controller.dispose(); // // this._controller.dispose();
// // }
// super.dispose();
// } // }
super.dispose();
}
} }

6
lib/retrofit/data/min_order_info.dart

@ -67,7 +67,7 @@ class MinOrderInfo {
dynamic discountType, dynamic discountType,
dynamic discountMoney, dynamic discountMoney,
dynamic overTime, dynamic overTime,
List<OrderProductListBean> orderProductVOList, List<OrderProductVOList> orderProductVOList,
dynamic moneyReturnList, dynamic moneyReturnList,
dynamic goodsReturnList, dynamic goodsReturnList,
dynamic moneyReturnVOList, dynamic moneyReturnVOList,
@ -235,7 +235,7 @@ class MinOrderInfo {
if (json['orderProductVOList'] != null) { if (json['orderProductVOList'] != null) {
this.orderProductVOList = []; this.orderProductVOList = [];
json['orderProductVOList'].forEach((v) { json['orderProductVOList'].forEach((v) {
this.orderProductVOList.add(OrderProductListBean.fromJson(v)); this.orderProductVOList.add(OrderProductVOList.fromJson(v));
}); });
} }
this.moneyReturnList = json['moneyReturnList']; this.moneyReturnList = json['moneyReturnList'];
@ -319,7 +319,7 @@ class MinOrderInfo {
dynamic discountType; dynamic discountType;
dynamic discountMoney; dynamic discountMoney;
dynamic overTime; dynamic overTime;
List<OrderProductListBean> orderProductVOList; List<OrderProductVOList> orderProductVOList;
dynamic moneyReturnList; dynamic moneyReturnList;
dynamic goodsReturnList; dynamic goodsReturnList;
dynamic moneyReturnVOList; dynamic moneyReturnVOList;

4
lib/retrofit/data/placeOrderFirst.dart

@ -21,7 +21,7 @@ class PlaceOrderFirst {
PromotionInfoDTOBean promotionInfoDTO; PromotionInfoDTOBean promotionInfoDTO;
String recMobile; String recMobile;
List<OrderProductVOList> orderProductVOList; List<OrderProductVOList> orderProductVOList;
List<OrderProductListBean> shoppingCartSkuItemList; List<OrderProductVOList> shoppingCartSkuItemList;
List<dynamic> skuItemDTOList; List<dynamic> skuItemDTOList;
num source; num source;
String storeId; String storeId;
@ -76,7 +76,7 @@ class PlaceOrderFirst {
placeOrderFirst.recMobile = json['recMobile']; placeOrderFirst.recMobile = json['recMobile'];
placeOrderFirst.shoppingCartSkuItemList = []..addAll( placeOrderFirst.shoppingCartSkuItemList = []..addAll(
(json['shoppingCartSkuItemList'] as List ?? []) (json['shoppingCartSkuItemList'] as List ?? [])
.map((o) => OrderProductListBean.fromJson(o))); .map((o) => OrderProductVOList.fromJson(o)));
placeOrderFirst.orderProductVOList = []..addAll( placeOrderFirst.orderProductVOList = []..addAll(
(json['orderProductVOList'] as List ?? []) (json['orderProductVOList'] as List ?? [])
.map((o) => OrderProductVOList.fromJson(o))); .map((o) => OrderProductVOList.fromJson(o)));

190
lib/retrofit/data/settleOrderInfo.dart

@ -1,4 +1,6 @@
import 'package:huixiang/retrofit/data/order_product_vo.dart';
class SettleOrderInfo { class SettleOrderInfo {
int orderNum; int orderNum;
int productNum; int productNum;
@ -12,7 +14,7 @@ class SettleOrderInfo {
List<CouponListBean> couponList; List<CouponListBean> couponList;
String threshold; String threshold;
String freePostAge; String freePostAge;
List<OrderProductListBean> orderProductList; List<OrderProductVOList> orderProductList;
static SettleOrderInfo fromJson(Map<String, dynamic> map) { static SettleOrderInfo fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -34,7 +36,7 @@ class SettleOrderInfo {
settleOrderInfoBean.threshold = map['threshold']; settleOrderInfoBean.threshold = map['threshold'];
settleOrderInfoBean.freePostAge = map['freePostAge']; settleOrderInfoBean.freePostAge = map['freePostAge'];
settleOrderInfoBean.orderProductList = List()..addAll( settleOrderInfoBean.orderProductList = List()..addAll(
(map['orderProductList'] as List ?? []).map((o) => OrderProductListBean.fromJson(o)) (map['orderProductList'] as List ?? []).map((o) => OrderProductVOList.fromJson(o))
); );
return settleOrderInfoBean; return settleOrderInfoBean;
} }
@ -84,98 +86,98 @@ class SettleOrderInfo {
/// status : null /// status : null
/// batch : null /// batch : null
class OrderProductListBean { // class OrderProductListBean {
dynamic id; // dynamic id;
dynamic createTime; // dynamic createTime;
dynamic createUser; // dynamic createUser;
dynamic updateTime; // dynamic updateTime;
dynamic updateUser; // dynamic updateUser;
dynamic tenantCode; // dynamic tenantCode;
dynamic storeId; // dynamic storeId;
dynamic orderId; // dynamic orderId;
dynamic actInfo; // dynamic actInfo;
String productId; // String productId;
String productName; // String productName;
String skuId; // String skuId;
String skuNameStr; // String skuNameStr;
dynamic skuImg; // dynamic skuImg;
int buyNum; // int buyNum;
dynamic refundNum; // dynamic refundNum;
dynamic type; // dynamic type;
dynamic reason; // dynamic reason;
double weight; // double weight;
String applyPrice; // String applyPrice;
String sellPrice; // String sellPrice;
dynamic postPay; // dynamic postPay;
dynamic isDelete; // dynamic isDelete;
dynamic discountAmount; // dynamic discountAmount;
dynamic discountPercent; // dynamic discountPercent;
dynamic status; // dynamic status;
dynamic batch; // dynamic batch;
//
static OrderProductListBean fromJson(Map<String, dynamic> map) { // static OrderProductListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null; // if (map == null) return null;
OrderProductListBean orderProductListBean = OrderProductListBean(); // OrderProductListBean orderProductListBean = OrderProductListBean();
orderProductListBean.id = map['id']; // orderProductListBean.id = map['id'];
orderProductListBean.createTime = map['createTime']; // orderProductListBean.createTime = map['createTime'];
orderProductListBean.createUser = map['createUser']; // orderProductListBean.createUser = map['createUser'];
orderProductListBean.updateTime = map['updateTime']; // orderProductListBean.updateTime = map['updateTime'];
orderProductListBean.updateUser = map['updateUser']; // orderProductListBean.updateUser = map['updateUser'];
orderProductListBean.tenantCode = map['tenantCode']; // orderProductListBean.tenantCode = map['tenantCode'];
orderProductListBean.storeId = map['storeId']; // orderProductListBean.storeId = map['storeId'];
orderProductListBean.orderId = map['orderId']; // orderProductListBean.orderId = map['orderId'];
orderProductListBean.actInfo = map['actInfo']; // orderProductListBean.actInfo = map['actInfo'];
orderProductListBean.productId = map['productId']; // orderProductListBean.productId = map['productId'];
orderProductListBean.productName = map['productName']; // orderProductListBean.productName = map['productName'];
orderProductListBean.skuId = map['skuId']; // orderProductListBean.skuId = map['skuId'];
orderProductListBean.skuNameStr = map['skuNameStr']; // orderProductListBean.skuNameStr = map['skuNameStr'];
orderProductListBean.skuImg = map['skuImg']; // orderProductListBean.skuImg = map['skuImg'];
orderProductListBean.buyNum = map['buyNum']; // orderProductListBean.buyNum = map['buyNum'];
orderProductListBean.refundNum = map['refundNum']; // orderProductListBean.refundNum = map['refundNum'];
orderProductListBean.type = map['type']; // orderProductListBean.type = map['type'];
orderProductListBean.reason = map['reason']; // orderProductListBean.reason = map['reason'];
orderProductListBean.weight = map['weight']; // orderProductListBean.weight = map['weight'];
orderProductListBean.applyPrice = map['applyPrice']; // orderProductListBean.applyPrice = map['applyPrice'];
orderProductListBean.sellPrice = map['sellPrice']; // orderProductListBean.sellPrice = map['sellPrice'];
orderProductListBean.postPay = map['postPay']; // orderProductListBean.postPay = map['postPay'];
orderProductListBean.isDelete = map['isDelete']; // orderProductListBean.isDelete = map['isDelete'];
orderProductListBean.discountAmount = map['discountAmount']; // orderProductListBean.discountAmount = map['discountAmount'];
orderProductListBean.discountPercent = map['discountPercent']; // orderProductListBean.discountPercent = map['discountPercent'];
orderProductListBean.status = map['status']; // orderProductListBean.status = map['status'];
orderProductListBean.batch = map['batch']; // orderProductListBean.batch = map['batch'];
return orderProductListBean; // return orderProductListBean;
} // }
//
Map toJson() => { // Map toJson() => {
"id": id, // "id": id,
"createTime": createTime, // "createTime": createTime,
"createUser": createUser, // "createUser": createUser,
"updateTime": updateTime, // "updateTime": updateTime,
"updateUser": updateUser, // "updateUser": updateUser,
"tenantCode": tenantCode, // "tenantCode": tenantCode,
"storeId": storeId, // "storeId": storeId,
"orderId": orderId, // "orderId": orderId,
"actInfo": actInfo, // "actInfo": actInfo,
"productId": productId, // "productId": productId,
"productName": productName, // "productName": productName,
"skuId": skuId, // "skuId": skuId,
"skuNameStr": skuNameStr, // "skuNameStr": skuNameStr,
"skuImg": skuImg, // "skuImg": skuImg,
"buyNum": buyNum, // "buyNum": buyNum,
"refundNum": refundNum, // "refundNum": refundNum,
"type": type, // "type": type,
"reason": reason, // "reason": reason,
"weight": weight, // "weight": weight,
"applyPrice": applyPrice, // "applyPrice": applyPrice,
"sellPrice": sellPrice, // "sellPrice": sellPrice,
"postPay": postPay, // "postPay": postPay,
"isDelete": isDelete, // "isDelete": isDelete,
"discountAmount": discountAmount, // "discountAmount": discountAmount,
"discountPercent": discountPercent, // "discountPercent": discountPercent,
"status": status, // "status": status,
"batch": batch, // "batch": batch,
}; // };
} // }
/// id : "1448907890034212864" /// id : "1448907890034212864"
/// storeId : "1333246101343436800" /// storeId : "1333246101343436800"

4
lib/retrofit/min_api.dart

@ -131,6 +131,10 @@ abstract class MinApiService {
debugPrint(msg, wrapWidth: maxStrLength); debugPrint(msg, wrapWidth: maxStrLength);
} }
///
@GET("/member/info")
Future<BaseData> memberInfo();
/// ///
@POST("product/findMiNiGroupList") @POST("product/findMiNiGroupList")
Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList( Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(

20
lib/retrofit/min_api.g.dart

@ -16,6 +16,26 @@ class _MinApiService implements MinApiService {
String baseUrl; String baseUrl;
@override
Future<BaseData<dynamic>> memberInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/info',
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;
}
@override @override
Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(param) async { Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(param) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');

29
lib/settlement/settlement.dart

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart'; import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/address.dart';
@ -12,8 +13,6 @@ import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.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/store_info.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
@ -28,6 +27,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart'; import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -56,6 +56,7 @@ class _Settlement extends State<Settlement> {
String parentId = ""; String parentId = "";
int payChannel = 4; int payChannel = 4;
int tableId = 0; int tableId = 0;
int numberOfPeople = 0;
Address address; Address address;
CouponListBean couponListBean; CouponListBean couponListBean;
@ -71,6 +72,7 @@ class _Settlement extends State<Settlement> {
parentCode = widget.arguments["parentCode"] ?? ""; parentCode = widget.arguments["parentCode"] ?? "";
parentId = widget.arguments["parentId"] ?? ""; parentId = widget.arguments["parentId"] ?? "";
storeInfo = widget.arguments["storeInfo"]; storeInfo = widget.arguments["storeInfo"];
numberOfPeople = widget.arguments["numberOfPeople"] ?? 0;
if (tableId == 0) { if (tableId == 0) {
placeOrder = true; placeOrder = true;
@ -111,6 +113,7 @@ class _Settlement extends State<Settlement> {
settleOrderInfo = baseData.data; settleOrderInfo = baseData.data;
if (settleOrderInfo.orderProductList == null || if (settleOrderInfo.orderProductList == null ||
settleOrderInfo.orderProductList.length == 0) { settleOrderInfo.orderProductList.length == 0) {
placeOrder = true;
queryOrderDetails(parentId); queryOrderDetails(parentId);
} }
}); });
@ -119,6 +122,7 @@ class _Settlement extends State<Settlement> {
/// ///
queryOrderDetails(id) async { queryOrderDetails(id) async {
print("ididididididid: $id");
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": id, "id": id,
}).catchError((error) {}); }).catchError((error) {});
@ -196,7 +200,7 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.isSubscribe = false; placeOrderFirst.isSubscribe = false;
placeOrderFirst.isTakeOut = selectedBtn; placeOrderFirst.isTakeOut = selectedBtn;
placeOrderFirst.notes = remakers; placeOrderFirst.notes = remakers;
placeOrderFirst.numberOfPeople = "0"; placeOrderFirst.numberOfPeople = "$numberOfPeople";
placeOrderFirst.orderSource = 2; placeOrderFirst.orderSource = 2;
placeOrderFirst.orderType = "0"; placeOrderFirst.orderType = "0";
placeOrderFirst.orderTypeId = 0; placeOrderFirst.orderTypeId = 0;
@ -232,23 +236,32 @@ class _Settlement extends State<Settlement> {
} else { } else {
/// ///
BaseData<DownOrder> baseData; BaseData<DownOrder> baseData;
if (parentId == "") { if (parentId == "") { //
if (placeOrder) { //
querySettlement();
} else { //
baseData = await minService baseData = await minService
.placeOrderFirst(placeOrderFirst.toJson()) .placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) { .catchError((error) {
print("error: $error"); print("error: $error");
}); });
}
} else { } else {
if (placeOrder) { //
querySettlement();
} else { //
baseData = await minService baseData = await minService
.addOrder(placeOrderFirst.toJson()) .addOrder(placeOrderFirst.toJson())
.catchError((error) { .catchError((error) {
print("error: $error"); print("error: $error");
}); });
} }
}
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
placeOrder = true; placeOrder = true;
this.downOrder = baseData.data; this.downOrder = baseData.data;
queryOrderDetails(parentId); queryOrderDetails(
(parentId == null || parentId == "") ? baseData.data.id : parentId);
setState(() {}); setState(() {});
} }
} }
@ -257,7 +270,7 @@ class _Settlement extends State<Settlement> {
/// ///
querySettlement() async { querySettlement() async {
placeOrderFirst.id = parentId != "" ? parentId : downOrder.id; placeOrderFirst.id = parentId != "" ? parentId : downOrder.id;
placeOrderFirst.orderProductVOList = downOrder.orderProductVOList; placeOrderFirst.orderProductVOList = downOrder == null ? minOrderInfo.orderProductVOList : downOrder.orderProductVOList;
if (placeOrderFirst.payChannel == 1) { if (placeOrderFirst.payChannel == 1) {
if (!(await Min.isInitialize())) { if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调 // app的充值支付使用同一个WXPayEntryActivity回调
@ -295,6 +308,8 @@ class _Settlement extends State<Settlement> {
.catchError((error) {}); .catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
} else {
SmartDialog.show(widget: Tips((){}, text: "${baseData.msg}",));
} }
} }
} }
@ -377,7 +392,7 @@ class _Settlement extends State<Settlement> {
couponCount(), couponCount(),
), ),
/// if (placeOrder) ///
PayMethod(payChannelCheck), PayMethod(payChannelCheck),
], ],
), ),

59
lib/settlement/settlement_view/pay_method.dart

@ -1,11 +1,11 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:shared_preferences/shared_preferences.dart';
class PayMethod extends StatefulWidget { class PayMethod extends StatefulWidget {
final Function(int payChannel) payChannelCheck; final Function(int payChannel) payChannelCheck;
PayMethod(this.payChannelCheck); PayMethod(this.payChannelCheck);
@ -14,10 +14,25 @@ class PayMethod extends StatefulWidget {
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _PayMethod(); return _PayMethod();
} }
} }
class _PayMethod extends State<PayMethod> { class _PayMethod extends State<PayMethod> {
String money = "0";
String balance = "0";
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
Map<String, dynamic> memberInfo =
jsonDecode(value.getString("minMember"));
balance = memberInfo["balance"];
money = memberInfo["money"];
setState(() {});
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -68,16 +83,32 @@ class _PayMethod extends State<PayMethod> {
widget.payChannelCheck(4); widget.payChannelCheck(4);
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
checkView(1), checkView(1),
Expanded(
child: Container(),
flex: 1,
),
Text(
"¥$money",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
width: 10,
),
Text( Text(
S.of(context).pingtaiyue, S.of(context).pingtaiyue,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,), fontWeight: MyFontWeight.semi_bold,
),
), ),
], ],
), ),
@ -93,10 +124,25 @@ class _PayMethod extends State<PayMethod> {
widget.payChannelCheck(3); widget.payChannelCheck(3);
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
checkView(2), checkView(2),
Expanded(
child: Container(),
flex: 1,
),
Text(
"¥$balance",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
width: 10,
),
Text( Text(
S.of(context).dianpuyue, S.of(context).dianpuyue,
style: TextStyle( style: TextStyle(
@ -159,5 +205,4 @@ class _PayMethod extends State<PayMethod> {
), ),
); );
} }
} }

3
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
@ -113,7 +114,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
return widgets; return widgets;
} }
Widget commodityItem(OrderProductListBean productList) { Widget commodityItem(OrderProductVOList productList) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row( child: Row(

7
lib/store/scan.dart

@ -1,9 +1,8 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:qrscan/qrscan.dart' as scanner;
class Scan { class Scan {
@ -26,8 +25,8 @@ class Scan {
); );
}); });
} else if (await Permission.camera.isGranted) { } else if (await Permission.camera.isGranted) {
var result = await Navigator.of(context).pushNamed('/router/qr_scan'); // var result = await Navigator.of(context).pushNamed('/router/qr_scan');
String result = await scanner.scan();
if (result != null && result != "") { if (result != null && result != "") {
Uri uri = Uri.parse(result); Uri uri = Uri.parse(result);
String table = uri.queryParameters["tableId"]; String table = uri.queryParameters["tableId"];

24
lib/store/store_order.dart

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:ai_decimal_accuracy/ai_decimal_accuracy.dart'; import 'package:ai_decimal_accuracy/ai_decimal_accuracy.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -115,6 +117,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
storeId: storeId, storeId: storeId,
showLoading: false, showLoading: false,
); );
queryMemberInfo();
queryShopCar().then((value) { queryShopCar().then((value) {
this.shopCarGoods = value; this.shopCarGoods = value;
setState(() {}); setState(() {});
@ -127,6 +132,18 @@ class _StoreOrderPage extends State<StoreOrderPage>
}); });
} }
queryMemberInfo() async {
BaseData baseData = await minService.memberInfo()
.catchError((error){debugPrint(error);});
if (baseData != null && baseData.isSuccess) {
SharedPreferences.getInstance().then(
(value) => {
value.setString('minMember', jsonEncode(baseData.data)),
},
);
}
}
/// ///
getParentInfo() async { getParentInfo() async {
BaseData baseData = await minService.getParentInfo("$tableId") BaseData baseData = await minService.getParentInfo("$tableId")
@ -161,8 +178,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
queryStoreInfo() async { queryStoreInfo() async {
BaseData baseData = BaseData baseData = await apiService.queryStoreInfo(storeId).catchError((error) {
await apiService.queryStoreInfo(storeId).catchError((error) {
debugPrint(error); debugPrint(error);
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -192,6 +208,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
return true; return true;
} }
}, },
child: Container(
color: Colors.white,
child: Stack( child: Stack(
children: [ children: [
Positioned( Positioned(
@ -463,6 +481,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
), ),
], ],
), ),
),
); );
} }
@ -536,6 +555,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
"parentCode": parentCode, "parentCode": parentCode,
"parentId": parentId, "parentId": parentId,
"shoppingCart": shopCarGoods, "shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople,
}, },
); );
getParentInfo(); getParentInfo();

11
lib/store/store_view/shop_car.dart

@ -177,6 +177,7 @@ class _ShopCar extends State<ShopCar> {
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
SmartDialog.dismiss();
widget.toDownOrder(); widget.toDownOrder();
}, },
child: RoundButton( child: RoundButton(
@ -188,8 +189,7 @@ class _ShopCar extends State<ShopCar> {
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
radius: 0, radius: 0,
fontSize: 16.sp, fontSize: 16.sp,
padding: padding: EdgeInsets.symmetric(vertical: 5.h),
EdgeInsets.symmetric(vertical: 5.h),
), ),
), ),
], ],
@ -220,10 +220,9 @@ class _ShopCar extends State<ShopCar> {
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 12.sp, fontSize: 12.sp,
radius: 100, radius: 100,
callback: () { // callback: () {
// Navigator.of(context) // Navigator.of(context).pushNamed('/router/test_page');
// .pushNamed('/router/test_page'); // },
},
), ),
), ),
], ],

58
lib/store/store_view/shop_goods.dart

@ -110,9 +110,9 @@ class _ShopGoods extends State<ShopGoods> {
), ),
Row( Row(
children: [ children: [
Column( // Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Row( Row(
children: [ children: [
Text( Text(
@ -127,7 +127,7 @@ class _ShopGoods extends State<ShopGoods> {
width: 4, width: 4,
), ),
Text( Text(
"¥${widget.productListBean != null ? widget.productListBean.price : widget.shoppingCartSkuItemListBean.skuPrice}", "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}",
style: TextStyle( style: TextStyle(
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
fontSize: 11.sp, fontSize: 11.sp,
@ -136,31 +136,31 @@ class _ShopGoods extends State<ShopGoods> {
), ),
], ],
), ),
Row( // Row(
children: [ // children: [
Text( // Text(
S.of(context).yuanjia, // S.of(context).yuanjia,
style: TextStyle( // style: TextStyle(
color: Color(0xFFA29E9E), // color: Color(0xFFA29E9E),
fontSize: 9.sp, // fontSize: 9.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
), // ),
), // ),
SizedBox( // SizedBox(
width: 4, // width: 4,
), // ),
Text( // Text(
"¥${widget.productListBean != null ? widget.productListBean.applyPrice : widget.shoppingCartSkuItemListBean.skuPrice}", // "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}",
style: TextStyle( // style: TextStyle(
color: Color(0xFFA29E9E), // color: Color(0xFFA29E9E),
fontSize: 10.sp, // fontSize: 10.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
), // ),
), // ),
], // ],
), // ),
], // ],
), // ),
Spacer(), Spacer(),
if (!widget.isShopCart) if (!widget.isShopCart)
Stack( Stack(

79
lib/store/store_view/store_info.dart

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
@ -6,9 +7,9 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:url_launcher/url_launcher.dart';
class StoreInfoView extends StatefulWidget { class StoreInfoView extends StatefulWidget {
final StoreInfo storeInfo; final StoreInfo storeInfo;
StoreInfoView(this.storeInfo); StoreInfoView(this.storeInfo);
@ -56,7 +57,9 @@ class _StoreInfoView extends State<StoreInfoView> {
Container( Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
widget.storeInfo != null ? (widget.storeInfo.storeName ?? "") : "", widget.storeInfo != null
? (widget.storeInfo.storeName ?? "")
: "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 18.sp, fontSize: 18.sp,
@ -68,9 +71,11 @@ class _StoreInfoView extends State<StoreInfoView> {
Row( Row(
children: [ children: [
Text( Text(
S.of(context).ren(widget.storeInfo != null S.of(context).ren(
widget.storeInfo != null
? widget.storeInfo.perCapitaConsumption ? widget.storeInfo.perCapitaConsumption
: "",), : "",
),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
@ -86,7 +91,9 @@ class _StoreInfoView extends State<StoreInfoView> {
: "")), : "")),
), ),
Text( Text(
widget.storeInfo != null ? widget.storeInfo.address : "", widget.storeInfo != null
? widget.storeInfo.address
: "",
maxLines: 2, maxLines: 2,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
style: TextStyle( style: TextStyle(
@ -121,12 +128,12 @@ class _StoreInfoView extends State<StoreInfoView> {
Expanded( Expanded(
child: Text( child: Text(
S.of(context).yingyeshijian(widget.storeInfo == null S.of(context).yingyeshijian(widget.storeInfo == null
? "" : (widget.storeInfo.openStartTime == null && ? ""
: (widget.storeInfo.openStartTime == null &&
widget.storeInfo.openEndTime == null) widget.storeInfo.openEndTime == null)
? S.of(context).quantian ? S.of(context).quantian
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}" "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"),
),
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -138,7 +145,16 @@ class _StoreInfoView extends State<StoreInfoView> {
width: 16.w, width: 16.w,
), ),
InkWell( InkWell(
onTap: () {}, onTap: () {
Navigator.of(context).pushNamed(
'/router/location_map',
arguments: {
"lat": widget.storeInfo.latitude,
"lng": widget.storeInfo.longitude,
"storeName": widget.storeInfo.storeName,
},
);
},
child: Image.asset( child: Image.asset(
"assets/image/icon_union_location.png", "assets/image/icon_union_location.png",
width: 24.w, width: 24.w,
@ -149,7 +165,9 @@ class _StoreInfoView extends State<StoreInfoView> {
width: 16.w, width: 16.w,
), ),
InkWell( InkWell(
onTap: () {}, onTap: () {
showCallMobile();
},
child: Image.asset( child: Image.asset(
"assets/image/icon_union_call.png", "assets/image/icon_union_call.png",
width: 24, width: 24,
@ -163,6 +181,47 @@ class _StoreInfoView extends State<StoreInfoView> {
); );
} }
showCallMobile() {
showCupertinoModalPopup(
context: context,
builder: (context) {
return CupertinoActionSheet(
title: Text(S.of(context).bodadianhua),
actions: [
if (widget.storeInfo != null &&
widget.storeInfo.tel != null &&
widget.storeInfo.tel != "")
CupertinoActionSheetAction(
child: Text(widget.storeInfo.tel),
onPressed: () {
callMobile(widget.storeInfo.tel);
Navigator.of(context).pop();
},
isDefaultAction: true,
isDestructiveAction: false,
),
],
cancelButton: CupertinoActionSheetAction(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(S.of(context).quxiao),
isDestructiveAction: true,
),
);
});
}
callMobile(mobile) async {
String url = "tel:$mobile";
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
List<Widget> itemServer(String businessService) { List<Widget> itemServer(String businessService) {
if (businessService == null || businessService == "") return []; if (businessService == null || businessService == "") return [];
var list = businessService.split(","); var list = businessService.split(",");

14
pubspec.lock

@ -263,13 +263,6 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.11" version: "1.0.11"
flutter_scankit:
dependency: "direct main"
description:
name: flutter_scankit
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
flutter_screenutil: flutter_screenutil:
dependency: "direct main" dependency: "direct main"
description: description:
@ -581,6 +574,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
qrscan:
dependency: "direct main"
description:
name: qrscan
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.2"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:

3
pubspec.yaml

@ -58,7 +58,8 @@ dependencies:
#多图, 裁剪 #多图, 裁剪
image_pickers: ^2.0.0 image_pickers: ^2.0.0
flutter_scankit: ^1.2.0 # flutter_scankit: ^1.2.0
qrscan: ^0.3.2
path_provider: ^1.2.0 path_provider: ^1.2.0
cached_network_image: ^2.0.0 cached_network_image: ^2.0.0

Loading…
Cancel
Save