diff --git a/lib/main.dart b/lib/main.dart index af44729f..d7c916c2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -52,6 +52,7 @@ import 'package:huixiang/setting/help_feedback_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; +import 'package:huixiang/store/store_order.dart'; import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/web/web_page.dart'; @@ -277,6 +278,7 @@ Map routers = { '/router/location_map': (context, {arguments}) => LocationMap(arguments: arguments), '/router/qr_scan': (context, {arguments}) => QrCodeScanPage(), '/router/qr_share': (context, {arguments}) => QrSharePage(), + '/router/store_order': (context, {arguments}) => StoreOrderPage(arguments: arguments), // '/router/hot_article_details_page': (context, {arguments}) => HotArticleDetailsPage(), // '/router/ui_test': (context, {arguments}) => UITest(), }; diff --git a/lib/retrofit/data/store_info.dart b/lib/retrofit/data/store_info.dart index f2dae3a2..67a8fc96 100644 --- a/lib/retrofit/data/store_info.dart +++ b/lib/retrofit/data/store_info.dart @@ -17,6 +17,7 @@ class StoreInfo { DeliveryInfo deliveryInfo; String district; String headMobile; + String tel; String headName; String id; num isAutoSendRefundAddress; @@ -67,6 +68,7 @@ class StoreInfo { : DeliveryInfo.fromJson(json['deliveryInfo'] as Map) ..district = json['district'] as String ..headMobile = json['headMobile'] as String + ..tel = json['tel'] as String ..headName = json['headName'] as String ..id = json['id'] as String ..isVip = json['isVip'] @@ -115,6 +117,7 @@ class StoreInfo { 'deliveryInfo': this.deliveryInfo.toJson(), 'district': this.district, 'headMobile': this.headMobile, + 'tel': this.tel, 'headName': this.headName, 'id': this.id, 'isAutoSendRefundAddress': this.isAutoSendRefundAddress, diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart new file mode 100644 index 00000000..f6e8d733 --- /dev/null +++ b/lib/store/store_order.dart @@ -0,0 +1,244 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/store_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/store/store_view/store_info.dart'; +import 'package:huixiang/union/union_view/union_coupon.dart'; +import 'package:huixiang/union/union_view/vip.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_tab.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class StoreOrderPage extends StatefulWidget { + final Map arguments; + + StoreOrderPage({this.arguments}); + + @override + State createState() { + return _StoreOrderPage(); + } +} + +class _StoreOrderPage extends State + with TickerProviderStateMixin/*, AutomaticKeepAliveClientMixin */{ + TabController tabcontroller; + ApiService apiService; + StoreInfo storeInfo; + RefreshController refreshController; + + @override + void initState() { + super.initState(); + + queryStoreInfo(); + + } + + queryStoreInfo() async { + final SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString('token'), + ); + + BaseData baseData = await apiService + .queryStoreInfo(widget.arguments["id"]) + .catchError((error) { + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + refreshController.refreshCompleted(); + storeInfo = StoreInfo.fromJson(baseData.data); + if (mounted) { + setState(() {}); + } + } else { + refreshController.refreshFailed(); + } + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Expanded( + child: DefaultTabController( + length: 2, + child: SmartRefresher( + controller: refreshController = + RefreshController(initialRefresh: false), + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + onRefresh: () { + queryStoreInfo(); + }, + child: NestedScrollView( + headerSliverBuilder: + (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverOverlapAbsorber( + handle: NestedScrollView.sliverOverlapAbsorberHandleFor( + context), + sliver: SliverAppBar( + title: Text( + "百年川椒", + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 18.sp, + ), + ), + expandedHeight: (storeInfo != null && storeInfo.couponVOList != null) ? 425.h : 365.h, + floating: false, + snap: false, + leading: GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + alignment: Alignment.centerRight, + margin: EdgeInsets.only(left: 10), + padding: EdgeInsets.all(6), + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + size: 24, + ), + ), + ), + pinned: true, + flexibleSpace: FlexibleSpaceBar( + background: Stack( + children: [ + Positioned( + child: Column( + children: [ + Image.asset( + "assets/image/share_image_bg.png", + fit: BoxFit.cover, + width: MediaQuery.of(context).size.width, + height: 180.h, + ), + Expanded( + child: Container( + color: Colors.transparent, + ), + flex: 1, + ), + ], + ), + top: 0, + bottom: 0, + left: 0, + right: 0, + ), + Positioned( + child: Container( + child: Column( + children: [ + ///门店信息 + StoreInfoView(), + + ///门店对应优惠券 + if (storeInfo != null && storeInfo.couponVOList != null) + UnionCoupon( + storeInfo, + (a) {}, + coupon: true, + ), + + ///门店对应VIP信息 + Vip(storeInfo, () {}, false), + ], + ), + ), + top: 110.h, + bottom: 0, + left: 0, + right: 0, + ), + ], + ), + collapseMode: CollapseMode.pin, + ), + backgroundColor: Color(0xFFFAFAFA), + centerTitle: false, + elevation: 0, + bottom: PreferredSize( + preferredSize: Size( + MediaQuery.of(context).size.width, + 38.h, + ), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 10.w), + width: MediaQuery.of(context).size.width, + child: TabBar( + controller: tabcontroller = TabController( + length: 2, + vsync: this, + ), + automaticIndicatorColorAdjustment: true, + isScrollable: true, + indicatorWeight: 1, + indicatorColor: Color(0xFFFAFAFA), + labelPadding: EdgeInsets.only(left: 8.w, right: 8.w), + indicatorSize: TabBarIndicatorSize.label, + unselectedLabelStyle: TextStyle( + fontSize: 15.sp, + fontWeight: FontWeight.w400, + ), + labelStyle: TextStyle( + color: Colors.black, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + labelColor: Colors.black, + tabs: [ + MyTab(text: "点单"), + MyTab(text: "星店活动"), + ], + ), + ), + ), + ), + ), + ]; + }, + body: TabBarView( + physics: BouncingScrollPhysics(), + children: [ + Container( + color: Colors.white, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.width, + ), + Container( + color: Colors.white, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.width, + ) + ], + controller: tabcontroller, + ), + ), + ), + ), + ), + Container( + height: 50.h, + color: Colors.blue, + ), + ], + ); + } + + // @override + // bool get wantKeepAlive => true; +} diff --git a/lib/store/store_view/store_info.dart b/lib/store/store_view/store_info.dart new file mode 100644 index 00000000..298e61b0 --- /dev/null +++ b/lib/store/store_view/store_info.dart @@ -0,0 +1,166 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/round_button.dart'; + +class StoreInfoView extends StatefulWidget { + @override + State createState() { + return _StoreInfoView(); + } +} + +class _StoreInfoView extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only( + left: 16.w, + right: 16.w, + top: 5.h, + bottom: 6.h, + ), + height: 138.h, + padding: EdgeInsets.all(12.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(25), + offset: Offset(0, 3), + blurRadius: 3, + spreadRadius: 0, + ), + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Row( + children: [ + Expanded( + child: Column( + children: [ + Container( + alignment: Alignment.centerLeft, + child: Text( + "百年川椒", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 18.sp, + color: Colors.black, + fontWeight: MyFontWeight.medium, + ), + ), + ), + Row( + children: [ + Text( + S.of(context).ren("1"), + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + SizedBox( + width: 20.w, + ), + ]..addAll(itemServer("11,22")), + ), + Text( + "地址:武昌区楚河汉界第一街区万达总部国际C座对面", + maxLines: 2, + textAlign: TextAlign.justify, + style: TextStyle( + color: Color(0xFF353535), + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + ), + ), + ], + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + ), + ), + Image.asset( + "assets/image/icon_vip_name.png", + width: 70.w, + height: 70.w, + ) + ], + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + ), + flex: 1, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Text( + S.of(context).yingyeshijian("10:00-22:00"), + style: TextStyle( + color: Color(0xFF353535), + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + ), + ), + ), + SizedBox( + width: 16.w, + ), + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/icon_union_location.png", + width: 24.w, + height: 24.h, + ), + ), + SizedBox( + width: 16.w, + ), + InkWell( + onTap: () {}, + child: Image.asset( + "assets/image/icon_union_call.png", + width: 24, + height: 24, + ), + ), + ], + ), + ], + ), + ); + } + + List itemServer(String businessService) { + if (businessService == null || businessService == "") return []; + var list = businessService.split(","); + return list + .map((e) => Container( + margin: EdgeInsets.only(right: 8.w), + child: RoundButton( + height: 14.h * AppUtils.textScale(context), + text: "$e", + backgroup: Color(0xFFFF7A1A), + padding: EdgeInsets.only( + left: 2.w, + right: 2.w, + ), + fontSize: 10.sp, + textColor: Colors.white, + ), + )) + .toList(); + } +} diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index e4a68518..c5727101 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -339,7 +339,7 @@ class _UnionDetailsPage extends State { } else { print("print 下载失败"); } - Future.delayed(Duration(seconds: 1), () { + Future.delayed(Duration(seconds: 1), (){ EasyLoading.dismiss(); }); } diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 835c3ff4..0cd45c2d 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -34,8 +34,8 @@ class UnionPage extends StatefulWidget { class _UnionPage extends State with AutomaticKeepAliveClientMixin, WidgetsBindingObserver { - - final RefreshController refreshController = RefreshController(initialRefresh: false); + final RefreshController refreshController = + RefreshController(initialRefresh: false); ApiService apiService; bool isKeyBoardShow = false; BMFCoordinate latLng; @@ -44,11 +44,11 @@ class _UnionPage extends State void dispose() { super.dispose(); WidgetsBinding.instance.removeObserver(this); - if (Location.getInstance() != null && Location.getInstance().aMapFlutterLocation != null) + if (Location.getInstance() != null && + Location.getInstance().aMapFlutterLocation != null) Location.getInstance().aMapFlutterLocation.stopLocation(); - if (refreshController != null) - refreshController.dispose(); + if (refreshController != null) refreshController.dispose(); } @override @@ -88,8 +88,10 @@ class _UnionPage extends State startLocation() async { EasyLoading.show(status: S.current.zhengzaijiazai); - Location.getInstance().aMapFlutterLocation - .onResultCallback().listen((event) { + Location.getInstance() + .aMapFlutterLocation + .onResultCallback() + .listen((event) { if (event != null && event["latitude"] != null && event["longitude"] != null) { @@ -101,17 +103,15 @@ class _UnionPage extends State latLng = BMFCoordinate(event["latitude"], event["longitude"]); } BMFCalculateUtils.coordConvert( - coordinate: latLng, - fromType: BMF_COORD_TYPE.BD09LL, - toType: BMF_COORD_TYPE.COMMON) + coordinate: latLng, + fromType: BMF_COORD_TYPE.BD09LL, + toType: BMF_COORD_TYPE.COMMON) .then((value) { this.latLng = value; saveLatLng( value, event["province"], event["city"], event["district"]); - print( - "union: Location result ${value.latitude} " - "${value.longitude}", - ); + print("union: Location result ${value.latitude} " + "${value.longitude}"); Location.getInstance().stopLocation(); queryStore( "${value.latitude}", @@ -152,13 +152,16 @@ class _UnionPage extends State getLatLng() async { SharedPreferences.getInstance().then( (value) => { - apiService = ApiService(Dio(), context: context, - token: value.getString('token'), showLoading: false), + apiService = ApiService(Dio(), + context: context, + token: value.getString('token'), + showLoading: false), if (value.containsKey("latitude") && value.containsKey("longitude") && value.containsKey("province") && value.containsKey("city") && - value.containsKey("district")) { + value.containsKey("district")) + { latLng = BMFCoordinate(double.tryParse(value.getString("latitude")), double.tryParse(value.getString("longitude"))), queryStore( @@ -265,12 +268,20 @@ class _UnionPage extends State itemBuilder: (context, position) { return GestureDetector( onTap: () { + // Navigator.of(context).pushNamed( + // '/router/union_detail_page', + // arguments: { + // "id": storeList[position].id, + // "storeName": storeList[position].storeName + // }); + Navigator.of(context).pushNamed( - '/router/union_detail_page', - arguments: { - "id": storeList[position].id, - "storeName": storeList[position].storeName - }); + '/router/store_order', + arguments: { + "id": storeList[position].id, + "storeName": storeList[position].storeName + }, + ); }, child: buildStoreItem(storeList[position], position), ); @@ -300,7 +311,7 @@ class _UnionPage extends State offset: Offset(0, 3), blurRadius: 14, spreadRadius: 0, - ) + ), ], ), child: TextField( diff --git a/lib/union/union_view/store_info.dart b/lib/union/union_view/store_info.dart index dff21763..9b222f7c 100644 --- a/lib/union/union_view/store_info.dart +++ b/lib/union/union_view/store_info.dart @@ -413,12 +413,12 @@ class _StoreInfos extends State { title: Text(S.of(context).bodadianhua), actions: [ if (widget.storeInfo != null && - widget.storeInfo.headMobile != null && - widget.storeInfo.headMobile != "") + widget.storeInfo.tel != null && + widget.storeInfo.tel != "") CupertinoActionSheetAction( - child: Text(widget.storeInfo.headMobile), + child: Text(widget.storeInfo.tel), onPressed: () { - callMobile(widget.storeInfo.headMobile); + callMobile(widget.storeInfo.tel); Navigator.of(context).pop(); }, isDefaultAction: true, diff --git a/lib/union/union_view/union_coupon.dart b/lib/union/union_view/union_coupon.dart index 2a12de4b..3b5f5b31 100644 --- a/lib/union/union_view/union_coupon.dart +++ b/lib/union/union_view/union_coupon.dart @@ -1,7 +1,3 @@ - - - - import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/store_info.dart'; @@ -12,57 +8,62 @@ import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/separator.dart'; class UnionCoupon extends StatefulWidget { - final StoreInfo storeInfo; + final bool coupon; final Function(String id) receiveCoupon; - UnionCoupon(this.storeInfo, this.receiveCoupon); + + UnionCoupon(this.storeInfo, this.receiveCoupon, {this.coupon = false}); @override State createState() { return _UnionCoupon(); } - } class _UnionCoupon extends State { @override Widget build(BuildContext context) { - return Column( - children: [ - // Container( - // margin: EdgeInsets.only(top: 10.h, bottom: 10.h), - // child: ItemTitle( - // text: S.of(context).youhuiquan, - // imgPath: "assets/image/icon_union_coupons.png", - // ), - // ), - (widget.storeInfo != null && widget.storeInfo.couponVOList != null) - ? buildCoupon() - : Container( - width: double.infinity, - height: 0.h, - alignment: Alignment.center, - // child: Text( - // S.of(context).zanwuyouhuiquankelingqu, - // style: TextStyle( - // fontSize: 14.sp, - // fontWeight: MyFontWeight.semi_bold, - // color: Color(0xFFA0A0A0), - // ), - // ), - ), - ], - ); + return (widget.coupon != null && + widget.coupon && + (widget.storeInfo != null && widget.storeInfo.couponVOList != null)) + ? buildCoupon() + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.h, bottom: 10.h), + child: ItemTitle( + text: S.of(context).youhuiquan, + imgPath: "assets/image/icon_union_coupons.png", + ), + ), + (widget.storeInfo != null && + widget.storeInfo.couponVOList != null) + ? buildCoupon() + : Container( + width: double.infinity, + height: 50.h, + alignment: Alignment.center, + child: Text( + S.of(context).zanwuyouhuiquankelingqu, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFA0A0A0), + ), + ), + ), + ], + ); } - Widget buildCoupon() { return Container( height: 109.h, child: ListView.builder( - itemCount: (widget.storeInfo != null && widget.storeInfo.couponVOList != null) - ? widget.storeInfo.couponVOList.length - : 0, + itemCount: + (widget.storeInfo != null && widget.storeInfo.couponVOList != null) + ? widget.storeInfo.couponVOList.length + : 0, physics: BouncingScrollPhysics(parent: PageScrollPhysics()), scrollDirection: Axis.horizontal, itemBuilder: (context, position) { @@ -95,10 +96,10 @@ class _UnionCoupon extends State { child: Text.rich(TextSpan(children: [ TextSpan( text: (widget.storeInfo != null && - widget.storeInfo.couponVOList != null && - widget.storeInfo - .couponVOList[position].bizType == - 1) + widget.storeInfo.couponVOList != null && + widget.storeInfo.couponVOList[position] + .bizType == + 1) ? "¥" : "", style: TextStyle( @@ -109,18 +110,21 @@ class _UnionCoupon extends State { ), TextSpan( text: (widget.storeInfo != null && - widget.storeInfo.couponVOList != null && - widget.storeInfo - .couponVOList[position].bizType == - 1) + widget.storeInfo.couponVOList != null && + widget.storeInfo.couponVOList[position] + .bizType == + 1) ? "${double.tryParse(widget.storeInfo.couponVOList[position].discountAmount).toInt()}" : (widget.storeInfo != null && - widget.storeInfo.couponVOList != null && - widget.storeInfo.couponVOList[position] - .bizType == - 5) - ? S.of(context).duihuanquan - : "${widget.storeInfo.couponVOList[position].discountPercent ~/ 10}折", + widget.storeInfo.couponVOList != + null && + widget + .storeInfo + .couponVOList[position] + .bizType == + 5) + ? S.of(context).duihuanquan + : "${widget.storeInfo.couponVOList[position].discountPercent ~/ 10}折", style: TextStyle( fontSize: 36.sp, color: Color(0xFFFF7A1A), @@ -155,9 +159,9 @@ class _UnionCoupon extends State { children: [ Text( (widget.storeInfo != null && - widget.storeInfo.couponVOList != null) - ? widget.storeInfo - .couponVOList[position].couponName + widget.storeInfo.couponVOList != null) + ? widget.storeInfo.couponVOList[position] + .couponName : "", maxLines: 1, overflow: TextOverflow.ellipsis, @@ -169,22 +173,25 @@ class _UnionCoupon extends State { ), Text( (widget.storeInfo != null && - widget.storeInfo.couponVOList != null) + widget.storeInfo.couponVOList != null) ? (widget.storeInfo.couponVOList[position] - .bizType == - 1 - ? S.of(context).manlijiandaijinquan( - double.tryParse(widget.storeInfo - .couponVOList[position] - .fullAmount) - .toInt(), - double.tryParse(widget.storeInfo - .couponVOList[position] - .discountAmount) - .toInt()) - : S.of(context).quanchangzhe(widget.storeInfo - .couponVOList[position] - .discountPercent)) + .bizType == + 1 + ? S.of(context).manlijiandaijinquan( + double.tryParse(widget + .storeInfo + .couponVOList[position] + .fullAmount) + .toInt(), + double.tryParse(widget + .storeInfo + .couponVOList[position] + .discountAmount) + .toInt()) + : S.of(context).quanchangzhe(widget + .storeInfo + .couponVOList[position] + .discountPercent)) : "", overflow: TextOverflow.ellipsis, style: TextStyle( @@ -195,17 +202,19 @@ class _UnionCoupon extends State { ), Text( S.of(context).youxiaoqizhi( - (widget.storeInfo != null && - widget.storeInfo.couponVOList != - null && - // widget.storeInfo.couponVOList[position].useStartTime != null && - widget.storeInfo.couponVOList[position] - .useEndTime != - null) - // ? "${widget.storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${widget.storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" - ? "${widget.storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" - : "", - ), + (widget.storeInfo != null && + widget.storeInfo.couponVOList != + null && + // widget.storeInfo.couponVOList[position].useStartTime != null && + widget + .storeInfo + .couponVOList[position] + .useEndTime != + null) + // ? "${widget.storeInfo.couponVOList[position].useStartTime.replaceAll("-", ".").split(" ")[0]}-${widget.storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" + ? "${widget.storeInfo.couponVOList[position].useEndTime.replaceAll("-", ".").split(" ")[0]}" + : "", + ), overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle( @@ -221,7 +230,9 @@ class _UnionCoupon extends State { onTap: () { if (widget.storeInfo != null && widget.storeInfo.couponVOList != null && - widget.storeInfo.couponVOList[position].status == 0) { + widget.storeInfo.couponVOList[position] + .status == + 0) { widget.receiveCoupon( widget.storeInfo.couponVOList[position].id); } @@ -230,16 +241,18 @@ class _UnionCoupon extends State { height: 25.h, child: RoundButton( text: (widget.storeInfo != null && - widget.storeInfo.couponVOList != null && - widget.storeInfo.couponVOList[position].status > - 0) + widget.storeInfo.couponVOList != null && + widget.storeInfo.couponVOList[position] + .status > + 0) ? S.of(context).yilingqu : S.of(context).lingqu, textColor: Colors.white, backgroup: (widget.storeInfo != null && - widget.storeInfo.couponVOList != null && - widget.storeInfo.couponVOList[position].status > - 0) + widget.storeInfo.couponVOList != null && + widget.storeInfo.couponVOList[position] + .status > + 0) ? Colors.grey : Color(0xFF32A060), padding: EdgeInsets.symmetric( @@ -259,6 +272,4 @@ class _UnionCoupon extends State { ), ); } - - -} \ No newline at end of file +}