|
|
|
@ -50,7 +50,6 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
if (_timer != null) { |
|
|
|
|
_timer.cancel(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -83,7 +82,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
if (isDispose) return; |
|
|
|
|
setState(() { |
|
|
|
|
var tempDateTime = |
|
|
|
|
DateTime.parse(activityActRecordDetails?.actRecord?.endTime).difference(DateTime.now()); |
|
|
|
|
DateTime.parse(activityActRecordDetails?.actRecord?.endTime) |
|
|
|
|
.difference(DateTime.now()); |
|
|
|
|
if (tempDateTime.inSeconds < 0) { |
|
|
|
|
tempDay = 0; |
|
|
|
|
tempHour = 0; |
|
|
|
@ -102,9 +102,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
|
|
|
|
|
///查看某一个发起的拼团、砍价详情 |
|
|
|
|
queryShowOneAct(actRecordId) async { |
|
|
|
|
BaseData<ActivityActRecordDetails> baseData = await minService |
|
|
|
|
.showOneAct(actRecordId) |
|
|
|
|
.catchError((error) { |
|
|
|
|
BaseData<ActivityActRecordDetails> baseData = |
|
|
|
|
await minService.showOneAct(actRecordId).catchError((error) { |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
@ -285,7 +284,13 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
// color: Color(0xFFD2D2D2), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) || tempDay == 0) ? Color(0xFFD2D2D2):Color(0xFFF8961E), |
|
|
|
|
color: (((activityActRecordDetails |
|
|
|
|
?.actRecord?.joinNum ?? |
|
|
|
|
0) == |
|
|
|
|
0) || |
|
|
|
|
tempDay == 0) |
|
|
|
|
? Color(0xFFD2D2D2) |
|
|
|
|
: Color(0xFFF8961E), |
|
|
|
|
borderRadius: BorderRadius.circular(4)), |
|
|
|
|
child: Text( |
|
|
|
|
tempDay.toString(), |
|
|
|
@ -305,7 +310,14 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
// color: Color(0xFFD2D2D2), |
|
|
|
|
color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0 ? Color(0xFFD2D2D2):Color(0xFFF8961E), |
|
|
|
|
color: |
|
|
|
|
(activityActRecordDetails?.actRecord?.joinNum ?? |
|
|
|
|
0) == |
|
|
|
|
activityActRecordDetails |
|
|
|
|
?.successNumber ?? |
|
|
|
|
0 |
|
|
|
|
? Color(0xFFD2D2D2) |
|
|
|
|
: Color(0xFFF8961E), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
], |
|
|
|
@ -318,8 +330,16 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
// color: Color(0xFFD2D2D2), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) |
|
|
|
|
? Color(0xFFD2D2D2):Color(0xFFF8961E), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? |
|
|
|
|
0) == |
|
|
|
|
activityActRecordDetails?.successNumber ?? |
|
|
|
|
0) || |
|
|
|
|
(tempDay == 0 && |
|
|
|
|
tempHour == 0 && |
|
|
|
|
tempM == 0 && |
|
|
|
|
tempS == 0)) |
|
|
|
|
? Color(0xFFD2D2D2) |
|
|
|
|
: Color(0xFFF8961E), |
|
|
|
|
borderRadius: BorderRadius.circular(4)), |
|
|
|
|
child: Text( |
|
|
|
|
tempHour.toString(), |
|
|
|
@ -339,7 +359,16 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
// color: Color(0xFFD2D2D2), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? |
|
|
|
|
0) == |
|
|
|
|
activityActRecordDetails?.successNumber ?? |
|
|
|
|
0) || |
|
|
|
|
(tempDay == 0 && |
|
|
|
|
tempHour == 0 && |
|
|
|
|
tempM == 0 && |
|
|
|
|
tempS == 0)) |
|
|
|
|
? Color(0xFFD2D2D2) |
|
|
|
|
: Color(0xFFF8961E), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
InkWell( |
|
|
|
@ -350,7 +379,16 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
// color: Color(0xFFD2D2D2), |
|
|
|
|
color:(((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? |
|
|
|
|
0) == |
|
|
|
|
activityActRecordDetails?.successNumber ?? |
|
|
|
|
0) || |
|
|
|
|
(tempDay == 0 && |
|
|
|
|
tempHour == 0 && |
|
|
|
|
tempM == 0 && |
|
|
|
|
tempS == 0)) |
|
|
|
|
? Color(0xFFD2D2D2) |
|
|
|
|
: Color(0xFFF8961E), |
|
|
|
|
borderRadius: BorderRadius.circular(4)), |
|
|
|
|
child: Text( |
|
|
|
|
tempM.toString(), |
|
|
|
@ -370,7 +408,16 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
// color: Color(0xFFD2D2D2), |
|
|
|
|
color:(((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? |
|
|
|
|
0) == |
|
|
|
|
activityActRecordDetails?.successNumber ?? |
|
|
|
|
0) || |
|
|
|
|
(tempDay == 0 && |
|
|
|
|
tempHour == 0 && |
|
|
|
|
tempM == 0 && |
|
|
|
|
tempS == 0)) |
|
|
|
|
? Color(0xFFD2D2D2) |
|
|
|
|
: Color(0xFFF8961E), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
InkWell( |
|
|
|
@ -381,7 +428,16 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
// color: Color(0xFFD2D2D2), |
|
|
|
|
color:(((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), |
|
|
|
|
color: (((activityActRecordDetails?.actRecord?.joinNum ?? |
|
|
|
|
0) == |
|
|
|
|
activityActRecordDetails?.successNumber ?? |
|
|
|
|
0) || |
|
|
|
|
(tempDay == 0 && |
|
|
|
|
tempHour == 0 && |
|
|
|
|
tempM == 0 && |
|
|
|
|
tempS == 0)) |
|
|
|
|
? Color(0xFFD2D2D2) |
|
|
|
|
: Color(0xFFF8961E), |
|
|
|
|
borderRadius: BorderRadius.circular(4)), |
|
|
|
|
child: Text( |
|
|
|
|
tempS.toString(), |
|
|
|
@ -398,7 +454,9 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
SizedBox( |
|
|
|
|
height: 24, |
|
|
|
|
), |
|
|
|
|
if((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) |
|
|
|
|
if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) == |
|
|
|
|
activityActRecordDetails?.successNumber ?? |
|
|
|
|
0) |
|
|
|
|
Text( |
|
|
|
|
"恭喜您拼团成功", |
|
|
|
|
style: TextStyle( |
|
|
|
@ -407,7 +465,12 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < (activityActRecordDetails?.successNumber ?? 0) && tempDay != 0 && tempHour!=0 && tempM !=0 && tempS !=0) |
|
|
|
|
if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) < |
|
|
|
|
(activityActRecordDetails?.successNumber ?? 0) && |
|
|
|
|
tempDay != 0 && |
|
|
|
|
tempHour != 0 && |
|
|
|
|
tempM != 0 && |
|
|
|
|
tempS != 0) |
|
|
|
|
Text.rich( |
|
|
|
|
TextSpan( |
|
|
|
|
children: [ |
|
|
|
@ -420,7 +483,9 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text:((activityActRecordDetails?.successNumber ?? 0) - (activityActRecordDetails?.actRecord?.joinNum ?? 0)).toString(), |
|
|
|
|
text: ((activityActRecordDetails?.successNumber ?? 0) - |
|
|
|
|
(activityActRecordDetails?.actRecord?.joinNum ?? 0)) |
|
|
|
|
.toString(), |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
@ -438,7 +503,12 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0) |
|
|
|
|
if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) != |
|
|
|
|
(activityActRecordDetails?.successNumber ?? 0) && |
|
|
|
|
tempDay == 0 && |
|
|
|
|
tempHour == 0 && |
|
|
|
|
tempM == 0 && |
|
|
|
|
tempS == 0) |
|
|
|
|
Text( |
|
|
|
|
"很遗憾,拼团失败", |
|
|
|
|
style: TextStyle( |
|
|
|
@ -471,11 +541,14 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
SizedBox( |
|
|
|
|
height: 54.h, |
|
|
|
|
), |
|
|
|
|
if((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) |
|
|
|
|
if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) == |
|
|
|
|
activityActRecordDetails?.successNumber ?? |
|
|
|
|
0) |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/order_details', arguments: { |
|
|
|
|
"id": activityActRecordDetails.actRecordJoinList[0].orderId |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
@ -495,11 +568,11 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
), |
|
|
|
|
if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < (activityActRecordDetails?.successNumber ?? 0) || tempDay != 0 && tempHour!=0 && tempM != 0 && tempS != 0) |
|
|
|
|
if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) < |
|
|
|
|
(activityActRecordDetails?.successNumber ?? 0)) |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
}); |
|
|
|
|
setState(() {}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
@ -533,11 +606,12 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
), |
|
|
|
|
if((tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0) && ((activityActRecordDetails?.actRecord?.joinNum ?? 0) < (activityActRecordDetails?.successNumber ?? 0))) |
|
|
|
|
if ((tempDay == 0 && tempHour == 0 && tempM == 0 && tempS == 0) && |
|
|
|
|
((activityActRecordDetails?.actRecord?.joinNum ?? 0) < |
|
|
|
|
(activityActRecordDetails?.successNumber ?? 0))) |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
}); |
|
|
|
|
setState(() {}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
@ -584,7 +658,9 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: MImage( |
|
|
|
|
activityActRecordDetails.actRecordJoinList[position]?.memberAvatar ?? "", |
|
|
|
|
activityActRecordDetails |
|
|
|
|
.actRecordJoinList[position]?.memberAvatar ?? |
|
|
|
|
"", |
|
|
|
|
width: 60, |
|
|
|
|
height: 60, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
@ -593,8 +669,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
activityActRecordDetails.actRecordJoinList[position].isLeader ? |
|
|
|
|
Align( |
|
|
|
|
activityActRecordDetails.actRecordJoinList[position].isLeader |
|
|
|
|
? Align( |
|
|
|
|
alignment: Alignment.bottomCenter, |
|
|
|
|
child: Container( |
|
|
|
|
width: 60.w, |
|
|
|
@ -615,8 +691,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
):Container(), |
|
|
|
|
) |
|
|
|
|
: Container(), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
if (position >= (activityActRecordDetails?.actRecord?.joinNum ?? 0)) |
|
|
|
@ -632,8 +708,7 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///拼团规则 |
|
|
|
@ -651,7 +726,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
color: Colors.white), |
|
|
|
|
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h,bottom:40.h), |
|
|
|
|
margin: |
|
|
|
|
EdgeInsets.only(left: 16.w, right: 16.w, top: 24.h, bottom: 40.h), |
|
|
|
|
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
@ -734,7 +810,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
width: 3, |
|
|
|
|
height: 1, |
|
|
|
|
child: DecoratedBox( |
|
|
|
|
decoration: BoxDecoration(color: Colors.white), |
|
|
|
|
decoration: |
|
|
|
|
BoxDecoration(color: Colors.white), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}), |
|
|
|
@ -810,7 +887,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
width: 3, |
|
|
|
|
height: 1, |
|
|
|
|
child: DecoratedBox( |
|
|
|
|
decoration: BoxDecoration(color: Colors.white), |
|
|
|
|
decoration: |
|
|
|
|
BoxDecoration(color: Colors.white), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}), |
|
|
|
@ -886,7 +964,8 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
width: 3, |
|
|
|
|
height: 1, |
|
|
|
|
child: DecoratedBox( |
|
|
|
|
decoration: BoxDecoration(color: Colors.white), |
|
|
|
|
decoration: |
|
|
|
|
BoxDecoration(color: Colors.white), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}), |
|
|
|
@ -928,7 +1007,6 @@ class _GroupDetails extends State<GroupDetails> {
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|