From 85be4f2f53cf5fc90b328dc72af7b02baf12c26f Mon Sep 17 00:00:00 2001
From: wurong <953969641@qq.com>
Date: Tue, 14 Nov 2023 10:21:23 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3json=3Dnull?=
 =?UTF-8?q?=E6=88=96=E8=80=85""=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B?=
 =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=8A=A5=E9=94=99=E6=96=87=E6=9C=AC?=
 =?UTF-8?q?=E9=97=AE=E9=A2=98;=20=E4=B8=8B=E5=8D=95=E9=A1=B5=E9=9D=A2?=
 =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8ui=E4=BC=98=E5=8C=96=E8=B0=83?=
 =?UTF-8?q?=E6=95=B4=EF=BC=9B=20=E4=BC=98=E6=83=A0=E5=88=B8=E9=A1=B5?=
 =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AE=E5=8F=AF?=
 =?UTF-8?q?=E7=94=A8=E9=97=A8=E5=BA=97=E6=97=B6=E6=96=B0=E5=A2=9E=E6=8F=90?=
 =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E7=A1=AE=E5=AE=9A=E6=8C=89=E9=92=AE=E9=80=82?=
 =?UTF-8?q?=E9=85=8D=E6=9B=B4=E6=94=B9=EF=BC=8C=E7=82=B9=E5=87=BB=E7=AB=8B?=
 =?UTF-8?q?=E5=8D=B3=E4=BD=BF=E7=94=A8=E7=81=AB=E9=94=85=E5=BA=97=E6=97=A0?=
 =?UTF-8?q?=E9=9C=80=E5=85=88=E6=89=AB=E7=A0=81=E5=86=8D=E8=B7=B3=E8=BD=AC?=
 =?UTF-8?q?=E8=87=B3=E5=BA=97=E9=93=BA=EF=BC=9B=20=E4=B8=8B=E5=8D=95?=
 =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?=
 =?UTF-8?q?=E5=A4=B1=E8=B4=A5ui=E5=A4=84=E7=90=86=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/retrofit/min_api.g.dart                |   8 +-
 lib/retrofit/retrofit_api.g.dart           |  12 +-
 lib/settlement/settlement.dart             |   6 +
 lib/settlement/settlement_view/coupon.dart |  11 +-
 lib/union/union_list.dart                  |   2 +-
 lib/union/union_select_city.dart           |   3 +-
 lib/view_widget/selector_store_dialog.dart | 123 ++++++++++++---------
 7 files changed, 92 insertions(+), 73 deletions(-)

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<SettleOrderInfo>.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<MinOrderInfo>.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<WxPay>.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<dynamic>.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<dynamic>.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<dynamic>.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<OrderInfo>.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<String>.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<bool>.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<Settlement> {
           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<CouponWidget> {
   @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<CouponWidget> {
                   //   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<CouponWidget> {
                               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<UnionList> 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<UnionSelectCity> {
       },
     ):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<SelectorStoreWidget> {
                   size: 18,
                 ),
               ),
-              SizedBox(width: 14),
+              SizedBox(width: 14.w),
             ],
           ),
           Container(
@@ -87,49 +87,55 @@ class _SelectorStoreWidget extends State<SelectorStoreWidget> {
             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<SelectorStoreWidget> {
               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<SelectorStoreWidget> {
   }
 
   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<SelectorStoreWidget> {
             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,