From f03e0d1309be5c9081ce37372289bb805a2c6695 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 16 Jun 2022 23:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E9=94=85=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mine_shop_details.dart | 2 +- lib/order/order_view/order_address.dart | 3 +++ lib/setting/account_security_page.dart | 4 ++- lib/setting/platform_code_page.dart | 5 +++- lib/settlement/settlement.dart | 27 ++++++++++--------- .../settlement_order_commodity.dart | 3 ++- lib/store/store_order.dart | 17 +++++++++--- pubspec.yaml | 2 +- 8 files changed, 42 insertions(+), 21 deletions(-) diff --git a/lib/mine/mine_shop_details.dart b/lib/mine/mine_shop_details.dart index c686ce79..7d4ab3bc 100644 --- a/lib/mine/mine_shop_details.dart +++ b/lib/mine/mine_shop_details.dart @@ -150,7 +150,7 @@ class _MineShopDetails extends State { Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( - title: "会员卡详情", + title: S.of(context).huiyuankaxiangqing, titleColor: Colors.black, background: Colors.white, brightness: Brightness.dark, diff --git a/lib/order/order_view/order_address.dart b/lib/order/order_view/order_address.dart index ff0b4857..7ff137ff 100644 --- a/lib/order/order_view/order_address.dart +++ b/lib/order/order_view/order_address.dart @@ -62,6 +62,7 @@ class _OrderAddress extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(widget?.orderInfo?.addressExt != null) Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -105,6 +106,7 @@ class _OrderAddress extends State { ), ], ), + if(widget?.orderInfo?.addressExt != null) Container( margin: EdgeInsets.only(left: 26.w), child: Text( @@ -120,6 +122,7 @@ class _OrderAddress extends State { ), ), ), + if(widget?.orderInfo?.addressExt != null) Visibility( visible: widget.orderStatus < 5 && widget.refundStatus == 0, child: Container( diff --git a/lib/setting/account_security_page.dart b/lib/setting/account_security_page.dart index e89a463d..f45254ef 100644 --- a/lib/setting/account_security_page.dart +++ b/lib/setting/account_security_page.dart @@ -39,6 +39,7 @@ class _AccountSecurityPage extends State { }); if (baseDate != null && baseDate.isSuccess) { userInfo = baseDate.data; + setState(() {}); SharedPreferences.getInstance().then( (value) => { value.setString('user', jsonEncode(baseDate.data)), @@ -105,8 +106,9 @@ class _AccountSecurityPage extends State { ), flex: 1, ), + if(userInfo?.hasPayPassword != null) Text( - "修改", + (userInfo?.hasPayPassword ?? true)? "修改" :"设置", style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.regular, diff --git a/lib/setting/platform_code_page.dart b/lib/setting/platform_code_page.dart index ac946d38..a2f92eda 100644 --- a/lib/setting/platform_code_page.dart +++ b/lib/setting/platform_code_page.dart @@ -62,7 +62,9 @@ class _PlatformCodePage extends State { "smsCode": code, }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { - codeType=4; + setState(() { + codeType=4; + }); SmartDialog.showToast(baseData.data, alignment: Alignment.center); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); @@ -230,6 +232,7 @@ class _PlatformCodePage extends State { color: Color(0xFF353535), ), radius: Radius.circular(4.r)), + keyboardType: TextInputType.text, ), ), GestureDetector( diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 98a9d460..38839c73 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:io'; import 'package:dio/dio.dart'; @@ -213,17 +214,16 @@ class _Settlement extends State { ///查看订单详情 queryOrderDetails(id) async { - print("ididididididid: $id"); - BaseData baseData = await minService.getOrderDetails({ - "id":pageType != null ? widget.arguments["orderId"] : parentId, - }).catchError((error) {}); - if (baseData != null && baseData.isSuccess) { - setState(() { - minOrderInfo = baseData.data; - }); - } else { - SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center); - } + BaseData baseData = await minService.getOrderDetails({ + "id": pageType != null ? widget.arguments["orderId"] : id??parentId, + }).catchError((error) {}); + if (baseData != null && baseData.isSuccess) { + setState(() { + minOrderInfo = baseData.data; + }); + } else { + SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center); + } } queryAddress(int selectedBtn) async { @@ -452,6 +452,7 @@ class _Settlement extends State { if (placeOrder) { // 结算 querySettlement(); + return; } else { if (parentId == "") { // 下单 @@ -473,8 +474,8 @@ class _Settlement extends State { if (baseData != null && baseData.isSuccess) { placeOrder = true; this.downOrder = DownOrder.fromJson(baseData.data); - queryOrderDetails( - (parentId == null || parentId == "") ? baseData.data.id : parentId); + parentId = this.downOrder.id??this.downOrder.parentId; + queryOrderDetails(parentId); setState(() {}); } else { SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 54c707b8..0516a33f 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -5,6 +5,7 @@ import 'package:huixiang/retrofit/data/activity_details.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart'; import 'package:huixiang/retrofit/data/order_product_vo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/separator.dart'; @@ -397,7 +398,7 @@ class _SettlementOrderCommodity extends State { String discountPrice(){ if(widget.minOrderInfo != null){ - return (widget.minOrderInfo.discountAmount ?? "0") + (widget.settleOrderInfo.benefitDiscountAmount ?? "0"); + return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.discountAmount ?? "0") + double.tryParse(widget.settleOrderInfo?.benefitDiscountAmount ?? "0")); }else if(widget.tableId < 0){ return "0"; }else { diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index c23105f1..e99443bc 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -207,7 +207,17 @@ class _StoreOrderPage extends State @override Widget build(BuildContext context) { - return Container( + return WillPopScope( + onWillPop: () async { + if (dialogShowing) { + debugPrint("ssssasdadsasdadasd"); + SmartDialog.dismiss(); + return false; + } else { + return true; + } + }, + child:Container( color: Colors.white, child: Stack( children: [ @@ -423,7 +433,8 @@ class _StoreOrderPage extends State ], controller: tabcontroller, ), - ), /*SmartRefresher( + ), + /*SmartRefresher( controller: refreshController = RefreshController(initialRefresh: false), enablePullDown: true, @@ -534,7 +545,7 @@ class _StoreOrderPage extends State ), ), ], - )); + ))); } ///领取优惠券 diff --git a/pubspec.yaml b/pubspec.yaml index 79c9a6ef..c6ce3987 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: 2.0.22+11 +version: 2.0.24+12 environment: sdk: ">=2.7.0 <3.0.0"