|
|
@ -40,6 +40,7 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
final SwiperController controller = SwiperController(); |
|
|
|
final SwiperController controller = SwiperController(); |
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
int limitNumber = 0; |
|
|
|
int limitNumber = 0; |
|
|
|
|
|
|
|
double bargainNum = 0; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void dispose() { |
|
|
|
void dispose() { |
|
|
@ -106,10 +107,15 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
|
|
|
|
bargainNum = 0; |
|
|
|
activityActRecordDetails = baseData.data; |
|
|
|
activityActRecordDetails = baseData.data; |
|
|
|
|
|
|
|
activityActRecordDetails.actRecordJoinList.forEach((element) { |
|
|
|
|
|
|
|
bargainNum += double.tryParse(element.actPrice); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
refreshController.refreshCompleted(); |
|
|
|
refreshController.refreshCompleted(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
refreshController.loadFailed(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -152,7 +158,9 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
header: MyHeader(), |
|
|
|
header: MyHeader(), |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
onRefresh: () { |
|
|
|
onRefresh: () { |
|
|
|
setState(() {}); |
|
|
|
setState(() { |
|
|
|
|
|
|
|
queryShowOneAct(actRecordId); |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: SingleChildScrollView( |
|
|
|
child: SingleChildScrollView( |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
@ -304,8 +312,8 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
borderRadius: BorderRadius.circular(4), |
|
|
|
borderRadius: BorderRadius.circular(4), |
|
|
|
color: Color(0xFF9476F7), |
|
|
|
color: Color(0xFF9476F7), |
|
|
|
), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
child:Text( |
|
|
|
"砍价成功", |
|
|
|
(limitNumber != (activityActRecordDetails?.actRecord?.joinNum ?? 0)) ? "已砍${bargainNum.toStringAsFixed(2)}":"砍价成功", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
fontSize: 10.sp, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
@ -333,12 +341,13 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
child: Stack( |
|
|
|
child: Stack( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
width:double.infinity, |
|
|
|
height: 8.h, |
|
|
|
height: 8.h, |
|
|
|
color: Color(0xFFF5F5F5), |
|
|
|
color: Color(0xFFF5F5F5), |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
width:double.tryParse(activityActRecordDetails?.actProduct?.productPrice ?? ""), |
|
|
|
width:(bargainNum/(double.tryParse(activityActRecordDetails?.actProduct?.productPrice ?? "0") - |
|
|
|
|
|
|
|
double.tryParse(activityActRecordDetails?.actProduct?.promotionPrice ?? "0")))*MediaQuery.of(context).size.width, |
|
|
|
height: 8.h, |
|
|
|
height: 8.h, |
|
|
|
decoration: BoxDecoration( |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: LinearGradient( |
|
|
|
gradient: LinearGradient( |
|
|
@ -474,24 +483,44 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 11.h), |
|
|
|
if(limitNumber == (activityActRecordDetails?.actRecord?.joinNum ?? 0)) |
|
|
|
Text( |
|
|
|
GestureDetector( |
|
|
|
"剩余时间 ${((tempDay == 0) ? "" : (tempDay.toString() + ":")).toString()} ${tempHour.toString()} : ${tempM.toString()} : ${tempS.toString()}", |
|
|
|
child: Container( |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
|
|
width:double.infinity, |
|
|
|
|
|
|
|
height:54.h, |
|
|
|
|
|
|
|
margin: EdgeInsets.only(left:6.w), |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
color: Color(0xFF9476F7), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(27), |
|
|
|
|
|
|
|
boxShadow: [ |
|
|
|
|
|
|
|
BoxShadow( |
|
|
|
|
|
|
|
color: Colors.black.withAlpha(12), |
|
|
|
|
|
|
|
offset: Offset(0, 3), |
|
|
|
|
|
|
|
blurRadius: 14, |
|
|
|
|
|
|
|
spreadRadius: 0, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"立即购买", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
color: Color(0xFF353535), |
|
|
|
color: Colors.white, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
// Container( |
|
|
|
) |
|
|
|
// alignment: Alignment.center, |
|
|
|
), |
|
|
|
|
|
|
|
// GestureDetector( |
|
|
|
|
|
|
|
// child:Container( |
|
|
|
// width:double.infinity, |
|
|
|
// width:double.infinity, |
|
|
|
// height:54.h, |
|
|
|
// height:54.h, |
|
|
|
// margin: EdgeInsets.only(left:6.w), |
|
|
|
// margin: EdgeInsets.only(bottom: 28), |
|
|
|
|
|
|
|
// alignment: Alignment.center, |
|
|
|
// decoration: BoxDecoration( |
|
|
|
// decoration: BoxDecoration( |
|
|
|
// borderRadius: BorderRadius.circular(27), |
|
|
|
|
|
|
|
// color: Color(0xFF9476F7), |
|
|
|
// color: Color(0xFF9476F7), |
|
|
|
// ), |
|
|
|
// borderRadius: BorderRadius.circular(27)), |
|
|
|
// child: Row( |
|
|
|
// child: Row( |
|
|
|
// mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
// mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center, |
|
|
@ -506,7 +535,7 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
// width:8, |
|
|
|
// width:8, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// Text( |
|
|
|
// Text( |
|
|
|
// "邀请微信好友一起拼团", |
|
|
|
// "邀请微信好友帮忙砍价", |
|
|
|
// style: TextStyle( |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 16.sp, |
|
|
|
// fontSize: 16.sp, |
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
|
// fontWeight: MyFontWeight.medium, |
|
|
@ -514,8 +543,17 @@ class _BargainDetails extends State<BargainDetails> { |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// ) |
|
|
|
// ) |
|
|
|
// ], |
|
|
|
// ], |
|
|
|
// ) |
|
|
|
// )) |
|
|
|
// ) |
|
|
|
// ), |
|
|
|
|
|
|
|
SizedBox(height: 11.h), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"剩余时间 ${((tempDay == 0) ? "" : (tempDay.toString() + ":")).toString()} ${tempHour.toString()} : ${tempM.toString()} : ${tempS.toString()}", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|