|
|
|
@ -32,10 +32,11 @@ class StoreOrderPage extends StatefulWidget {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class testModel{ |
|
|
|
|
class testModel { |
|
|
|
|
String name; |
|
|
|
|
bool isSelected; |
|
|
|
|
testModel(String name){ |
|
|
|
|
|
|
|
|
|
testModel(String name) { |
|
|
|
|
this.name = name; |
|
|
|
|
this.isSelected = false; |
|
|
|
|
} |
|
|
|
@ -47,10 +48,15 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
ApiService apiService; |
|
|
|
|
StoreInfo storeInfo; |
|
|
|
|
RefreshController refreshController; |
|
|
|
|
List<testModel> temperatureStoreList = [testModel("正常冰"),testModel("少冰"),testModel("多冰"),testModel("去冰")]; |
|
|
|
|
List<testModel> sweetnessStoreList = [testModel("正常糖"),testModel("5分糖")]; |
|
|
|
|
List<testModel> temperatureStoreList = [ |
|
|
|
|
testModel("正常冰"), |
|
|
|
|
testModel("少冰"), |
|
|
|
|
testModel("多冰"), |
|
|
|
|
testModel("去冰") |
|
|
|
|
]; |
|
|
|
|
List<testModel> sweetnessStoreList = [testModel("正常糖"), testModel("5分糖")]; |
|
|
|
|
int isSelected = 0; |
|
|
|
|
int isChoice =0; |
|
|
|
|
int isChoice = 0; |
|
|
|
|
int tempClickIndex = 0; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -253,14 +259,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
color: Colors.black, |
|
|
|
|
width: MediaQuery.of(context).size.width, |
|
|
|
|
height: MediaQuery.of(context).size.width, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).xindianhuodong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
controller: tabcontroller, |
|
|
|
@ -300,15 +298,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/settlement', |
|
|
|
|
arguments: { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
arguments: {}, |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
child:RoundButton( |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 103.w, |
|
|
|
|
height: 54.h, |
|
|
|
|
text: S.current.jiesuan, |
|
|
|
@ -319,42 +315,40 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
showShoppingCart(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopp.png", |
|
|
|
|
width: 88, |
|
|
|
|
height: 88, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
right: 15, |
|
|
|
|
top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 17, |
|
|
|
|
height: 17, |
|
|
|
|
text: "1", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
showShoppingCart(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopp.png", |
|
|
|
|
width: 88, |
|
|
|
|
height: 88, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
right: 15, |
|
|
|
|
top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 17, |
|
|
|
|
height: 17, |
|
|
|
|
text: "1", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
@ -362,17 +356,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///星店活动 |
|
|
|
|
Widget starGoodsItem() { |
|
|
|
|
return Container( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).xindianhuodong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
return Container( |
|
|
|
|
child: Swiper( |
|
|
|
|
viewportFraction: 0.95, |
|
|
|
@ -502,6 +487,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///点餐 |
|
|
|
|
Widget order() { |
|
|
|
|
return Container( |
|
|
|
|
width: double.infinity, |
|
|
|
@ -760,205 +746,211 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
context: context, |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
|
builder: (context) { |
|
|
|
|
return StatefulBuilder( |
|
|
|
|
builder:(context1, state) { |
|
|
|
|
return Container( |
|
|
|
|
alignment: Alignment.topCenter, |
|
|
|
|
padding: EdgeInsets.only(top: 16, left: 16, right: 16), |
|
|
|
|
width: double.infinity, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), topRight: Radius.circular(8)), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
MImage( |
|
|
|
|
"", |
|
|
|
|
width: 70, |
|
|
|
|
height: 70, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 10), |
|
|
|
|
Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"手工啵啵奶茶", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(top: 4, bottom: 7), |
|
|
|
|
child: Text( |
|
|
|
|
"已选:正常冰", |
|
|
|
|
return StatefulBuilder(builder: (context1, state) { |
|
|
|
|
return Container( |
|
|
|
|
alignment: Alignment.topCenter, |
|
|
|
|
padding: EdgeInsets.only(top: 16, left: 16, right: 16), |
|
|
|
|
width: double.infinity, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), topRight: Radius.circular(8)), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
MImage( |
|
|
|
|
"", |
|
|
|
|
width: 70, |
|
|
|
|
height: 70, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
SizedBox(width: 10), |
|
|
|
|
Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"手工啵啵奶茶", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF727272), |
|
|
|
|
fontSize: 11.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"会员价", |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(top: 4, bottom: 7), |
|
|
|
|
child: Text( |
|
|
|
|
"已选:正常冰", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
|
fontSize: 13.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF727272), |
|
|
|
|
fontSize: 11.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"¥19.00", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"会员价", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
|
fontSize: 13.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
Text( |
|
|
|
|
"¥19.00", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/cancel.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/cancel.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 23, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"温度", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 23, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"温度", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 15, |
|
|
|
|
), |
|
|
|
|
sweetnessStore((){state((){ |
|
|
|
|
for(var i = 0;i < temperatureStoreList.length;i++){ |
|
|
|
|
if(tempClickIndex == i) |
|
|
|
|
temperatureStoreList[i].isSelected = true; |
|
|
|
|
else temperatureStoreList[i].isSelected = false; |
|
|
|
|
} |
|
|
|
|
});},temperatureStoreList), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"甜度", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
SizedBox( |
|
|
|
|
height: 15, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 15, |
|
|
|
|
), |
|
|
|
|
sweetnessStore((){state((){ |
|
|
|
|
for(var i = 0;i < sweetnessStoreList.length;i++){ |
|
|
|
|
if(tempClickIndex == i) |
|
|
|
|
sweetnessStoreList[i].isSelected = true; |
|
|
|
|
else sweetnessStoreList[i].isSelected = false; |
|
|
|
|
} |
|
|
|
|
});},sweetnessStoreList), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Expanded(child: Text( |
|
|
|
|
"数量", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
)) |
|
|
|
|
, |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/reduce.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
sweetnessStore(() { |
|
|
|
|
state(() { |
|
|
|
|
for (var i = 0; i < temperatureStoreList.length; i++) { |
|
|
|
|
if (tempClickIndex == i) |
|
|
|
|
temperatureStoreList[i].isSelected = true; |
|
|
|
|
else |
|
|
|
|
temperatureStoreList[i].isSelected = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, temperatureStoreList), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"甜度", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 8, right: 8), |
|
|
|
|
child: Text( |
|
|
|
|
"1", |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 15, |
|
|
|
|
), |
|
|
|
|
sweetnessStore(() { |
|
|
|
|
state(() { |
|
|
|
|
for (var i = 0; i < sweetnessStoreList.length; i++) { |
|
|
|
|
if (tempClickIndex == i) |
|
|
|
|
sweetnessStoreList[i].isSelected = true; |
|
|
|
|
else |
|
|
|
|
sweetnessStoreList[i].isSelected = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, sweetnessStoreList), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
"数量", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/reduce.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/add.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 8, right: 8), |
|
|
|
|
child: Text( |
|
|
|
|
"1", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
RoundButton( |
|
|
|
|
width:double.infinity, |
|
|
|
|
height: 54.h, |
|
|
|
|
text: "加入购物车", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
radius:27, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
);}); |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/add.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
RoundButton( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 54.h, |
|
|
|
|
text: "加入购物车", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
radius: 27, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget sweetnessStore(Function fc,List<testModel> arrays) { |
|
|
|
|
Widget sweetnessStore(Function fc, List<testModel> arrays) { |
|
|
|
|
return GridView.builder( |
|
|
|
|
itemCount:arrays.length, |
|
|
|
|
itemCount: arrays.length, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
|
|
|
|
//一行的Widget数量 |
|
|
|
|
//一行的Widget数量 |
|
|
|
|
crossAxisCount: 4, |
|
|
|
|
//水平子Widget之间间距 |
|
|
|
|
crossAxisSpacing: 6.w, |
|
|
|
@ -968,17 +960,17 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
childAspectRatio: 3 / 1), |
|
|
|
|
itemBuilder: (contetx, index) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
onTap: () { |
|
|
|
|
tempClickIndex = index; |
|
|
|
|
fc(); |
|
|
|
|
}, |
|
|
|
|
child: sweetnessItem(arrays[index].name,arrays[index].isSelected), |
|
|
|
|
child: sweetnessItem(arrays[index].name, arrays[index].isSelected), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget sweetnessItem(String name,bool isCheck) { |
|
|
|
|
Widget sweetnessItem(String name, bool isCheck) { |
|
|
|
|
return Container( |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
@ -988,10 +980,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
width: 68.w, |
|
|
|
|
height: 29.h, |
|
|
|
|
text: name, |
|
|
|
|
textColor: !isCheck ?Color(0xFF727272):Colors.white, |
|
|
|
|
textColor: !isCheck ? Color(0xFF727272) : Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
radius: 4, |
|
|
|
|
backgroup:!isCheck ? Color(0xFFE5E5E5):Color(0xFF32A060), |
|
|
|
|
backgroup: !isCheck ? Color(0xFFE5E5E5) : Color(0xFF32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
@ -1005,144 +997,143 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
context: context, |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
|
builder: (context) { |
|
|
|
|
return StatefulBuilder( |
|
|
|
|
builder:(context1, state) { |
|
|
|
|
return Container( |
|
|
|
|
alignment: Alignment.topCenter, |
|
|
|
|
width: double.infinity, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), topRight: Radius.circular(8)), |
|
|
|
|
), |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.only(top: 16, left: 16, right: 16), |
|
|
|
|
child:Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
return StatefulBuilder(builder: (context1, state) { |
|
|
|
|
return Container( |
|
|
|
|
alignment: Alignment.topCenter, |
|
|
|
|
width: double.infinity, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
topLeft: Radius.circular(8), topRight: Radius.circular(8)), |
|
|
|
|
), |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.only(top: 16, left: 16, right: 16), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"已选商品", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/delete.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
Text( |
|
|
|
|
"已选商品", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/delete.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox(height: 24.h), |
|
|
|
|
Expanded(child: |
|
|
|
|
Container( |
|
|
|
|
child: ListView.builder( |
|
|
|
|
itemCount: 10, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
// physics:NeverScrollableScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return shoppGoodsItem(); |
|
|
|
|
}), |
|
|
|
|
),) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
height: 54.h, |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
child: Row( |
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.end, |
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
|
children: [ |
|
|
|
|
Spacer(), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).heji, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"¥19.00", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF32A060), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
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), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
SizedBox(height: 24.h), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
child: ListView.builder( |
|
|
|
|
itemCount: 10, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
// physics:NeverScrollableScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return shoppGoodsItem(); |
|
|
|
|
}), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
height: 54.h, |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
child: Row( |
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.end, |
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
|
children: [ |
|
|
|
|
Spacer(), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).heji, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopp.png", |
|
|
|
|
width: 88, |
|
|
|
|
height: 88, |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"¥19.00", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF32A060), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
right: 15, |
|
|
|
|
top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 17, |
|
|
|
|
height: 17, |
|
|
|
|
text: "1", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
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), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopp.png", |
|
|
|
|
width: 88, |
|
|
|
|
height: 88, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
Positioned( |
|
|
|
|
right: 15, |
|
|
|
|
top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 17, |
|
|
|
|
height: 17, |
|
|
|
|
text: "1", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
);}); |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -1155,7 +1146,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
MImage( |
|
|
|
|
"assets/image/default_1.png", |
|
|
|
|
width: 60, |
|
|
|
|
height:60, |
|
|
|
|
height: 60, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
@ -1195,7 +1186,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox(height:6), |
|
|
|
|
SizedBox(height: 6), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
Column( |
|
|
|
@ -1232,25 +1223,25 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 8, right: 8), |
|
|
|
|
child: Text( |
|
|
|
|
"1", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 8, right: 8), |
|
|
|
|
child: Text( |
|
|
|
|
"1", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/add.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/add.png", |
|
|
|
|
width: 22, |
|
|
|
|
height: 22, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
@ -1261,7 +1252,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @override |
|
|
|
|
// bool get wantKeepAlive => true; |
|
|
|
|
} |
|
|
|
|