2.新增加集换卡详情页面; 3.语言-增加部分文本语言并更改; 4.回乡VIP板块更改;原本的VIP卡逻辑暂时不用,换成用户充值200即成为会员,该页面ui调整;(原来逻辑未删减,暂保留不使用) 5.16进制渐变色值的方法,改变亮度暂定统一为95; 6.首页ui调整;邀请好友图片处,原单一图片现更改为轮播效果,新增集换卡引导也放在此处; 7.积分明细页面更改;共用一个页面根据积分跟集换卡的入口,传对应的值,查看对应的数据; 8.积分明细跳转路径更改,新增一个类型带入路径中跳转传入; 9.更改测试版本服务地址; 10.我的页面跟首页更改一致,单一图片改轮播效果; 11.会员中心,会员卡部分更改;将原有写法去掉,重写了会员卡的使用显示,并优化了该页面数据的显示; 12.我的页面,vip等级显示更改; 13.会员卡列表等级接口,实体类新增部分字段;(原定位分数已不用,更改为originScore,后期若用的原字段,需要修改) 14.订单结算页,支付类型更换时queryOrderInfo()接口中。优惠类型做了调整更改;(改修改需要多测试下,尝试多种情况看下,是否有问题;有可能部分情况没有预判到) 15.点单页结算跳转,vipLevelName,vipLevelName字段做了非空判断; 16.UserInfo实体类新增isVip字段;(主要用于查看用户数据是查询该用户是否已是vip卡状态) 17.福利兑换中心页面,我的信息部分ui做调整,新增集换卡数量的显示;new_revision_app
After Width: | Height: | Size: 4.6 KiB |
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: 32 KiB |
After Width: | Height: | Size: 9.0 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: 59 KiB |
After Width: | Height: | Size: 1.7 KiB |
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: 13 KiB |
@ -0,0 +1,316 @@ |
|||||||
|
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(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
///查询会员信息 |
||||||
|
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.cover, |
||||||
|
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), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
) |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
) |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
} |