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

243
lib/settlement/settlement.dart

@ -115,43 +115,40 @@ class _Settlement extends State<Settlement> {
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<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) {
@ -219,17 +206,16 @@ class _Settlement extends State<Settlement> {
});
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<List<Address>> baseDate =
@ -274,17 +260,16 @@ class _Settlement extends State<Settlement> {
}
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<Settlement> {
});
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<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
@ -462,12 +441,11 @@ class _Settlement extends State<Settlement> {
}
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<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),
@ -691,28 +668,27 @@ class _Settlement extends State<Settlement> {
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<Settlement> {
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<Settlement> {
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<Settlement> {
);
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<Settlement> {
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);
}
}
}

Loading…
Cancel
Save