Browse Source

删减完购物车的 商品后 弹框应该消失;

订单结算页面:板块间间距调整;
门店展示-优化:商品展示-显示商品价格;
优惠券使用详情弹窗/ 余额充值弹窗/ 福利中心门店选择弹窗标题显示处理;
顶部title居中处理;
选规格按钮调整;(更换为圆形按钮)
优化商品展示图片过小问题,商品列表图片尺寸更改102;
加购前 不显示 “—“号,加购数量为1时显示“—“号;
添加购物车时增加红点动画效果 例「美团外卖」;
删减完购物车的 商品后 弹框应该消失;
门店列表商品板块ui优化;
商品详情加购商品时增加红色抛物线动画;
wr_2023_new_business_new
wurong 4 months ago
parent
commit
789a1e51a5
  1. BIN
      assets/image/2x/add.webp
  2. BIN
      assets/image/2x/reduce.webp
  3. BIN
      assets/image/3x/add.webp
  4. BIN
      assets/image/3x/reduce.webp
  5. BIN
      assets/image/add.webp
  6. BIN
      assets/image/reduce.webp
  7. 5
      lib/settlement/settlement.dart
  8. 2
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  9. 1
      lib/settlement/settlement_view/pay_method.dart
  10. 3
      lib/settlement/settlement_view/settlement_order_commodity.dart
  11. 2
      lib/settlement/settlement_view/vip_discounts_select.dart
  12. 111
      lib/store/shop_details_page.dart
  13. 58
      lib/store/store_order.dart
  14. 83
      lib/store/store_view/red_dot_page.dart
  15. 28
      lib/store/store_view/shop_car.dart
  16. 181
      lib/store/store_view/shop_goods.dart
  17. 3
      lib/store/store_view/store_order_list.dart
  18. 242
      lib/union/union_list.dart
  19. 4
      lib/view_widget/coupon_details_dialog.dart
  20. 2
      lib/view_widget/my_appbar.dart
  21. 2
      lib/view_widget/recharge_details_dialog.dart
  22. 2
      lib/view_widget/selector_store_dialog.dart

BIN
assets/image/2x/add.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 486 B

BIN
assets/image/2x/reduce.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 516 B

BIN
assets/image/3x/add.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 952 B

BIN
assets/image/3x/reduce.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 878 B

BIN
assets/image/add.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

After

Width:  |  Height:  |  Size: 362 B

BIN
assets/image/reduce.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 314 B

5
lib/settlement/settlement.dart

@ -1011,11 +1011,10 @@ class _Settlement extends State<Settlement> {
subscribeStoresName, subscribeStoresName,
), ),
///
if (settleOrderInfo != null && if (settleOrderInfo != null &&
placeOrder && placeOrder &&
joinA != JoinActivity.BargainBug) joinA != JoinActivity.BargainBug)
///
PayMethod( PayMethod(
payChannelCheck, payChannelCheck,
coupons, coupons,
@ -1146,7 +1145,7 @@ class _Settlement extends State<Settlement> {
], ],
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 6.h, bottom: 6.h), margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom: 16.h),
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 10.h), padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 10.h),
child: Row( child: Row(
children: [ children: [

2
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -84,7 +84,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
], ],
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 14.h, bottom: 14.h), margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom: 16.h),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 16.w, left: 16.w,
right: 16.w, right: 16.w,

1
lib/settlement/settlement_view/pay_method.dart

@ -54,7 +54,6 @@ class _PayMethod extends State<PayMethod> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 16.w, left: 16.w,
right: 16.w, right: 16.w,
top: 8.h,
bottom: 16.h, bottom: 16.h,
), ),
padding: EdgeInsets.only( padding: EdgeInsets.only(

3
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -52,8 +52,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 16.w, left: 16.w,
right: 16.w, right: 16.w,
top: 16.h, bottom: 16.h,
bottom: 8.h,
), ),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 20.w, left: 20.w,

2
lib/settlement/settlement_view/vip_discounts_select.dart

@ -41,7 +41,7 @@ class _VipDiscountsSelect extends State<VipDiscountsSelect> {
], ],
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 14.h, bottom: 14.h), margin: EdgeInsets.only(left: 16.w, right: 16.w,bottom: 16.h),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 16.w, left: 16.w,
right: 16.w, right: 16.w,

111
lib/store/shop_details_page.dart

