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,
null,
0,
widget.arguments["pid"] ?? (productId?? ""),
widget.arguments["pid"] ?? (productId ?? ""),
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
} else if (coupons != null && coupons != "" || tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
widget.arguments["cid"],
0,
productId?? null,
productId ?? null,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
} else
queryOrderInfo(
null,
@ -150,8 +148,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
});
weChatResponseEventHandler.listen((event) async {
@ -161,28 +158,18 @@ class _Settlement extends State<Settlement> {
}
///
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<SettleOrderInfo> 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) {
@ -223,13 +210,12 @@ class _Settlement extends State<Settlement> {
selectedBtn,
null,
0,
productId?? null,
productId ?? null,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
return;
}
BaseData<List<Address>> baseDate =
@ -278,13 +264,12 @@ class _Settlement extends State<Settlement> {
selectedBtn,
null,
0,
productId?? null,
productId ?? null,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
}
}
@ -305,13 +290,12 @@ class _Settlement extends State<Settlement> {
selectedBtn,
null,
0,
productId?? null,
productId ?? null,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
}
}
@ -404,14 +388,10 @@ class _Settlement extends State<Settlement> {
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<Settlement> {
if (placeOrder) {
//
querySettlement();
}
else{
} else {
if (parentId == "") {
//
baseData = await minService
@ -466,8 +445,7 @@ class _Settlement extends State<Settlement> {
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<Settlement> {
? 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<Settlement> {
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<Settlement> {
isTake,
memberCouponId,
orderId,
promotionId ?? (productId?? ""),
promotionId ?? (productId ?? ""),
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
}, queryAddress, storeInfo, address,
selectedAddress, pageType),
@ -709,8 +686,7 @@ class _Settlement extends State<Settlement> {
tableId,
),
if (placeOrder &&
joinA != JoinActivity.BargainBug)
if (placeOrder && joinA != JoinActivity.BargainBug)
///
PayMethod(payChannelCheck),
@ -783,7 +759,9 @@ class _Settlement extends State<Settlement> {
: queryPlaceOrderFirst();
},
),
SizedBox(width: 17,)
SizedBox(
width: 17,
)
],
),
),
@ -807,8 +785,7 @@ class _Settlement extends State<Settlement> {
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
}
mobileChange(String mobile) {
@ -843,7 +820,7 @@ class _Settlement extends State<Settlement> {
);
if (couponBean != null) {
this.couponListBean = couponBean;
coupons = couponListBean?.promotionName??"";
coupons = couponListBean?.promotionName ?? "";
promotions = "";
this.promotion = null;
queryOrderInfo(
@ -851,13 +828,12 @@ class _Settlement extends State<Settlement> {
selectedBtn,
couponListBean?.id,
0,
productId?? null,
productId ?? null,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
}
}
@ -881,13 +857,12 @@ class _Settlement extends State<Settlement> {
selectedBtn,
null,
0,
promotion != null ? promotion.id : (productId?? null),
promotion != null ? promotion.id : (productId ?? null),
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
count1,
payChannel
);
payChannel);
}
}
}

Loading…
Cancel
Save