w-R 3 years ago
parent
commit
a9fd2c4dec
  1. 93
      lib/settlement/settlement.dart

93
lib/settlement/settlement.dart

@ -119,26 +119,24 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
widget.arguments["pid"] ?? (productId?? ""), widget.arguments["pid"] ?? (productId ?? ""),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
} else if (coupons != null && coupons != "" || tableId <= 0) { } else if (coupons != null && coupons != "" || tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
selectedBtn, selectedBtn,
widget.arguments["cid"], widget.arguments["cid"],
0, 0,
productId?? null, productId ?? null,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
} else } else
queryOrderInfo( queryOrderInfo(
null, null,
@ -150,8 +148,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
}); });
weChatResponseEventHandler.listen((event) async { weChatResponseEventHandler.listen((event) async {
@ -161,28 +158,18 @@ class _Settlement extends State<Settlement> {
} }
/// ///
queryOrderInfo( queryOrderInfo(addressId, isTake, memberCouponId, orderId, promotionId,
addressId, productSkuId, actProductId, actProductSkuId, buyNum, payChannel) async {
isTake,
memberCouponId,
orderId,
promotionId,
productSkuId,
actProductId,
actProductSkuId,
buyNum,
payChannel
) async {
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId, "addressId": addressId,
"isTake": isTake, "isTake": isTake,
"memberCouponId": memberCouponId, "memberCouponId": memberCouponId,
"orderId": orderId, "orderId": orderId,
"promotionId": promotionId, "promotionId": promotionId,
"productSkuId":productSkuId, "productSkuId": productSkuId,
"actProductId": actProductId, "actProductId": actProductId,
"actProductSkuId": actProductSkuId, "actProductSkuId": actProductSkuId,
"buyNum":buyNum, "buyNum": buyNum,
"payChannel": payChannel "payChannel": payChannel
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -223,13 +210,12 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
productId?? null, productId ?? null,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
return; return;
} }
BaseData<List<Address>> baseDate = BaseData<List<Address>> baseDate =
@ -278,13 +264,12 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
productId?? null, productId ?? null,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
} }
} }
@ -305,13 +290,12 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
productId?? null, productId ?? null,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
} }
} }
@ -404,14 +388,10 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.payChannel = payChannel; placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId = placeOrderFirst.promotionInfoDTO.promotionId =
(promotion != null && tableId <= 0) (promotion != null && tableId <= 0) ? promotion.id : "";
? promotion.id
: "";
// : widget.arguments["pid"] ?? ""; // : widget.arguments["pid"] ?? "";
placeOrderFirst.promotionInfoDTO.couponId = placeOrderFirst.promotionInfoDTO.couponId =
(couponListBean != null && tableId <= 0) (couponListBean != null && tableId <= 0) ? couponListBean.id : "";
? couponListBean.id
: "";
// : widget.arguments["cid"] ?? ""; // : widget.arguments["cid"] ?? "";
placeOrderFirst.recMobile = placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; (mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
@ -442,8 +422,7 @@ class _Settlement extends State<Settlement> {
if (placeOrder) { if (placeOrder) {
// //
querySettlement(); querySettlement();
} } else {
else{
if (parentId == "") { if (parentId == "") {
// //
baseData = await minService baseData = await minService
@ -466,8 +445,7 @@ class _Settlement extends State<Settlement> {
queryOrderDetails( queryOrderDetails(
(parentId == null || parentId == "") ? baseData.data.id : parentId); (parentId == null || parentId == "") ? baseData.data.id : parentId);
setState(() {}); setState(() {});
} } else {
else {
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); SmartDialog.showToast(baseData?.msg, alignment: Alignment.center);
} }
} }
@ -480,7 +458,7 @@ class _Settlement extends State<Settlement> {
? minOrderInfo.orderProductVOList ? minOrderInfo.orderProductVOList
: downOrder.orderProductVOList; : downOrder.orderProductVOList;
if (placeOrderFirst.payChannel == 1) { if (placeOrderFirst.payChannel == 1) {
if(Platform.isAndroid){ if (Platform.isAndroid) {
if (!(await Min.isInitialize())) { if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调 // app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针 // getPackage空指针
@ -647,8 +625,8 @@ class _Settlement extends State<Settlement> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
DistributionMode((addressId, isTake, DistributionMode((addressId, isTake, memberCouponId,
memberCouponId, orderId, promotionId) { orderId, promotionId) {
setState(() { setState(() {
this.selectedBtn = 0; this.selectedBtn = 0;
}); });
@ -657,13 +635,12 @@ class _Settlement extends State<Settlement> {
isTake, isTake,
memberCouponId, memberCouponId,
orderId, orderId,
promotionId ?? (productId?? ""), promotionId ?? (productId ?? ""),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
}, queryAddress, storeInfo, address, }, queryAddress, storeInfo, address,
selectedAddress, pageType), selectedAddress, pageType),
@ -709,8 +686,7 @@ class _Settlement extends State<Settlement> {
tableId, tableId,
), ),
if (placeOrder && if (placeOrder && joinA != JoinActivity.BargainBug)
joinA != JoinActivity.BargainBug)
/// ///
PayMethod(payChannelCheck), PayMethod(payChannelCheck),
@ -783,7 +759,9 @@ class _Settlement extends State<Settlement> {
: queryPlaceOrderFirst(); : queryPlaceOrderFirst();
}, },
), ),
SizedBox(width: 17,) SizedBox(
width: 17,
)
], ],
), ),
), ),
@ -807,8 +785,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
} }
mobileChange(String mobile) { mobileChange(String mobile) {
@ -843,7 +820,7 @@ class _Settlement extends State<Settlement> {
); );
if (couponBean != null) { if (couponBean != null) {
this.couponListBean = couponBean; this.couponListBean = couponBean;
coupons = couponListBean?.promotionName??""; coupons = couponListBean?.promotionName ?? "";
promotions = ""; promotions = "";
this.promotion = null; this.promotion = null;
queryOrderInfo( queryOrderInfo(
@ -851,13 +828,12 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
couponListBean?.id, couponListBean?.id,
0, 0,
productId?? null, productId ?? null,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
} }
} }
@ -881,13 +857,12 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
null, null,
0, 0,
promotion != null ? promotion.id : (productId?? null), promotion != null ? promotion.id : (productId ?? null),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
count1, count1,
payChannel payChannel);
);
} }
} }
} }

Loading…
Cancel
Save