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. 185
      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,
),
///
if (settleOrderInfo != null &&
placeOrder &&
joinA != JoinActivity.BargainBug)
///
PayMethod(
payChannelCheck,
coupons,
@ -1146,7 +1145,7 @@ class _Settlement extends State<Settlement> {
],
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),
child: Row(
children: [

2
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -84,7 +84,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
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(
left: 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(
left: 16.w,
right: 16.w,
top: 8.h,
bottom: 16.h,
),
padding: EdgeInsets.only(

3
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -52,8 +52,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
margin: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 16.h,
bottom: 8.h,
bottom: 16.h,
),
padding: EdgeInsets.only(
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),
),
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(
left: 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/retrofit_api.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/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
@ -73,6 +74,9 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
int singleNum = 0;
String goodsSkuId;
bool isCounts = false;
GlobalKey _key = GlobalKey();
Offset _endOffset;
double rightOffset = 23.0;
@override
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) {
// String minToken = value.getString("minToken");
// String tenant = value.getString("tenant");
@ -330,21 +340,37 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
queryShopCar().then((value) {
this.shopCarGoods = value;
dialogShowing = true;
SmartDialog.show(
widget: ShopCar(
//使showModalBottomSheet加载弹窗才有效
showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
//
// isDismissible: true,
builder: (_) {
return ShopCar(
shopCartKey,
this.shopCarGoods,
clearShopCar,
toDownOrder,
shopCartAdd,
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 {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
//线
// EasyLoading.show( status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (count < 0) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) {
if (element.productId == id) {
@ -376,7 +402,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
}else{
SmartDialog.showToast(baseData.msg);
}
EasyLoading.dismiss();
// EasyLoading.dismiss();
}
///
@ -822,9 +848,10 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
},
child: Image.asset(
"assets/image/shopping_bag.webp",
width: 66,
height: 66,
width: 57.w,
height: 57.w,
fit: BoxFit.fitWidth,
key: _key,
),
),
if (count() != 0)
@ -910,14 +937,17 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
),
Spacer(),
GestureDetector(
Builder(
builder: (context) {
return GestureDetector(
onTap: () async {
if (storeInfo.posType.code == "NORMALSTORE" &&
tableId == 0) {
showDeleteDialog();
} else if (isSetMeal == true) {
await Navigator.of(context)
.pushNamed('/router/product_meals_sku', arguments: {
await Navigator.of(context).pushNamed(
'/router/product_meals_sku',
arguments: {
"id": id,
"storeId": storeId,
"tableId": tableId
@ -927,7 +957,28 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
setState(() {});
});
} 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(
@ -968,7 +1019,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
],
),
),
)
);},)
],
),
)
@ -1053,7 +1104,9 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
),
),
Spacer(),
GestureDetector(
Builder(
builder: (context) {
return GestureDetector(
onTap: () async {
if (storeInfo.posType.code == "NORMALSTORE" &&
tableId == 0) {
@ -1071,6 +1124,26 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
setState(() {});
});
} 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)
? (widget.arguments["minQty"]??0):counts));
}
@ -1113,7 +1186,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> {
],
),
),
)
);},),
],
),
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/store/store_view/people_num.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/store_info.dart';
import 'package:huixiang/store/store_view/store_order_list.dart';
@ -74,6 +75,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
String cName;
String cid;
GlobalKey _key = GlobalKey();
Offset _endOffset;
double rightOffset = 23.0;
@override
void initState() {
super.initState();
@ -81,6 +86,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
tableId = widget.arguments["tableId"] ?? 0;
tenant = widget.arguments["tenant"];
storeId = widget.arguments["id"];
WidgetsBinding.instance.addPostFrameCallback((c) {
//
_endOffset = (_key.currentContext.findRenderObject() as RenderBox)
.localToGlobal(Offset.zero)+
Offset(rightOffset, 0.0);
});
debugPrint(
"store_param tableId:$tableId tenant:$tenant storeId:$storeId");
@ -458,6 +469,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
minToken,
tenant,
tableId,
_endOffset,
_queryMiNiDetail, () {
queryShopCar().then((value) {
this.shopCarGoods = value;
@ -563,21 +575,21 @@ class _StoreOrderPage extends State<StoreOrderPage>
),
),
Stack(
children: [
children: <Widget>[
InkWell(
onTap: () {
if (count() != 0) showShoppingCart();
},
child: Image.asset(
"assets/image/shopping_bag.webp",
width: 66,
height: 66,
width: 57.w,
height: 57.h,
fit: BoxFit.fitWidth,
),
),
if (count() != 0)
Positioned(
right: 5,
right: 0,
// top: 14,
child: RoundButton(
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) {
this.shopCarGoods = value;
dialogShowing = true;
SmartDialog.show(
widget: ShopCar(
//使showModalBottomSheet加载弹窗才有效
showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
//
// isDismissible: true,
builder: (_) {
return ShopCar(
shopCartKey,
this.shopCarGoods,
clearShopCar,
toDownOrder,
shopCartAdd,
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 {
// EasyLoading.show(status: S.current.zhengzaijiazai);
BaseData<bool> baseData = await minService.clearShoppingCart(storeId);
if (baseData.isSuccess) {
shopCarGoods = null;
@ -773,8 +803,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
_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) {
shopCarGoods.shoppingCartSkuItemList.forEach((element) async {
if (element.productId == id) {
@ -785,7 +815,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
return;
}
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
EasyLoading.dismiss();
// EasyLoading.dismiss();
if (baseData != null && baseData.isSuccess) {
miNiDetail = baseData.data;
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_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
@ -38,8 +39,9 @@ class _ShopCar extends State<ShopCar> {
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
debugPrint("ssssasdadsasdadasd");
SmartDialog.dismiss();
// debugPrint("ssssasdadsasdadasd");
// SmartDialog.dismiss();
Navigator.of(context).pop();
return true;
},
child: StatefulBuilder(
@ -79,12 +81,15 @@ class _ShopCar extends State<ShopCar> {
),
),
InkWell(
onTap: () {
onTap: () async{
if (widget.shopingCar.shoppingCartSkuItemList != null) {
EasyLoading.show(status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
widget.shopingCar.shoppingCartSkuItemList.clear();
}
await widget.clearShopCar();
EasyLoading.dismiss();
Navigator.of(context).pop();
state(() {});
widget.clearShopCar();
},
child: Image.asset(
"assets/image/delete.webp",
@ -121,6 +126,9 @@ class _ShopCar extends State<ShopCar> {
(ShoppingCartSkuItemListBean cart) async {
widget.shopingCar =
await widget.shopCartReduce(cart);
if(widget.shopingCar?.shoppingCartSkuItemList == null){
Navigator.of(context).pop();
}
setState(() {});
},
isShopCart: true,
@ -175,7 +183,8 @@ class _ShopCar extends State<ShopCar> {
Spacer(),
GestureDetector(
onTap: () {
SmartDialog.dismiss();
// SmartDialog.dismiss();
Navigator.of(context).pop();
widget.toDownOrder();
},
child: RoundButton(
@ -197,13 +206,14 @@ class _ShopCar extends State<ShopCar> {
children: [
InkWell(
onTap: () {
// Navigator.of(context).pop();
SmartDialog.dismiss();
Navigator.of(context).pop();
// SmartDialog.dismiss();
},
child: Image.asset(
"assets/image/shopping_bag.webp",
width: 66,
height: 66,
width: 57.w,
height: 57.h,
fit: BoxFit.fitWidth,
),
),
Positioned(

185
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/retrofit/data/findMiNiGroupList.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/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -30,6 +31,7 @@ class ShopGoods extends StatefulWidget {
final ShoppingCartSkuItemListBean shoppingCartSkuItemListBean;
final int count;
final int tableId;
final Offset endOffset;
final bool isShopCart;
final StoreInfo storeInfo;
@ -40,6 +42,7 @@ class ShopGoods extends StatefulWidget {
this.count = 0,
this.isShopCart = false,
this.tableId,
this.endOffset,
this.queryShoppingCart,
this.queryMiNiDetail,
this.shoppingCartSkuItemListBean,
@ -114,8 +117,8 @@ class _ShopGoods extends State<ShopGoods> {
: (widget.shoppingCartSkuItemListBean != null
? widget.shoppingCartSkuItemListBean.skuImg
: ""),
width: 70.h,
height: 70.h,
width: 102.h,
height: 102.h,
radius: BorderRadius.circular(4),
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
@ -127,9 +130,9 @@ class _ShopGoods extends State<ShopGoods> {
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
children:[
Padding(
padding: EdgeInsets.only(right: 16.w),
padding: EdgeInsets.only(right: 16.w,bottom:7.h),
child: Row(
children: [
Expanded(
@ -140,9 +143,9 @@ class _ShopGoods extends State<ShopGoods> {
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Colors.black,
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF282828),
fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold,
),
),
),
@ -163,15 +166,9 @@ class _ShopGoods extends State<ShopGoods> {
],
),
),
SizedBox(
height: 2.h,
),
Padding(
padding: EdgeInsets.only(right: 16.w),
child: Row(
children: [
Expanded(
child: Text(
padding: EdgeInsets.only(right: 16.w,bottom:7.h),
child:Text(
(widget.productListBean != null
? widget.productListBean.shortName
: widget.shoppingCartSkuItemListBean.skuName ??
@ -183,22 +180,37 @@ class _ShopGoods extends State<ShopGoods> {
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(
width: 10.w,
alignment: Alignment.center,
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,
children: [
),
Spacer(),
],
):SizedBox(height:23.h),
Row(
children: [
Text(
Expanded(child:Text(
"¥${AppUtils.calculateDouble(double.tryParse(widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price) ?? 0)}",
style: TextStyle(
color: Color(0xFFFF4500),
@ -206,10 +218,10 @@ class _ShopGoods extends State<ShopGoods> {
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.medium,
),
),
SizedBox(
width:5.w,
),
)),
// SizedBox(
// width:5.w,
// ),
// Container(
// width: 44.w,
// 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)
GestureDetector(
Builder(
builder: (context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if (widget.storeInfo.posType.code == "NORMALSTORE" &&
widget.tableId == 0) {
showDeleteDialog();
} 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)
queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0)
@ -276,7 +283,7 @@ class _ShopGoods extends State<ShopGoods> {
},
child:Container(
padding: EdgeInsets.only(
left:50.w,
// left:48.w,
top: 4.h,
bottom: 4.h,
),
@ -285,13 +292,14 @@ class _ShopGoods extends State<ShopGoods> {
text:"${widget?.productListBean?.minQty ?? 0}份起购",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
radius: 11,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
vertical:2.h, horizontal:6.w),
),
)),
));},),
///
if (!widget.isShopCart &&
(widget.productListBean?.attrStyle ?? 0) == 1 &&
!(widget?.productListBean?.subscribeParam
@ -306,7 +314,7 @@ class _ShopGoods extends State<ShopGoods> {
widget.tableId == 0) {
showDeleteDialog();
} else {
widget.queryMiNiDetail(
await widget.queryMiNiDetail(
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
@ -318,7 +326,6 @@ class _ShopGoods extends State<ShopGoods> {
children: [
Container(
padding: EdgeInsets.only(
left: 35.w,
top: 4.h,
bottom: 4.h,
),
@ -327,11 +334,11 @@ class _ShopGoods extends State<ShopGoods> {
text: S.of(context).xuanguige,
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
radius: 11,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
vertical:3.h, horizontal:6.w),
),
),
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 ||
(widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
!(widget?.productListBean?.isSetMeal ?? false) && widget.count != 0)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
@ -380,18 +381,19 @@ class _ShopGoods extends State<ShopGoods> {
padding: EdgeInsets.only(left: 15.w, right: 6.w),
child: Image.asset(
"assets/image/reduce.webp",
width: 22,
width: 22.h,
height: 22.h,
),
),
),
///
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 && (((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
!(widget?.productListBean?.subscribeParam
?.isEnableSubscribe ??
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
!(widget?.productListBean?.isSetMeal ?? false) && widget.count != 0)
Container(
alignment: Alignment.center,
child: Text(
@ -403,6 +405,7 @@ class _ShopGoods extends State<ShopGoods> {
),
),
),
///+
if (widget.isShopCart ||
(widget.productListBean?.attrStyle ?? 0) == 0 &&(((widget.productListBean?.minQty ?? 0).toInt() > 1 && widget.count != 0)
|| (widget.productListBean?.minQty ?? 0).toInt() == 0) &&
@ -410,7 +413,9 @@ class _ShopGoods extends State<ShopGoods> {
?.isEnableSubscribe ??
false) &&
!(widget?.productListBean?.isSetMeal ?? false))
GestureDetector(
Builder(
builder: (context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
if (widget.storeInfo.posType.code == "NORMALSTORE" &&
@ -425,6 +430,22 @@ class _ShopGoods extends State<ShopGoods> {
// SmartDialog.showToast("库存不足",
// alignment: Alignment.center);
// } 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)
queryMiNiDetail(widget.productListBean.id);
else if (_jumpType == 0)
@ -439,16 +460,20 @@ class _ShopGoods extends State<ShopGoods> {
});
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,
width: 22.h,
height: 22.h,
),
),
);
},
),
///
if ((widget.productListBean.subscribeParam
.isEnableSubscribe ??
false) ==
@ -474,7 +499,6 @@ class _ShopGoods extends State<ShopGoods> {
},
child: Container(
padding: EdgeInsets.only(
left: 35.w,
top: 4.h,
bottom: 4.h,
),
@ -483,13 +507,14 @@ class _ShopGoods extends State<ShopGoods> {
text: S.of(context).lijiyuyue,
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
radius: 11,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
vertical:3.h, horizontal:6.w),
),
)),
///
if ((widget.productListBean.isSetMeal ?? false) == true)
GestureDetector(
behavior: HitTestBehavior.opaque,
@ -524,7 +549,6 @@ class _ShopGoods extends State<ShopGoods> {
children: [
Container(
padding: EdgeInsets.only(
left: 35.w,
top: 4.h,
bottom: 4.h,
),
@ -533,11 +557,11 @@ class _ShopGoods extends State<ShopGoods> {
text: "选套餐",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 3,
radius: 11,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 3.w),
vertical:3.h, horizontal:6.w),
),
),
Positioned(
@ -563,7 +587,6 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox(
height: 4.h,
),
///VIP价格
// if (widget.productListBean.vipPrice != null)
// Row(

3
lib/store/store_view/store_order_list.dart

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

242
lib/union/union_list.dart

@ -226,8 +226,8 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
Widget buildStoreItem(Store store, position) {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 12.h),
padding: EdgeInsets.symmetric(horizontal:12.w,vertical: 12.h),
margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 12.h),
padding: EdgeInsets.symmetric(vertical: 12.h,horizontal: 12.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(6)),
@ -240,7 +240,10 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
)
]),
width: double.infinity,
child: Row(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
@ -276,7 +279,7 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
],
),
SizedBox(
width: 12.w,
width: 11.w,
),
Expanded(
child: Column(
@ -292,8 +295,8 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
fontWeight: MyFontWeight.bold,
),
),
SizedBox(height: 6.h),
Row(
Padding(padding:EdgeInsets.only(left:2.w,top:8.h,bottom:10.h),
child: Row(
children: [
if(store.perCapitaConsumption != null && (store?.perCapitaConsumption ?? "0") != "0")
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(
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)
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();
}
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) {
return Container(
width: 74.h,
margin: EdgeInsets.only(right: 8.w),
child: Column(
return Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
productShow?.imgs[0] ?? "",
width: 74.h,
height: 74.h,
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),
padding: EdgeInsets.only(top: 8.h,bottom:6.h),
child: Text(
productShow?.productName ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFFA29E9E),
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,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12),
margin: EdgeInsets.only(top: 12.h,bottom: 12.h,left:32.w),
child: Text(
S.of(context).shiyongxiangqing,
style: TextStyle(

2
lib/view_widget/my_appbar.dart

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

2
lib/view_widget/recharge_details_dialog.dart

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

2
lib/view_widget/selector_store_dialog.dart

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

Loading…
Cancel
Save