Browse Source

进度条更改

zyh
w-R 3 years ago
parent
commit
8f2458a54d
  1. 28
      lib/store/shopping/shopping_goods_details.dart
  2. 114
      lib/store/shopping/shopping_home/bargain_details.dart

28
lib/store/shopping/shopping_goods_details.dart

@ -524,20 +524,20 @@ class _ShoppingGoodsDetails extends State<ShoppingGoodsDetails> {
], ],
), ),
), ),
Container( // Container(
color: Colors.white, // color: Colors.white,
margin: EdgeInsets.only(bottom: 72.h), // margin: EdgeInsets.only(bottom: 72.h),
child: Html( // child: Html(
data: miNiDetail?.detail ?? "", // data: miNiDetail?.detail ?? "",
customImageRenders: { // customImageRenders: {
networkSourceMatcher(): networkImageRender( // networkSourceMatcher(): networkImageRender(
loadingWidget: () { // loadingWidget: () {
return Container(); // return Container();
}, // },
), // ),
}, // },
), // ),
), // ),
], ],
), ),
), ),

114
lib/store/shopping/shopping_home/bargain_details.dart

@ -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,6 +483,68 @@ class _BargainDetails extends State<BargainDetails> {
), ),
], ],
), ),
if(limitNumber == (activityActRecordDetails?.actRecord?.joinNum ?? 0))
GestureDetector(
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(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
)
),
// GestureDetector(
// child:Container(
// width:double.infinity,
// height:54.h,
// margin: EdgeInsets.only(bottom: 28),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: Color(0xFF9476F7),
// borderRadius: BorderRadius.circular(27)),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// "assets/image/wx.png",
// width:24,
// height:24,
// fit: BoxFit.cover,
// ),
// SizedBox(
// width:8,
// ),
// Text(
// "邀请微信好友帮忙砍价",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// )
// ],
// ))
// ),
SizedBox(height: 11.h), SizedBox(height: 11.h),
Text( Text(
"剩余时间 ${((tempDay == 0) ? "" : (tempDay.toString() + ":")).toString()} ${tempHour.toString()} : ${tempM.toString()} : ${tempS.toString()}", "剩余时间 ${((tempDay == 0) ? "" : (tempDay.toString() + ":")).toString()} ${tempHour.toString()} : ${tempM.toString()} : ${tempS.toString()}",
@ -483,39 +554,6 @@ class _BargainDetails extends State<BargainDetails> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
// Container(
// alignment: Alignment.center,
// width:double.infinity,
// height:54.h,
// margin: EdgeInsets.only(left:6.w),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(27),
// color: Color(0xFF9476F7),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Image.asset(
// "assets/image/wx.png",
// width:24,
// height:24,
// fit: BoxFit.cover,
// ),
// SizedBox(
// width:8,
// ),
// Text(
// "邀请微信好友一起拼团",
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight: MyFontWeight.medium,
// color: Colors.white,
// ),
// )
// ],
// )
// )
], ],
), ),
); );

Loading…
Cancel
Save