11
This commit is contained in:
1 parent
52c1c30658
commit
7ed1a4a343
5 files changed
+27
-5
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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<void> sendSubScreen() async {
|
||||
await SubScreenPlugin.sendMsgToViceScreen(
|
||||
SubScreenAction.jumpSubPage.name,
|
||||
);
|
||||
final json = SubScreenProductEvent(
|
||||
shopList: shopCardList.map((e) => e.toJson()).toList(),
|
||||
sysType: _sysType,
|
||||
|
||||
@@ -15,6 +15,7 @@ class SubPageToool {
|
||||
SubRouteNames.subProduct,
|
||||
(Route<dynamic> route) => false,
|
||||
);
|
||||
logger.i("跳转到商品页面");
|
||||
SubNavigatorKey.currentRouteName = SubRouteNames.subProduct;
|
||||
break;
|
||||
case SubScreenAction.jumpSubBack:
|
||||
@@ -25,6 +26,7 @@ class SubPageToool {
|
||||
SubRouteNames.root,
|
||||
(Route<dynamic> route) => false,
|
||||
);
|
||||
logger.i("跳转到欢迎页面");
|
||||
SubNavigatorKey.currentRouteName = SubRouteNames.root;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -25,7 +25,15 @@ class _SubAppPageState extends State<SubAppPage> {
|
||||
_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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ class _SubProductPageState extends State<SubProductPage> {
|
||||
_sysType = subScreenEvent.sysType;
|
||||
if (subScreenEvent.payUser != null) {
|
||||
_payUser = ServiceUser.fromJson(subScreenEvent.payUser!);
|
||||
} else {
|
||||
_payUser = null;
|
||||
}
|
||||
_totalPrice = subScreenEvent.totalPrice;
|
||||
_amountMealPrice = subScreenEvent.amountMealPrice;
|
||||
|
||||
Reference in new issue
Block a user