diff --git a/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart b/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart index 1057aa5..20d2fb0 100644 --- a/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart +++ b/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart @@ -7,7 +7,6 @@ import 'package:flutter/services.dart'; import 'package:flutter_alibc/alibc_const_key.dart'; import 'package:flutter_alibc/alibc_model.dart'; import 'package:flutter_alibc/flutter_alibc.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/has_goods_dialog_style_model.dart'; import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; @@ -48,27 +47,27 @@ class _IntellectSearchGoodsDialogState child: Stack( children: [ Container( - margin: EdgeInsets.only(top: 38.h, left: 92.w, right: 92.w), + margin: EdgeInsets.only(top: 19, left: 48, right: 48), padding: EdgeInsets.only( - top: (38 + 38).h, - left: 30.w, - right: 30.w, - bottom: 48.h), + top: 38, + left: 15, + right: 15, + bottom: 24), decoration: BoxDecoration( color: HexColor.fromHex(_styleModel?.bgColor ?? "#FFFFFF"), borderRadius: BorderRadius.circular(16)), width: double.infinity, child: Column( - children: [_bulidTopItem(), _buildBottomItem()], + children: [_buildTopItem(), _buildBottomItem()], ), ), Container( - height: 76.h, + height: 38, child: Center( child: Container( - height: 76.h, - width: 216.w, + height: 38, + width: 108, child: CachedNetworkImage( imageUrl: _styleModel?.titleImg ?? "", fit: BoxFit.fill, @@ -84,13 +83,13 @@ class _IntellectSearchGoodsDialogState ); } - _bulidTopItem() { + _buildTopItem() { return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 160.w, - height: 160.w, + width: 80, + height: 80, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), image: DecorationImage( @@ -99,7 +98,7 @@ class _IntellectSearchGoodsDialogState fit: BoxFit.fill)), ), SizedBox( - width: 19.w, + width: 9.5, ), Expanded( child: Container( @@ -113,10 +112,10 @@ class _IntellectSearchGoodsDialogState widget.model?.title ?? "", maxLines: 2, overflow: TextOverflow.ellipsis, - style: TextStyle(color: Colors.black, fontSize: 24.sp), + style: TextStyle(color: Colors.black, fontSize: 12), ), SizedBox( - height: 5.h, + height: 5, ), Row( children: [ @@ -132,8 +131,8 @@ class _IntellectSearchGoodsDialogState mainAxisSize: MainAxisSize.min, children: [ Container( - width: 30.w, - height: 30.w, + width: 15, + height: 15, decoration: BoxDecoration( color: HexColor.fromHex(_styleModel ?.moduleList?.coupon?.bgColor ?? @@ -149,7 +148,7 @@ class _IntellectSearchGoodsDialogState ?.coupon ?.fontColor ?? ""), - fontSize: 20.sp), + fontSize: 10), ), ), ), @@ -163,7 +162,7 @@ class _IntellectSearchGoodsDialogState ?.moduleList ?.couponPrice ?.fontColor), - fontSize: 20.sp), + fontSize: 10), ), ) ], @@ -179,7 +178,7 @@ class _IntellectSearchGoodsDialogState mainAxisSize: MainAxisSize.min, children: [ SizedBox( - height: 30.w, + height: 15, ), Center( child: Padding( @@ -197,7 +196,7 @@ class _IntellectSearchGoodsDialogState ?.commission ?.fontColor ?? ""), - fontSize: 20.sp), + fontSize: 10), ), ), ) @@ -209,7 +208,7 @@ class _IntellectSearchGoodsDialogState ], ), SizedBox( - height: 10.h, + height: 5, ), Row( crossAxisAlignment: CrossAxisAlignment.end, @@ -219,7 +218,7 @@ class _IntellectSearchGoodsDialogState child: Text( _styleModel?.moduleList?.couponAfter?.content ?? "", style: TextStyle( - fontSize: 20.sp, + fontSize: 10, color: HexColor.fromHex(_styleModel ?.moduleList?.couponAfterPrice?.fontColor ?? "")), @@ -231,7 +230,7 @@ class _IntellectSearchGoodsDialogState child: Text( "¥", style: TextStyle( - fontSize: 20.sp, + fontSize: 10, color: HexColor.fromHex(_styleModel ?.moduleList?.couponAfterPrice?.fontColor ?? "")), @@ -246,7 +245,7 @@ class _IntellectSearchGoodsDialogState "", maxLines: 1, style: TextStyle( - fontSize: 32.sp, + fontSize: 16, color: HexColor.fromHex(_styleModel ?.moduleList?.couponAfterPrice?.fontColor), ), @@ -272,7 +271,7 @@ class _IntellectSearchGoodsDialogState children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 20.w, right: 20.w), + margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( color: HexColor.fromHex( _styleModel?.moduleList?.saveBtn?.bgColor ?? ""), @@ -290,7 +289,7 @@ class _IntellectSearchGoodsDialogState style: TextStyle( color: HexColor.fromHex( _styleModel?.moduleList?.saveBtn?.fontColor), - fontSize: 24.sp), + fontSize: 12), ), )), )) @@ -308,7 +307,7 @@ class _IntellectSearchGoodsDialogState children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 20.w, right: 20.w), + margin: EdgeInsets.only(left: 10, right:10), decoration: BoxDecoration( color: HexColor.fromHex( _styleModel?.moduleList?.viewGoodsBtn?.bgColor ?? ""), @@ -322,7 +321,7 @@ class _IntellectSearchGoodsDialogState color: HexColor.fromHex( _styleModel?.moduleList?.viewGoodsBtn?.fontColor ?? ""), - fontSize: 24.sp), + fontSize: 12), ), )), )) diff --git a/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_no_goods_dialog.dart b/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_no_goods_dialog.dart index d4c1090..891bf9d 100644 --- a/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_no_goods_dialog.dart +++ b/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_no_goods_dialog.dart @@ -1,10 +1,8 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/no_goods_dialog_style_model.dart'; -import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; @@ -64,12 +62,9 @@ class _IntellectSearchNoGoodsDialogState Stack( children: [ Container( - margin: EdgeInsets.only(top: 38.h, left: 92.w, right: 92.w), + margin: EdgeInsets.only(top: 19, left: 42.5, right: 42.5), padding: EdgeInsets.only( - top: (38 + 15).h, - left: 30.w, - right: 30.w, - bottom: 48.h), + top: 26, left: 15, right: 15, bottom: 24), decoration: BoxDecoration( color: HexColor.fromHex(_styleModel?.bgColor ?? ""), borderRadius: BorderRadius.circular(16)), @@ -79,11 +74,11 @@ class _IntellectSearchNoGoodsDialogState ), ), Container( - height: 76.h, + height: 38, child: Center( child: Container( - height: 76.h, - width: 216.w, + height: 38, + width: 108, child: CachedNetworkImage( imageUrl: _styleModel?.titleImg ?? "", ), @@ -106,7 +101,7 @@ class _IntellectSearchNoGoodsDialogState style: TextStyle( color: HexColor.fromHex( _styleModel?.moduleList?.title?.textColor ?? ""), - fontSize: 30.sp), + fontSize: 15), ), Container( margin: EdgeInsets.only(top: 12), @@ -120,7 +115,7 @@ class _IntellectSearchNoGoodsDialogState style: TextStyle( color: HexColor.fromHex( _styleModel?.moduleList?.content?.textColor ?? ''), - fontSize: 22.sp), + fontSize: 11), decoration: InputDecoration( contentPadding: EdgeInsets.only(left: 10, top: 10, bottom: 4), border: InputBorder.none, @@ -156,20 +151,21 @@ class _IntellectSearchNoGoodsDialogState style: TextStyle( color: HexColor.fromHex( _styleModel?.moduleList?.btn?.textColor), - fontSize: 24.sp), + fontSize: 12), ), )), ), onTap: () { RouterUtil.route( - SkipModel.fromJson( - _styleModel.moduleList.btn.skipInfo.toJson()), - { - "keywords": searchText, - "type": _styleModel.moduleList.btn.skipInfo.pvd - }, - context).then((_){ - Navigator.pop(context); + SkipModel.fromJson( + _styleModel.moduleList.btn.skipInfo.toJson()), + { + "keywords": searchText, + "type": _styleModel.moduleList.btn.skipInfo.pvd + }, + context) + .then((_) { + Navigator.pop(context); }); }, ), @@ -184,7 +180,7 @@ class _IntellectSearchNoGoodsDialogState children: [ Container( height: 1, - width: 137.w, + width: 68.5, color: HexColor.fromHex( _styleModel?.moduleList?.segment?.textColor ?? ""), ), @@ -196,7 +192,7 @@ class _IntellectSearchNoGoodsDialogState ), Container( height: 1, - width: 137.w, + width: 68.5, color: HexColor.fromHex( _styleModel?.moduleList?.segment?.textColor ?? ""), ), @@ -206,7 +202,7 @@ class _IntellectSearchNoGoodsDialogState height: 24, ), Container( - height: 100.w, + height: 50, child: ListView.builder( scrollDirection: Axis.horizontal, shrinkWrap: true, @@ -228,8 +224,8 @@ class _IntellectSearchNoGoodsDialogState Container( child: Image.network( item.image ?? "", - width: 60.w, - height: 60.w, + width: 30, + height: 30, fit: BoxFit.fill, ), ), @@ -239,14 +235,17 @@ class _IntellectSearchNoGoodsDialogState Text( item.title ?? "", style: TextStyle( - fontSize: 22.sp, + fontSize: 11, color: HexColor.fromHex(item.textColor ?? "")), ) ], ), onTap: () { RouterUtil.route(SkipModel.fromJson(item.skipInfo.toJson()), - {"keywords": searchText, "type": item.pvd}, context); + {"keywords": searchText, "type": item.pvd}, context) + .then((value) { + Navigator.pop(context); + }); }, )); } diff --git a/lib/dialog/select_date_ym_dialog/select_date_ym_dialog.dart b/lib/dialog/select_date_ym_dialog/select_date_ym_dialog.dart index c5bb69a..b59b1b7 100644 --- a/lib/dialog/select_date_ym_dialog/select_date_ym_dialog.dart +++ b/lib/dialog/select_date_ym_dialog/select_date_ym_dialog.dart @@ -94,7 +94,7 @@ class _SelectDateYMDialogState extends State child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - GestureDetector( + InkWell( child: Padding( padding: const EdgeInsets.only( left: 16, top: 8, bottom: 8, right: 16), @@ -102,7 +102,7 @@ class _SelectDateYMDialogState extends State "取消", style: TextStyle( color: HexColor.fromHex("#FF999999"), - fontSize: 35.sp), + fontSize: 17.5), ), ), onTap: () { @@ -110,7 +110,7 @@ class _SelectDateYMDialogState extends State }, ), Text("选择日期"), - GestureDetector( + InkWell( child: Padding( padding: const EdgeInsets.only( right: 16, left: 16, bottom: 8, top: 8), @@ -118,7 +118,7 @@ class _SelectDateYMDialogState extends State "确定", style: TextStyle( color: HexColor.fromHex("#FFFF4242"), - fontSize: 35.sp), + fontSize: 17.5), ), ), onTap: () { @@ -181,7 +181,7 @@ class _SelectDateYMDialogState extends State height: 40, child: Center( child: Text( - yearDate[index].toString() + "", + yearDate[index].toString() + "年", style: TextStyle( color: index == selectYearIndex ? Colors.redAccent : Colors.black26), diff --git a/lib/dialog/tip_dialog/tip_dialog.dart b/lib/dialog/tip_dialog/tip_dialog.dart index bb473ad..719267f 100644 --- a/lib/dialog/tip_dialog/tip_dialog.dart +++ b/lib/dialog/tip_dialog/tip_dialog.dart @@ -22,7 +22,7 @@ class TipDialog extends StatelessWidget { width: double.infinity, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(20)), - margin: EdgeInsets.only(left: 91.w, right: 91.w), + margin: EdgeInsets.only(left: 45, right: 45), child: Column( children: [ Row( @@ -35,7 +35,7 @@ class TipDialog extends StatelessWidget { Text( title, style: TextStyle( - fontSize: 30.sp, fontWeight: FontWeight.w400), + fontSize: 15, fontWeight: FontWeight.w500), ), SizedBox( width: 48, @@ -52,7 +52,7 @@ class TipDialog extends StatelessWidget { constraints: BoxConstraints(minHeight: 100), child: Text( content, - style: TextStyle(fontSize: 26.sp), + style: TextStyle(fontSize: 13), ), ), Row( @@ -73,7 +73,7 @@ class TipDialog extends StatelessWidget { btnText, style: TextStyle( color: HexColor.fromHex("#FFFFFF"), - fontSize: 26.sp), + fontSize: 13), )), )) ], diff --git a/lib/pages/brand_detail_page/brand_detail_bloc.dart b/lib/pages/brand_detail_page/brand_detail_bloc.dart new file mode 100644 index 0000000..e4f3a15 --- /dev/null +++ b/lib/pages/brand_detail_page/brand_detail_bloc.dart @@ -0,0 +1,19 @@ +import 'dart:async'; + +import 'package:zhiying_comm/util/base_bloc.dart'; + +class BrandDetailBloc extends BlocBase { + List> _pageData = List(); + + StreamController>> _dataController = + StreamController>>.broadcast(); + + Stream>> get outData => _dataController.stream; + + @override + void dispose() { + _dataController.close(); + } + + +} diff --git a/lib/pages/brand_detail_page/brand_detail_page.dart b/lib/pages/brand_detail_page/brand_detail_page.dart new file mode 100644 index 0000000..87ef735 --- /dev/null +++ b/lib/pages/brand_detail_page/brand_detail_page.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/pages/brand_detail_page/brand_detail_page_skeleton.dart'; +import 'package:zhiying_comm/util/base_bloc.dart'; + +import 'brand_detail_bloc.dart'; + +class BrandDetailPage extends StatefulWidget { + @override + _BrandDetailPageState createState() => _BrandDetailPageState(); +} + +class _BrandDetailPageState extends State { + @override + Widget build(BuildContext context) { + return BlocProvider(child: BrandDetailContainer(), bloc: BrandDetailBloc()); + } +} + +class BrandDetailContainer extends StatefulWidget { + @override + _BrandDetailContainerState createState() => _BrandDetailContainerState(); +} + +class _BrandDetailContainerState extends State { + BrandDetailBloc _bloc; + + @override + void initState() { + _bloc = BlocProvider.of(context); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return StreamBuilder( + stream: _bloc.outData, + builder: (context, asny) { + return Scaffold(body: BrandDetailPageSkeleton()); + }); + } +} diff --git a/lib/pages/brand_detail_page/brand_detail_page_skeleton.dart b/lib/pages/brand_detail_page/brand_detail_page_skeleton.dart new file mode 100644 index 0000000..df09f4c --- /dev/null +++ b/lib/pages/brand_detail_page/brand_detail_page_skeleton.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/widgets/brand/brandDetailTabBarView/brand_detail_tab_bar_view.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_appbar/brand_appbar.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_detail_appbar/brand_detail_appbar.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_detail_recommend/brand_detail_recommend.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_detail_tab_bar/brand_detail_tab_bar.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_detail_top/brand_detail_top.dart'; +import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; + +class BrandDetailPageSkeleton extends StatelessWidget { + @override + Widget build(BuildContext context) { + return NestedScrollView( + headerSliverBuilder: (context, innerBoxIsScrolled) { + return headerBuild(); + }, + body: BrandTabBarView()); + } + + List headerBuild() { + List listWidget = List(); + listWidget.add(BrandDetailAppBar()); + listWidget.add(SliverToBoxAdapter( + child: BrandDetailTop(), + )); + listWidget.add(SliverToBoxAdapter( + child: BrandDetailRecommend(), + )); + listWidget.add(SliverPersistentHeader( + pinned: true, + floating: false, + delegate: CustomSliverPersistentHeaderDelegate( + max: 48, min: 48, child: BrandDetailTabBar()), + )); + return listWidget; + } +} diff --git a/lib/pages/brand_page/brand_page.dart b/lib/pages/brand_page/brand_page.dart new file mode 100644 index 0000000..ad081f0 --- /dev/null +++ b/lib/pages/brand_page/brand_page.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifier.dart'; +import 'package:zhiying_comm/util/base_bloc.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +import 'brand_page_bloc.dart'; + +///品牌页面 + +class BrandPage extends StatefulWidget { + @override + _BrandPageState createState() => _BrandPageState(); +} + +class _BrandPageState extends State { + @override + Widget build(BuildContext context) { + return MultiProvider( + providers: [ChangeNotifierProvider.value(value: SearchTagNotifier())], + child: BlocProvider(child: BrandPageContainer(), bloc: BrandBloc())); + } +} + +class BrandPageContainer extends StatefulWidget { + @override + _BrandPageContainerState createState() => _BrandPageContainerState(); +} + + +class _BrandPageContainerState extends State { + + @override + void initState() { + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return StreamBuilder(builder: (context, asyn) { + + var model=asyn.data; + if(model==null){ + return Container();///骨架图 + } + return Scaffold( + appBar: AppBar( + centerTitle: true, + title: Text("大牌秒杀",style: TextStyle(color: HexColor.fromHex("#FFFFFF"),fontSize: 17),), + ), + body: Container( + child: Stack( + children: [ + CustomScrollView( + slivers: _createContent(context, model), + ) + ], + ), + ), + ); + }); + } +} + +///构建子模块 +_createContent(BuildContext context, List> model) { + List list = List(); + if (model == null) { + ///骨架图 + } else { + for (var item in model) { + WidgetModel widgetModel = + WidgetModel.fromJson(Map.from(item)); + if (item.containsKey("mod_name") && + item['mod_name'] == "hot_rank_tab_view") { + list.add(Expanded( + child: WidgetFactory.create(widgetModel.modName, + isSliver: false, model: item)[0])); + continue; + } + list.addAll(WidgetFactory.create(widgetModel.modName, + isSliver: false, model: item)); + } + } + return list; +} diff --git a/lib/pages/brand_page/brand_page_bloc.dart b/lib/pages/brand_page/brand_page_bloc.dart new file mode 100644 index 0000000..f62f171 --- /dev/null +++ b/lib/pages/brand_page/brand_page_bloc.dart @@ -0,0 +1,18 @@ +import 'dart:async'; + +import 'package:zhiying_comm/util/base_bloc.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class BrandBloc extends BlocBase { + List> _pageData = List(); + + StreamController>> _dataController = + StreamController>>.broadcast(); + + Stream>> get outData => _dataController.stream; + + @override + void dispose() { + _dataController.close(); + } +} diff --git a/lib/pages/brand_page/brand_page_skeleton.dart b/lib/pages/brand_page/brand_page_skeleton.dart new file mode 100644 index 0000000..203ca89 --- /dev/null +++ b/lib/pages/brand_page/brand_page_skeleton.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_appbar/brand_appbar.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_appbar/brand_appbar_sk.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_list/brand_list.dart'; +import 'package:zhiying_base_widget/widgets/brand/brand_list/brand_list_sk.dart'; +import 'package:zhiying_base_widget/widgets/brand/tabbar/brand_tab_bar.dart'; + +class BrandPageSkeleton extends StatefulWidget { + @override + _BrandPageSkeletonState createState() => _BrandPageSkeletonState(); +} + +class _BrandPageSkeletonState extends State + with TickerProviderStateMixin { + TabController tabController; + + @override + void initState() { + tabController = TabController(length: 6, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return buildSkeleton(); + return Scaffold( + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BrandAppBar(), + BrandTabBar(tabController), + Expanded(child: BrandList(tabController)) + ], + ), + ); + } + + @override + void dispose() { + tabController.dispose(); + super.dispose(); + } + + Widget buildSkeleton() { + return Column( + children: [BrandAppBarSkeleton(), BrandListSkeleton()], + ); + } +} diff --git a/lib/pages/brand_search_page/brand_search_page.dart b/lib/pages/brand_search_page/brand_search_page.dart new file mode 100644 index 0000000..27e4075 --- /dev/null +++ b/lib/pages/brand_search_page/brand_search_page.dart @@ -0,0 +1,106 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/pages/brand_search_page/brand_search_page_bloc.dart'; +import 'package:zhiying_comm/util/base_bloc.dart'; +import 'package:zhiying_comm/util/extension/color.dart'; + +class BrandSearchPage extends StatefulWidget { + @override + _BrandSearchPageState createState() => _BrandSearchPageState(); +} + +class _BrandSearchPageState extends State { + @override + Widget build(BuildContext context) { + return BlocProvider( + child: BrandSearchContainer(), bloc: BrandSearchPageBloc()); + } +} + +class BrandSearchContainer extends StatefulWidget { + @override + _BrandSearchContainerState createState() => _BrandSearchContainerState(); +} + +class _BrandSearchContainerState extends State { + @override + Widget build(BuildContext context) { + return StreamBuilder(builder: (context, asycn) { + return Scaffold( + appBar: AppBar( + leading: Navigator.canPop(context) + ? IconButton(icon: Icon(Icons.arrow_back_ios), onPressed: () {}) + : null, + centerTitle: true, + title: _buildTopSearch(), + ), + ); + }); + } + + _buildTopSearch() { + return Container( + height: 35, + child: Stack( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + height: 35, + margin: EdgeInsets.only(right: 35), + padding: EdgeInsets.only(left: 16), + decoration: BoxDecoration( + color: Colors.grey[100], + borderRadius: BorderRadius.circular(32)), + child: Row( + children: [ + Icon( + Icons.search, + color: Colors.grey[400], + ), + SizedBox( + width: 8, + ), + Expanded( + child: TextField( + onSubmitted: (value) => toSearch(value), + style: TextStyle(fontSize: 16), + decoration: InputDecoration( + isDense: true, + border: InputBorder.none, + contentPadding: EdgeInsets.zero, + ), + ), + ), + ], + ), + ), + ), + ], + ), + Align( + alignment: Alignment.centerRight, + child: Container( + width: 65, + child: FlatButton( + color: Colors.red, + padding: EdgeInsets.only(left: 0), + onPressed: () {}, + child: Text( + "搜索", + style: TextStyle(color: HexColor.fromHex("#FFFFFF")), + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(32)), + ), + ), + ) + ], + ), + ); + } + + ///搜索 + toSearch(String value) {} +} diff --git a/lib/pages/brand_search_page/brand_search_page_bloc.dart b/lib/pages/brand_search_page/brand_search_page_bloc.dart new file mode 100644 index 0000000..eca58c1 --- /dev/null +++ b/lib/pages/brand_search_page/brand_search_page_bloc.dart @@ -0,0 +1,18 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/util/base_bloc.dart'; + +class BrandSearchPageBloc extends BlocBase { + List> _pageData = List(); + + StreamController>> _dataController = + StreamController>>.broadcast(); + + Stream>> get outData => _dataController.stream; + + @override + void dispose() { + _dataController.close(); + } +} diff --git a/lib/pages/wallet_page/wallet_page.dart b/lib/pages/wallet_page/wallet_page.dart index 7e70c32..9180386 100644 --- a/lib/pages/wallet_page/wallet_page.dart +++ b/lib/pages/wallet_page/wallet_page.dart @@ -106,7 +106,7 @@ class _WalletPageContainerState extends State<_WalletPageContainer> { _refreshController.refreshCompleted(); return Stack( children: [ - Container(height: 362.h, color: _pageBloc.backgroundColor), + Container(height: 181, color: _pageBloc.backgroundColor), SmartRefresher( controller: _refreshController, enablePullDown: true, @@ -156,27 +156,27 @@ class _WalletPageContainerState extends State<_WalletPageContainer> { } } -class _SilverAppBarDelegate extends SliverPersistentHeaderDelegate { - _SilverAppBarDelegate(BuildContext context, this.child) { - this.context = context; - } - - BuildContext context; - final Widget child; - - @override - double get minExtent => MediaQuery.of(context).padding.top + 44; - - @override - double get maxExtent => MediaQuery.of(context).padding.top + 44; - - @override - Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) { - return child; - } - - @override - bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) { - return false; - } -} +// class _SilverAppBarDelegate extends SliverPersistentHeaderDelegate { +// _SilverAppBarDelegate(BuildContext context, this.child) { +// this.context = context; +// } +// +// BuildContext context; +// final Widget child; +// +// @override +// double get minExtent => MediaQuery.of(context).padding.top + 44; +// +// @override +// double get maxExtent => MediaQuery.of(context).padding.top + 44; +// +// @override +// Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) { +// return child; +// } +// +// @override +// bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) { +// return false; +// } +// } diff --git a/lib/register.dart b/lib/register.dart index 37ddddf..c5a118f 100644 --- a/lib/register.dart +++ b/lib/register.dart @@ -6,6 +6,10 @@ import 'package:sharesdk_plugin/sharesdk_register.dart'; import 'package:zhiying_base_widget/models/app_config_model.dart'; import 'package:zhiying_base_widget/pages/about_us_page/about_us_page.dart'; import 'package:zhiying_base_widget/pages/bil_detail_page/bil_detail_page.dart'; +import 'package:zhiying_base_widget/pages/brand_detail_page/brand_detail_page.dart'; +import 'package:zhiying_base_widget/pages/brand_detail_page/brand_detail_page_skeleton.dart'; +import 'package:zhiying_base_widget/pages/brand_page/brand_page_skeleton.dart'; +import 'package:zhiying_base_widget/pages/brand_search_page/brand_search_page.dart'; import 'package:zhiying_base_widget/pages/feedback_page/feedback_page.dart'; import 'package:zhiying_base_widget/pages/feedback_page/feedback_record_page.dart'; import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart'; diff --git a/lib/widgets/brand/brandDetailTabBarView/brand_detail_tab_bar_view.dart b/lib/widgets/brand/brandDetailTabBarView/brand_detail_tab_bar_view.dart new file mode 100644 index 0000000..172e488 --- /dev/null +++ b/lib/widgets/brand/brandDetailTabBarView/brand_detail_tab_bar_view.dart @@ -0,0 +1,155 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class BrandTabBarView extends StatefulWidget { + final TabController tabController; + + const BrandTabBarView({Key key, this.tabController}) : super(key: key); + + @override + _BrandTabBarViewState createState() => _BrandTabBarViewState(); +} + +class _BrandTabBarViewState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Padding( + padding: EdgeInsets.only(top: 8, bottom: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: buildSelectItem(), + ), + ), + ), + Divider( + height: 2, + endIndent: 32, + indent: 32, + ), + Expanded( + child: ListView.builder( + padding: EdgeInsets.all(0), + itemCount: 10, + itemBuilder: _buildGoods)) + ], + ), + ); + } + + buildSelectItem() { + List listWidget = List(); + for (var index = 0; index < 3; index++) { + listWidget.add(Text("价格")); + } + return listWidget; + } + + Widget _buildGoods(BuildContext context, int index) { + return Container( + decoration: BoxDecoration(color: Colors.white), + margin: EdgeInsets.only(left: 10, right: 10, bottom: 10), + padding: EdgeInsets.all(10), + child: Row( + children: [ + Container(), + Container( + width: 82, + height: 82, + decoration: BoxDecoration( + image: DecorationImage( + image: CachedNetworkImageProvider( + "https://alipic.lanhuapp.com/SketchPngd755e6f62dfaf7bae4da8bf384a5ef25bde99ae5e4f34424c5d404c805775bc1"))), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "王一博同款高露洁氨基酸精华漱口水双支装", + style: TextStyle( + color: HexColor.fromHex("#FF333333"), + fontSize: 13, + fontWeight: FontWeight.w500), + ), + SizedBox( + height: 8, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + color: Colors.red, + child: Text( + "到手价", + style: TextStyle( + color: HexColor.fromHex("#FFFFFF"), fontSize: 12), + ), + ), + SizedBox( + width: 4, + ), + Padding( + padding: EdgeInsets.only(bottom: 1), + child: Text( + "¥", + style: TextStyle( + color: HexColor.fromHex("#FFFF4242"), fontSize: 11), + ), + ), + Text( + "89.98", + style: TextStyle( + color: HexColor.fromHex("#FFFF4242"), fontSize: 18), + ), + SizedBox( + width: 4, + ), + Text( + "¥89.98", + style: TextStyle( + color: HexColor.fromHex("#FFACACAC"), + fontSize: 10, + decoration: TextDecoration.lineThrough), + ), + ], + ), + SizedBox( + height: 8, + ), + Row( + children: buildCoupon(), + ) + ], + )) + ], + ), + ); + } + + buildCoupon() { + List listWidget = List(); + for (var index = 0; index < 3; index++) { + listWidget.add(Container( + decoration: BoxDecoration(color: HexColor.fromHex("#FFFEEFEF")), + padding: EdgeInsets.only(left: 4, right: 4, bottom: 1, top: 1), + child: Text( + "50元", + style: TextStyle(color: HexColor.fromHex("#FFFF4242"), fontSize: 11), + ), + )); + } + return listWidget; + } +} diff --git a/lib/widgets/brand/brand_appbar/brand_appbar.dart b/lib/widgets/brand/brand_appbar/brand_appbar.dart new file mode 100644 index 0000000..737b288 --- /dev/null +++ b/lib/widgets/brand/brand_appbar/brand_appbar.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/util/extension/color.dart'; + +class BrandAppBar extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SliverAppBar( + centerTitle: true, + elevation: 0, + floating: false, + snap: false, + pinned: true, + leading: Navigator.canPop(context) + ? IconButton( + icon: Icon( + Icons.arrow_back_ios, + size: 12, + ), + onPressed: () { + Navigator.pop(context); + }) + : Container(), + title: Text( + "大牌秒杀", + style: TextStyle(color: HexColor.fromHex("#FFFFFF")), + ), + ); + } +} diff --git a/lib/widgets/brand/brand_appbar/brand_appbar_sk.dart b/lib/widgets/brand/brand_appbar/brand_appbar_sk.dart new file mode 100644 index 0000000..979d2c7 --- /dev/null +++ b/lib/widgets/brand/brand_appbar/brand_appbar_sk.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; +import 'package:shimmer/shimmer.dart'; + +class BrandAppBarSkeleton extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Shimmer.fromColors( + baseColor: Colors.grey[300], + highlightColor: Colors.grey[100], + child: Container( + color: Colors.white, + height: MediaQuery.of(context).padding.top + 46, + width: double.infinity, + )); + } +} diff --git a/lib/widgets/brand/brand_appbar/model/brand_appbar_model.dart b/lib/widgets/brand/brand_appbar/model/brand_appbar_model.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/widgets/brand/brand_detail_appbar/brand_detail_appbar.dart b/lib/widgets/brand/brand_detail_appbar/brand_detail_appbar.dart new file mode 100644 index 0000000..0cef41b --- /dev/null +++ b/lib/widgets/brand/brand_detail_appbar/brand_detail_appbar.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/util/extension/color.dart'; + +class BrandDetailAppBar extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SliverAppBar( + backgroundColor: Colors.transparent, + centerTitle: true, + elevation: 0, + floating: false, + snap: false, + pinned: true, + leading: Navigator.canPop(context) + ? IconButton( + icon: Icon( + Icons.arrow_back_ios, + size: 12, + ), + onPressed: () { + Navigator.pop(context); + }) + : Container(), + title: Text( + "品牌详情", + style: TextStyle(color: HexColor.fromHex("#FFFFFF"), fontSize: 15), + ), + ); + } +} diff --git a/lib/widgets/brand/brand_detail_recommend/brand_detail_recommend.dart b/lib/widgets/brand/brand_detail_recommend/brand_detail_recommend.dart new file mode 100644 index 0000000..d4cbc88 --- /dev/null +++ b/lib/widgets/brand/brand_detail_recommend/brand_detail_recommend.dart @@ -0,0 +1,114 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class BrandDetailRecommend extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 10,bottom: 8), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFFF"), + borderRadius: BorderRadius.circular(8)), + padding: EdgeInsets.only(top: 12, bottom: 12), + child: Column( + children: [ + Text( + "爆款推荐", + style: TextStyle(color: HexColor.fromHex("#FF1D1D1D")), + ), + SizedBox( + height: 5, + ), + Container( + width: 27, + height: 2.5, + color: HexColor.fromHex("#FFFF4242"), + ), + SizedBox( + height: 9, + ), + Row(children: buildItem()), + ], + )); + } + + ///构建子项 + buildItem() { + List listWidget = List(); + for (var index = 0; index < 3; index++) { + listWidget.add(Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.only(left: 4, right: 4), + child: Stack(children: [ + Column( + children: [ + CachedNetworkImage( + imageUrl: + "https://alipic.lanhuapp.com/SketchPngd755e6f62dfaf7bae4da8bf384a5ef25bde99ae5e4f34424c5d404c805775bc1", + fit: BoxFit.fitWidth, + ), + Container( + padding: + EdgeInsets.only(left: 0, right: 0, top: 0, bottom: 0), + margin: EdgeInsets.only(left: 10, right: 10, top: 10), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: CachedNetworkImageProvider( + "https://alipic.lanhuapp.com/SketchPng4f1ab85a62b33508b27e51c317ffb4f19d7dd5dcc70fadf50169cbc68d046cfb"))), + child: Center( + child: Padding( + padding: EdgeInsets.only( + top: 1, bottom: 1, left: 16, right: 16), + child: Text( + "热卖3.5万", + style: TextStyle( + fontSize: 12, color: HexColor.fromHex("#FFFFFF")), + ), + ), + ), + ), + SizedBox( + height: 7, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 1), + child: Text( + "¥", + style: TextStyle( + color: HexColor.fromHex("#FFFF4242"), fontSize: 10), + ), + ), + Text( + "23.9", + style: TextStyle( + fontWeight: FontWeight.bold, + color: HexColor.fromHex("#FFFF4242"), + fontSize: 15), + ), + SizedBox( + width: 10, + ), + Text( + "¥23.9", + style: TextStyle( + decoration: TextDecoration.lineThrough, + color: HexColor.fromHex("#FFACACAC"), + fontSize: 15), + ) + ], + ) + ], + ), + ]), + ), + )); + } + return listWidget; + } +} diff --git a/lib/widgets/brand/brand_detail_tab_bar/brand_detail_tab_bar.dart b/lib/widgets/brand/brand_detail_tab_bar/brand_detail_tab_bar.dart new file mode 100644 index 0000000..74b87a3 --- /dev/null +++ b/lib/widgets/brand/brand_detail_tab_bar/brand_detail_tab_bar.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/util/extension/color.dart'; + +///品牌详情的 +class BrandDetailTabBar extends StatefulWidget { + final TabController tabController; + + const BrandDetailTabBar({Key key, this.tabController}) : super(key: key); + + @override + _BrandDetailTabBarState createState() => _BrandDetailTabBarState(); +} + +class _BrandDetailTabBarState extends State + with TickerProviderStateMixin { + int currentSelectIndex = 0; + TabController tabController; + + @override + void initState() { + tabController = TabController(length: 3, vsync: this); + tabController.addListener(() { + currentSelectIndex = tabController.index; + setState(() {}); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF")), + padding: EdgeInsets.only(left: 10, right: 10,top: 4,bottom: 4), + margin: EdgeInsets.only(top: 0, left: 10, right: 10), + child: TabBar( + isScrollable: true, + controller: tabController, + tabs: _buildTabs(), + indicatorWeight: 0.01, + ), + ); + } + + _buildTabs() { + List listWidget = List(); + for (var index = 0; index < 3; index++) { + listWidget.add(Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "全部", + style: + TextStyle(color: HexColor.fromHex("#FFF84F45"), fontSize: 14), + ), + Container( + width: 40, + height: 2, + color: + currentSelectIndex == index ? Colors.red : Colors.transparent, + ) + ], + ), + )); + } + return listWidget; + } +} diff --git a/lib/widgets/brand/brand_detail_top/brand_detail_top.dart b/lib/widgets/brand/brand_detail_top/brand_detail_top.dart new file mode 100644 index 0000000..ef9069b --- /dev/null +++ b/lib/widgets/brand/brand_detail_top/brand_detail_top.dart @@ -0,0 +1,146 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class BrandDetailTop extends StatefulWidget { + @override + _BrandDetailTopState createState() => _BrandDetailTopState(); +} + +class _BrandDetailTopState extends State { + bool isOpen = false; + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 30), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFFF"), + borderRadius: BorderRadius.circular(8)), + padding: EdgeInsets.only(top: 45, bottom: 12), + width: double.infinity, + child: Column( + children: [ + Text( + "高露洁", + style: TextStyle( + color: HexColor.fromHex("#FF1D1D1D"), fontSize: 15), + ), + SizedBox( + height: 4, + ), + Container( + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFECEC"), + borderRadius: BorderRadius.circular(40)), + child: Padding( + padding: EdgeInsets.only(left: 4, right: 4), + child: Text( + "拥有百年历史的口腔护理专家", + style: TextStyle( + color: HexColor.fromHex("#FFFF4242"), fontSize: 10), + ), + ), + ), + SizedBox( + height: 14, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "粉丝:", + style: TextStyle( + color: HexColor.fromHex("#FF343434"), fontSize: 10), + ), + Text( + "888.8万", + style: TextStyle( + color: HexColor.fromHex("#FF343434"), fontSize: 10), + ), + SizedBox( + width: 11.5, + ), + Text( + "近期销量:", + style: TextStyle( + color: HexColor.fromHex("#FF343434"), fontSize: 10), + ), + Text( + "22.2万", + style: TextStyle( + color: HexColor.fromHex("#FF343434"), fontSize: 10), + ), + ], + ), + SizedBox( + height: 16, + ), + Text( + "「个人护理用品已销售到全球200多个国家和地区」", + style: TextStyle( + color: HexColor.fromHex("#FFFF4242"), fontSize: 11), + ), + SizedBox( + height: 16, + ), + Container( + height: isOpen ? null : 46, + padding: EdgeInsets.all(4), + child: Text( + " 高露洁公司已有200年的历史,产品已经销售到世界20多个国家和地区,成为全球领先的日用消费品公司,在口腔护理…个人护理、家居护理等方面为大众提供高品质的消费品,是广大消费者耳熟能详的全球著名品牌。", + overflow: TextOverflow.ellipsis, + maxLines: isOpen ? 1000 : 2, + style: TextStyle( + color: HexColor.fromHex("#FF767676"), fontSize: 12), + ), + ), + GestureDetector( + onTap: () { + ///点击展开更多 + isOpen = !isOpen; + setState(() {}); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + isOpen ? "收起" : "查看更多", + style: TextStyle( + color: HexColor.fromHex("#FF999999"), fontSize: 11), + ), + Icon( + isOpen ? Icons.keyboard_arrow_down : Icons.chevron_right, + size: 20, + color: HexColor.fromHex("#FF999999"), + ) + ], + ), + ) + ], + ), + ), + Align( + alignment: Alignment.topCenter, + child: Container( + child: CachedNetworkImage( + imageUrl: "", + width: 67, + height: 67, + placeholder: (context, url) { + return Container( + width: 67, + height: 67, + color: Colors.yellow, + ); + }, + ), + ), + ), + ], + ); + } +} diff --git a/lib/widgets/brand/brand_list/brand_list.dart b/lib/widgets/brand/brand_list/brand_list.dart new file mode 100644 index 0000000..9c5cb84 --- /dev/null +++ b/lib/widgets/brand/brand_list/brand_list.dart @@ -0,0 +1,360 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class BrandList extends StatefulWidget { + final TabController tabController; + + const BrandList(this.tabController, {Key key}) : super(key: key); + + @override + _BrandListState createState() => _BrandListState(); +} + +class _BrandListState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: TabBarView( + controller: widget.tabController, children: _buildTabView()), + ); + } + + _buildTabView() { + List listWidget = List(); + for (var index = 0; index < 6; index++) { + listWidget.add(BrandListView()); + } + return listWidget; + } +} + +///底部列表 +class BrandListView extends StatefulWidget { + final String type; + + const BrandListView({Key key, this.type}) : super(key: key); + + @override + _BrandListViewState createState() => _BrandListViewState(); +} + +class _BrandListViewState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: ListView.builder( + shrinkWrap: false, itemCount: 2, itemBuilder: _buildItem)); + } + + Widget _buildItem(BuildContext context, int index) { + if (index == 0) { + return ListView.builder( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: 2, + itemBuilder: _buildListItem1); + } else { + return ListView.builder( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: 2, + itemBuilder: _buildListItem2); + } + } + + ///构建某个品牌1 + Widget _buildListItem1(BuildContext context, int index) { + if (index == 0) { + return Container( + color: Colors.amber, + height: 40, + child: Center( + child: CachedNetworkImage( + imageUrl: "", + )), + ); + } else { + return Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 8), + padding: EdgeInsets.all(7), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFFF"), + borderRadius: BorderRadius.circular(8)), + child: Column( + children: [ + Row( + children: [ + CachedNetworkImage( + imageUrl: "", + width: 40, + height: 40, + ), + Expanded( + child: Container( + height: 40, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "百草味", + style: TextStyle( + color: HexColor.fromHex("#333333"), + fontSize: 15, + fontWeight: FontWeight.w600), + ), + Expanded( + child: Container( + height: 20, + margin: EdgeInsets.only(top: 4), + child: ListView.builder( + scrollDirection: Axis.horizontal, + padding: EdgeInsets.all(0), + shrinkWrap: true, + itemCount: 4, + itemBuilder: _buildDiscounts))) + ], + ), + ), + ), + Row( + children: [ + Text( + "加载更多", + style: TextStyle( + color: HexColor.fromHex("#FF333333"), fontSize: 12), + ), + Icon(Icons.keyboard_arrow_right) + ], + ) + ], + ), + Row( + children: [ + Expanded( + child: Container( + height: 180, + child: ListView.builder( + itemCount: 4, + shrinkWrap: true, + itemBuilder: _buildGoodsItem, + scrollDirection: Axis.horizontal, + ), + )) + ], + ) + ], + ), + ); + } + } + + ///构建某个品牌2 + Widget _buildListItem2(BuildContext context, int index) { + if (index == 0) { + return Container( + color: Colors.amber, + height: 40, + child: Center( + child: CachedNetworkImage( + imageUrl: "", + )), + ); + } else { + return Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 8), + padding: EdgeInsets.all(7), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFFF"), + borderRadius: BorderRadius.circular(8)), + child: Column( + children: [ + Row( + children: [ + CachedNetworkImage( + imageUrl: "", + width: 40, + height: 40, + ), + Expanded( + child: Container( + height: 40, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "百草味", + style: TextStyle( + color: HexColor.fromHex("#333333"), + fontSize: 15, + fontWeight: FontWeight.w600), + ), + Expanded( + child: Container( + height: 20, + margin: EdgeInsets.only(top: 4), + child: ListView.builder( + scrollDirection: Axis.horizontal, + padding: EdgeInsets.all(0), + shrinkWrap: true, + itemCount: 4, + itemBuilder: _buildDiscounts))) + ], + ), + ), + ), + Row( + children: [ + Text( + "已售", + style: TextStyle( + color: HexColor.fromHex("#FF333333"), fontSize: 12), + ), + Text( + "10.6", + style: TextStyle( + color: HexColor.fromHex("#FFFF4242"), fontSize: 12), + ), + Text( + "万件", + style: TextStyle( + color: HexColor.fromHex("#FF333333"), fontSize: 12), + ), + Icon(Icons.keyboard_arrow_right) + ], + ) + ], + ), + Row( + children: [ + Expanded( + child: Container( + height: 180, + child: ListView.builder( + itemCount: 4, + shrinkWrap: true, + itemBuilder: _buildGoodsItem, + scrollDirection: Axis.horizontal, + ), + )) + ], + ) + ], + ), + ); + } + } + + ///构建优惠项 + Widget _buildDiscounts(BuildContext context, int index) { + return Container( + margin: EdgeInsets.only(right: 6), + child: Padding( + padding: EdgeInsets.only(left: 4, right: 4), + child: Center( + child: Text( + "ddd", + style: + TextStyle(color: HexColor.fromHex("#FFFF6500"), fontSize: 10), + ), + ), + ), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFF1E8"), + borderRadius: BorderRadius.circular(4)), + ); + } + + Widget _buildGoodsItem(BuildContext context, int index) { + return Container( + width: 101, + margin: EdgeInsets.only(right: 10, top: 10), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 101, + height: 101, + color: HexColor.fromHex("#424242"), + ), + + ///商品名称 + Container( + width: 101, + child: Text( + "商品名称短发的说法发大水方法", + style: TextStyle(color: HexColor.fromHex("#333333")), + maxLines: 1, + overflow: TextOverflow.ellipsis, + )), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 1), + child: Text( + "¥", + style: TextStyle( + color: HexColor.fromHex("#333333"), fontSize: 10), + ), + ), + SizedBox( + width: 2, + ), + Text( + "118", + style: TextStyle( + color: HexColor.fromHex("#FFFF4242"), fontSize: 15), + ), + SizedBox( + width: 10, + ), + Padding( + padding: EdgeInsets.only(bottom: 1), + child: Text( + "¥200", + style: TextStyle( + decoration: TextDecoration.lineThrough, + color: HexColor.fromHex("#FFACACAC"), + fontSize: 10), + ), + ), + ], + ), + Row( + children: buildCoupon(), + ) + ], + ), + ); + } + + ///构建优惠券 + buildCoupon() { + List listWidget = List(); + for (var index = 0; index < 2; index++) { + listWidget.add(Expanded( + child: Container( + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFF1F1"), + borderRadius: BorderRadius.circular(4)), + child: Padding( + padding: EdgeInsets.all(4.0), + child: Text( + "券¥26.00", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: + TextStyle(color: HexColor.fromHex("#FFFF4242"), fontSize: 10), + ), + ), + ), + )); + } + return listWidget; + } +} diff --git a/lib/widgets/brand/brand_list/brand_list_item.dart b/lib/widgets/brand/brand_list/brand_list_item.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/widgets/brand/brand_list/brand_list_sk.dart b/lib/widgets/brand/brand_list/brand_list_sk.dart new file mode 100644 index 0000000..81587ae --- /dev/null +++ b/lib/widgets/brand/brand_list/brand_list_sk.dart @@ -0,0 +1,130 @@ +import 'package:flutter/material.dart'; +import 'package:shimmer/shimmer.dart'; + +class BrandListSkeleton extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Shimmer.fromColors( + baseColor: Colors.grey[300], + highlightColor: Colors.grey[100], + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10), + color: Colors.white, + height: MediaQuery.of(context).padding.top + 46, + width: 200, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + margin: EdgeInsets.only(top: 10), + color: Colors.white, + height: 40, + width: 60, + ), + Container( + margin: EdgeInsets.only(top: 10), + color: Colors.white, + height: 40, + width: 60, + ), + Container( + margin: EdgeInsets.only(top: 10), + color: Colors.white, + height: 40, + width: 60, + ), + Container( + margin: EdgeInsets.only(top: 10), + color: Colors.white, + height: 40, + width: 60, + ), + Container( + margin: EdgeInsets.only(top: 10), + color: Colors.white, + height: 40, + width: 60, + ), + ], + ), + Container( + margin: EdgeInsets.only(top: 10), + color: Colors.white, + height: MediaQuery.of(context).padding.top + 46, + width: 200, + ), + _buildItem(), + _buildItem(), + _buildItem() + ], + )); + } + + Widget _buildItem() { + return Container( + margin: EdgeInsets.only(top: 16, left: 16, right: 16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + Container( + width: 40, + height: 40, + color: Colors.white, + ), + SizedBox( + width: 16, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 80, + height: 16, + color: Colors.white, + ), + SizedBox( + height: 8, + ), + Container( + width: 80, + height: 16, + color: Colors.white, + ), + ], + )) + ], + ), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 10, top: 10), + width: 101, + height: 101, + color: Colors.white, + ), + Container( + margin: EdgeInsets.only(right: 10, top: 10), + width: 101, + height: 101, + color: Colors.white, + ), + Container( + margin: EdgeInsets.only(right: 10, top: 10), + width: 101, + height: 101, + color: Colors.white, + ), + + ], + ), + ], + ), + ); + } +} diff --git a/lib/widgets/brand/brand_list/model/brand_list_modle.dart b/lib/widgets/brand/brand_list/model/brand_list_modle.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/widgets/brand/tabbar/brand_tab_bar.dart b/lib/widgets/brand/tabbar/brand_tab_bar.dart new file mode 100644 index 0000000..e10367f --- /dev/null +++ b/lib/widgets/brand/tabbar/brand_tab_bar.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/util/extension/color.dart'; + +class BrandTabBar extends StatefulWidget { + final TabController tabController; + + const BrandTabBar(this.tabController, {Key key}) : super(key: key); + + @override + _BrandTabBarState createState() => _BrandTabBarState(); +} + +class _BrandTabBarState extends State { + var currentIndex = 0; + + @override + void initState() { + widget.tabController.addListener(() { + currentIndex = widget.tabController.index; + setState(() {}); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return TabBar( + indicatorWeight: 0.01, + isScrollable: true, + controller: widget.tabController, + tabs: _buildTabs(), + // onTap: (index) { + // currentIndex = index; + // setState(() {}); + // }, + ); + } + + ///构建 + _buildTabs() { + List listWidget = List(); + for (var index = 0; index < 6; index++) { + listWidget.add(Container( + height: 48, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Text( + index.toString(), + style: TextStyle( + color: index == currentIndex + ? Colors.red + : HexColor.fromHex("#000000")), + ), + Container( + width: 13.67, + height: 4.6, + color: index == currentIndex + ? Colors.red + : HexColor.fromHex("#000000"), + ) + ], + ), + )); + } + return listWidget; + } +} diff --git a/lib/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart b/lib/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart index 1c09104..43f5770 100644 --- a/lib/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart +++ b/lib/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart @@ -109,10 +109,12 @@ class _GoodsDetailsSlideBannerContainerState String items = datas.image_list[index]; return Container( width: double.infinity, - child: Hero( - tag: items + "top", - child: CachedNetworkImage( - imageUrl: items ?? '', fit: BoxFit.cover)), + child: (datas.image_list.length ?? 1) == 1 + ? CachedNetworkImage(imageUrl: items ?? '', fit: BoxFit.cover) + : Hero( + tag: items + "top", + child: CachedNetworkImage( + imageUrl: items ?? '', fit: BoxFit.cover)), ); }, itemCount: datas?.image_list?.length ?? 0, diff --git a/lib/widgets/hot_ranking/hot_ranking_appbar/hot_ranking_appbar.dart b/lib/widgets/hot_ranking/hot_ranking_appbar/hot_ranking_appbar.dart index ab0ecfe..ac18d6c 100644 --- a/lib/widgets/hot_ranking/hot_ranking_appbar/hot_ranking_appbar.dart +++ b/lib/widgets/hot_ranking/hot_ranking_appbar/hot_ranking_appbar.dart @@ -38,8 +38,8 @@ class HotRankingAppBar extends StatelessWidget { color: HexColor.fromHex(model?.appBarNameColor ?? "")), ), CachedNetworkImage( - height: 40.w, - width: 144.w, + height: 20, + width: 72, imageUrl: model.appBarNameImg ?? "", fit: BoxFit.fill, ) diff --git a/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart b/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart index da05d52..fd01893 100644 --- a/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart +++ b/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart @@ -32,25 +32,22 @@ class HotRankingGoods extends StatelessWidget { child: Stack( children: [ Container( - padding: EdgeInsets.all(15.w), + padding: EdgeInsets.all(12.5), margin: - EdgeInsets.only(top: 8.w, bottom: 8.w, left: 25.w, right: 25.w), + EdgeInsets.only(top: 4, bottom: 4, left: 12.5, right: 12.5), decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(15.w)), + color: Colors.white, borderRadius: BorderRadius.circular(12.5)), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ /// 商品图片 Container( - width: 254.w, - height: 254.w, + width:127, + height: 127, child: ClipRRect( borderRadius: BorderRadius.circular(6), - child: Hero( - tag: (good?.goodImage ?? "") + "top", - child: CachedNetworkImage( - imageUrl: good?.goodImage ?? '', - ), + child: CachedNetworkImage( + imageUrl: good?.goodImage ?? '', ), ), decoration: @@ -60,10 +57,11 @@ class HotRankingGoods extends StatelessWidget { /// 商品图片右边视图 Expanded( child: Container( - margin: EdgeInsets.only(left: 20.w), + margin: EdgeInsets.only(left: 10), child: Column( // mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ /// 商品标题 RichText( @@ -75,7 +73,7 @@ class HotRankingGoods extends StatelessWidget { alignment: ui.PlaceholderAlignment.middle, child: Container( padding: EdgeInsets.only( - left: 4.w, right: 4.w, top: 1, bottom: 1), + left: 2, right: 2, top: 1, bottom: 1), decoration: BoxDecoration( color: HexColor.fromHex( providers.providerBgColor), @@ -86,19 +84,19 @@ class HotRankingGoods extends StatelessWidget { color: HexColor.fromHex( providers.providerNameColor, ), - fontSize: 18.sp), + fontSize: 9), ), )), WidgetSpan( child: SizedBox( - width: 4.h, + width: 2, )), TextSpan( text: good.goodTitle, style: TextStyle( color: HexColor.fromHex( styleModel.titleColor ?? ""), - fontSize: 30.sp)) + fontSize: 15)) ])), /// 优惠券 @@ -108,7 +106,7 @@ class HotRankingGoods extends StatelessWidget { ? Container() : Container( margin: EdgeInsets.only( - top: 4, bottom: 4, right: 15.w), + top: 4, bottom: 4, right: 7.5), decoration: BoxDecoration( borderRadius: BorderRadius.circular(2.5), color: HexColor.fromHex(styleModel @@ -130,7 +128,7 @@ class HotRankingGoods extends StatelessWidget { .couponCommission .left .couponFontColor), - fontSize: 22.sp, + fontSize: 11, fontFamily: 'Din', package: 'zhiying_base_widget'), ), @@ -165,7 +163,7 @@ class HotRankingGoods extends StatelessWidget { .couponCommission .right .commissionFontColor), - fontSize: 22.sp, + fontSize: 11, fontFamily: 'Din', package: 'zhiying_base_widget'), ), @@ -181,13 +179,13 @@ class HotRankingGoods extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Padding( - padding: EdgeInsets.only(bottom: 6.sp), + padding: EdgeInsets.only(bottom: 3), child: Text( "¥", style: TextStyle( color: HexColor.fromHex( styleModel.currentPriceColor ?? ""), - fontSize: 20.sp), + fontSize: 10), ), ), Text( @@ -195,7 +193,7 @@ class HotRankingGoods extends StatelessWidget { style: TextStyle( color: HexColor.fromHex( styleModel.currentPriceColor ?? ""), - fontSize: 40.sp, + fontSize: 20, fontWeight: FontWeight.bold, fontFamily: 'Din', package: 'zhiying_base_widget'), @@ -204,13 +202,13 @@ class HotRankingGoods extends StatelessWidget { width: 6, ), Padding( - padding: EdgeInsets.only(bottom: 4.sp), + padding: EdgeInsets.only(bottom: 2), child: Text( "¥" + good.marketPrice ?? "", style: TextStyle( color: HexColor.fromHex( styleModel.marketPriceColor ?? ""), - fontSize: 22.sp, + fontSize: 11, decoration: TextDecoration.lineThrough, fontFamily: 'Din', package: 'zhiying_base_widget'), @@ -232,19 +230,19 @@ class HotRankingGoods extends StatelessWidget { Expanded( child: Container( alignment: Alignment.centerLeft, - height: 40.w, + height: 20, padding: EdgeInsets.only( - left: 40.w, + left: 20, ), margin: - EdgeInsets.only(right: 20, left: 20.w), + EdgeInsets.only(right: 20, left: 10), color: HexColor.fromHex( styleModel.hotRank.bgColor ?? ""), child: Text( - "热销" + good.inorderCount + "件", + "热销" + (good.inorderCount??"") + "件", style: TextStyle( color: Colors.white, - fontSize: 22.sp, + fontSize: 11, fontFamily: 'Din', package: 'zhiying_base_widget'), ), @@ -252,13 +250,13 @@ class HotRankingGoods extends StatelessWidget { ], ), Container( - width: 48.w, - height: 48.w, + width: 24, + height: 24, child: CachedNetworkImage( imageUrl: styleModel?.hotRank?.hotSaleImg ?? "", - width: 48.w, - height: 48.w, + width: 24, + height: 24, placeholder: (context, _) => Container(color: Colors.yellow), fit: BoxFit.fill, @@ -267,8 +265,8 @@ class HotRankingGoods extends StatelessWidget { Align( alignment: Alignment.centerRight, child: Container( - height: 48.h, - width: 127.w, + height: 24, + width: 63.5, decoration: BoxDecoration( image: DecorationImage( image: CachedNetworkImageProvider( @@ -295,9 +293,9 @@ class HotRankingGoods extends StatelessWidget { decoration: BoxDecoration( image: DecorationImage( image: CachedNetworkImageProvider(indexImage ?? ""))), - margin: EdgeInsets.only(left: 40.w, top: 8.h), - height: 60.w, - width: 60.w, + margin: EdgeInsets.only(left: 20, top: 4), + height: 30, + width: 30, ), ) ], diff --git a/lib/widgets/hot_ranking/hot_tab_bar/hot_tab_bar.dart b/lib/widgets/hot_ranking/hot_tab_bar/hot_tab_bar.dart index 79a9c5b..196764d 100644 --- a/lib/widgets/hot_ranking/hot_tab_bar/hot_tab_bar.dart +++ b/lib/widgets/hot_ranking/hot_tab_bar/hot_tab_bar.dart @@ -54,36 +54,42 @@ class _HotRankTableBarState extends State Widget build(BuildContext context) { return Container( margin: EdgeInsets.only(bottom: 10), - child: TabBar( - // indicatorPadding: EdgeInsets.only(bottom: 0, top: 10), - // indicatorWeight: 3, - indicatorWeight: 6, - indicatorSize: TabBarIndicatorSize.label, - controller: _tabController, - indicatorColor: HexColor.fromHex( - _barModel.tabList[_tabController.index].nameSelectColor), - unselectedLabelColor: HexColor.fromHex( - _barModel.tabList[_tabController.index].nameNoSelectColor), - labelColor: HexColor.fromHex( - _barModel.tabList[_tabController.index].nameSelectColor), - indicator: MaterialIndicator( - height: 2.5, - horizontalPadding: 8, - bottomRightRadius: 1.25, - bottomLeftRadius: 1.25, - topRightRadius: 1.25, - topLeftRadius: 1.25, - color: HexColor.fromHex(_barModel.tabList[_tabController.index].nameSelectColor), - ), - isScrollable: true, - tabs: _buildTabs(), - onTap: (index) { - var params = { - "type": "loadData", - "type_id": _barModel.tabList[_tabController.index].typeId - }; - _pageBloc.sendEvent(params); - }, + child: Row( + children: [ + Expanded( + child: TabBar( + // indicatorPadding: EdgeInsets.only(bottom: 0, top: 10), + // indicatorWeight: 3, + indicatorWeight: 6, + indicatorSize: TabBarIndicatorSize.label, + controller: _tabController, + indicatorColor: HexColor.fromHex( + _barModel.tabList[_tabController.index].nameSelectColor), + unselectedLabelColor: HexColor.fromHex( + _barModel.tabList[_tabController.index].nameNoSelectColor), + labelColor: HexColor.fromHex( + _barModel.tabList[_tabController.index].nameSelectColor), + indicator: MaterialIndicator( + height: 2.5, + horizontalPadding: 8, + bottomRightRadius: 1.25, + bottomLeftRadius: 1.25, + topRightRadius: 1.25, + topLeftRadius: 1.25, + color: HexColor.fromHex(_barModel.tabList[_tabController.index].nameSelectColor), + ), + isScrollable: true, + tabs: _buildTabs(), + onTap: (index) { + var params = { + "type": "loadData", + "type_id": _barModel.tabList[_tabController.index].typeId + }; + _pageBloc.sendEvent(params); + }, + ), + ), + ], ), ); } @@ -101,7 +107,7 @@ class _HotRankTableBarState extends State ), child: Text( item.name, - style: TextStyle(fontSize: 26.sp), + style: TextStyle(fontSize: 13), ), ), )); diff --git a/lib/widgets/wallet/wallet_bil/wallet_bil.dart b/lib/widgets/wallet/wallet_bil/wallet_bil.dart index e6adecb..98ebf79 100644 --- a/lib/widgets/wallet/wallet_bil/wallet_bil.dart +++ b/lib/widgets/wallet/wallet_bil/wallet_bil.dart @@ -39,16 +39,16 @@ class WalletBil extends StatelessWidget { children: [ CachedNetworkImage( imageUrl: model.bilIcon, - width: 36.w, - height: 36.w, + width: 18, + height: 18, fit: BoxFit.fill, ), SizedBox( - width: 15.w, + width: 7.5, ), Text( model.bilText, - style: TextStyle(fontSize: 24.sp), + style: TextStyle(fontSize: 12), ), ], ), diff --git a/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart b/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart index adcce00..53a1b8c 100644 --- a/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart +++ b/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart @@ -1,4 +1,4 @@ -import 'package:zhiying_comm/zhiying_comm.dart'; +import 'package:zhiying_comm/models/base/skip_model.dart'; class WalletHeaderModel extends SkipModel { String headerImg; @@ -6,26 +6,40 @@ class WalletHeaderModel extends SkipModel { String headerCashOutText; String headerCashOutTextColor; String headerCashOutKey; + String headerCashOutBtnText; + String headerCashOutBtnTextColor; String headerCashOutBtnImg; + String skipIdentifier; + String requiredLogin; + String requiredTaobaoAuth; List headerBottomList; WalletHeaderModel( {this.headerImg, - this.headerAvatar, - this.headerCashOutText, - this.headerCashOutTextColor, - this.headerCashOutKey, - this.headerCashOutBtnImg, - this.headerBottomList}); + this.headerAvatar, + this.headerCashOutText, + this.headerCashOutTextColor, + this.headerCashOutKey, + this.headerCashOutBtnText, + this.headerCashOutBtnTextColor, + this.headerCashOutBtnImg, + this.skipIdentifier, + this.requiredLogin, + this.requiredTaobaoAuth, + this.headerBottomList}); WalletHeaderModel.fromJson(Map json) { - super.fromJson(json); headerImg = json['header_img']; headerAvatar = json['header_avatar']; headerCashOutText = json['header_cash_out_text']; headerCashOutTextColor = json['header_cash_out_text_color']; headerCashOutKey = json['header_cash_out_key']; + headerCashOutBtnText = json['header_cash_out_btn_text']; + headerCashOutBtnTextColor = json['header_cash_out_btn_text_color']; headerCashOutBtnImg = json['header_cash_out_btn_img']; + skipIdentifier = json['skip_identifier']; + requiredLogin = json['required_login']; + requiredTaobaoAuth = json['required_taobao_auth']; if (json['header_bottom_list'] != null) { headerBottomList = new List(); json['header_bottom_list'].forEach((v) { @@ -35,13 +49,18 @@ class WalletHeaderModel extends SkipModel { } Map toJson() { - final Map data = super.toJson(); + final Map data = new Map(); data['header_img'] = this.headerImg; data['header_avatar'] = this.headerAvatar; data['header_cash_out_text'] = this.headerCashOutText; data['header_cash_out_text_color'] = this.headerCashOutTextColor; data['header_cash_out_key'] = this.headerCashOutKey; + data['header_cash_out_btn_text'] = this.headerCashOutBtnText; + data['header_cash_out_btn_text_color'] = this.headerCashOutBtnTextColor; data['header_cash_out_btn_img'] = this.headerCashOutBtnImg; + data['skip_identifier'] = this.skipIdentifier; + data['required_login'] = this.requiredLogin; + data['required_taobao_auth'] = this.requiredTaobaoAuth; if (this.headerBottomList != null) { data['header_bottom_list'] = this.headerBottomList.map((v) => v.toJson()).toList(); diff --git a/lib/widgets/wallet/wallet_data/wallet_data.dart b/lib/widgets/wallet/wallet_data/wallet_data.dart index 1a367b9..9267e0b 100644 --- a/lib/widgets/wallet/wallet_data/wallet_data.dart +++ b/lib/widgets/wallet/wallet_data/wallet_data.dart @@ -52,13 +52,13 @@ class _WalletDataState extends State { ? WalletDataSkeleton() : Container( margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 10), - padding: EdgeInsets.only(left: 36.w, right: 26.w), + padding: EdgeInsets.only(left: 18, right: 13), decoration: BoxDecoration( image: DecorationImage( image: CachedNetworkImageProvider( model?.headerImg ?? ""), fit: BoxFit.fill)), - height: 290.h, + height: 145, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ @@ -69,8 +69,8 @@ class _WalletDataState extends State { children: [ CachedNetworkImage( imageUrl: model?.headerAvatar ?? "", - height: 66.h, - width: 52.h, + height: 33, + width: 26, fit: BoxFit.fill, ), Padding( @@ -82,7 +82,7 @@ class _WalletDataState extends State { Text( model?.headerCashOutText ?? "", style: TextStyle( - fontSize: 25.sp, + fontSize: 12.5, color: HexColor.fromHex( model?.headerCashOutTextColor ?? "")), @@ -93,7 +93,7 @@ class _WalletDataState extends State { ? dataModel[model.headerCashOutKey] : "", style: TextStyle( - fontSize: 40.sp, + fontSize: 20, color: HexColor.fromHex( model.headerCashOutTextColor), fontFamily: 'Din-Bold', @@ -120,13 +120,15 @@ class _WalletDataState extends State { ), child: Padding( padding: EdgeInsets.only( - left: 29.w, - right: 29.w, - top: 20.w, - bottom: 20.w), + left: 14.5, + right: 14.5, + top: 10, + bottom: 10), child: Text( - "提现", - style: TextStyle(color: Colors.white), + model.headerCashOutBtnText, + style: TextStyle( + color: HexColor.fromHex( + model.headerCashOutBtnTextColor)), ), ), ), @@ -159,14 +161,14 @@ class _WalletDataState extends State { : "", style: TextStyle( color: HexColor.fromHex(item.valueColor), - fontSize: 30.sp, + fontSize: 15, fontFamily: 'Din-Bold', package: 'zhiying_base_widget'), ), Text( item.text, style: TextStyle( - color: HexColor.fromHex(item.textColor), fontSize: 22.sp), + color: HexColor.fromHex(item.textColor), fontSize: 11), ), ], )); diff --git a/lib/widgets/wallet/wallet_detail/wallet_detail.dart b/lib/widgets/wallet/wallet_detail/wallet_detail.dart index b095863..c92eb9e 100644 --- a/lib/widgets/wallet/wallet_detail/wallet_detail.dart +++ b/lib/widgets/wallet/wallet_detail/wallet_detail.dart @@ -4,13 +4,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:tab_indicator_styler/tab_indicator_styler.dart'; import 'package:zhiying_base_widget/dialog/tip_dialog/tip_dialog.dart'; -import 'package:zhiying_base_widget/pages/withdraw_page/withdraw_page.dart'; -import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; -import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/model/wallet_detail_data_model.dart'; import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/model/wallet_detail_model.dart'; import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail_bloc.dart'; import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail_sk.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; @@ -55,9 +51,10 @@ class _WalletDetailState extends State with TickerProviderStateMix } return Container( decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), - margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 15.h, bottom: 15.h), + margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 7.5, bottom: 7.5), padding: const EdgeInsets.only(bottom: 13), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.only(top: 12), @@ -87,10 +84,10 @@ class _WalletDetailState extends State with TickerProviderStateMix ///日期选择 Container( - height: 100.h, + height: 50, alignment: Alignment.center, child: ListView.builder( - padding: EdgeInsets.only( left: 16.w), + padding: EdgeInsets.only( left: 8), itemCount: _model.dateList.length, scrollDirection: Axis.horizontal, itemBuilder: _buildTimeItem, @@ -99,8 +96,8 @@ class _WalletDetailState extends State with TickerProviderStateMix /// 数据 Container( - height: 126.h, - margin: EdgeInsets.only(top: 16, left: 30.w, right: 30.w), + height: 63, + margin: EdgeInsets.only(top: 16, left: 15, right: 15), width: double.infinity, decoration: BoxDecoration(image: DecorationImage(image: CachedNetworkImageProvider(_model.providerDashbord.finish.bgImg), fit: BoxFit.fill)), child: Column( @@ -112,7 +109,7 @@ class _WalletDetailState extends State with TickerProviderStateMix padding: const EdgeInsets.all(8.0), child: Text( _model.providerDashbord.finish.text, - style: TextStyle(fontSize: 28.sp, color: HexColor.fromHex(_model.providerDashbord.finish.textColor)), + style: TextStyle(fontSize: 14, color: HexColor.fromHex(_model.providerDashbord.finish.textColor)), ), ), Row( @@ -120,15 +117,15 @@ class _WalletDetailState extends State with TickerProviderStateMix children: [ Text( _model.providerDashbord.finish.text ?? "", - style: TextStyle(color: Colors.black, fontSize: 22.sp), + style: TextStyle(color: Colors.black, fontSize: 11), ), InkWell( child: Padding( padding: const EdgeInsets.all(8.0), child: CachedNetworkImage( imageUrl: _model.providerDashbord.finish.tipIcon ?? "", - width: 20.h, - height: 20.h, + width: 10, + height: 10, fit: BoxFit.fill, ), ), @@ -140,7 +137,7 @@ class _WalletDetailState extends State with TickerProviderStateMix ), Text( _bloc.selectDateData.finish ?? "", - style: TextStyle(color: Colors.red, fontSize: 40.sp, fontFamily: 'Din', package: 'zhiying_base_widget', fontWeight: FontWeight.bold), + style: TextStyle(color: Colors.red, fontSize: 20, fontFamily: 'Din', package: 'zhiying_base_widget', fontWeight: FontWeight.bold), ) ], ), @@ -187,7 +184,7 @@ class _WalletDetailState extends State with TickerProviderStateMix child: Center( child: Text( item.text, - style: TextStyle(fontSize: 22.sp, color: HexColor.fromHex(item.type == _bloc.selectDateData.type ? item.textSelectColor : item.textUnselectColor)), + style: TextStyle(fontSize: 11, color: HexColor.fromHex(item.type == _bloc.selectDateData.type ? item.textSelectColor : item.textUnselectColor)), )), ), ), @@ -220,25 +217,25 @@ class _WalletDetailState extends State with TickerProviderStateMix child: Column( children: [ SizedBox( - height: 15.h, + height: 7.5, ), item.isShow == "0" ? Container() : Text( item.title, - style: TextStyle(color: HexColor.fromHex(item.titleColor), fontSize: 28.sp), + style: TextStyle(color: HexColor.fromHex(item.titleColor), fontSize: 14), ), SizedBox( - height: 15.h, + height: 7.5, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: Container( - height: 123.h, - margin: EdgeInsets.only(right: 8, left: 30.w), - padding: EdgeInsets.only(left: 20.w), + height: 61.5, + margin: EdgeInsets.only(right: 8, left: 15), + padding: EdgeInsets.only(left: 10), decoration: BoxDecoration(image: DecorationImage(image: CachedNetworkImageProvider(item.itemList[0].bgImg ?? ""), fit: BoxFit.fill)), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -248,15 +245,15 @@ class _WalletDetailState extends State with TickerProviderStateMix children: [ Text( item.itemList[0].text ?? "", - style: TextStyle(fontSize: 22.sp, color: HexColor.fromHex(item.itemList[0].textColor)), + style: TextStyle(fontSize: 11, color: HexColor.fromHex(item.itemList[0].textColor)), ), InkWell( child: Padding( padding: const EdgeInsets.all(8.0), child: CachedNetworkImage( imageUrl: item.itemList[0].tipIcon, - width: 20.h, - height: 20.h, + width: 10, + height: 10, fit: BoxFit.fill, ), ), @@ -272,7 +269,7 @@ class _WalletDetailState extends State with TickerProviderStateMix fontFamily: 'Din', package: 'zhiying_base_widget', fontWeight: FontWeight.bold, - fontSize: 34.sp, + fontSize: 17, color: HexColor.fromHex(item.itemList[1].valueColor), )) ], @@ -280,9 +277,9 @@ class _WalletDetailState extends State with TickerProviderStateMix ), Expanded( child: Container( - height: 123.h, - margin: EdgeInsets.only(left: 8, right: 30.w), - padding: EdgeInsets.only(left: 20.w), + height: 61.5, + margin: EdgeInsets.only(left: 8, right: 15,), + padding: EdgeInsets.only(left: 10), decoration: BoxDecoration(image: DecorationImage(image: CachedNetworkImageProvider(item.itemList[1].bgImg ?? ""), fit: BoxFit.fill)), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -292,15 +289,15 @@ class _WalletDetailState extends State with TickerProviderStateMix children: [ Text( item.itemList[1].text ?? "", - style: TextStyle(fontSize: 22.sp, color: HexColor.fromHex(item.itemList[1].textColor)), + style: TextStyle(fontSize: 11, color: HexColor.fromHex(item.itemList[1].textColor)), ), InkWell( child: Padding( padding: const EdgeInsets.all(8.0), child: CachedNetworkImage( imageUrl: item.itemList[1].tipIcon, - width: 20.h, - height: 20.h, + width: 10, + height: 10, fit: BoxFit.fill, ), ), @@ -314,7 +311,7 @@ class _WalletDetailState extends State with TickerProviderStateMix Text( dataMap[item.itemList[1].vauleKey], style: TextStyle( - fontSize: 34.sp, color: HexColor.fromHex(item.itemList[1].valueColor), fontFamily: 'Din', package: 'zhiying_base_widget', fontWeight: FontWeight.bold), + fontSize: 17, color: HexColor.fromHex(item.itemList[1].valueColor), fontFamily: 'Din', package: 'zhiying_base_widget', fontWeight: FontWeight.bold), ) ], ), diff --git a/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart b/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart index 5682119..81f79a0 100644 --- a/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart +++ b/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart @@ -27,7 +27,8 @@ class WalletBilDetail extends StatefulWidget { _WalletBilDetailState createState() => _WalletBilDetailState(); } -class _WalletBilDetailState extends State with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { +class _WalletBilDetailState extends State + with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { WalletBilDetailWidgetBloc _bloc; TabController _tabController; @@ -36,7 +37,8 @@ class _WalletBilDetailState extends State with TickerProviderSt void initState() { _bloc = WalletBilDetailWidgetBloc(); _bloc.initStyleData(json.decode(widget.data['data'])); - _tabController = TabController(length: _bloc.styleData.tabList.length, vsync: this); + _tabController = + TabController(length: _bloc.styleData.tabList.length, vsync: this); _bloc.loadInputData(_bloc.inPutCurrentPage, _bloc.inputShowDate); _bloc.loadOutputData(_bloc.outPutCurrentPage, _bloc.outputShowDate); @@ -52,7 +54,8 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ AppBar( brightness: Brightness.light, - backgroundColor: HexColor.fromHex(_bloc.styleData.appBarBgColor), + backgroundColor: + HexColor.fromHex(_bloc.styleData.appBarBgColor), centerTitle: true, leading: IconButton( icon: Icon( @@ -65,7 +68,10 @@ class _WalletBilDetailState extends State with TickerProviderSt }), title: Text( _bloc.styleData.appBarName ?? "", - style: TextStyle(color: HexColor.fromHex(_bloc.styleData.appBarNameColor), fontWeight: FontWeight.bold, fontSize: 18), + style: TextStyle( + color: HexColor.fromHex(_bloc.styleData.appBarNameColor), + fontWeight: FontWeight.bold, + fontSize: 18), ), ), Container( @@ -82,15 +88,22 @@ class _WalletBilDetailState extends State with TickerProviderSt controller: _tabController, tabs: _buildTabBarItem(), indicatorWeight: 9.5, - labelStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), - unselectedLabelStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), + labelStyle: + TextStyle(fontSize: 15, fontWeight: FontWeight.bold), + unselectedLabelStyle: + TextStyle(fontSize: 15, fontWeight: FontWeight.bold), labelColor: HexColor.fromHex(_bloc.styleData.tabSeletedColor), - unselectedLabelColor: HexColor.fromHex(_bloc.styleData.tabNoSeletedColor), - indicatorColor: HexColor.fromHex(_bloc.styleData.tabLineColor), + unselectedLabelColor: + HexColor.fromHex(_bloc.styleData.tabNoSeletedColor), + indicatorColor: + HexColor.fromHex(_bloc.styleData.tabLineColor), indicatorSize: TabBarIndicatorSize.label, ), ), - Expanded(child: TabBarView(controller: _tabController, children: _buildTabViewPage())) + Expanded( + child: TabBarView( + controller: _tabController, + children: _buildTabViewPage())) ], ), )); @@ -126,8 +139,14 @@ class _WalletBilDetailState extends State with TickerProviderSt }, child: Padding( padding: const EdgeInsets.only(top: 8, bottom: 8), - child: Text(tabList.type == "input" ? _bloc.inputShowDate : _bloc.outputShowDate, - style: TextStyle(fontSize: 28.sp, color: HexColor.fromHex(_bloc.styleData.timeSelectColor), fontWeight: FontWeight.bold))), + child: Text( + tabList.type == "input" + ? _bloc.inputShowDate + : _bloc.outputShowDate, + style: TextStyle( + fontSize: 14, + color: HexColor.fromHex(_bloc.styleData.timeSelectColor), + fontWeight: FontWeight.bold))), ), Icon( Icons.arrow_drop_down, @@ -147,11 +166,15 @@ class _WalletBilDetailState extends State with TickerProviderSt if (tabList.type == 'input') { _bloc.inputSelectType = tabViewBtns[index].type; _bloc.inPutCurrentPage = 1; - _bloc.loadInputData(_bloc.inPutCurrentPage, _bloc.inputShowDate, type: _bloc.inputSelectType); + _bloc.loadInputData( + _bloc.inPutCurrentPage, _bloc.inputShowDate, + type: _bloc.inputSelectType); } else { _bloc.outputSelectType = tabViewBtns[index].type; _bloc.outPutCurrentPage = 1; - _bloc.loadOutputData(_bloc.outPutCurrentPage, _bloc.outputShowDate, type: _bloc.outputSelectType); + _bloc.loadOutputData( + _bloc.outPutCurrentPage, _bloc.outputShowDate, + type: _bloc.outputSelectType); } _bloc.refresh(); }, @@ -159,16 +182,24 @@ class _WalletBilDetailState extends State with TickerProviderSt child: Container( alignment: Alignment.center, margin: EdgeInsets.only(right: 12.5), - padding: EdgeInsets.only(left: 16, right: 16, top: 2.5, bottom: 2.5), + padding: EdgeInsets.only( + left: 16, right: 16, top: 2.5, bottom: 2.5), decoration: BoxDecoration( border: Border.all( - color: HexColor.fromHex(selectType == tabViewBtns[index].type ? _bloc.styleData.btnSelectedColor : _bloc.styleData.btnNoSelectedColor), + color: HexColor.fromHex( + selectType == tabViewBtns[index].type + ? _bloc.styleData.btnSelectedColor + : _bloc.styleData.btnNoSelectedColor), ), borderRadius: BorderRadius.circular(50)), child: Text( tabViewBtns[index].name ?? "", style: TextStyle( - fontSize: 11, color: HexColor.fromHex(selectType == tabViewBtns[index].type ? _bloc.styleData.btnSelectedColor : _bloc.styleData.btnNoSelectedColor)), + fontSize: 11, + color: HexColor.fromHex( + selectType == tabViewBtns[index].type + ? _bloc.styleData.btnSelectedColor + : _bloc.styleData.btnNoSelectedColor)), ), ), ); @@ -179,9 +210,11 @@ class _WalletBilDetailState extends State with TickerProviderSt } _selectDate(TabList tabList) async { - var result = await showDialog(context: context, builder: (context) => SelectDateYMDialog()); + var result = await showDialog( + context: context, builder: (context) => SelectDateYMDialog()); if (result != null) { - var dataTime = DateFormat('yyyy-MM').format(DateTime(int.parse(result['year']), int.parse(result['month']))); + var dataTime = DateFormat('yyyy-MM').format( + DateTime(int.parse(result['year']), int.parse(result['month']))); if (tabList.type == "input") { _bloc.inputShowDate = dataTime; _bloc.loadInputData(_bloc.inPutCurrentPage, _bloc.inputShowDate); @@ -196,7 +229,9 @@ class _WalletBilDetailState extends State with TickerProviderSt _buildBottomItem(TabList tabList) { return ListView.builder( shrinkWrap: true, - itemCount: tabList.type == 'input' ? _bloc.inputDataVM.length : _bloc.outputDataVM.length, + itemCount: tabList.type == 'input' + ? _bloc.inputDataVM.length + : _bloc.outputDataVM.length, itemBuilder: (context, index) { return _buildItem(context, index, tabList); }); @@ -208,8 +243,10 @@ class _WalletBilDetailState extends State with TickerProviderSt var modelItem = _bloc.inputDataVM[index]; return Container( margin: EdgeInsets.only(left: 12.5, right: 12.5, bottom: 4, top: 4), - padding: EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(8)), + padding: EdgeInsets.only(left: 12.5, right: 12.5, top: 10, bottom: 10), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFFF"), + borderRadius: BorderRadius.circular(8)), child: Column( children: [ Row( @@ -219,25 +256,33 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), color: HexColor.fromHex("#FFFFF3F3"), border: Border.all(color: HexColor.fromHex(inputItemStyle.typeNameColor))), + borderRadius: BorderRadius.circular(4), + color: HexColor.fromHex("#FFFFF3F3"), + border: Border.all( + color: HexColor.fromHex( + inputItemStyle.typeNameColor))), child: Padding( - padding: const EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 2), + padding: const EdgeInsets.only( + left: 4, right: 4, top: 2, bottom: 2), child: Center( child: Text( modelItem['type'] ?? "", - style: TextStyle(color: HexColor.fromHex(inputItemStyle.typeNameColor), fontSize: 20.sp), + style: TextStyle( + color: HexColor.fromHex( + inputItemStyle.typeNameColor), + fontSize: 10), ), ), ), ), Container( - width: 353.w, - margin: EdgeInsets.only(left: 15.w), + width: 176.5, + margin: EdgeInsets.only(left: 7.5), child: Text( modelItem['title'] ?? "", maxLines: 1, overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 28.sp), + style: TextStyle(fontSize: 14), )) ], ), @@ -245,11 +290,16 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( "+ ", - style: TextStyle(color: HexColor.fromHex(inputItemStyle.amountColor)), + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.amountColor)), ), Text( "¥ " + modelItem['amount'], - style: TextStyle(color: HexColor.fromHex(inputItemStyle.amountColor), fontSize: 30.sp, fontFamily: 'Din', package: 'zhiying_base_widget'), + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.amountColor), + fontSize: 15, + fontFamily: 'Din', + package: 'zhiying_base_widget'), ) ], ) @@ -264,33 +314,45 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( inputItemStyle.orderIdText, - style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['order_id'], - style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.contentColor), + fontSize: 11), ), SizedBox( - width: 28.w, + width: 14, ), GestureDetector( onTap: () { - Clipboard.setData(ClipboardData(text: modelItem['order_id'])); + Clipboard.setData( + ClipboardData(text: modelItem['order_id'])); Fluttertoast.showToast(msg: "已复制"); }, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: HexColor.fromHex(inputItemStyle.copyBtnBgColor), - border: Border.all(color: HexColor.fromHex(inputItemStyle.contentColor), width: 0.5)), + border: Border.all( + color: + HexColor.fromHex(inputItemStyle.contentColor), + width: 0.5)), child: Padding( - padding: EdgeInsets.only(left: 16, right: 16, top: 1, bottom: 1), + padding: EdgeInsets.only( + left: 16, right: 16, top: 1, bottom: 1), child: Text( inputItemStyle.copyBtnText, - style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex( + inputItemStyle.copyBtnTextColor), + fontSize: 11), ), ), ), @@ -307,14 +369,17 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( inputItemStyle.orderTypeText, - style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['order_type'] ?? "", - style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex("#FF999999"), fontSize: 11), ), ], )), @@ -323,7 +388,9 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( inputItemStyle.amountText + " ¥" + modelItem['amount'], - style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.contentColor), + fontSize: 11), ), ], )) @@ -339,14 +406,17 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( inputItemStyle.timeText, - style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['time'] ?? "", - style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex("#FF999999"), fontSize: 11), ), ], )), @@ -354,8 +424,13 @@ class _WalletBilDetailState extends State with TickerProviderSt child: Row( children: [ Text( - inputItemStyle.settleTimeText + " " + modelItem['settle_time'] ?? "", - style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), + inputItemStyle.settleTimeText + + " " + + modelItem['settle_time'] ?? + "", + style: TextStyle( + color: HexColor.fromHex(inputItemStyle.contentColor), + fontSize: 11), ), ], )) @@ -371,8 +446,11 @@ class _WalletBilDetailState extends State with TickerProviderSt ///消费返回的Item return Container( margin: EdgeInsets.only(left: 12.5, right: 12.5, bottom: 4, top: 4), - padding: EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(8)), + padding: + EdgeInsets.only(left: 12.5, right: 12.5, top: 10, bottom: 10), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFFF"), + borderRadius: BorderRadius.circular(8)), child: Column( children: [ Row( @@ -384,25 +462,31 @@ class _WalletBilDetailState extends State with TickerProviderSt decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: HexColor.fromHex("#FFFFF3F3"), - border: Border.all(color: HexColor.fromHex(outputItemStyle.typeNameColor))), + border: Border.all( + color: HexColor.fromHex( + outputItemStyle.typeNameColor))), child: Padding( - padding: const EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 2), + padding: const EdgeInsets.only( + left: 4, right: 4, top: 2, bottom: 2), child: Center( child: Text( modelItem['type'] ?? "", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.typeNameColor), fontSize: 20.sp), + style: TextStyle( + color: HexColor.fromHex( + outputItemStyle.typeNameColor), + fontSize: 10), ), ), ), ), Container( - width: 353.w, - margin: EdgeInsets.only(left: 15.w), + width: 176.5, + margin: EdgeInsets.only(left: 7.5), child: Text( modelItem['title'] ?? "", maxLines: 1, overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 28.sp), + style: TextStyle(fontSize: 14), )) ], ), @@ -410,11 +494,16 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( "- ", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor)), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.amountColor)), ), Text( "¥ " + modelItem['amount'], - style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor), fontSize: 30.sp), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.amountColor), + fontSize: 15), ) ], ) @@ -429,33 +518,46 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( outputItemStyle.orderIdText, - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['order_id'], - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( - width: 28.w, + width: 14, ), GestureDetector( onTap: () { - Clipboard.setData(ClipboardData(text: modelItem['order_id'])); + Clipboard.setData( + ClipboardData(text: modelItem['order_id'])); Fluttertoast.showToast(msg: "已复制"); }, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), - color: HexColor.fromHex(outputItemStyle.copyBtnBgColor), - border: Border.all(color: HexColor.fromHex(outputItemStyle.contentColor),width: 0.5)), + color: + HexColor.fromHex(outputItemStyle.copyBtnBgColor), + border: Border.all( + color: HexColor.fromHex( + outputItemStyle.contentColor), + width: 0.5)), child: Padding( - padding: EdgeInsets.only(left: 16, right: 16, top: 1, bottom: 1), + padding: EdgeInsets.only( + left: 16, right: 16, top: 1, bottom: 1), child: Text( outputItemStyle.copyBtnText ?? "", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex( + outputItemStyle.contentColor), + fontSize: 11), ), ), ), @@ -472,14 +574,18 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( outputItemStyle.consumeOrderTypeText, - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['order_type'] ?? "", - style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex("#FF999999"), fontSize: 11), ), ], )), @@ -487,8 +593,13 @@ class _WalletBilDetailState extends State with TickerProviderSt child: Row( children: [ Text( - outputItemStyle.consumeAmountText + " ¥" + modelItem['amount'], - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + outputItemStyle.consumeAmountText + + " ¥" + + modelItem['amount'], + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), ], )) @@ -504,14 +615,18 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( outputItemStyle.consumeTimeText, - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['time'] ?? "", - style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex("#FF999999"), fontSize: 11), ), ], )), @@ -537,8 +652,11 @@ class _WalletBilDetailState extends State with TickerProviderSt } else if (modelItem['type'] == '提现') { return Container( margin: EdgeInsets.only(left: 12.5, right: 12.5, bottom: 4, top: 4), - padding: EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(8)), + padding: + EdgeInsets.only(left: 12.5, right: 12.5, top: 10, bottom: 10), + decoration: BoxDecoration( + color: HexColor.fromHex("#FFFFFF"), + borderRadius: BorderRadius.circular(8)), child: Column( children: [ Row( @@ -550,25 +668,31 @@ class _WalletBilDetailState extends State with TickerProviderSt decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: HexColor.fromHex("#FFFFF3F3"), - border: Border.all(color: HexColor.fromHex(outputItemStyle.typeNameColor))), + border: Border.all( + color: HexColor.fromHex( + outputItemStyle.typeNameColor))), child: Padding( - padding: const EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 2), + padding: const EdgeInsets.only( + left: 4, right: 4, top: 2, bottom: 2), child: Center( child: Text( modelItem['type'] ?? "", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.typeNameColor), fontSize: 20.sp), + style: TextStyle( + color: HexColor.fromHex( + outputItemStyle.typeNameColor), + fontSize: 10), ), ), ), ), Container( - width: 353.w, - margin: EdgeInsets.only(left: 15.w), + width: 176.5, + margin: EdgeInsets.only(left: 12.5), child: Text( modelItem['title'] ?? "", maxLines: 1, overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 28.sp), + style: TextStyle(fontSize: 14), )) ], ), @@ -576,11 +700,16 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( "- ", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor)), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.amountColor)), ), Text( "¥ " + modelItem['amount'], - style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor), fontSize: 30.sp), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.amountColor), + fontSize: 15), ) ], ) @@ -595,33 +724,46 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( outputItemStyle.orderIdText, - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['order_id'], - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( - width: 28.w, + width: 14, ), GestureDetector( onTap: () { - Clipboard.setData(ClipboardData(text: modelItem['order_id'])); + Clipboard.setData( + ClipboardData(text: modelItem['order_id'])); Fluttertoast.showToast(msg: "已复制"); }, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), - color: HexColor.fromHex(outputItemStyle.copyBtnBgColor), - border: Border.all(color: HexColor.fromHex(outputItemStyle.contentColor), width: 0.5)), + color: + HexColor.fromHex(outputItemStyle.copyBtnBgColor), + border: Border.all( + color: HexColor.fromHex( + outputItemStyle.contentColor), + width: 0.5)), child: Padding( - padding: EdgeInsets.only(left: 16, right: 16, top: 1, bottom: 1), + padding: EdgeInsets.only( + left: 16, right: 16, top: 1, bottom: 1), child: Text( outputItemStyle.copyBtnText ?? "", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex( + outputItemStyle.contentColor), + fontSize: 11), ), ), ), @@ -638,14 +780,20 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( outputItemStyle.withdrawAccountText, - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['account'] ?? "", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), ], )), @@ -653,8 +801,13 @@ class _WalletBilDetailState extends State with TickerProviderSt child: Row( children: [ Text( - outputItemStyle.withdrawAmountText + " ¥" + modelItem['amount'], - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + outputItemStyle.withdrawAmountText + + " ¥" + + modelItem['amount'], + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), ], )) @@ -668,14 +821,18 @@ class _WalletBilDetailState extends State with TickerProviderSt children: [ Text( outputItemStyle.withdrawTimeText, - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), SizedBox( width: 4, ), Text( modelItem['time'] ?? "", - style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), + style: TextStyle( + color: HexColor.fromHex("#FF999999"), fontSize: 11), ), ], )), @@ -683,8 +840,14 @@ class _WalletBilDetailState extends State with TickerProviderSt child: Row( children: [ Text( - outputItemStyle.withdrawOrderStatusText + " " + modelItem['order_status'] ?? "", - style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), + outputItemStyle.withdrawOrderStatusText + + " " + + modelItem['order_status'] ?? + "", + style: TextStyle( + color: + HexColor.fromHex(outputItemStyle.contentColor), + fontSize: 11), ), ], )) @@ -723,7 +886,9 @@ class _WalletBilDetailState extends State with TickerProviderSt onRefresh: () { _bloc.inputRefresh(); }, - child: EmptyUtil.isEmpty(_bloc.inputDataVM ) ? EmptyWidget() : _buildBottomItem(item)), + child: EmptyUtil.isEmpty(_bloc.inputDataVM) + ? EmptyWidget() + : _buildBottomItem(item)), ) ], ), @@ -751,7 +916,9 @@ class _WalletBilDetailState extends State with TickerProviderSt onRefresh: () { _bloc.outputRefresh(); }, - child: EmptyUtil.isEmpty(_bloc.outputDataVM) ? EmptyWidget() : _buildBottomItem(item)), + child: EmptyUtil.isEmpty(_bloc.outputDataVM) + ? EmptyWidget() + : _buildBottomItem(item)), ) ], ),