diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 1e28bf20..58a502c4 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -335,7 +335,7 @@ class _Settlement extends State { baseData?.isSuccess ?? false ? SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center) - : SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + : SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); } } else { ///火锅店下单, 等待结算 diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index bd3f8530..697729aa 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -497,7 +497,10 @@ class _ShoppingGoodsDetails extends State { "actProductId":actProductId, "actProductSkuId":skuId1, }, - ); + ).then((value) { + _onRefresh(); + setState(() {}); + }); } ///去砍价详情页面 @@ -507,7 +510,6 @@ class _ShoppingGoodsDetails extends State { "actRecordId": launchJoinAct.actRecordId, "limitNumber":limitNumber, "storeInfo":storeInfo, - "skuId":skuId1 }); } diff --git a/lib/store/shopping/shopping_home/bargain_details.dart b/lib/store/shopping/shopping_home/bargain_details.dart index 5776a55b..ebb724a7 100644 --- a/lib/store/shopping/shopping_home/bargain_details.dart +++ b/lib/store/shopping/shopping_home/bargain_details.dart @@ -64,7 +64,7 @@ class _BargainDetails extends State { actRecordId = widget.arguments["actRecordId"]; limitNumber = widget.arguments["limitNumber"]; storeInfo = widget.arguments["storeInfo"]; - skuId = widget.arguments["skuId"]; + // skuId = widget.arguments["skuId"]; startCountdownTimer(); SharedPreferences.getInstance().then((value) { String minToken = value.getString("minToken"); @@ -128,47 +128,21 @@ class _BargainDetails extends State { } } - ///发起活动 - queryLaunchAct() async { - BaseData baseData = await minService.launchAct({ - "actProductId": activityActRecordDetails.actRecord.actProductId, - "actRecordId": 0, - "actTemplateId": activityActRecordDetails.actRecord.actTemplateId, - "actTimeId": activityActRecordDetails.actRecord.actTimeId, - "addressId":"", - "isDirectBuy":true, - "getType": 1, - "productId":activityActRecordDetails.actProduct.productId, - "skuId": skuId, - "skuPrice": activityActRecordDetails.actProduct.promotionPrice, - "templateType": 3 - }).catchError((error) { - refreshController.refreshFailed(); - }); - if (baseData != null && baseData.isSuccess) { - setState(() { - launchJoinAct = baseData.data; - toOrder(); - refreshController.refreshCompleted(); - }); - } else { - refreshController.refreshFailed(); - } - } - ///直接购买去下单结算页面 toOrder() async { await Navigator.of(context).pushNamed( '/router/settlement', arguments: { "storeInfo": storeInfo, - "pageType": 3, + "pageType": "3", "isDirectBuy":true, "productId": activityActRecordDetails.actProduct.productId, "skuId":skuId, "buyNum": 1, "skuValue1":activityActRecordDetails.skuName, - "orderId":launchJoinAct.orderId + "orderId":launchJoinAct.orderId, + "actProductId":activityActRecordDetails.actProduct.id, + "actProductSkuId":activityActRecordDetails.actProduct.skuJson, }, ); } @@ -566,7 +540,7 @@ class _BargainDetails extends State { (activityActRecordDetails?.actRecord?.joinNum ?? 0)) GestureDetector( onTap: (){ - queryLaunchAct(); + toOrder(); }, child: Container( alignment: Alignment.center, diff --git a/lib/store/shopping/shopping_home/group_details.dart b/lib/store/shopping/shopping_home/group_details.dart index 8908af96..70528788 100644 --- a/lib/store/shopping/shopping_home/group_details.dart +++ b/lib/store/shopping/shopping_home/group_details.dart @@ -50,7 +50,6 @@ class _GroupDetails extends State { if (_timer != null) { _timer.cancel(); } - } @override @@ -83,7 +82,8 @@ class _GroupDetails extends State { 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 { ///查看某一个发起的拼团、砍价详情 queryShowOneAct(actRecordId) async { - BaseData baseData = await minService - .showOneAct(actRecordId) - .catchError((error) { + BaseData baseData = + await minService.showOneAct(actRecordId).catchError((error) { refreshController.refreshFailed(); }); if (baseData != null && baseData.isSuccess) { @@ -274,42 +273,55 @@ class _GroupDetails extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if(tempDay != 0) - Row( - children: [ - InkWell( - onTap: () {}, - child: Container( - width: 27, - height: 28, - alignment: Alignment.center, - decoration: BoxDecoration( - // color: Color(0xFFD2D2D2), - color: (((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) || tempDay == 0) ? Color(0xFFD2D2D2):Color(0xFFF8961E), - borderRadius: BorderRadius.circular(4)), - child: Text( - tempDay.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, + if (tempDay != 0) + Row( + children: [ + InkWell( + onTap: () {}, + child: Container( + width: 27, + height: 28, + alignment: Alignment.center, + decoration: BoxDecoration( + // color: Color(0xFFD2D2D2), + color: (((activityActRecordDetails + ?.actRecord?.joinNum ?? + 0) == + 0) || + tempDay == 0) + ? Color(0xFFD2D2D2) + : Color(0xFFF8961E), + borderRadius: BorderRadius.circular(4)), + child: Text( + tempDay.toString(), + style: TextStyle( + color: Colors.white, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), ), ), ), - ), - Padding( - padding: EdgeInsets.only(left: 10, right: 10), - child: Text( - ":", - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - // color: Color(0xFFD2D2D2), - color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0 ? Color(0xFFD2D2D2):Color(0xFFF8961E), - ), - )), - ], - ), + Padding( + padding: EdgeInsets.only(left: 10, right: 10), + child: Text( + ":", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + // color: Color(0xFFD2D2D2), + color: + (activityActRecordDetails?.actRecord?.joinNum ?? + 0) == + activityActRecordDetails + ?.successNumber ?? + 0 + ? Color(0xFFD2D2D2) + : Color(0xFFF8961E), + ), + )), + ], + ), InkWell( onTap: () {}, child: Container( @@ -318,11 +330,19 @@ class _GroupDetails extends State { 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(), + tempHour.toString(), style: TextStyle( color: Colors.white, fontSize: 14.sp, @@ -339,7 +359,16 @@ class _GroupDetails extends State { 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 { 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 { 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 { 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,68 +454,82 @@ class _GroupDetails extends State { SizedBox( height: 24, ), - if((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) - Text( - "恭喜您拼团成功", - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.black, + if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) == + activityActRecordDetails?.successNumber ?? + 0) + Text( + "恭喜您拼团成功", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), - ), - if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < (activityActRecordDetails?.successNumber ?? 0) && tempDay != 0 && tempHour!=0 && tempM !=0 && tempS !=0) - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "距离拼团成功还差", - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.black, + if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) < + (activityActRecordDetails?.successNumber ?? 0) && + tempDay != 0 && + tempHour != 0 && + tempM != 0 && + tempS != 0) + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "距离拼团成功还差", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), - ), - TextSpan( - text:((activityActRecordDetails?.successNumber ?? 0) - (activityActRecordDetails?.actRecord?.joinNum ?? 0)).toString(), - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFF8961E), + TextSpan( + text: ((activityActRecordDetails?.successNumber ?? 0) - + (activityActRecordDetails?.actRecord?.joinNum ?? 0)) + .toString(), + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFF8961E), + ), ), - ), - TextSpan( - text: "人", - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.black, + TextSpan( + text: "人", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), - ), - ], + ], + ), ), - ), - if(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0) - Text( - "很遗憾,拼团失败", - style: TextStyle( - fontSize: 18.sp, - fontWeight: MyFontWeight.semi_bold, - color: Colors.black, + if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) != + (activityActRecordDetails?.successNumber ?? 0) && + tempDay == 0 && + tempHour == 0 && + tempM == 0 && + tempS == 0) + Text( + "很遗憾,拼团失败", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), - ), SizedBox( height: 32, ), Container( alignment: Alignment.center, width: double.infinity, - height:80.h, + height: 80.h, child: ListView.builder( shrinkWrap: true, padding: EdgeInsets.zero, scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), - itemCount:(activityActRecordDetails?.successNumber ?? 0), + itemCount: (activityActRecordDetails?.successNumber ?? 0), itemBuilder: (context, position) { return GestureDetector( onTap: () {}, @@ -469,93 +539,97 @@ class _GroupDetails extends State { ), ), SizedBox( - height:54.h, + height: 54.h, ), - if((activityActRecordDetails?.actRecord?.joinNum ?? 0) == 0) - InkWell( - onTap: () { - setState(() { - - }); - }, - child:Container( - width:double.infinity, - height:54.h, - margin: EdgeInsets.only(bottom: 28), - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFF00A359), - borderRadius: BorderRadius.circular(27)), - child: Text( - "查看拼团订单", - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), - )), - ), - if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < (activityActRecordDetails?.successNumber ?? 0) || tempDay != 0 && tempHour!=0 && tempM != 0 && tempS != 0) - InkWell( - onTap: () { - setState(() { - }); - }, - child:Container( - width:double.infinity, - height:54.h, - margin: EdgeInsets.only(bottom: 28), - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFF00A359), - 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, + if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) == + activityActRecordDetails?.successNumber ?? + 0) + InkWell( + onTap: () { + Navigator.of(context) + .pushNamed('/router/order_details', arguments: { + "id": activityActRecordDetails.actRecordJoinList[0].orderId + }); + }, + child: Container( + width: double.infinity, + height: 54.h, + margin: EdgeInsets.only(bottom: 28), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF00A359), + borderRadius: BorderRadius.circular(27)), + child: Text( + "查看拼团订单", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, ), - Text( - "邀请微信好友一起拼团", - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, + )), + ), + if ((activityActRecordDetails?.actRecord?.joinNum ?? 0) < + (activityActRecordDetails?.successNumber ?? 0)) + InkWell( + onTap: () { + setState(() {}); + }, + child: Container( + width: double.infinity, + height: 54.h, + margin: EdgeInsets.only(bottom: 28), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF00A359), + 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, ), - ) - ], - )), - ), - if((tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0) && ((activityActRecordDetails?.actRecord?.joinNum ?? 0) < (activityActRecordDetails?.successNumber ?? 0))) - InkWell( - onTap: () { - setState(() { - }); - }, - child:Container( - width:double.infinity, - height:54.h, - margin: EdgeInsets.only(bottom: 28), - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFF00A359), - borderRadius: BorderRadius.circular(27)), - child: Text( - "联系客服退款", - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), - )), - ), + SizedBox( + width: 8, + ), + Text( + "邀请微信好友一起拼团", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ) + ], + )), + ), + if ((tempDay == 0 && tempHour == 0 && tempM == 0 && tempS == 0) && + ((activityActRecordDetails?.actRecord?.joinNum ?? 0) < + (activityActRecordDetails?.successNumber ?? 0))) + InkWell( + onTap: () { + setState(() {}); + }, + child: Container( + width: double.infinity, + height: 54.h, + margin: EdgeInsets.only(bottom: 28), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF00A359), + borderRadius: BorderRadius.circular(27)), + child: Text( + "联系客服退款", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + )), + ), ], ), ); @@ -563,372 +637,376 @@ class _GroupDetails extends State { Widget groupItem(position) { return Container( - margin: EdgeInsets.only(right:25), - child:Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - if(position < (activityActRecordDetails?.actRecord?.joinNum ?? 0)) - Stack( - children: [ - Container( - width:70, - height:70, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(60), - border: Border.all( - width: 1, - color: Color(0xFFF8961E), - // style: BorderStyle.solid, + margin: EdgeInsets.only(right: 25), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (position < (activityActRecordDetails?.actRecord?.joinNum ?? 0)) + Stack( + children: [ + Container( + width: 70, + height: 70, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(60), + border: Border.all( + width: 1, + color: Color(0xFFF8961E), + // style: BorderStyle.solid, + ), + ), + child: MImage( + activityActRecordDetails + .actRecordJoinList[position]?.memberAvatar ?? + "", + width: 60, + height: 60, + fit: BoxFit.cover, + isCircle: true, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), ), - ), - child:MImage( - activityActRecordDetails.actRecordJoinList[position]?.memberAvatar ?? "", - width:60, - height:60, - fit: BoxFit.cover, - isCircle: true, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), + activityActRecordDetails.actRecordJoinList[position].isLeader + ? Align( + alignment: Alignment.bottomCenter, + child: Container( + width: 60.w, + child: Container( + width: 34.w, + height: 14.h, + alignment: Alignment.center, + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + color: Color(0xFFF8961E), + borderRadius: BorderRadius.circular(7)), + child: Text( + "团长", + style: TextStyle( + fontSize: 8.sp, + fontWeight: MyFontWeight.light, + color: Colors.white, + ), + )), + ), + ) + : Container(), + ], ), - activityActRecordDetails.actRecordJoinList[position].isLeader ? - Align( - alignment: Alignment.bottomCenter, - child:Container( + if (position >= (activityActRecordDetails?.actRecord?.joinNum ?? 0)) + Container( + width: 60, + height: 67, + margin: EdgeInsets.only(left: 20), + child: Image.asset( + "assets/image/pin_t.png", width: 60.w, - child: Container( - width: 34.w, - height:14.h, - alignment: Alignment.center, - margin: EdgeInsets.only(left:10,right:10), - decoration: BoxDecoration( - color: Color(0xFFF8961E), - borderRadius: BorderRadius.circular(7)), - child: Text( - "团长", - style: TextStyle( - fontSize:8.sp, - fontWeight: MyFontWeight.light, - color: Colors.white, - ), - )), + height: 60.h, + fit: BoxFit.cover, ), - - ):Container(), - ], - ), - if(position >= (activityActRecordDetails?.actRecord?.joinNum ?? 0)) - Container( - width: 60, - height: 67, - margin: EdgeInsets.only(left:20), - child:Image.asset( - "assets/image/pin_t.png", - width: 60.w, - height: 60.h, - fit: BoxFit.cover, ), - ), - ], - ) - ); + ], + )); } ///拼团规则 Widget groupRule() { return Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - color: Colors.white), - 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, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "拼团规则", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF353535), + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + color: Colors.white), + 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, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "拼团规则", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), + ), ), - ), - SizedBox(height: 12.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/zu_tuan.png", - width: 42, - height: 42, - fit: BoxFit.cover, - ), - Container( - width:45, - child: Flex( - children: List.generate(8, (_) { - return SizedBox( - width: 3, - height: 1, - child: DecoratedBox( - decoration: - BoxDecoration(color: Color(0xFF32A060)), - ), - ); - }), - mainAxisAlignment: MainAxisAlignment.spaceBetween, - direction: Axis.horizontal, + SizedBox(height: 12.h), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zu_tuan.png", + width: 42, + height: 42, + fit: BoxFit.cover, ), - ), - ], - ), - SizedBox(height: 8.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - children: [ - Text( - "开团/参团", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF181818), - ), + Container( + width: 45, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, ), - Text( - "拼团享低价", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF5F5F5F), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "开团/参团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), ), - ), - ], - ), - Container( - width:35, - child: Flex( - children: List.generate(0, (_) { - return SizedBox( - width: 3, - height: 1, - child: DecoratedBox( - decoration: BoxDecoration(color: Colors.white), + Text( + "拼团享低价", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), ), - ); - }), - mainAxisAlignment: MainAxisAlignment.spaceBetween, - direction: Axis.horizontal, + ), + ], ), - ), - ], - ), - ], - ), - Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/zt_zf.png", - width: 42, - height: 42, - fit: BoxFit.cover, - ), - Container( - width: 45, - child: Flex( - children: List.generate(8, (_) { - return SizedBox( - width: 3, - height: 1, - child: DecoratedBox( - decoration: - BoxDecoration(color: Color(0xFF32A060)), - ), - ); - }), - mainAxisAlignment: MainAxisAlignment.spaceBetween, - direction: Axis.horizontal, + Container( + width: 35, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), ), - ), - ], - ), - SizedBox(height: 8.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - children: [ - Text( - "成功支付", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF181818), - ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/zt_zf.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 45, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, ), - Text( - "下单可开团", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF5F5F5F), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "成功支付", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), ), - ), - ], - ), - Container( - width: 35, - child: Flex( - children: List.generate(0, (_) { - return SizedBox( - width: 3, - height: 1, - child: DecoratedBox( - decoration: BoxDecoration(color: Colors.white), + Text( + "下单可开团", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), ), - ); - }), - mainAxisAlignment: MainAxisAlignment.spaceBetween, - direction: Axis.horizontal, + ), + ], ), - ), - ], - ), - ], - ), - Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/image/yq_zt.png", - width: 42, - height: 42, - fit: BoxFit.cover, - ), - Container( - width: 45, - child: Flex( - children: List.generate(8, (_) { - return SizedBox( - width: 3, - height: 1, - child: DecoratedBox( - decoration: - BoxDecoration(color: Color(0xFF32A060)), - ), - ); - }), - mainAxisAlignment: MainAxisAlignment.spaceBetween, - direction: Axis.horizontal, + Container( + width: 35, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), ), - ), - ], - ), - SizedBox(height: 8.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - children: [ - Text( - "邀请参团", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF181818), - ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/image/yq_zt.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + Container( + width: 45, + child: Flex( + children: List.generate(8, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Color(0xFF32A060)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, ), - Text( - "一起享优惠", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF5F5F5F), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Text( + "邀请参团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), + ), ), - ), - ], - ), - Container( - width: 35, - child: Flex( - children: List.generate(0, (_) { - return SizedBox( - width: 3, - height: 1, - child: DecoratedBox( - decoration: BoxDecoration(color: Colors.white), + Text( + "一起享优惠", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), ), - ); - }), - mainAxisAlignment: MainAxisAlignment.spaceBetween, - direction: Axis.horizontal, + ), + ], + ), + Container( + width: 35, + child: Flex( + children: List.generate(0, (_) { + return SizedBox( + width: 3, + height: 1, + child: DecoratedBox( + decoration: + BoxDecoration(color: Colors.white), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), ), + ], + ) + ], + ), + Column( + children: [ + Image.asset( + "assets/image/zt_m.png", + width: 42, + height: 42, + fit: BoxFit.cover, + ), + SizedBox(height: 8.h), + Text( + "人满成团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF181818), ), - ], - ) - ], - ), - Column( - children: [ - Image.asset( - "assets/image/zt_m.png", - width: 42, - height: 42, - fit: BoxFit.cover, - ), - SizedBox(height: 8.h), - Text( - "人满成团", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF181818), ), - ), - Text( - "人不满退款", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF5F5F5F), + Text( + "人不满退款", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF5F5F5F), + ), ), - ), - ], - ), - ], - ), - ], - ) - ); + ], + ), + ], + ), + ], + )); } } diff --git a/lib/store/shopping/shopping_home/group_page_details.dart b/lib/store/shopping/shopping_home/group_page_details.dart index d4b55bb8..c5c00455 100644 --- a/lib/store/shopping/shopping_home/group_page_details.dart +++ b/lib/store/shopping/shopping_home/group_page_details.dart @@ -8,6 +8,7 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -137,7 +138,14 @@ class _GroupPageDetails extends State { 62.h - MediaQuery.of(context).padding.top, padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - child: ListView.builder( + child: (actRecordAndJoinlDTOList == null || actRecordAndJoinlDTOList?.length == 0) + ? NoDataView( + src:"assets/image/ding_dan.png", + isShowBtn: false, + text:"目前暂无参团列表,可下单发起拼团哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), + ):ListView.builder( padding: EdgeInsets.zero, itemCount: actRecordAndJoinlDTOList?.length ?? 0, scrollDirection: Axis.vertical,