@ -16,6 +16,7 @@ import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/people_num.dart'; import 'package:huixiang/store/store_view/people_num.dart';
import 'package:huixiang/store/store_view/red_dot_page.dart';
import 'package:huixiang/store/store_view/shop_car.dart'; import 'package:huixiang/store/store_view/shop_car.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
@ -73,6 +74,9 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
int singleNum = 0; int singleNum = 0;
String goodsSkuId; String goodsSkuId;
bool isCounts = false; bool isCounts = false;
GlobalKey _key = GlobalKey();
Offset _endOffset;
double rightOffset = 23.0;
@override @override
void initState() { void initState() {
@ -91,6 +95,12 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
}); });
} }
}); });
WidgetsBinding.instance.addPostFrameCallback((c) {
//
_endOffset = (_key.currentContext.findRenderObject() as RenderBox)
.localToGlobal(Offset.zero)+
Offset(rightOffset, 0.0);
});
// SharedPreferences.getInstance().then((value) { // SharedPreferences.getInstance().then((value) {
// String minToken = value.getString("minToken"); // String minToken = value.getString("minToken");
// String tenant = value.getString("tenant"); // String tenant = value.getString("tenant");
@ -330,21 +340,37 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
queryShopCar().then((value) { queryShopCar().then((value) {
this.shopCarGoods = value; this.shopCarGoods = value;
dialogShowing = true; dialogShowing = true;
SmartDialog.show( //使showModalBottomSheet加载弹窗才有效
widget: ShopCar( showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
//
// isDismissible: true,
builder: (_) {
return ShopCar(
shopCartKey, shopCartKey,
this.shopCarGoods, this.shopCarGoods,
clearShopCar, clearShopCar,
toDownOrder, toDownOrder,
shopCartAdd, shopCartAdd,
shopCartReduce, shopCartReduce,
),
onDismiss: () {
dialogShowing = false;
},
alignmentTemp: Alignment.bottomCenter,
); );
}); });
// SmartDialog.show(
// widget: ShopCar(
// shopCartKey,
// this.shopCarGoods,
// clearShopCar,
// toDownOrder,
// shopCartAdd,
// shopCartReduce,
// ),
// onDismiss: () {
// dialogShowing = false;
// },
// alignmentTemp: Alignment.bottomCenter,
// );
});
} }
/// ///
@ -359,8 +385,8 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
/// ///
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show( //线
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); // EasyLoading.show( status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) { shopCarGoods.shoppingCartSkuItemList.forEach((element) {
if (element.productId == id) { if (element.productId == id) {
@ -376,7 +402,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
}else{ }else{
SmartDialog.showToast(baseData.msg); SmartDialog.showToast(baseData.msg);
} }
EasyLoading.dismiss(); // EasyLoading.dismiss();
} }
/// ///
@ -822,9 +848,10 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
}, },
child: Image.asset( child: Image.asset(
"assets/image/shopping_bag.webp", "assets/image/shopping_bag.webp",
width: 66, width: 57.w,
height: 66, height: 57.w,
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
key: _key,
), ),
), ),
if (count() != 0) if (count() != 0)
@ -910,14 +937,17 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
), ),
), ),
Spacer(), Spacer(),
GestureDetector( Builder(
builder: (context) {
return GestureDetector(
onTap: () async { onTap: () async {
if (storeInfo.posType.code == "NORMALSTORE" && if (storeInfo.posType.code == "NORMALSTORE" &&
tableId == 0) { tableId == 0) {
showDeleteDialog(); showDeleteDialog();
} else if (isSetMeal == true) { } else if (isSetMeal == true) {
await Navigator.of(context) await Navigator.of(context).pushNamed(
.pushNamed('/router/product_meals_sku', arguments: { '/router/product_meals_sku',
arguments: {
"id": id, "id": id,
"storeId": storeId, "storeId": storeId,
"tableId": tableId "tableId": tableId
@ -927,7 +957,28 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
setState(() {}); setState(() {});
}); });
} else { } else {
_queryMiNiDetail(id, counts); if (miNiDetail.attrList != null &&
miNiDetail.attrList.length == 1 &&
miNiDetail.attrList[0].attrValueList.length == 1){
/// widget overlayEntry
var _overlayEntry = OverlayEntry(builder: (_) {
RenderBox box = context.findRenderObject();
var offset = box.localToGlobal(Offset.zero);
return RedDotPage(
startPosition: offset,
endPosition: _endOffset,
);
});
// Overlay
Overlay.of(context).insert(_overlayEntry);
//
Future.delayed(Duration(milliseconds: 800), () {
_overlayEntry.remove();
_overlayEntry = null;
});
}
_queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0)
? (widget.arguments["minQty"]??0):counts));
} }
}, },
child: Container( child: Container(
@ -968,7 +1019,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
], ],
), ),
), ),
) );},)
], ],
), ),
) )
@ -1053,7 +1104,9 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
), ),
), ),
Spacer(), Spacer(),
GestureDetector( Builder(
builder: (context) {
return GestureDetector(
onTap: () async { onTap: () async {
if (storeInfo.posType.code == "NORMALSTORE" && if (storeInfo.posType.code == "NORMALSTORE" &&
tableId == 0) { tableId == 0) {
@ -1071,6 +1124,26 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
setState(() {}); setState(() {});
}); });
} else { } else {
if (miNiDetail.attrList != null &&
miNiDetail.attrList.length == 1 &&
miNiDetail.attrList[0].attrValueList.length == 1){
/// widget overlayEntry
var _overlayEntry = OverlayEntry(builder: (_) {
RenderBox box = context.findRenderObject();
var offset = box.localToGlobal(Offset.zero);
return RedDotPage(
startPosition: offset,
endPosition: _endOffset,
);
});
// Overlay
Overlay.of(context).insert(_overlayEntry);
//
Future.delayed(Duration(milliseconds: 800), () {
_overlayEntry.remove();
_overlayEntry = null;
});
}
_queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0) _queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0)
? (widget.arguments["minQty"]??0):counts)); ? (widget.arguments["minQty"]??0):counts));
} }
@ -1113,7 +1186,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
], ],
), ),
), ),
) );},),
], ],
), ),
Text( Text(

58
lib/store/store_order.dart

@ -18,6 +18,7 @@ import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/people_num.dart'; import 'package:huixiang/store/store_view/people_num.dart';
import 'package:huixiang/store/store_view/product_sku.dart'; import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/store/store_view/red_dot_page.dart';
import 'package:huixiang/store/store_view/shop_car.dart'; import 'package:huixiang/store/store_view/shop_car.dart';
import 'package:huixiang/store/store_view/store_info.dart'; import 'package:huixiang/store/store_view/store_info.dart';
import 'package:huixiang/store/store_view/store_order_list.dart'; import 'package:huixiang/store/store_view/store_order_list.dart';
@ -74,6 +75,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
String cName; String cName;
String cid; String cid;
GlobalKey _key = GlobalKey();
Offset _endOffset;
double rightOffset = 23.0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -81,6 +86,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
tableId = widget.arguments["tableId"] ?? 0; tableId = widget.arguments["tableId"] ?? 0;
tenant = widget.arguments["tenant"]; tenant = widget.arguments["tenant"];
storeId = widget.arguments["id"]; storeId = widget.arguments["id"];
WidgetsBinding.instance.addPostFrameCallback((c) {
//
_endOffset = (_key.currentContext.findRenderObject() as RenderBox)
.localToGlobal(Offset.zero)+
Offset(rightOffset, 0.0);
});
debugPrint( debugPrint(
"store_param tableId:$tableId tenant:$tenant storeId:$storeId"); "store_param tableId:$tableId tenant:$tenant storeId:$storeId");
@ -458,6 +469,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
minToken, minToken,
tenant, tenant,
tableId, tableId,
_endOffset,
_queryMiNiDetail, () { _queryMiNiDetail, () {
queryShopCar().then((value) { queryShopCar().then((value) {
this.shopCarGoods = value; this.shopCarGoods = value;
@ -563,21 +575,21 @@ class _StoreOrderPage extends State<StoreOrderPage>
), ),
), ),
Stack( Stack(
children: [ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () {
if (count() != 0) showShoppingCart(); if (count() != 0) showShoppingCart();
}, },
child: Image.asset( child: Image.asset(
"assets/image/shopping_bag.webp", "assets/image/shopping_bag.webp",
width: 66, width: 57.w,
height: 66, height: 57.h,
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
), ),
), ),
if (count() != 0) if (count() != 0)
Positioned( Positioned(
right: 5, right: 0,
// top: 14, // top: 14,
child: RoundButton( child: RoundButton(
width: 17.w, width: 17.w,
@ -591,6 +603,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
), ),
), ),
], ],
key: _key,
), ),
], ],
), ),
@ -745,25 +758,42 @@ class _StoreOrderPage extends State<StoreOrderPage>
queryShopCar().then((value) { queryShopCar().then((value) {
this.shopCarGoods = value; this.shopCarGoods = value;
dialogShowing = true; dialogShowing = true;
SmartDialog.show( //使showModalBottomSheet加载弹窗才有效
widget: ShopCar( showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
//
// isDismissible: true,
builder: (_) {
return ShopCar(
shopCartKey, shopCartKey,
this.shopCarGoods, this.shopCarGoods,
clearShopCar, clearShopCar,
toDownOrder, toDownOrder,
shopCartAdd, shopCartAdd,
shopCartReduce, shopCartReduce,
),
onDismiss: () {
dialogShowing = false;
},
alignmentTemp: Alignment.bottomCenter,
); );
}); });
// SmartDialog.show(
// widget: ShopCar(
// shopCartKey,
// this.shopCarGoods,
// clearShopCar,
// toDownOrder,
// shopCartAdd,
// shopCartReduce,
// ),
// onDismiss: () {
// dialogShowing = false;
// },
// alignmentTemp: Alignment.bottomCenter,
// );
});
} }
/// ///
clearShopCar() async { clearShopCar() async {
// EasyLoading.show(status: S.current.zhengzaijiazai);
BaseData<bool> baseData = await minService.clearShoppingCart(storeId); BaseData<bool> baseData = await minService.clearShoppingCart(storeId);
if (baseData.isSuccess) { if (baseData.isSuccess) {
shopCarGoods = null; shopCarGoods = null;
@ -773,8 +803,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
/// ///
_queryMiNiDetail(String id, int count) async { _queryMiNiDetail(String id, int count) async {
EasyLoading.show( //线
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); // EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (count < 0) { if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async { shopCarGoods.shoppingCartSkuItemList.forEach((element) async {
if (element.productId == id) { if (element.productId == id) {
@ -785,7 +815,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
return; return;
} }
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id); BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
EasyLoading.dismiss(); // EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
miNiDetail = baseData.data; miNiDetail = baseData.data;
showStoreSelector(baseData.data, id, count); showStoreSelector(baseData.data, id, count);

83
lib/store/store_view/red_dot_page.dart

@ -0,0 +1,83 @@
import 'dart:math';
import 'package:flutter/material.dart';
class RedDotPage extends StatefulWidget {
final Offset startPosition;
final Offset endPosition;
const RedDotPage({Key key, this.startPosition, this.endPosition})
: super(key: key);
@override
_RedDotPageState createState() => _RedDotPageState();
}
class _RedDotPageState extends State<RedDotPage>
with SingleTickerProviderStateMixin {
AnimationController _controller; // controller
Animation<double> _animation; //
double left; // left
double top; // right
@override
void initState() {
super.initState();
_controller =
AnimationController(duration: Duration(milliseconds: 800), vsync: this);
_animation = Tween(begin: 0.0, end: 1.0).animate(_controller);
// 线
var x0 = widget.startPosition.dx;
var y0 = widget.startPosition.dy;
var x1 = widget.startPosition.dx - 250;
var y1 = widget.startPosition.dy - 100;
var x2 = widget.endPosition.dx;
var y2 = widget.endPosition.dy;
_animation.addListener(() {
// t
var t = _animation.value;
if (mounted)
setState(() {
left = pow(1 - t, 2) * x0 + 2 * t * (1 - t) * x1 + pow(t, 2) * x2;
top = pow(1 - t, 2) * y0 + 2 * t * (1 - t) * y1 + pow(t, 2) * y2;
});
});
//
left = widget.startPosition.dx;
top = widget.startPosition.dy;
//
_controller.forward();
}
@override
Widget build(BuildContext context) {
// Stack -> Positioned
return Stack(
children: <Widget>[
Positioned(
left: left,
top: top,
child: ClipOval(
child: Container(
width: 14,
height: 14,
color: Colors.red,
),
),
)
],
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}

28
lib/store/store_view/shop_car.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart';
@ -38,8 +39,9 @@ class _ShopCar extends State<ShopCar> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
debugPrint("ssssasdadsasdadasd"); // debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss(); // SmartDialog.dismiss();
Navigator.of(context).pop();
return true; return true;
}, },
child: StatefulBuilder( child: StatefulBuilder(
@ -79,12 +81,15 @@ class _ShopCar extends State<ShopCar> {
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () async{
if (widget.shopingCar.shoppingCartSkuItemList != null) { if (widget.shopingCar.shoppingCartSkuItemList != null) {
EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
widget.shopingCar.shoppingCartSkuItemList.clear(); widget.shopingCar.shoppingCartSkuItemList.clear();
} }
await widget.clearShopCar();
EasyLoading.dismiss();
Navigator.of(context).pop();
state(() {}); state(() {});
widget.clearShopCar();
}, },
child: Image.asset( child: Image.asset(
"assets/image/delete.webp", "assets/image/delete.webp",
@ -121,6 +126,9 @@ class _ShopCar extends State<ShopCar> {
(ShoppingCartSkuItemListBean cart) async { (ShoppingCartSkuItemListBean cart) async {
widget.shopingCar = widget.shopingCar =
await widget.shopCartReduce(cart); await widget.shopCartReduce(cart);
if(widget.shopingCar?.shoppingCartSkuItemList == null){
Navigator.of(context).pop();
}
setState(() {}); setState(() {});
}, },
isShopCart: true, isShopCart: true,
@ -175,7 +183,8 @@ class _ShopCar extends State<ShopCar> {
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
SmartDialog.dismiss(); // SmartDialog.dismiss();
Navigator.of(context).pop();
widget.toDownOrder(); widget.toDownOrder();
}, },
child: RoundButton( child: RoundButton(
@ -197,13 +206,14 @@ class _ShopCar extends State<ShopCar> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
// Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.dismiss(); // SmartDialog.dismiss();
}, },
child: Image.asset( child: Image.asset(
"assets/image/shopping_bag.webp", "assets/image/shopping_bag.webp",
width: 66, width: 57.w,
height: 66, height: 57.h,
fit: BoxFit.fitWidth,
), ),
), ),
Positioned( Positioned(

181
lib/store/store_view/shop_goods.dart

@ -5,6 +5,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/store/store_view/red_dot_page.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -30,6 +31,7 @@ class ShopGoods extends StatefulWidget {
final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean; final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean;
final int count; final int count;
final int tableId; final int tableId;
final Offset endOffset;
final bool isShopCart; final bool isShopCart;
final StoreInfo storeInfo; final StoreInfo storeInfo;
@ -40,6 +42,7 @@ class ShopGoods extends StatefulWidget {
this.count = 0, this.count = 0,
this.isShopCart = false, this.isShopCart = false,
this.tableId, this.tableId,
this.endOffset,
this.queryShoppingCart, this.queryShoppingCart,
this.queryMiNiDetail, this.queryMiNiDetail,
this.shoppingCartSkuItemListBean, this.shoppingCartSkuItemListBean,
@ -114,8 +117,8 @@ class _ShopGoods extends State<ShopGoods> {
: (widget.shoppingCartSkuItemListBean != null : (widget.shoppingCartSkuItemListBean != null
? widget.shoppingCartSkuItemListBean.skuImg ? widget.shoppingCartSkuItemListBean.skuImg
: ""), : ""),
width: 70.h, width: 102.h,
height: 70.h, height: 102.h,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
@ -129,7 +132,7 @@ class _ShopGoods extends State<ShopGoods> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children:[ children:[
Padding( Padding(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right: 16.w,bottom:7.h),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -140,9 +143,9 @@ class _ShopGoods extends State<ShopGoods> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Color(0xFF282828),
fontSize: 13.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight:MyFontWeight.semi_bold,
), ),
), ),
), ),
@ -163,14 +166,8 @@ class _ShopGoods extends State<ShopGoods> {
], ],
), ),
), ),
SizedBox(
height: 2.h,
),
Padding( Padding(
padding: EdgeInsets.only(right: 16.w), padding: EdgeInsets.only(right: 16.w,bottom:7.h),
child: Row(
children: [
Expanded(
child:Text( child:Text(
(widget.productListBean != null (widget.productListBean != null
? widget.productListBean.shortName ? widget.productListBean.shortName
@ -183,22 +180,37 @@ class _ShopGoods extends State<ShopGoods> {
fontSize: 10.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
),),
((widget.productListBean?.minQty ?? 0).toInt() > 1)?
Row(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal:4.w),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFF65720),
style: BorderStyle.solid,
), ),
), ),
SizedBox( alignment: Alignment.center,
width: 10.w, child: Text(
"${widget.productListBean?.minQty ?? 0}份起购",
style: TextStyle(
color: Color(0xFFF65720),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
), ),
],
)),
SizedBox(
height: 7.h,
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, Spacer(),
children: [ ],
):SizedBox(height:23.h),
Row( Row(
children: [ children: [
Text( Expanded(child:Text(
"¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}", "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}",
style: TextStyle( style: TextStyle(
color: Color(0xFFFF4500), color: Color(0xFFFF4500),
@ -206,10 +218,10 @@ class _ShopGoods extends State<ShopGoods> {
fontFamily: 'JDZhengHT', fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), )),
SizedBox( // SizedBox(
width:5.w, // width:5.w,
), // ),
// Container( // Container(
// width: 44.w, // width: 44.w,
// height: 18.h, // height: 18.h,
@ -227,38 +239,33 @@ class _ShopGoods extends State<ShopGoods> {
// ), // ),
// ), // ),
// ), // ),
if((widget.productListBean?.minQty ?? 0).toInt() > 1) ///
Container(
padding: EdgeInsets.symmetric(horizontal:4.w),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
border: Border.all(
width: 1,
color: Color(0xFFF65720),
style: BorderStyle.solid,
),
),
alignment: Alignment.center,
child: Text(
"${widget.productListBean?.minQty ?? 0}份起购",
style: TextStyle(
color: Color(0xFFF65720),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
),
],
),
if((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count == 0 && (widget.productListBean?.attrStyle ?? 0) != 1) if((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count == 0 && (widget.productListBean?.attrStyle ?? 0) != 1)
GestureDetector( Builder(
builder: (context) {
return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
if (widget.storeInfo.posType.code == "NORMALSTORE" && if (widget.storeInfo.posType.code == "NORMALSTORE" &&
widget.tableId == 0) { widget.tableId == 0) {
showDeleteDialog(); showDeleteDialog();
} else { } else {
/// widget overlayEntry
var _overlayEntry = OverlayEntry(builder: (_) {
RenderBox box = context.findRenderObject();
var offset = box.localToGlobal(Offset.zero);
return RedDotPage(
startPosition: offset,
endPosition: widget.endOffset,
);
});
// Overlay
Overlay.of(context).insert(_overlayEntry);
//
Future.delayed(Duration(milliseconds: 800), () {
_overlayEntry.remove();
_overlayEntry = null;
});
if (_jumpType == -1) if (_jumpType == -1)
queryMiNiDetail(widget.productListBean.id); queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0) else if (_jumpType == 0)
@ -276,7 +283,7 @@ class _ShopGoods extends State<ShopGoods> {
}, },
child:Container( child:Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left:50.w, // left:48.w,
top: 4.h, top: 4.h,
bottom: 4.h, bottom: 4.h,
), ),
@ -285,13 +292,14 @@ class _ShopGoods extends State<ShopGoods> {
text:"${widget?.productListBean?.minQty ?? 0}份起购", text:"${widget?.productListBean?.minQty ?? 0}份起购",
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
radius: 3, radius: 11,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 11.sp, fontSize: 11.sp,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w), vertical:2.h, horizontal:6.w),
), ),
)), ));},),
///
if (!widget.isShopCart && if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1 && (widget.productListBean?.attrStyle ?? 0) == 1 &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
@ -306,7 +314,7 @@ class _ShopGoods extends State<ShopGoods> {
widget.tableId == 0) { widget.tableId == 0) {
showDeleteDialog(); showDeleteDialog();
} else { } else {
widget.queryMiNiDetail( await widget.queryMiNiDetail(
widget.productListBean != null widget.productListBean != null
? widget.productListBean.id ? widget.productListBean.id
: widget.shoppingCartSkuItemListBean : widget.shoppingCartSkuItemListBean
@ -318,7 +326,6 @@ class _ShopGoods extends State<ShopGoods> {
children: [ children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 35.w,
top: 4.h, top: 4.h,
bottom: 4.h, bottom: 4.h,
), ),
@ -327,11 +334,11 @@ class _ShopGoods extends State<ShopGoods> {
text: S.of(context).xuanguige, text: S.of(context).xuanguige,
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
radius: 3, radius: 11,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 11.sp, fontSize: 11.sp,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w), vertical:3.h, horizontal:6.w),
), ),
), ),
Positioned( Positioned(
@ -352,20 +359,14 @@ class _ShopGoods extends State<ShopGoods> {
), ),
], ],
)), )),
if (widget.isShopCart || ///-
(widget.productListBean?.attrStyle ?? 0) == 0 &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
Spacer(),
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0) (widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) && || (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false) && false) &&
!(widget?.productListBean?.isSetMeal ?? false)) !(widget?.productListBean?.isSetMeal ?? false) && widget.count != 0)
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
@ -380,18 +381,19 @@ class _ShopGoods extends State<ShopGoods> {
padding: EdgeInsets.only(left: 15.w, right: 6.w), padding: EdgeInsets.only(left: 15.w, right: 6.w),
child: Image.asset( child: Image.asset(
"assets/image/reduce.webp", "assets/image/reduce.webp",
width: 22, width: 22.h,
height: 22.h, height: 22.h,
), ),
), ),
), ),
///
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0) (widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) && || (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
!(widget?.productListBean?.subscribeParam !(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false) && false) &&
!(widget?.productListBean?.isSetMeal ?? false)) !(widget?.productListBean?.isSetMeal ?? false) && widget.count != 0)
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
@ -403,6 +405,7 @@ class _ShopGoods extends State<ShopGoods> {
), ),
), ),
), ),
///+
if (widget.isShopCart || if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 &&(((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0) (widget.productListBean?.attrStyle ?? 0) == 0 &&(((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) && || (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
@ -410,7 +413,9 @@ class _ShopGoods extends State<ShopGoods> {
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false) && false) &&
!(widget?.productListBean?.isSetMeal ?? false)) !(widget?.productListBean?.isSetMeal ?? false))
GestureDetector( Builder(
builder: (context) {
return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
if (widget.storeInfo.posType.code == "NORMALSTORE" && if (widget.storeInfo.posType.code == "NORMALSTORE" &&
@ -425,6 +430,22 @@ class _ShopGoods extends State<ShopGoods> {
// SmartDialog.showToast("库存不足", // SmartDialog.showToast("库存不足",
// alignment: Alignment.center); // alignment: Alignment.center);
// } else // } else
/// widget overlayEntry
var _overlayEntry = OverlayEntry(builder: (_) {
RenderBox box = context.findRenderObject();
var offset = box.localToGlobal(Offset.zero);
return RedDotPage(
startPosition: offset,
endPosition: widget.endOffset,
);
});
// Overlay
Overlay.of(context).insert(_overlayEntry);
//
Future.delayed(Duration(milliseconds: 800), () {
_overlayEntry.remove();
_overlayEntry = null;
});
if (_jumpType == -1) if (_jumpType == -1)
queryMiNiDetail(widget.productListBean.id); queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0) else if (_jumpType == 0)
@ -439,16 +460,20 @@ class _ShopGoods extends State<ShopGoods> {
}); });
widget.queryShoppingCart(); widget.queryShoppingCart();
} }
// Navigator.of(context).pushNamed('/router/goods_list_page');
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 6.w, right: 5.5.w), padding: EdgeInsets.only(left: 6.w, right: 5.5.w),
child: Image.asset( child: Image.asset(
"assets/image/add.webp", "assets/image/add.webp",
width: 22, width: 22.h,
height: 22.h, height: 22.h,
), ),
), ),
);
},
), ),
///
if ((widget.productListBean.subscribeParam if ((widget.productListBean.subscribeParam
.isEnableSubscribe ?? .isEnableSubscribe ??
false) == false) ==
@ -474,7 +499,6 @@ class _ShopGoods extends State<ShopGoods> {
}, },
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 35.w,
top: 4.h, top: 4.h,
bottom: 4.h, bottom: 4.h,
), ),
@ -483,13 +507,14 @@ class _ShopGoods extends State<ShopGoods> {
text: S.of(context).lijiyuyue, text: S.of(context).lijiyuyue,
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
radius: 3, radius: 11,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 11.sp, fontSize: 11.sp,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w), vertical:3.h, horizontal:6.w),
), ),
)), )),
///
if ((widget.productListBean.isSetMeal ?? false) == true) if ((widget.productListBean.isSetMeal ?? false) == true)
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@ -524,7 +549,6 @@ class _ShopGoods extends State<ShopGoods> {
children: [ children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 35.w,
top: 4.h, top: 4.h,
bottom: 4.h, bottom: 4.h,
), ),
@ -533,11 +557,11 @@ class _ShopGoods extends State<ShopGoods> {
text: "选套餐", text: "选套餐",
textColor: Colors.white, textColor: Colors.white,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
radius: 3, radius: 11,
backgroup: Color(0xFF32A060), backgroup: Color(0xFF32A060),
fontSize: 11.sp, fontSize: 11.sp,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w), vertical:3.h, horizontal:6.w),
), ),
), ),
Positioned( Positioned(
@ -563,7 +587,6 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox( SizedBox(
height: 4.h, height: 4.h,
), ),
///VIP价格 ///VIP价格
// if (widget.productListBean.vipPrice != null) // if (widget.productListBean.vipPrice != null)
// Row( // Row(

3
lib/store/store_view/store_order_list.dart

@ -27,6 +27,7 @@ class StoreOrderListPage extends StatefulWidget {
final String minToken; final String minToken;
final String tenant; final String tenant;
final int tableId; final int tableId;
final Offset _endOffset;
final Function(String id, int count) queryMiNiDetail; final Function(String id, int count) queryMiNiDetail;
final Function queryShoppingCart; final Function queryShoppingCart;
final ScrollPhysics scrollPhysics; final ScrollPhysics scrollPhysics;
@ -42,6 +43,7 @@ class StoreOrderListPage extends StatefulWidget {
this.minToken, this.minToken,
this.tenant, this.tenant,
this.tableId, this.tableId,
this._endOffset,
this.queryMiNiDetail, this.queryMiNiDetail,
this.queryShoppingCart, this.queryShoppingCart,
this.scrollPhysics); this.scrollPhysics);
@ -377,6 +379,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
count: count, count: count,
isShopCart: false, isShopCart: false,
tableId: widget.tableId, tableId: widget.tableId,
endOffset: widget._endOffset,
queryShoppingCart: widget.queryShoppingCart, queryShoppingCart: widget.queryShoppingCart,
queryMiNiDetail: widget.queryMiNiDetail, queryMiNiDetail: widget.queryMiNiDetail,
shoppingCartSkuItemListBean: shoppingCartSkuItemListBean, shoppingCartSkuItemListBean: shoppingCartSkuItemListBean,

242
lib/union/union_list.dart

@ -226,8 +226,8 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
Widget buildStoreItem(Store store, position) { Widget buildStoreItem(Store store, position) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h), margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 12.h),
padding: EdgeInsets.symmetric(horizontal:12.w,vertical: 12.h), padding: EdgeInsets.symmetric(vertical: 12.h,horizontal: 12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
@ -240,7 +240,10 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
) )
]), ]),
width: double.infinity, width: double.infinity,
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( Stack(
@ -276,7 +279,7 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
], ],
), ),
SizedBox( SizedBox(
width: 12.w, width: 11.w,
), ),
Expanded( Expanded(
child: Column( child: Column(
@ -292,8 +295,8 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
fontWeight: MyFontWeight.bold, fontWeight: MyFontWeight.bold,
), ),
), ),
SizedBox(height: 6.h), Padding(padding:EdgeInsets.only(left:2.w,top:8.h,bottom:10.h),
Row( child: Row(
children: [ children: [
if(store.perCapitaConsumption != null && (store?.perCapitaConsumption ?? "0") != "0") if(store.perCapitaConsumption != null && (store?.perCapitaConsumption ?? "0") != "0")
Padding(padding: EdgeInsets.only(right: 22.w),child:Text( Padding(padding: EdgeInsets.only(right: 22.w),child:Text(
@ -329,47 +332,57 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
), ),
), ),
], ],
), ),),
SizedBox(height: 10.h),
Row( Row(
children: []..addAll( children: []..addAll(
itemServer(store != null ? store.businessService : "")), itemServer(store != null ? store.businessService : "")),
), ),
if (storeList[position].productShow != null) if (storeList[position].productShow != null)
SizedBox(height: store.businessService == "" ? 40.h : 23.h), SizedBox(height: store.businessService == "" ? 40.h : 23.h),
if (storeList[position].productShow != null)
Container(
height: 100.h,
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount:
(storeList[position].productShow?.length ?? 0) > 3
? 3
: storeList[position].productShow?.length ?? 0,
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics:BouncingScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName,
"distance": storeList[position].distance
},
);},
child: unionGoodsItem(
storeList[position].productShow[index]),
);
},
),
),
], ],
)) ))
], ],
), ),
if (storeList[position].productShow != null)
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: unionItem(position,0)),
SizedBox(width:16.w),
Expanded(child: unionItem(position,1)),
SizedBox(width:16.w),
Expanded(child: unionItem(position,2)),
],
)
// Container(
// height: 150.h,
// child: ListView.builder(
// padding: EdgeInsets.zero,
// itemCount:
// (storeList[position].productShow?.length ?? 0) > 3
// ? 3
// : storeList[position].productShow?.length ?? 0,
// scrollDirection: Axis.horizontal,
// shrinkWrap: true,
// physics:BouncingScrollPhysics(),
// itemBuilder: (context, index) {
// return GestureDetector(
// onTap: () {Navigator.of(context).pushNamed(
// '/router/store_order',
// arguments: {
// "id": storeList[position].id,
// "tenant": storeList[position].tenantCode,
// "storeName": storeList[position].storeName,
// "distance": storeList[position].distance
// },
// );},
// child: unionGoodsItem(
// storeList[position].productShow[index]),
// );
// },
// ),
// ),
],),
); );
} }
@ -395,37 +408,176 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
.toList(); .toList();
} }
Widget unionItem(int position,int unionIndex) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
storeList[position].productShow[unionIndex]?.imgs[0] ?? "",
width:double.infinity,
height:97.w,
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Padding(
padding: EdgeInsets.only(top: 8.h,bottom:6.h),
child: Text(
storeList[position].productShow[unionIndex]?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(padding:EdgeInsets.only(right:2.w),
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize:12.sp,
color: Color(0xFFF65720),
),
),
TextSpan(
text:"${(storeList[position].productShow[unionIndex]?.price ?? "").split(".")[0]}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFF65720),
),
),
if(storeList[position].productShow[unionIndex].price.contains("."))
TextSpan(
text:".",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFF65720),
),
),
if(storeList[position].productShow[unionIndex].price.contains("."))
TextSpan(
text:(storeList[position].productShow[unionIndex]?.price ?? "").split(".")[1],
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize:12.sp,
color: Color(0xFFF65720),
),
),
],
),
textDirection: TextDirection.ltr,
),),
Text(
"${storeList[position].productShow[unionIndex]?.applyPrice ?? ""}",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xFFA29E9E),
),
),
])
],
);
}
Widget unionGoodsItem(ProductShow productShow) { Widget unionGoodsItem(ProductShow productShow) {
return Container( return Column(
width: 74.h,
margin: EdgeInsets.only(right: 8.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
MImage( MImage(
productShow?.imgs[0] ?? "", productShow?.imgs[0] ?? "",
width: 74.h, width: 97.h,
height: 74.h, height: 97.h,
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(4), radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.h), padding: EdgeInsets.only(top: 8.h,bottom:6.h),
child: Text( child: Text(
productShow?.productName ?? "", productShow?.productName ?? "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFFA29E9E), color: Color(0xFF0D0D0D),
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
), ),
), ),
Expanded(child:Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(padding:EdgeInsets.only(right:2.w),
child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize:12.sp,
color: Color(0xFFF65720),
),
),
TextSpan(
text:"${(productShow?.price ?? "").split(".")[0]}",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFF65720),
),
),
if(productShow.price.contains("."))
TextSpan(
text:".",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFF65720),
),
),
if(productShow.price.contains("."))
TextSpan(
text:(productShow?.price ?? "").split(".")[1],
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize:12.sp,
color: Color(0xFFF65720),
),
),
], ],
), ),
textDirection: TextDirection.ltr,
),),
Text(
"${productShow?.applyPrice ?? ""}",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFFA29E9E),
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
decoration: TextDecoration.lineThrough,
decorationColor: Color(0xFFA29E9E),
),
),
]))
],
); );
} }

4
lib/view_widget/coupon_details_dialog.dart

@ -41,13 +41,13 @@ class _CouponDetailsWidget extends State<CouponDetailsWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12), margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left:32.w),
child: Text( child: Text(
S.of(context).shiyongxiangqing, S.of(context).shiyongxiangqing,
style: TextStyle( style: TextStyle(

2
lib/view_widget/my_appbar.dart

@ -93,7 +93,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(right:34.w), margin: EdgeInsets.only(right:50.w),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(

2
lib/view_widget/recharge_details_dialog.dart

@ -38,7 +38,7 @@ class _RechargeWidget extends State<RechargeWidget> {
children: [ children: [
Expanded(child: Expanded(child:
Container( Container(
margin: EdgeInsets.symmetric(vertical: 12.h), margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left: 32.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"充值说明", "充值说明",

2
lib/view_widget/selector_store_dialog.dart

@ -56,7 +56,7 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
Expanded( Expanded(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12), margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left: 32.w),
child: Text( child: Text(
S.of(context).qingxuanzeshiyongmendian, S.of(context).qingxuanzeshiyongmendian,
style: TextStyle( style: TextStyle(

Loading…
Cancel
Save