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. 335
      lib/store/shop_details_page.dart
  13. 72
      lib/store/store_order.dart
  14. 83
      lib/store/store_view/red_dot_page.dart
  15. 30
      lib/store/store_view/shop_car.dart
  16. 331
      lib/store/store_view/shop_goods.dart
  17. 3
      lib/store/store_view/store_order_list.dart
  18. 450
      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,

335
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,20 +340,36 @@ 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(
shopCartKey, backgroundColor: Colors.transparent,
this.shopCarGoods, context: context,
clearShopCar, //
toDownOrder, // isDismissible: true,
shopCartAdd, builder: (_) {
shopCartReduce, return ShopCar(
), shopCartKey,
onDismiss: () { this.shopCarGoods,
dialogShowing = false; clearShopCar,
}, toDownOrder,
alignmentTemp: Alignment.bottomCenter, shopCartAdd,
); shopCartReduce,
);
});
// 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,65 +937,89 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
), ),
), ),
Spacer(), Spacer(),
GestureDetector( Builder(
onTap: () async { builder: (context) {
if (storeInfo.posType.code == "NORMALSTORE" && return GestureDetector(
tableId == 0) { onTap: () async {
showDeleteDialog(); if (storeInfo.posType.code == "NORMALSTORE" &&
} else if (isSetMeal == true) { tableId == 0) {
await Navigator.of(context) showDeleteDialog();
.pushNamed('/router/product_meals_sku', arguments: { } else if (isSetMeal == true) {
"id": id, await Navigator.of(context).pushNamed(
"storeId": storeId, '/router/product_meals_sku',
"tableId": tableId arguments: {
}); "id": id,
queryShopCar().then((value) { "storeId": storeId,
this.shopCarGoods = value; "tableId": tableId
setState(() {}); });
}); queryShopCar().then((value) {
} else { this.shopCarGoods = value;
_queryMiNiDetail(id, counts); setState(() {});
} });
}, } else {
child: Container( if (miNiDetail.attrList != null &&
width: 92.w, miNiDetail.attrList.length == 1 &&
height: 32.h, miNiDetail.attrList[0].attrValueList.length == 1){
decoration: BoxDecoration( /// widget overlayEntry
borderRadius: BorderRadius.circular(4), var _overlayEntry = OverlayEntry(builder: (_) {
color: Color(0xFF32A060), RenderBox box = context.findRenderObject();
), var offset = box.localToGlobal(Offset.zero);
margin: EdgeInsets.only(bottom: 8), return RedDotPage(
child: Row( startPosition: offset,
mainAxisAlignment: MainAxisAlignment.center, endPosition: _endOffset,
crossAxisAlignment: CrossAxisAlignment.center, );
children: [ });
Image.asset( // Overlay
"assets/image/goods_shopp.webp", Overlay.of(context).insert(_overlayEntry);
fit: BoxFit.fill, //
width: 18, Future.delayed(Duration(milliseconds: 800), () {
height: 18, _overlayEntry.remove();
), _overlayEntry = null;
SizedBox( });
width: 2, }
_queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0)
? (widget.arguments["minQty"]??0):counts));
}
},
child: Container(
width: 92.w,
height: 32.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Color(0xFF32A060),
), ),
Text( margin: EdgeInsets.only(bottom: 8),
((miNiDetail?.subscribeParam?.isEnableSubscribe ?? child: Row(
false) == mainAxisAlignment: MainAxisAlignment.center,
true) crossAxisAlignment: CrossAxisAlignment.center,
? S.of(context).lijiyuyue children: [
: (isSetMeal ?? false) == true Image.asset(
? "选套餐" "assets/image/goods_shopp.webp",
: "加入购物车", fit: BoxFit.fill,
style: TextStyle( width: 18,
fontSize: 12.sp, height: 18,
fontWeight: MyFontWeight.regular, ),
color: Color(0xFFFFFFFF), SizedBox(
), width: 2,
),
Text(
((miNiDetail?.subscribeParam?.isEnableSubscribe ??
false) ==
true)
? S.of(context).lijiyuyue
: (isSetMeal ?? false) == true
? "选套餐"
: "加入购物车",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
),
),
],
), ),
], ),
), );},)
),
)
], ],
), ),
) )
@ -1053,67 +1104,89 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
), ),
), ),
Spacer(), Spacer(),
GestureDetector( Builder(
onTap: () async { builder: (context) {
if (storeInfo.posType.code == "NORMALSTORE" && return GestureDetector(
tableId == 0) { onTap: () async {
showDeleteDialog(); if (storeInfo.posType.code == "NORMALSTORE" &&
} else if (isSetMeal == true) { tableId == 0) {
await Navigator.of(context).pushNamed( showDeleteDialog();
'/router/product_meals_sku', } else if (isSetMeal == true) {
arguments: { await Navigator.of(context).pushNamed(
"id": id, '/router/product_meals_sku',
"storeId": storeId, arguments: {
"tableId": tableId "id": id,
"storeId": storeId,
"tableId": tableId
});
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
}); });
queryShopCar().then((value) { } else {
this.shopCarGoods = value; if (miNiDetail.attrList != null &&
setState(() {}); miNiDetail.attrList.length == 1 &&
}); miNiDetail.attrList[0].attrValueList.length == 1){
} else { /// widget overlayEntry
_queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0) var _overlayEntry = OverlayEntry(builder: (_) {
? (widget.arguments["minQty"]??0):counts)); RenderBox box = context.findRenderObject();
} var offset = box.localToGlobal(Offset.zero);
}, return RedDotPage(
child: Container( startPosition: offset,
width: 92.w, endPosition: _endOffset,
height: 32.h, );
decoration: BoxDecoration( });
borderRadius: BorderRadius.circular(4), // Overlay
color: Color(0xFF32A060), Overlay.of(context).insert(_overlayEntry);
), //
margin: EdgeInsets.only(bottom: 8), Future.delayed(Duration(milliseconds: 800), () {
child: Row( _overlayEntry.remove();
mainAxisAlignment: MainAxisAlignment.center, _overlayEntry = null;
crossAxisAlignment: CrossAxisAlignment.center, });
children: [ }
Image.asset( _queryMiNiDetail(id,(skuMinQty > 1 ? counts : ((widget.arguments["minQty"]??0) > 1 && singleNum==0)
"assets/image/goods_shopp.webp", ? (widget.arguments["minQty"]??0):counts));
fit: BoxFit.fill, }
width: 18, },
height: 18, child: Container(
), width: 92.w,
SizedBox( height: 32.h,
width: 2, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Color(0xFF32A060),
), ),
Text( margin: EdgeInsets.only(bottom: 8),
((miNiDetail?.subscribeParam?.isEnableSubscribe ?? child: Row(
false) == mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/goods_shopp.webp",
fit: BoxFit.fill,
width: 18,
height: 18,
),
SizedBox(
width: 2,
),
Text(
((miNiDetail?.subscribeParam?.isEnableSubscribe ??
false) ==
true) true)
? S.of(context).lijiyuyue ? S.of(context).lijiyuyue
: (isSetMeal ?? false) == true : (isSetMeal ?? false) == true
? "选套餐" ? "选套餐"
: "加入购物车", : "加入购物车",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
), ),
),
],
), ),
], ),
), );},),
),
)
], ],
), ),
Text( Text(

72
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(
shopCartKey, backgroundColor: Colors.transparent,
this.shopCarGoods, context: context,
clearShopCar, //
toDownOrder, // isDismissible: true,
shopCartAdd, builder: (_) {
shopCartReduce, return ShopCar(
), shopCartKey,
onDismiss: () { this.shopCarGoods,
dialogShowing = false; clearShopCar,
}, toDownOrder,
alignmentTemp: Alignment.bottomCenter, shopCartAdd,
); shopCartReduce,
);
});
// 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();
}
}

