Browse Source

点餐更改

master
w-R 3 years ago
parent
commit
bb1146407f
  1. 1
      lib/union/union_page.dart
  2. 230
      lib/union/union_view/store_activity.dart
  3. 4
      lib/union/union_view/store_info.dart

1
lib/union/union_page.dart

@ -8,7 +8,6 @@ import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart'; import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_easyloading/flutter_easyloading.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/generated/l10n.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';

230
lib/union/union_view/store_activity.dart

@ -6,6 +6,7 @@ import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
class StoreActivity extends StatefulWidget { class StoreActivity extends StatefulWidget {
@ -23,6 +24,7 @@ class StoreActivity extends StatefulWidget {
class _StoreActivity extends State<StoreActivity> { class _StoreActivity extends State<StoreActivity> {
int page = 0; int page = 0;
int isSelected =0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -94,11 +96,44 @@ class _StoreActivity extends State<StoreActivity> {
Widget order(){ Widget order(){
return Container( return Container(
child: Text("点单页面!"), width: double.infinity,
child: Row(
children: [
Container(
// decoration: BoxDecoration(
// color: Color(0xFFFAFAFA),
// boxShadow: [
// BoxShadow(
// color: Color(0x0D000000),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// ),
width: 104.w,
child:ListView.builder(
itemCount:5,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return orderItem(position);
}),
),
Expanded(flex:1,child:Container(
child:ListView.builder(
itemCount:5,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return goodsItem();
}),
)),
],),
); );
} }
Widget buildSwiper2Bottom() { Widget buildSwiper2Bottom() {
return Container( return Container(
child: Swiper( child: Swiper(
@ -228,4 +263,195 @@ class _StoreActivity extends State<StoreActivity> {
} }
Widget orderItem(int index) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: (){setState(() {
isSelected = index;
});},
child: Container(
color: isSelected != index ?Color(0xFFFAFAFA):Colors.white,
child: Padding(padding: EdgeInsets.only(left: 16,right: 28,top:8,bottom: 16),
child: Row(
children: [
Container(
color: isSelected != index ? Color(0xFFFAFAFA):Color(0xFF32A060),
width: 2.w,
height: 17.h,
),
SizedBox(width: 10.w,),
Text(
"人气推荐",
textAlign: TextAlign.center,
style: TextStyle(
color:isSelected != index ?Color(0xFF202020):Color(0xFF000000),
fontSize:12.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),),
),
),
],
),
);
}
Widget goodsItem() {
return Container(
color: Colors.white,
padding: EdgeInsets.only(right: 16.w),
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 12.w
),
MImage(
"assets/image/default_1.png",
width: 70,
height: 70,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(width:10),
Expanded(child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"手工啵啵奶茶",
style: TextStyle(
color:Colors.black,
fontSize:13.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(height:2),
Row(
children: [
Text(
"无香精",
style: TextStyle(
color:Color(0xFF4C4C4C),
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width:10),
Text(
"无香精",
style: TextStyle(
color:Color(0xFF4C4C4C),
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
),
)
],
),
SizedBox(height:7),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"会员价",
style: TextStyle(
color:Color(0xFFFF7A1A),
fontSize:10.sp,
fontWeight: MyFontWeight.medium,
),
),
Text(
"¥19.00",
style: TextStyle(
color:Color(0xFFFF7A1A),
fontSize:11.sp,
fontWeight: MyFontWeight.medium,
),
)
],
),
Row(
children: [
Text(
"原价",
style: TextStyle(
color:Color(0xFFA29E9E),
fontSize:9.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width:10),
Text(
"¥19.00",
style: TextStyle(
color:Color(0xFFA29E9E),
fontSize:10.sp,
fontWeight: MyFontWeight.regular,
),
)
],
),
],
),
Spacer(),
true?RoundButton(
width: 49.w,
text: "选规格",
textColor: Colors.white,
fontWeight: MyFontWeight.medium,
radius: 11,
backgroup: Color(0xFF32A060),
fontSize: 11.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
):
InkWell(
onTap: () {
},
child: Image.asset(
"assets/image/reduce.png",
width: 22,
height: 22,
),
),
if(false)
Padding(padding: EdgeInsets.only(left: 8,right: 8),
child:Text(
"1",
style: TextStyle(
color:Colors.black,
fontSize:14.sp,
fontWeight: MyFontWeight.medium,
),
),),
if(false)
InkWell(
onTap: () {
},
child: Image.asset(
"assets/image/add.png",
width: 22,
height: 22,
),
),
],
),
],
),)
],
),
);
}
} }

4
lib/union/union_view/store_info.dart

@ -102,7 +102,7 @@ class _StoreInfos extends State<StoreInfos> {
), ),
), ),
SizedBox( SizedBox(
height: 4.h, height: 6.h,
), ),
Text( Text(
S.of(context).yingyeshijian(widget.storeInfo == null S.of(context).yingyeshijian(widget.storeInfo == null
@ -173,7 +173,7 @@ class _StoreInfos extends State<StoreInfos> {
], ],
), ),
], ],
) ),
], ],
), ),
); );

Loading…
Cancel
Save