diff --git a/assets/image/2x/goods_cart.png b/assets/image/2x/goods_cart.png new file mode 100644 index 00000000..2569ec2d Binary files /dev/null and b/assets/image/2x/goods_cart.png differ diff --git a/assets/image/2x/goods_phone.png b/assets/image/2x/goods_phone.png new file mode 100644 index 00000000..1d6727c4 Binary files /dev/null and b/assets/image/2x/goods_phone.png differ diff --git a/assets/image/2x/jg.png b/assets/image/2x/jg.png new file mode 100644 index 00000000..6697416d Binary files /dev/null and b/assets/image/2x/jg.png differ diff --git a/assets/image/2x/kan_jia.png b/assets/image/2x/kan_jia.png new file mode 100644 index 00000000..0847c09d Binary files /dev/null and b/assets/image/2x/kan_jia.png differ diff --git a/assets/image/2x/ms.png b/assets/image/2x/ms.png new file mode 100644 index 00000000..86889ee9 Binary files /dev/null and b/assets/image/2x/ms.png differ diff --git a/assets/image/2x/ms_t.png b/assets/image/2x/ms_t.png new file mode 100644 index 00000000..3f152f26 Binary files /dev/null and b/assets/image/2x/ms_t.png differ diff --git a/assets/image/2x/pin_t.png b/assets/image/2x/pin_t.png new file mode 100644 index 00000000..3543465a Binary files /dev/null and b/assets/image/2x/pin_t.png differ diff --git a/assets/image/2x/pin_tuan.png b/assets/image/2x/pin_tuan.png new file mode 100644 index 00000000..77c13d09 Binary files /dev/null and b/assets/image/2x/pin_tuan.png differ diff --git a/assets/image/2x/shopping_cart.png b/assets/image/2x/shopping_cart.png new file mode 100644 index 00000000..80a684ff Binary files /dev/null and b/assets/image/2x/shopping_cart.png differ diff --git a/assets/image/2x/shopping_cart_h.png b/assets/image/2x/shopping_cart_h.png new file mode 100644 index 00000000..10f4d57c Binary files /dev/null and b/assets/image/2x/shopping_cart_h.png differ diff --git a/assets/image/2x/shopping_home.png b/assets/image/2x/shopping_home.png new file mode 100644 index 00000000..267bfeb4 Binary files /dev/null and b/assets/image/2x/shopping_home.png differ diff --git a/assets/image/2x/shopping_home_h.png b/assets/image/2x/shopping_home_h.png new file mode 100644 index 00000000..9cc7f114 Binary files /dev/null and b/assets/image/2x/shopping_home_h.png differ diff --git a/assets/image/2x/wx.png b/assets/image/2x/wx.png new file mode 100644 index 00000000..4a8cb22c Binary files /dev/null and b/assets/image/2x/wx.png differ diff --git a/assets/image/2x/yq_zt.png b/assets/image/2x/yq_zt.png new file mode 100644 index 00000000..46e80140 Binary files /dev/null and b/assets/image/2x/yq_zt.png differ diff --git a/assets/image/2x/zt_m.png b/assets/image/2x/zt_m.png new file mode 100644 index 00000000..2bbe9eda Binary files /dev/null and b/assets/image/2x/zt_m.png differ diff --git a/assets/image/2x/zt_zf.png b/assets/image/2x/zt_zf.png new file mode 100644 index 00000000..fa99acf2 Binary files /dev/null and b/assets/image/2x/zt_zf.png differ diff --git a/assets/image/2x/zu_tuan.png b/assets/image/2x/zu_tuan.png new file mode 100644 index 00000000..011db486 Binary files /dev/null and b/assets/image/2x/zu_tuan.png differ diff --git a/assets/image/3x/goods_cart.png b/assets/image/3x/goods_cart.png new file mode 100644 index 00000000..34339a8f Binary files /dev/null and b/assets/image/3x/goods_cart.png differ diff --git a/assets/image/3x/goods_phone.png b/assets/image/3x/goods_phone.png new file mode 100644 index 00000000..051e4a20 Binary files /dev/null and b/assets/image/3x/goods_phone.png differ diff --git a/assets/image/3x/jg.png b/assets/image/3x/jg.png new file mode 100644 index 00000000..4c9c610b Binary files /dev/null and b/assets/image/3x/jg.png differ diff --git a/assets/image/3x/kan_jia.png b/assets/image/3x/kan_jia.png new file mode 100644 index 00000000..543944e8 Binary files /dev/null and b/assets/image/3x/kan_jia.png differ diff --git a/assets/image/3x/ms.png b/assets/image/3x/ms.png new file mode 100644 index 00000000..98f6aa3e Binary files /dev/null and b/assets/image/3x/ms.png differ diff --git a/assets/image/3x/ms_t.png b/assets/image/3x/ms_t.png new file mode 100644 index 00000000..55332b74 Binary files /dev/null and b/assets/image/3x/ms_t.png differ diff --git a/assets/image/3x/pin_t.png b/assets/image/3x/pin_t.png new file mode 100644 index 00000000..cbe7701a Binary files /dev/null and b/assets/image/3x/pin_t.png differ diff --git a/assets/image/3x/pin_tuan.png b/assets/image/3x/pin_tuan.png new file mode 100644 index 00000000..6990ee29 Binary files /dev/null and b/assets/image/3x/pin_tuan.png differ diff --git a/assets/image/3x/shopping_cart.png b/assets/image/3x/shopping_cart.png new file mode 100644 index 00000000..9b902ce2 Binary files /dev/null and b/assets/image/3x/shopping_cart.png differ diff --git a/assets/image/3x/shopping_cart_h.png b/assets/image/3x/shopping_cart_h.png new file mode 100644 index 00000000..5d3e017f Binary files /dev/null and b/assets/image/3x/shopping_cart_h.png differ diff --git a/assets/image/3x/shopping_home.png b/assets/image/3x/shopping_home.png new file mode 100644 index 00000000..3a195e71 Binary files /dev/null and b/assets/image/3x/shopping_home.png differ diff --git a/assets/image/3x/shopping_home_h.png b/assets/image/3x/shopping_home_h.png new file mode 100644 index 00000000..9d59d24a Binary files /dev/null and b/assets/image/3x/shopping_home_h.png differ diff --git a/assets/image/3x/wx.png b/assets/image/3x/wx.png new file mode 100644 index 00000000..cc0f160b Binary files /dev/null and b/assets/image/3x/wx.png differ diff --git a/assets/image/3x/yq_zt.png b/assets/image/3x/yq_zt.png new file mode 100644 index 00000000..a2f26596 Binary files /dev/null and b/assets/image/3x/yq_zt.png differ diff --git a/assets/image/3x/zt_m.png b/assets/image/3x/zt_m.png new file mode 100644 index 00000000..593de4c6 Binary files /dev/null and b/assets/image/3x/zt_m.png differ diff --git a/assets/image/3x/zt_zf.png b/assets/image/3x/zt_zf.png new file mode 100644 index 00000000..2317bed0 Binary files /dev/null and b/assets/image/3x/zt_zf.png differ diff --git a/assets/image/3x/zu_tuan.png b/assets/image/3x/zu_tuan.png new file mode 100644 index 00000000..c523aa9e Binary files /dev/null and b/assets/image/3x/zu_tuan.png differ diff --git a/assets/image/goods_cart.png b/assets/image/goods_cart.png new file mode 100644 index 00000000..7be4c8eb Binary files /dev/null and b/assets/image/goods_cart.png differ diff --git a/assets/image/goods_phone.png b/assets/image/goods_phone.png new file mode 100644 index 00000000..435f1224 Binary files /dev/null and b/assets/image/goods_phone.png differ diff --git a/assets/image/jg.png b/assets/image/jg.png new file mode 100644 index 00000000..e0a08c8f Binary files /dev/null and b/assets/image/jg.png differ diff --git a/assets/image/kan_jia.png b/assets/image/kan_jia.png new file mode 100644 index 00000000..dc91e94c Binary files /dev/null and b/assets/image/kan_jia.png differ diff --git a/assets/image/ms.png b/assets/image/ms.png new file mode 100644 index 00000000..7b605f26 Binary files /dev/null and b/assets/image/ms.png differ diff --git a/assets/image/ms_t.png b/assets/image/ms_t.png new file mode 100644 index 00000000..0a0acf2d Binary files /dev/null and b/assets/image/ms_t.png differ diff --git a/assets/image/pin_t.png b/assets/image/pin_t.png new file mode 100644 index 00000000..f37d4a9d Binary files /dev/null and b/assets/image/pin_t.png differ diff --git a/assets/image/pin_tuan.png b/assets/image/pin_tuan.png new file mode 100644 index 00000000..b6e4071c Binary files /dev/null and b/assets/image/pin_tuan.png differ diff --git a/assets/image/shopping_cart.png b/assets/image/shopping_cart.png new file mode 100644 index 00000000..aa3fe614 Binary files /dev/null and b/assets/image/shopping_cart.png differ diff --git a/assets/image/shopping_cart_h.png b/assets/image/shopping_cart_h.png new file mode 100644 index 00000000..3c1a3293 Binary files /dev/null and b/assets/image/shopping_cart_h.png differ diff --git a/assets/image/shopping_home.png b/assets/image/shopping_home.png new file mode 100644 index 00000000..71014b2d Binary files /dev/null and b/assets/image/shopping_home.png differ diff --git a/assets/image/shopping_home_h.png b/assets/image/shopping_home_h.png new file mode 100644 index 00000000..416cf783 Binary files /dev/null and b/assets/image/shopping_home_h.png differ diff --git a/assets/image/wx.png b/assets/image/wx.png new file mode 100644 index 00000000..ce737166 Binary files /dev/null and b/assets/image/wx.png differ diff --git a/assets/image/yq_zt.png b/assets/image/yq_zt.png new file mode 100644 index 00000000..38c8173f Binary files /dev/null and b/assets/image/yq_zt.png differ diff --git a/assets/image/zt_m.png b/assets/image/zt_m.png new file mode 100644 index 00000000..ff7cfa4b Binary files /dev/null and b/assets/image/zt_m.png differ diff --git a/assets/image/zt_zf.png b/assets/image/zt_zf.png new file mode 100644 index 00000000..ff969c86 Binary files /dev/null and b/assets/image/zt_zf.png differ diff --git a/assets/image/zu_tuan.png b/assets/image/zu_tuan.png new file mode 100644 index 00000000..ee8dd195 Binary files /dev/null and b/assets/image/zu_tuan.png differ diff --git a/lib/community/community_course.dart b/lib/community/community_course.dart index 21cfa78a..1c6abc9f 100644 --- a/lib/community/community_course.dart +++ b/lib/community/community_course.dart @@ -239,21 +239,6 @@ class _CommunityCourse extends State left: 0, right: 0, ), - if (brands != null && brands.length > 0) - Positioned( - child: Container( - color: Colors.white, - child: StoreTitleTab( - brands, - globaKeys, - scrollController, - isScroll: true, - ), - ), - top: 0, - left: 0, - right: 0, - ), ], ); } diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index ddde6b88..9377d1b5 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -45,6 +45,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { bool isShowImg = true; int chapterIndex = 0; double height = 0; + var isShowMore = false; @override void initState() { @@ -179,7 +180,6 @@ class _ClassDetails extends State with WidgetsBindingObserver { ], ), Container( - height: 123, margin: EdgeInsets.only(bottom: 16.h), padding: EdgeInsets.only(left: 16, top: 16, right: 10), decoration: BoxDecoration( @@ -200,7 +200,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { Row( children: [ Container( - height: 22.h, + height:26.h, padding:EdgeInsets.only(left:2,right:2), alignment: Alignment.center, decoration: BoxDecoration( @@ -290,14 +290,47 @@ class _ClassDetails extends State with WidgetsBindingObserver { ), Text( course != null ? course.introduce : "", - overflow: TextOverflow.ellipsis, - maxLines: 2, + overflow: isShowMore + ? TextOverflow.visible + : TextOverflow.ellipsis, + maxLines: isShowMore ? 10 : 2, style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, color: Colors.black, ), ), + SizedBox(height: 3.h), + GestureDetector( + onTap: () { + setState(() { + isShowMore = !isShowMore; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Text( + S.of(context).gengduo, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + Icon( + (isShowMore != null && !isShowMore) + ? Icons.chevron_right + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, + ), + ], + ), + ), + SizedBox(height: 3.h), ], ), ), diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index 7a1fd383..f3b7870f 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -10,11 +10,7 @@ import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/brand.dart'; -import 'package:huixiang/retrofit/data/category_select_list.dart'; -import 'package:huixiang/retrofit/data/collect_class_list.dart'; -import 'package:huixiang/retrofit/data/course_list.dart'; import 'package:huixiang/retrofit/data/headlines_list.dart'; -import 'package:huixiang/retrofit/data/headlines_list_details.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; @@ -205,21 +201,6 @@ class _ArticlePage extends State left: 0, right: 0, ), - if (brands != null && brands.length > 0) - Positioned( - child: Container( - color: Colors.white, - child: StoreTitleTab( - brands, - globaKeys, - scrollController, - isScroll: true, - ), - ), - top: 0, - left: 0, - right: 0, - ), ], ); } diff --git a/lib/community/headlines/headlines_collection.dart b/lib/community/headlines/headlines_collection.dart index 07c48dfe..d26ff83d 100644 --- a/lib/community/headlines/headlines_collection.dart +++ b/lib/community/headlines/headlines_collection.dart @@ -15,7 +15,7 @@ class HeadlinesCollection extends StatefulWidget { final List headlines; final List
articles; - HeadlinesCollection(this.headlines,this.articles); + HeadlinesCollection(this.headlines, this.articles); @override State createState() { @@ -38,18 +38,18 @@ class _HeadlinesCollection extends State { Widget build(BuildContext context) { return Container( height: 60.h, - margin: EdgeInsets.only(top:10), + margin: EdgeInsets.only(top: 10), child: ListView.builder( scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), padding: EdgeInsets.symmetric(horizontal: 10), - itemCount:widget.headlines == null ? 0 : widget.headlines.length, + itemCount: widget.headlines == null ? 0 : widget.headlines.length, itemBuilder: (context, position) { return GestureDetector( onTap: () { Navigator.of(context).pushNamed( '/router/headlines_column_details', - arguments: {"id":widget.headlines[position].id}); + arguments: {"id": widget.headlines[position].id}); }, child: headlinesCollectionItem(widget.headlines[position]), ); @@ -61,7 +61,7 @@ class _HeadlinesCollection extends State { Widget headlinesCollectionItem(HeadlinesList headlines) { return Container( width: 225.w, - height:60.h, + height: 60.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), boxShadow: [ @@ -75,7 +75,7 @@ class _HeadlinesCollection extends State { color: Colors.black, ), margin: EdgeInsets.symmetric( - horizontal:6, + horizontal: 6, ), child: Stack( children: [ @@ -97,73 +97,76 @@ class _HeadlinesCollection extends State { ), ), Container( - padding: EdgeInsets.only(left:12.w,right: 12.w), + padding: EdgeInsets.only(left: 12.w, right: 12.w), child: Column( crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded(child: Row( - children: [ - Container( - margin: EdgeInsets.only(right:4), - padding:EdgeInsets.only(left:2,right:2), - height: 16.h, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(2), - color: Color(0xFF32A060), - ), - child: Text( - "专栏", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Row( + children: [ + Container( + margin: EdgeInsets.only(right: 4), + padding: EdgeInsets.only(left: 2, right: 2), + height: 16.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF32A060), + ), + child: Text( + "专栏", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), ), ), - ), - Expanded(child:Text( - headlines?.name ?? "", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.white, + Expanded( + child: Text( + headlines?.name ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), ), - ),), - ],)), - // Row( - // children: [ - // Expanded(child:Text( - // "更新3篇", - // style: TextStyle( - // fontSize: 12.sp, - // fontWeight: MyFontWeight.medium, - // color: Colors.white, - // ), - // )), - // Text( - // "查看专栏", - // style: TextStyle( - // fontSize: 12.sp, - // fontWeight: MyFontWeight.regular, - // color: Colors.white, - // ), - // ), - // SizedBox(width: 2), - // Image.asset( - // "assets/image/t_right.png", - // width: 14, - // height: 14, - // ), - // ],), - ],), + ], + )), + // Row( + // children: [ + // Expanded(child:Text( + // "更新3篇", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.white, + // ), + // )), + // Text( + // "查看专栏", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // color: Colors.white, + // ), + // ), + // SizedBox(width: 2), + // Image.asset( + // "assets/image/t_right.png", + // width: 14, + // height: 14, + // ), + // ],), + ], + ), ), ], ), ); } - } diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 56650179..32610b00 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -535,8 +535,10 @@ class MessageLookup extends MessageLookupByLibrary { "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), + "wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍价"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), "wodenianling" : MessageLookupByLibrary.simpleMessage("我的年龄"), + "wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼团"), "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index e1d59ac9..4354f664 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -533,8 +533,10 @@ class MessageLookup extends MessageLookupByLibrary { "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), + "wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍价"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), "wodenianling" : MessageLookupByLibrary.simpleMessage("我的年龄"), + "wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼团"), "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 63b3f40c..b7c0d583 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -533,8 +533,10 @@ class MessageLookup extends MessageLookupByLibrary { "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的会员等级"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的积分值"), + "wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍价"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), "wodenianling" : MessageLookupByLibrary.simpleMessage("我的年龄"), + "wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼团"), "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的钱包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index f3a037d6..66265693 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -532,8 +532,10 @@ class MessageLookup extends MessageLookupByLibrary { "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"), + "wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍價"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), "wodenianling" : MessageLookupByLibrary.simpleMessage("我的年齡"), + "wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼團"), "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 738e14c7..d615c30d 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -533,8 +533,10 @@ class MessageLookup extends MessageLookupByLibrary { "wodegongju" : MessageLookupByLibrary.simpleMessage("我的工具"), "wodehuiyuandengji" : MessageLookupByLibrary.simpleMessage("我的會員等級"), "wodejifenzhi" : MessageLookupByLibrary.simpleMessage("我的積分值"), + "wodekanjia" : MessageLookupByLibrary.simpleMessage("我的砍價"), "wodekaquan" : MessageLookupByLibrary.simpleMessage("我的卡券"), "wodenianling" : MessageLookupByLibrary.simpleMessage("我的年齡"), + "wodepintuan" : MessageLookupByLibrary.simpleMessage("我的拼團"), "wodeqianbao" : MessageLookupByLibrary.simpleMessage("我的錢包"), "wodeshengri" : MessageLookupByLibrary.simpleMessage("我的生日"), "wodexiaoxi" : MessageLookupByLibrary.simpleMessage("我的消息"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 5976a619..c61964fe 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -5635,6 +5635,26 @@ class S { ); } + /// `我的砍价` + String get wodekanjia { + return Intl.message( + '我的砍价', + name: 'wodekanjia', + desc: '', + args: [], + ); + } + + /// `我的拼团` + String get wodepintuan { + return Intl.message( + '我的拼团', + name: 'wodepintuan', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_view/shortcut_operation.dart b/lib/home/home_view/shortcut_operation.dart index 82e76630..771ae260 100644 --- a/lib/home/home_view/shortcut_operation.dart +++ b/lib/home/home_view/shortcut_operation.dart @@ -46,9 +46,20 @@ class _ShortcutOperation extends State { }, child: Container( width: 106, - color: Colors.white, margin: EdgeInsets.only(right:10), padding: EdgeInsets.only(top: 8,bottom: 8), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(4), + ), child: Column( children: [ Text( @@ -84,9 +95,20 @@ class _ShortcutOperation extends State { }, child: Container( width: 106, - color: Colors.white, margin: EdgeInsets.only(right:10), padding: EdgeInsets.only(top: 8,bottom: 8), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(4), + ), child: Column( children: [ Text( @@ -122,8 +144,19 @@ class _ShortcutOperation extends State { }, child:Container( width: 106, - color: Colors.white, padding: EdgeInsets.only(top: 8,bottom: 8), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(4), + ), child: Column( children: [ Text( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 32b382df..650ff5df 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -584,6 +584,10 @@ "invite_code_error": "邀请码输入错误", "yaoqingwancheng": "邀请完成", "xuanji": "选集", + "wodekanjia": "我的砍价", + "wodepintuan": "我的拼团", + + diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 0151ed71..744b1ff0 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -581,6 +581,8 @@ "qingshuruyaoqingma": "请输入邀请码", "invite_code_error": "邀请码输入错误", "xuanji": "选集", + "wodekanjia": "我的砍价", + "wodepintuan": "我的拼团", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 17bdfa3e..8a557bd1 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -581,6 +581,8 @@ "qingshuruyaoqingma": "请输入邀请码", "invite_code_error": "邀请码输入错误", "xuanji": "选集", + "wodekanjia": "我的砍价", + "wodepintuan": "我的拼团", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 811a8988..1e789568 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -575,7 +575,8 @@ "qingshuruyaoqingma": "請輸入邀請碼", "invite_code_error": "邀請碼輸入錯誤", "xuanji": "選集", - + "wodekanjia": "我的砍價", + "wodepintuan": "我的拼團", "privacy_policy4": "并使用本機號碼登錄" diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 91303103..7cb58780 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -575,6 +575,8 @@ "qingshuruyaoqingma": "請輸入邀請碼", "invite_code_error": "邀請碼輸入錯誤", "xuanji": "選集", + "wodekanjia": "我的砍價", + "wodepintuan": "我的拼團", diff --git a/lib/main.dart b/lib/main.dart index 72f074a7..bf494de9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -51,6 +51,14 @@ import 'package:huixiang/setting/help_feedback_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; +import 'package:huixiang/store/shopping/activity_prefecture_details.dart'; +import 'package:huixiang/store/shopping/shopping_cart/shopping_cart_page.dart'; +import 'package:huixiang/store/shopping/shopping_goods_details.dart'; +import 'package:huixiang/store/shopping/shopping_home/bargain_details.dart'; +import 'package:huixiang/store/shopping/shopping_home/group_details.dart'; +import 'package:huixiang/store/shopping/shopping_home/group_page_details.dart'; +import 'package:huixiang/store/shopping/shopping_home/search_page.dart'; +import 'package:huixiang/store/shopping/shopping_mall_home.dart'; import 'package:huixiang/store/store_order.dart'; import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/test_page.dart'; @@ -79,6 +87,7 @@ import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/mine_attainment_page.dart'; import 'mine/mine_vip/mine_vip_core.dart'; +import 'order/bargain_group_order.dart'; import 'order/exchange_write_off_page.dart'; import 'mine/release_page.dart'; import 'mine/roll_center_page.dart'; @@ -252,6 +261,8 @@ Map routers = { BindingAssistantCard(), '/router/order_history_page': (context, {arguments}) => OrderHistoryPage(arguments: arguments), + '/router/bargain_group_order': (context, {arguments}) => + BargainGroupOrder(), '/router/union_detail_page': (context, {arguments}) => UnionDetailsPage(arguments: arguments), '/router/address_edit_page': (context, {arguments}) => @@ -267,6 +278,14 @@ Map routers = { HotArticleDetailsPage(), '/router/store_order': (context, {arguments}) => StoreOrderPage(arguments: arguments), + '/router/shopping_mall_home': (context, {arguments}) => + ShoppingMallHome(arguments: arguments), + '/router/activity_prefecture_details': (context, {arguments}) => + ActivityPrefectureDetails(), + '/router/shopping_goods_details': (context, {arguments}) => + ShoppingGoodsDetails(), + '/router/search_page': (context, {arguments}) => + SearchPage(), '/router/vip_balance': (context, {arguments}) => VipBalancePage(arguments: arguments), '/router/exchange_order_details': (context, {arguments}) => @@ -325,4 +344,10 @@ Map routers = { MineAttainmentPage(arguments: arguments), '/router/headlines_column_details': (context, {arguments}) => HeadlinesColumnDetails(arguments: arguments), + '/router/group_details': (context, {arguments}) => + GroupDetails(), + '/router/bargain_details': (context, {arguments}) => + BargainDetails(), + '/router/group_page_details': (context, {arguments}) => + GroupPageDetails(), }; diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 092ca029..2193cadf 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -60,81 +60,117 @@ class _MineItem extends State { ), ), ), - InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context) - .pushNamed('/router/releasePage', - arguments: {}); - }); - }, - child: mineItem( - S.of(context).wodedongtai, - "assets/image/dynamic.png", - ), + Row( + children: [ + Expanded(child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context) + .pushNamed('/router/releasePage', + arguments: {}); + }); + }, + child: mineItem( + S.of(context).wodedongtai, + "assets/image/dynamic.png", + ), + )), + Expanded(child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context) + .pushNamed('/router/exchange_history_page'); + }); + }, + child: mineItem( + S.of(context).duihuanlishi, + "assets/image/icon_mine_records_of_consumption.png", + ), + ),), + Expanded(child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/mine_card'); + }); + }, + child: mineItem( + S.of(context).wodekaquan, + "assets/image/icon_mine_card.png", + ), + ),), + Expanded(child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context).pushNamed('/router/manage_address_page'); + }); + }, + child: mineItem( + S.of(context).guanlidizhi, + "assets/image/icon_location_address.png", + ), + ),), + ], ), - InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context) - .pushNamed('/router/exchange_history_page'); - }); - }, - child: mineItem( - S.of(context).duihuanlishi, - "assets/image/icon_mine_records_of_consumption.png", - ), - ), - InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context).pushNamed('/router/mine_card'); - }); - }, - child: mineItem( - S.of(context).wodekaquan, - "assets/image/icon_mine_card.png", - ), - ), - InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context).pushNamed('/router/manage_address_page'); - }); - }, - child: mineItem( - S.of(context).guanlidizhi, - "assets/image/icon_location_address.png", - ), - ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); - }, - child: mineItem( - S.of(context).tuiguangma, - "assets/image/icon_mine_promotion_code.png", - ), + SizedBox(height: 10.h,), + Row( + children: [ + Expanded(child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + Navigator.of(context) + .pushNamed('/router/bargain_group_order'); + }); + }, + child: mineItem( + S.of(context).wodekanjia, + "assets/image/icon_mine_records_of_consumption.png", + ), + ),), + Expanded(child: InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/bargain_group_order'); + }, + child: mineItem( + S.of(context).wodepintuan, + "assets/image/kan_jia.png", + ), + ),), + Expanded(child: InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + }, + child: mineItem( + S.of(context).tuiguangma, + "assets/image/pin_tuan.png", + ), + ),), + Expanded(child: Text("")), + ], ), // mineItem( // S.of(context).bangzhuyufankui, @@ -146,40 +182,71 @@ class _MineItem extends State { } ///我的页面下面条目 + // Widget mineItem(text, icon) { + // return Container( + // color: Colors.white, + // margin: EdgeInsets.symmetric(vertical: 6.h), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Image.asset( + // icon, + // width: 28.w, + // height: 28.h, + // ), + // SizedBox( + // width: 8.w, + // ), + // Expanded( + // flex: 1, + // child: Text( + // text, + // style: TextStyle( + // fontWeight: MyFontWeight.medium, + // fontSize: 16.sp, + // color: Color(0xFF353535), + // ), + // ), + // ), + // Icon( + // Icons.keyboard_arrow_right, + // size: 20, + // color: Colors.black, + // ) + // ], + // ), + // ); + // } Widget mineItem(text, icon) { return Container( color: Colors.white, - margin: EdgeInsets.symmetric(vertical: 6.h), - child: Row( + margin: EdgeInsets.symmetric(vertical:4.h), + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( icon, - width: 28.w, - height: 28.h, + width: 36.w, + height: 36.w, + fit: BoxFit.contain, ), SizedBox( - width: 8.w, + height:4.h, ), - Expanded( - flex: 1, - child: Text( - text, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 16.sp, - color: Color(0xFF353535), - ), + Text( + text, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 12.sp, + color: Color(0xFF353535), ), ), - Icon( - Icons.keyboard_arrow_right, - size: 20, - color: Colors.black, - ) ], ), ); } + + } diff --git a/lib/mine/mine_view/mine_order.dart b/lib/mine/mine_view/mine_order.dart index 947758db..bb874b09 100644 --- a/lib/mine/mine_view/mine_order.dart +++ b/lib/mine/mine_view/mine_order.dart @@ -115,8 +115,8 @@ class _MineOrderView extends State { Image.asset( orderStatusImg[status], fit: BoxFit.contain, - width: 32.w, - height: 32.w, + width: 36.w, + height: 36.w, ), SizedBox(height: 4.h,), Text( diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart new file mode 100644 index 00000000..a339b78c --- /dev/null +++ b/lib/order/bargain_group_order.dart @@ -0,0 +1,439 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/exchange_order.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/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/icon_text.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/my_tab.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class BargainGroupOrder extends StatefulWidget { + @override + State createState() { + return _BargainGroupOrder(); + } +} + +class _BargainGroupOrder extends State + with SingleTickerProviderStateMixin { + List tabs; + List _pages; + TabController tabcontroller; + + @override + void initState() { + super.initState(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (tabcontroller == null) + tabcontroller = TabController(length: 4, vsync: this); + tabs = [ + MyTab( + text: S.of(context).quanbu, + ), + MyTab( + text: "进行中", + ), + MyTab( + text: "成功", + ), + MyTab( + text: "失败", + ) + ]; + _pages = [ + ExchangeHistoryList(0), + ExchangeHistoryList(1), + ExchangeHistoryList(2), + ExchangeHistoryList(3) + ]; + } + + @override + Widget build(BuildContext context) { + return DefaultTabController( + length: 4, + child: Scaffold( + appBar: MyAppBar( + title: S.of(context).wodekanjia, + titleColor: Colors.black, + titleSize: 18.sp, + background: Color(0xFFFFFFFF), + leadingColor: Colors.black, + toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top, + bottom: PreferredSize( + preferredSize: Size(double.infinity, 38.h), + child: TabBar( + controller: tabcontroller, + indicatorWeight: 2, + indicatorColor: Color(0xFF39B54A), + indicatorSize: TabBarIndicatorSize.label, + indicatorPadding: EdgeInsets.only(top: 3), + unselectedLabelStyle: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.normal, + ), + labelStyle: TextStyle( + color: Colors.black, + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold), + labelColor: Colors.black, + tabs: tabs, + ), + ), + ), + body: TabBarView( + children: _pages, + controller: tabcontroller, + ), + ), + ); + } +} + +class ExchangeHistoryList extends StatefulWidget { + final int orderStatus; + + ExchangeHistoryList(this.orderStatus); + + @override + State createState() { + return _ExchangeHistoryList(); + } +} + +class _ExchangeHistoryList extends State { + ApiService apiService; + + RefreshController _refreshController = + RefreshController(initialRefresh: false); + + @override + void initState() { + super.initState(); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService(Dio(), + context: context, token: value.getString('token')), + }); + } + + int pageNum = 1; + + _refresh() { + pageNum = 1; + } + + @override + Widget build(BuildContext context) { + return SmartRefresher( + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + footer: CustomFooter( + builder: (BuildContext context, LoadStatus mode) { + return MyFooter(mode); + }, + ), + controller: _refreshController, + onRefresh: _refresh, + // onLoading: queryHistory, + child: + // orders == null || orders.length == 0 + // ? NoDataView( + // isShowBtn: false, + // text: "还没有订单,快去下一单吧~", + // fontSize: 16.sp, + // margin: EdgeInsets.only(top: 120.h), + // ) + // : + ListView.builder( + // itemCount: orders == null ? 0 : orders.length, + itemCount: 5, + itemBuilder: (context, position) { + return bargainOrder(); + }, + ), + ); + } + + String orderStatus(state) { + String orderStatus = ""; + switch (state) { + case 1: + orderStatus = S.of(context).weiwancheng; + break; + case 2: + orderStatus = S.of(context).yiwancheng; + break; + case 9: + orderStatus = S.of(context).yiquxiao; + break; + } + return orderStatus; + } + + Widget bargainOrder() { + return Container( + margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(25), + offset: Offset(0, 1), + blurRadius: 12, + spreadRadius: 0, + ), + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 19.w, + height:21.h, + margin: EdgeInsets.only(left: 12.w, top: 12.h), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xff32A060), + borderRadius: BorderRadius.circular(2), + ), + child: Text( + // (orderInfo != null && orderInfo.isTakeOut == 0) ? "自" : "外", + "自", + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.only(left: 6.w, top: 12.h), + alignment: Alignment.centerLeft, + child: Text( + // (orderInfo != null) ? orderInfo.storeName : "", + "一心回乡商城", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Color(0xFF353535), + ), + ), + ), + flex: 1, + ), + Padding( + padding: EdgeInsets.only(top: 12.h, right: 12.w), + child: Text( + // (orderInfo != null && + // orderInfo.storeVO != null && + // orderInfo.storeVO.posType != null) + // ? StatusUtils.statusText( + // context, + // orderInfo.refundStatus, + // orderInfo.orderStatus, + // orderInfo.payStatus, + // orderInfo.sendStatus, + // orderInfo.isTakeOut) + // : "", + "还差¥23.4砍价成功", + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + color: + // (orderInfo == null) + // ? Color(0xFF32A060) + // : (orderInfo.refundStatus == 1 || + // orderInfo.orderStatus >= 5) + // ? Colors.grey + // : (orderInfo.orderStatus == 4) + // ? Color(0xFF32A060) + // : + Color(0xffFE951E), + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.only(left: 37.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).xiadanshijian_("下单时间:2020.01.20 10:50:22"), + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF727272), + ), + ), + SizedBox( + height: 8.h, + ), + Container( + height: 81.h, + margin: EdgeInsets.only(right: 12), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // MImage( + // "", + // width: 81.w, + // height: 81.h, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 81, + height: 81, + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "[生态小农]山林放养鸡蛋30枚/盒", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + Text( + "套盒装", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF727272), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "x1", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF727272), + ), + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "已砍至:", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF868686), + ), + ), + TextSpan( + text: "58.2", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "元", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF868686), + ), + ), + ], + ), + ), + ], + ), + ], + )), + ], + ), + ), + ], + ), + ), + SizedBox( + height: 12.h, + ), + Container( + margin: EdgeInsets.only(right: 12.w, bottom: 16.h), + child: Directionality( + textDirection: TextDirection.rtl, + child: Row( + children: [ + GestureDetector( + onTap: () {}, + child: RoundButton( + height: 25.h, + text: "查看详情", + textColor: Colors.white, + fontSize: 12.sp, + backgroup: Color(0xFF32A060), + radius: 2, + padding: EdgeInsets.fromLTRB(17.w,0, 17.w,0), + ), + ), + // GestureDetector( + // onTap: () { + // + // }, + // child:RoundButton( + // height: 25.h, + // padding: EdgeInsets.fromLTRB(8, 4, 8, 4), + // text: S.of(context).chakanxiangqing, + // textColor: Colors.white, + // fontSize: 12, + // backgroup: Color(0xFF32A060), + // radius: 2, + // ), + // ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 3d003bae..42c454dd 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -242,10 +242,33 @@ class _OrderHistoryList extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 19.w, - height: 19.h, + width: 19, + height: 21, margin: EdgeInsets.only(left: 12.w, top: 12.h), alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + border: Border.all( + width: 1, + color: Color(0xFF32A060), + style: BorderStyle.solid, + ) + ), + child: Text( + "团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.bold, + color: Color(0xFF32A060), + ), + ), + ), + Container( + width: 19, + height:21, + margin: EdgeInsets.only(left:7.w,top: 12.h), + alignment: Alignment.center, decoration: BoxDecoration( color: Color(0xff32A060), borderRadius: BorderRadius.circular(2), diff --git a/lib/retrofit/data/activity_area_list.dart b/lib/retrofit/data/activity_area_list.dart new file mode 100644 index 00000000..27accb42 --- /dev/null +++ b/lib/retrofit/data/activity_area_list.dart @@ -0,0 +1,307 @@ +import 'package:huixiang/retrofit/data/product.dart'; + +/// actTemplate : {"id":"1473198577613275136","createTime":"2021-12-21 15:48:06","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:06","updateUser":"1333246101196636160","storeId":"1333246101343436800","type":2,"limitTime":null,"limitNumber":0,"coverImg":"https://pos.upload.gznl.top/1175/2021/12/5bf7a846-768b-4a17-872f-e927988c24c9.jpg","shareImg":"https://pos.upload.gznl.top/1175/2021/12/65f6a0f7-14d1-4393-902e-42e5dc464800.jpg","bannerImg":"https://pos.upload.gznl.top/1175/2021/12/9ee395eb-718c-40c0-bfe0-673dbbade4cf.jpg","state":1,"allDay":false,"startTime":"2021-12-20 00:00:00","endTime":"2021-12-30 00:00:00","isDelete":0} +/// timeProductList : [{"actTime":{"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0},"productList":[]},{"actTime":{"id":"1473570616966643712","createTime":"2021-12-22 16:26:27","createUser":"1333246101196636160","updateTime":"2021-12-22 16:26:27","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"11:00:00","endHour":"17:00:00","isDelete":0},"productList":[{"id":"1473570776908038144","createTime":"2021-12-22 16:27:05","createUser":"1333246101196636160","updateTime":"2021-12-22 16:27:05","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","timeId":"1473570616966643712","productId":"1456500820571848704","productName":"毛毛虫面包","productImg":"https://pos.upload.gznl.top/1175/2021/11/4a6ffabd-0e10-4720-ac93-57ec6855c5cf.jpg","productPrice":"8.00","promotionPrice":"8.00","productStock":-20,"sellCount":0,"skuJson":[{"skuId":"1456500821968551936","skuPrice":8,"skuStock":-20}],"isDelete":0}]}] + +class ActivityAreaList { + ActivityAreaList({ + ActTemplate actTemplate, + List timeProductList,}){ + _actTemplate = actTemplate; + _timeProductList = timeProductList; +} + + ActivityAreaList.fromJson(dynamic json) { + _actTemplate = json['actTemplate'] != null ? ActTemplate.fromJson(json['actTemplate']) : null; + if (json['timeProductList'] != null) { + _timeProductList = []; + json['timeProductList'].forEach((v) { + _timeProductList.add(TimeProductList.fromJson(v)); + }); + } + } + ActTemplate _actTemplate; + List _timeProductList; + + ActTemplate get actTemplate => _actTemplate; + List get timeProductList => _timeProductList; + + Map toJson() { + final map = {}; + if (_actTemplate != null) { + map['actTemplate'] = _actTemplate.toJson(); + } + if (_timeProductList != null) { + map['timeProductList'] = _timeProductList.map((v) => v.toJson()).toList(); + } + return map; + } + +} + +/// actTime : {"id":"1473198590141661184","createTime":"2021-12-21 15:48:09","createUser":"1333246101196636160","updateTime":"2021-12-21 15:48:09","updateUser":"1333246101196636160","storeId":"1333246101343436800","templateId":"1473198577613275136","allDay":false,"startHour":"09:00:00","endHour":"10:00:00","isDelete":0} +/// productList : [] + +class TimeProductList { + TimeProductList({ + ActTime actTime, + List productList,}){ + _actTime = actTime; + _productList = productList; +} + + TimeProductList.fromJson(dynamic json) { + _actTime = json['actTime'] != null ? ActTime.fromJson(json['actTime']) : null; + if (json['productList'] != null) { + _productList = []; + json['productList'].forEach((v) { + _productList.add(ProductList.fromJson(v)); + }); + } + } + ActTime _actTime; + List _productList; + + ActTime get actTime => _actTime; + List get productList => _productList; + + Map toJson() { + final map = {}; + if (_actTime != null) { + map['actTime'] = _actTime.toJson(); + } + if (_productList != null) { + map['productList'] = _productList.map((v) => v.toJson()).toList(); + } + return map; + } + +} + +/// id : "1473198590141661184" +/// createTime : "2021-12-21 15:48:09" +/// createUser : "1333246101196636160" +/// updateTime : "2021-12-21 15:48:09" +/// updateUser : "1333246101196636160" +/// storeId : "1333246101343436800" +/// templateId : "1473198577613275136" +/// allDay : false +/// startHour : "09:00:00" +/// endHour : "10:00:00" +/// isDelete : 0 + +class ActTime { + ActTime({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String storeId, + String templateId, + bool allDay, + String startHour, + String endHour, + int isDelete,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _storeId = storeId; + _templateId = templateId; + _allDay = allDay; + _startHour = startHour; + _endHour = endHour; + _isDelete = isDelete; +} + + ActTime.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _storeId = json['storeId']; + _templateId = json['templateId']; + _allDay = json['allDay']; + _startHour = json['startHour']; + _endHour = json['endHour']; + _isDelete = json['isDelete']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _storeId; + String _templateId; + bool _allDay; + String _startHour; + String _endHour; + int _isDelete; + + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get storeId => _storeId; + String get templateId => _templateId; + bool get allDay => _allDay; + String get startHour => _startHour; + String get endHour => _endHour; + int get isDelete => _isDelete; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['storeId'] = _storeId; + map['templateId'] = _templateId; + map['allDay'] = _allDay; + map['startHour'] = _startHour; + map['endHour'] = _endHour; + map['isDelete'] = _isDelete; + return map; + } + +} + +/// id : "1473198577613275136" +/// createTime : "2021-12-21 15:48:06" +/// createUser : "1333246101196636160" +/// updateTime : "2021-12-21 15:48:06" +/// updateUser : "1333246101196636160" +/// storeId : "1333246101343436800" +/// type : 2 +/// limitTime : null +/// limitNumber : 0 +/// coverImg : "https://pos.upload.gznl.top/1175/2021/12/5bf7a846-768b-4a17-872f-e927988c24c9.jpg" +/// shareImg : "https://pos.upload.gznl.top/1175/2021/12/65f6a0f7-14d1-4393-902e-42e5dc464800.jpg" +/// bannerImg : "https://pos.upload.gznl.top/1175/2021/12/9ee395eb-718c-40c0-bfe0-673dbbade4cf.jpg" +/// state : 1 +/// allDay : false +/// startTime : "2021-12-20 00:00:00" +/// endTime : "2021-12-30 00:00:00" +/// isDelete : 0 + +class ActTemplate { + ActTemplate({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String storeId, + int type, + dynamic limitTime, + int limitNumber, + String coverImg, + String shareImg, + String bannerImg, + int state, + bool allDay, + String startTime, + String endTime, + int isDelete,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _storeId = storeId; + _type = type; + _limitTime = limitTime; + _limitNumber = limitNumber; + _coverImg = coverImg; + _shareImg = shareImg; + _bannerImg = bannerImg; + _state = state; + _allDay = allDay; + _startTime = startTime; + _endTime = endTime; + _isDelete = isDelete; +} + + ActTemplate.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _storeId = json['storeId']; + _type = json['type']; + _limitTime = json['limitTime']; + _limitNumber = json['limitNumber']; + _coverImg = json['coverImg']; + _shareImg = json['shareImg']; + _bannerImg = json['bannerImg']; + _state = json['state']; + _allDay = json['allDay']; + _startTime = json['startTime']; + _endTime = json['endTime']; + _isDelete = json['isDelete']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _storeId; + int _type; + dynamic _limitTime; + int _limitNumber; + String _coverImg; + String _shareImg; + String _bannerImg; + int _state; + bool _allDay; + String _startTime; + String _endTime; + int _isDelete; + + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get storeId => _storeId; + int get type => _type; + dynamic get limitTime => _limitTime; + int get limitNumber => _limitNumber; + String get coverImg => _coverImg; + String get shareImg => _shareImg; + String get bannerImg => _bannerImg; + int get state => _state; + bool get allDay => _allDay; + String get startTime => _startTime; + String get endTime => _endTime; + int get isDelete => _isDelete; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['storeId'] = _storeId; + map['type'] = _type; + map['limitTime'] = _limitTime; + map['limitNumber'] = _limitNumber; + map['coverImg'] = _coverImg; + map['shareImg'] = _shareImg; + map['bannerImg'] = _bannerImg; + map['state'] = _state; + map['allDay'] = _allDay; + map['startTime'] = _startTime; + map['endTime'] = _endTime; + map['isDelete'] = _isDelete; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 3ee52d73..1aa69ce7 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,8 +21,8 @@ import 'data/shoppingCart.dart'; part 'min_api.g.dart'; -const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -35,6 +35,9 @@ const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; +const base_url = "http://192.168.10.142:8765/app/";///詹云久 +const baseUrl = "http://192.168.10.142:8765/app/";///詹云久 + ///调用小程序的接口 @RestApi(baseUrl: baseUrl) abstract class MinApiService { diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 02d9988a..ef360ca1 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.142:8765/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index cf056f6e..48b32e23 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -19,6 +19,7 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; import 'data/achievement_detail_list.dart'; +import 'data/activity_area_list.dart'; import 'data/address.dart'; import 'data/banner.dart'; import 'data/brand_data.dart'; @@ -53,8 +54,8 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -66,8 +67,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const baseUrl = "http://192.168.10.37:8766/app/"; -// const base_url = "http://192.168.10.142:8766/app/";///詹云久 -// const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 +const base_url = "http://192.168.10.142:8766/app/";///詹云久 +const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { @@ -481,5 +482,8 @@ abstract class ApiService { @GET("/information/category/{id}") Future> headlinesDetails(@Path("id") String id); + ///活动专区,秒杀,砍价,拼团 + @GET("/actTemplate/findActListByType?allDay={allDay}&type={type}") + Future>> findActListByType(@Path("allDay") bool allDay, @Path("type") int type); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index d1a64c02..0b1bec7a 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.142:8766/app/'; } final Dio _dio; @@ -1773,4 +1773,28 @@ class _ApiService implements ApiService { return value; } + @override + Future>> findActListByType(allDay,type) async { + ArgumentError.checkNotNull(allDay, 'allDay'); + ArgumentError.checkNotNull(type, 'type'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/actTemplate/findActListByType?allDay=$allDay&type=$type', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => (json as List) + .map((i) => ActivityAreaList.fromJson(i as Map)) + .toList()); + return value; + } + } diff --git a/lib/store/shopping/activity_prefecture_details.dart b/lib/store/shopping/activity_prefecture_details.dart new file mode 100644 index 00000000..d2e7f1c6 --- /dev/null +++ b/lib/store/shopping/activity_prefecture_details.dart @@ -0,0 +1,683 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/data/activity_area_list.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ActivityPrefectureDetails extends StatefulWidget { + @override + State createState() { + return _ActivityPrefectureDetails(); + } +} + +class _ActivityPrefectureDetails extends State { + ApiService apiService; + int seckillIndex = 0; + RefreshController refreshController = RefreshController(); + List activityAreaList = []; + ScrollController _scrollController; + ScrollPhysics _scrollPhysics = NeverScrollableScrollPhysics(); + bool scrollFlag = false; + + + + @override + void initState() { + super.initState(); + _scrollController = ScrollController(); + _scrollController.addListener(() { + setState(() { + if(_scrollController.offset < (325.h-MediaQuery.of(context).padding.top)){ + _scrollPhysics = NeverScrollableScrollPhysics(); + } + else{ + _scrollPhysics = BouncingScrollPhysics(); + } + }); + }); + SharedPreferences.getInstance().then((value) { + apiService = + ApiService(Dio(), context: context, token: value.getString("token")); + queryFindActListByType(false,2); + }); + } + + ///秒杀/砍价/拼团列表 + queryFindActListByType(allDay,type) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData> baseData = + await apiService.findActListByType(allDay,type).catchError((error) { + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + activityAreaList.clear(); + activityAreaList.addAll(baseData.data); + setState(() { + refreshController.refreshCompleted(); + }); + } else { + refreshController.refreshFailed(); + } + } + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + physics: BouncingScrollPhysics(), + controller: _scrollController, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + seckillProduct(), + seckilList(), + ], + ), + ); + } + + Widget seckillProduct() { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.h), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + child: Column( + children: [ + swiper(), + seckillIndex == 0 ? + Container( + width: double.infinity, + alignment: Alignment.center, + height: 62.h, + padding: EdgeInsets.only(left: 16.w,right: 16.w), + decoration: BoxDecoration( + color: Color(0xFFFFEED9)), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/ms.png", + width:38, + height:38, + fit: BoxFit.contain, + ), + SizedBox(width: 14.w,), + Expanded(child:ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + itemCount:activityAreaList != null ? activityAreaList.length : 0, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + setState(() { + }); + }, + child: timeItem(activityAreaList[position],position), + ); + }, + )) + , + ], + ), + ) + : Container( + width: double.infinity, + alignment: Alignment.center, + height: 62.h, + padding: EdgeInsets.only(left: 16.w,right: 16.w), + decoration: BoxDecoration( + color: Color(0xFFFFEED9)), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/ms_t.png", + width:38, + height:38, + fit: BoxFit.contain, + ), + Spacer(), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "距秒杀结束还有", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + TextSpan( + text: "0", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFB312B), + ), + ), + TextSpan( + text: "天", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + ], + ), + ), + SizedBox(width: 4.w), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center,children: [ + InkWell( + onTap: () { + setState(() { + }); + }, + child:Container( + width: 20, + height: 20, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFB312B), + borderRadius: BorderRadius.circular(1)), + child: Text( + "22", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + Padding(padding:EdgeInsets.only(left: 2.w,right: 2.w), + child:Text( + ":", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFFFB312B), + ), + ),), + Container( + width: 20, + height: 20, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFB312B), + borderRadius: BorderRadius.circular(1)), + child: Text( + "22", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + Padding(padding:EdgeInsets.only(left: 2.w,right: 2.w), + child:Text( + ":", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFFFB312B), + ), + ),), + InkWell( + onTap: () { + }, + child: Container( + width: 20, + height: 20, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFB312B), + borderRadius: BorderRadius.circular(1)), + child: Text( + "22", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + ],) + ], + ), + ) + ], + ), + ); + } + + Widget swiper() { + return Container( + child: AspectRatio( + aspectRatio: 1.3698, + child: Stack( + children: [ + MImage( + "", + width:double.infinity, + height: 330.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + margin: EdgeInsets.only(left: 16, top: 52), + padding: EdgeInsets.all(5), + child: Icon( + Icons.arrow_back_ios, + size: 24, + color: Colors.black, + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child:Container( + margin: EdgeInsets.only(top: 52), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Color.fromRGBO(0, 0, 0, 69000000), + ), + width:160.w, + height: 30.h, + child: Row( + children: [ + GestureDetector( + onTap: (){ + setState(() { + seckillIndex =0; + }); + }, + child: Container( + alignment: Alignment.center, + width: 72.w, + height:22.h, + margin: EdgeInsets.only(left:6.w), + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + seckillIndex == 0 ? Color(0xFFF67E5F):Colors.transparent, + seckillIndex == 0 ? Color(0xFFFC5237):Colors.transparent, + ]), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Opacity( + opacity: seckillIndex == 0 ? 1 :0.5, + child: Text( + "限时秒杀", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ) + ) + ), + GestureDetector( + onTap: (){ + setState(() { + seckillIndex = 1; + }); + }, + child: Container( + alignment: Alignment.center, + width: 72.w, + height:22.h, + margin: EdgeInsets.only(left:6.w), + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + seckillIndex == 1 ? Color(0xFFF67E5F):Colors.transparent, + seckillIndex == 1 ? Color(0xFFFC5237):Colors.transparent, + ]), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child:Opacity( + opacity: seckillIndex == 1 ? 1 :0.5, + child: Text( + "限天秒杀", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ) + ) + ), + ], + ), + ), + ), + ], + ), + ), + ); + } + + ///秒杀列表 + Widget seckilList() { + return Container( + height: MediaQuery.of(context).size.height-62.h-MediaQuery.of(context).padding.top, + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount:10, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: _scrollPhysics, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + setState(() {}); + }, + child: seckilItem(), + ); + }, + ), + ); + } + + Widget timeItem(ActivityAreaList activityAreaList,position) { + return Container( + margin: EdgeInsets.only(right:12.w,top:8.h,bottom:8.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + activityAreaList.timeProductList[position].actTime.startHour, + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFC3127), + ), + ), + Expanded(child: Container( + alignment: Alignment.center, + width:48.w, + height:15.h, + decoration: BoxDecoration( + color: Color(0xFFFB312B), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Text( + "已结束", + style: TextStyle( + fontSize:10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + )) + ], + ), + ); + } + + Widget seckilItem() { + return Container( + margin: EdgeInsets.only(right:12.w,top: 12.h,bottom: 12.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // MImage( + // "", + // width: 94.w, + // height: 94.h, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 94, + height: 94, + fit: BoxFit.cover, + ), + SizedBox(width:12.w,), + Expanded(child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "[生态小农]山林放养鸡蛋30枚/盒", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + Text( + "限量45件", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(6.5), + child: + Stack( + children: [ + Container( + width: 180.w, + height: 8.h, + color: Color(0xFFF5F5F5), + ), + Container( + width: 100.w, + height: 8.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [Color(0xFFFDBA56), Color(0xFFFB2B2B)])), + ) + ], + )), + SizedBox(width: 5,), + Text( + "已售67%", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ], + ), + Row( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFB2E2C), + ), + ), + TextSpan( + text: "123.00", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFB2E2C), + ), + ), + ], + ), + ), + Expanded(child: Text( + "¥234.00", + style: TextStyle( + fontSize: 10.sp, + decoration: TextDecoration.lineThrough, + decorationColor: Color(0xFF585858), + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ),), + Container( + alignment: Alignment.center, + width:60.w, + height:24.h, + decoration: BoxDecoration( + color: Color(0xFFFB312B), + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Text( + "马上抢", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ), + // Container( + // alignment: Alignment.center, + // width:60.w, + // height:24.h, + // decoration: BoxDecoration( + // color: Color(0xFFE2F6EA), + // borderRadius: BorderRadius.circular(12), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ), + // ], + // ), + // child: Text( + // "即将开始", + // style: TextStyle( + // fontSize:12.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xFF52AF79), + // ), + // ), + // ), + // Container( + // alignment: Alignment.center, + // width:60.w, + // height:24.h, + // decoration: BoxDecoration( + // color: Colors.transparent, + // borderRadius: BorderRadius.circular(12), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ), + // ], + // ), + // child: Text( + // "已结束", + // style: TextStyle( + // fontSize:12.sp, + // fontWeight: MyFontWeight.medium, + // color: Color(0xFFADADAD), + // ), + // ), + // ), + ], + ), + ], + ),) + ], + ), + ); + } + +} diff --git a/lib/store/shopping/shopping_cart/cart_goods_list.dart b/lib/store/shopping/shopping_cart/cart_goods_list.dart new file mode 100644 index 00000000..fccc1bec --- /dev/null +++ b/lib/store/shopping/shopping_cart/cart_goods_list.dart @@ -0,0 +1,203 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +class CartGoodsList extends StatefulWidget { + + @override + State createState() { + return _CartGoodsList(); + } +} + +class _CartGoodsList extends State { + RefreshController refreshController = RefreshController(); + ApiService apiService; + int pageNum = 0; + + @override + void initState() { + super.initState(); + _onRefresh(); + } + + _onRefresh() async { + pageNum = 0; + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height - + 103.h - + MediaQuery.of(context).padding.top, + child: SmartRefresher( + controller: refreshController, + enablePullUp: false, + enablePullDown: true, + physics: BouncingScrollPhysics(), + header: MyHeader(), + onRefresh: () { + }, + child: ListView.builder( + itemCount:6, + padding: EdgeInsets.only( + top: 8.h, + bottom: 84.h, /* + (375.h - 88.h) + 4.h*/ + ), + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return InkWell( + onTap: () { + }, + child: cartGoodsItem(), + ); + }), + ), + ); + } + + Widget cartGoodsItem() { + return Container( + margin: EdgeInsets.all(16), + padding: EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + // ? "assets/image/icon_radio_selected.png" : + "assets/image/icon_radio_unselected.png", + width:16, + height:16, + ), + SizedBox(width: 16.w), + // MImage( + // "assets/image/icon_story_td.png", + // isCircle: true, + // width:81, + // height:81, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 81, + height: 81, + fit: BoxFit.cover, + ), + SizedBox(width: 10.w), + Expanded(child: + Container( + height:81.h,child:Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "[生态小农]山林放养鸡蛋30枚/盒", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + // SizedBox(height: 5.h), + Text( + "套盒装", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF727272), + ), + ), + // SizedBox(height: 5.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child:Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "58.2", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + ], + ), + )), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center,children: [ + InkWell( + onTap: () { + setState(() { + }); + }, + child: Image.asset( + "assets/image/reduce.png", + width: 22, + height: 22, + ), + ), + Container( + width: 30, + alignment: Alignment.center, + 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, + ), + ), + ],) + ], + ), + ], + )),), + ], + ), + ); + } +} diff --git a/lib/store/shopping/shopping_cart/shopping_cart_page.dart b/lib/store/shopping/shopping_cart/shopping_cart_page.dart new file mode 100644 index 00000000..035ed866 --- /dev/null +++ b/lib/store/shopping/shopping_cart/shopping_cart_page.dart @@ -0,0 +1,241 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/store/shopping/shopping_home/recommend_goods_list_view.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import 'cart_goods_list.dart'; + +class ShoppingCartPage extends StatefulWidget { + @override + State createState() { + return _ShoppingCartPage(); + } +} + +class _ShoppingCartPage extends State + with AutomaticKeepAliveClientMixin { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + final SwiperController controller = SwiperController(); + + @override + void dispose() { + super.dispose(); + if (refreshController != null) refreshController.dispose(); + } + + final RefreshController refreshController = RefreshController(); + + @override + Widget build(BuildContext context) { + super.build(context); + return Stack( + children: [ + Column( + children: [ + MyAppBar( + title: "购物车", + titleColor: Colors.black, + leadingColor: Colors.black, + background: Colors.transparent, + actions: [ + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(right: 12.w), + child: GestureDetector( + onTap: () { + + }, + child: Text("管理", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color:Colors.black, + ), + ), + ), + ), + // Container( + // alignment: Alignment.center, + // margin: EdgeInsets.only(right: 12.w), + // child: GestureDetector( + // onTap: () { + // + // }, + // child: Text(S.of(context).quxiao, + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: MyFontWeight.semi_bold, + // color:Colors.black, + // ), + // ), + // ), + // ), + ], + ), + 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: [ + ///购物车商品列表 + CartGoodsList(), + ], + ); + }, + ), + ), + ), + ), + ), + ], + ), + Align( + alignment: Alignment(0.8,0.8), + child: Container( + height:70.h, + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + color: Color(0xFFFAFAFA), + ), + padding: EdgeInsets.only(left: 16.w,right: 16.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/icon_radio_unselected.png", + width: 16, + height: 16, + ), + SizedBox(width: 5.w), + Expanded(child: Text( + "全选", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA29E9E), + ), + ),), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "合计:", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + TextSpan( + text: "¥20.4", + style: TextStyle( + fontSize: 20.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + + ], + ), + ), + Container( + alignment: Alignment.center, + width: 70.w, + height: 32.h, + margin: EdgeInsets.only(left:6.w), + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Text( + "结算", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + ), + // Container( + // alignment: Alignment.center, + // width: 70.w, + // height: 32.h, + // margin: EdgeInsets.only(left:6.w), + // decoration: BoxDecoration( + // color: Color(0xFFFB312B), + // borderRadius: BorderRadius.circular(16), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ), + // ], + // ), + // child: Text( + // "删除", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.regular, + // color: Colors.white, + // ), + // ), + // ), + ], + ), + ), + ), + ], + ); + } + + + @override + bool get wantKeepAlive => true; +} diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart new file mode 100644 index 00000000..72b7bb27 --- /dev/null +++ b/lib/store/shopping/shopping_goods_details.dart @@ -0,0 +1,1235 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_html/image_render.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/goods.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ShoppingGoodsDetails extends StatefulWidget { + @override + State createState() { + return _ShoppingGoodsDetails(); + } +} + +class _ShoppingGoodsDetails extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + + SharedPreferences.getInstance().then((value) { + apiService = + ApiService(Dio(), context: context, token: value.getString("token")); + }); + } + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Container( + color: Color(0xFFF7F7F7), + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildColumn(), + + ///拼团 + groupOption(), + + ///拼团规则 + groupRule(), + goodsOption(), + Padding( + padding: EdgeInsets.only(top: 16.h, bottom: 12.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 21, + height: 1.h, + color: Color(0xFF979797), + ), + Text( + "商品详情", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF585858), + ), + ), + Container( + width: 21, + height: 1.h, + color: Color(0xFF979797), + ), + ], + ), + ), + Container( + color: Colors.white, + child: Html( + data: "", + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, + ), + ), + ], + ), + ), + flex: 1, + ), + ], + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + height:80.h, + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + color: Color(0xFFFAFAFA), + ), + padding: EdgeInsets.only(left: 16.w, right: 16.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context) + .pushNamed('/router/shopping_mall_home', arguments: { + "type": 1, + }); + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + "assets/image/goods_cart.png", + width: 24, + height: 24, + ), + Text( + "购物车", + style: TextStyle( + fontSize: 9.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + ], + ), + ), + GestureDetector( + onTap: () { + setState(() { + // showCallMobile)(); + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + "assets/image/goods_phone.png", + width: 24, + height: 24, + ), + Text( + "联系平台", + style: TextStyle( + fontSize: 9.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + ], + ), + ), + payButton(), + ], + ), + ), + ), + ], + ); + } + + ///购买按钮 + Widget payButton() { + return Container( + child: Row( + children: [ + // GestureDetector( + // child:Container( + // alignment: Alignment.center, + // width: 120.w, + // height:37.h, + // margin: EdgeInsets.only(left:6.w), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(16), + // border: Border.all( + // width: 1, + // color: Color(0xFF32A060), + // style: BorderStyle.solid, + // ), + // ), + // child: Text( + // "加入购物车", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.regular, + // color: Color(0xFF32A060), + // ), + // ), + // ), + // ), + // GestureDetector( + // child: Container( + // alignment: Alignment.center, + // width: 120.w, + // height:37.h, + // margin: EdgeInsets.only(left:6.w), + // decoration: BoxDecoration( + // color: Color(0xFF32A060), + // borderRadius: BorderRadius.circular(16), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ), + // ], + // ), + // child: Text( + // "立即购买", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.regular, + // color: Colors.white, + // ), + // ), + // ) + // ), + ///秒杀按钮 + GestureDetector( + onTap: (){ + Navigator.of(context).popAndPushNamed('/router/group_details'); + }, + child: Container( + alignment: Alignment.center, + width: 120.w, + height:40.h, + margin: EdgeInsets.only(left: 6.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + border: Border.all( + width: 1, + color: Color(0xFF32A060), + style: BorderStyle.solid, + ), + ), + child: Column( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 7.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + ], + ), + ), + Expanded(child: + Text( + "原价购买", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + )), + ], + ), + ), + ), + GestureDetector( + onTap: (){ + Navigator.of(context).popAndPushNamed('/router/bargain_details'); + }, + child: Container( + alignment: Alignment.center, + width: 120.w, + height: 40.h, + margin: EdgeInsets.only(left: 6.w), + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 7.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ], + ), + ), + Expanded(child: + Text( + "我要秒杀", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ),), + ], + ), + )), + ], + ), + ); + } + + Widget buildColumn() { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.h), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + child: Column( + children: [ + swiper(), + Container( + width: double.infinity, + alignment: Alignment.center, + height: 50.h, + padding: EdgeInsets.only(left: 16.w), + decoration: BoxDecoration( + // image: DecorationImage( + // fit: BoxFit.fill, + // image: AssetImage("assets/image/attainment_bj.png"), + // ), + color: Colors.green), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + TextSpan( + text: "282.00", + style: TextStyle( + fontSize: 28.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ], + ), + ), + SizedBox(width: 4.w), + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "原价¥283.00", + style: TextStyle( + fontWeight: MyFontWeight.regular, + decoration: TextDecoration.lineThrough, + decorationColor: Colors.white, + fontSize: 9.sp, + color: Colors.white, + ), + ), + Text( + "已售12件", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 10.sp, + color: Colors.white, + ), + ), + ], + ) + ], + ), + ), + Container( + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + "[前进麦味]全麦吐司250g", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xFF353535), + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 8, right: 8), + padding: EdgeInsets.only(left: 2, right: 2), + height: 17.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF5A5A5A), + ), + child: Text( + "中国大陆5仓", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + ), + ], + ), + SizedBox( + height: 8.h, + ), + Text( + "人生没有标准答案,一切答案都在行动中,前进卖完也是一样,用真诚行动践行标准的定义", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 13.sp, + color: Color(0xFF585858), + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget swiper() { + return Container( + child: AspectRatio( + aspectRatio: 1.3698, + child: Stack( + children: [ + Swiper( + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + itemBuilder: (context, position) { + return + // goods == null + // ? + Container() + // : Image.network( + // goods.viceImgPaths.elementAt(position), + // fit: BoxFit.cover, + // ) + ; + }, + itemCount: 3, + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + margin: EdgeInsets.only(left: 16, top: 52), + padding: EdgeInsets.all(5), + child: Image.asset( + "assets/image/integral_return.png", + // alignment: Alignment.center, + width: 24, + height: 24, + ), + ), + ), + ], + ), + ), + ); + } + + ///快递/規格/退款 + Widget goodsOption() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.h), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(top: 16.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "快递", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA2A2A2), + ), + ), + SizedBox( + width: 8.w, + ), + Expanded( + child: Text( + "免邮费(吉林省、黑龙江省、西藏自治区、新疆维吾尔自治区、香港特别行政区除外)", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + ], + ), + Container( + margin: EdgeInsets.only(left: 32.w, top: 8.h, bottom: 8.h), + width: double.infinity, + height: 1.h, + color: Color(0xFFF1F1F1), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "规格", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA2A2A2), + ), + ), + SizedBox( + width: 8.w, + ), + Expanded( + child: Text( + "250ml/瓶*2(礼盒装)", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + GestureDetector( + onTap: () {}, + child: Icon( + Icons.arrow_forward_ios, + color: Colors.black, + size: 16.sp, + ), + ), + ], + ), + Container( + margin: EdgeInsets.only(left: 32.w, top: 8.h, bottom: 8.h), + width: double.infinity, + height: 1.h, + color: Color(0xFFF1F1F1), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "退款", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA2A2A2), + ), + ), + SizedBox( + width: 8.w, + ), + Expanded( + child: Text( + "如需退款请联系商家,待商家确认后,将进行退款。", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + ], + ), + ], + ), + ); + } + + ///拼团 + Widget groupOption() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.h), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(top: 16.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + "可参加的团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), + ), + ), + ), + GestureDetector( + onTap: (){ + setState(() { + Navigator.of(context).popAndPushNamed('/router/group_page_details'); + }); + }, + child: Text( + "更多", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF585858), + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 16, + color: Colors.black, + ), + ], + ), + SizedBox(height: 12.h), + ListView.builder( + padding: EdgeInsets.zero, + itemCount: 2, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + setState(() {}); + }, + child: groupItem(), + ); + }, + ), + ], + ), + ); + } + + Widget groupItem() { + return Container( + margin: EdgeInsets.only(top: 8.h, bottom: 8.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // MImage( + // "", + // width:30, + // height:30, + // fit: BoxFit.cover, + // isCircle: true, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 30, + height: 30, + fit: BoxFit.cover, + ), + SizedBox(width: 4.w), + Expanded( + child: Text( + "团长名称", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + )), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "还差:", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + TextSpan( + text: "1", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "人", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ], + ), + ), + Text( + "剩余23:12:12", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ], + ), + Container( + alignment: Alignment.center, + width: 53.w, + height: 22.h, + margin: EdgeInsets.only(left: 4.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(13), + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFF61CE6B), + Color(0xFF32A057), + ]), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Text( + "去参团", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ) + ], + ), + ); + } + + ///拼团规则 + Widget groupRule() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(8.h), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(top: 16.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "拼团规则", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), + ), + ), + SizedBox(height: 12.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zu_tuan.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 51, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "开团/参团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "拼团享低价", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + Container( + width: 43, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zt_zf.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 51, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "成功支付", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "下单可开团", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + Container( + width: 43, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/yq_zt.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 51, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "邀请参团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "一起享优惠", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + Container( + width: 43, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Image.asset( + "assets/image/zt_m.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + SizedBox(height: 8.h), + Text( + "人满成团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "人不满退款", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + ], + ), + ], + ), + ); + } + + ///联系电话 +// showCallMobile() { +// showCupertinoModalPopup( +// context: context, +// builder: (context) { +// return CupertinoActionSheet( +// title: Text(S.of(context).bodadianhua), +// actions: [ +// if (widget.storeInfo != null && +// widget.storeInfo.tel != null && +// widget.storeInfo.tel != "") +// CupertinoActionSheetAction( +// child: Text(widget.storeInfo.tel), +// onPressed: () { +// callMobile(widget.storeInfo.tel); +// Navigator.of(context).pop(); +// }, +// isDefaultAction: true, +// isDestructiveAction: false, +// ), +// ], +// cancelButton: CupertinoActionSheetAction( +// onPressed: () { +// Navigator.of(context).pop(); +// }, +// child: Text(S.of(context).quxiao), +// isDestructiveAction: true, +// ), +// ); +// }); +// } +// +// callMobile(mobile) async { +// String url = "tel:$mobile"; +// if (await canLaunch(url)) { +// await launch(url); +// } else { +// throw 'Could not launch $url'; +// } +// } + +} diff --git a/lib/store/shopping/shopping_home/activity_banner.dart b/lib/store/shopping/shopping_home/activity_banner.dart new file mode 100644 index 00000000..83bf20ce --- /dev/null +++ b/lib/store/shopping/shopping_home/activity_banner.dart @@ -0,0 +1,205 @@ +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/retrofit/data/banner.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ActivityBanner extends StatefulWidget { + final List bannerData; + final SwiperController controller; + + ActivityBanner(this.bannerData, this.controller); + + @override + State createState() { + return _ActivityBanner(); + } +} + +class _ActivityBanner extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + List bannerData = []; + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(bottom:10), + child: AspectRatio( + aspectRatio: 1.23, + child: Swiper( + viewportFraction: 0.9, + scale: 0.73, + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return Column( + children: [ + InkWell( + onTap: () { + bannerClick(widget.bannerData[position]); + }, + child: + // MImage( + // (widget.bannerData != null && + // position < widget.bannerData.length) + // ? widget.bannerData[position].imgUrl + // : "", + // width:double.infinity, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_2_1.png", + // fadeSrc: "assets/image/default_2_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + height:185, + width:double.infinity, + fit: BoxFit.cover, + ), + ), + // Expanded(child: child) + Container( + height: 138, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.vertical(bottom: Radius.circular(8)), + ), + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(horizontal: 12), + itemCount: 4, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/shopping_goods_details', + arguments: {}, + ); + }, + child: activityBannerItem(), + ); + }, + ), + ), + ], + ); + }, + itemCount: + (widget.bannerData != null && widget.bannerData.length > 0) + ? widget.bannerData.length + : 1), + ), + ); + } + + Widget activityBannerItem() { + return Container( + margin: EdgeInsets.only(right:7.w,left:7.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // MImage( + // "assets/image/icon_story_td.png", + // isCircle: true, + // width: 70.w, + // height: 70.h, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 70, + height: 70, + fit: BoxFit.cover, + ), + SizedBox( + height: 4, + ), + Text( + "[一心回乡]甄果", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "12.60", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + ], + ), + ), + ], + ), + ); + } + + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + bannerClick(BannerData bannerData) async { + switch (bannerData.contentType) { + case 1: + Navigator.of(context).pushNamed('/router/integral_store_page', + arguments: {"goodsId": bannerData.content}); + break; + case 2: + Navigator.of(context).pushNamed('/router/web_page', arguments: { + "activityId": bannerData.content, + }); + break; + case 3: + Navigator.of(context).pushNamed('/router/web_page', arguments: { + "articleId": bannerData.content, + }); + break; + case 4: + String router = bannerData.content; + if (router.contains("?")) { + String params = router.substring(router.indexOf("?")); + params = params.replaceAll("?", ""); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(router, arguments: map); + } else { + Navigator.of(context).pushNamed(router); + } + break; + case 5: + Navigator.of(context).pushNamed('/router/class_details', arguments: { + "id": bannerData.content, + }); + break; + } + } +} diff --git a/lib/store/shopping/shopping_home/bargain_details.dart b/lib/store/shopping/shopping_home/bargain_details.dart new file mode 100644 index 00000000..b5d04bdb --- /dev/null +++ b/lib/store/shopping/shopping_home/bargain_details.dart @@ -0,0 +1,753 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class BargainDetails extends StatefulWidget { + @override + State createState() { + return _BargainDetails(); + } +} + +class _BargainDetails extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + final SwiperController controller = SwiperController(); + + @override + void dispose() { + super.dispose(); + if (refreshController != null) refreshController.dispose(); + } + + final RefreshController refreshController = RefreshController(); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Container( + color: Color(0xFFF7F7F7), + ), + Stack( + children: [ + Container( + height: 330.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFFE8F5E9), + Color(0xFFE5F7FF), + ]), + ), + ), + Column( + children: [ + MyAppBar( + title: "砍价详情", + titleColor: Colors.black, + leadingColor: Colors.black, + background: Colors.transparent, + ), + 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: [ + bargainGoodsInfo(), + bargainProgress(), + bargainRule(), + bargainFriendsList(), + ], + ); + }, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ], + ); + } + + ///商品信息b + Widget bargainGoodsInfo() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(2), + child: Image.asset( + "assets/image/icon_story_td.png", + width: 85, + height: 85, + fit: BoxFit.cover, + ), + ), + // MImage( + // "", + // width: double.infinity, + // height: 166, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + SizedBox( + width: 10, + ), + Expanded( + child: Container( + height: 85, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "[生态小农]山林放养鸡蛋30枚/盒备份 2", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + Text( + "套盒装", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF9476F7), + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF9476F7), + ), + ), + ], + ), + ), + ], + ), + )) + ], + ), + ); + } + + ///砍价进度 + Widget bargainProgress() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container(margin: EdgeInsets.only(left: 10),child: + Stack( + alignment: Alignment.bottomLeft, + children: [ + Container( + alignment: Alignment.center, + width:67, + height:23.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: Color(0xFF9476F7), + ), + child: Text( + "砍价成功", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + ), + Align( + alignment: Alignment.bottomLeft, + child: + Container(height:8,child: Icon( + Icons.arrow_drop_down, + color: Color(0xFF9476F7), + size: 18, + ),), + ), + ], + ),), + SizedBox(height:10), + ClipRRect( + borderRadius: BorderRadius.circular(6.5), + child: + Stack( + children: [ + Container( + width:double.infinity, + height: 8.h, + color: Color(0xFFF5F5F5), + ), + Container( + width: 100.w, + height: 8.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [Color(0xFFFEC401), Color(0xFF9274F7)])), + ) + ], + )), + SizedBox(height: 3,), + Row( + children: [ + Expanded(child:Text( + "原价¥284.00", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF8D8D8D), + ), + ),), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "最低价¥", + style: TextStyle( + fontSize:9.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF9476F7), + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF9476F7), + ), + ), + + ], + ), + ), + ], + ), + SizedBox(height:16), + Row(children: [ + Expanded(child: GestureDetector( + child:Container( + alignment: Alignment.center, + width:double.infinity, + height:54.h, + margin: EdgeInsets.only(left:6.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + border: Border.all( + width: 1, + color: Color(0xFF9476F7), + style: BorderStyle.solid, + ), + ), + child: Text( + "我也要砍", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF9476F7), + ), + ), + ), + )), + // Expanded(child:GestureDetector( + // child: Container( + // alignment: Alignment.center, + // width:double.infinity, + // height:54.h, + // margin: EdgeInsets.only(left:6.w), + // decoration: BoxDecoration( + // color: Color(0xFF9476F7), + // borderRadius: BorderRadius.circular(27), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ), + // ], + // ), + // child: Text( + // "帮他砍价", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.white, + // ), + // ), + // ) + // ),), + Expanded(child:GestureDetector( + child: Container( + alignment: Alignment.center, + width:double.infinity, + height:54.h, + margin: EdgeInsets.only(left:6.w), + decoration: BoxDecoration( + color: Color(0xFFE5E5E5), + borderRadius: BorderRadius.circular(27), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Text( + "已帮TA砍价", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF858585), + ), + ), + ) + ),), + ],), + // Container( + // alignment: Alignment.center, + // width:double.infinity, + // height:54.h, + // margin: EdgeInsets.only(left:6.w), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(27), + // color: Color(0xFF9476F7), + // ), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Image.asset( + // "assets/image/wx.png", + // width:24, + // height:24, + // fit: BoxFit.cover, + // ), + // SizedBox( + // width:8, + // ), + // Text( + // "邀请微信好友一起拼团", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.white, + // ), + // ) + // ], + // ) + // ) + ], + ), + ); + } + + ///砍价规则 + Widget bargainRule() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 3, + height: 3, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 5, + height: 5, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 8, + height: 8, + margin: EdgeInsets.only(right: 4), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Text( + "砍价规则", + style: TextStyle( + fontSize:15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + Container( + width: 8, + height: 8, + margin: EdgeInsets.only(right: 10, left: 4), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 5, + height: 5, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 3, + height: 3, + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + ], + ), + SizedBox( + height: 12, + ), + Text( + "1.选择自己喜欢的商品,邀请好友砍价,每次砍价金额以页面显示为主,邀请的越多,砍价成功的几率越高。", + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize:12.sp, + height: 1.5, + fontWeight: MyFontWeight.medium, + ), + ), + Text( + "2.砍价成功后,点击立即购买,将以最终价格进行结算。", + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize:12.sp, + height: 1.5, + fontWeight: MyFontWeight.medium, + ), + ), + Text( + "3.砍价商品不享受平台活动,优惠券以及会员折扣。", + style: TextStyle( + color: Color(0xFF4C4C4C), + fontSize:12.sp, + height: 1.5, + fontWeight: MyFontWeight.medium, + ), + ), + ], + ), + ); + } + + ///砍价好友榜 + Widget bargainFriendsList() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 3, + height: 3, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 5, + height: 5, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 8, + height: 8, + margin: EdgeInsets.only(right: 4), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Text( + "好友砍价榜", + style: TextStyle( + fontSize:15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + Container( + width: 8, + height: 8, + margin: EdgeInsets.only(right: 10, left: 4), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 5, + height: 5, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 3, + height: 3, + decoration: BoxDecoration( + color: Color(0xFF9476F7), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + ], + ), + SizedBox( + height:20, + ), + Container( + alignment: Alignment.center, + width: double.infinity, + child: ListView.builder( + shrinkWrap: true, + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + physics: BouncingScrollPhysics(), + itemCount: 3, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: bargainFriendsItem(), + ); + }, + ), + // (coupons != null && coupons.length > 0) + // ? ListView.builder( + // padding: EdgeInsets.symmetric(vertical: 8.h), + // itemBuilder: (context, position) { + // return GestureDetector( + // onTap: () { + // Navigator.of(context).pushNamed( + // '/router/vip_details_page', + // arguments: {"id": coupons[position].id}); + // }, + // child: vipCardItem(coupons[position]), + // ); + // }, + // itemCount: coupons != null ? coupons.length : 0, + // ) + // : NoDataView( + // isShowBtn: false, + // text: "暂无好友帮忙砍价~", + // fontSize: 16.sp, + // margin: EdgeInsets.only(top: 120.h), + // ), + ), + SizedBox( + height:20, + ), + ], + ), + ); + } + + Widget bargainFriendsItem() { + return Container( + height: 36.h, + margin: EdgeInsets.only(bottom:10), + child:Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + // MImage( + // "", + // width:34, + // height:34, + // fit: BoxFit.cover, + // isCircle: true, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 34, + height: 34, + fit: BoxFit.cover, + ), + SizedBox(width: 4,), + Expanded(child:Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "张三", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + Text( + "3分钟前", + style: TextStyle( + fontSize:10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFACACAC), + ), + ), + ], + )), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "已砍", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + TextSpan( + text: "23.00元", + style: TextStyle( + fontSize:11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF9476F7), + ), + ), + ], + ), + ), + ], + ) + ); + } + +} diff --git a/lib/store/shopping/shopping_home/classify_list.dart b/lib/store/shopping/shopping_home/classify_list.dart new file mode 100644 index 00000000..aaeecec4 --- /dev/null +++ b/lib/store/shopping/shopping_home/classify_list.dart @@ -0,0 +1,97 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ClassifyList extends StatefulWidget { + + @override + State createState() { + return _ClassifyList(); + } +} + +class _ClassifyList extends State { + ApiService apiService; + BMFCoordinate latLng; + + final TextEditingController editingController = TextEditingController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: 100.h, + margin: EdgeInsets.only(top:12.h,left: 16.w,right: 16.w), + padding: EdgeInsets.only(bottom: 3.h, top: 16.h,), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + color: Colors.white, + ), + child: ListView.builder( + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.symmetric(horizontal: 14), + itemCount:15, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/search_page'); + }, + child: classifyItem(), + ); + }, + ), + ); + } + + Widget classifyItem() { + return Container( + // height:94.h, + margin: EdgeInsets.only(right: 19.w), + child: Column( + children: [ + // MImage( + // "assets/image/icon_story_td.png", + // isCircle: true, + // width: 48.w, + // height: 48.h, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 48, + height: 48, + fit: BoxFit.cover, + ), + SizedBox(height: 4,), + Text( + "时令水果", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), + ); + } +} diff --git a/lib/store/shopping/shopping_home/group_details.dart b/lib/store/shopping/shopping_home/group_details.dart new file mode 100644 index 00000000..350a698b --- /dev/null +++ b/lib/store/shopping/shopping_home/group_details.dart @@ -0,0 +1,888 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class GroupDetails extends StatefulWidget { + @override + State createState() { + return _GroupDetails(); + } +} + +class _GroupDetails extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + final SwiperController controller = SwiperController(); + + @override + void dispose() { + super.dispose(); + if (refreshController != null) refreshController.dispose(); + } + + final RefreshController refreshController = RefreshController(); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Container( + color: Color(0xFFF7F7F7), + ), + Stack( + children: [ + Container( + height: 330.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFFE8F5E9), + Color(0xFFE5F7FF), + ]), + ), + ), + Column( + children: [ + MyAppBar( + title: "拼团详情", + titleColor: Colors.black, + leadingColor: Colors.black, + background: Colors.transparent, + ), + 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: [ + goodsInfo(), + inviteGroup(), + groupRule(), + ], + ); + }, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ], + ); + } + + ///商品信息 + Widget goodsInfo() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(2), + child: Image.asset( + "assets/image/icon_story_td.png", + width: 85, + height: 85, + fit: BoxFit.cover, + ), + ), + // MImage( + // "", + // width: double.infinity, + // height: 166, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + SizedBox( + width: 10, + ), + Expanded( + child: Container( + height: 85, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "[生态小农]山林放养鸡蛋30枚/盒备份 2", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + Text( + "套盒装", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + ], + ), + ), + ], + ), + )) + ], + ), + ); + } + + ///邀请好友拼团 + Widget inviteGroup() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 3, + height: 3, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFFB8BAC1), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 5, + height: 5, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFFB8BAC1), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 8, + height: 8, + margin: EdgeInsets.only(right: 4), + decoration: BoxDecoration( + color: Color(0xFFB8BAC1), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Text( + "拼团剩余时间", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + Container( + width: 8, + height: 8, + margin: EdgeInsets.only(right: 10, left: 4), + decoration: BoxDecoration( + color: Color(0xFFB8BAC1), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 5, + height: 5, + margin: EdgeInsets.only(right: 10), + decoration: BoxDecoration( + color: Color(0xFFB8BAC1), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + Container( + width: 3, + height: 3, + decoration: BoxDecoration( + color: Color(0xFFB8BAC1), + borderRadius: BorderRadius.all(Radius.circular(5))), + ), + ], + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () {}, + child: Container( + width: 27, + height: 28, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFD2D2D2), + borderRadius: BorderRadius.circular(4)), + child: Text( + "22", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(left: 10, right: 10), + child: Text( + ":", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFD2D2D2), + ), + )), + InkWell( + onTap: () {}, + child: Container( + width: 27, + height: 28, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFD2D2D2), + borderRadius: BorderRadius.circular(4)), + child: Text( + "59", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only(left: 10, right: 10), + child: Text( + ":", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFD2D2D2), + ), + )), + InkWell( + onTap: () {}, + child: Container( + width: 27, + height: 28, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFD2D2D2), + borderRadius: BorderRadius.circular(4)), + child: Text( + "59", + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ), + ), + ), + ], + ), + SizedBox( + height: 24, + ), + // Text( + // "恭喜您拼团成功", + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Colors.black, + // ), + // ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "距离拼团成功还差", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + TextSpan( + text: "2", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFF8961E), + ), + ), + TextSpan( + text: "人", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + ], + ), + ), + // Text( + // "很遗憾,拼团失败", + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Colors.black, + // ), + // ), + SizedBox( + height: 32, + ), + Container( + alignment: Alignment.center, + width: double.infinity, + height: 75.h, + child: ListView.builder( + shrinkWrap: true, + padding: EdgeInsets.zero, + scrollDirection: Axis.horizontal, + physics: BouncingScrollPhysics(), + itemCount: 3, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: groupItem(), + ); + }, + ), + ), + SizedBox( + height:54.h, + ), + InkWell( + onTap: () { + setState(() { + }); + }, + child:Container( + width:double.infinity, + height:54.h, + margin: EdgeInsets.only(bottom: 28), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF00A359), + borderRadius: BorderRadius.circular(27)), + child: Text( + "查看拼团订单", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + )), + ), + // InkWell( + // onTap: () { + // setState(() { + // }); + // }, + // child:Container( + // width:double.infinity, + // height:54.h, + // margin: EdgeInsets.only(bottom: 28), + // alignment: Alignment.center, + // decoration: BoxDecoration( + // color: Color(0xFF00A359), + // borderRadius: BorderRadius.circular(27)), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Image.asset( + // "assets/image/wx.png", + // width:24, + // height:24, + // fit: BoxFit.cover, + // ), + // SizedBox( + // width:8, + // ), + // Text( + // "邀请微信好友一起拼团", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.white, + // ), + // ) + // ], + // )), + // ), + // InkWell( + // onTap: () { + // setState(() { + // }); + // }, + // child:Container( + // width:double.infinity, + // height:54.h, + // margin: EdgeInsets.only(bottom: 28), + // alignment: Alignment.center, + // decoration: BoxDecoration( + // color: Color(0xFF00A359), + // borderRadius: BorderRadius.circular(27)), + // child: Text( + // "联系客服退款", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.white, + // ), + // )), + // ), + ], + ), + ); + } + + Widget groupItem() { + return Container( + margin: EdgeInsets.only(right:25), + child:Row( + children: [ + Stack( + children: [ + Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(60), + border: Border.all( + width: 1, + color: Color(0xFFF8961E), + // style: BorderStyle.solid, + ), + ), + child:MImage( + "", + width:60.w, + height:60.h, + fit: BoxFit.cover, + isCircle: true, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + ), + Align( + alignment: Alignment.bottomCenter, + child:Container( + width: 60.w, + child: Container( + width: 34.w, + height:14.h, + alignment: Alignment.center, + margin: EdgeInsets.only(left:10,right:10), + decoration: BoxDecoration( + color: Color(0xFFF8961E), + borderRadius: BorderRadius.circular(7)), + child: Text( + "团长", + style: TextStyle( + fontSize:8.sp, + fontWeight: MyFontWeight.light, + color: Colors.white, + ), + )), + ), + + ) + ], + ), + // Container( + // width: 60.w, + // height: 67.h, + // child:Image.asset( + // "assets/image/pin_t.png", + // width: 60.w, + // height: 60.h, + // fit: BoxFit.cover, + // ), + // ), + ], + ) + ); + } + + ///拼团规则 + Widget groupRule() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h,bottom:40.h), + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "拼团规则", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), + ), + ), + SizedBox(height: 12.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zu_tuan.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width:45, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "开团/参团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "拼团享低价", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + Container( + width:35, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zt_zf.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 45, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "成功支付", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "下单可开团", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + Container( + width: 35, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/yq_zt.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 45, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "邀请参团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "一起享优惠", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + Container( + width: 35, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + ], + ) + ], + ), + Column( + children: [ + Image.asset( + "assets/image/zt_m.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + SizedBox(height: 8.h), + Text( + "人满成团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), + ), + Text( + "人不满退款", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), + ), + ], + ), + ], + ), + ], + ) + ); + } +} diff --git a/lib/store/shopping/shopping_home/group_page_details.dart b/lib/store/shopping/shopping_home/group_page_details.dart new file mode 100644 index 00000000..0e761da7 --- /dev/null +++ b/lib/store/shopping/shopping_home/group_page_details.dart @@ -0,0 +1,214 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class GroupPageDetails extends StatefulWidget { + + @override + State createState() { + return _GroupPageDetails(); + } +} + +class _GroupPageDetails extends State { + RefreshController refreshController = RefreshController(); + ApiService apiService; + int pageNum = 0; + + @override + void initState() { + super.initState(); + _onRefresh(); + } + + _onRefresh() async { + pageNum = 0; + setState(() {}); + } + + @override + Widget build(BuildContext context) { + return Container( + color: Colors.white, + child: Column( + children: [ + MyAppBar( + title:"可参加的团", + titleColor: Colors.black, + leadingColor: Colors.black, + background: Colors.transparent, + ), + Expanded( + child: Container( + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + physics: BouncingScrollPhysics(), + onRefresh: () { + setState(() {}); + }, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: FutureBuilder( + // future: queryHome(), + builder: (context, snapshot) { + return Column( + children: [ + groupList(), + ], + ); + }, + ), + ), + ), + ), + ), + ], + ), + ); + } + + ///参团列表 + Widget groupList() { + return Container( + height: MediaQuery.of(context).size.height-62.h-MediaQuery.of(context).padding.top, + padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount:10, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + setState(() {}); + }, + child: groupItem(), + ); + }, + ), + ); + } + + Widget groupItem() { + return Container( + height: 44.h, + margin: EdgeInsets.only(top: 8.h, bottom: 8.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // MImage( + // "", + // width:44, + // height:44, + // fit: BoxFit.cover, + // isCircle: true, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: 44, + height: 44, + fit: BoxFit.cover, + ), + SizedBox(width: 4.w), + Expanded( + child: Text( + "团长名称", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + )), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "还差:", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + TextSpan( + text: "1", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "人", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ], + ), + ), + Text( + "剩余23:12:12", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ], + ), + Container( + alignment: Alignment.center, + width: 53.w, + height: 22.h, + margin: EdgeInsets.only(left: 4.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(13), + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFF61CE6B), + Color(0xFF32A057), + ]), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Text( + "去参团", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/store/shopping/shopping_home/recommend_goods_list_view.dart b/lib/store/shopping/shopping_home/recommend_goods_list_view.dart new file mode 100644 index 00000000..b98bfa1b --- /dev/null +++ b/lib/store/shopping/shopping_home/recommend_goods_list_view.dart @@ -0,0 +1,214 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class RecommendGoodsListView extends StatefulWidget { + @override + State createState() { + return _RecommendGoodsListView(); + } +} + +class _RecommendGoodsListView extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Text( + "为你推荐", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF1A1A1A), + ), + ), + Container( + color: Color(0xFF32A060), + width: 35.w, + height: 5.h, + ), + GridView.builder( + itemCount: 6, + padding: EdgeInsets.only( + left: 16.w, + right: 16.w, + top: 13.h, + bottom: 16.h, + ), + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 2, + //水平子Widget之间间距 + crossAxisSpacing: 11.w, + //垂直子Widget之间间距 + mainAxisSpacing: 16.w, + //子Widget宽高比例 0.59 + childAspectRatio: + 185 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/shopping_goods_details', + arguments: {}, + ); + }, + child: goodsListItem(), + ); + }, + ) + ], + ); + } + + Widget goodsListItem() { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(8), + ), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(10), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white, + ), + margin: EdgeInsets.symmetric( + vertical: 3, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(10), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: + // MImage( + // "", + // width: double.infinity, + // height: 166, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width: double.infinity, + fit: BoxFit.cover, + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.only(left: 12.w, right: 12.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.only(top: 8, right: 8), + padding: EdgeInsets.only(left: 2, right: 2), + height: 17.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF5A5A5A), + ), + child: Text( + "中国大陆5仓", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + ), + Text( + "已售12件", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5D5D5D), + ), + ), + ], + ), + Text( + "SWISSGEAR瑞士军刀联名款马克杯", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + ], + ), + ), + Text( + "¥283.00", + style: TextStyle( + fontSize: 14.sp, + decoration: TextDecoration.lineThrough, + decorationColor: Color(0xFF585858), + fontWeight: MyFontWeight.regular, + color: Color(0xFFA2A2A2), + ), + ), + ], + ), + ], + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/store/shopping/shopping_home/search_page.dart b/lib/store/shopping/shopping_home/search_page.dart new file mode 100644 index 00000000..f6482224 --- /dev/null +++ b/lib/store/shopping/shopping_home/search_page.dart @@ -0,0 +1,607 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:fluwx/fluwx.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/vip_benefit_list.dart'; +import 'package:huixiang/retrofit/data/vip_rule_details.dart'; +import 'package:huixiang/retrofit/data/wx_pay.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/icon_text.dart'; +import 'package:huixiang/view_widget/item_input_widget.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/round_button.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class SearchPage extends StatefulWidget { + @override + State createState() { + return _SearchPage(); + } +} + +class _SearchPage extends State { + ApiService apiService; + TextEditingController controller = TextEditingController(); + final RefreshController refreshController = RefreshController(); + int optionIndex = 0; + + @override + void initState() { + super.initState(); + + SharedPreferences.getInstance().then((value) { + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), pay: true); + }); + } + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + color: Colors.transparent, + ), + color: Colors.transparent, + borderRadius: new BorderRadius.only( + topLeft: Radius.circular(16), + topRight: Radius.circular(16), + ), + ), + ), + Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height: 140.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFFE8F5E9), + Color(0xFFE5F7FF), + ]), + ), + ), + Column( + children: [ + Container( + height: 100.h, + color: Colors.transparent, + margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 15.h), + child: Row( + children: [ + GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child: Icon( + Icons.arrow_back_ios, + size: 24, + color: Colors.black, + ), + ), + Expanded( + child: Container( + height: 30.h, + margin: EdgeInsets.fromLTRB(0.w, 0, 8.w, 0.h), + padding: EdgeInsets.fromLTRB(12.w, 7.h, 0, 7.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(18), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: GestureDetector( + onTap: () {}, + child: Row( + children: [ + Icon( + Icons.search, + size: 16, + color: Color(0xFFABACAB), + ), + SizedBox( + width: 3.w, + ), + Text( + "前进麦味", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ), + ], + ), + ), + )), + Container( + alignment: Alignment.center, + child: GestureDetector( + onTap: () {}, + child: Text( + "搜索", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), + ), + ), + ], + )), + Expanded( + child: Container( + decoration: BoxDecoration( + border: Border.all( + width: 0, + color: Colors.white, + ), + color: Colors.white, + borderRadius: new BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + padding: EdgeInsets.only(left: 17.w, top: 16.h,right: 17.w), + 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: [ + // hotSearch(), + // historySearch(), + searchList() + ], + ); + }, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ], + ); + } + + ///热门搜索 + Widget hotSearch() { + return Container( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "热门搜索", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF181818), + ), + ), + SizedBox(height: 16.h), + GridView.builder( + itemCount: 6, + shrinkWrap: true, + padding: EdgeInsets.zero, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 4, + //水平子Widget之间间距 + crossAxisSpacing: 6.w, + //垂直子Widget之间间距 + mainAxisSpacing: 12.w, + //垂直单个子Widget之间间距 + childAspectRatio: 3 / 1, + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () {}, + child: hotSearchItem(), + ); + }, + ), + ], + ), + ); + } + + Widget hotSearchItem() { + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RoundButton( + width: 68.w, + height: 29.h, + text: "稻田里的书店", + textColor: Color(0xFF181818), + fontWeight: MyFontWeight.regular, + radius: 4, + backgroup: Color(0xFFF5F5F5), + fontSize: 12.sp, + ), + ], + ), + ); + } + + ///历史搜索 + Widget historySearch() { + return Container( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded(child:Text( + "历史搜索", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF181818), + ), + )), + Image.asset( + "assets/image/icon_delete.png", + width: 22.w, + height:20.h, + ), + Text( + "删除", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF181818), + ), + ), + ], + ), + + SizedBox(height: 16.h), + GridView.builder( + itemCount: 6, + shrinkWrap: true, + padding: EdgeInsets.zero, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 4, + //水平子Widget之间间距 + crossAxisSpacing: 6.w, + //垂直子Widget之间间距 + mainAxisSpacing: 12.w, + //垂直单个子Widget之间间距 + childAspectRatio: 3 / 1, + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + + }, + child: historySearchItem(), + ); + }, + ), + ], + ), + ); + } + + Widget historySearchItem() { + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RoundButton( + width: 68.w, + height: 29.h, + text: "稻田里的书店", + textColor: Color(0xFF181818), + fontWeight: MyFontWeight.regular, + radius: 4, + backgroup: Color(0xFFF5F5F5), + fontSize: 12.sp, + ), + ], + ), + ); + } + + ///搜索列表 + Widget searchList() { + return Container( + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: (){ + setState(() { + optionIndex = 0 ; + }); + }, + child: Text( + "默认推荐", + style: TextStyle( + fontSize: optionIndex == 0 ? 15.sp :14.sp, + fontWeight: optionIndex == 0 ? MyFontWeight.semi_bold : MyFontWeight.regular, + color: optionIndex == 0 ? Color(0xFF181818) : Color(0xFF4D4D4D), + ), + ), + ), + GestureDetector( + onTap: (){ + setState(() { + optionIndex = 1 ; + }); + }, + child:Text( + "销量", + style: TextStyle( + fontSize: optionIndex == 1 ? 15.sp :14.sp, + fontWeight: optionIndex == 1 ? MyFontWeight.semi_bold : MyFontWeight.regular, + color: optionIndex == 1 ? Color(0xFF181818) : Color(0xFF4D4D4D), + ), + ), + ), + GestureDetector( + onTap: (){ + setState(() { + optionIndex = 2 ; + }); + }, + child:Row(children: [ + Text( + "价格", + style: TextStyle( + fontSize: optionIndex == 2 ? 15.sp :14.sp, + fontWeight: optionIndex == 2 ? MyFontWeight.semi_bold : MyFontWeight.regular, + color: optionIndex == 2 ? Color(0xFF181818) : Color(0xFF4D4D4D), + ), + ), + Image.asset( + "assets/image/jg.png", + width:16, + height:16, + ), + ],), + ), + GestureDetector( + onTap: (){ + setState(() { + optionIndex = 3 ; + }); + }, + child: Text( + "专区", + style: TextStyle( + fontSize: optionIndex == 3 ? 15.sp :14.sp, + fontWeight: optionIndex == 3 ? MyFontWeight.semi_bold : MyFontWeight.regular, + color: optionIndex == 3 ? Color(0xFF181818) : Color(0xFF4D4D4D), + ), + ), + ), + ], + ), + SizedBox(height: 16.h), + GridView.builder( + itemCount:6, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount:2, + //水平子Widget之间间距 + crossAxisSpacing: 11.w, + //垂直子Widget之间间距 + mainAxisSpacing: 16.w, + //子Widget宽高比例 0.59 + childAspectRatio: + 185 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/shopping_mall_home',arguments: { + "type" : 1, + }); + }, + child: searchListItem(), + ); + }, + ) + ], + ), + ); + } + + Widget searchListItem() { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(10), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white, + ), + margin: EdgeInsets.symmetric( + vertical: 3, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(10), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: + // MImage( + // "", + // width: double.infinity, + // height: 166, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.png", + // fadeSrc: "assets/image/default_1.png", + // ), + Image.asset( + "assets/image/icon_story_td.png", + width:double.infinity, + fit: BoxFit.cover, + ), + ), + Expanded(child:Container( + padding: EdgeInsets.only(left:8.w,right:8.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.only(top: 8, right: 8), + padding: EdgeInsets.only(left: 2, right: 2), + height: 17.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF5A5A5A), + ), + child: Text( + "中国大陆5仓", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + ), + Text( + "已售12件", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5D5D5D), + ), + ), + ], + ), + Text( + "SWISSGEAR瑞士军刀联名款马克杯", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize:18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + ], + ), + ), + Text( + "¥283.00", + style: TextStyle( + fontSize:14.sp, + decoration: TextDecoration.lineThrough, + decorationColor: Color(0xFF585858), + fontWeight: MyFontWeight.regular, + color: Color(0xFFA2A2A2), + ), + ), + ], + ), + ], + ), + ),) + ], + ), + ); + } +} diff --git a/lib/store/shopping/shopping_home/shopping_acticvity.dart b/lib/store/shopping/shopping_home/shopping_acticvity.dart new file mode 100644 index 00000000..0a443d42 --- /dev/null +++ b/lib/store/shopping/shopping_home/shopping_acticvity.dart @@ -0,0 +1,321 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/base_data.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/item_title.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class ShoppingActivity extends StatefulWidget { + @override + State createState() { + return _ShoppingActivity(); + } +} + +class _ShoppingActivity extends State { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + SizedBox( + height: 10.h, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 9.w), + child: Row( + children: [ + GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/activity_prefecture_details'); + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5.w ), + padding: EdgeInsets.only(left: 12.w), + width: (MediaQuery.of(context).size.width - 42) / 2, + height: 195.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "回乡秒杀", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Colors.black, + ), + ), + Text( + "超多好物,等你来秒", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF7B7B7B), + ), + ), + GestureDetector( + onTap: (){ + }, + child: Container( + height:20.h, + width: 60.w, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(11.5), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "10点场", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 16, + color: Colors.white, + ), + ], + ), + ), + ), + Padding(padding: EdgeInsets.only(bottom: 10.h),child: + Image.asset( + "assets/image/icon_story_td.png", + width: 87, + height: 87, + fit: BoxFit.cover, + ),) + ], + ), + ), + ), + Expanded( + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5.w), + padding: EdgeInsets.only(left: 12.w,right: 11.w), + width: (MediaQuery.of(context).size.width - 42) / 2, + height: 195.h / 2, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "好价我砍", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Colors.black, + ), + ), + Text( + "拉友同优", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF7B7B7B), + ), + ), + GestureDetector( + onTap: (){ + }, + child: Container( + height: 18.h, + width: 48.w, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(11.5), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "GO", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 16, + color: Colors.white, + ), + ], + ), + ), + ), + ], + ),), + Padding(padding: EdgeInsets.only(bottom: 10.h),child: + Image.asset( + "assets/image/icon_story_td.png", + width: 44, + height: 44, + fit: BoxFit.cover, + ),) + ], + ), + ), + ), + SizedBox( + height: 5, + ), + GestureDetector( + onTap: () { + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 5.w), + padding: EdgeInsets.only(left: 12.w,right: 11.w), + width: (MediaQuery.of(context).size.width - 42) / 2, + height: 195.h / 2, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "拼团专场", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: Colors.black, + ), + ), + Text( + "优惠齐享", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF7B7B7B), + ), + ), + GestureDetector( + onTap: (){ + }, + child: Container( + height: 18.h, + width: 48.w, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(11.5), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "GO", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.white, + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 16, + color: Colors.white, + ), + ], + ), + ), + ), + ], + ),), + Padding(padding: EdgeInsets.only(bottom: 10.h),child: + Image.asset( + "assets/image/icon_story_td.png", + width: 44, + height: 44, + fit: BoxFit.cover, + ),) + ], + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + SizedBox( + height: 28.h, + ), + ], + ); + } + +} diff --git a/lib/store/shopping/shopping_home/shopping_home_banner.dart b/lib/store/shopping/shopping_home/shopping_home_banner.dart new file mode 100644 index 00000000..9bc88b1c --- /dev/null +++ b/lib/store/shopping/shopping_home/shopping_home_banner.dart @@ -0,0 +1,120 @@ + +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/retrofit/data/banner.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +class ShoppingHomeBanner extends StatefulWidget { + + final List bannerData; + final SwiperController controller; + + ShoppingHomeBanner(this.bannerData,this.controller); + + @override + State createState() { + return _ShoppingHomeBanner(); + } + +} + +class _ShoppingHomeBanner extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + List bannerData = []; + + + @override + Widget build(BuildContext context) { + return Container( + child: AspectRatio( + aspectRatio: 2.08, + child: Swiper( + viewportFraction: 0.88, + scale: 0.93, + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return InkWell( + onTap: () { + bannerClick(widget.bannerData[position]); + }, + child: MImage( + (widget.bannerData != null && position < widget.bannerData.length) + ? widget.bannerData[position].imgUrl + : "", + fit: BoxFit.cover, + radius: BorderRadius.circular(8), + errorSrc: "assets/image/default_2_1.png", + fadeSrc: "assets/image/default_2_1.png", + ), + ); + }, + itemCount: (widget.bannerData != null && widget.bannerData.length > 0) + ? widget.bannerData.length + : 1), + ), + ); + } + + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + bannerClick(BannerData bannerData) async { + switch (bannerData.contentType) { + case 1: + Navigator.of(context).pushNamed('/router/integral_store_page', + arguments: {"goodsId": bannerData.content}); + break; + case 2: + Navigator.of(context) + .pushNamed('/router/web_page', arguments: { + "activityId": bannerData.content, + }); + break; + case 3: + Navigator.of(context) + .pushNamed('/router/web_page', arguments: { + "articleId": bannerData.content, + }); + break; + case 4: + String router = bannerData.content; + if (router.contains("?")) { + String params = router.substring(router.indexOf("?")); + params = params.replaceAll("?", ""); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(router, arguments: map); + } else { + Navigator.of(context).pushNamed(router); + } + break; + case 5: + Navigator.of(context) + .pushNamed('/router/class_details', arguments: { + "id": bannerData.content, + }); + break; + } + } +} + + + + + + + diff --git a/lib/store/shopping/shopping_home/shopping_home_page.dart b/lib/store/shopping/shopping_home/shopping_home_page.dart new file mode 100644 index 00000000..31c6c58e --- /dev/null +++ b/lib/store/shopping/shopping_home/shopping_home_page.dart @@ -0,0 +1,198 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; +import 'package:huixiang/main.dart'; +import 'package:huixiang/retrofit/data/store_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/store/shopping/shopping_home/recommend_goods_list_view.dart'; +import 'package:huixiang/store/shopping/shopping_home/shopping_acticvity.dart'; +import 'package:huixiang/utils/event_type.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'classify_list.dart'; + +class ShoppingHomePage extends StatefulWidget { + final StoreInfo storeInfo; + + ShoppingHomePage(this.storeInfo); + + @override + State createState() { + return _ShoppingHomePage(); + } +} + +class _ShoppingHomePage extends State + with AutomaticKeepAliveClientMixin { + ApiService apiService; + + @override + void initState() { + super.initState(); + } + + final SwiperController controller = SwiperController(); + + @override + void dispose() { + super.dispose(); + if (refreshController != null) refreshController.dispose(); + } + + final RefreshController refreshController = RefreshController(); + + @override + Widget build(BuildContext context) { + super.build(context); + return Column( + children: [ + MyAppBar( + title: widget?.storeInfo?.storeName ?? "一心回乡商城", + titleColor: Colors.black, + leadingColor: Colors.black, + background: Colors.transparent, + ), + 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: [ + buildSearchItem(), + + buildSwiper(), + + ///分类导航栏 + // ShoppingTitleTab(), + + ///分类列表 + ClassifyList(), + + ///专区活动 + ShoppingActivity(), + + ///严选活动 + // ActivityBanner(), + + ///为你推荐 + RecommendGoodsListView(), + ], + ); + }, + ), + ), + ), + ), + ), + SizedBox( + height: 76.h, + ), + ], + ); + } + + Widget buildSearchItem() { + return Container( + height: 36.h, + margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 16.h), + padding: EdgeInsets.fromLTRB(12.w, 6.h, 0, 6.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(18), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/search_page'); + }, + child: Row( + children: [ + Icon( + Icons.search, + size: 24, + color: Color(0xFFABACAB), + ), + SizedBox( + width: 3.w, + ), + Text( + "前进麦味", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF727272), + ), + ), + ], + ), + ), + ); + } + + Widget buildSwiper() { + return Container( + width: double.infinity, + height: 160.h, + margin: EdgeInsets.only(left: 16,right: 16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + ), + child: Swiper( + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8.w, + activeSize: 8.w, + space: 5.w, + activeColor: Colors.white, + color: Colors.white.withAlpha(76), + ), + ), + itemBuilder: (context, position) { + return Container( + child: MImage( + (widget.storeInfo != null && + widget.storeInfo.bannerList != null && + position < widget.storeInfo.bannerList.length) + ? widget.storeInfo.bannerList[position].imgUrl + : "", + fit: BoxFit.cover, + radius: BorderRadius.circular(8), + errorSrc: "assets/image/default_2_1.png", + fadeSrc: "assets/image/default_2_1.png", + ), + ); + }, + itemCount: (widget.storeInfo != null && widget.storeInfo.bannerList != null) + ? widget.storeInfo.bannerList.length + : 1, + ), + ); + } + + @override + bool get wantKeepAlive => true; +} diff --git a/lib/store/shopping/shopping_home/shopping_title_tab.dart b/lib/store/shopping/shopping_home/shopping_title_tab.dart new file mode 100644 index 00000000..7a3c4a74 --- /dev/null +++ b/lib/store/shopping/shopping_home/shopping_title_tab.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/category_select_list.dart'; +import 'package:huixiang/retrofit/data/goods_category.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/my_tab.dart'; + +class ShoppingTitleTab extends StatefulWidget { + final List classSelectList; + final Function notifyClassSelectList; + + ShoppingTitleTab(this.classSelectList,this.notifyClassSelectList); + + @override + State createState() { + return _ClassTitleTab(); + } +} + +class _ClassTitleTab extends State + with SingleTickerProviderStateMixin { + TabController tabController; + + @override + void initState() { + super.initState(); + + } + + @override + Widget build(BuildContext context) { + return Container( + alignment: Alignment.centerLeft, + child: DefaultTabController( + length:widget.classSelectList == null + ? 0 + : widget.classSelectList.length, + child: TabBar( + isScrollable: true, + //可滚动 + indicatorColor: Color(0xff39B54A), + labelColor: Color(0xff32A060), + labelStyle: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + unselectedLabelStyle: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + controller: tabController, + //未选中文字颜色 + unselectedLabelColor: Color(0xff4D4D4D), + indicatorSize: TabBarIndicatorSize.label, + onTap: (index){ + widget.notifyClassSelectList(index); + }, + //指示器与文字等宽 + tabs:widget.classSelectList == null + ? [] + : widget.classSelectList + .map((e) => MyTab(text: e.name)) + .toList(), + ), + ), + ); + } + +} diff --git a/lib/store/shopping/shopping_mall_home.dart b/lib/store/shopping/shopping_mall_home.dart new file mode 100644 index 00000000..72becd83 --- /dev/null +++ b/lib/store/shopping/shopping_mall_home.dart @@ -0,0 +1,244 @@ +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_swiper/flutter_swiper.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/main.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; +import 'package:huixiang/retrofit/data/banner.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/brand.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/store_info.dart'; +import 'package:huixiang/retrofit/min_api.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/store/shopping/shopping_cart/shopping_cart_page.dart'; +import 'package:huixiang/store/shopping/shopping_home/shopping_home_page.dart'; +import 'package:huixiang/utils/event_type.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class ShoppingMallHome extends StatefulWidget { + final arguments; + + ShoppingMallHome({this.arguments}); + + @override + State createState() { + return _ShoppingMallHome(); + } +} + +class _ShoppingMallHome extends State + with AutomaticKeepAliveClientMixin { + ApiService apiService; + MinApiService minService; + List brands = []; + List bannerData = []; + int choiceIndex = 0; + bool dialogShowing = false; + final RefreshController refreshController = RefreshController(); + final SwiperController controller = SwiperController(); + String storeId = ""; + String tenant = ""; + + ///小程序token + String minToken; + StoreInfo storeInfo; + List activitys; + + @override + void initState() { + super.initState(); + if (widget.arguments != null) choiceIndex = widget.arguments["type"]; + + tenant = widget.arguments["tenant"]; + storeId = widget.arguments["id"]; + + SharedPreferences.getInstance().then((value) { + minLogin(value); + queryStoreInfo(); + }); + } + + /// 小程序登录 + minLogin(SharedPreferences shared) async { + EasyLoading.show(status: S.of(context).zhengzaijiazai); + apiService = ApiService( + Dio(), + context: context, + token: shared.getString('token'), + showLoading: false, + ); + apiService.minLogin(storeId).catchError((onError) { + debugPrint(onError); + }).then((baseData) { + if (baseData != null && baseData.isSuccess) { + Map minStoreInfo = baseData.data; + minToken = minStoreInfo["token"]; + queryStoreInfo(); + SharedPreferences.getInstance().then( + (value) => { + value.setString('minToken', minToken), + value.setString('tenant', tenant), + value.setString('storeId', storeId), + }, + ); + minService = MinApiService( + Dio(), + context: context, + token: minToken, + tenant: tenant, + storeId: storeId, + showLoading: false, + ); + + // queryShopCar().then((value) { + // this.shopCarGoods = value; + // setState(() {}); + // }); + // if (tableId > 0) { + // getParentInfo(); + // } + EasyLoading.dismiss(); + } + }); + } + + /// 查询店铺信息 + queryStoreInfo() async { + BaseData baseData = + await apiService.queryStoreInfo(storeId).catchError((error) { + debugPrint(error); + }); + if (baseData != null && baseData.isSuccess) { + storeInfo = StoreInfo.fromJson(baseData.data); + activitys = storeInfo.informationVOPageVO.list + .map((e) => Activity.fromJson(e)) + .toList(); + if (mounted) { + setState(() {}); + } + } + EasyLoading.dismiss(); + } + + @override + void dispose() { + super.dispose(); + if (refreshController != null) refreshController.dispose(); + } + + @override + Widget build(BuildContext context) { + super.build(context); + return Stack( + children: [ + Container( + color: Color(0xFFF7F7F7), + ), + Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height: 260.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFFE8F5E9), + Color(0xFFE5F7FF), + ]), + ), + ), + if (choiceIndex == 0) + ShoppingHomePage( + storeInfo, + ), + if (choiceIndex == 1) ShoppingCartPage(), + Align( + alignment: Alignment.bottomCenter, + child: Container( + color: Colors.white, + height: 83.h, + width: double.infinity, + padding: EdgeInsets.only(top: 10.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + setState(() { + choiceIndex = 0; + }); + }, + child: Column( + children: [ + Image.asset( + choiceIndex == 0 + ? "assets/image/shopping_home.png" + : "assets/image/shopping_home_h.png", + width: 30, + height: 30, + ), + Text( + "首页", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.semi_bold, + color: choiceIndex == 0 + ? Color(0xFF4C4C4C) + : Color(0xFFC6C6C6), + ), + ), + ], + )), + ), + Expanded( + child: GestureDetector( + onTap: () { + setState(() { + choiceIndex = 1; + }); + }, + child: Column( + children: [ + Image.asset( + choiceIndex == 0 + ? "assets/image/shopping_cart_h.png" + : "assets/image/shopping_cart.png", + width: 30, + height: 30, + ), + Text( + "购物车", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.semi_bold, + color: choiceIndex == 0 + ? Color(0xFFC6C6C6) + : Color(0xFF4C4C4C), + ), + ), + ], + ), + )) + ], + ), + ), + ), + ], + ), + ], + ); + } + + @override + bool get wantKeepAlive => true; +} diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 069bdc0c..1c744bd0 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -136,6 +136,7 @@ class _StoreOrderPage extends State }); } + ///会员信息 queryMemberInfo() async { BaseData baseData = await minService.memberInfo() .catchError((error){debugPrint(error);}); diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index c75e8a58..abea0f39 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -114,8 +114,8 @@ class _ProductSku extends State { children: [ MImage( widget.miNiDetail.imgs[0], - width: 70, - height: 70, + width: 75, + height: 75, fit: BoxFit.cover, errorSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png", @@ -123,7 +123,7 @@ class _ProductSku extends State { SizedBox( width: 10, ), - Column( + Expanded(child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -139,6 +139,8 @@ class _ProductSku extends State { child: Text( ": " + (selectSkus.map((e) => "$e").toList().toString()), + maxLines: 1, + overflow: TextOverflow.ellipsis, style: TextStyle( color: Color(0xFF727272), fontSize: 11.sp, @@ -167,7 +169,7 @@ class _ProductSku extends State { ], ), ], - ), + )), Spacer(), InkWell( onTap: () { diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index ae7cf7e8..b087530b 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -21,7 +21,7 @@ class StoreOrderListPage extends StatefulWidget { final ScrollController controller; final String minToken; final String tenant; - final Function(String id,int count) queryMiNiDetail; + final Function(String id, int count) queryMiNiDetail; ShoppingCart shopCarGoods; @@ -31,8 +31,8 @@ class StoreOrderListPage extends StatefulWidget { this.storeInfo, this.shopCarGoods, this.controller, - this.minToken, - this.tenant, + this.minToken, + this.tenant, this.queryMiNiDetail, ); @@ -232,15 +232,15 @@ class _StoreOrderListPage extends State { } return InkWell( onTap: () { - widget.queryMiNiDetail(productListBeans[position].id,1); + widget.queryMiNiDetail(productListBeans[position].id, 1); }, child: ShopGoods( (ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) { - widget.queryMiNiDetail(productListBeans[position].id,1); + widget.queryMiNiDetail(productListBeans[position].id, 1); }, (ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) { - if(count > 0) - widget.queryMiNiDetail(productListBeans[position].id,-1); + if (count > 0) + widget.queryMiNiDetail(productListBeans[position].id, -1); }, productListBean: productListBeans[position], count: count, diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 47d25624..557e20e5 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -13,6 +13,7 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; +import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/location.dart'; import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/classic_header.dart'; @@ -231,16 +232,64 @@ class _UnionPage extends State ), body: Column( children: [ - PreferredSize( - preferredSize: Size(double.infinity, 52.h), - child: Container( - padding: EdgeInsets.only(top:15.h), - color: Color(0xFFFAFAFA), - child: ItemTitle( - text: S.of(context).jingbilianmenghuiyuandian, - imgPath: "assets/image/icon_union_store.png", + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child:PreferredSize( + preferredSize: Size(double.infinity, 52.h), + child: Container( + padding: EdgeInsets.only(top:15.h), + color: Color(0xFFFAFAFA), + child: ItemTitle( + text: S.of(context).jingbilianmenghuiyuandian, + imgPath: "assets/image/icon_union_store.png", + ), + ), + )), + GestureDetector( + onTap: (){ + setState(() { + var storeName = storeList.firstWhere((x)=>x.storeName == "一心回乡商城"); + if(storeName == null) + return; + Navigator.of(context).pushNamed( + '/router/shopping_mall_home', + arguments: { + "type":0, + "id": storeName.id, + "tenant": storeName.tenantCode, + "storeName":storeName.storeName + }, + ); + }); + }, + child:Container( + margin: EdgeInsets.only(right: 18), + height: 25.h, + width: 102.w, + color: Colors.white, + child:Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "一心回乡商城", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 16, + ), + ], + ), + ), ), - ), + ], ), buildItem(), ], @@ -525,9 +574,6 @@ class _UnionPage extends State ), ], ), - SizedBox( - height: 4.h, - ), Row( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/view_widget/new_people_reward.dart b/lib/view_widget/new_people_reward.dart index 8a0a702a..38be0459 100644 --- a/lib/view_widget/new_people_reward.dart +++ b/lib/view_widget/new_people_reward.dart @@ -154,7 +154,7 @@ class _NewPeopleReward extends State { ), Expanded( child: Padding( - padding: EdgeInsets.only(top: 4, bottom: 4), + padding: EdgeInsets.only(top: 4, bottom: 4,left: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart index 156776d5..b78968b2 100644 --- a/lib/web/web_view/comment_list.dart +++ b/lib/web/web_view/comment_list.dart @@ -79,14 +79,6 @@ class CommentListState extends State { Container( decoration: BoxDecoration( color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ), - ], ), child: Column( mainAxisAlignment: MainAxisAlignment.start, diff --git a/pubspec.lock b/pubspec.lock index 784ca8a7..45429d08 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -229,7 +229,7 @@ packages: name: flutter_html url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.0" + version: "2.2.1" flutter_layout_grid: dependency: transitive description: @@ -269,7 +269,7 @@ packages: name: flutter_screenutil url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.1" + version: "5.0.1+2" flutter_smart_dialog: dependency: "direct main" description: @@ -329,6 +329,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "9.2.0" + gradient_widgets: + dependency: "direct main" + description: + name: gradient_widgets + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.6.0" graphs: dependency: transitive description: @@ -475,7 +482,7 @@ packages: name: path_provider_linux url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.2" + version: "2.1.4" path_provider_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b82c67f6..aec2cefc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,6 +15,8 @@ dependencies: sdk: flutter fluwx: ^3.5.0 + gradient_widgets: ^0.6.0 + keframe: ^2.0.2 #滑动组件卡顿优化 tpns_flutter_plugin: @@ -89,6 +91,9 @@ dependencies: ai_decimal_accuracy: ^1.1.0 + + + dev_dependencies: flutter_test: sdk: flutter