fmk
3 years ago
51 changed files with 1342 additions and 327 deletions
After Width: | Height: | Size: 7.8 KiB |
@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
|
||||
import 'package:flutter/material.dart'; |
||||
|
||||
class CommunityPage extends StatefulWidget { |
||||
|
||||
|
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _CommunityPage(); |
||||
} |
||||
|
||||
} |
||||
|
||||
class _CommunityPage extends State<CommunityPage> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,217 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_svg/flutter_svg.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/item_title.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/view_widget/round_button.dart'; |
||||
import 'package:huixiang/view_widget/separator.dart'; |
||||
|
||||
class CouponView extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _CouponView(); |
||||
} |
||||
} |
||||
|
||||
class _CouponView extends State<CouponView> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Column( |
||||
children: [ |
||||
SizedBox( |
||||
height: 20.h, |
||||
), |
||||
ItemTitle( |
||||
text: S.of(context).chaojiyouhuiquan, |
||||
imgPath: "assets/image/icon_points_mall.png", |
||||
), |
||||
Container( |
||||
height: 132, |
||||
margin: EdgeInsets.only(top: 10), |
||||
child: ListView.builder( |
||||
scrollDirection: Axis.horizontal, |
||||
physics: BouncingScrollPhysics(), |
||||
padding: EdgeInsets.symmetric(horizontal: 10), |
||||
itemBuilder: (context, position) { |
||||
return couponItem(); |
||||
}, |
||||
itemCount: 10, |
||||
), |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
Widget couponItem() { |
||||
return Container( |
||||
width: 0.9.sw, |
||||
height: 122.h, |
||||
child: Stack( |
||||
children: [ |
||||
Container( |
||||
width: 0.9.sw, |
||||
height: 122.h, |
||||
child: SvgPicture.asset( |
||||
"assets/svg/youhuiquan_bg.svg", |
||||
width: double.infinity, |
||||
height: 122.h, |
||||
fit: BoxFit.fill, |
||||
), |
||||
), |
||||
Container( |
||||
width: 0.9.sw, |
||||
height: 122.h, |
||||
child: Row( |
||||
children: [ |
||||
Expanded( |
||||
child: Container( |
||||
alignment: Alignment.center, |
||||
child: Container( |
||||
width: 74, |
||||
height: 74, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(6), |
||||
gradient: LinearGradient( |
||||
begin: Alignment.topLeft, |
||||
end: Alignment.bottomRight, |
||||
colors: [ |
||||
Color(0xFFACDD60), |
||||
Color(0xFF32A060), |
||||
], |
||||
), |
||||
), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "20", |
||||
style: TextStyle( |
||||
fontSize: 25.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Text( |
||||
"抵扣劵", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 14.sp, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
flex: 37, |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only( |
||||
top: 24.h, |
||||
bottom: 24.h, |
||||
), |
||||
child: MySeparator( |
||||
height: 5.h, |
||||
width: 1, |
||||
color: Color(0xFFD8D8D8), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: Container( |
||||
margin: |
||||
EdgeInsets.symmetric(vertical: 10.h, horizontal: 15.w), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
"海峡姐妹(楚河汉街店)", |
||||
style: TextStyle( |
||||
color: Color(0xFF181818), |
||||
fontWeight: MyFontWeight.medium, |
||||
fontSize: 14.sp, |
||||
), |
||||
), |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"1张", |
||||
style: TextStyle( |
||||
color: Color(0xFF868686), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 4.w, |
||||
), |
||||
Text( |
||||
"20元无门槛抵扣 ", |
||||
style: TextStyle( |
||||
color: Color(0xFF868686), |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 12.sp, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
width: 12.w, |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.end, |
||||
children: [ |
||||
Text( |
||||
"2021/10/11到期", |
||||
style: TextStyle( |
||||
color: Color(0xFF868686), |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 10.sp, |
||||
), |
||||
), |
||||
Expanded( |
||||
child: Container(), |
||||
flex: 1, |
||||
), |
||||
RoundButton( |
||||
text: "领取", |
||||
textColor: Colors.white, |
||||
backgroup: Color(0xFF32A060), |
||||
radius: 100, |
||||
padding: EdgeInsets.symmetric(vertical: 3.h, horizontal: 14.w), |
||||
), |
||||
SizedBox( |
||||
width: 10.w, |
||||
), |
||||
], |
||||
), |
||||
], |
||||
), |
||||
), |
||||
flex: 63, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,168 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/item_title.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/view_widget/round_button.dart'; |
||||
|
||||
class FeaturedActivity extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _FeaturedActivity(); |
||||
} |
||||
} |
||||
|
||||
class _FeaturedActivity extends State<FeaturedActivity> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Column( |
||||
children: [ |
||||
ItemTitle( |
||||
text: S.of(context).jifenshangcheng, |
||||
imgPath: "assets/image/icon_points_mall.png", |
||||
moreText: S.of(context).chakangengduo, |
||||
onTap: () {}, |
||||
), |
||||
SizedBox( |
||||
height: 10.h, |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.symmetric(horizontal: 11.w), |
||||
child: Row( |
||||
children: [ |
||||
Container( |
||||
child: stackItem(18.sp), |
||||
margin: EdgeInsets.symmetric(horizontal: 5.w), |
||||
width: (MediaQuery.of(context).size.width - 42) / 2, |
||||
height: 180.h, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(4), |
||||
color: Colors.red, |
||||
image: DecorationImage( |
||||
image: AssetImage( |
||||
"assets/image/share_image_bg.png", |
||||
), |
||||
fit: BoxFit.cover, |
||||
), |
||||
), |
||||
), |
||||
Container( |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
||||
children: [ |
||||
Container( |
||||
child: stackItem(14.sp), |
||||
margin: EdgeInsets.symmetric(horizontal: 5.w), |
||||
width: (MediaQuery.of(context).size.width - 42) / 2, |
||||
height: 170.h / 2, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(4), |
||||
color: Colors.green, |
||||
image: DecorationImage( |
||||
image: AssetImage( |
||||
"assets/image/share_image_bg.png", |
||||
), |
||||
fit: BoxFit.cover, |
||||
), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 10.h, |
||||
), |
||||
Container( |
||||
child: stackItem(14.sp), |
||||
margin: EdgeInsets.symmetric(horizontal: 5.w), |
||||
width: (MediaQuery.of(context).size.width - 42) / 2, |
||||
height: 170.h / 2, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(4), |
||||
color: Colors.blue, |
||||
image: DecorationImage( |
||||
image: AssetImage( |
||||
"assets/image/share_image_bg.png", |
||||
), |
||||
fit: BoxFit.cover, |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 28.h, |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
Widget stackItem(double textSize) { |
||||
return Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
margin: EdgeInsets.only(left: 8, top: 8), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
"第二件半价!", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: textSize, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 2, |
||||
), |
||||
Text( |
||||
"仅限指定饮品", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 12.sp, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
width: 58.w, |
||||
margin: EdgeInsets.only(left: 8, bottom: 8), |
||||
padding: EdgeInsets.symmetric( |
||||
vertical: 4.h, |
||||
horizontal: 8.w, |
||||
), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF32A060), |
||||
borderRadius: BorderRadius.circular(20), |
||||
), |
||||
alignment: Alignment.center, |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
"了解", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
Icon( |
||||
Icons.keyboard_arrow_right, |
||||
color: Colors.white, |
||||
size: 12, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,131 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_svg/flutter_svg.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/item_title.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class QuickOrder extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _QuickOrder(); |
||||
} |
||||
} |
||||
|
||||
class _QuickOrder extends State<QuickOrder> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Column( |
||||
children: [ |
||||
ItemTitle( |
||||
text: S.of(context).jifenshangcheng, |
||||
imgPath: "assets/image/icon_points_mall.png", |
||||
), |
||||
Container( |
||||
height: 170, |
||||
margin: EdgeInsets.only(top: 10), |
||||
child: ListView.builder( |
||||
scrollDirection: Axis.horizontal, |
||||
physics: BouncingScrollPhysics(), |
||||
padding: EdgeInsets.symmetric(horizontal: 10), |
||||
itemBuilder: (context, position) { |
||||
return storeItem(); |
||||
}, |
||||
itemCount: 10, |
||||
), |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
Widget storeItem() { |
||||
return Container( |
||||
width: 160, |
||||
height: 160, |
||||
margin: EdgeInsets.symmetric( |
||||
horizontal: 6.w, |
||||
vertical: 3, |
||||
), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(4.w), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x08000000), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
), |
||||
child: Stack( |
||||
children: [ |
||||
Positioned( |
||||
top: 0, |
||||
left: 0, |
||||
right: 0, |
||||
child: ClipRRect( |
||||
child: Image.asset( |
||||
"assets/image/share_image_bg.png", |
||||
width: double.infinity, |
||||
height: 95, |
||||
fit: BoxFit.cover, |
||||
), |
||||
borderRadius: BorderRadius.vertical( |
||||
top: Radius.circular(4), |
||||
), |
||||
), |
||||
), |
||||
Positioned( |
||||
bottom: 0, |
||||
left: 0, |
||||
right: 0, |
||||
child: SvgPicture.asset( |
||||
"assets/svg/kuaijiexiadan_bg.svg", |
||||
width: double.infinity, |
||||
height: 95, |
||||
fit: BoxFit.fill, |
||||
), |
||||
), |
||||
Positioned( |
||||
bottom: 0, |
||||
left: 0, |
||||
right: 0, |
||||
child: Container( |
||||
height: 95, |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/default_user.png", |
||||
width: 32, |
||||
height: 32, |
||||
), |
||||
Text( |
||||
"百年川椒", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
Text( |
||||
"正宗重庆老味道", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF868686), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 5, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,88 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
||||
|
||||
part of 'min_api.dart'; |
||||
|
||||
// ************************************************************************** |
||||
// RetrofitGenerator |
||||
// ************************************************************************** |
||||
|
||||
class _MinApiService implements MinApiService { |
||||
_MinApiService(this._dio, {this.baseUrl}) { |
||||
ArgumentError.checkNotNull(_dio, '_dio'); |
||||
baseUrl ??= 'http://192.168.10.236:8765/app/'; |
||||
} |
||||
|
||||
final Dio _dio; |
||||
|
||||
String baseUrl; |
||||
|
||||
@override |
||||
Future<BaseData<List<FindMiNiGroupList>>> findMiNiGroupList(param) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'product/findMiNiGroupList', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData<List<FindMiNiGroupList>>.fromJson( |
||||
_result.data, |
||||
(json) => (json as List<dynamic>) |
||||
.map<FindMiNiGroupList>( |
||||
(i) => FindMiNiGroupList.fromJson(i as Map<String, dynamic>)) |
||||
.toList()); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData<MiNiDetail>> miNiDetail(id) async { |
||||
ArgumentError.checkNotNull(id, 'id'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
final _result = await _dio.request<Map<String, dynamic>>( |
||||
'/product/queryMiNiProductDetail?id=$id', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'GET', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData<MiNiDetail>.fromJson( |
||||
_result.data, |
||||
(json) => MiNiDetail.fromJson(json), |
||||
); |
||||
return value; |
||||
} |
||||
|
||||
@override |
||||
Future<BaseData<ShoppingCart>> shoppingCart(param, header) async { |
||||
ArgumentError.checkNotNull(param, 'param'); |
||||
ArgumentError.checkNotNull(header, 'header'); |
||||
const _extra = <String, dynamic>{}; |
||||
final queryParameters = <String, dynamic>{}; |
||||
final _data = <String, dynamic>{}; |
||||
_data.addAll(param ?? <String, dynamic>{}); |
||||
final _result = await _dio.request<Map<String, dynamic>>('shoppingcart', |
||||
queryParameters: queryParameters, |
||||
options: RequestOptions( |
||||
method: 'POST', |
||||
headers: <String, dynamic>{}, |
||||
extra: _extra, |
||||
baseUrl: baseUrl), |
||||
data: _data); |
||||
final value = BaseData<ShoppingCart>.fromJson( |
||||
_result.data, |
||||
(json) => ShoppingCart.fromJson(json), |
||||
); |
||||
return value; |
||||
} |
||||
} |
Loading…
Reference in new issue