@@ -0,0 +1,54 @@ | |||||
import 'package:flutter/material.dart'; | |||||
class WalletDetailListPage extends StatefulWidget { | |||||
@override | |||||
_WalletDetailListPageState createState() => _WalletDetailListPageState(); | |||||
} | |||||
class _WalletDetailListPageState extends State<WalletDetailListPage> { | |||||
@override | |||||
Widget build(BuildContext context) { | |||||
return Container( | |||||
margin: EdgeInsets.only(left: 12.5, right: 12.5), | |||||
child: Column( | |||||
children: <Widget>[ | |||||
_createHeader(), | |||||
_createContent(), | |||||
], | |||||
), | |||||
); | |||||
} | |||||
Widget _createHeader() { | |||||
return Container( | |||||
height: 50, | |||||
child: Row( | |||||
children: <Widget>[ | |||||
Container( | |||||
width: 80, | |||||
child: Row( | |||||
children: <Widget>[ | |||||
Text( | |||||
'2020-10', | |||||
style: TextStyle( | |||||
fontSize: 14, | |||||
color: Color(0xff333333), | |||||
fontWeight: FontWeight.bold, | |||||
), | |||||
), | |||||
], | |||||
), | |||||
), | |||||
Expanded( | |||||
child: SingleChildScrollView( | |||||
child: Row(), | |||||
)) | |||||
], | |||||
), | |||||
); | |||||
} | |||||
Widget _createContent() { | |||||
return Container(); | |||||
} | |||||
} |
@@ -0,0 +1,106 @@ | |||||
import 'package:flutter/cupertino.dart'; | |||||
import 'package:flutter/material.dart'; | |||||
import 'package:tab_indicator_styler/tab_indicator_styler.dart'; | |||||
import 'package:zhiying_base_widget/pages/wallet_page/wallet_detail_list_page.dart'; | |||||
import 'package:zhiying_comm/util/extension/color.dart'; | |||||
class WalletDetailPage extends StatefulWidget { | |||||
@override | |||||
_WalletDetailPageState createState() => _WalletDetailPageState(); | |||||
} | |||||
class _WalletDetailPageState extends State<WalletDetailPage> | |||||
with TickerProviderStateMixin { | |||||
TabController _controller; | |||||
@override | |||||
void initState() { | |||||
_controller = TabController(vsync: this, length: 2); | |||||
super.initState(); | |||||
} | |||||
@override | |||||
Widget build(BuildContext context) { | |||||
return Scaffold( | |||||
appBar: _createNav(), | |||||
body: SafeArea( | |||||
child: Column( | |||||
children: <Widget>[ | |||||
_createTab(), | |||||
Expanded( | |||||
child: _createContent(), | |||||
), | |||||
], | |||||
), | |||||
), | |||||
); | |||||
} | |||||
// 导航栏 | |||||
Widget _createNav() { | |||||
return CupertinoNavigationBar( | |||||
border: Border( | |||||
bottom: BorderSide( | |||||
width: 0.0, // One physical pixel. | |||||
style: BorderStyle.none, | |||||
), | |||||
), | |||||
backgroundColor: Colors.white, | |||||
leading: Navigator.canPop(context) | |||||
? GestureDetector( | |||||
child: Container( | |||||
padding: EdgeInsets.zero, | |||||
child: Icon( | |||||
Icons.arrow_back_ios, | |||||
size: 20, | |||||
), | |||||
), | |||||
onTap: () { | |||||
if (Navigator.canPop(context)) { | |||||
Navigator.pop(context); | |||||
} | |||||
}, | |||||
) | |||||
: Container(), | |||||
middle: Text( | |||||
'明细', | |||||
style: TextStyle( | |||||
fontSize: 15, | |||||
color: Color(0xff333333), | |||||
), | |||||
), | |||||
); | |||||
} | |||||
Widget _createTab() { | |||||
return Container( | |||||
color: Colors.white, | |||||
child: TabBar( | |||||
isScrollable: false, | |||||
labelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 13), | |||||
unselectedLabelStyle: TextStyle(fontSize: 13), | |||||
indicator: MaterialIndicator( | |||||
height: 2, | |||||
topLeftRadius: 8, | |||||
topRightRadius: 8, | |||||
bottomLeftRadius: 8, | |||||
bottomRightRadius: 8, | |||||
color: HexColor.fromHex('#F94B47'), | |||||
horizontalPadding: 30, | |||||
), | |||||
controller: _controller, | |||||
tabs: List.generate(2, (index) => Tab(text: '收入明细')), | |||||
indicatorColor: Colors.red, | |||||
unselectedLabelColor: HexColor.fromHex('#999999'), | |||||
labelColor: HexColor.fromHex('#000000'), | |||||
), | |||||
); | |||||
} | |||||
Widget _createContent() { | |||||
return TabBarView( | |||||
controller: _controller, | |||||
children: <Widget>[WalletDetailListPage(), Container()], | |||||
); | |||||
} | |||||
} |
@@ -5,15 +5,13 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; | |||||
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifier.dart'; | import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifier.dart'; | ||||
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; | import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; | ||||
import 'package:zhiying_base_widget/utils/contants.dart'; | import 'package:zhiying_base_widget/utils/contants.dart'; | ||||
import 'package:zhiying_base_widget/widgets/others/mine_header_bg_widget.dart'; | |||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_appbar/wallet_appbar_sk.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_appbar/wallet_appbar_sk.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data_sk.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data_sk.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail_sk.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail_sk.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_income/wallet_income_sk.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_income/wallet_income_sk.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; | |||||
import 'wallet_page_bloc.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
import 'wallet_page_bloc.dart'; | import 'wallet_page_bloc.dart'; | ||||
///钱包页面 | ///钱包页面 | ||||
@@ -82,7 +80,7 @@ class _WalletPageContainerState extends State<_WalletPageContainer> { | |||||
return SmartRefresher( | return SmartRefresher( | ||||
controller: _refreshController, | controller: _refreshController, | ||||
enablePullDown: true, | enablePullDown: true, | ||||
enablePullUp:true, | |||||
enablePullUp: true, | |||||
header: WaterDropHeader(), | header: WaterDropHeader(), | ||||
onLoading: _onLoading, | onLoading: _onLoading, | ||||
child: Container( | child: Container( | ||||
@@ -131,17 +129,6 @@ class _WalletPageContainerState extends State<_WalletPageContainer> { | |||||
for (var item in model) { | for (var item in model) { | ||||
WidgetModel widgetModel = | WidgetModel widgetModel = | ||||
WidgetModel.fromJson(Map<String, dynamic>.from(item)); | WidgetModel.fromJson(Map<String, dynamic>.from(item)); | ||||
if (item.containsKey("mod_name") && | |||||
item['mod_name'] == "my_wallet_appbar") { | |||||
list.add(SliverPersistentHeader( | |||||
delegate: _SilverAppBarDelegate( | |||||
context, | |||||
WidgetFactory.create(widgetModel.modName, | |||||
isSliver: false, model: item)[0]), | |||||
pinned: true, | |||||
)); | |||||
continue; | |||||
} | |||||
list.addAll(WidgetFactory.create(widgetModel.modName, | list.addAll(WidgetFactory.create(widgetModel.modName, | ||||
isSliver: true, model: item)); | isSliver: true, model: item)); | ||||
} | } | ||||
@@ -0,0 +1,8 @@ | |||||
import 'package:flutter/material.dart'; | |||||
class WalletTabWidget extends StatelessWidget { | |||||
@override | |||||
Widget build(BuildContext context) { | |||||
return Container(); | |||||
} | |||||
} |
@@ -44,7 +44,6 @@ import 'package:zhiying_base_widget/widgets/others/normal_nav/normal_nav_creater | |||||
import 'package:zhiying_base_widget/widgets/search/tabbar/search_tab_creater.dart'; | import 'package:zhiying_base_widget/widgets/search/tabbar/search_tab_creater.dart'; | ||||
import 'package:zhiying_base_widget/widgets/search_result/sort/search_result_sort_widget.dart'; | import 'package:zhiying_base_widget/widgets/search_result/sort/search_result_sort_widget.dart'; | ||||
import 'package:zhiying_base_widget/widgets/search_result/tarbar/search_result_tab_creater.dart'; | import 'package:zhiying_base_widget/widgets/search_result/tarbar/search_result_tab_creater.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_appbar/wallet_appbar.dart'; | |||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_bil/wallet_bil.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_bil/wallet_bil.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail.dart'; | ||||
@@ -290,11 +289,13 @@ class BaseWidgetRegister { | |||||
// WidgetFactory.regist('profile_carousel', HomeBannerCreater()); | // WidgetFactory.regist('profile_carousel', HomeBannerCreater()); | ||||
// ==================== 钱包 | // ==================== 钱包 | ||||
WidgetFactory.regist( | |||||
'my_wallet_appbar', | |||||
DefaultWidgetCreater((model) => WalletAppbar( | |||||
data: model, | |||||
))); | |||||
// WidgetFactory.regist( | |||||
// 'my_wallet_appbar', | |||||
// DefaultWidgetCreater((model) => WalletAppbar( | |||||
// data: model, | |||||
// ))); | |||||
WidgetFactory.regist('my_wallet_appbar', NormalNavCreater()); | |||||
WidgetFactory.regist( | WidgetFactory.regist( | ||||
'my_wallet_header', DefaultWidgetCreater((model) => WalletData(model))); | 'my_wallet_header', DefaultWidgetCreater((model) => WalletData(model))); | ||||
WidgetFactory.regist( | WidgetFactory.regist( | ||||
@@ -1,14 +1,33 @@ | |||||
import 'dart:convert' as convert; | |||||
import 'dart:ui'; | import 'dart:ui'; | ||||
import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:zhiying_base_widget/pages/mine_page/mine_page.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
class NormalNavDelegate extends SliverPersistentHeaderDelegate { | class NormalNavDelegate extends SliverPersistentHeaderDelegate { | ||||
final Map<String, dynamic> data; | |||||
double _height; | double _height; | ||||
Color _bgColor; | |||||
String _title; | |||||
Color _titleColor; | |||||
NormalNavDelegate() : super() { | |||||
NormalNavDelegate(this.data) : super() { | |||||
_height = MediaQueryData.fromWindow(window).padding.top + 44; | _height = MediaQueryData.fromWindow(window).padding.top + 44; | ||||
String d = data['data']; | |||||
Map<String, dynamic> json = | |||||
Map<String, dynamic>.from(convert.jsonDecode(d)); | |||||
if (json.containsKey('app_bar_bg_color')) { | |||||
_bgColor = HexColor.fromHex(json['app_bar_bg_color'] ?? ''); | |||||
} | |||||
if (json.containsKey('app_bar_name')) { | |||||
_title = json['app_bar_name'] ?? ''; | |||||
} | |||||
if (json.containsKey('app_bar_name')) { | |||||
_titleColor = HexColor.fromHex(json['app_bar_name_color']); | |||||
} | |||||
} | } | ||||
@override | @override | ||||
@@ -17,7 +36,8 @@ class NormalNavDelegate extends SliverPersistentHeaderDelegate { | |||||
print('${shrinkOffset.toString()}'); | print('${shrinkOffset.toString()}'); | ||||
double percent = shrinkOffset / _height; | double percent = shrinkOffset / _height; | ||||
print('${percent.toString()}'); | print('${percent.toString()}'); | ||||
return NormalNav(Colors.red.withOpacity(percent)); | |||||
return NormalNav(_title, _titleColor, | |||||
_bgColor?.withOpacity(percent) ?? Colors.transparent); | |||||
} | } | ||||
@override | @override | ||||
@@ -32,9 +52,11 @@ class NormalNavDelegate extends SliverPersistentHeaderDelegate { | |||||
} | } | ||||
class NormalNav extends StatelessWidget { | class NormalNav extends StatelessWidget { | ||||
final String title; | |||||
final Color titleColor; | |||||
final Color color; | final Color color; | ||||
NormalNav(this.color); | |||||
NormalNav(this.title, this.titleColor, this.color); | |||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
@@ -73,8 +95,9 @@ class NormalNav extends StatelessWidget { | |||||
child: Container( | child: Container( | ||||
child: Center( | child: Center( | ||||
child: Text( | child: Text( | ||||
'我的钱包', | |||||
style: TextStyle(fontSize: 18, color: Colors.white), | |||||
title ?? '', | |||||
style: TextStyle( | |||||
fontSize: 18, color: titleColor ?? Colors.white), | |||||
), | ), | ||||
), | ), | ||||
), | ), | ||||
@@ -83,16 +106,16 @@ class NormalNav extends StatelessWidget { | |||||
child: Container( | child: Container( | ||||
width: 44, | width: 44, | ||||
height: 44, | height: 44, | ||||
child: Icon( | |||||
Icons.settings, | |||||
color: Colors.white, | |||||
), | |||||
// child: Icon( | |||||
// Icons.settings, | |||||
// color: Colors.white, | |||||
// ), | |||||
), | ), | ||||
onTap: () { | onTap: () { | ||||
Navigator.push(context, | |||||
CupertinoPageRoute(builder: (context) { | |||||
return MinePage(); | |||||
})); | |||||
// Navigator.push(context, | |||||
// CupertinoPageRoute(builder: (context) { | |||||
// return MinePage(); | |||||
// })); | |||||
}, | }, | ||||
), | ), | ||||
], | ], | ||||
@@ -9,7 +9,7 @@ class NormalNavCreater extends WidgetCreater { | |||||
SliverPersistentHeader( | SliverPersistentHeader( | ||||
pinned: true, | pinned: true, | ||||
floating: true, | floating: true, | ||||
delegate: NormalNavDelegate(), | |||||
delegate: NormalNavDelegate(model), | |||||
), | ), | ||||
]; | ]; | ||||
} | } | ||||
@@ -1,14 +1,13 @@ | |||||
import 'dart:convert'; | import 'dart:convert'; | ||||
import 'package:flutter/material.dart'; | |||||
import 'package:cached_network_image/cached_network_image.dart'; | import 'package:cached_network_image/cached_network_image.dart'; | ||||
import 'package:flutter/cupertino.dart'; | |||||
import 'package:flutter/material.dart'; | |||||
import 'package:zhiying_base_widget/pages/wallet_page/wallet_detail_page.dart'; | |||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_bil/model/wallet_bli_model.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_bil/model/wallet_bli_model.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_income/wallet_income_sk.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_income/wallet_income_sk.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | |||||
///查看明细部件 | ///查看明细部件 | ||||
class WalletBil extends StatelessWidget { | class WalletBil extends StatelessWidget { | ||||
Map<String, dynamic> data; | Map<String, dynamic> data; | ||||
@@ -23,29 +22,44 @@ class WalletBil extends StatelessWidget { | |||||
} | } | ||||
return data == null | return data == null | ||||
? WalletIncomeSkeleton() | ? WalletIncomeSkeleton() | ||||
: Container( | |||||
decoration: BoxDecoration( | |||||
color: Colors.white, borderRadius: BorderRadius.circular(8)), | |||||
margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 10), | |||||
child: ListTile( | |||||
title: Row( | |||||
mainAxisSize: MainAxisSize.min, | |||||
children: <Widget>[ | |||||
CachedNetworkImage( | |||||
imageUrl: model.bilIcon, | |||||
width: 36.w, | |||||
height: 36.w, | |||||
fit: BoxFit.fill, | |||||
), | |||||
SizedBox(width: 15.w,), | |||||
Text(model.bilText, style: TextStyle(fontSize: 24.sp),), | |||||
], | |||||
), | |||||
trailing: InkWell( | |||||
child: Text(model.skipText, style: TextStyle(color: Colors.grey),), | |||||
: GestureDetector( | |||||
onTap: () { | onTap: () { | ||||
///跳转??? | |||||
},), | |||||
)); | |||||
Navigator.push( | |||||
context, | |||||
CupertinoPageRoute( | |||||
builder: (context) => WalletDetailPage(), | |||||
), | |||||
); | |||||
}, | |||||
child: Container( | |||||
decoration: BoxDecoration( | |||||
color: Colors.white, | |||||
borderRadius: BorderRadius.circular(8)), | |||||
margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 10), | |||||
child: ListTile( | |||||
title: Row( | |||||
mainAxisSize: MainAxisSize.min, | |||||
children: <Widget>[ | |||||
CachedNetworkImage( | |||||
imageUrl: model.bilIcon, | |||||
width: 36.w, | |||||
height: 36.w, | |||||
fit: BoxFit.fill, | |||||
), | |||||
SizedBox( | |||||
width: 15.w, | |||||
), | |||||
Text( | |||||
model.bilText, | |||||
style: TextStyle(fontSize: 24.sp), | |||||
), | |||||
], | |||||
), | |||||
trailing: Text( | |||||
model.skipText, | |||||
style: TextStyle(color: Colors.grey), | |||||
), | |||||
)), | |||||
); | |||||
} | } | ||||
} | } |
@@ -1,10 +1,11 @@ | |||||
import 'dart:convert'; | import 'dart:convert'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | |||||
import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_data/model/wallet_header_model.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_data/model/wallet_header_model.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data_bloc.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data_bloc.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data_sk.dart'; | import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data_sk.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
class WalletData extends StatefulWidget { | class WalletData extends StatefulWidget { | ||||
@@ -92,9 +93,12 @@ class _WalletDataState extends State<WalletData> { | |||||
? dataModel[model.headerCashOutKey] | ? dataModel[model.headerCashOutKey] | ||||
: "", | : "", | ||||
style: TextStyle( | style: TextStyle( | ||||
fontSize: 40.sp, | |||||
color: HexColor.fromHex( | |||||
model.headerCashOutTextColor)), | |||||
fontSize: 40.sp, | |||||
color: HexColor.fromHex( | |||||
model.headerCashOutTextColor), | |||||
fontFamily: 'Din-Bold', | |||||
package: 'zhiying_base_widget', | |||||
), | |||||
), | ), | ||||
], | ], | ||||
), | ), | ||||
@@ -102,6 +106,15 @@ class _WalletDataState extends State<WalletData> { | |||||
], | ], | ||||
), | ), | ||||
GestureDetector( | GestureDetector( | ||||
onTap: () { | |||||
SkipModel skipModel = SkipModel( | |||||
skipIdentifier: 'pub.flutter.cash_out', | |||||
requiredLogin: '1', | |||||
requiredTaobaoAuth: '0', | |||||
); | |||||
RouterUtil.route( | |||||
skipModel, skipModel.toJson(), context); | |||||
}, | |||||
child: Container( | child: Container( | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
color: Colors.red, | color: Colors.red, | ||||
@@ -149,7 +162,10 @@ class _WalletDataState extends State<WalletData> { | |||||
? dataModel[item.valueKey] | ? dataModel[item.valueKey] | ||||
: "", | : "", | ||||
style: TextStyle( | style: TextStyle( | ||||
color: HexColor.fromHex(item.valueColor), fontSize: 30.sp), | |||||
color: HexColor.fromHex(item.valueColor), | |||||
fontSize: 30.sp, | |||||
fontFamily: 'Din-Bold', | |||||
package: 'zhiying_base_widget'), | |||||
), | ), | ||||
Text( | Text( | ||||
item.text, | item.text, | ||||