diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index 27b5150d..3cfe6b72 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -524,20 +524,20 @@ class _ShoppingGoodsDetails extends State { ], ), ), - Container( - color: Colors.white, - margin: EdgeInsets.only(bottom: 72.h), - child: Html( - data: miNiDetail?.detail ?? "", - customImageRenders: { - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - return Container(); - }, - ), - }, - ), - ), + // Container( + // color: Colors.white, + // margin: EdgeInsets.only(bottom: 72.h), + // child: Html( + // data: miNiDetail?.detail ?? "", + // customImageRenders: { + // networkSourceMatcher(): networkImageRender( + // loadingWidget: () { + // return Container(); + // }, + // ), + // }, + // ), + // ), ], ), ), diff --git a/lib/store/shopping/shopping_home/bargain_details.dart b/lib/store/shopping/shopping_home/bargain_details.dart index 51a248d7..a06ea448 100644 --- a/lib/store/shopping/shopping_home/bargain_details.dart +++ b/lib/store/shopping/shopping_home/bargain_details.dart @@ -40,6 +40,7 @@ class _BargainDetails extends State { final SwiperController controller = SwiperController(); final RefreshController refreshController = RefreshController(); int limitNumber = 0; + double bargainNum = 0; @override void dispose() { @@ -106,10 +107,15 @@ class _BargainDetails extends State { }); if (baseData != null && baseData.isSuccess) { setState(() { + bargainNum = 0; activityActRecordDetails = baseData.data; + activityActRecordDetails.actRecordJoinList.forEach((element) { + bargainNum += double.tryParse(element.actPrice); + }); }); refreshController.refreshCompleted(); } else { + refreshController.refreshFailed(); refreshController.loadFailed(); } } @@ -152,7 +158,9 @@ class _BargainDetails extends State { header: MyHeader(), physics: BouncingScrollPhysics(), onRefresh: () { - setState(() {}); + setState(() { + queryShowOneAct(actRecordId); + }); }, child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), @@ -304,8 +312,8 @@ class _BargainDetails extends State { borderRadius: BorderRadius.circular(4), color: Color(0xFF9476F7), ), - child: Text( - "砍价成功", + child:Text( + (limitNumber != (activityActRecordDetails?.actRecord?.joinNum ?? 0)) ? "已砍${bargainNum.toStringAsFixed(2)}":"砍价成功", style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.regular, @@ -333,12 +341,13 @@ class _BargainDetails extends State { child: Stack( children: [ Container( - width: double.infinity, + width:double.infinity, height: 8.h, color: Color(0xFFF5F5F5), ), 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, decoration: BoxDecoration( gradient: LinearGradient( @@ -474,6 +483,68 @@ class _BargainDetails extends State { ), ], ), + 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), Text( "剩余时间 ${((tempDay == 0) ? "" : (tempDay.toString() + ":")).toString()} ${tempHour.toString()} : ${tempM.toString()} : ${tempS.toString()}", @@ -483,39 +554,6 @@ class _BargainDetails extends State { 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, - // ), - // ) - // ], - // ) - // ) ], ), );