提交 5cdb7467 authored 作者: maodou's avatar maodou

Merge remote-tracking branch 'origin/test' into test

...@@ -72,6 +72,7 @@ class CouponModel { ...@@ -72,6 +72,7 @@ class CouponModel {
CouponModel({ CouponModel({
this.couponRecId, this.couponRecId,
this.endTime, this.endTime,
this.startTime,
this.couponId, this.couponId,
this.useStatus, this.useStatus,
this.couponName, this.couponName,
...@@ -83,6 +84,7 @@ class CouponModel { ...@@ -83,6 +84,7 @@ class CouponModel {
CouponModel.fromJson(dynamic json) { CouponModel.fromJson(dynamic json) {
couponRecId = json['coupon_rec_id']; couponRecId = json['coupon_rec_id'];
endTime = json['end_time']; endTime = json['end_time'];
startTime = json['start_time'];
couponId = json['coupon_id']; couponId = json['coupon_id'];
useStatus = json['use_status']; useStatus = json['use_status'];
couponName = json['coupon_name']; couponName = json['coupon_name'];
...@@ -93,6 +95,7 @@ class CouponModel { ...@@ -93,6 +95,7 @@ class CouponModel {
num? couponRecId; num? couponRecId;
String? endTime; String? endTime;
String? startTime;
num? couponId; num? couponId;
num? useStatus; num? useStatus;
String? couponName; String? couponName;
...@@ -103,6 +106,7 @@ class CouponModel { ...@@ -103,6 +106,7 @@ class CouponModel {
CouponModel copyWith({ CouponModel copyWith({
num? couponRecId, num? couponRecId,
String? endTime, String? endTime,
String? startTime,
num? couponId, num? couponId,
num? useStatus, num? useStatus,
String? couponName, String? couponName,
...@@ -113,6 +117,7 @@ class CouponModel { ...@@ -113,6 +117,7 @@ class CouponModel {
CouponModel( CouponModel(
couponRecId: couponRecId ?? this.couponRecId, couponRecId: couponRecId ?? this.couponRecId,
endTime: endTime ?? this.endTime, endTime: endTime ?? this.endTime,
startTime: startTime ?? this.startTime,
couponId: couponId ?? this.couponId, couponId: couponId ?? this.couponId,
useStatus: useStatus ?? this.useStatus, useStatus: useStatus ?? this.useStatus,
couponName: couponName ?? this.couponName, couponName: couponName ?? this.couponName,
...@@ -124,7 +129,8 @@ class CouponModel { ...@@ -124,7 +129,8 @@ class CouponModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['coupon_rec_id'] = couponRecId; map['coupon_rec_id'] = couponRecId;
// map['end_time'] = endTime; map['end_time'] = endTime;
map['start_time'] = startTime;
map['coupon_id'] = couponId; map['coupon_id'] = couponId;
map['use_status'] = useStatus; map['use_status'] = useStatus;
map['coupon_name'] = couponName; map['coupon_name'] = couponName;
......
...@@ -105,34 +105,37 @@ class CreditPointsPage extends StatelessWidget { ...@@ -105,34 +105,37 @@ class CreditPointsPage extends StatelessWidget {
color: Colours.cE7, color: Colours.cE7,
// color: Colors.red, // color: Colors.red,
), ),
GestureDetector( Visibility(
onTap: (){ visible: controller.creditPointModel.deductibleIntegral ==0?false:true,
controller.setUse(); child: GestureDetector(
if (controller.useCreditPoint) { onTap: (){
context.pop(); controller.setUse();
} if (controller.useCreditPoint) {
}, context.pop();
child: Container( }
color: Colors.white, },
height: 54, child: Container(
child: Row( color: Colors.white,
mainAxisAlignment: MainAxisAlignment.spaceBetween, height: 54,
children: [ child: Row(
RichText(text: TextSpan( mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
TextSpan(text: '抵扣',style: TextStyle(color: Colours.c9,fontSize: 13.w,height: 1.4)), RichText(text: TextSpan(
TextSpan(text: '¥${controller.creditPointModel.deductibleAmount}',style: TextStyle(color: AppTheme.primary,fontSize: 13.w,height: 1.4,fontWeight: Fonts.medium)), children: [
TextSpan(text: '使用${controller.creditPointModel.deductibleIntegral}积分',style: TextStyle(color: Colours.c9,fontSize: 13.w,height: 1.4)), TextSpan(text: '抵扣',style: TextStyle(color: Colours.c9,fontSize: 13.w,height: 1.4)),
] TextSpan(text: '¥${controller.creditPointModel.deductibleAmount}',style: TextStyle(color: AppTheme.primary,fontSize: 13.w,height: 1.4,fontWeight: Fonts.medium)),
)), TextSpan(text: '使用${controller.creditPointModel.deductibleIntegral}积分',style: TextStyle(color: Colours.c9,fontSize: 13.w,height: 1.4)),
SizedBox( ]
width: 15.w, )),
height: 15.w, SizedBox(
child: Image.asset( width: 15.w,
controller.useCreditPoint?'assets/images/check.png':'assets/images/uncheck.png', height: 15.w,
), child: Image.asset(
) controller.useCreditPoint?'assets/images/check.png':'assets/images/uncheck.png',
], ),
)
],
),
), ),
), ),
) )
......
...@@ -132,8 +132,11 @@ class _MinePageState extends State<MinePage> { ...@@ -132,8 +132,11 @@ class _MinePageState extends State<MinePage> {
child: Column( child: Column(
children: [ children: [
GestureDetector( GestureDetector(
onTap:(){ onTap:() async {
context.pushNamed(Routes.security,extra: controller.userInfo); final result = await context.pushNamed(Routes.security,extra: controller.userInfo);
if (result == true){
controller.getInfo();
}
}, child: _buildItem('账户安全') }, child: _buildItem('账户安全')
), ),
Container(color: Colours.cLine,margin: EdgeInsets.symmetric(horizontal: 15.w),height: 1.w,), Container(color: Colours.cLine,margin: EdgeInsets.symmetric(horizontal: 15.w),height: 1.w,),
......
...@@ -74,7 +74,7 @@ class BuildItem extends StatelessWidget { ...@@ -74,7 +74,7 @@ class BuildItem extends StatelessWidget {
Gaps.vGaps5, Gaps.vGaps5,
Text('满${model.normPrice}${model.reducedPrice}元',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c9),), Text('满${model.normPrice}${model.reducedPrice}元',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c9),),
Gaps.vGaps5, Gaps.vGaps5,
Text('有效至:${model.endTime}',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c9),), model.type ==1?Text('有效至:${model.endTime}',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c9),):Text('有效期${model.startTime}${model.endTime}',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c9),),
], ],
), ),
if (model.type == 1) GestureDetector( if (model.type == 1) GestureDetector(
......
...@@ -261,7 +261,10 @@ class _UserInfoPageState extends State<UserInfoPage> { ...@@ -261,7 +261,10 @@ class _UserInfoPageState extends State<UserInfoPage> {
getGender(num? sex) { getGender(num? sex) {
String gender; String gender;
if (sex == 1) { if (sex == 0) {
gender = "";
}
else if (sex == 1) {
gender = "男"; gender = "男";
} else if (sex == 2) { } else if (sex == 2) {
gender = "女"; gender = "女";
......
...@@ -12,169 +12,175 @@ class UserSecurityPage extends StatefulWidget { ...@@ -12,169 +12,175 @@ class UserSecurityPage extends StatefulWidget {
class _UserSecurityPageState extends State<UserSecurityPage> { class _UserSecurityPageState extends State<UserSecurityPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return WillPopScope(
appBar: AppBar( onWillPop: () async {
centerTitle: true, context.pop(true);
title: const Text('账号安全'), return false;
), },
body: Column( child: Scaffold(
children: [ appBar: AppBar(
Container( centerTitle: true,
margin: EdgeInsets.symmetric(vertical: 10.w, horizontal: 10.w), title: const Text('账号安全'),
decoration: BoxDecoration( ),
borderRadius: BorderRadius.circular(8.w), body: Column(
color: Colors.white, children: [
boxShadow: [ Container(
BoxShadow( margin: EdgeInsets.symmetric(vertical: 10.w, horizontal: 10.w),
color: const Color(0xFFC7C7C7).withOpacity(0.5), decoration: BoxDecoration(
offset: Offset(3.w, 0), borderRadius: BorderRadius.circular(8.w),
blurRadius: 10.w, color: Colors.white,
spreadRadius: 0.w, boxShadow: [
), BoxShadow(
], color: const Color(0xFFC7C7C7).withOpacity(0.5),
), offset: Offset(3.w, 0),
child: Column( blurRadius: 10.w,
children: [ spreadRadius: 0.w,
GestureDetector( ),
onTap: () { ],
context.pushNamed(Routes.changePhone); ),
}, child: Column(
child: _buildItem( children: [
title: '修改手机号码', value: widget.model.phone ?? '')), GestureDetector(
Container( onTap: () {
margin: EdgeInsets.symmetric(horizontal: 10.w), context.pushNamed(Routes.changePhone);
height: 0.5.w, },
color: Colours.cF0, child: _buildItem(
), title: '修改手机号码', value: widget.model.phone ?? '')),
GestureDetector( Container(
onTap: () { margin: EdgeInsets.symmetric(horizontal: 10.w),
context.pushNamed(Routes.changePwd, extra: widget.model); height: 0.5.w,
}, color: Colours.cF0,
child: _buildItem( ),
title: '修改密码', GestureDetector(
value: widget.model.password.toString().isEmpty onTap: () {
? '未设置' context.pushNamed(Routes.changePwd, extra: widget.model);
: '')), },
], child: _buildItem(
), title: '修改密码',
), value: widget.model.password.toString().isEmpty
Container( ? '未设置'
margin: EdgeInsets.symmetric(horizontal: 10.w), : '')),
decoration: BoxDecoration( ],
borderRadius: BorderRadius.circular(8.w), ),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color(0xFFC7C7C7).withOpacity(0.5),
offset: Offset(3.w, 0),
blurRadius: 10.w,
spreadRadius: 0.w,
),
],
), ),
child: Column( Container(
children: [ margin: EdgeInsets.symmetric(horizontal: 10.w),
GestureDetector( decoration: BoxDecoration(
child: _buildItem(title: '账号注销', value: ''), borderRadius: BorderRadius.circular(8.w),
onTap: () async { color: Colors.white,
showDialog( boxShadow: [
context: context, BoxShadow(
builder: (BuildContext context) { color: const Color(0xFFC7C7C7).withOpacity(0.5),
return AlertDialog( offset: Offset(3.w, 0),
shape: RoundedRectangleBorder( blurRadius: 10.w,
borderRadius: BorderRadius.circular(8.0.w), spreadRadius: 0.w,
), ),
contentPadding: EdgeInsets.zero, ],
// 移除内容部分的内边距 ),
content: Wrap( child: Column(
children: [ children: [
Container( GestureDetector(
margin: child: _buildItem(title: '账号注销', value: ''),
EdgeInsets.only(top: 44.w, bottom: 29.w), onTap: () async {
// 调整上下间距 showDialog(
child: Center( context: context,
child: Text( builder: (BuildContext context) {
'确定注销账号吗', return AlertDialog(
style: TextStyle( shape: RoundedRectangleBorder(
fontSize: 15.w, borderRadius: BorderRadius.circular(8.0.w),
fontWeight: Fonts.medium, ),
color: Colours.c3, contentPadding: EdgeInsets.zero,
), // 移除内容部分的内边距
), content: Wrap(
),
),
Container(
height: 1.w, // 设置分割线的高度
width: double.infinity, // 设置分割线的宽度
color: Colours.cLine, // 设置分割线的颜色
),
],
),
// 去除操作按钮区域的内边距
actionsPadding: EdgeInsets.zero,
actions: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
GestureDetector( Container(
onTap: () => Navigator.of(context).pop(), margin:
child: Container( EdgeInsets.only(top: 44.w, bottom: 29.w),
width: 105.w, // 调整上下间距
color: Colours.cFF, child: Center(
alignment: Alignment.center, child: Text(
child: const Text( '确定注销账号吗',
'取消',
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 15.w,
fontWeight: Fonts.medium, fontWeight: Fonts.medium,
color: Colours.c6, color: Colours.c3,
), ),
), ),
), ),
), ),
Container( Container(
height: 39.5.w, // 设置分割线的高度 height: 1.w, // 设置分割线的高度
width: 1, // 设置分割线的宽度 width: double.infinity, // 设置分割线的宽度
color: Colours.cLine, // 设置分割线的颜色 color: Colours.cLine, // 设置分割线的颜色
), ),
GestureDetector( ],
onTap: () async { ),
final result = await AccountAPI.delete(); // 去除操作按钮区域的内边距
if (result) { actionsPadding: EdgeInsets.zero,
CustomToast.loading(); actions: <Widget>[
await UserStore.to.logout(); Row(
CustomToast.dismiss(); mainAxisAlignment: MainAxisAlignment.spaceEvenly,
if (context.mounted) { children: [
context.goNamed(Routes.splash); GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text(
'取消',
style: TextStyle(
fontSize: 12,
fontWeight: Fonts.medium,
color: Colours.c6,
),
),
),
),
Container(
height: 39.5.w, // 设置分割线的高度
width: 1, // 设置分割线的宽度
color: Colours.cLine, // 设置分割线的颜色
),
GestureDetector(
onTap: () async {
final result = await AccountAPI.delete();
if (result) {
CustomToast.loading();
await UserStore.to.logout();
CustomToast.dismiss();
if (context.mounted) {
context.goNamed(Routes.splash);
}
} }
} },
}, child: Container(
child: Container( width: 105.w,
width: 105.w, color: Colours.cFF,
color: Colours.cFF, alignment: Alignment.center,
alignment: Alignment.center, child: const Text(
child: const Text( '确定',
'确定', style: TextStyle(
style: TextStyle( fontSize: 12,
fontSize: 12, fontWeight: Fonts.medium,
fontWeight: Fonts.medium, color: Colours.cAB1941,
color: Colours.cAB1941, ),
), ),
), ),
), ),
), ],
], ),
), ],
], );
); },
}, );
); },
}, ),
), ],
], ),
), )
) ],
], ),
), ),
); );
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论