|
|
|
@ -6,6 +6,7 @@ import 'package:huixiang/data/find_mini_group.dart';
|
|
|
|
|
import 'package:huixiang/data/mini_detail.dart'; |
|
|
|
|
import 'package:huixiang/data/shopping_cart.dart'; |
|
|
|
|
import 'package:huixiang/generated/l10n.dart'; |
|
|
|
|
import 'package:huixiang/utils/flutter_utils.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:huixiang/utils/shared_preference.dart'; |
|
|
|
|
import 'package:huixiang/utils/str_utils.dart'; |
|
|
|
@ -55,6 +56,34 @@ class _ShopGoods extends State<ShopGoods> {
|
|
|
|
|
int _jumpType = -1; |
|
|
|
|
MiniDetail? miNiDetail; |
|
|
|
|
|
|
|
|
|
late ProductListBean? productListBean; |
|
|
|
|
late SkuItemList? shoppingCartSkuItemListBean; |
|
|
|
|
late int count; |
|
|
|
|
late int tableId; |
|
|
|
|
late bool isShopCart; |
|
|
|
|
late StoreInfo? storeInfo; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
productListBean = widget.productListBean; |
|
|
|
|
shoppingCartSkuItemListBean = widget.shoppingCartSkuItemListBean; |
|
|
|
|
count = widget.count; |
|
|
|
|
tableId = widget.tableId; |
|
|
|
|
isShopCart = widget.isShopCart; |
|
|
|
|
storeInfo = widget.storeInfo; |
|
|
|
|
super.initState(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
didUpdateWidget(oldWidget) { |
|
|
|
|
productListBean = widget.productListBean; |
|
|
|
|
shoppingCartSkuItemListBean = widget.shoppingCartSkuItemListBean; |
|
|
|
|
count = widget.count; |
|
|
|
|
tableId = widget.tableId; |
|
|
|
|
isShopCart = widget.isShopCart; |
|
|
|
|
storeInfo = widget.storeInfo; |
|
|
|
|
super.didUpdateWidget(oldWidget); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///商品详情 |
|
|
|
|
queryMiNiDetail(id) async { |
|
|
|
|
MinApiService? minService; |
|
|
|
@ -75,35 +104,30 @@ class _ShopGoods extends State<ShopGoods> {
|
|
|
|
|
miNiDetail = baseData.data; |
|
|
|
|
if (baseData.data?.productSkuVOList?[0].productSetMeals?.isEmpty ?? true) { |
|
|
|
|
_jumpType = 0; |
|
|
|
|
if (widget.shoppingCartSkuItemListBean != null) { |
|
|
|
|
widget.add.call(widget.shoppingCartSkuItemListBean!); |
|
|
|
|
} |
|
|
|
|
widget.add.call(widget.shoppingCartSkuItemListBean); |
|
|
|
|
} else { |
|
|
|
|
_jumpType = 1; |
|
|
|
|
await Navigator.of(context) |
|
|
|
|
.pushNamed('/router/product_meals_sku', arguments: { |
|
|
|
|
"id": widget.productListBean?.id, |
|
|
|
|
"storeId": widget.productListBean?.storeId, |
|
|
|
|
"tableId": widget.tableId |
|
|
|
|
}); |
|
|
|
|
await Navigator.of(context).pushNamed( |
|
|
|
|
'/router/product_meals_sku', |
|
|
|
|
arguments: { |
|
|
|
|
"id": widget.productListBean?.id, |
|
|
|
|
"storeId": widget.productListBean?.storeId, |
|
|
|
|
"tableId": widget.tableId |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
widget.queryShoppingCart(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// refreshController.refreshFailed(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
String price = doubleStr2Int( |
|
|
|
|
"${widget.isShopCart ? widget.shoppingCartSkuItemListBean?.skuPrice : widget.productListBean?.price}"); |
|
|
|
|
String price = doubleStr2Int("${widget.isShopCart ? widget.shoppingCartSkuItemListBean?.skuPrice : widget.productListBean?.price}"); |
|
|
|
|
return Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
// padding: EdgeInsets.only( |
|
|
|
|
// right: 16.w, |
|
|
|
|
// // bottom: 20.h, |
|
|
|
|
// ), |
|
|
|
|
height: 123.h, |
|
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
|
vertical: 8.h, |
|
|
|
|
), |
|
|
|
|
child: Row( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
@ -125,130 +149,71 @@ class _ShopGoods extends State<ShopGoods> {
|
|
|
|
|
width: 10.w, |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
child: Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 16.w), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
widget.productListBean!.productName ?? |
|
|
|
|
widget.shoppingCartSkuItemListBean!.productName ?? |
|
|
|
|
"", |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
maxLines: 1, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 13.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: IntrinsicHeight( |
|
|
|
|
child: Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 16.w), |
|
|
|
|
child: Text( |
|
|
|
|
widget.productListBean!.productName ?? widget.shoppingCartSkuItemListBean!.productName ?? "", |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
maxLines: 1, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 13.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
// Image.asset( |
|
|
|
|
// "assets/image/green_leaf.webp", |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// width: 12, |
|
|
|
|
// height: 12, |
|
|
|
|
// ), |
|
|
|
|
// Text( |
|
|
|
|
// "X300", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// color: Color(0xFF55BC51), |
|
|
|
|
// fontSize: 10.sp, |
|
|
|
|
// fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 2.h, |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 16.w), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
widget.productListBean!.shortName ?? |
|
|
|
|
widget.shoppingCartSkuItemListBean!.skuName ?? |
|
|
|
|
"", |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
maxLines: 2, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 10.w, |
|
|
|
|
SizedBox( |
|
|
|
|
height: 2.h, |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 25.w), |
|
|
|
|
child: Text( |
|
|
|
|
widget.productListBean!.shortName ?? widget.shoppingCartSkuItemListBean!.skuName ?? "", |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
maxLines: 2, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 7.h, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"¥${price}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFFFF4500), |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
SizedBox( |
|
|
|
|
height: 7.h, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"¥${price}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFFFF4500), |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 2.w, |
|
|
|
|
), |
|
|
|
|
// Container( |
|
|
|
|
// width: 44.w, |
|
|
|
|
// height: 18.h, |
|
|
|
|
// decoration: BoxDecoration( |
|
|
|
|
// color: Color(0xFFFF4500), |
|
|
|
|
// borderRadius: BorderRadius.circular(2), |
|
|
|
|
// ), |
|
|
|
|
// alignment: Alignment.center, |
|
|
|
|
// child: Text( |
|
|
|
|
// "APP专享", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// color: Color(0xFFFFFFFF), |
|
|
|
|
// fontSize: 10.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
if (!widget.isShopCart && |
|
|
|
|
(widget.productListBean?.attrStyle ?? 0) == 1 && |
|
|
|
|
!(widget.productListBean?.subscribeParam |
|
|
|
|
?.isEnableSubscribe ?? |
|
|
|
|
false) && |
|
|
|
|
!(widget.productListBean?.isSetMeal ?? false)) |
|
|
|
|
GestureDetector( |
|
|
|
|
SizedBox( |
|
|
|
|
width: 2.w, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
if (!widget.isShopCart && (widget.productListBean?.attrStyle ?? 0) == 1 && |
|
|
|
|
!(widget.productListBean?.subscribeParam?.isEnableSubscribe ?? false) && |
|
|
|
|
!(widget.productListBean?.isSetMeal ?? false)) |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == |
|
|
|
|
"NORMALSTORE" && |
|
|
|
|
widget.tableId == 0) { |
|
|
|
|
if (widget.storeInfo?.posType?.code == "NORMALSTORE" && widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else { |
|
|
|
|
widget.queryMiNiDetail( |
|
|
|
|
widget.productListBean!.id ?? |
|
|
|
|
widget.shoppingCartSkuItemListBean! |
|
|
|
|
.productId ?? |
|
|
|
|
"", |
|
|
|
|
0); |
|
|
|
|
widget.queryMiNiDetail(widget.productListBean!.id ?? widget.shoppingCartSkuItemListBean!.productId ?? "", 0); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Stack( |
|
|
|
@ -293,160 +258,128 @@ class _ShopGoods extends State<ShopGoods> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
if (widget.isShopCart || |
|
|
|
|
(widget.productListBean?.attrStyle ?? 0) == 0 && |
|
|
|
|
!(widget.productListBean?.subscribeParam |
|
|
|
|
?.isEnableSubscribe ?? |
|
|
|
|
false) && |
|
|
|
|
!(widget.productListBean?.isSetMeal ?? false)) ...[ |
|
|
|
|
Spacer(), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == |
|
|
|
|
"NORMALSTORE" && |
|
|
|
|
widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else { |
|
|
|
|
widget.reduce(widget.shoppingCartSkuItemListBean); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only(left: 15.w, right: 6.w), |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/reduce.webp", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
"${widget.count}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0 && |
|
|
|
|
!(widget.productListBean?.subscribeParam?.isEnableSubscribe ?? false) && |
|
|
|
|
!(widget.productListBean?.isSetMeal ?? false)) ...[ |
|
|
|
|
Spacer(), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == "NORMALSTORE" && widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else { |
|
|
|
|
widget.reduce(widget.shoppingCartSkuItemListBean); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only(left: 15.w, right: 6.w), |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/reduce.webp", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == |
|
|
|
|
"NORMALSTORE" && |
|
|
|
|
widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else { |
|
|
|
|
// if ((widget?.productListBean?.oversold ?? 0) == 0 && |
|
|
|
|
// widget.count >= |
|
|
|
|
// (widget?.shoppingCartSkuItemListBean |
|
|
|
|
// ?.skuStock ?? |
|
|
|
|
// 0)) { |
|
|
|
|
// SmartDialog.showToast("库存不足", |
|
|
|
|
// alignment: Alignment.center); |
|
|
|
|
// } else |
|
|
|
|
if (_jumpType == -1) |
|
|
|
|
queryMiNiDetail(widget.productListBean?.id); |
|
|
|
|
else if (_jumpType == 0) |
|
|
|
|
widget.add(widget.shoppingCartSkuItemListBean); |
|
|
|
|
else if (_jumpType == 1) |
|
|
|
|
await Navigator.of(context).pushNamed( |
|
|
|
|
Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
child: Text( |
|
|
|
|
"${widget.count}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == "NORMALSTORE" && widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else { |
|
|
|
|
if (_jumpType == -1) { |
|
|
|
|
queryMiNiDetail(widget.productListBean?.id); |
|
|
|
|
} else if (_jumpType == 0) { |
|
|
|
|
widget.add(widget.shoppingCartSkuItemListBean); |
|
|
|
|
} else if (_jumpType == 1) { |
|
|
|
|
await Navigator.of(context).pushNamed( |
|
|
|
|
'/router/product_meals_sku', |
|
|
|
|
arguments: { |
|
|
|
|
"id": widget.productListBean?.id, |
|
|
|
|
"storeId": widget.productListBean?.storeId, |
|
|
|
|
"tableId": widget.tableId |
|
|
|
|
}); |
|
|
|
|
widget.queryShoppingCart(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only(left: 6.w, right: 9.w), |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/add.webp", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
if (widget.productListBean?.subscribeParam |
|
|
|
|
?.isEnableSubscribe ?? |
|
|
|
|
false) |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == |
|
|
|
|
"NORMALSTORE" && |
|
|
|
|
widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else if (widget.isShopCart || |
|
|
|
|
(widget.productListBean?.attrStyle ?? 0) == 0) { |
|
|
|
|
queryMiNiDetail(widget.productListBean?.id); |
|
|
|
|
} else { |
|
|
|
|
String? productId = widget.productListBean != null |
|
|
|
|
? widget.productListBean!.id |
|
|
|
|
: widget.shoppingCartSkuItemListBean?.productId; |
|
|
|
|
if (productId != null) { |
|
|
|
|
widget.queryMiNiDetail(productId, 0); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
widget.queryShoppingCart(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
left: 35.w, |
|
|
|
|
top: 4.h, |
|
|
|
|
bottom: 4.h, |
|
|
|
|
), |
|
|
|
|
margin: EdgeInsets.only(right: 8.w, top: 4), |
|
|
|
|
child: RoundButton( |
|
|
|
|
text: S.of(context).lijiyuyue, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
radius: 3, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 11.sp, |
|
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
|
vertical: 5.h, |
|
|
|
|
horizontal: 3.w, |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only(left: 6.w, right: 9.w), |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/add.webp", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if ((widget.productListBean?.isSetMeal ?? false) == true) |
|
|
|
|
GestureDetector( |
|
|
|
|
], |
|
|
|
|
if (widget.productListBean?.subscribeParam?.isEnableSubscribe ?? false) |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == |
|
|
|
|
"NORMALSTORE" && |
|
|
|
|
widget.tableId == 0) { |
|
|
|
|
if (widget.storeInfo?.posType?.code == "NORMALSTORE" && widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0) { |
|
|
|
|
queryMiNiDetail(widget.productListBean?.id); |
|
|
|
|
} else { |
|
|
|
|
String? productId = widget.productListBean != null ? widget.productListBean!.id : widget.shoppingCartSkuItemListBean?.productId; |
|
|
|
|
if (productId != null) { |
|
|
|
|
widget.queryMiNiDetail(productId, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// else if ((widget?.productListBean?.oversold ?? |
|
|
|
|
// 0) == |
|
|
|
|
// 0 && |
|
|
|
|
// widget.count >= |
|
|
|
|
// (widget?.shoppingCartSkuItemListBean |
|
|
|
|
// ?.skuStock ?? |
|
|
|
|
// 0)) { |
|
|
|
|
// SmartDialog.showToast("库存不足", |
|
|
|
|
// alignment: Alignment.center); |
|
|
|
|
// } |
|
|
|
|
else { |
|
|
|
|
await Navigator.of(context).pushNamed( |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
left: 35.w, |
|
|
|
|
top: 4.h, |
|
|
|
|
bottom: 4.h, |
|
|
|
|
), |
|
|
|
|
margin: EdgeInsets.only(right: 8.w, top: 4), |
|
|
|
|
child: RoundButton( |
|
|
|
|
text: S.of(context).lijiyuyue, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
radius: 3, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 11.sp, |
|
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
|
vertical: 5.h, |
|
|
|
|
horizontal: 3.w, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if ((widget.productListBean?.isSetMeal ?? false) == true) |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () async { |
|
|
|
|
if (widget.storeInfo?.posType?.code == "NORMALSTORE" && widget.tableId == 0) { |
|
|
|
|
showDeleteDialog(); |
|
|
|
|
} else { |
|
|
|
|
await Navigator.of(context).pushNamed( |
|
|
|
|
'/router/product_meals_sku', |
|
|
|
|
arguments: { |
|
|
|
|
"id": widget.productListBean?.id, |
|
|
|
|
"storeId": widget.productListBean?.storeId, |
|
|
|
|
"tableId": widget.tableId |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
widget.queryShoppingCart(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
widget.queryShoppingCart(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
@ -464,7 +397,8 @@ class _ShopGoods extends State<ShopGoods> {
|
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 11.sp, |
|
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
|
vertical: 5.h, horizontal: 3.w), |
|
|
|
|
vertical: 5.h, horizontal: 3.w, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
@ -484,54 +418,56 @@ class _ShopGoods extends State<ShopGoods> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 4.h, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 4.h, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///VIP价格(暂时弃用) |
|
|
|
|
// if (widget.productListBean.vipPrice != null) |
|
|
|
|
// Row( |
|
|
|
|
// children: [ |
|
|
|
|
// Container( |
|
|
|
|
// alignment: Alignment.center, |
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 2.w), |
|
|
|
|
// margin: EdgeInsets.only(right: 4.w), |
|
|
|
|
// decoration: new BoxDecoration( |
|
|
|
|
// color: Color(0xff32A060), |
|
|
|
|
// borderRadius: BorderRadius.circular(4)), |
|
|
|
|
// child: Text( |
|
|
|
|
// "VIP", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// color: Color(0xFFFFFFFF), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// Text( |
|
|
|
|
// "¥${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 14.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// fontFamily: 'JDZhengHT', |
|
|
|
|
// color: Color(0xff32A060), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ], |
|
|
|
|
// ), |
|
|
|
|
// Text( |
|
|
|
|
// "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// color: Color(0xFFA29E9E), |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// decoration: TextDecoration.lineThrough, |
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
], |
|
|
|
|
///VIP价格(暂时弃用) |
|
|
|
|
// if (widget.productListBean.vipPrice != null) |
|
|
|
|
// Row( |
|
|
|
|
// children: [ |
|
|
|
|
// Container( |
|
|
|
|
// alignment: Alignment.center, |
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 2.w), |
|
|
|
|
// margin: EdgeInsets.only(right: 4.w), |
|
|
|
|
// decoration: new BoxDecoration( |
|
|
|
|
// color: Color(0xff32A060), |
|
|
|
|
// borderRadius: BorderRadius.circular(4)), |
|
|
|
|
// child: Text( |
|
|
|
|
// "VIP", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// color: Color(0xFFFFFFFF), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// Text( |
|
|
|
|
// "¥${AppUtils.calculateDouble(double.tryParse(widget.productListBean.vipPrice ?? "0") ?? 0)}", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontSize: 14.sp, |
|
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
|
// fontFamily: 'JDZhengHT', |
|
|
|
|
// color: Color(0xff32A060), |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
// ], |
|
|
|
|
// ), |
|
|
|
|
// Text( |
|
|
|
|
// "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.applyPrice) ?? 0)}", |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// color: Color(0xFFA29E9E), |
|
|
|
|
// fontSize: 12.sp, |
|
|
|
|
// decoration: TextDecoration.lineThrough, |
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
// ), |
|
|
|
|
// ), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 6.w), |
|
|
|
|