Browse Source

safety

master
fmk 3 years ago
parent
commit
af927986bb
  1. 439
      lib/store/store_view/settlement.dart
  2. 28
      lib/store/store_view/shop_goods.dart

439
lib/store/store_view/settlement.dart

@ -16,7 +16,7 @@ class Settlement extends StatefulWidget {
final arguments; final arguments;
final OrderInfo orderInfo; final OrderInfo orderInfo;
Settlement({this.arguments,this.orderInfo}); Settlement({this.arguments, this.orderInfo});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -51,7 +51,8 @@ class _Settlement extends State<Settlement> {
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE // String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
queryDetails() async { queryDetails() async {
BaseData<OrderInfo> baseData = await apiService.orderDetail(widget.arguments["id"]); BaseData<OrderInfo> baseData =
await apiService.orderDetail(widget.arguments["id"]);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
orderInfo = baseData.data; orderInfo = baseData.data;
payStatus = orderInfo.payStatus; payStatus = orderInfo.payStatus;
@ -95,7 +96,7 @@ class _Settlement extends State<Settlement> {
appBar: MyAppBar( appBar: MyAppBar(
background: Color(0xFF3A405A), background: Color(0xFF3A405A),
leadingColor: Colors.white, leadingColor: Colors.white,
title:S.of(context).dingdanjiesuan, title: S.of(context).dingdanjiesuan,
titleColor: Colors.white, titleColor: Colors.white,
brightness: Brightness.dark, brightness: Brightness.dark,
titleSize: 18.sp, titleSize: 18.sp,
@ -106,10 +107,11 @@ class _Settlement extends State<Settlement> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
distributionMode(), distributionMode(),
SizedBox(height: 14,), SizedBox(
height: 14,
),
/// ///
OrderCommodity(orderInfo), OrderCommodity(orderInfo),
@ -120,7 +122,6 @@ class _Settlement extends State<Settlement> {
activityRemarks(), activityRemarks(),
payMethod(), payMethod(),
], ],
), ),
), ),
@ -136,50 +137,49 @@ class _Settlement extends State<Settlement> {
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
child: child: Container(
Container( height: 54.h,
height: 54.h, color: Colors.white,
color: Colors.white, child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Spacer(),
Spacer(), Text(
Text( S.of(context).heji,
S.of(context).heji, style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 12.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Colors.black,
color: Colors.black, ),
),
),
Text(
"¥19.00",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
SizedBox(width: 28,),
GestureDetector(
onTap: () {
},
child: RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
),
],
), ),
), Text(
) "¥19.00",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
SizedBox(
width: 28,
),
GestureDetector(
onTap: () {},
child: RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
),
],
),
),
),
], ],
); );
} }
@ -289,7 +289,11 @@ class _Settlement extends State<Settlement> {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
height: 175.h, height: 175.h,
margin: EdgeInsets.only(left: 16, right: 16, top: 15), margin: EdgeInsets.only(
left: 16,
right: 16,
top: 15,
),
child: Stack( child: Stack(
children: [ children: [
Column( Column(
@ -310,37 +314,40 @@ class _Settlement extends State<Settlement> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 50.h, height: 50.h,
decoration: BoxDecoration( decoration: BoxDecoration(
image: selectedBtn == 0 image: selectedBtn == 0
? DecorationImage( ? DecorationImage(
image: AssetImage( image:
"assets/image/order_btn1.png"), AssetImage("assets/image/order_btn1.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
) )
: null, : null,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(8))), topLeft: Radius.circular(8),
child: GestureDetector( ),
onTap: () { ),
setState(() { child: GestureDetector(
selectedBtn = 0; onTap: () {
}); setState(() {
}, selectedBtn = 0;
child: Stack( });
alignment: Alignment.center, },
children: [ child: Stack(
Text( alignment: Alignment.center,
S.of(context).daodianziqu, children: [
style: TextStyle( Text(
fontSize: 14.sp, S.of(context).daodianziqu,
fontWeight: MyFontWeight.semi_bold, style: TextStyle(
color: Colors.black, fontSize: 14.sp,
), fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
), ),
], ),
), ],
)), ),
),
),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
@ -360,7 +367,7 @@ class _Settlement extends State<Settlement> {
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
Text( Text(
S.of(context).waimaipeisong, S.of(context).waimaipeisong,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -374,37 +381,40 @@ class _Settlement extends State<Settlement> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 50.h, height: 50.h,
decoration: BoxDecoration( decoration: BoxDecoration(
image: selectedBtn == 2 image: selectedBtn == 2
? DecorationImage( ? DecorationImage(
image: AssetImage( image:
"assets/image/order_btn3.png"), AssetImage("assets/image/order_btn3.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
) )
: null, : null,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(8))), topRight: Radius.circular(8),
child: GestureDetector( ),
onTap: () { ),
setState(() { child: GestureDetector(
selectedBtn = 2; onTap: () {
}); setState(() {
}, selectedBtn = 2;
child: Stack( });
alignment: Alignment.center, },
children: [ child: Stack(
Text( alignment: Alignment.center,
S.of(context).kuaidiwuliu, children: [
style: TextStyle( Text(
fontSize: 14.sp, S.of(context).kuaidiwuliu,
fontWeight: MyFontWeight.regular, style: TextStyle(
color: Colors.black, fontSize: 14.sp,
), fontWeight: MyFontWeight.regular,
color: Colors.black,
), ),
], ),
), ],
)), ),
),
),
), ),
], ],
), ),
@ -416,37 +426,39 @@ class _Settlement extends State<Settlement> {
children: [ children: [
Row( Row(
children: [ children: [
Expanded(child:Column( Expanded(
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text( children: [
"前进麦味·天然烘焙(凯德1818店)", Text(
overflow: TextOverflow.ellipsis, "前进麦味·天然烘焙(凯德1818店)",
style: TextStyle( overflow: TextOverflow.ellipsis,
fontSize: 14.sp, style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp,
color: Color(0xFF4C4C4C), fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF4C4C4C),
),
), ),
), SizedBox(
SizedBox( height: 4,
height: 4,
),
Text(
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
), ),
), Text(
SizedBox( "武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05",
height: 12, overflow: TextOverflow.ellipsis,
), maxLines: 2,
], style: TextStyle(
),), fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
SizedBox(
height: 12,
),
],
),
),
SizedBox( SizedBox(
width: 18, width: 18,
), ),
@ -458,42 +470,46 @@ class _Settlement extends State<Settlement> {
Image.asset( Image.asset(
"assets/image/map.png", "assets/image/map.png",
height: 61.h, height: 61.h,
width:61.w, width: 61.w,
),
],
),
Column(
children: [
RoundButton(
width: 41.w,
height: 13,
text: "距离您11m",
textColor: Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold,
radius: 7.5,
backgroup: Colors.white,
fontSize: 7.sp,
),
Image.asset(
"assets/image/landmark.png",
height: 24.h,
width: 24.w,
), ),
], ],
), ),
Column(children: [
RoundButton(
width: 41.w,
height: 13,
text: "距离您11m",
textColor:Color(0xFF34A262),
fontWeight: MyFontWeight.semi_bold,
radius:7.5,
backgroup:Colors.white,
fontSize:7.sp,
),
Image.asset(
"assets/image/landmark.png",
height: 24.h,
width:24.w,
),
],),
], ],
) )
], ],
), ),
Row( Row(
children: [ children: [
Expanded(child: Text( Expanded(
S.of(context).yuliudianhua, child: Text(
overflow: TextOverflow.ellipsis, S.of(context).yuliudianhua,
style: TextStyle( overflow: TextOverflow.ellipsis,
fontSize: 14.sp, style: TextStyle(
fontWeight: MyFontWeight.regular, fontSize: 14.sp,
color: Color(0xFF4C4C4C), fontWeight: MyFontWeight.regular,
color: Color(0xFF4C4C4C),
),
), ),
)), ),
Text( Text(
"12309090909", "12309090909",
style: TextStyle( style: TextStyle(
@ -504,8 +520,8 @@ class _Settlement extends State<Settlement> {
), ),
Image.asset( Image.asset(
"assets/image/pen.png", "assets/image/pen.png",
height:14.h, height: 14.h,
width:14.w, width: 14.w,
), ),
], ],
) )
@ -514,18 +530,12 @@ class _Settlement extends State<Settlement> {
), ),
], ],
), ),
// Image.asset(
// "assets/image/shadow.png",
// width: 24.w,
// height: 24.h,
// fit: BoxFit.contain,
// ),
], ],
), ),
); );
} }
Widget activityRemarks(){ Widget activityRemarks() {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -540,29 +550,40 @@ class _Settlement extends State<Settlement> {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
height: 86.h, height: 86.h,
margin: EdgeInsets.only(left: 16, right: 16, top: 15), margin: EdgeInsets.only(
padding: EdgeInsets.only(left: 16, right: 16, top: 16), left: 16,
right: 16,
top: 15,
),
padding: EdgeInsets.only(
left: 16,
right: 16,
top: 16,
),
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(flex: 1,child:Text( Expanded(
S.of(context).youhuiquan, flex: 1,
style: TextStyle( child: Text(
fontWeight: MyFontWeight.regular, S.of(context).youhuiquan,
fontSize: 14.sp, style: TextStyle(
color: Color(0xFF353535), fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
), ),
)), ),
Text( Text(
"满30减10", "满30减10",
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold,
), ),
), ),
Icon( Icon(
@ -571,27 +592,31 @@ class _Settlement extends State<Settlement> {
), ),
], ],
), ),
SizedBox(height: 13, SizedBox(
height: 13,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(flex: 1,child:Text( Expanded(
S.of(context).beizhu, flex: 1,
style: TextStyle( child: Text(
fontWeight: MyFontWeight.regular, S.of(context).beizhu,
fontSize: 14.sp, style: TextStyle(
color: Color(0xFF353535), fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
), ),
)), ),
Text( Text(
"口味、面包硬度等", "口味、面包硬度等",
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold,
), ),
), ),
Icon( Icon(
@ -605,7 +630,7 @@ class _Settlement extends State<Settlement> {
); );
} }
Widget payMethod(){ Widget payMethod() {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -642,14 +667,14 @@ class _Settlement extends State<Settlement> {
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: Colors.black, color: Colors.black,
fontWeight:MyFontWeight.regular, fontWeight: MyFontWeight.regular,
), ),
), ),
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex =1; checkIndex = 1;
}); });
}, },
child: Row( child: Row(
@ -662,17 +687,19 @@ class _Settlement extends State<Settlement> {
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold,
), ),
), ),
], ],
), ),
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex =2; checkIndex = 2;
}); });
}, },
child: Row( child: Row(
@ -685,13 +712,15 @@ class _Settlement extends State<Settlement> {
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
), ),
), ),
], ],
), ),
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -712,7 +741,7 @@ class _Settlement extends State<Settlement> {
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
), ),
), ),
), ),

28
lib/store/store_view/shop_goods.dart

@ -159,21 +159,19 @@ class _ShopGoods extends State<ShopGoods> {
: InkWell( : InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
{ if (widget.productListBeans[widget.position]
if (widget.productListBeans[widget.position] .buyNum >
.buyNum > 0)
0) widget.productListBeans[widget.position]
widget.productListBeans[widget.position] .buyNum--;
.buyNum--; int allCount = 0;
int allCount = 0; double allPrice = 0;
double allPrice = 0; widget.productListBeans.forEach((element) {
widget.productListBeans.forEach((element) { allCount += element.buyNum;
allCount += element.buyNum; allPrice += double.parse(element.price) *
allPrice += double.parse(element.price) * element.buyNum;
element.buyNum; });
}); widget.fc(allCount, allPrice);
widget.fc(allCount, allPrice);
}
}); });
}, },
child: Image.asset( child: Image.asset(

Loading…
Cancel
Save