diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 9e69bad1..eb3d0305 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -115,43 +115,40 @@ class _Settlement extends State { showLoading: true); if (promotions != null && promotions != "" || tableId <= 0) { queryOrderInfo( - address != null ? address.id : null, - selectedBtn, - null, - 0, - widget.arguments["pid"] ?? (productId?? ""), - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + address != null ? address.id : null, + selectedBtn, + null, + 0, + widget.arguments["pid"] ?? (productId ?? ""), + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); } else if (coupons != null && coupons != "" || tableId <= 0) { queryOrderInfo( - address != null ? address.id : null, - selectedBtn, - widget.arguments["cid"], - 0, - productId?? null, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + address != null ? address.id : null, + selectedBtn, + widget.arguments["cid"], + 0, + productId ?? null, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); } else queryOrderInfo( - null, - selectedBtn, - null, - 0, - productId ?? null, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + null, + selectedBtn, + null, + 0, + productId ?? null, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); }); weChatResponseEventHandler.listen((event) async { @@ -161,28 +158,18 @@ class _Settlement extends State { } ///订单结算信息 - queryOrderInfo( - addressId, - isTake, - memberCouponId, - orderId, - promotionId, - productSkuId, - actProductId, - actProductSkuId, - buyNum, - payChannel - ) async { + queryOrderInfo(addressId, isTake, memberCouponId, orderId, promotionId, + productSkuId, actProductId, actProductSkuId, buyNum, payChannel) async { BaseData baseData = await minService.getOrderInfo({ "addressId": addressId, "isTake": isTake, "memberCouponId": memberCouponId, "orderId": orderId, "promotionId": promotionId, - "productSkuId":productSkuId, + "productSkuId": productSkuId, "actProductId": actProductId, "actProductSkuId": actProductSkuId, - "buyNum":buyNum, + "buyNum": buyNum, "payChannel": payChannel }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { @@ -219,17 +206,16 @@ class _Settlement extends State { }); if (address != null) { queryOrderInfo( - address.id, - selectedBtn, - null, - 0, - productId?? null, + address.id, + selectedBtn, + null, + 0, + productId ?? null, productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); return; } BaseData> baseDate = @@ -274,17 +260,16 @@ class _Settlement extends State { } queryOrderInfo( - address.id, - selectedBtn, - null, - 0, - productId?? null, + address.id, + selectedBtn, + null, + 0, + productId ?? null, productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); } } @@ -301,17 +286,16 @@ class _Settlement extends State { }); queryOrderInfo( - address.id, - selectedBtn, - null, - 0, - productId?? null, + address.id, + selectedBtn, + null, + 0, + productId ?? null, productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); } } @@ -404,14 +388,10 @@ class _Settlement extends State { placeOrderFirst.payChannel = payChannel; placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); placeOrderFirst.promotionInfoDTO.promotionId = - (promotion != null && tableId <= 0) - ? promotion.id - : ""; + (promotion != null && tableId <= 0) ? promotion.id : ""; // : widget.arguments["pid"] ?? ""; placeOrderFirst.promotionInfoDTO.couponId = - (couponListBean != null && tableId <= 0) - ? couponListBean.id - : ""; + (couponListBean != null && tableId <= 0) ? couponListBean.id : ""; // : widget.arguments["cid"] ?? ""; placeOrderFirst.recMobile = (mobile == null || mobile == "") ? mobile : storeInfo.headMobile; @@ -442,8 +422,7 @@ class _Settlement extends State { if (placeOrder) { // 结算 querySettlement(); - } - else{ + } else { if (parentId == "") { // 下单 baseData = await minService @@ -462,12 +441,11 @@ class _Settlement extends State { } if (baseData != null && baseData.isSuccess) { placeOrder = true; - this.downOrder = DownOrder.fromJson(baseData.data); + this.downOrder = DownOrder.fromJson(baseData.data); queryOrderDetails( (parentId == null || parentId == "") ? baseData.data.id : parentId); setState(() {}); - } - else { + } else { SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); } } @@ -480,7 +458,7 @@ class _Settlement extends State { ? minOrderInfo.orderProductVOList : downOrder.orderProductVOList; if (placeOrderFirst.payChannel == 1) { - if(Platform.isAndroid){ + if (Platform.isAndroid) { if (!(await Min.isInitialize())) { // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, @@ -647,8 +625,8 @@ class _Settlement extends State { child: Container( child: Column( children: [ - DistributionMode((addressId, isTake, - memberCouponId, orderId, promotionId) { + DistributionMode((addressId, isTake, memberCouponId, + orderId, promotionId) { setState(() { this.selectedBtn = 0; }); @@ -657,13 +635,12 @@ class _Settlement extends State { isTake, memberCouponId, orderId, - promotionId ?? (productId?? ""), + promotionId ?? (productId ?? ""), productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", count1, - payChannel - ); + payChannel); }, queryAddress, storeInfo, address, selectedAddress, pageType), @@ -691,28 +668,27 @@ class _Settlement extends State { couponCart, activityCart, settleOrderInfo, - payChannel == 4 ? null : coupons, - payChannel == 4 ? null : promotions, + payChannel == 4 ? null : coupons, + payChannel == 4 ? null : promotions, couponCount(), placeOrder, remakers, - () { + () { Navigator.of(context).pushNamed( '/router/edit_remarks_page', arguments: {}, ).then((value) => { - setState(() { - if (value != null) remakers = value; - }) - }); + setState(() { + if (value != null) remakers = value; + }) + }); }, tableId, ), - if (placeOrder && - joinA != JoinActivity.BargainBug) + if (placeOrder && joinA != JoinActivity.BargainBug) - ///支付方式 + ///支付方式 PayMethod(payChannelCheck), ], ), @@ -776,14 +752,16 @@ class _Settlement extends State { callback: () { pageType != null ? bargainOrderId != null - ? activityPay() - : joinA == JoinActivity.GoJoin - ? queryJoinAct() - : queryLaunchAct() + ? activityPay() + : joinA == JoinActivity.GoJoin + ? queryJoinAct() + : queryLaunchAct() : queryPlaceOrderFirst(); }, ), - SizedBox(width: 17,) + SizedBox( + width: 17, + ) ], ), ), @@ -800,15 +778,14 @@ class _Settlement extends State { queryOrderInfo( address?.id, selectedBtn, - payChannel == 4 ? null : couponListBean?.id, + payChannel == 4 ? null : couponListBean?.id, 0, - payChannel == 4 ? null : promotion?.id, + payChannel == 4 ? null : promotion?.id, productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", count1, - payChannel - ); + payChannel); } mobileChange(String mobile) { @@ -843,21 +820,20 @@ class _Settlement extends State { ); if (couponBean != null) { this.couponListBean = couponBean; - coupons = couponListBean?.promotionName??""; + coupons = couponListBean?.promotionName ?? ""; promotions = ""; this.promotion = null; queryOrderInfo( - address?.id, - selectedBtn, - couponListBean?.id, - 0, - productId?? null, + address?.id, + selectedBtn, + couponListBean?.id, + 0, + productId ?? null, productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); } } @@ -877,17 +853,16 @@ class _Settlement extends State { coupons = ""; this.couponListBean = null; queryOrderInfo( - address?.id, - selectedBtn, - null, - 0, - promotion != null ? promotion.id : (productId?? null), + address?.id, + selectedBtn, + null, + 0, + promotion != null ? promotion.id : (productId ?? null), productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - count1, - payChannel - ); + actProductId ?? "", + actProductSkuId ?? "", + count1, + payChannel); } } }