diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 215825a0..bb860d8e 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -219,7 +219,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json == "" ? null :SettleOrderInfo.fromJson(json), + (json) => ((json??"") == "")? null :SettleOrderInfo.fromJson(json), ); return value; } @@ -242,7 +242,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json==null?null:MinOrderInfo.fromJson(json), + (json) => ((json??"") == "")?null:MinOrderInfo.fromJson(json), ); return value; } @@ -331,7 +331,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json==null?null:(WxPay.fromJson(json)), + (json) => ((json??"") == "")?null:(WxPay.fromJson(json)), ); return value; } @@ -353,7 +353,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json==null?null:(json as dynamic), + (json) => ((json??"") == "")?null:(json as dynamic), ); return value; } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 570b2739..db98afb0 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -90,7 +90,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json == null ? null : json, + (json) => ((json??"") == "")? null : json, ); return value; } @@ -133,7 +133,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json == null ? null :json as dynamic, + (json) => ((json??"") == "")? null :json as dynamic, ); return value; } @@ -355,7 +355,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json == null ? null : json as dynamic, + (json) => ((json??"") == "")? null : json as dynamic, ); return value; } @@ -910,7 +910,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json == null ? null : OrderInfo.fromJson(json), + (json) => ((json??"") == "")? null : OrderInfo.fromJson(json), ); return value; } @@ -1312,7 +1312,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json == null ? null : (json as String), + (json) => ((json??"") == "")? null : (json as String), ); return value; } @@ -1335,7 +1335,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => (json ?? "") == "" ? null : (json as bool), + (json) => ((json??"") == "")? null : (json as bool), ); return value; } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 9aef543d..6d24a134 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -716,6 +716,12 @@ class _Settlement extends State { timeStamp: int.tryParse(wxPay.timeStamp), sign: wxPay.sign, ); + }else{ + EasyLoading.dismiss(); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + Future.delayed(Duration(seconds:2), () { + toOrderDetails(placeOrderFirst.id); + }); } } else { BaseData baseData = await minService diff --git a/lib/settlement/settlement_view/coupon.dart b/lib/settlement/settlement_view/coupon.dart index e5eec726..c5b0ce06 100644 --- a/lib/settlement/settlement_view/coupon.dart +++ b/lib/settlement/settlement_view/coupon.dart @@ -30,7 +30,7 @@ class _CouponWidget extends State { @override Widget build(BuildContext context) { return Container( - height: 170, + height: 170.h, width: double.infinity, decoration: BoxDecoration( color: Colors.white, @@ -102,12 +102,9 @@ class _CouponWidget extends State { // flex: 1, // ), SizedBox( - width: 8, - ), - couponListWidget(context), - SizedBox( - width: 5, + width: 8.w, ), + Expanded(child: couponListWidget(context)), Expanded( flex: 2, child: Column( @@ -121,7 +118,7 @@ class _CouponWidget extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(2), border: Border.all( - width: 1, + width: 1.w, color: Color(0xFFFF7A1A), style: BorderStyle.solid, ), diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index 140d3439..a32272ab 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -104,7 +104,7 @@ class _UnionList extends State with AutomaticKeepAliveClientMixin { src: "assets/image/di_zhi.webp", isShowBtn: false, text: ((widget.city??"") != "武汉" && (widget.city??"") != "郑州" && (widget.city??"") != "北京") ? - " 当前回乡开放门店 仅包含 武汉/北京/郑州,您当前的位置无法获取,请手动更换城市" :"暂无店铺列表~", + " 当前海峡姐妹开放门店 仅包含 武汉/北京/郑州,您当前的位置无法获取,请手动更换城市" :"暂无店铺列表~", fontSize: 16.sp, margin: EdgeInsets.only(top: 120.h,left:45.w,right:45.w), ) diff --git a/lib/union/union_select_city.dart b/lib/union/union_select_city.dart index 5856b5b4..11ece4f0 100644 --- a/lib/union/union_select_city.dart +++ b/lib/union/union_select_city.dart @@ -286,7 +286,8 @@ class _UnionSelectCity extends State { }, ):Padding(padding:EdgeInsets.only(top:12.h), child: Text( - "抱歉,未找到相关位置,可尝试修改后重试", + // "抱歉,未找到相关位置,可尝试修改后重试", + "抱歉,该城市未开设门店,可尝试修改后重试", style: TextStyle( color: Color(0xFF4D4D4D), fontWeight: MyFontWeight.medium, diff --git a/lib/view_widget/selector_store_dialog.dart b/lib/view_widget/selector_store_dialog.dart index 87fc9cef..8aefc7b0 100644 --- a/lib/view_widget/selector_store_dialog.dart +++ b/lib/view_widget/selector_store_dialog.dart @@ -78,7 +78,7 @@ class _SelectorStoreWidget extends State { size: 18, ), ), - SizedBox(width: 14), + SizedBox(width: 14.w), ], ), Container( @@ -87,49 +87,55 @@ class _SelectorStoreWidget extends State { color: Color(0xFFF2F2F2), margin: EdgeInsets.only(bottom: 11.h), ), - Expanded(child: - Container( + Expanded( + child: Container( height: (widget.stores != null - ? (widget.stores.length > 4 ? 4 : widget.stores.length) - : 0) * + ? (widget.stores.length > 4 ? 4 : widget.stores.length) + : 0) * 60.h, child: (widget.stores == null || widget.stores.length == 0) - ? Padding(padding:EdgeInsets.symmetric(horizontal: 16.w), - child: Text( - "该优惠券未设置适用门店,适用情况请查看使用详情", - textAlign: TextAlign.center, - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 14.sp, - color: Colors.black, - ), - ),) + ? Padding( + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Text( + "该优惠券未设置适用门店,适用情况请查看使用详情", + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Colors.black, + ), + ), + ) : ListView.builder( - physics: BouncingScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: (){ - setState(() { - selectIndex = position; - }); - }, - child: storeItem(widget.stores[position], position), - ); - }, - itemCount: widget.stores != null ? widget.stores.length : 0, - ), + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + setState(() { + selectIndex = position; + }); + }, + child: storeItem(widget.stores[position], position), + ); + }, + itemCount: widget.stores != null ? widget.stores.length : 0, + ), )), GestureDetector( - onTap: (){ - if (widget.stores[selectIndex].posType.code == - "NORMALSTORE") { - Scan.toScan( - context, - widget.stores[selectIndex].id, - widget.stores[selectIndex].tenantCode, - widget.stores[selectIndex].storeName, - ); - } else { + onTap: () { + if (widget.stores == null || widget.stores.length == 0) { + Navigator.of(context).pop(); + } + // if (widget.stores[selectIndex].posType.code == + // "NORMALSTORE") { + // Scan.toScan( + // context, + // widget.stores[selectIndex].id, + // widget.stores[selectIndex].tenantCode, + // widget.stores[selectIndex].storeName, + // ); + // } + else { Navigator.of(context).pushReplacementNamed( '/router/store_order', arguments: { @@ -145,10 +151,11 @@ class _SelectorStoreWidget extends State { height: 40.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), - color:Color(0xFF32A060), + color: Color(0xFF32A060), ), alignment: Alignment.center, - margin: EdgeInsets.only(top: 14.h,bottom: 30.h,left: 16.w,right: 16.w), + margin: EdgeInsets.only( + top: 14.h, bottom: 30.h, left: 16.w, right: 16.w), child: Text( S.of(context).queding, style: TextStyle( @@ -226,9 +233,9 @@ class _SelectorStoreWidget extends State { } Widget storeItem(Store store, position) { - return Container( - height:52 , - margin: EdgeInsets.only(bottom: 12,left: 14,right: 14), + return Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12.h, left: 14.w, right: 14.w), child: Stack( alignment: Alignment.bottomRight, children: [ @@ -238,29 +245,37 @@ class _SelectorStoreWidget extends State { decoration: BoxDecoration( borderRadius: new BorderRadius.circular(6), border: Border.all( - color: position == selectIndex ? Color(0xFF32A060):Color(0xFFF7F7F7), - width: position == selectIndex ? 1 :0, + color: position == selectIndex + ? Color(0xFF32A060) + : Color(0xFFF7F7F7), + width: position == selectIndex ? 1 : 0, ), - color: position == selectIndex ? Color(0xFFF0FAF4) :Color(0xFFF7F7F7), + color: position == selectIndex + ? Color(0xFFF0FAF4) + : Color(0xFFF7F7F7), ), alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 12,), + padding: EdgeInsets.only( + left: 12, + ), child: Text( store.storeName, style: TextStyle( fontWeight: MyFontWeight.bold, fontSize: 15.sp, - color: position == selectIndex ?Color(0xFF32A060) : Color(0xFF0D0D0D), + color: position == selectIndex + ? Color(0xFF32A060) + : Color(0xFF0D0D0D), ), ), ), if (position == selectIndex) - Image.asset( - "assets/image/recharge.webp", - width: 20, - height: 20, - fit: BoxFit.fill, - ), + Image.asset( + "assets/image/recharge.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), // MImage( // store.logo, // width: 28.w,