From dab4e2d2c345550ffe4b0458c263bd200bee8268 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 15 Mar 2022 17:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/order/bargain_group_order.dart | 92 +- lib/order/order_history_page.dart | 74 +- .../data/activity_actRecord_details.dart | 9 +- lib/retrofit/data/activity_order_list.dart | 8 +- .../settlement_view/distribution.dart | 29 +- .../shopping/shopping_goods_details.dart | 20 +- .../shopping_home/bargain_details.dart | 53 +- .../shopping/shopping_home/group_details.dart | 1102 +++++++++-------- .../shopping_home/group_page_details.dart | 10 +- .../shopping/shopping_home/search_page.dart | 9 + .../shopping_home/shopping_home_page.dart | 3 +- 11 files changed, 770 insertions(+), 639 deletions(-) diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart index e7ed1f7e..cb991dc4 100644 --- a/lib/order/bargain_group_order.dart +++ b/lib/order/bargain_group_order.dart @@ -1,10 +1,14 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity_order_list.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/min_api.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; @@ -61,9 +65,9 @@ class _BargainGroupOrder extends State ]; _pages = [ ExchangeHistoryList(0,type), - ExchangeHistoryList(1,type), ExchangeHistoryList(2,type), - ExchangeHistoryList(3,type) + ExchangeHistoryList(3,type), + ExchangeHistoryList(4,type) ]; } @@ -124,8 +128,11 @@ class ExchangeHistoryList extends StatefulWidget { class _ExchangeHistoryList extends State { MinApiService minService; List activityOrderList = []; - RefreshController _refreshController = - RefreshController(initialRefresh: false); + RefreshController _refreshController = RefreshController(initialRefresh: false); + ApiService apiService; + StoreInfo storeInfo; + List activitys; + String storeId; @override void initState() { @@ -140,6 +147,7 @@ class _ExchangeHistoryList extends State { token: minToken, tenant: tenant, storeId: storeId, + showLoading: true ); queryShowMyActList(); }); @@ -149,7 +157,7 @@ class _ExchangeHistoryList extends State { queryShowMyActList() async { BaseData> baseData = await minService.showMyActList({ - "state":0, + "state":widget.orderStatus, "type" :widget.type, }).catchError((error) { _refreshController.loadFailed(); @@ -161,6 +169,7 @@ class _ExchangeHistoryList extends State { activityOrderList.clear(); if(baseData.data.length > 0) activityOrderList.addAll(baseData.data); + queryStoreInfo(); }); } else { _refreshController.refreshFailed(); @@ -168,6 +177,32 @@ class _ExchangeHistoryList extends State { } } + /// 查询店铺信息 + queryStoreInfo() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = + await apiService.queryStoreInfo(activityOrderList[0].storeId).catchError((error) { + debugPrint(error.toString()); + }); + if (baseData != null && baseData.isSuccess) { + storeInfo = StoreInfo.fromJson(baseData.data); + activitys = storeInfo.informationVOPageVO.list + .map((e) => Activity.fromJson(e)) + .toList(); + if (mounted) { + setState(() {}); + } + } + EasyLoading.dismiss(); + } + _refresh() { queryShowMyActList(); } @@ -198,7 +233,7 @@ class _ExchangeHistoryList extends State { return bargainOrder(activityOrderList[position]); }, ):NoDataView( - src: "assets/image/icon_empty.png", + src: "assets/image/ding_dan.png", isShowBtn: false, text: "还没有订单,快去下一单吧~", fontSize: 16.sp, @@ -257,8 +292,8 @@ class _ExchangeHistoryList extends State { // borderRadius: BorderRadius.circular(2), // ), // child: Text( - // // (orderInfo != null && orderInfo.isTakeOut == 0) ? "自" : "外", - // "自", + // (orderInfo != null && orderInfo.isTakeOut == 0) ? "自" : "外", + // // "自", // style: TextStyle( // fontSize: 12.sp, // fontWeight: FontWeight.bold, @@ -285,32 +320,12 @@ class _ExchangeHistoryList extends State { Padding( padding: EdgeInsets.only(top: 12.h, right: 12.w), child:Text( - // (orderInfo != null && - // orderInfo.storeVO != null && - // orderInfo.storeVO.posType != null) - // ? StatusUtils.statusText( - // context, - // orderInfo.refundStatus, - // orderInfo.orderStatus, - // orderInfo.payStatus, - // orderInfo.sendStatus, - // orderInfo.isTakeOut) - // : "", - (widget.type == 1)?(activityOrderList.howManyMore != 0 ? "还差${activityOrderList?.howManyMore ?? 0}人拼团成功" : "拼团成功") - :(activityOrderList.howManyMoney != 0 ? "还差¥${activityOrderList?.howManyMoney ?? 0}砍价成功" : "成功"), + (widget.type == 1)?(widget.orderStatus == 4 ? "拼团失败" :(activityOrderList.howManyMore != 0 ? "还差${activityOrderList?.howManyMore ?? 0}人拼团成功" : "拼团成功")) + :(widget.orderStatus == 4 ? "砍价失败" : (activityOrderList.howManyMoney != "0.00" ? "还差¥${activityOrderList?.howManyMoney ?? 0}砍价成功" : "砍价成功")), style: TextStyle( fontSize: 14.sp, fontWeight: FontWeight.bold, - color: - // (orderInfo == null) - // ? Color(0xFF32A060) - // : (orderInfo.refundStatus == 1 || - // orderInfo.orderStatus >= 5) - // ? Colors.grey - // : (orderInfo.orderStatus == 4) - // ? Color(0xFF32A060) - // : - Color(0xffFE951E), + color: widget.orderStatus == 4 ? Color(0xff32A060) : Color(0xffFE951E), ), ), ), @@ -448,6 +463,7 @@ class _ExchangeHistoryList extends State { .pushNamed('/router/bargain_details',arguments: { "actRecordId": activityOrderList.actRecordId, "limitNumber":activityOrderList.successNumber, + "storeInfo":storeInfo, }); } }, @@ -461,20 +477,6 @@ class _ExchangeHistoryList extends State { padding: EdgeInsets.fromLTRB(17.w,0, 17.w,0), ), ), - // GestureDetector( - // onTap: () { - // - // }, - // child:RoundButton( - // height: 25.h, - // padding: EdgeInsets.fromLTRB(8, 4, 8, 4), - // text: S.of(context).chakanxiangqing, - // textColor: Colors.white, - // fontSize: 12, - // backgroup: Color(0xFF32A060), - // radius: 2, - // ), - // ), ], ), ), diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index ad770558..f1cb53e2 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, @@ -156,7 +156,7 @@ class _OrderHistoryList extends State ); }) : NoDataView( - src: "assets/image/ding_dan.png", + src: "assets/image/ding_dan.png", isShowBtn: false, text: "目前暂无订单,快去下一单吧~", fontSize: 16.sp, @@ -193,7 +193,10 @@ class _OrderHistoryList extends State if (current == 1) { orderInfos.clear(); } - orderInfos.addAll(baseData.data.records); + baseData.data.records.forEach((element) { + if((element.orderType == 0 || element.orderType == 1 ||element.orderType == 2 ||element.orderType == 3) && element.payStatus == 1 && element.refundStatus ==0) + orderInfos.add(element); + }); refreshController.refreshCompleted(); refreshController.loadComplete(); if (current * 10 > int.tryParse(baseData.data.total)) { @@ -215,7 +218,8 @@ class _OrderHistoryList extends State SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), showLoading: true, - context: context, token: value.getString("token")), + context: context, + token: value.getString("token")), queryOrder(), }); } @@ -243,29 +247,34 @@ class _OrderHistoryList extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - (orderInfo != null && orderInfo.orderType == 0) ? Container(): - Container( - width: 19, - height: 21, - margin: EdgeInsets.only(left: 12.w, top: 12.h), - alignment: Alignment.center, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(2), - border: Border.all( - width: 1, - color: Color(0xFF32A060), - style: BorderStyle.solid, - )), - child: Text( - (orderInfo != null && orderInfo.orderType == 7) ?"秒":"团", - style: TextStyle( - fontSize: 12.sp, - fontWeight: FontWeight.bold, - color: Color(0xFF32A060), - ), - ), - ), + (orderInfo != null && orderInfo.orderType == 0) + ? Container() + : Container( + width: 19, + height: 21, + margin: EdgeInsets.only(left: 12.w, top: 12.h), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + border: Border.all( + width: 1, + color: Color(0xFF32A060), + style: BorderStyle.solid, + )), + child: Text( + (orderInfo != null && orderInfo.orderType == 1) + ? "团" + : ((orderInfo != null && orderInfo.orderType == 2) + ? "秒" + : "砍"), + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.bold, + color: Color(0xFF32A060), + ), + ), + ), Container( width: 19, height: 21, @@ -276,7 +285,11 @@ class _OrderHistoryList extends State borderRadius: BorderRadius.circular(2), ), child: Text( - (orderInfo != null && orderInfo.isTakeOut == 0) ? "自" : ((orderInfo != null && orderInfo.isTakeOut == 1) ? "外" : "物"), + (orderInfo != null && orderInfo.isTakeOut == 0) + ? "自" + : ((orderInfo != null && orderInfo.isTakeOut == 1) + ? "外" + : "物"), style: TextStyle( fontSize: 12.sp, fontWeight: FontWeight.bold, @@ -436,7 +449,7 @@ class _OrderHistoryList extends State ), TextSpan( // text: totalPrice(orderInfo), - text:orderInfo.finalPayPrice, + text: orderInfo.finalPayPrice, style: TextStyle( fontSize: 12.sp, fontWeight: FontWeight.bold, @@ -562,7 +575,8 @@ class _OrderHistoryList extends State payResult(BaseData baseData) {} orderCancel(String orderId) async { - BaseData baseData = await apiService.orderCancel(orderId).catchError((onError) {}); + BaseData baseData = + await apiService.orderCancel(orderId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("订单取消成功"); _onRefresh(); diff --git a/lib/retrofit/data/activity_actRecord_details.dart b/lib/retrofit/data/activity_actRecord_details.dart index 1970a87d..27eea174 100644 --- a/lib/retrofit/data/activity_actRecord_details.dart +++ b/lib/retrofit/data/activity_actRecord_details.dart @@ -9,13 +9,15 @@ class ActivityActRecordDetails { ActRecord actRecord, List actRecordJoinList, ActProduct actProduct, - dynamic skuName, + dynamic skuName, + String skuId, bool isBargain, int successNumber}){ _actRecord = actRecord; _actRecordJoinList = actRecordJoinList; _actProduct = actProduct; _skuName = skuName; + _skuId = skuId; _isBargain = isBargain; _successNumber = successNumber; @@ -31,6 +33,7 @@ class ActivityActRecordDetails { } _actProduct = json['actProduct'] != null ? ActProduct.fromJson(json['actProduct']) : null; _skuName = json['skuName']; + _skuId = json['skuId']; _isBargain = json['isBargain']; _successNumber = json['successNumber']; } @@ -38,6 +41,7 @@ class ActivityActRecordDetails { List _actRecordJoinList; ActProduct _actProduct; dynamic _skuName; + String _skuId; bool _isBargain; int _successNumber; @@ -45,6 +49,7 @@ class ActivityActRecordDetails { List get actRecordJoinList => _actRecordJoinList; ActProduct get actProduct => _actProduct; dynamic get skuName => _skuName; + String get skuId => _skuId; bool get isBargain => _isBargain; int get successNumber => _successNumber; @@ -59,7 +64,7 @@ class ActivityActRecordDetails { if (_actProduct != null) { map['actProduct'] = _actProduct.toJson(); } - map['skuName'] = _skuName; + map['skuId'] = _skuId; map['isBargain'] = _isBargain; map['successNumber'] = _successNumber; return map; diff --git a/lib/retrofit/data/activity_order_list.dart b/lib/retrofit/data/activity_order_list.dart index f629ed4b..f2432d45 100644 --- a/lib/retrofit/data/activity_order_list.dart +++ b/lib/retrofit/data/activity_order_list.dart @@ -13,7 +13,8 @@ class ActivityOrderList { ActivityOrderList({ - String storeName, + String storeName, + String storeId, String joinTime, String productImg, String productName, @@ -27,6 +28,7 @@ class ActivityOrderList { dynamic bargainMoney, dynamic howManyMoney,}){ _storeName = storeName; + _storeId = storeId; _joinTime = joinTime; _productImg = productImg; _productName = productName; @@ -43,6 +45,7 @@ class ActivityOrderList { ActivityOrderList.fromJson(dynamic json) { _storeName = json['storeName']; + _storeId = json['storeId']; _joinTime = json['joinTime']; _productImg = json['productImg']; _productName = json['productName']; @@ -57,6 +60,7 @@ class ActivityOrderList { _howManyMoney = json['howManyMoney']; } String _storeName; + String _storeId; String _joinTime; String _productImg; String _productName; @@ -71,6 +75,7 @@ class ActivityOrderList { dynamic _howManyMoney; String get storeName => _storeName; + String get storeId => _storeId; String get joinTime => _joinTime; String get productImg => _productImg; String get productName => _productName; @@ -87,6 +92,7 @@ class ActivityOrderList { Map toJson() { final map = {}; map['storeName'] = _storeName; + map['storeId'] = _storeId; map['joinTime'] = _joinTime; map['productImg'] = _productImg; map['productName'] = _productName; diff --git a/lib/settlement/settlement_view/distribution.dart b/lib/settlement/settlement_view/distribution.dart index a5383add..126eba9f 100644 --- a/lib/settlement/settlement_view/distribution.dart +++ b/lib/settlement/settlement_view/distribution.dart @@ -26,7 +26,7 @@ class DistributionMode extends StatefulWidget { final String pageType; DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo, - this.address, this.selectedNewAddress,this.pageType); + this.address, this.selectedNewAddress, this.pageType); @override State createState() { @@ -154,10 +154,13 @@ class _DistributionMode extends State { flex: 1, child: GestureDetector( onTap: () { - setState(() { - selectedBtn = 1; - widget.queryAddress(selectedBtn); - }); + if (widget.pageType != null) { + SmartDialog.showToast("该功能暂未开放!", + alignment: Alignment.center); + return; + } + selectedBtn = 1; + widget.queryAddress(selectedBtn); }, child: Container( height: 50.h, @@ -177,6 +180,11 @@ class _DistributionMode extends State { flex: 1, child: GestureDetector( onTap: () { + if (widget.pageType != null) { + selectedBtn = 2; + widget.queryAddress(selectedBtn); + return; + } SmartDialog.showToast("该功能暂未开放!", alignment: Alignment.center); }, @@ -308,11 +316,17 @@ class _DistributionMode extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( + (widget.pageType != null) ? + Icon( + Icons.local_shipping, + color: Color(0xFF727272), + size: 24, + ):Image.asset( "assets/image/icon_permission_location.png", height: 24.h, width: 24.w, ), + SizedBox(width: 5), Text( widget?.address?.username ?? "", overflow: TextOverflow.ellipsis, @@ -351,7 +365,8 @@ class _DistributionMode extends State { }); }, child: Container( - padding:EdgeInsets.symmetric(horizontal:15.w,vertical: 5.h), + padding: EdgeInsets.symmetric( + horizontal: 15.w, vertical: 5.h), child: Icon( Icons.keyboard_arrow_right, size: 24, diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index bd3f8530..05a055be 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 }); } @@ -734,7 +736,7 @@ class _ShoppingGoodsDetails extends State { SmartDialog.showToast("请先选择您要购买的商品!~"); return; } - queryLaunchAct(); + // queryLaunchAct(); }, child: Container( alignment: Alignment.center, @@ -771,7 +773,11 @@ class _ShoppingGoodsDetails extends State { children: [ GestureDetector( onTap: () { - toDownOrder(); + if (count1 == 0) { + SmartDialog.showToast("请先选择您要购买的商品!~"); + return; + } + queryLaunchAct(); }, child: Container( alignment: Alignment.center, @@ -827,7 +833,11 @@ class _ShoppingGoodsDetails extends State { ), GestureDetector( onTap: () { - toDownOrder(); + if (count1 == 0) { + SmartDialog.showToast("请先选择您要购买的商品!~"); + return; + } + queryLaunchAct(); }, child: Container( alignment: Alignment.center, diff --git a/lib/store/shopping/shopping_home/bargain_details.dart b/lib/store/shopping/shopping_home/bargain_details.dart index 5776a55b..3757b6ff 100644 --- a/lib/store/shopping/shopping_home/bargain_details.dart +++ b/lib/store/shopping/shopping_home/bargain_details.dart @@ -46,7 +46,6 @@ class _BargainDetails extends State { double bargainNum = 0; LaunchJoinAct launchJoinAct; StoreInfo storeInfo; - String skuId; @override void dispose() { @@ -58,13 +57,14 @@ class _BargainDetails extends State { } } + + @override void initState() { super.initState(); actRecordId = widget.arguments["actRecordId"]; limitNumber = widget.arguments["limitNumber"]; storeInfo = widget.arguments["storeInfo"]; - 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( + await Navigator.of(context).popAndPushNamed( '/router/settlement', arguments: { "storeInfo": storeInfo, - "pageType": 3, + "pageType": "3", "isDirectBuy":true, "productId": activityActRecordDetails.actProduct.productId, - "skuId":skuId, + "skuId":activityActRecordDetails.skuId, "buyNum": 1, "skuValue1":activityActRecordDetails.skuName, - "orderId":launchJoinAct.orderId + "orderId":activityActRecordDetails.actRecordJoinList[0].orderId, + "actProductId":activityActRecordDetails.actProduct.id, + "actProductSkuId":activityActRecordDetails.skuId, }, ); } @@ -566,7 +540,7 @@ class _BargainDetails extends State { (activityActRecordDetails?.actRecord?.joinNum ?? 0)) GestureDetector( onTap: (){ - queryLaunchAct(); + toOrder(); }, child: Container( alignment: Alignment.center, @@ -594,6 +568,15 @@ class _BargainDetails extends State { ), ), )), + if ((activityActRecordDetails?.actRecord?.state ?? 0) == 3) + Text( + "恭喜您砍价成功", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + ), if (limitNumber != (activityActRecordDetails?.actRecord?.joinNum ?? 0)) GestureDetector( 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, diff --git a/lib/store/shopping/shopping_home/search_page.dart b/lib/store/shopping/shopping_home/search_page.dart index a4484aeb..90974a92 100644 --- a/lib/store/shopping/shopping_home/search_page.dart +++ b/lib/store/shopping/shopping_home/search_page.dart @@ -12,6 +12,7 @@ import 'package:huixiang/view_widget/classic_header.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -661,6 +662,14 @@ class _SearchPage extends State with AutomaticKeepAliveClientMixin, ], ), SizedBox(height: 16.h), + (productListBeans == null || productListBeans?.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), + ): GridView.builder( itemCount:productListBeans?.length ?? 0, shrinkWrap: true, diff --git a/lib/store/shopping/shopping_home/shopping_home_page.dart b/lib/store/shopping/shopping_home/shopping_home_page.dart index 6358d79c..3b6a1488 100644 --- a/lib/store/shopping/shopping_home/shopping_home_page.dart +++ b/lib/store/shopping/shopping_home/shopping_home_page.dart @@ -99,8 +99,9 @@ class _ShoppingHomePage extends State homeRecommendList.clear(); homeRecommendList.addAll(baseData.data); }); + }else { + refreshController.refreshFailed(); } - EasyLoading.dismiss(); } _onRefresh(){