diff --git a/assets/svg/dingdan_waimai.svg b/assets/svg/dingdan_waimai.svg index 1a9fe492..0980e0c3 100644 --- a/assets/svg/dingdan_waimai.svg +++ b/assets/svg/dingdan_waimai.svg @@ -1,8 +1,8 @@ - + 矩形备份 20 - + @@ -10,8 +10,8 @@ - - + + diff --git a/assets/svg/dingdan_wuliu.svg b/assets/svg/dingdan_wuliu.svg index 1f0d46c4..1a0a9f91 100644 --- a/assets/svg/dingdan_wuliu.svg +++ b/assets/svg/dingdan_wuliu.svg @@ -1,8 +1,8 @@ - + 矩形备份 20 - + @@ -10,8 +10,8 @@ - - + + diff --git a/assets/svg/dingdan_ziqu.svg b/assets/svg/dingdan_ziqu.svg index e52fb91e..ca452520 100644 --- a/assets/svg/dingdan_ziqu.svg +++ b/assets/svg/dingdan_ziqu.svg @@ -1,17 +1,17 @@ - + 矩形备份 20 - - + + - - + + diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 8452d723..ed3c23de 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -54,6 +54,8 @@ class _StoreOrderPage extends State StoreOrderListPage storeOrderListPage; List> shopCarGoods = []; + List appletProducts = []; + List shopCar = []; ScrollController controller = ScrollController(); @@ -420,11 +422,14 @@ class _StoreOrderPage extends State SmartDialog.showToast("请选择要购买的商品~"); return ; } + getShopCarGoods(); + Navigator.of(context).pushNamed( '/router/settlement', arguments: { "storeInfo": storeInfo, "shopGoods": shopCarGoods, + "shopProduct": shopCar, }, ); } @@ -466,16 +471,14 @@ class _StoreOrderPage extends State ); } - List appletProducts = []; - _productListResult(List appletProducts) { this.appletProducts = appletProducts; } - ///购物车弹窗 - showShoppingCart() { + ///获取购物车内的商品 + getShopCarGoods() { if (appletProducts == null || appletProducts.length == 0) return; - List shopCar = []; + shopCar = []; if (shopCarGoods != null && shopCarGoods.length > 0) { shopCarGoods.forEach((element) { appletProducts.forEach((element1) { @@ -487,6 +490,12 @@ class _StoreOrderPage extends State }); }); } + } + + ///购物车弹窗 + showShoppingCart() { + + getShopCarGoods(); showModalBottomSheet( context: context, diff --git a/lib/store/store_view/settlement.dart b/lib/store/store_view/settlement.dart index 7b2e5abc..6ceb3ad6 100644 --- a/lib/store/store_view/settlement.dart +++ b/lib/store/store_view/settlement.dart @@ -2,6 +2,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; @@ -78,6 +79,7 @@ class _Settlement extends State { leadingColor: Colors.white, title: S.of(context).dingdanjiesuan, titleColor: Colors.white, + brightness: Brightness.dark, titleSize: 18.sp, ), body: Container( @@ -88,7 +90,60 @@ class _Settlement extends State { children: [ distributionMode(), SizedBox( - height: 14, + height: 16, + ), + + Container( + margin: EdgeInsets.only( + left: 16, + right: 16, + ), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x0D000000), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(8), + ), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.h), + child: Row( + children: [ + Expanded( + child: Text( + S.of(context).yuliudianhua, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4C4C4C), + ), + ), + ), + Text( + storeInfo != null ? storeInfo.headMobile : "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + ), + GestureDetector( + onTap: () { + showAlertDialog(); + }, + child: Image.asset( + "assets/image/pen.png", + height: 14.h, + width: 14.w, + ), + ), + ], + ), ), ///订单商品 @@ -167,103 +222,92 @@ class _Settlement extends State { String center = ""; TextEditingController _vc = TextEditingController(); + List addressBgs = [ + "assets/svg/dingdan_ziqu.svg", + "assets/svg/dingdan_waimai.svg", + "assets/svg/dingdan_wuliu.svg", + ]; + Widget distributionMode() { return Container( - decoration: BoxDecoration( - color: Color(0xFFFAFAFA), - boxShadow: [ - BoxShadow( - color: Color(0x0D000000), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.circular(8), + height: 143.h, + margin: EdgeInsets.only( + left: 16, + right: 16, + top: 10, ), - height: 175.h, - margin: EdgeInsets.only(left: 16, right: 16, top: 15), child: Stack( children: [ + Container( + decoration: BoxDecoration( + color: Color(0x80FFFFFF), + boxShadow: [ + BoxShadow( + color: Color(0x0D000000), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(8), + ), + child: SvgPicture.asset( + addressBgs[selectedBtn], + width: double.infinity, + height: double.infinity, + fit: BoxFit.fill, + ), + ), Column( children: [ Container( - decoration: BoxDecoration( - color: Color(0xFF9C9FAC), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), - ), - ), height: 50.h, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, children: [ Expanded( flex: 1, child: Container( height: 50.h, - decoration: BoxDecoration( - image: selectedBtn == 0 - ? DecorationImage( - image: - AssetImage("assets/image/order_btn1.png"), - fit: BoxFit.fill, - ) - : null, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - ), - ), + alignment: Alignment.center, child: GestureDetector( onTap: () { setState(() { selectedBtn = 0; }); }, - child: Stack( - alignment: Alignment.center, - children: [ - Text( - S.of(context).daodianziqu, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.black, - ), - ), - ], + child: Text( + S.of(context).daodianziqu, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), ), ), ), Expanded( flex: 1, - child: GestureDetector( - onTap: () { - setState(() { - selectedBtn = 1; - }); - }, - child: Stack( - alignment: Alignment.center, - children: [ - if (selectedBtn == 1) - Image.asset( - "assets/image/order_btn2.png", - height: 50.h, - fit: BoxFit.fill, - ), - Text( - S.of(context).waimaipeisong, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), + child: Container( + height: 50.h, + alignment: Alignment.center, + child: GestureDetector( + onTap: () { + setState(() { + selectedBtn = 1; + }); + }, + child: Text( + S.of(context).waimaipeisong, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, ), - ], + ), ), ), ), @@ -271,18 +315,7 @@ class _Settlement extends State { flex: 1, child: Container( height: 50.h, - decoration: BoxDecoration( - image: selectedBtn == 2 - ? DecorationImage( - image: - AssetImage("assets/image/order_btn3.png"), - fit: BoxFit.fill, - ) - : null, - borderRadius: BorderRadius.only( - topRight: Radius.circular(8), - ), - ), + alignment: Alignment.center, child: GestureDetector( onTap: () { setState(() { @@ -291,18 +324,13 @@ class _Settlement extends State { alignment: Alignment.center); }); }, - child: Stack( - alignment: Alignment.center, - children: [ - Text( - S.of(context).kuaidiwuliu, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), - ), - ], + child: Text( + S.of(context).kuaidiwuliu, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), ), ), ), @@ -394,39 +422,6 @@ class _Settlement extends State { ) ], ), - Row( - children: [ - Expanded( - child: Text( - S.of(context).yuliudianhua, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF4C4C4C), - ), - ), - ), - Text( - storeInfo != null ? storeInfo.headMobile : "", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF4C4C4C), - ), - ), - GestureDetector( - onTap: () { - showAlertDialog(); - }, - child: Image.asset( - "assets/image/pen.png", - height: 14.h, - width: 14.w, - ), - ), - ], - ) ], ), )