From 57897e9a08783622aef477fdf9e2b57a2976e997 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 16 May 2022 14:54:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/home_view/featured_acticvity.dart | 65 ++++++++++++---------- lib/main_page.dart | 6 +- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 3 +- lib/view_widget/update_dialog.dart | 6 +- pubspec.yaml | 2 +- 6 files changed, 43 insertions(+), 41 deletions(-) diff --git a/lib/home/home_view/featured_acticvity.dart b/lib/home/home_view/featured_acticvity.dart index 0e7b41d9..a53fbca4 100644 --- a/lib/home/home_view/featured_acticvity.dart +++ b/lib/home/home_view/featured_acticvity.dart @@ -197,38 +197,43 @@ class _FeaturedActivity extends State { ], ), ), - Container( - width: 48.w, - margin: EdgeInsets.only(left: 8, bottom: 8), - padding: EdgeInsets.symmetric( - vertical: 4.h, - horizontal: 8.w, - ), - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(20), - ), - alignment: Alignment.center, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "了解", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.medium, - color: Colors.white, - ), + Row( + children: [ + Container( + // width: 52.w, + margin: EdgeInsets.only(left: 8, bottom: 8), + padding: EdgeInsets.symmetric( + vertical: 4.h, + horizontal: 8.w, ), - Icon( - Icons.keyboard_arrow_right, - color: Colors.white, - size: 12, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(20), ), - ], - ), - ), + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "了解", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: Colors.white, + size: 12, + ), + ], + ), + ), + Spacer() + ], + ) ], )); } diff --git a/lib/main_page.dart b/lib/main_page.dart index 86870f12..4df0ed88 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -337,10 +337,10 @@ class _MainPage extends State with WidgetsBindingObserver { PackageInfo packageInfo = await PackageInfo.fromPlatform(); BaseData baseData = await apiService.appVersion().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { - baseData.data.appLastVersion = "1.0.5"; - baseData.data.appLastVersionUp = "1.0.1"; + // baseData.data.appLastVersion = "1.0.95"; + // baseData.data.appLastVersionUp = "1.0.95"; if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion) - && AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){ + && AppUtils.versionCompare(value.getString("appLastVersion"),baseData.data?.appLastVersion)){ showDialog( context: context, barrierDismissible: false, diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 5868e31d..cc2cfcbc 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -32,7 +32,7 @@ part 'min_api.g.dart'; // const base_url = "http://192.168.10.37:8765/app/"; -const localBaseUrl = "http://192.168.10.236:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.236:8765/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 75508c21..252cd821 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -170,8 +170,7 @@ abstract class ApiService { @Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo); /// 周边搜索 - @GET( - "https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") + @GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") Future searchPoi(@Path("lat") String lat, @Path("lng") String lng, @Path("keywords") String keywords, int size, int page); diff --git a/lib/view_widget/update_dialog.dart b/lib/view_widget/update_dialog.dart index 3e93e1ad..a3d3cd4c 100644 --- a/lib/view_widget/update_dialog.dart +++ b/lib/view_widget/update_dialog.dart @@ -102,9 +102,7 @@ class _UpdateDialog extends State { Expanded( child: InkWell( onTap: () { - (Theme.of(context).platform == TargetPlatform.android) ? - androidUpdate():Bridge.toAppStore().then((value) { - }); + updateApp(); // Navigator.of(context).pop(); }, child: Container( @@ -139,7 +137,7 @@ class _UpdateDialog extends State { Navigator.of(context).pop(); } - androidUpdate() async { + updateApp() async { String url = Platform.isIOS ? "itms-apps://itunes.apple.com/app/id1575124838":"http://application.lotus-wallet.com/huixaing?release_id=627cadff23389f2fe6d57cb1"; if (await canLaunch(url)) { await launch(url); diff --git a/pubspec.yaml b/pubspec.yaml index 67e729b8..866f830d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.1+2 +version: 1.0.94+3 environment: sdk: ">=2.7.0 <3.0.0" From cdf598af659077f5f5f9d3090a7f81b7a2180704 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Tue, 17 May 2022 17:25:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=BD=8D=E7=BD=AEnull=E8=A7=A3=E5=86=B3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/login/login_page.dart | 3 ++- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/retrofit/retrofit_api.g.dart | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 490debd7..dd55456d 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -343,7 +343,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { EasyLoading.dismiss(); } else { - // SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); + if(value?.msg !=null) + SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); } }); } diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index cc2cfcbc..623d8cb2 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -102,7 +102,7 @@ abstract class MinApiService { } } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { ///高德地图的poi服务请求不需要toast - SmartDialog.showToast(map["msg"], alignment: Alignment.center); + // SmartDialog.showToast(map["msg"], alignment: Alignment.center); } debugPrint( "======================= Min_响应数据结束 =======================\n"); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 252cd821..cdc46026 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -130,7 +130,7 @@ abstract class ApiService { } } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { ///高德地图的poi服务请求不需要toast - SmartDialog.showToast(map["msg"], alignment: Alignment.center); + // SmartDialog.showToast(map["msg"], alignment: Alignment.center); } debugPrint("======================= 响应数据结束 =======================\n"); }, onError: (DioError e) { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index ac8c7fa4..f161e0ee 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -92,7 +92,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => LoginInfo.fromJson(json), + (json) => json==""?null :LoginInfo.fromJson(json), ); return value; } From 93c7c0205a865d305903a5f21aaab4b8530190b3 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 18 May 2022 14:00:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E6=83=A0=E6=9B=B4=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main_page.dart | 2 +- lib/retrofit/data/settleOrderInfo.dart | 6 +++ lib/settlement/settlement.dart | 60 +++++++++++++++++--------- lib/store/store_order.dart | 4 +- 4 files changed, 49 insertions(+), 23 deletions(-) diff --git a/lib/main_page.dart b/lib/main_page.dart index 4df0ed88..9d2814ea 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -340,7 +340,7 @@ class _MainPage extends State with WidgetsBindingObserver { // baseData.data.appLastVersion = "1.0.95"; // baseData.data.appLastVersionUp = "1.0.95"; if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion) - && AppUtils.versionCompare(value.getString("appLastVersion"),baseData.data?.appLastVersion)){ + && AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){ showDialog( context: context, barrierDismissible: false, diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index 1504d4f0..d045b833 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -16,6 +16,8 @@ class SettleOrderInfo { String threshold; String freePostAge; List orderProductList; + String promotionId; + String memberCouponId; static SettleOrderInfo fromJson(Map map) { if (map == null) return null; @@ -40,6 +42,8 @@ class SettleOrderInfo { settleOrderInfoBean.orderProductList = List()..addAll( (map['orderProductList'] as List ?? []).map((o) => OrderProductVOList.fromJson(o)) ); + settleOrderInfoBean.promotionId = map['promotionId']; + settleOrderInfoBean.memberCouponId = map['memberCouponId']; return settleOrderInfoBean; } @@ -58,6 +62,8 @@ class SettleOrderInfo { "threshold": threshold, "freePostAge": freePostAge, "orderProductList": orderProductList, + "promotionId": promotionId, + "memberCouponId": memberCouponId, }; } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 6e0626cf..215f5cfc 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -89,7 +89,7 @@ class _Settlement extends State { tenant: tenant, storeId: storeId, showLoading: true); - if (promotions != null && promotions != "" || tableId <= 0) { + if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, selectedBtn, @@ -98,7 +98,7 @@ class _Settlement extends State { widget.arguments["pid"], payChannel ); - } else if (coupons != null && coupons != "" || tableId <= 0) { + } else if (coupons != null && coupons != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, selectedBtn, @@ -134,9 +134,29 @@ class _Settlement extends State { "promotionId": promotionId, "payChannel": payChannel }).catchError((error) {}); + this.promotion = null; + promotions = ""; + this.couponListBean = null; + coupons = ""; if (baseData != null && baseData.isSuccess) { setState(() { settleOrderInfo = baseData.data; + if((settleOrderInfo?.promotionId??"")!=""){ + settleOrderInfo.promotionInfoList.forEach((element) { + if(element.id == settleOrderInfo.promotionId){ + this.promotion = element; + promotions = promotion?.name ?? ""; + } + }); + } + if((settleOrderInfo?.memberCouponId??"")!=""){ + settleOrderInfo.couponList.forEach((element) { + if(element.id == settleOrderInfo.memberCouponId){ + this.couponListBean = element; + coupons = couponListBean?.promotionName ?? ""; + } + }); + } if (settleOrderInfo.orderProductList == null || settleOrderInfo.orderProductList.length == 0) { placeOrder = true; @@ -468,8 +488,8 @@ class _Settlement extends State { couponCart, activityCart, settleOrderInfo, - payChannel == 4 ? null : coupons, - payChannel == 4 ? null : promotions, + coupons, + promotions, couponCount(), placeOrder, remakers, @@ -562,9 +582,9 @@ class _Settlement extends State { queryOrderInfo( address?.id, selectedBtn, - payChannel == 4 ? null : couponListBean?.id, + couponListBean?.id, 0, - payChannel == 4 ? null : promotion?.id, + promotion?.id, payChannel ); } @@ -599,20 +619,20 @@ class _Settlement extends State { couponBean: couponListBean); }, ); - if (couponBean != null) { - this.couponListBean = couponBean; - coupons = couponListBean?.promotionName ?? ""; - promotions = ""; - this.promotion = null; + // if (couponBean != null) { + // this.couponListBean = couponBean; + // coupons = couponListBean?.promotionName ?? ""; + // promotions = ""; + // this.promotion = null; queryOrderInfo( address?.id, selectedBtn, - couponListBean?.id, + couponBean?.id, 0, null, payChannel ); - } + // } } ///活动弹窗 @@ -625,19 +645,19 @@ class _Settlement extends State { return SettlementActivity(settleOrderInfo, storeInfo); }, ); - if (pro != null) { - this.promotion = pro; - promotions = promotion?.name ?? ""; - coupons = ""; - this.couponListBean = null; + // if (pro != null) { + // this.promotion = pro; + // promotions = promotion?.name ?? ""; + // coupons = ""; + // this.couponListBean = null; queryOrderInfo( address?.id, selectedBtn, null, 0, - promotion?.id, + pro?.id, payChannel ); - } + // } } } diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 9523df4c..082045bf 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -566,9 +566,9 @@ class _StoreOrderPage extends State "tableId": tableId, "parentCode": parentCode, "parentId": parentId, - "pName": pName, + // "pName": pName, "pid": pid, - "cName": cName, + // "cName": cName, "cid": cid, "shoppingCart": shopCarGoods, "numberOfPeople": numberOfPeople,