From b546496fb0d51a3d197581696101727e93a1af16 Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Tue, 13 Oct 2020 14:13:52 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=88=91=E7=9A=84=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=E5=B0=8F=E5=B9=85=E5=BA=A6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team_details_page/team_details_page.dart | 41 +++- lib/pages/team_page/team_page.dart | 7 +- .../home_slide_banner/home_slide_banner.dart | 7 + .../search_input/search_result_input.dart | 14 +- .../sort/search_result_sort_widget.dart | 1 + lib/widgets/team/fans/team_fans_item.dart | 175 ++++++++++-------- .../team/fans/team_fans_number_item.dart | 21 +++ 7 files changed, 179 insertions(+), 87 deletions(-) create mode 100644 lib/widgets/team/fans/team_fans_number_item.dart diff --git a/lib/pages/team_details_page/team_details_page.dart b/lib/pages/team_details_page/team_details_page.dart index a8c51b1..44c3750 100644 --- a/lib/pages/team_details_page/team_details_page.dart +++ b/lib/pages/team_details_page/team_details_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:zhiying_comm/zhiying_comm.dart' - ''; +import 'package:zhiying_comm/zhiying_comm.dart'; +import 'package:zhiying_base_widget/widgets/team/fans/team_fans_item.dart'; /// /// 我的团队 - 用户详情 @@ -22,7 +22,41 @@ class _TeamDetailsPageState extends State { Widget _getMainWidget(){ return Scaffold( backgroundColor: HexColor.fromHex('#F9F9F9'), - body: Container(), + body: CustomScrollView( + slivers: [ + + + /// 头部Bar + SliverAppBar( + // expandedHeight: 200.0, + leading: IconButton( + icon: Icon( + Icons.arrow_back_ios, + size: 22, + color: HexColor.fromHex('#333333'), + ), + onPressed: () => Navigator.maybePop(context), + ), + backgroundColor: Colors.white, + floating: true, + pinned: true, + title: Text( + '用户详情', + style: TextStyle(color: HexColor.fromHex('#333333'), fontWeight: FontWeight.bold, fontSize: 18), + ), + centerTitle: true, + elevation: 0, + ), + + /// TA的推荐人 + + /// 推荐人的信息 + SliverToBoxAdapter( + child: TeamFansItem(), + ), + + ], + ), ); } @@ -31,6 +65,7 @@ class _TeamDetailsPageState extends State { /// 推荐人的信息 + /// 本月数据 & 上个月数据 } diff --git a/lib/pages/team_page/team_page.dart b/lib/pages/team_page/team_page.dart index 8643c9f..3f1008c 100644 --- a/lib/pages/team_page/team_page.dart +++ b/lib/pages/team_page/team_page.dart @@ -2,6 +2,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:tab_indicator_styler/tab_indicator_styler.dart'; import 'package:zhiying_base_widget/widgets/team/data/team_data_widet.dart'; +import 'package:zhiying_base_widget/widgets/team/fans/team_fans_item.dart'; +import 'package:zhiying_base_widget/widgets/team/fans/team_fans_number_item.dart'; import 'package:zhiying_base_widget/widgets/team/recommend/team_recommend_widget.dart'; import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; @@ -204,8 +206,9 @@ class _TeamPageState extends State { controller: _controller, children: tabTitle .map((s) => ListView.builder( - itemBuilder: (context, int) => Text("123"), - itemCount: 100, + + itemBuilder: (context, int) => int == 0 ? TeamFansNumberItemWidget() : TeamFansItem(), + itemCount: 10, )) .toList(), ), diff --git a/lib/widgets/home/home_slide_banner/home_slide_banner.dart b/lib/widgets/home/home_slide_banner/home_slide_banner.dart index 6965548..7129a8f 100644 --- a/lib/widgets/home/home_slide_banner/home_slide_banner.dart +++ b/lib/widgets/home/home_slide_banner/home_slide_banner.dart @@ -1,9 +1,12 @@ import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:provider/provider.dart'; import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifier.dart'; +import 'package:zhiying_base_widget/pages/team_details_page/team_details_page.dart'; +import 'package:zhiying_base_widget/pages/team_page/team_page.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; import 'bloc/bloc.dart'; @@ -49,6 +52,10 @@ class _HomeSlideBannerContainerState extends State { // Navigator.push(context, MaterialPageRoute( // builder: (_) => PageFactory.create('goods_details', null) // )); + // Navigator.push(context, CupertinoPageRoute(builder: (_)=> TeamPage())); + Navigator.push(context, MaterialPageRoute( + builder: (_)=> TeamDetailsPage() + )); } @override diff --git a/lib/widgets/search_result/search_input/search_result_input.dart b/lib/widgets/search_result/search_input/search_result_input.dart index d3932b9..465111d 100644 --- a/lib/widgets/search_result/search_input/search_result_input.dart +++ b/lib/widgets/search_result/search_input/search_result_input.dart @@ -136,13 +136,13 @@ class _SearchResultInputWidgetState extends State { width: double.infinity, child: Container( height: 32, + alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30), color: HexColor.fromHex('#F9F9F9'), ), padding: const EdgeInsets.only(left: 12.5, right: 12.5), child: TextField( - onTap: ()=> Navigator.maybePop(context), // onChanged: (str) => _onChanged(str), showCursor: true, @@ -150,12 +150,14 @@ class _SearchResultInputWidgetState extends State { onSubmitted: (text) => _onSearchButtomClick(), controller: _textEditingController, focusNode: _focusNode, - style: TextStyle(fontSize: 14, color: HexColor.fromHex('#333333')), + style: TextStyle(fontSize: 14, color: HexColor.fromHex('#333333'), textBaseline: TextBaseline.alphabetic), decoration: InputDecoration( - // filled: true, - contentPadding: const EdgeInsets.only(left: 0, right: 0,top: 0 ,bottom: 12), + filled: true, + isDense: true, + contentPadding: EdgeInsets.zero, + // contentPadding: const EdgeInsets.only(left: 0, right: 0,top: 0 ,bottom: 12), // focusColor: Colors.transparent, - // fillColor: Colors.transparent, + fillColor: Colors.transparent, border: InputBorder.none, focusedBorder: InputBorder.none, focusedErrorBorder: InputBorder.none, @@ -163,7 +165,7 @@ class _SearchResultInputWidgetState extends State { disabledBorder: InputBorder.none, enabledBorder: InputBorder.none, hintText: model?.search_inpu_hint_text ?? '搜索更多优惠商品', - hintStyle: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 14), + hintStyle: TextStyle(color: HexColor.fromHex('#999999'), fontSize: 14, textBaseline: TextBaseline.alphabetic), ), ), ), diff --git a/lib/widgets/search_result/sort/search_result_sort_widget.dart b/lib/widgets/search_result/sort/search_result_sort_widget.dart index 055861a..1b6d41a 100644 --- a/lib/widgets/search_result/sort/search_result_sort_widget.dart +++ b/lib/widgets/search_result/sort/search_result_sort_widget.dart @@ -317,6 +317,7 @@ class _SearchResultSortWidgetState extends State { var padding = EdgeInsets.only(left: 12.5, right: 12.5, top: 10, bottom: (i == model.length - 1) ? 15 : 0); lists.add(GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () => _onClickZhSort(model, item, parentData), child: Container( padding: padding, diff --git a/lib/widgets/team/fans/team_fans_item.dart b/lib/widgets/team/fans/team_fans_item.dart index d893184..f3fdbfe 100644 --- a/lib/widgets/team/fans/team_fans_item.dart +++ b/lib/widgets/team/fans/team_fans_item.dart @@ -19,14 +19,16 @@ class _TeamFansItemState extends State { Widget _getMainWidget() { return Container( decoration: BoxDecoration(color: HexColor.fromHex('#FFFFFF'), borderRadius: BorderRadius.circular(10)), - margin: const EdgeInsets.only(left: 12.5, right: 12.5), + margin: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8), padding: const EdgeInsets.only(left: 20, right: 20, top: 17.5, bottom: 15), child: Column( children: [ // 粉丝头像信息等 _getFansInfoWidget(), + const SizedBox(height: 10), // 微信号码 _getWXNumberInfoWidget(), + const SizedBox(height: 10), // 数据信息 _getDataWidget(), ], @@ -44,6 +46,8 @@ class _TeamFansItemState extends State { /// 信息 Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ /// 会员等级 关系 昵称 RichText( @@ -107,88 +111,103 @@ class _TeamFansItemState extends State { /// 数据信息 Widget _getDataWidget() { return Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ /// 左边数据 - Column( - children: [ - /// 邀请人数(人) - _getCustomWidget( - text: '邀请人数(人)', - textColor: '#333333', - textSize: 10, - number: '1578', - numberColor: '#FF4242', - numberSize: 20, - ), - - /// 今日邀请 & 本月邀请 - Row( - children: [ - /// 今日邀请 - _getCustomWidget( - text: '今日邀请', - textColor: '#909090', - textSize: 10, - number: '3258', - numberColor: '#333333', - numberSize: 15, - ), - - /// 本月邀请 - _getCustomWidget( - text: '本月邀请', - textColor: '#909090', - textSize: 10, - number: '3258', - numberColor: '#333333', - numberSize: 15, - ), - ], - ) - ], + Flexible( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + /// 邀请人数(人) + _getCustomWidget( + text: '邀请人数(人)', + textColor: '#333333', + textSize: 10, + number: '1578', + numberColor: '#FF4242', + numberSize: 20, + ), + const SizedBox(height: 15), + /// 今日邀请 & 本月邀请 + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + /// 今日邀请 + _getCustomWidget( + text: '今日邀请', + textColor: '#909090', + textSize: 10, + number: '3258', + numberColor: '#333333', + numberSize: 15, + ), + + /// 本月邀请 + _getCustomWidget( + text: '本月邀请', + textColor: '#909090', + textSize: 10, + number: '3258', + numberColor: '#333333', + numberSize: 15, + ), + ], + ) + ], + ), ), /// 分割线 - VerticalDivider(width: 65.5, thickness: 0.5), + SizedBox( height:65.5, width: 0.5,child: VerticalDivider(width: 0.5, thickness: 0.5, color: HexColor.fromHex('#F7F7F7'))), /// 右边数据 - Column( - children: [ - /// 累计收益(¥) - _getCustomWidget( - text: '累计收益(¥)', - textColor: '#333333', - textSize: 10, - number: '157.54', - numberColor: '#FF4242', - numberSize: 20, - ), - - /// 近7天收益 & 本月收益 - Row( - children: [ - /// 今日邀请 - _getCustomWidget( - text: '近7天收益', - textColor: '#909090', - textSize: 10, - number: '4.12', - numberColor: '#333333', - numberSize: 15, - ), - - /// 本月邀请 - _getCustomWidget( - text: '本月收益', - textColor: '#909090', - textSize: 10, - number: '528.14', - numberColor: '#333333', - numberSize: 15, - ), - ], - ) - ], + Flexible( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + /// 累计收益(¥) + _getCustomWidget( + text: '累计收益(¥)', + textColor: '#333333', + textSize: 10, + number: '157.54', + numberColor: '#FF4242', + numberSize: 20, + ), + + const SizedBox(height: 15), + + /// 近7天收益 & 本月收益 + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + /// 今日邀请 + _getCustomWidget( + text: '近7天收益', + textColor: '#909090', + textSize: 10, + number: '4.12', + numberColor: '#333333', + numberSize: 15, + ), + + /// 本月邀请 + _getCustomWidget( + text: '本月收益', + textColor: '#909090', + textSize: 10, + number: '528.14', + numberColor: '#333333', + numberSize: 15, + ), + ], + ) + ], + ), ) ], ); @@ -197,9 +216,13 @@ class _TeamFansItemState extends State { /// 自定义Widget(数字加粗) Widget _getCustomWidget({String text, String textColor, double textSize, String number, String numberColor, double numberSize, String icon}) { return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ /// Number Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ /// nummber\ Text(number, diff --git a/lib/widgets/team/fans/team_fans_number_item.dart b/lib/widgets/team/fans/team_fans_number_item.dart new file mode 100644 index 0000000..c9ab43a --- /dev/null +++ b/lib/widgets/team/fans/team_fans_number_item.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; +import 'package:zhiying_comm/zhiying_comm.dart'; + +class TeamFansNumberItemWidget extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + alignment: Alignment.center, + margin: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8), + child: RichText( + text: TextSpan(text: '', children: [ + TextSpan(text: '粉丝总人数', style: TextStyle(fontSize: 12, color: HexColor.fromHex('#333333'), fontWeight: FontWeight.bold)), + TextSpan(text: '79', style: TextStyle(fontSize: 18, color: HexColor.fromHex('#FF4242'), fontFamily: 'Din', package: 'zhiying_base_widget', fontWeight: FontWeight.bold)), + TextSpan(text: '人 当前分类人数', style: TextStyle(fontSize: 12, color: HexColor.fromHex('#333333'), fontWeight: FontWeight.bold)), + TextSpan(text: '15', style: TextStyle(fontSize: 18, color: HexColor.fromHex('#FF4242'), fontFamily: 'Din', package: 'zhiying_base_widget', fontWeight: FontWeight.bold)), + TextSpan(text: '人', style: TextStyle(fontSize: 12, color: HexColor.fromHex('#333333'), fontWeight: FontWeight.bold)), + ]), + ), + ); + } +}