From 1a144d1860d521fef10c930f902f35b0422ecdd1 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Tue, 18 Mar 2025 21:19:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=89=AF=E5=B1=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=A0=E8=BE=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/plugs/sub_screen_models.dart | 3 ++- .../models/plugs/sub_screen_models.g.dart | 4 +-- .../database/dao/canteen_spu_dao.dart | 12 +++++++-- lib/common/services/database/database.g.dart | 25 +++++++++++-------- .../database/entity/canteen_spu_entity.dart | 4 +-- .../database/entity/canteen_spu_entity.g.dart | 6 ++--- lib/common/utils/app/app_setting_tool.dart | 8 ++---- lib/common/utils/sync/sync_product_tool.dart | 10 +++++--- .../widgets/order/mixin/order_mixin.dart | 2 +- lib/common/widgets/order/order_common.dart | 6 ++--- lib/common/widgets/user/user_info.dart | 5 +++- lib/pages/panel/controller.dart | 4 +-- .../setting/widgets/setting_baseInfo.dart | 4 +-- lib/sub_screen/page/sub_product.dart | 4 ++- 14 files changed, 55 insertions(+), 42 deletions(-) diff --git a/lib/common/models/plugs/sub_screen_models.dart b/lib/common/models/plugs/sub_screen_models.dart index b45f273..fb533ec 100644 --- a/lib/common/models/plugs/sub_screen_models.dart +++ b/lib/common/models/plugs/sub_screen_models.dart @@ -14,7 +14,8 @@ class SubScreenProductEvent { SysType sysType; // 支付用户 - ServiceUser? payUser; + // ServiceUser + Map? payUser; // 购物车总价 int totalPrice; diff --git a/lib/common/models/plugs/sub_screen_models.g.dart b/lib/common/models/plugs/sub_screen_models.g.dart index 17d4411..100144e 100644 --- a/lib/common/models/plugs/sub_screen_models.g.dart +++ b/lib/common/models/plugs/sub_screen_models.g.dart @@ -13,9 +13,7 @@ SubScreenProductEvent _$SubScreenProductEventFromJson( .map((e) => e as Map) .toList(), sysType: $enumDecode(_$SysTypeEnumMap, json['sysType']), - payUser: json['payUser'] == null - ? null - : ServiceUser.fromJson(json['payUser'] as Map), + payUser: json['payUser'] as Map?, totalPrice: (json['totalPrice'] as num).toInt(), amountMealPrice: (json['amountMealPrice'] as num).toInt(), ); diff --git a/lib/common/services/database/dao/canteen_spu_dao.dart b/lib/common/services/database/dao/canteen_spu_dao.dart index 1251ef5..eae72d1 100644 --- a/lib/common/services/database/dao/canteen_spu_dao.dart +++ b/lib/common/services/database/dao/canteen_spu_dao.dart @@ -56,9 +56,17 @@ abstract class CanteenSpuDao { Future getCount(String hourType); @Query(''' - SELECT * FROM canteen_spu WHERE delFlag = 0 AND serviceUniqueCode = :code + SELECT * FROM canteen_spu + WHERE + delFlag = 0 + AND serviceUniqueCode = :code + AND (:saleDate = '-1' OR strftime('%Y-%m-%d', saleDate) = strftime('%Y-%m-%d', :saleDate)) + LIMIT 1 ''') - Future getByCode(String code); + Future getByCode( + String code, + String saleDate, + ); @Query(''' SELECT canteen_spu.* diff --git a/lib/common/services/database/database.g.dart b/lib/common/services/database/database.g.dart index 460bd01..7df4eb6 100644 --- a/lib/common/services/database/database.g.dart +++ b/lib/common/services/database/database.g.dart @@ -118,7 +118,7 @@ class _$AppDatabase extends AppDatabase { await database.execute( 'CREATE TABLE IF NOT EXISTS `order_record` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `uniqueCode` TEXT NOT NULL, `serviceUniqueCode` TEXT NOT NULL, `sysType` TEXT NOT NULL, `userCode` TEXT NOT NULL, `username` TEXT, `hourType` TEXT, `price` INTEGER NOT NULL, `extraPrice` INTEGER NOT NULL, `payPrice` INTEGER NOT NULL, `walletId` TEXT, `orderSourceTypeId` TEXT, `type` TEXT NOT NULL, `status` TEXT NOT NULL, `payType` TEXT NOT NULL, `productDesc` TEXT, `count` INTEGER NOT NULL, `weight` REAL NOT NULL, `payTime` TEXT, `createTime` TEXT NOT NULL)'); await database.execute( - 'CREATE TABLE IF NOT EXISTS `canteen_spu` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `serviceUniqueCode` TEXT NOT NULL, `classifyServiceUniqueCode` TEXT NOT NULL, `hourType` INTEGER, `saleDate` TEXT, `name` TEXT NOT NULL, `price` INTEGER NOT NULL, `image` TEXT, `isDefault` INTEGER NOT NULL, `status` INTEGER NOT NULL, `sort` INTEGER NOT NULL, `createTime` TEXT NOT NULL, `updateTime` TEXT NOT NULL, `delFlag` INTEGER NOT NULL)'); + 'CREATE TABLE IF NOT EXISTS `canteen_spu` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `serviceUniqueCode` TEXT NOT NULL, `classifyServiceUniqueCode` TEXT NOT NULL, `hourType` INTEGER, `saleDate` TEXT NOT NULL, `name` TEXT NOT NULL, `price` INTEGER NOT NULL, `image` TEXT, `isDefault` INTEGER NOT NULL, `status` INTEGER NOT NULL, `sort` INTEGER NOT NULL, `createTime` TEXT NOT NULL, `updateTime` TEXT NOT NULL, `delFlag` INTEGER NOT NULL)'); await database.execute( 'CREATE TABLE IF NOT EXISTS `supermarket_sku` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `serviceUniqueCode` TEXT NOT NULL, `spuId` TEXT NOT NULL, `barCode` TEXT NOT NULL, `spec` TEXT NOT NULL, `unit` TEXT NOT NULL, `packageNum` INTEGER NOT NULL, `purchasePrice` INTEGER NOT NULL, `retailPrice` INTEGER NOT NULL, `promotionPrice` INTEGER NOT NULL)'); await database.execute( @@ -482,7 +482,7 @@ class _$CanteenSpuDao extends CanteenSpuDao { 'serviceUniqueCode': item.serviceUniqueCode, 'classifyServiceUniqueCode': item.classifyServiceUniqueCode, 'hourType': item.hourType?.index, - 'saleDate': _dateTimeEmptyConverter.encode(item.saleDate), + 'saleDate': _dateTimeConverter.encode(item.saleDate), 'name': item.name, 'price': item.price, 'image': item.image, @@ -502,7 +502,7 @@ class _$CanteenSpuDao extends CanteenSpuDao { 'serviceUniqueCode': item.serviceUniqueCode, 'classifyServiceUniqueCode': item.classifyServiceUniqueCode, 'hourType': item.hourType?.index, - 'saleDate': _dateTimeEmptyConverter.encode(item.saleDate), + 'saleDate': _dateTimeConverter.encode(item.saleDate), 'name': item.name, 'price': item.price, 'image': item.image, @@ -522,7 +522,7 @@ class _$CanteenSpuDao extends CanteenSpuDao { 'serviceUniqueCode': item.serviceUniqueCode, 'classifyServiceUniqueCode': item.classifyServiceUniqueCode, 'hourType': item.hourType?.index, - 'saleDate': _dateTimeEmptyConverter.encode(item.saleDate), + 'saleDate': _dateTimeConverter.encode(item.saleDate), 'name': item.name, 'price': item.price, 'image': item.image, @@ -571,11 +571,14 @@ class _$CanteenSpuDao extends CanteenSpuDao { } @override - Future getByCode(String code) async { + Future getByCode( + String code, + String saleDate, + ) async { return _queryAdapter.query( - 'SELECT * FROM canteen_spu WHERE delFlag = 0 AND serviceUniqueCode = ?1', - mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeEmptyConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), - arguments: [code]); + 'SELECT * FROM canteen_spu WHERE delFlag = 0 AND serviceUniqueCode = ?1 AND (?2 = \'-1\' OR strftime(\'%Y-%m-%d\', saleDate) = strftime(\'%Y-%m-%d\', ?2)) LIMIT 1', + mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), + arguments: [code, saleDate]); } @override @@ -585,7 +588,7 @@ class _$CanteenSpuDao extends CanteenSpuDao { ) async { return _queryAdapter.queryList( 'SELECT canteen_spu.* FROM canteen_spu LEFT JOIN classify ON canteen_spu.classifyServiceUniqueCode = classify.serviceUniqueCode WHERE canteen_spu.delFlag = 0 AND (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || hourType || \',\', \',\' || ?2 || \',\') > 0) ORDER BY classify.sort, canteen_spu.price', - mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeEmptyConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), + mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), arguments: [classifyServiceUniqueCode, hourType]); } @@ -598,7 +601,7 @@ class _$CanteenSpuDao extends CanteenSpuDao { ) async { return _queryAdapter.queryList( 'SELECT canteen_spu.* FROM canteen_spu LEFT JOIN classify ON canteen_spu.classifyServiceUniqueCode = classify.serviceUniqueCode WHERE canteen_spu.delFlag = 0 AND (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || canteen_spu.hourType || \',\', \',\' || ?2 || \',\') > 0) AND strftime(\'%Y-%m-%d\', saleDate) = strftime(\'%Y-%m-%d\', \'now\', \'localtime\') ORDER BY classify.sort, classify.id, canteen_spu.price LIMIT ?3 OFFSET ?4', - mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeEmptyConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), + mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), arguments: [classifyServiceUniqueCode, hourType, pageSize, offset]); } @@ -606,7 +609,7 @@ class _$CanteenSpuDao extends CanteenSpuDao { Future> getDefault(String hourType) async { return _queryAdapter.queryList( 'SELECT * FROM canteen_spu WHERE delFlag = 0 AND isDefault = 1 AND (?1 = \'-1\' OR hourType = ?1) AND strftime(\'%Y-%m-%d\', saleDate) = strftime(\'%Y-%m-%d\', \'now\', \'localtime\')', - mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeEmptyConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), + mapper: (Map row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)), arguments: [hourType]); } diff --git a/lib/common/services/database/entity/canteen_spu_entity.dart b/lib/common/services/database/entity/canteen_spu_entity.dart index 4071d03..f07f3aa 100644 --- a/lib/common/services/database/entity/canteen_spu_entity.dart +++ b/lib/common/services/database/entity/canteen_spu_entity.dart @@ -23,7 +23,7 @@ class CanteenSpuEntity extends Equatable { ProductHourType? hourType; /// 菜品上架日期 - DateTime? saleDate; + DateTime saleDate; /// 商品名 String name; @@ -57,7 +57,7 @@ class CanteenSpuEntity extends Equatable { required this.serviceUniqueCode, required this.classifyServiceUniqueCode, this.hourType, - this.saleDate, + required this.saleDate, required this.name, required this.price, this.image, diff --git a/lib/common/services/database/entity/canteen_spu_entity.g.dart b/lib/common/services/database/entity/canteen_spu_entity.g.dart index 1e4029b..ec13364 100644 --- a/lib/common/services/database/entity/canteen_spu_entity.g.dart +++ b/lib/common/services/database/entity/canteen_spu_entity.g.dart @@ -12,9 +12,7 @@ CanteenSpuEntity _$CanteenSpuEntityFromJson(Map json) => serviceUniqueCode: json['serviceUniqueCode'] as String, classifyServiceUniqueCode: json['classifyServiceUniqueCode'] as String, hourType: $enumDecodeNullable(_$ProductHourTypeEnumMap, json['hourType']), - saleDate: json['saleDate'] == null - ? null - : DateTime.parse(json['saleDate'] as String), + saleDate: DateTime.parse(json['saleDate'] as String), name: json['name'] as String, price: (json['price'] as num).toInt(), image: json['image'] as String?, @@ -32,7 +30,7 @@ Map _$CanteenSpuEntityToJson(CanteenSpuEntity instance) => 'serviceUniqueCode': instance.serviceUniqueCode, 'classifyServiceUniqueCode': instance.classifyServiceUniqueCode, 'hourType': _$ProductHourTypeEnumMap[instance.hourType], - 'saleDate': instance.saleDate?.toIso8601String(), + 'saleDate': instance.saleDate.toIso8601String(), 'name': instance.name, 'price': instance.price, 'image': instance.image, diff --git a/lib/common/utils/app/app_setting_tool.dart b/lib/common/utils/app/app_setting_tool.dart index 22900c8..dc1bf3d 100644 --- a/lib/common/utils/app/app_setting_tool.dart +++ b/lib/common/utils/app/app_setting_tool.dart @@ -221,12 +221,8 @@ abstract class AppSettingTool { /// 绑定设备信息 static Future bindSys(int serviceId) async { - final sysSetting = await AppSettingTool.getSysSetting(); - var androidId = sysSetting.androidId; - if (ObjectUtil.isEmpty(androidId)) { - androidId = await AppSysTool.getAndroidId(); - if (ObjectUtil.isEmpty(androidId)) return false; - } + var androidId = await AppSysTool.getAndroidId(); + if (ObjectUtil.isEmpty(androidId)) return false; final pa = {"id": serviceId, "uniqueCode": androidId}; try { final data = await HardApi.bind(pa); diff --git a/lib/common/utils/sync/sync_product_tool.dart b/lib/common/utils/sync/sync_product_tool.dart index 756db22..fb73f04 100644 --- a/lib/common/utils/sync/sync_product_tool.dart +++ b/lib/common/utils/sync/sync_product_tool.dart @@ -167,7 +167,7 @@ abstract class SyncProductTool { while (true) { final pa = { "current": currentPage, - "size": 100, + "size": 50, }; final supermarket = await ProductApi.supermarketSpu( pa, @@ -259,12 +259,16 @@ abstract class SyncProductTool { createTime: DateTime.now(), updateTime: DateTime.now(), hourType: ProductHourType.values.fromCode(v.hourType), - saleDate: v.saleDate, + saleDate: v.saleDate ?? DateTime.now(), isDefault: false, delFlag: false, ); if (isUpdate) { - final detail = await productDao.getByCode(item.serviceUniqueCode); + final saleDateStr = DateUtil.formatDate(item.saleDate); + final detail = await productDao.getByCode( + item.serviceUniqueCode, + saleDateStr, + ); if (ObjectUtil.isEmpty(detail)) continue; if (detail == item) continue; item.id = detail?.id; diff --git a/lib/common/widgets/order/mixin/order_mixin.dart b/lib/common/widgets/order/mixin/order_mixin.dart index 711e2d6..00b7869 100644 --- a/lib/common/widgets/order/mixin/order_mixin.dart +++ b/lib/common/widgets/order/mixin/order_mixin.dart @@ -434,7 +434,7 @@ mixin OrderMixin { final json = SubScreenProductEvent( shopList: shopCardList.map((e) => e.toJson()).toList(), sysType: _sysType, - payUser: payUser.value, + payUser: payUser.value?.toJson(), totalPrice: totalPrice.value, amountMealPrice: amountMealPrice.value, ).toJson(); diff --git a/lib/common/widgets/order/order_common.dart b/lib/common/widgets/order/order_common.dart index ab350cd..52d4e9d 100644 --- a/lib/common/widgets/order/order_common.dart +++ b/lib/common/widgets/order/order_common.dart @@ -84,10 +84,10 @@ Widget orderSelectPanel( maxLines: 1, overflow: TextOverflow.ellipsis, style: theme.typography.lg, - ).width(maxWidth * 0.3), - appPrice(context, price), + ).width(maxWidth * 0.28), + appPrice(context, price).expanded(), ].toRow(mainAxisAlignment: MainAxisAlignment.spaceBetween).expanded(), - SizedBox(width: 10.w), + SizedBox(width: 5.w), showPlus ? [ FIcon( diff --git a/lib/common/widgets/user/user_info.dart b/lib/common/widgets/user/user_info.dart index f8ba664..a18ce19 100644 --- a/lib/common/widgets/user/user_info.dart +++ b/lib/common/widgets/user/user_info.dart @@ -33,7 +33,10 @@ Widget appUserInfo( SizedBox(width: 10.w), [ Text("姓名:$username", style: style), - Text("饭卡余额:$balance", style: style), + [ + Text("饭卡余额:", style: style), + appPrice(context, balance), + ].toRow(), ].toColumn(crossAxisAlignment: CrossAxisAlignment.start), ].toRow(mainAxisAlignment: MainAxisAlignment.center).width(double.infinity); } diff --git a/lib/pages/panel/controller.dart b/lib/pages/panel/controller.dart index 836dd86..4c0f06b 100644 --- a/lib/pages/panel/controller.dart +++ b/lib/pages/panel/controller.dart @@ -68,11 +68,11 @@ class PanelController extends GetxController { switch (type) { case PanelType.supermarketOrder: if (!await _checkIsBind()) return; - Get.offAllNamed(RouteNames.supermarketProduct); + Get.toNamed(RouteNames.supermarketProduct); break; case PanelType.canteenOrder: if (!await _checkIsBind()) return; - Get.offAllNamed(RouteNames.canteenProduct); + Get.toNamed(RouteNames.canteenProduct); break; case PanelType.takeFood: if (!await _checkIsBind()) return; diff --git a/lib/pages/setting/widgets/setting_baseInfo.dart b/lib/pages/setting/widgets/setting_baseInfo.dart index 5466998..6eab60c 100644 --- a/lib/pages/setting/widgets/setting_baseInfo.dart +++ b/lib/pages/setting/widgets/setting_baseInfo.dart @@ -17,9 +17,9 @@ Future _bindServiceDialog(BuildContext context, SysSetting sys) async { } if (AppSysTool.isDev()) { // 正式环境-超市 - // uniqueCodeC.text = "1894303392833716226"; + uniqueCodeC.text = "1894303392833716226"; // 正式环境-测试 - uniqueCodeC.text = "1896157295523049473"; + // uniqueCodeC.text = "1896157295523049473"; // 测试环境-测试设备 // uniqueCodeC.text = "1877592554489143298"; } diff --git a/lib/sub_screen/page/sub_product.dart b/lib/sub_screen/page/sub_product.dart index 3b2245c..74adb8f 100644 --- a/lib/sub_screen/page/sub_product.dart +++ b/lib/sub_screen/page/sub_product.dart @@ -53,7 +53,9 @@ class _SubProductPageState extends State { .map((v) => ShopCardEntity.fromJson(v)) .toList(); _sysType = subScreenEvent.sysType; - _payUser = subScreenEvent.payUser; + if (subScreenEvent.payUser != null) { + _payUser = ServiceUser.fromJson(subScreenEvent.payUser!); + } _totalPrice = subScreenEvent.totalPrice; _amountMealPrice = subScreenEvent.amountMealPrice; });