diff --git a/assets/svg/jingbi.svg b/assets/svg/jingbi.svg new file mode 100644 index 00000000..85b1e236 --- /dev/null +++ b/assets/svg/jingbi.svg @@ -0,0 +1,13 @@ + + + 编组 8 + + + + + + + + + + \ No newline at end of file diff --git a/assets/svg/kuaijiexiadan_bg.svg b/assets/svg/kuaijiexiadan_bg.svg new file mode 100644 index 00000000..81b47b77 --- /dev/null +++ b/assets/svg/kuaijiexiadan_bg.svg @@ -0,0 +1,11 @@ + + + 路径 + + + + + + + + \ No newline at end of file diff --git a/assets/svg/lianmeng.svg b/assets/svg/lianmeng.svg new file mode 100644 index 00000000..5363ce60 --- /dev/null +++ b/assets/svg/lianmeng.svg @@ -0,0 +1,20 @@ + + + 编组 12 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/svg/saoyisao.svg b/assets/svg/saoyisao.svg new file mode 100644 index 00000000..74c2cfe3 --- /dev/null +++ b/assets/svg/saoyisao.svg @@ -0,0 +1,15 @@ + + + 扫一扫icon + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/svg/shequn.svg b/assets/svg/shequn.svg new file mode 100644 index 00000000..82dabdec --- /dev/null +++ b/assets/svg/shequn.svg @@ -0,0 +1,13 @@ + + + 编组 13备份 + + + + + + + + + + \ No newline at end of file diff --git a/assets/svg/tixing.svg b/assets/svg/tixing.svg new file mode 100644 index 00000000..a0f52d59 --- /dev/null +++ b/assets/svg/tixing.svg @@ -0,0 +1,17 @@ + + + 编组 9 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/svg/wode.svg b/assets/svg/wode.svg new file mode 100644 index 00000000..96186155 --- /dev/null +++ b/assets/svg/wode.svg @@ -0,0 +1,15 @@ + + + 编组 32备份 + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/svg/youhuiquan_bg.svg b/assets/svg/youhuiquan_bg.svg new file mode 100644 index 00000000..d0ff3aef --- /dev/null +++ b/assets/svg/youhuiquan_bg.svg @@ -0,0 +1,20 @@ + + + 形状结合 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/community/community_page.dart b/lib/community/community_page.dart new file mode 100644 index 00000000..281b7023 --- /dev/null +++ b/lib/community/community_page.dart @@ -0,0 +1,23 @@ + + + +import 'package:flutter/material.dart'; + +class CommunityPage extends StatefulWidget { + + + + @override + State createState() { + return _CommunityPage(); + } + +} + +class _CommunityPage extends State { + @override + Widget build(BuildContext context) { + return Scaffold(); + } + +} \ No newline at end of file diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 8c55b608..f4f7651b 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -125,6 +125,7 @@ class MessageLookup extends MessageLookupByLibrary { "chakanxiangqing" : MessageLookupByLibrary.simpleMessage("查看详情"), "changjianwenti" : MessageLookupByLibrary.simpleMessage("常见问题"), "changqiyouxiao" : MessageLookupByLibrary.simpleMessage("长期有效"), + "chaojiyouhuiquan" : MessageLookupByLibrary.simpleMessage("超值优惠券"), "chaungshirengushi" : MessageLookupByLibrary.simpleMessage("创始人故事"), "chenggongdengluzhuce" : MessageLookupByLibrary.simpleMessage("成功登录注册,并绑定相关信息即可成为会员。"), "chengshixuanze" : MessageLookupByLibrary.simpleMessage("城市选择"), @@ -305,7 +306,8 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), - "main_menu3" : MessageLookupByLibrary.simpleMessage("我的"), + "main_menu3" : MessageLookupByLibrary.simpleMessage("社群"), + "main_menu4" : MessageLookupByLibrary.simpleMessage("我的"), "manlijiandaijinquan" : m17, "manyuankeyong" : m18, "meiriqiandao" : MessageLookupByLibrary.simpleMessage("每日签到"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index cdf576dc..d288ebf7 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -125,6 +125,7 @@ class MessageLookup extends MessageLookupByLibrary { "chakanxiangqing" : MessageLookupByLibrary.simpleMessage("查看详情"), "changjianwenti" : MessageLookupByLibrary.simpleMessage("常见问题"), "changqiyouxiao" : MessageLookupByLibrary.simpleMessage("长期有效"), + "chaojiyouhuiquan" : MessageLookupByLibrary.simpleMessage("超值优惠券"), "chaungshirengushi" : MessageLookupByLibrary.simpleMessage("创始人故事"), "chenggongdengluzhuce" : MessageLookupByLibrary.simpleMessage("成功登录注册,并绑定相关信息即可成为会员。"), "chengshixuanze" : MessageLookupByLibrary.simpleMessage("城市选择"), @@ -304,7 +305,8 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), - "main_menu3" : MessageLookupByLibrary.simpleMessage("我的"), + "main_menu3" : MessageLookupByLibrary.simpleMessage("社群"), + "main_menu4" : MessageLookupByLibrary.simpleMessage("我的"), "manlijiandaijinquan" : m17, "manyuankeyong" : m18, "meiriqiandao" : MessageLookupByLibrary.simpleMessage("每日签到"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 4955ede9..2674ccb0 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -125,6 +125,7 @@ class MessageLookup extends MessageLookupByLibrary { "chakanxiangqing" : MessageLookupByLibrary.simpleMessage("查看详情"), "changjianwenti" : MessageLookupByLibrary.simpleMessage("常见问题"), "changqiyouxiao" : MessageLookupByLibrary.simpleMessage("长期有效"), + "chaojiyouhuiquan" : MessageLookupByLibrary.simpleMessage("超值优惠券"), "chaungshirengushi" : MessageLookupByLibrary.simpleMessage("创始人故事"), "chenggongdengluzhuce" : MessageLookupByLibrary.simpleMessage("成功登录注册,并绑定相关信息即可成为会员。"), "chengshixuanze" : MessageLookupByLibrary.simpleMessage("城市选择"), @@ -304,7 +305,8 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), - "main_menu3" : MessageLookupByLibrary.simpleMessage("我的"), + "main_menu3" : MessageLookupByLibrary.simpleMessage("社群"), + "main_menu4" : MessageLookupByLibrary.simpleMessage("我的"), "manlijiandaijinquan" : m17, "manyuankeyong" : m18, "meiriqiandao" : MessageLookupByLibrary.simpleMessage("每日签到"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index b16610ba..4f01a1e7 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -125,6 +125,7 @@ class MessageLookup extends MessageLookupByLibrary { "chakanxiangqing" : MessageLookupByLibrary.simpleMessage("查看詳情"), "changjianwenti" : MessageLookupByLibrary.simpleMessage("常見問題"), "changqiyouxiao" : MessageLookupByLibrary.simpleMessage("長期有效"), + "chaojiyouhuiquan" : MessageLookupByLibrary.simpleMessage("超值优惠券"), "chaungshirengushi" : MessageLookupByLibrary.simpleMessage("創始人故事"), "chenggongdengluzhuce" : MessageLookupByLibrary.simpleMessage("成功登录注册,并绑定相关信息即可成为会员。"), "chengshixuanze" : MessageLookupByLibrary.simpleMessage("城市選擇"), @@ -304,7 +305,8 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"), "main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"), - "main_menu3" : MessageLookupByLibrary.simpleMessage("我的"), + "main_menu3" : MessageLookupByLibrary.simpleMessage("社群"), + "main_menu4" : MessageLookupByLibrary.simpleMessage("我的"), "manlijiandaijinquan" : m17, "manyuankeyong" : m18, "meiriqiandao" : MessageLookupByLibrary.simpleMessage("每日簽到"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 53548694..cd8c340c 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -125,6 +125,7 @@ class MessageLookup extends MessageLookupByLibrary { "chakanxiangqing" : MessageLookupByLibrary.simpleMessage("查看詳情"), "changjianwenti" : MessageLookupByLibrary.simpleMessage("常見問題"), "changqiyouxiao" : MessageLookupByLibrary.simpleMessage("長期有效"), + "chaojiyouhuiquan" : MessageLookupByLibrary.simpleMessage("超值优惠券"), "chaungshirengushi" : MessageLookupByLibrary.simpleMessage("創始人故事"), "chenggongdengluzhuce" : MessageLookupByLibrary.simpleMessage("成功登录注册,并绑定相关信息即可成为会员。"), "chengshixuanze" : MessageLookupByLibrary.simpleMessage("城市選擇"), @@ -304,7 +305,8 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"), "main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"), - "main_menu3" : MessageLookupByLibrary.simpleMessage("我的"), + "main_menu3" : MessageLookupByLibrary.simpleMessage("社群"), + "main_menu4" : MessageLookupByLibrary.simpleMessage("我的"), "manlijiandaijinquan" : m17, "manyuankeyong" : m18, "meiriqiandao" : MessageLookupByLibrary.simpleMessage("每日簽到"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index c4024160..34855b1d 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -185,16 +185,26 @@ class S { ); } - /// `我的` + /// `社群` String get main_menu3 { return Intl.message( - '我的', + '社群', name: 'main_menu3', desc: '', args: [], ); } + /// `我的` + String get main_menu4 { + return Intl.message( + '我的', + name: 'main_menu4', + desc: '', + args: [], + ); + } + /// `首页` String get shouye { return Intl.message( @@ -5125,6 +5135,16 @@ class S { ); } + /// `超值优惠券` + String get chaojiyouhuiquan { + return Intl.message( + '超值优惠券', + name: 'chaojiyouhuiquan', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 9d23ad22..983718a5 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -2,11 +2,17 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/home/home_view/coupon.dart'; +import 'package:huixiang/home/home_view/featured_acticvity.dart'; import 'package:huixiang/home/home_view/home_banner.dart'; import 'package:huixiang/home/home_view/home_integral_store.dart'; +import 'package:huixiang/home/home_view/quick_order.dart'; import 'package:huixiang/home/home_view/sign_view.dart'; +import 'package:huixiang/home/points_mall_view/points_goods_title.dart'; +import 'package:huixiang/home/points_mall_view/points_goods_view.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/banner.dart'; @@ -14,16 +20,15 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/founder.dart'; import 'package:huixiang/retrofit/data/goods.dart'; +import 'package:huixiang/retrofit/data/goods_category.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; - -import 'home_view/brand_view.dart'; -import 'home_view/founder_store.dart'; -import 'home_view/hot_article.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class HomePage extends StatefulWidget { final GestureTapCallback callback; @@ -55,6 +60,17 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { final SwiperController controller = SwiperController(); + String categoryId; + int pageNum = 1; + + //排序类型枚举:1-自然排序,2-销量,3-价格 + int orderType = 1; + + //是否降序排列 + bool orderDesc = true; + List goods = []; + List gooodsCategorys = []; + List bannerData = []; List brandData = []; List
articles = []; @@ -65,7 +81,8 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { EasyLoading.show(status: S.of(context).zhengzaijiazai); final SharedPreferences value = await SharedPreferences.getInstance(); - apiService = ApiService(Dio(), context: context, token: value.getString('token'), showLoading: false); + apiService = ApiService(Dio(), + context: context, token: value.getString('token'), showLoading: false); final BaseData brand = await apiService.queryHomeBrand().catchError((onError) { @@ -107,6 +124,60 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { gooods.addAll(goodsData.data.list); } + BaseData> dataCategory = + await apiService.goodsCategory({ + "current": 1, + "map": {}, + "model": {"pageNum": 1, "pageSize": 20, "searchKey": ""}, + "order": "descending", + "size": 20, + "sort": "sortOrder" + }).catchError((onError) { + refreshController.loadFailed(); + refreshController.refreshFailed(); + }); + + if (dataCategory != null && + dataCategory.isSuccess && + dataCategory.data != null && + dataCategory.data.records != null && + dataCategory.data.records.length > 0) { + gooodsCategorys.clear(); + gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu)); + gooodsCategorys.addAll(dataCategory.data.records); + } + + var param = { + "categoryId": categoryId ?? "", + "orderDesc": orderDesc, + "orderType": orderType, + "pageNum": pageNum, + "pageSize": 10, + "state": 1 + }; + BaseData> pageGoods = + await apiService.creditGoods(param).catchError((onError) { + refreshController.loadFailed(); + refreshController.refreshFailed(); + }); + EasyLoading.dismiss(); + if (pageGoods != null && pageGoods.isSuccess) { + if (pageNum == 1) { + goods.clear(); + } + goods.addAll(pageGoods.data.list); + refreshController.refreshCompleted(); + refreshController.loadComplete(); + if (pageGoods.data.pageNum == pageGoods.data.pages) { + refreshController.loadNoData(); + } else { + pageNum += 1; + } + } else { + refreshController.loadFailed(); + refreshController.refreshFailed(); + } + final BaseData> baseData = await apiService.queryBanner({ "model": {"type": "HOME_PAGE"}, @@ -127,8 +198,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { @override void dispose() { super.dispose(); - if (refreshController != null) - refreshController.dispose(); + if (refreshController != null) refreshController.dispose(); } final RefreshController refreshController = RefreshController(); @@ -136,46 +206,122 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { @override Widget build(BuildContext context) { super.build(context); - return Container( - child: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader(), - physics: BouncingScrollPhysics(), - onRefresh: () { - setState(() {}); - }, - child: SingleChildScrollView( - physics: NeverScrollableScrollPhysics(), - child: FutureBuilder( - future: queryHome(), - builder: (context, snapshot) { - return Column( - children: [ - ///banner - HomeBanner(bannerData, controller), - - ///签到 - SignView(), - - ///热门文章 - HotArticle(articles), - - ///创始人故事 - FounderStore(founder), - - ///品牌介绍 - BrandView(brandData), - - ///积分商城 - HomeIntegralStore(gooods, callback), - ], - ); - }, + return Column( + children: [ + MyAppBar( + title: "首页", + leading: false, + actions: [ + Container( + margin: EdgeInsets.only(right: 12.w), + child: GestureDetector( + onTap: () { + // Navigator.of(context).pushNamed('/router/system_msg_page'); + }, + child: SvgPicture.asset( + "assets/svg/tixing.svg", + width: 24, + height: 24, + ), + ), + ), + Container( + margin: EdgeInsets.only(right: 16.w), + child: GestureDetector( + onTap: () { + // Navigator.of(context).pushNamed('/router/system_msg_page'); + }, + child: SvgPicture.asset( + "assets/svg/saoyisao.svg", + width: 24, + height: 24, + ), + ), + ), + ], + ), + Expanded( + child: Container( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + onRefresh: () { + setState(() {}); + }, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: FutureBuilder( + future: queryHome(), + builder: (context, snapshot) { + return Column( + children: [ + ///banner + HomeBanner(bannerData, controller), + + ///签到 + SignView(), + + // ///热门文章 + // HotArticle(articles), + // ///创始人故事 + // FounderStore(founder), + // ///品牌介绍 + // BrandView(brandData), + + ///快捷下单 + QuickOrder(), + + CouponView(), + + ///积分商城 + HomeIntegralStore(gooods, callback), + + FeaturedActivity(), + + ///积分商品头Tab + PointsGoodsTitle( + gooodsCategorys, + (orderType, orderDesc) { + this.orderType = orderType; + this.orderDesc = orderDesc; + setState(() {}); + }, + (index) { + categoryId = gooodsCategorys[index].id; + pageNum = 1; + setState(() {}); + }, + ), + + ///积分商品列表 + PointGoods( + goods, + (index) { + _toDetails(index); + }, + ), + ], + ); + }, + ), + ), + ), ), ), - ), + SizedBox( + height: 76.h, + ), + ], + ); + } + + _toDetails(index) async { + Navigator.of(context).pushNamed( + '/router/integral_store_page', + arguments: {"goodsId": goods[index].id}, ); } diff --git a/lib/home/home_view/coupon.dart b/lib/home/home_view/coupon.dart new file mode 100644 index 00000000..dad9e698 --- /dev/null +++ b/lib/home/home_view/coupon.dart @@ -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 createState() { + return _CouponView(); + } +} + +class _CouponView extends State { + @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, + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/home/home_view/featured_acticvity.dart b/lib/home/home_view/featured_acticvity.dart new file mode 100644 index 00000000..8d90ff3f --- /dev/null +++ b/lib/home/home_view/featured_acticvity.dart @@ -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 createState() { + return _FeaturedActivity(); + } +} + +class _FeaturedActivity extends State { + @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, + ), + ], + ), + ), + ], + ); + } +} diff --git a/lib/home/home_view/home_integral_store.dart b/lib/home/home_view/home_integral_store.dart index 1ed0bcfd..652b349e 100644 --- a/lib/home/home_view/home_integral_store.dart +++ b/lib/home/home_view/home_integral_store.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/goods.dart'; @@ -10,7 +9,6 @@ import 'package:huixiang/view_widget/item_title.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class HomeIntegralStore extends StatefulWidget { - final GestureTapCallback callback; final List gooods; @@ -20,7 +18,6 @@ class HomeIntegralStore extends StatefulWidget { State createState() { return _HomeIntegralStore(); } - } class _HomeIntegralStore extends State { @@ -28,8 +25,12 @@ class _HomeIntegralStore extends State { Widget build(BuildContext context) { return Container( margin: EdgeInsets.only( - left: 16.5.w, right: 16.5.w, bottom: 40.h, top: 10.h), - padding: EdgeInsets.only(bottom: 10.h, top: 16.h), + left: 16.5.w, + right: 16.5.w, + bottom: 20.h, + top: 10.h, + ), + padding: EdgeInsets.only(bottom: 3.h, top: 16.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), boxShadow: [ @@ -38,59 +39,64 @@ class _HomeIntegralStore extends State { offset: Offset(0, 3), blurRadius: 14, spreadRadius: 0, - ) + ), ], color: Colors.white, ), child: Column( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: ItemTitle( - text: S.of(context).jifenshangcheng, - imgPath: "assets/image/icon_points_mall.png", - ), - ), - GestureDetector( - onTap: widget.callback, - child: Container( - padding: EdgeInsets.symmetric( - vertical: 3.h, horizontal: 8.w,), - margin: EdgeInsets.only(right: 16.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11.5), - color: Color(0xFF32A060), - ), - child: Row( - children: [ - Text( - "GO", - style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - Icon( - Icons.chevron_right, - color: Colors.white, - size: 18, - ), - ], - ), - ), - ), - ], + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Expanded( + // flex: 1, + // child: ItemTitle( + // text: S.of(context).jifenshangcheng, + // imgPath: "assets/image/icon_points_mall.png", + // ), + // ), + // GestureDetector( + // onTap: widget.callback, + // child: Container( + // padding: EdgeInsets.symmetric( + // vertical: 3.h, + // horizontal: 8.w, + // ), + // margin: EdgeInsets.only(right: 16.w), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(11.5), + // color: Color(0xFF32A060), + // ), + // child: Row( + // children: [ + // Text( + // "GO", + // style: TextStyle( + // fontSize: 14.sp, + // fontWeight: FontWeight.bold, + // color: Colors.white, + // ), + // ), + // Icon( + // Icons.chevron_right, + // color: Colors.white, + // size: 18, + // ), + // ], + // ), + // ), + // ), + // ], + // ), + ItemTitle( + text: "大家都在兑换", + imgPath: "assets/image/icon_points_mall.png", ), SizedBox( height: 14.h, ), Divider( - // indent: 0.0, thickness: 1, color: Color(0xffF2F2F2), ), @@ -102,7 +108,9 @@ class _HomeIntegralStore extends State { Widget integralStore() { return GridView.builder( - itemCount: (widget.gooods != null && widget.gooods.length > 0) ? (widget.gooods.length > 2 ? 2 : widget.gooods.length) : 0, + itemCount: (widget.gooods != null && widget.gooods.length > 0) + ? (widget.gooods.length > 2 ? 2 : widget.gooods.length) + : 0, padding: EdgeInsets.all(13.w), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), @@ -130,7 +138,6 @@ class _HomeIntegralStore extends State { ); } - Widget buildItem(Goods goods) { return Container( alignment: Alignment.center, @@ -201,5 +208,4 @@ class _HomeIntegralStore extends State { ), ); } - } diff --git a/lib/home/home_view/quick_order.dart b/lib/home/home_view/quick_order.dart new file mode 100644 index 00000000..5895d099 --- /dev/null +++ b/lib/home/home_view/quick_order.dart @@ -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 createState() { + return _QuickOrder(); + } +} + +class _QuickOrder extends State { + @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, + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/home/home_view/sign_view.dart b/lib/home/home_view/sign_view.dart index a3e4dcf0..e595cd34 100644 --- a/lib/home/home_view/sign_view.dart +++ b/lib/home/home_view/sign_view.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/item_title.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; @@ -14,7 +13,7 @@ class SignView extends StatelessWidget { return Column( children: [ SizedBox( - height: 20.h, + height: 10.h, ), ItemTitle( text: S.of(context).jinrihuiyuanrenwu, diff --git a/lib/home/points_mall_view/points_goods_title.dart b/lib/home/points_mall_view/points_goods_title.dart index 89617030..a28e59c3 100644 --- a/lib/home/points_mall_view/points_goods_title.dart +++ b/lib/home/points_mall_view/points_goods_title.dart @@ -2,15 +2,19 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/goods_category.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/my_tab.dart'; class PointsGoodsTitle extends StatefulWidget { final ValueChanged onTap; final Function(int orderType, bool orderDesc) sortChange; final List gooodsCategorys; - PointsGoodsTitle(this.gooodsCategorys, this.sortChange, this.onTap); + PointsGoodsTitle( + this.gooodsCategorys, + this.sortChange, + this.onTap, + ); @override State createState() { @@ -19,7 +23,6 @@ class PointsGoodsTitle extends StatefulWidget { } class _PointsGoodsTitle extends State { - var _itemText = S.current.morenpaixu; List sortString = [ S.current.morenpaixu, @@ -27,32 +30,39 @@ class _PointsGoodsTitle extends State { S.current.jifendidaogao, ]; + @override + void initState() { + super.initState(); + } + @override Widget build(BuildContext context) { return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - ItemTitle( - text: S.of(context).jifenshangcheng, - imgPath: "assets/image/icon_points_mall.png", - moreText: _itemText, - moreType: 1, - items: sortString - .map( - (e) => DropdownMenuItem( - value: e, - child: Text( - e, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xff353535), - ), - ), - ), - ) - .toList(), - onChanged: _sortChange, - ), + // ItemTitle( + // text: S.of(context).jifenshangcheng, + // imgPath: "assets/image/icon_points_mall.png", + // moreText: _itemText, + // moreType: 1, + // items: sortString + // .map( + // (e) => DropdownMenuItem( + // value: e, + // child: Text( + // e, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xff353535), + // ), + // ), + // ), + // ) + // .toList(), + // onChanged: _sortChange, + // ), Container( alignment: Alignment.centerLeft, child: DefaultTabController( @@ -80,12 +90,52 @@ class _PointsGoodsTitle extends State { tabs: widget.gooodsCategorys == null ? [] : widget.gooodsCategorys - .map((e) => Tab(text: e.name)) + .map((e) => MyTab(text: e.name)) .toList(), onTap: widget.onTap, ), ), ), + Container( + width: 124.w, + height: 32.h, + margin: EdgeInsets.only(left: 20.w, top: 10), + color: Colors.white, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + width: 104.w, + height: 32.h, + color: Colors.white, + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: DropdownButton( + items: sortString + .map( + (e) => DropdownMenuItem( + value: e, + child: Text( + e, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xff353535), + ), + ), + ), + ) + .toList(), + value: _itemText, + itemHeight: 50, + onChanged: _sortChange, + style: TextStyle(), + ), + ), + ], + ), + ), ], ); } @@ -107,5 +157,4 @@ class _PointsGoodsTitle extends State { _itemText = item; }); } - } diff --git a/lib/integral/intergra_view/integral_task.dart b/lib/integral/intergra_view/integral_task.dart index d8156b84..637b0959 100644 --- a/lib/integral/intergra_view/integral_task.dart +++ b/lib/integral/intergra_view/integral_task.dart @@ -1,12 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/sign_info.dart'; import 'package:huixiang/retrofit/data/task.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; class IntegralTask extends StatefulWidget { diff --git a/lib/integral/intergra_view/integral_vip.dart b/lib/integral/intergra_view/integral_vip.dart index 451e0ef7..e465bc1e 100644 --- a/lib/integral/intergra_view/integral_vip.dart +++ b/lib/integral/intergra_view/integral_vip.dart @@ -3,7 +3,6 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/sign_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/utils/font_weight.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class IntegralVip extends StatefulWidget { diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 2b8c93ca..0fcd825a 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -14,7 +14,8 @@ "privacy_policy3": "《隐私服务》", "main_menu1": "净弼", "main_menu2": "联盟", - "main_menu3": "我的", + "main_menu3": "社群", + "main_menu4": "我的", "shouye": "首页", "huodongliebiao": "活动列表", "jifenshangcheng": "积分商城", @@ -532,6 +533,7 @@ "huiyuanjia": "会员价", "yuanjia": "原价", "xuanguige": "选规格", + "chaojiyouhuiquan": "超值优惠券", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 34e76b93..7184477d 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -14,7 +14,8 @@ "privacy_policy3": "《隐私服务》", "main_menu1": "净弼", "main_menu2": "联盟", - "main_menu3": "我的", + "main_menu3": "社群", + "main_menu4": "我的", "shouye": "首页", "huodongliebiao": "活动列表", "jifenshangcheng": "积分商城", @@ -532,6 +533,7 @@ "huiyuanjia": "会员价", "yuanjia": "原价", "xuanguige": "选规格", + "chaojiyouhuiquan": "超值优惠券", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index af4f27fe..5b337403 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -14,7 +14,8 @@ "privacy_policy3": "《隐私服务》", "main_menu1": "净弼", "main_menu2": "联盟", - "main_menu3": "我的", + "main_menu3": "社群", + "main_menu4": "我的", "shouye": "首页", "huodongliebiao": "活动列表", "jifenshangcheng": "积分商城", @@ -532,6 +533,7 @@ "huiyuanjia": "会员价", "yuanjia": "原价", "xuanguige": "选规格", + "chaojiyouhuiquan": "超值优惠券", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 89980a93..4bea15d5 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -14,7 +14,8 @@ "privacy_policy3": "《隱私服務》", "main_menu1": "淨弼", "main_menu2": "聯盟", - "main_menu3": "我的", + "main_menu3": "社群", + "main_menu4": "我的", "shouye": "首頁", "huodongliebiao": "活動列表", "jifenshangcheng": "積分商城", @@ -527,6 +528,7 @@ "huiyuanjia": "會員價", "yuanjia": "原價", "xuanguige": "選規格", + "chaojiyouhuiquan": "超值优惠券", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 3a28318d..010f674f 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -14,7 +14,8 @@ "privacy_policy3": "《隱私服務》", "main_menu1": "淨弼", "main_menu2": "聯盟", - "main_menu3": "我的", + "main_menu3": "社群", + "main_menu4": "我的", "shouye": "首頁", "huodongliebiao": "活動列表", "jifenshangcheng": "積分商城", @@ -526,6 +527,7 @@ "huiyuanjia": "會員價", "yuanjia": "原價", "xuanguige": "選規格", + "chaojiyouhuiquan": "超值优惠券", diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 10072fce..10e95e7c 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -22,7 +22,6 @@ import 'package:huixiang/view_widget/round_button.dart'; import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:sharesdk_plugin/sharesdk_interface.dart'; -import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; class LoginPage extends StatefulWidget { final Map arguments; diff --git a/lib/main_page.dart b/lib/main_page.dart index 5a432a99..e1239a74 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -3,9 +3,10 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:huixiang/community/community_page.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/home/huixiang_brand_page.dart'; -import 'package:huixiang/home/main_home_page.dart'; +import 'package:huixiang/home/home_page.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_page.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -32,7 +33,7 @@ class _MainPage extends State with WidgetsBindingObserver { List _widgetOptions; List icons; - List iconn; + // List iconn; @override void dispose() { @@ -76,24 +77,26 @@ class _MainPage extends State with WidgetsBindingObserver { pushRoute(); _widgetOptions = [ - BrandPage(), - MainHomePage(), + // BrandPage(), + HomePage(() {}), + // MainHomePage(), UnionPage(), + CommunityPage(), MinePage(), ]; icons = [ - "assets/image/icon_brand_s.png", - "assets/image/icon_bi_s.png", - "assets/image/icon_meng_s.png", - "assets/image/icon_wo_s.png", - ]; - iconn = [ - "assets/image/icon_brand_n.png", - "assets/image/icon_bi_n.png", - "assets/image/icon_meng_n.png", - "assets/image/icon_wo_n.png", + "assets/svg/jingbi.svg", + "assets/svg/lianmeng.svg", + "assets/svg/shequn.svg", + "assets/svg/wode.svg", ]; + // iconn = [ + // "assets/image/icon_brand_n.png", + // "assets/image/icon_bi_n.png", + // "assets/image/icon_meng_n.png", + // "assets/image/icon_wo_n.png", + // ]; eventBus.on().listen((event) { if (event.type < 3) { @@ -265,10 +268,11 @@ class _MainPage extends State with WidgetsBindingObserver { mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - bottomNavigationBigItem(S.of(context).pinpai, 0), - bottomNavigationItem(S.of(context).main_menu1, 1), - bottomNavigationItem(S.of(context).main_menu2, 2), - bottomNavigationItem(S.of(context).main_menu3, 3), + // bottomNavigationBigItem(S.of(context).pinpai, 0), + bottomNavigationItem(S.of(context).main_menu1, 0), + bottomNavigationItem(S.of(context).main_menu2, 1), + bottomNavigationItem(S.of(context).main_menu3, 2), + bottomNavigationItem(S.of(context).main_menu4, 3), ], ), ), @@ -302,23 +306,36 @@ class _MainPage extends State with WidgetsBindingObserver { SizedBox( height: 4.h, ), - AnimatedCrossFade( - firstChild: Image.asset( - icons[index], - width: 30, - height: 30, - fit: BoxFit.contain, - ), - secondChild: Image.asset( - iconn[index], - width: 30, - height: 30, - fit: BoxFit.contain, - ), - crossFadeState: isSelected - ? CrossFadeState.showFirst - : CrossFadeState.showSecond, - duration: Duration(milliseconds: 200), + // AnimatedCrossFade( + // firstChild: SvgPicture.asset( + // icons[index], + // width: 30, + // height: 30, + // fit: BoxFit.contain, + // ), + // // Image.asset( + // // icons[index], + // // width: 30, + // // height: 30, + // // fit: BoxFit.contain, + // // ), + // secondChild: Image.asset( + // iconn[index], + // width: 30, + // height: 30, + // fit: BoxFit.contain, + // ), + // crossFadeState: isSelected + // ? CrossFadeState.showFirst + // : CrossFadeState.showSecond, + // duration: Duration(milliseconds: 200), + // ), + SvgPicture.asset( + icons[index], + width: 30, + height: 30, + color: isSelected ? Color(0xFF32A060) : Color(0xFFE6E6E6), + fit: BoxFit.contain, ), Text( text, @@ -336,72 +353,72 @@ class _MainPage extends State with WidgetsBindingObserver { ); } - Widget bottomNavigationBigItem(text, index) { - var isSelected = index == clickIndex; - return Expanded( - child: InkWell( - onTap: () { - setState(() { - clickIndex = index; - pageController.jumpToPage(clickIndex); - }); - }, - child: Container( - width: 45.w, - alignment: Alignment.center, - child: AnimatedCrossFade( - firstCurve: Curves.easeIn, - secondCurve: Curves.ease, - sizeCurve: Curves.easeInOut, - duration: Duration(milliseconds: 50), - firstChild: Container( - padding: EdgeInsets.all(4), - height: 82.h, - alignment: - Platform.isAndroid ? Alignment.center : Alignment.topCenter, - child: Image.asset( - icons[index], - width: 45, - height: 45, - fit: BoxFit.contain, - ), - ), - secondChild: Column( - mainAxisAlignment: Platform.isAndroid - ? MainAxisAlignment.center - : MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - if (Platform.isIOS) - SizedBox( - height: 4.h, - ), - Image.asset( - iconn[index], - width: 30, - height: 30, - fit: BoxFit.contain, - ), - SizedBox( - height: 1.h, - ), - Text( - text, - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), - ), - ), - ], - ), - crossFadeState: isSelected - ? CrossFadeState.showFirst - : CrossFadeState.showSecond, - ), - ), - ), - flex: 1, - ); - } + // Widget bottomNavigationBigItem(text, index) { + // var isSelected = index == clickIndex; + // return Expanded( + // child: InkWell( + // onTap: () { + // setState(() { + // clickIndex = index; + // pageController.jumpToPage(clickIndex); + // }); + // }, + // child: Container( + // width: 45.w, + // alignment: Alignment.center, + // child: AnimatedCrossFade( + // firstCurve: Curves.easeIn, + // secondCurve: Curves.ease, + // sizeCurve: Curves.easeInOut, + // duration: Duration(milliseconds: 50), + // firstChild: Container( + // padding: EdgeInsets.all(4), + // height: 82.h, + // alignment: + // Platform.isAndroid ? Alignment.center : Alignment.topCenter, + // child: Image.asset( + // icons[index], + // width: 45, + // height: 45, + // fit: BoxFit.contain, + // ), + // ), + // secondChild: Column( + // mainAxisAlignment: Platform.isAndroid + // ? MainAxisAlignment.center + // : MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // if (Platform.isIOS) + // SizedBox( + // height: 4.h, + // ), + // Image.asset( + // iconn[index], + // width: 30, + // height: 30, + // fit: BoxFit.contain, + // ), + // SizedBox( + // height: 1.h, + // ), + // Text( + // text, + // style: TextStyle( + // fontSize: 10.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(isSelected ? 0xFF4C4C4C : 0xFFA29E9E), + // ), + // ), + // ], + // ), + // crossFadeState: isSelected + // ? CrossFadeState.showFirst + // : CrossFadeState.showSecond, + // ), + // ), + // ), + // flex: 1, + // ); + // } } diff --git a/lib/retrofit/data/findMiNiGroupList.dart b/lib/retrofit/data/findMiNiGroupList.dart index 5f2716c1..54e65c27 100644 --- a/lib/retrofit/data/findMiNiGroupList.dart +++ b/lib/retrofit/data/findMiNiGroupList.dart @@ -23,7 +23,7 @@ class FindMiNiGroupList { findMiNiGroupListBean.groupName = map['groupName']; findMiNiGroupListBean.groupImg = map['groupImg']; findMiNiGroupListBean.sort = map['sort']; - findMiNiGroupListBean.productList = List()..addAll( + findMiNiGroupListBean.productList = []..addAll( (map['productList'] as List ?? []).map((o) => ProductListBean.fromJson(o)) ); findMiNiGroupListBean.productPageVO = map['productPageVO']; diff --git a/lib/retrofit/data/logistics.dart b/lib/retrofit/data/logistics.dart index 73a18902..ad48f765 100644 --- a/lib/retrofit/data/logistics.dart +++ b/lib/retrofit/data/logistics.dart @@ -18,7 +18,7 @@ class Logistics { logisticsBean.shipperCode = map['shipperCode']; logisticsBean.state = map['state']; logisticsBean.success = map['success']; - logisticsBean.traces = List()..addAll( + logisticsBean.traces = []..addAll( (map['traces'] as List ?? []).map((o) => TracesBean.fromMap(o)) ); return logisticsBean; diff --git a/lib/retrofit/data/shoppingCart.dart b/lib/retrofit/data/shoppingCart.dart index 06a62c30..72673c63 100644 --- a/lib/retrofit/data/shoppingCart.dart +++ b/lib/retrofit/data/shoppingCart.dart @@ -79,7 +79,7 @@ class ShoppingCartSkuItemListBean { shoppingCartSkuItemListBean.createTime = map['createTime']; shoppingCartSkuItemListBean.groupId = map['groupId']; shoppingCartSkuItemListBean.id = map['id']; - shoppingCartSkuItemListBean.platterList = List()..addAll( + shoppingCartSkuItemListBean.platterList = []..addAll( (map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJson(o)) ); shoppingCartSkuItemListBean.productId = map['productId']; diff --git a/lib/retrofit/data/vip_card.dart b/lib/retrofit/data/vip_card.dart index 4142de74..44b2a331 100644 --- a/lib/retrofit/data/vip_card.dart +++ b/lib/retrofit/data/vip_card.dart @@ -91,7 +91,7 @@ class VipCard { vipCardBean.vipRegStore = map['vipRegStore']; vipCardBean.tenantName = map['tenantName']; vipCardBean.tenantLogo = map['tenantLogo']; - vipCardBean.storeList = List()..addAll( + vipCardBean.storeList = []..addAll( (map['storeList'] as List ?? []).map((o) => StoreListBean.fromMap(o)) ); return vipCardBean; diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index e7768863..0bd28e56 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -10,7 +10,6 @@ import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; -import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index 179f09a5..a29793d4 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; diff --git a/lib/store/store_view/settlement.dart b/lib/store/store_view/settlement.dart index 0d69992b..3e679d3d 100644 --- a/lib/store/store_view/settlement.dart +++ b/lib/store/store_view/settlement.dart @@ -8,7 +8,6 @@ import 'package:huixiang/order/order_view/order_info.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; -import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/store/store_view/settlement_order_commodity.dart'; diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index 446de7b0..b2ce482f 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -40,6 +40,7 @@ class _ShopGoods extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, children: [ SizedBox(width: 12.w), MImage( diff --git a/lib/store/store_view/store_activity.dart b/lib/store/store_view/store_activity.dart index 4bf0e441..1c2d26e5 100644 --- a/lib/store/store_view/store_activity.dart +++ b/lib/store/store_view/store_activity.dart @@ -30,8 +30,11 @@ class _StoreActivity extends State { ) : Container( width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, - margin: EdgeInsets.only(top: 160.h), + height: MediaQuery.of(context).size.height - + (kToolbarHeight + 38 + 54.h), + margin: EdgeInsets.only( + top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight), + ), color: Colors.white, child: Swiper( viewportFraction: 0.95, @@ -44,17 +47,19 @@ class _StoreActivity extends State { widget.activitys[position].id) { Navigator.of(context).pop(); } else { - Navigator.of(context).pushNamed('/router/web_page', - arguments: { - "activityId": widget.activitys[position].id, - "source": widget.arguments["id"] - }); + Navigator.of(context).pushNamed( + '/router/web_page', + arguments: { + "activityId": widget.activitys[position].id, + "source": widget.arguments["id"] + }, + ); } }, child: Container( margin: EdgeInsets.symmetric(horizontal: 5.w), decoration: BoxDecoration( - // color: Colors.white, + color: Colors.white, borderRadius: BorderRadius.circular(8), boxShadow: [ BoxShadow( diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index b4ed9754..02d02cd3 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -87,8 +87,7 @@ class _StoreOrderListPage extends State { Widget build(BuildContext context) { return Container( width: MediaQuery.of(context).size.width, - height: - MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h), + height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h), margin: EdgeInsets.only( top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight), ), @@ -113,8 +112,7 @@ class _StoreOrderListPage extends State { width: MediaQuery.of(context).size.width - 100.w, child: ListView.builder( itemCount: productListBeans == null - ? 0 - : productListBeans.length, + ? 0 : productListBeans.length, physics: BouncingScrollPhysics(), padding: EdgeInsets.zero, itemBuilder: (context, position) { diff --git a/lib/union/union_view/store_activity.dart b/lib/union/union_view/store_activity.dart index 147431ad..29d9b780 100644 --- a/lib/union/union_view/store_activity.dart +++ b/lib/union/union_view/store_activity.dart @@ -7,7 +7,6 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.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 StoreActivity extends StatefulWidget { diff --git a/lib/view_widget/classic_header.dart b/lib/view_widget/classic_header.dart index 6cca75ff..1bb7cccc 100644 --- a/lib/view_widget/classic_header.dart +++ b/lib/view_widget/classic_header.dart @@ -1,7 +1,4 @@ -import 'package:flare_flutter/flare_actor.dart'; -import 'package:flare_flutter/flare_controller.dart'; import 'package:flare_flutter/flare_controls.dart'; -import 'package:flare_flutter/provider/asset_flare.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart' diff --git a/lib/view_widget/comment_menu.dart b/lib/view_widget/comment_menu.dart index fb0d4c10..8113385b 100644 --- a/lib/view_widget/comment_menu.dart +++ b/lib/view_widget/comment_menu.dart @@ -2,7 +2,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; -import 'package:huixiang/view_widget/separator.dart'; class CommentMenu extends StatefulWidget { final bool isSelf; diff --git a/lib/view_widget/item_title.dart b/lib/view_widget/item_title.dart index 7a7fa3bf..8d9795a7 100644 --- a/lib/view_widget/item_title.dart +++ b/lib/view_widget/item_title.dart @@ -13,19 +13,23 @@ class ItemTitle extends StatelessWidget { final String moreText; final List> items; - ItemTitle( - {this.text, - this.imgPath, - this.moreText = "", - this.moreType = 0, - this.items, - this.onChanged, - this.onTap}); + ItemTitle({ + this.text, + this.imgPath, + this.moreText = "", + this.moreType = 0, + this.items, + this.onChanged, + this.onTap, + }); @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(left: 16.w, right: 17.w,), + margin: EdgeInsets.only( + left: 16.w, + right: 17.w, + ), alignment: Alignment.center, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -69,33 +73,39 @@ class ItemTitle extends StatelessWidget { ? GestureDetector( onTap: onTap, child: Container( - padding: - EdgeInsets.only(left: 8.w, right: 8.w, top: 2.h, bottom: 2.h), + padding: EdgeInsets.only( + left: 8.w, + right: 8.w, + top: 2.h, + bottom: 2.h, + ), decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(25), - offset: Offset(0, 1), - blurRadius: 12, - spreadRadius: 0) - ], - borderRadius: BorderRadius.all(Radius.circular(2))), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(25), + offset: Offset(0, 1), + blurRadius: 12, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(2), + ), child: Row( children: [ Text( moreText, style: TextStyle( fontSize: 12.sp, - fontWeight: FontWeight.w400 + fontWeight: FontWeight.w400, ), ), Icon( moreType == 0 ? Icons.keyboard_arrow_right - : (Icons.keyboard_arrow_down), + : Icons.keyboard_arrow_down, size: 16, - ) + ), ], ), ), diff --git a/lib/view_widget/my_appbar.dart b/lib/view_widget/my_appbar.dart index 25145892..aa421290 100644 --- a/lib/view_widget/my_appbar.dart +++ b/lib/view_widget/my_appbar.dart @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; class MyAppBar extends StatelessWidget implements PreferredSizeWidget { final Function onTap; final Widget action; + List actions; final Widget bottom; final Widget titleChild; final String title; @@ -20,6 +21,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { Key key, this.onTap, this.action, + this.actions, this.bottom, this.titleChild, this.title, @@ -31,7 +33,21 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { this.brightness = Brightness.light, this.leading = true, }) : preferredSize = Size.fromHeight(toolbarHeight ?? kToolbarHeight), - super(key: key); + super(key: key) { + if (actions == null) + actions = []; + if (action != null) { + actions.add( + Container( + margin: EdgeInsets.only(right: 15), + child: GestureDetector( + onTap: onTap, + child: action, + ), + ), + ); + } + } @override Widget build(BuildContext context) { @@ -39,21 +55,23 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { backgroundColor: background, elevation: 0, brightness: brightness, - leading: leading ? GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: leadingColor, - size: 24, - ), - ), - ) : Container(), + leading: leading + ? GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + alignment: Alignment.centerRight, + margin: EdgeInsets.only(left: 10), + padding: EdgeInsets.all(6), + child: Icon( + Icons.arrow_back_ios, + color: leadingColor, + size: 24, + ), + ), + ) + : Container(), titleSpacing: 2, centerTitle: false, leadingWidth: leading ? 56 : 10.w, @@ -67,16 +85,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { fontSize: titleSize, ), ), - actions: [ - if (action != null) - Container( - margin: EdgeInsets.only(right: 15), - child: GestureDetector( - onTap: onTap, - child: action, - ), - ) - ], + actions: actions, bottom: bottom, ); } diff --git a/lib/view_widget/store_title_tab.dart b/lib/view_widget/store_title_tab.dart index 08c6e48a..81a891a0 100644 --- a/lib/view_widget/store_title_tab.dart +++ b/lib/view_widget/store_title_tab.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart index 13a791cf..edb3ce76 100644 --- a/lib/web/web_view/comment_list.dart +++ b/lib/web/web_view/comment_list.dart @@ -9,7 +9,6 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/member_comment_list.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; -import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/comment_menu.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart index 65d1b5ab..2469f0a0 100644 --- a/lib/web/web_view/web_content.dart +++ b/lib/web/web_view/web_content.dart @@ -1,7 +1,6 @@ import 'package:chewie/chewie.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/image_render.dart'; import 'package:chewie/src/chewie_progress_colors.dart' as chewie;