# Conflicts: # lib/base_state.dart # lib/main.dart # lib/main_page.dart # lib/order/order_detail_page.dart # lib/view_widget/classic_header.dart # lib/web/web_view/comment_list.dart # pubspec.yamldart3_last
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 1022 B |
After Width: | Height: | Size: 996 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 834 B |
After Width: | Height: | Size: 894 B |
After Width: | Height: | Size: 696 B |
After Width: | Height: | Size: 1020 B |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 996 B |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 910 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 796 B |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 686 B |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 658 B |
After Width: | Height: | Size: 634 B |
After Width: | Height: | Size: 708 B |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 790 B |
After Width: | Height: | Size: 700 B |
After Width: | Height: | Size: 696 B |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,322 @@
|
||||
import 'dart:convert'; |
||||
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.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 '../retrofit/data/user_info.dart'; |
||||
import '../view_widget/classic_header.dart'; |
||||
import '../view_widget/my_footer.dart'; |
||||
|
||||
class TradingCardPage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _TradingCardPage(); |
||||
} |
||||
} |
||||
|
||||
class _TradingCardPage extends State<TradingCardPage> { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
UserInfo userInfo; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
SharedPreferences.getInstance().then((value) { |
||||
apiService = |
||||
ApiService(Dio(), context: context, token: value.getString("token")); |
||||
queryUserBalance(); |
||||
}); |
||||
} |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
refreshController.dispose(); |
||||
} |
||||
|
||||
///查询会员信息 |
||||
queryUserBalance() async { |
||||
BaseData<UserInfo> baseData = |
||||
await apiService.queryInfo().catchError((onError) { |
||||
refreshController.refreshFailed(); |
||||
refreshController.loadFailed();}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
userInfo = baseData.data; |
||||
if (mounted) setState(() {}); |
||||
refreshController.refreshCompleted(); |
||||
refreshController.loadComplete(); |
||||
}else { |
||||
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
||||
refreshController.refreshFailed(); |
||||
refreshController.loadFailed(); |
||||
} |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
color: Colors.white, |
||||
child: Stack( |
||||
children: [ |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
image: DecorationImage( |
||||
fit: BoxFit.fill, |
||||
image: AssetImage("assets/image/settlement_bg.webp"), |
||||
), |
||||
), |
||||
width: double.infinity, |
||||
height: 306.h, |
||||
), |
||||
Scaffold( |
||||
backgroundColor: Colors.transparent, |
||||
appBar: MyAppBar( |
||||
title: "", |
||||
titleColor: Colors.white, |
||||
background: Colors.transparent, |
||||
leadingColor: Colors.white, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader( |
||||
color: Colors.white, |
||||
), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
queryUserBalance(); |
||||
}, |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: ScrollController(), |
||||
child: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child:Container( |
||||
margin: EdgeInsets.symmetric(horizontal:14.w), |
||||
child:Column( |
||||
children: [ |
||||
Container( |
||||
width: double.infinity, |
||||
padding:EdgeInsets.only(top:24.h,bottom: 27.h) , |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(12), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 4), |
||||
blurRadius: 8, |
||||
spreadRadius: 8, |
||||
) |
||||
], |
||||
), |
||||
child: Column( |
||||
children:[ |
||||
Image.asset( |
||||
"assets/image/my_trading.webp", |
||||
width:200.w, |
||||
fit: BoxFit.fill, |
||||
height:22.h, |
||||
), |
||||
SizedBox(height:28.h), |
||||
Image.asset( |
||||
"assets/image/trading_logo.webp", |
||||
width:196.w, |
||||
fit: BoxFit.fill, |
||||
height:150.h, |
||||
), |
||||
Padding(padding:EdgeInsets.only(top: 21.h,bottom: 17.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
"我已收集", |
||||
style: TextStyle( |
||||
color: Colors.black, |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
SizedBox(width: 12.w,), |
||||
Text( |
||||
(userInfo?.happyBean ?? 0).toString(), |
||||
style: TextStyle( |
||||
color: Color(0xFF32A060), |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
) |
||||
], |
||||
),), |
||||
Padding(padding:EdgeInsets.only(bottom:31.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(right:1.w), |
||||
child: GestureDetector( |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/welfare_exchange'); |
||||
}, |
||||
child: Text( |
||||
"兑换区逛逛", |
||||
style: TextStyle( |
||||
color: Color(0xFF32A060), |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
)), |
||||
Image.asset( |
||||
"assets/image/icon_right_z.webp", |
||||
width:16, |
||||
fit: BoxFit.fill, |
||||
height:16, |
||||
color: Color(0xFF32A060), |
||||
) |
||||
], |
||||
),), |
||||
Image.asset( |
||||
"assets/image/trading_text.webp", |
||||
width:314.w, |
||||
fit: BoxFit.fill, |
||||
height:98.h, |
||||
), |
||||
] |
||||
), |
||||
), |
||||
Container( |
||||
width: double.infinity, |
||||
padding:EdgeInsets.symmetric(vertical: 17.h,horizontal: 32.w) , |
||||
margin: EdgeInsets.only(top:16.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(12), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 4), |
||||
blurRadius: 8, |
||||
spreadRadius: 8, |
||||
) |
||||
], |
||||
), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/trading_history.webp", |
||||
width:16.h, |
||||
fit: BoxFit.fill, |
||||
height:16.h, |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap:(){ |
||||
Navigator.of(context) |
||||
.pushNamed('/router/exchange_history_page'); |
||||
}, |
||||
child: Padding(padding:EdgeInsets.only(left: 4.w), |
||||
child: Text( |
||||
"兑换记录", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
)), |
||||
), |
||||
Spacer(), |
||||
Container( |
||||
width: 1.w, |
||||
height: 35.5.h, |
||||
margin: EdgeInsets.symmetric(), |
||||
color:Color(0xFFD8D8D8)), |
||||
Spacer(), |
||||
Image.asset( |
||||
"assets/image/trading_detail.webp", |
||||
width:16.h, |
||||
fit: BoxFit.fill, |
||||
height:16.h, |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/integral_detailed_page',arguments:{"titleType":1}); |
||||
}, |
||||
child: Padding(padding:EdgeInsets.only(left: 4.w), |
||||
child: Text( |
||||
"印章明细", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
)),) |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
width: double.infinity, |
||||
padding:EdgeInsets.symmetric(vertical:12.h,horizontal: 11.w) , |
||||
margin: EdgeInsets.only(top:16.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(12), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 4), |
||||
blurRadius: 8, |
||||
spreadRadius: 8, |
||||
) |
||||
], |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom:14.h), |
||||
child: Text( |
||||
"规则介绍", |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
),), |
||||
Padding(padding:EdgeInsets.only(bottom:12.h), |
||||
child: Text( |
||||
"(1) 商品中所要求的印章达到方可兑换", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular), |
||||
),), |
||||
Text( |
||||
"(2) 印章卡仅兑换商城指定商品,不能折算现金或兑换其他非指定商品项目", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 12.sp, |
||||
height: 1.5.h, |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,154 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
|
||||
import '../generated/l10n.dart'; |
||||
import '../retrofit/data/channels_list.dart'; |
||||
import '../retrofit/retrofit_api.dart'; |
||||
|
||||
class LoginStoreSelect extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
LoginStoreSelect({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _LoginStoreSelect(); |
||||
} |
||||
} |
||||
|
||||
class _LoginStoreSelect extends State<LoginStoreSelect> { |
||||
ChannelsList channelsList; |
||||
int channelIndex = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
channelsList = widget.arguments["channelsList"]; |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
appBar: MyAppBar( |
||||
title: S.of(context).qudaolaiyuan, |
||||
titleColor: Colors.black, |
||||
titleSize: 18.sp, |
||||
background: Color(0xFFFFFFFF), |
||||
leadingColor: Colors.black, |
||||
), |
||||
body: Container( |
||||
color: Color(0xFFFFFFFF), |
||||
height: double.infinity, |
||||
child: Column( |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(top:18.h,bottom:20.h,left:18.w), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/login_channel.webp", |
||||
fit: BoxFit.fill, |
||||
width:24, |
||||
height:24, |
||||
), |
||||
SizedBox(width:12.w), |
||||
Text( |
||||
"Hi,您是通过什么途径了解到这款APP的?", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.bold, |
||||
fontSize: 15.sp, |
||||
color: Color(0xFF181818), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
Expanded(child: ListView.builder( |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
channelIndex = position; |
||||
}); |
||||
}, |
||||
child: channelItem(position), |
||||
); |
||||
}, |
||||
itemCount:(channelsList != null && (channelsList?.channels?.length ?? 0) > 0) ? channelsList.channels.length : 0, |
||||
)), |
||||
if(channelsList != null && (channelsList.channels.length) > 0) |
||||
GestureDetector( |
||||
onTap: () { |
||||
Navigator.pop(context,channelsList.channels[channelIndex]); |
||||
}, |
||||
child: Container( |
||||
width: double.infinity, |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF32A060), |
||||
borderRadius: BorderRadius.circular(27), |
||||
), |
||||
margin: EdgeInsets.only( |
||||
left: 16, right: 16, bottom: 21), |
||||
padding: EdgeInsets.symmetric(vertical:18.h), |
||||
child: Text( |
||||
S.of(context).queren, |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget channelItem(index){ |
||||
return Container( |
||||
height:52 , |
||||
margin: EdgeInsets.only(bottom: 12,left: 14,right: 14), |
||||
child: Stack( |
||||
alignment: Alignment.bottomRight, |
||||
children: [ |
||||
Container( |
||||
height: 52.h, |
||||
width: double.infinity, |
||||
decoration: BoxDecoration( |
||||
borderRadius: new BorderRadius.circular(6), |
||||
border: Border.all( |
||||
color: channelIndex == index ? Color(0xFF32A060) : Color(0xFFF7F7F7), |
||||
width: channelIndex == index ? 1 : 0, |
||||
), |
||||
color:channelIndex == index ? Color(0xFFF0FAF4) : Color(0xFFF7F7F7), |
||||
), |
||||
alignment: Alignment.centerLeft, |
||||
padding: EdgeInsets.only(left: 12,), |
||||
child: Text( |
||||
channelsList.channels[index], |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.bold, |
||||
fontSize: 14.sp, |
||||
color: channelIndex == index ? Color(0xFF32A060) : Colors.black, |
||||
), |
||||
), |
||||
), |
||||
if (index == channelIndex) |
||||
Image.asset( |
||||
"assets/image/recharge.webp", |
||||
width: 20, |
||||
height: 20, |
||||
fit: BoxFit.fill, |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |