diff --git a/lib/common/values/constants.dart b/lib/common/values/constants.dart index 1480343..a35825b 100644 --- a/lib/common/values/constants.dart +++ b/lib/common/values/constants.dart @@ -12,7 +12,7 @@ class Constants { /// 服务 url 线上 // static const apiUrl = 'https://stgl.pj.gov.cn/api'; - static const apiUrl = 'http://192.168.101.185:9999'; + static const apiUrl = 'http://192.168.101.196:9999'; /// 静态资源 url static const ossUrl = apiUrl; diff --git a/lib/common/widgets/order/mixin/order_mixin.dart b/lib/common/widgets/order/mixin/order_mixin.dart index e69094e..80c0b36 100644 --- a/lib/common/widgets/order/mixin/order_mixin.dart +++ b/lib/common/widgets/order/mixin/order_mixin.dart @@ -454,6 +454,19 @@ mixin OrderMixin { /// **************** start 副屏幕相关 start **************** void putOffSendSubScreen({int seconds = 5}) { + // 如果有商品就不反回 + if (_sysType == SysType.SUPERMARKET) { + if (supermarketSpuList.isNotEmpty) { + putOffSendSubScreenDelayed = null; + return; + } + } + if (_sysType == SysType.CANTEEN) { + if (canteenSpuList.isNotEmpty) { + putOffSendSubScreenDelayed = null; + return; + } + } if (putOffSendSubScreenDelayed != null) { sendSubScreenBack(); putOffSendSubScreenDelayed = null; @@ -472,9 +485,6 @@ mixin OrderMixin { } Future sendSubScreen() async { - await SubScreenPlugin.sendMsgToViceScreen( - SubScreenAction.jumpSubPage.name, - ); final json = SubScreenProductEvent( shopList: shopCardList.map((e) => e.toJson()).toList(), sysType: _sysType, diff --git a/lib/sub_screen/common/utils/sub_page_tool.dart b/lib/sub_screen/common/utils/sub_page_tool.dart index 3dfa705..c37270a 100644 --- a/lib/sub_screen/common/utils/sub_page_tool.dart +++ b/lib/sub_screen/common/utils/sub_page_tool.dart @@ -15,6 +15,7 @@ class SubPageToool { SubRouteNames.subProduct, (Route route) => false, ); + logger.i("跳转到商品页面"); SubNavigatorKey.currentRouteName = SubRouteNames.subProduct; break; case SubScreenAction.jumpSubBack: @@ -25,6 +26,7 @@ class SubPageToool { SubRouteNames.root, (Route route) => false, ); + logger.i("跳转到欢迎页面"); SubNavigatorKey.currentRouteName = SubRouteNames.root; break; default: diff --git a/lib/sub_screen/page/sub_app.dart b/lib/sub_screen/page/sub_app.dart index 36d663d..9af0427 100644 --- a/lib/sub_screen/page/sub_app.dart +++ b/lib/sub_screen/page/sub_app.dart @@ -25,7 +25,15 @@ class _SubAppPageState extends State { _streamSubscription = SubScreenPlugin.viceStream.listen((event) { final action = SubScreenAction.values.fromCode(event.method); if (action == null) return; - SubPageToool.switchJump(action); + if (action == SubScreenAction.updateCard) { + if (SubNavigatorKey.currentRouteName != SubRouteNames.subProduct) { + SubPageToool.switchJump(SubScreenAction.jumpSubPage); + } else { + SubPageToool.switchJump(action); + } + } else { + SubPageToool.switchJump(action); + } }); } diff --git a/lib/sub_screen/page/sub_product.dart b/lib/sub_screen/page/sub_product.dart index 74adb8f..1798d38 100644 --- a/lib/sub_screen/page/sub_product.dart +++ b/lib/sub_screen/page/sub_product.dart @@ -55,6 +55,8 @@ class _SubProductPageState extends State { _sysType = subScreenEvent.sysType; if (subScreenEvent.payUser != null) { _payUser = ServiceUser.fromJson(subScreenEvent.payUser!); + } else { + _payUser = null; } _totalPrice = subScreenEvent.totalPrice; _amountMealPrice = subScreenEvent.amountMealPrice;