From 74d7a8c75399409405d391122f00e2596e68150e Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 10 Feb 2022 16:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=9B=A2,=E7=9B=B4=E6=8E=A5=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E6=B5=81=E7=A8=8B,=E7=AD=89=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=9B=B4=E6=94=B9,=E6=8B=BC=E5=9B=A2=E9=A1=B5=E9=9D=A2=5F?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E7=9B=B4=E6=8E=A5=E9=80=89=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E7=BB=93=E7=AE=97,=E7=A0=8D=E4=BB=B7=E9=80=89=E4=BA=86?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=E8=B7=B3=E8=BD=AC=E7=A0=8D=E4=BB=B7=E8=AF=A6?= =?UTF-8?q?=E6=83=85,=E6=88=91=E7=9A=84=E6=8B=BC=E5=9B=A2/=E7=A0=8D?= =?UTF-8?q?=E4=BB=B7=E8=B7=B3=E8=BD=AC=E5=8F=82=E4=B8=8E=E8=AF=A6=E6=83=85?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/order/bargain_group_order.dart | 10 +- lib/order/order_history_page.dart | 2 +- lib/retrofit/data/activity_order_list.dart | 6 + lib/retrofit/data/launch_join_act.dart | 148 ++++++++++++++ lib/retrofit/min_api.dart | 5 +- lib/retrofit/min_api.g.dart | 12 +- .../shopping/shopping_goods_details.dart | 101 +++++---- .../shopping/shopping_home/group_details.dart | 192 +++++------------- 8 files changed, 280 insertions(+), 196 deletions(-) create mode 100644 lib/retrofit/data/launch_join_act.dart diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart index 3beedebd..ff1ffbbb 100644 --- a/lib/order/bargain_group_order.dart +++ b/lib/order/bargain_group_order.dart @@ -45,9 +45,6 @@ class _BargainGroupOrder extends State type = widget.arguments["type"]; } - ///查看我的拼团、砍价、列表 - - @override void didChangeDependencies() { super.didChangeDependencies(); @@ -153,6 +150,7 @@ class _ExchangeHistoryList extends State { }); } + ///查看我的拼团、砍价、列表 queryShowMyActList() async { BaseData> baseData = await minService.showMyActList({ @@ -193,6 +191,7 @@ class _ExchangeHistoryList extends State { ), controller: _refreshController, physics: BouncingScrollPhysics(), + onLoading: _refresh, onRefresh: _refresh, child: (activityOrderList != null && activityOrderList.length > 0) ? @@ -302,7 +301,6 @@ class _ExchangeHistoryList extends State { // orderInfo.sendStatus, // orderInfo.isTakeOut) // : "", - // "还差¥{activityOrderList?.howManyMoney ?? ""}砍价成功", "还差${activityOrderList?.howManyMore ?? 0}人拼团成功", style: TextStyle( fontSize: 14.sp, @@ -444,10 +442,10 @@ class _ExchangeHistoryList extends State { GestureDetector( onTap: () { Navigator.of(context) - .popAndPushNamed('/router/group_details', arguments: { + .pushNamed('/router/group_details', arguments: { "actRecordId": activityOrderList.actRecordId, "actProduct":activityOrderList, - "limitNumber":activityOrderList.howManyMore, + "limitNumber":activityOrderList.successNumber, }); }, child: RoundButton( diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 56318001..112f098b 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -142,7 +142,7 @@ class _OrderHistoryList extends State }, ), onRefresh: _onRefresh, - onLoading: queryOrder, + // onLoading: queryOrder, child: (orderInfos != null && orderInfos.length > 0) ? ListView.builder( itemCount: orderInfos != null ? orderInfos.length : 0, diff --git a/lib/retrofit/data/activity_order_list.dart b/lib/retrofit/data/activity_order_list.dart index c709420c..f629ed4b 100644 --- a/lib/retrofit/data/activity_order_list.dart +++ b/lib/retrofit/data/activity_order_list.dart @@ -22,6 +22,7 @@ class ActivityOrderList { int actRecordState, bool actRecordJoinState, int howManyMore, + int successNumber, dynamic orderSum, dynamic bargainMoney, dynamic howManyMoney,}){ @@ -34,6 +35,7 @@ class ActivityOrderList { _actRecordState = actRecordState; _actRecordJoinState = actRecordJoinState; _howManyMore = howManyMore; + _successNumber = successNumber; _orderSum = orderSum; _bargainMoney = bargainMoney; _howManyMoney = howManyMoney; @@ -49,6 +51,7 @@ class ActivityOrderList { _actRecordState = json['actRecordState']; _actRecordJoinState = json['actRecordJoinState']; _howManyMore = json['howManyMore']; + _successNumber = json['successNumber']; _orderSum = json['orderSum']; _bargainMoney = json['bargainMoney']; _howManyMoney = json['howManyMoney']; @@ -62,6 +65,7 @@ class ActivityOrderList { int _actRecordState; bool _actRecordJoinState; int _howManyMore; + int _successNumber; dynamic _orderSum; dynamic _bargainMoney; dynamic _howManyMoney; @@ -75,6 +79,7 @@ class ActivityOrderList { int get actRecordState => _actRecordState; bool get actRecordJoinState => _actRecordJoinState; int get howManyMore => _howManyMore; + int get successNumber => _successNumber; dynamic get orderSum => _orderSum; dynamic get bargainMoney => _bargainMoney; dynamic get howManyMoney => _howManyMoney; @@ -90,6 +95,7 @@ class ActivityOrderList { map['actRecordState'] = _actRecordState; map['actRecordJoinState'] = _actRecordJoinState; map['howManyMore'] = _howManyMore; + map ['successNumber'] = _successNumber; map['orderSum'] = _orderSum; map['bargainMoney'] = _bargainMoney; map['howManyMoney'] = _howManyMoney; diff --git a/lib/retrofit/data/launch_join_act.dart b/lib/retrofit/data/launch_join_act.dart new file mode 100644 index 00000000..1c980954 --- /dev/null +++ b/lib/retrofit/data/launch_join_act.dart @@ -0,0 +1,148 @@ +/// id : "1491606527402835968" +/// createTime : "2022-02-10 10:54:43" +/// createUser : "1478548720785031168" +/// updateTime : "2022-02-10 10:54:43" +/// updateUser : "1478548720785031168" +/// storeId : "1460885296764682240" +/// type : 1 +/// actTemplateId : "1490571620652154880" +/// actTimeId : "1490571620887035904" +/// actRecordId : "1491606526735941632" +/// mid : "1478548720785031168" +/// orderId : "1491606528052953088" +/// isLeader : true +/// memberAvatar : "" +/// memberNickname : "斯基" +/// productId : "1490571670107193344" +/// actPrice : "60" +/// state : false +/// isDelete : null + +class LaunchJoinAct { + LaunchJoinAct({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String storeId, + int type, + String actTemplateId, + String actTimeId, + String actRecordId, + String mid, + String orderId, + bool isLeader, + String memberAvatar, + String memberNickname, + String productId, + String actPrice, + bool state, + dynamic isDelete,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _storeId = storeId; + _type = type; + _actTemplateId = actTemplateId; + _actTimeId = actTimeId; + _actRecordId = actRecordId; + _mid = mid; + _orderId = orderId; + _isLeader = isLeader; + _memberAvatar = memberAvatar; + _memberNickname = memberNickname; + _productId = productId; + _actPrice = actPrice; + _state = state; + _isDelete = isDelete; +} + + LaunchJoinAct.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _storeId = json['storeId']; + _type = json['type']; + _actTemplateId = json['actTemplateId']; + _actTimeId = json['actTimeId']; + _actRecordId = json['actRecordId']; + _mid = json['mid']; + _orderId = json['orderId']; + _isLeader = json['isLeader']; + _memberAvatar = json['memberAvatar']; + _memberNickname = json['memberNickname']; + _productId = json['productId']; + _actPrice = json['actPrice']; + _state = json['state']; + _isDelete = json['isDelete']; + } + String _id; + String _createTime; + String _createUser; + String _updateTime; + String _updateUser; + String _storeId; + int _type; + String _actTemplateId; + String _actTimeId; + String _actRecordId; + String _mid; + String _orderId; + bool _isLeader; + String _memberAvatar; + String _memberNickname; + String _productId; + String _actPrice; + bool _state; + dynamic _isDelete; + + String get id => _id; + String get createTime => _createTime; + String get createUser => _createUser; + String get updateTime => _updateTime; + String get updateUser => _updateUser; + String get storeId => _storeId; + int get type => _type; + String get actTemplateId => _actTemplateId; + String get actTimeId => _actTimeId; + String get actRecordId => _actRecordId; + String get mid => _mid; + String get orderId => _orderId; + bool get isLeader => _isLeader; + String get memberAvatar => _memberAvatar; + String get memberNickname => _memberNickname; + String get productId => _productId; + String get actPrice => _actPrice; + bool get state => _state; + dynamic get isDelete => _isDelete; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['storeId'] = _storeId; + map['type'] = _type; + map['actTemplateId'] = _actTemplateId; + map['actTimeId'] = _actTimeId; + map['actRecordId'] = _actRecordId; + map['mid'] = _mid; + map['orderId'] = _orderId; + map['isLeader'] = _isLeader; + map['memberAvatar'] = _memberAvatar; + map['memberNickname'] = _memberNickname; + map['productId'] = _productId; + map['actPrice'] = _actPrice; + map['state'] = _state; + map['isDelete'] = _isDelete; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 0d37b80e..f669a542 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -20,6 +20,7 @@ import 'data/activity_details.dart'; import 'data/activity_order_list.dart'; import 'data/findMiNiGroupList.dart'; import 'data/home_recommend_list.dart'; +import 'data/launch_join_act.dart'; import 'data/miNiDetail.dart'; import 'data/settleOrderInfo.dart'; import 'data/shoppingCart.dart'; @@ -231,11 +232,11 @@ abstract class MinApiService { /// 发起活动 @POST("actTemplate/launchAct") - Future launchAct(@Body() Map param); + Future> launchAct(@Body() Map param); /// 参与活动 @POST("actTemplate/joinAct") - Future joinAct(@Body() Map param); + Future> joinAct(@Body() Map param); /// 活动付款 @POST("actTemplate/actPay") diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index b8c39c26..31ec58cb 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -491,7 +491,7 @@ class _MinApiService implements MinApiService { } @override - Future> launchAct(param) async { + Future> launchAct(param) async { ArgumentError.checkNotNull(param, 'param'); const _extra = {}; final queryParameters = {}; @@ -506,15 +506,15 @@ class _MinApiService implements MinApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => LaunchJoinAct.fromJson(json), ); return value; } @override - Future> joinAct(param) async { + Future> joinAct(param) async { ArgumentError.checkNotNull(param, 'param'); const _extra = {}; final queryParameters = {}; @@ -529,9 +529,9 @@ class _MinApiService implements MinApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => LaunchJoinAct.fromJson(json), ); return value; } diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index 89d09b6a..2ea2c9dd 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -13,6 +13,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity_details.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/launch_join_act.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart'; import 'package:huixiang/retrofit/data/shoppingCart.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; @@ -74,6 +75,7 @@ class _ShoppingGoodsDetails extends State { bool isDispose = false; Timer _timer; String testTime = "2021-12-30 10:00:00"; + LaunchJoinAct launchJoinAct; @override void dispose() { @@ -227,38 +229,62 @@ class _ShoppingGoodsDetails extends State { } ///发起活动 - // queryLaunchAct() async { - // if (minService == null) - // minService = MinApiService( - // Dio(), - // context: context, - // token: minToken, - // tenant: tenant, - // storeId: storeId, - // showLoading: false, - // ); - // BaseData baseData = await minService.launchAct({ - // "actProductId":activityDetails.actProduct.id, - // "actRecordId":0, - // "actTemplateId":activityDetails.actProduct.templateId, - // "actTimeId":activityDetails.actProduct.timeId, - // "getType":1, - // "productId":activityDetails.actProduct.productId, - // "skuId":activityDetails.actProduct.skuJson[0].skuId, - // "skuPrice":activityDetails.actProduct.skuJson[0].skuPrice, - // "templateType":pageType - // }).catchError((error) { - // refreshController.refreshFailed(); - // }); - // if (baseData != null && baseData.isSuccess) { - // setState(() { - // - // refreshController.refreshCompleted(); - // }); - // } else { - // refreshController.refreshFailed(); - // } - // } + queryLaunchAct() async { + if (minService == null) + minService = MinApiService( + Dio(), + context: context, + token: minToken, + tenant: tenant, + storeId: storeId, + showLoading: false, + ); + BaseData baseData = await minService.launchAct({ + "actProductId":activityDetails.actProduct.id, + "actRecordId":0, + "actTemplateId":activityDetails.actProduct.templateId, + "actTimeId":activityDetails.actProduct.timeId, + "getType":1, + "productId":activityDetails.actProduct.productId, + "skuId":activityDetails.actProduct.skuJson[0].skuId, + "skuPrice":activityDetails.actProduct.skuJson[0].skuPrice, + "templateType":pageType + }).catchError((error) { + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + setState(() { + launchJoinAct = baseData.data; + refreshController.refreshCompleted(); + }); + } else { + refreshController.refreshFailed(); + } + } + + + ///参与活动 + queryJoinAct() async { + BaseData baseData = await minService.joinAct({ + "actProductId": "", + "actRecordId": "", + "actTemplateId": "", + "actTimeId":"", + "getType":1, + "productId":"", + "skuId":"", + "skuPrice":"", + "templateType":1 + }).catchError((error) { + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + launchJoinAct = baseData.data; + refreshController.refreshCompleted(); + }else { + refreshController.refreshFailed(); + } + } ///选规格弹窗 showStoreSelector(MiNiDetail miNiDetail, String id, int count) async { @@ -397,8 +423,6 @@ class _ShoppingGoodsDetails extends State { ///去下单结算页面 toDownOrder() async { - // int num = count(); - if (count1 == 0) { SmartDialog.showToast("请先选择您要购买的商品!~"); return; @@ -427,7 +451,6 @@ class _ShoppingGoodsDetails extends State { "tableId": tableId, }, ], - // "numberOfPeople": numberOfPeople, }, ); } @@ -1611,13 +1634,7 @@ class _ShoppingGoodsDetails extends State { ), GestureDetector( onTap: () { - Navigator.of(context) - .popAndPushNamed('/router/group_details', arguments: { - "actRecordId": activityDetails.actRecordAndJoinlDTOList[0] - .actRecordJoinList[index].actRecordId, - "actProduct":activityDetails.actProduct, - "limitNumber":limitNumber, - }); + }, 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 c3827b0b..a66a292d 100644 --- a/lib/store/shopping/shopping_home/group_details.dart +++ b/lib/store/shopping/shopping_home/group_details.dart @@ -8,6 +8,8 @@ import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/retrofit/data/activity_actRecord_details.dart'; import 'package:huixiang/retrofit/data/activity_details.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/launch_join_act.dart'; +import 'package:huixiang/retrofit/data/miNiDetail.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; @@ -31,7 +33,6 @@ class GroupDetails extends StatefulWidget { class _GroupDetails extends State { MinApiService minService; String actRecordId; - // ActProduct actProduct; ActivityActRecordDetails activityActRecordDetails; bool isDispose = false; Timer _timer; @@ -57,7 +58,6 @@ class _GroupDetails extends State { void initState() { super.initState(); actRecordId = widget.arguments["actRecordId"]; - // actProduct = widget.arguments["actProduct"]; limitNumber = widget.arguments["limitNumber"]; startCountdownTimer(); SharedPreferences.getInstance().then((value) { @@ -166,11 +166,9 @@ class _GroupDetails extends State { child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), child: FutureBuilder( - // future: queryHome(), builder: (context, snapshot) { return Column( children: [ - goodsInfo(), inviteGroup(), groupRule(), ], @@ -189,102 +187,6 @@ class _GroupDetails extends State { ); } - ///商品信息 - Widget goodsInfo() { - 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), - padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(2), - child: Image.asset( - "assets/image/icon_story_td.png", - width: 85, - height: 85, - fit: BoxFit.cover, - ), - ), - // MImage( - // actProduct?.productImg??"", - // width: double.infinity, - // height: 166, - // fit: BoxFit.cover, - // errorSrc: "assets/image/default_1.png", - // fadeSrc: "assets/image/default_1.png", - // ), - SizedBox( - width: 10, - ), - Expanded( - child: Container( - height: 85, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "[生态小农]山林放养鸡蛋30枚/盒备份 2", - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF353535), - ), - ), - Text( - "套盒装", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF727272), - ), - ), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "¥", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF32A060), - ), - ), - TextSpan( - text: "284.00", - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF32A060), - ), - ), - ], - ), - ), - ], - ), - )) - ], - ), - ); - } - ///邀请好友拼团 Widget inviteGroup() { return Container( @@ -418,7 +320,8 @@ class _GroupDetails extends State { alignment: Alignment.center, decoration: BoxDecoration( // color: Color(0xFFD2D2D2), - color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), + color: (((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) + ? Color(0xFFD2D2D2):Color(0xFFF8961E), borderRadius: BorderRadius.circular(4)), child: Text( tempHour.toString(), @@ -438,7 +341,7 @@ class _GroupDetails extends State { fontSize: 16.sp, fontWeight: MyFontWeight.medium, // color: Color(0xFFD2D2D2), - color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), + color: (((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), ), )), InkWell( @@ -449,7 +352,7 @@ class _GroupDetails extends State { alignment: Alignment.center, decoration: BoxDecoration( // color: Color(0xFFD2D2D2), - color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), + color:(((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), borderRadius: BorderRadius.circular(4)), child: Text( tempM.toString(), @@ -469,7 +372,7 @@ class _GroupDetails extends State { fontSize: 16.sp, fontWeight: MyFontWeight.medium, // color: Color(0xFFD2D2D2), - color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), + color:(((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), ), )), InkWell( @@ -480,7 +383,7 @@ class _GroupDetails extends State { alignment: Alignment.center, decoration: BoxDecoration( // color: Color(0xFFD2D2D2), - color: (activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber ? Color(0xFFD2D2D2):Color(0xFFF8961E), + color:(((activityActRecordDetails?.actRecord?.joinNum ?? 0) == limitNumber) ||(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0)) ? Color(0xFFD2D2D2):Color(0xFFF8961E), borderRadius: BorderRadius.circular(4)), child: Text( tempS.toString(), @@ -506,7 +409,7 @@ class _GroupDetails extends State { color: Colors.black, ), ), - if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < limitNumber) + if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < limitNumber && tempDay != 0 && tempHour!=0 && tempM !=0 && tempS !=0) Text.rich( TextSpan( children: [ @@ -537,6 +440,15 @@ class _GroupDetails extends State { ], ), ), + if(tempDay == 0 && tempHour==0 && tempM ==0 && tempS ==0) + Text( + "很遗憾,拼团失败", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), SizedBox( height: 32, ), @@ -565,6 +477,7 @@ class _GroupDetails extends State { InkWell( onTap: () { setState(() { + }); }, child:Container( @@ -584,7 +497,7 @@ class _GroupDetails extends State { ), )), ), - if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < limitNumber) + if((activityActRecordDetails?.actRecord?.joinNum ?? 0) < limitNumber && tempDay != 0 && tempHour!=0 && tempM != 0 && tempS != 0) InkWell( onTap: () { setState(() { @@ -622,28 +535,29 @@ class _GroupDetails extends State { ], )), ), - // 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) == limitNumber) ||(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: Text( + "联系客服退款", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + )), + ), ], ), ); @@ -708,17 +622,17 @@ class _GroupDetails extends State { ], ), 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, + 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, + ), ), - ), ], ) );