30
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",
@ -117,10 +122,13 @@ class _ShopCar extends State<ShopCar> {
widget.shopingCar = widget.shopingCar =
await widget.shopCartAdd(cart); await widget.shopCartAdd(cart);
setState(() {}); setState(() {});
}, },
(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(

331
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",
@ -127,9 +130,9 @@ class _ShopGoods extends State<ShopGoods> {
Expanded( Expanded(
child: Column( child: Column(
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,102 +166,106 @@ 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( child:Text(
children: [ (widget.productListBean != null
Expanded( ? widget.productListBean.shortName
child: Text( : widget.shoppingCartSkuItemListBean.skuName ??
(widget.productListBean != null ""),
? widget.productListBean.shortName overflow: TextOverflow.ellipsis,
: widget.shoppingCartSkuItemListBean.skuName ?? maxLines: 2,
""), style: TextStyle(
overflow: TextOverflow.ellipsis, color: Color(0xFF4C4C4C),
maxLines: 2, fontSize: 10.sp,
style: TextStyle( fontWeight: MyFontWeight.regular,
color: Color(0xFF4C4C4C), ),
fontSize: 10.sp, ),),
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}份起购",
],
)),
SizedBox(
height: 7.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Text(
"¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}",
style: TextStyle( style: TextStyle(
color: Color(0xFFFF4500), color: Color(0xFFF65720),
fontSize: 16.sp, fontSize: 10.sp,
fontFamily: 'JDZhengHT', fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox( ),
width:5.w, Spacer(),
), ],
// Container( ):SizedBox(height:23.h),
// width: 44.w, Row(
// height: 18.h, children: [
// decoration: BoxDecoration( Expanded(child:Text(
// color: Color(0xFFFF4500), "¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}",
// borderRadius: BorderRadius.circular(2), style: TextStyle(
// ), color: Color(0xFFFF4500),
// alignment: Alignment.center, fontSize: 16.sp,
// child: Text( fontFamily: 'JDZhengHT',
// "APP专享", fontWeight: MyFontWeight.medium,
// style: TextStyle( ),
// color: Color(0xFFFFFFFF), )),
// fontSize: 10.sp, // SizedBox(
// fontWeight: MyFontWeight.medium, // width:5.w,
// ), // ),
// ), // Container(
// ), // width: 44.w,
if((widget.productListBean?.minQty ?? 0).toInt() > 1) // height: 18.h,
Container( // decoration: BoxDecoration(
padding: EdgeInsets.symmetric(horizontal:4.w), // color: Color(0xFFFF4500),
decoration: BoxDecoration( // borderRadius: BorderRadius.circular(2),
borderRadius: // ),
BorderRadius.circular(2), // alignment: Alignment.center,
border: Border.all( // child: Text(
width: 1, // "APP专享",
color: Color(0xFFF65720), // style: TextStyle(
style: BorderStyle.solid, // color: Color(0xFFFFFFFF),
), // fontSize: 10.sp,
), // fontWeight: MyFontWeight.medium,
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
@ -302,15 +310,15 @@ class _ShopGoods extends State<ShopGoods> {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () async { onTap: () async {
if (widget.storeInfo.posType.code == if (widget.storeInfo.posType.code ==
"NORMALSTORE" && "NORMALSTORE" &&
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
.productId, .productId,
0); 0);
} }
}, },
@ -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,45 +413,67 @@ class _ShopGoods extends State<ShopGoods> {
?.isEnableSubscribe ?? ?.isEnableSubscribe ??
false) && false) &&
!(widget?.productListBean?.isSetMeal ?? false)) !(widget?.productListBean?.isSetMeal ?? false))
GestureDetector( Builder(
behavior: HitTestBehavior.opaque, builder: (context) {
onTap: () async { return GestureDetector(
if (widget.storeInfo.posType.code == "NORMALSTORE" && behavior: HitTestBehavior.opaque,
widget.tableId == 0) { onTap: () async {
showDeleteDialog(); if (widget.storeInfo.posType.code == "NORMALSTORE" &&
} else { widget.tableId == 0) {
// if ((widget?.productListBean?.oversold ?? 0) == 0 && showDeleteDialog();
// widget.count >= } else {
// (widget?.shoppingCartSkuItemListBean // if ((widget?.productListBean?.oversold ?? 0) == 0 &&
// ?.skuStock ?? // widget.count >=
// 0)) { // (widget?.shoppingCartSkuItemListBean
// SmartDialog.showToast("库存不足", // ?.skuStock ??
// alignment: Alignment.center); // 0)) {
// } else // SmartDialog.showToast("库存不足",
if (_jumpType == -1) // alignment: Alignment.center);
queryMiNiDetail(widget.productListBean.id); // } else
else if (_jumpType == 0) /// widget overlayEntry
widget.add(widget.shoppingCartSkuItemListBean); var _overlayEntry = OverlayEntry(builder: (_) {
else if (_jumpType == 1) RenderBox box = context.findRenderObject();
await Navigator.of(context).pushNamed( var offset = box.localToGlobal(Offset.zero);
'/router/product_meals_sku', return RedDotPage(
arguments: { startPosition: offset,
"id": widget.productListBean.id, endPosition: widget.endOffset,
"storeId": widget.productListBean.storeId, );
"tableId": widget.tableId });
}); // Overlay
widget.queryShoppingCart(); Overlay.of(context).insert(_overlayEntry);
} //
Future.delayed(Duration(milliseconds: 800), () {
_overlayEntry.remove();
_overlayEntry = null;
});
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();
}
// Navigator.of(context).pushNamed('/router/goods_list_page');
},
child: Container(
padding: EdgeInsets.only(left: 6.w, right: 5.5.w),
child: Image.asset(
"assets/image/add.webp",
width: 22.h,
height: 22.h,
),
),
);
}, },
child: Container(
padding: EdgeInsets.only(left: 6.w, right: 5.5.w),
child: Image.asset(
"assets/image/add.webp",
width: 22,
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,

450
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,136 +240,149 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
) )
]), ]),
width: double.infinity, width: double.infinity,
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( Row(
children: [
MImage(
store.facade,
width: 74.h,
height: 74.h,
fit: BoxFit.cover,
radius: BorderRadius.circular(6),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
Container(
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
bottomRight: Radius.circular(6),
topRight: Radius.circular(2),
bottomLeft: Radius.circular(2)),
),
padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 2.h),
child: Text(
"品牌",
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
)
],
),
SizedBox(
width: 12.w,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Stack(
store?.storeName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.bold,
),
),
SizedBox(height: 6.h),
Row(
children: [ children: [
if(store.perCapitaConsumption != null && (store?.perCapitaConsumption ?? "0") != "0") MImage(
Padding(padding: EdgeInsets.only(right: 22.w),child:Text( store.facade,
S.of(context).ren( width: 74.h,
store?.perCapitaConsumption ?? "", height: 74.h,
), fit: BoxFit.cover,
style: TextStyle( radius: BorderRadius.circular(6),
color: Color(0xFF4D4D4D), errorSrc: "assets/image/default_1.webp",
fontSize: 12.sp, fadeSrc: "assets/image/default_1.webp",
fontWeight: MyFontWeight.regular,
),
),),
if (store.distance != null)
Image.asset(
"assets/image/icon_union_location_black.webp",
fit: BoxFit.fill,
height: 12,
width: 12,
), ),
SizedBox(width: 4.w), Container(
if (store.distance != null) decoration: BoxDecoration(
Text( color: Color(0xFF32A060),
(store.distance ?? 0) > 1000 borderRadius: BorderRadius.only(
? S.of(context).gongli( topLeft: Radius.circular(6),
((store.distance ?? 0) / 1000 * 100).toInt() / bottomRight: Radius.circular(6),
100.0) topRight: Radius.circular(2),
: S bottomLeft: Radius.circular(2)),
.of(context)
.mi(((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
), ),
), padding: EdgeInsets.symmetric(horizontal: 3.w, vertical: 2.h),
child: Text(
"品牌",
style: TextStyle(
color: Colors.white,
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
),
)
], ],
), ),
SizedBox(height: 10.h), SizedBox(
Row( width: 11.w,
children: []..addAll(
itemServer(store != null ? store.businessService : "")),
), ),
if (storeList[position].productShow != null) Expanded(
SizedBox(height: store.businessService == "" ? 40.h : 23.h), child: Column(
if (storeList[position].productShow != null) mainAxisAlignment: MainAxisAlignment.start,
Container( crossAxisAlignment: CrossAxisAlignment.start,
height: 100.h, children: [
child: ListView.builder( Text(
padding: EdgeInsets.zero, store?.storeName ?? "",
itemCount: overflow: TextOverflow.ellipsis,
(storeList[position].productShow?.length ?? 0) > 3 style: TextStyle(
? 3 color: Color(0xFF0D0D0D),
: storeList[position].productShow?.length ?? 0, fontSize: 14.sp,
scrollDirection: Axis.horizontal, fontWeight: MyFontWeight.bold,
shrinkWrap: true, ),
physics:BouncingScrollPhysics(), ),
itemBuilder: (context, index) { Padding(padding:EdgeInsets.only(left:2.w,top:8.h,bottom:10.h),
return GestureDetector( child: Row(
onTap: () {Navigator.of(context).pushNamed( children: [
'/router/store_order', if(store.perCapitaConsumption != null && (store?.perCapitaConsumption ?? "0") != "0")
arguments: { Padding(padding: EdgeInsets.only(right: 22.w),child:Text(
"id": storeList[position].id, S.of(context).ren(
"tenant": storeList[position].tenantCode, store?.perCapitaConsumption ?? "",
"storeName": storeList[position].storeName, ),
"distance": storeList[position].distance style: TextStyle(
}, color: Color(0xFF4D4D4D),
);}, fontSize: 12.sp,
child: unionGoodsItem( fontWeight: MyFontWeight.regular,
storeList[position].productShow[index]), ),
); ),),
}, if (store.distance != null)
), Image.asset(
), "assets/image/icon_union_location_black.webp",
fit: BoxFit.fill,
height: 12,
width: 12,
),
SizedBox(width: 4.w),
if (store.distance != null)
Text(
(store.distance ?? 0) > 1000
? S.of(context).gongli(
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S
.of(context)
.mi(((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
),
),
],
),),
Row(
children: []..addAll(
itemServer(store != null ? store.businessService : "")),
),
if (storeList[position].productShow != null)
SizedBox(height: store.businessService == "" ? 40.h : 23.h),
],
))
], ],
)) ),
], 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]),
// );
// },
// ),
// ),
],),
); );
} }
@ -394,38 +407,177 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
)) ))
.toList(); .toList();
} }
Widget unionGoodsItem(ProductShow productShow) { Widget unionItem(int position,int unionIndex) {
return Container( return Column(
width: 74.h, crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only(right: 8.w), children: [
child: Column( MImage(
mainAxisAlignment: MainAxisAlignment.spaceAround, storeList[position].productShow[unionIndex]?.imgs[0] ?? "",
crossAxisAlignment: CrossAxisAlignment.start, width:double.infinity,
children: [ height:97.w,
MImage( fit: BoxFit.cover,
productShow?.imgs[0] ?? "", radius: BorderRadius.circular(4),
width: 74.h, errorSrc: "assets/image/default_1.webp",
height: 74.h, fadeSrc: "assets/image/default_1.webp",
fit: BoxFit.cover, ),
radius: BorderRadius.circular(4), Padding(
errorSrc: "assets/image/default_1.webp", padding: EdgeInsets.only(top: 8.h,bottom:6.h),
fadeSrc: "assets/image/default_1.webp", child: Text(
storeList[position].productShow[unionIndex]?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
), ),
Padding( ),
padding: EdgeInsets.only(top: 8.h), Row(
child: Text( crossAxisAlignment: CrossAxisAlignment.center,
productShow?.productName ?? "", children: [
overflow: TextOverflow.ellipsis, Padding(padding:EdgeInsets.only(right:2.w),
style: TextStyle( child: Text.rich(
color: Color(0xFFA29E9E), TextSpan(
fontSize: 12.sp, children: [
fontWeight: MyFontWeight.regular, 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) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
productShow?.imgs[0] ?? "",
width: 97.h,
height: 97.h,
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(
productShow?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 12.sp,
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