wurong
2 years ago
6 changed files with 459 additions and 153 deletions
@ -0,0 +1,178 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/store.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/store/scan.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/border_text.dart'; |
||||
import 'package:huixiang/view_widget/custom_image.dart'; |
||||
import 'package:huixiang/view_widget/round_button.dart'; |
||||
|
||||
class HomeSideslipDialog extends StatefulWidget { |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _HomeSideslipDialog(); |
||||
} |
||||
} |
||||
|
||||
class _HomeSideslipDialog extends State<HomeSideslipDialog> with SingleTickerProviderStateMixin{ |
||||
AnimationController _animationController; |
||||
Animation<Offset> _animation; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
_animationController = AnimationController( |
||||
duration: Duration(milliseconds: 500), |
||||
vsync: this, |
||||
); |
||||
_animation = Tween<Offset>( |
||||
begin: Offset(1.0, 0.0), |
||||
end: Offset.zero, |
||||
).animate(CurvedAnimation( |
||||
parent: _animationController, |
||||
curve: Curves.easeInOut, |
||||
)); |
||||
_animationController.forward(); |
||||
} |
||||
|
||||
@override |
||||
void dispose() { |
||||
_animationController.dispose(); |
||||
super.dispose(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return SlideTransition(position: _animation, |
||||
child: WillPopScope( |
||||
///点击背景不收起弹窗; |
||||
// onWillPop: () async => false, |
||||
child: Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(right:61.w), |
||||
height: double.infinity, |
||||
padding: EdgeInsets.only(top: 55.h), |
||||
decoration: new BoxDecoration( |
||||
color: Colors.white, |
||||
), |
||||
child:Container( |
||||
child: |
||||
Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
padding:EdgeInsets.only(left:14.w,bottom: 33.h), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/default_user.webp", |
||||
width:57, |
||||
height:57, |
||||
), |
||||
SizedBox(width: 10.w,), |
||||
Expanded(child: |
||||
Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children:[ |
||||
Text("前进麦味烘焙*海峡姐妹茶", |
||||
maxLines: 1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF1A1A1A) |
||||
),), |
||||
SizedBox(height: 5.h,), |
||||
Text("123****1234", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF4D4D4D) |
||||
),), |
||||
], |
||||
)) |
||||
], |
||||
), |
||||
), |
||||
Padding(padding: EdgeInsets.only(left: 16.w,bottom: 22.h), |
||||
child: |
||||
Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_switch_shop.webp", |
||||
width:24, |
||||
height:24, |
||||
), |
||||
SizedBox(width: 4.w,), |
||||
Text("门店切换", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF1A1A1A) |
||||
),), |
||||
], |
||||
),), |
||||
Expanded(child:ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: shopItem(), |
||||
); |
||||
}, |
||||
)), |
||||
Container( |
||||
alignment: Alignment.center, |
||||
width: double.infinity, |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
margin: EdgeInsets.only(left:16.w,right: 16.w,bottom: 103.h,top: 20.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(4.w), |
||||
), |
||||
child:Text("退出登录", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white |
||||
),),), |
||||
], |
||||
), |
||||
), |
||||
),),); |
||||
} |
||||
|
||||
///门店选择 |
||||
Widget shopItem(){ |
||||
return Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF8F9FA), |
||||
borderRadius: BorderRadius.circular(4.w), |
||||
), |
||||
margin:EdgeInsets.only(bottom: 11.h), |
||||
padding: EdgeInsets.only(top: 5.h,bottom: 8.h,left: 16.w,right: 17.w), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child:Text("前进麦味烘焙*海峡姐妹茶(哈乐城店)", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B) |
||||
),)), |
||||
Icon( |
||||
Icons.check, |
||||
size: 20, |
||||
color: Color(0xFF4D4D4D),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,79 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/business_system/home/trade_summary.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../generated/l10n.dart'; |
||||
import '../../mine/coupons_page.dart'; |
||||
import '../../mine/vip_card_page.dart'; |
||||
import '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
import '../../view_widget/my_tab.dart'; |
||||
|
||||
class TradeOverviewPage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _TradeOverviewPage(); |
||||
} |
||||
} |
||||
|
||||
class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProviderStateMixin{ |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
var isShowMore = false; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return DefaultTabController( |
||||
length: 3, |
||||
child: Scaffold( |
||||
appBar: MyAppBar( |
||||
title:"", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top, |
||||
bottom: TabBar( |
||||
// isScrollable: true, //可滚动 |
||||
indicatorColor: Color(0xFF30415B), |
||||
labelColor: Colors.black, |
||||
labelStyle: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
unselectedLabelStyle: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: FontWeight.normal, |
||||
color: Color(0xFF666666) |
||||
), |
||||
// controller: tabController, |
||||
//未选中文字颜色 |
||||
unselectedLabelColor: Color(0xffA29E9E), |
||||
indicatorSize: TabBarIndicatorSize.label, |
||||
//指示器与文字等宽 |
||||
tabs: <Widget>[ |
||||
MyTab(text:"总览"), |
||||
MyTab(text: "订单"), |
||||
MyTab(text: "商品"), |
||||
], |
||||
), |
||||
), |
||||
body: TabBarView( |
||||
children: [ |
||||
TradeSummary(), |
||||
CouponsPage(), |
||||
VipCardPage(),], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,162 @@
|
||||
import 'dart:convert'; |
||||
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/coupon.dart'; |
||||
import 'package:huixiang/retrofit/data/page.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/coupon_details_dialog.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:huixiang/view_widget/new_coupon_widget.dart'; |
||||
import 'package:huixiang/view_widget/no_data_view.dart'; |
||||
import 'package:huixiang/view_widget/receive_success.dart'; |
||||
import 'package:huixiang/view_widget/selector_store_dialog.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../utils/font_weight.dart'; |
||||
|
||||
class TradeSummary extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _TradeSummary(); |
||||
} |
||||
} |
||||
|
||||
class _TradeSummary extends State<TradeSummary> { |
||||
ApiService apiService; |
||||
final RefreshController _refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async { |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
body: Column( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFD8D8D8), |
||||
width:double.infinity, |
||||
height: 1.h, |
||||
), |
||||
Expanded(child: SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: scrollController, |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() {}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
border: Border.all(color: Color(0xFFCFD0D1), width: 1.w), |
||||
), |
||||
margin: EdgeInsets.only(top: 16.h,right: 20.w,left: 20.w,bottom:12.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"日报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"周报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"月报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"自定义", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
Loading…
Reference in new issue