Browse Source

Merge branch 'dev' into wr_2023_business

# Conflicts:
#	lib/settlement/settlement.dart
wr_2023_business
wurong 1 year ago
parent
commit
32cb5cce40
  1. 108
      lib/settlement/settlement.dart

108
lib/settlement/settlement.dart

@ -140,9 +140,7 @@ class _Settlement extends State<Settlement> {
storeId: storeId, storeId: storeId,
showLoading: false); showLoading: false);
queryMemberInfo(); queryMemberInfo();
if (widget.arguments["pid"] != null && if (widget.arguments["pid"] != null && widget.arguments["pid"] != "" && tableId <= 0) {
widget.arguments["pid"] != "" &&
tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
@ -163,9 +161,7 @@ class _Settlement extends State<Settlement> {
count1, count1,
payChannel, payChannel,
tableId); tableId);
} else if (widget.arguments["cid"] != null && } else if ( widget.arguments["cid"] != null && widget.arguments["cid"] != "" && tableId <= 0) {
widget.arguments["cid"] != "" &&
tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
@ -174,7 +170,7 @@ class _Settlement extends State<Settlement> {
selectedBtn != 2) selectedBtn != 2)
? diningStatus ? diningStatus
: selectedBtn, : selectedBtn,
widget.arguments["cid"] ?? 0, widget.arguments["cid"]??0,
0, 0,
productId ?? 0, productId ?? 0,
productSkuId ?? "", productSkuId ?? "",
@ -232,9 +228,7 @@ class _Settlement extends State<Settlement> {
payChannel, payChannel,
tableId) async { tableId) async {
try { try {
EasyLoading.show( EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({
"addressId": addressId, "addressId": addressId,
@ -335,8 +329,7 @@ class _Settlement extends State<Settlement> {
/// ///
queryOrderDetails(id) async { queryOrderDetails(id) async {
EasyLoading.show( EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({
"id": pageType != null ? widget.arguments["orderId"] : id ?? parentId, "id": pageType != null ? widget.arguments["orderId"] : id ?? parentId,
}).catchError((error) {}); }).catchError((error) {});
@ -565,8 +558,7 @@ class _Settlement extends State<Settlement> {
/// ///
queryPlaceOrderFirst() async { queryPlaceOrderFirst() async {
try { try {
EasyLoading.show( EasyLoading.show(status: S.current.zhengzaijiazai,
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
// for (int i = 0; i < settleOrderInfo.orderProductList.length; i++) { // for (int i = 0; i < settleOrderInfo.orderProductList.length; i++) {
// settleOrderInfo.orderProductList.forEach((element1) { // settleOrderInfo.orderProductList.forEach((element1) {
@ -582,20 +574,22 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.cartSum = settleOrderInfo.price; placeOrderFirst.cartSum = settleOrderInfo.price;
placeOrderFirst.addressId = address == null ? null : address.id; placeOrderFirst.addressId = address == null ? null : address.id;
placeOrderFirst.isSubscribe = placeOrderFirst.isSubscribe =
((subscribeParam?.isEnableSubscribe ?? false) == true) ((subscribeParam?.isEnableSubscribe ?? false) == true)
? true ? true
: false; // : false; //
placeOrderFirst.isTakeOut = placeOrderFirst.isTakeOut =
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false && (subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 && selectedBtn != 1 &&
selectedBtn != 2) selectedBtn != 2)
? diningStatus ? diningStatus
: selectedBtn; : selectedBtn;
placeOrderFirst.notes = remakers + placeOrderFirst.notes = remakers +
(reservationTime ?? "") + (reservationTime ?? "") +
((subscribeParam?.isEnableSubscribe ?? false) == true ((subscribeParam?.isEnableSubscribe ?? false) == true
? "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1 ? (subscribeParam.stores[0]) : (subscribeStoresName ?? ""))}" ? "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1
? (subscribeParam.stores[0])
: (subscribeStoresName ?? ""))}"
: ""); : "");
placeOrderFirst.numberOfPeople = "$numberOfPeople"; placeOrderFirst.numberOfPeople = "$numberOfPeople";
placeOrderFirst.orderSource = 2; placeOrderFirst.orderSource = 2;
@ -606,23 +600,23 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00")
? payChannel = 0 ? payChannel = 0
: ((tableId > 0 : ((tableId > 0
? (minOrderInfo?.isRaise ?? false) ? (minOrderInfo?.isRaise ?? false)
: (settleOrderInfo?.isRaise ?? false)) : (settleOrderInfo?.isRaise ?? false))
? 7 ? 7
: payChannel)); : payChannel));
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId = placeOrderFirst.promotionInfoDTO.promotionId =
(promotion != null && tableId <= 0) ? promotion.id : ""; (promotion != null && tableId <= 0) ? promotion.id : "";
// : widget.arguments["pid"] ?? ""; // : widget.arguments["pid"] ?? "";
placeOrderFirst.promotionInfoDTO.couponId = placeOrderFirst.promotionInfoDTO.couponId =
(couponListBean != null && tableId <= 0) ? couponListBean.id : ""; (couponListBean != null && tableId <= 0) ? couponListBean.id : "";
// : widget.arguments["cid"] ?? ""; // : widget.arguments["cid"] ?? "";
// placeOrderFirst.promotionInfoDTO.useVipPrice = (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && (settleOrderInfo.usePlateMoney == false))) ) ? false : useVipPriceSelect; // placeOrderFirst.promotionInfoDTO.useVipPrice = (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && (settleOrderInfo.usePlateMoney == false))) ) ? false : useVipPriceSelect;
// placeOrderFirst.promotionInfoDTO.useBenefit = (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false : useBenefitSelect; // placeOrderFirst.promotionInfoDTO.useBenefit = (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false : useBenefitSelect;
placeOrderFirst.promotionInfoDTO.discountType = placeOrderFirst.promotionInfoDTO.discountType =
(!placeOrder) ? "AUTO" : settleOrderInfo?.discountType ?? ""; (!placeOrder) ? "AUTO" : settleOrderInfo?.discountType ?? "";
placeOrderFirst.recMobile = placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; (mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = placeOrderFirst.shoppingCartSkuItemList =
settleOrderInfo.orderProductList; settleOrderInfo.orderProductList;
placeOrderFirst.skuItemDTOList = []; placeOrderFirst.skuItemDTOList = [];
@ -631,8 +625,8 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.subcribeTime = subTime ?? ""; // placeOrderFirst.subcribeTime = subTime ?? ""; //
placeOrderFirst.tableId = "$tableId"; placeOrderFirst.tableId = "$tableId";
for (int i = 0; for (int i = 0;
i < (shopCarGoods?.shoppingCartSkuItemList?.length ?? 0); i < (shopCarGoods?.shoppingCartSkuItemList?.length ?? 0);
i++) { i++) {
placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList = placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList =
shopCarGoods.shoppingCartSkuItemList[i].setMealDataList; shopCarGoods.shoppingCartSkuItemList[i].setMealDataList;
} }
@ -645,8 +639,7 @@ class _Settlement extends State<Settlement> {
print("error: $error"); print("error: $error");
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
// EasyLoading.show( // EasyLoading.show(status: S.current.zhengzaijiazai,
// status: S.current.zhengzaijiazai,
// maskType: EasyLoadingMaskType.black); // maskType: EasyLoadingMaskType.black);
placeOrder = true; placeOrder = true;
this.downOrder = DownOrder.fromJson(baseData.data); this.downOrder = DownOrder.fromJson(baseData.data);
@ -691,14 +684,13 @@ class _Settlement extends State<Settlement> {
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center); SmartDialog.showToast(baseData?.msg, alignment: Alignment.center);
} }
} }
} finally { }finally{
// EasyLoading.dismiss(); EasyLoading.dismiss();
} }
} }
/// ///
querySettlement() async { querySettlement() async {
try{
placeOrderFirst.id = ((parentId != "") ? parentId : downOrder.id); placeOrderFirst.id = ((parentId != "") ? parentId : downOrder.id);
placeOrderFirst.orderProductVOList = ((downOrder == null) placeOrderFirst.orderProductVOList = ((downOrder == null)
? minOrderInfo.orderProductVOList ? minOrderInfo.orderProductVOList
@ -735,10 +727,10 @@ class _Settlement extends State<Settlement> {
timeStamp: int.tryParse(wxPay.timeStamp), timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign, sign: wxPay.sign,
); );
} else { }else{
EasyLoading.dismiss(); EasyLoading.dismiss();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
Future.delayed(Duration(seconds: 2), () { Future.delayed(Duration(seconds:2), () {
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
}); });
} }
@ -762,8 +754,6 @@ class _Settlement extends State<Settlement> {
text: "${baseData?.msg}", text: "${baseData?.msg}",
)); ));
} }
}}finally{
EasyLoading.dismiss();
} }
} }
@ -971,10 +961,8 @@ class _Settlement extends State<Settlement> {
/// ///
if ((settleOrderInfo != null || if ((settleOrderInfo != null ||
minOrderInfo != null) && minOrderInfo != null) && (placeOrder && tableId <= 0 &&
(placeOrder && !(settleOrderInfo?.isRaise ?? false)))
tableId <= 0 &&
!(settleOrderInfo?.isRaise ?? false)))
VipDiscountsSelect( VipDiscountsSelect(
vipSelectCheck, vipSelectCheck,
settleOrderInfo, settleOrderInfo,
@ -1557,19 +1545,13 @@ class _Settlement extends State<Settlement> {
selectedBtn != 2) selectedBtn != 2)
? diningStatus ? diningStatus
: selectedBtn, : selectedBtn,
((couponBean?.id ?? 0) == 0 && (promotion?.id ?? productId ?? 0) != 0) ((couponBean?.id??0) == 0 && (promotion?.id ?? productId ?? 0) !=0) ? 0: couponBean?.id,
? 0
: couponBean?.id,
0, 0,
((couponBean?.id ?? 0) == 0 && (promotion?.id ?? productId ?? 0) != 0) ((couponBean?.id??0) == 0 && (promotion?.id ?? productId ?? 0) !=0) ? promotion?.id ?? productId :0,
? promotion?.id ?? productId
: 0,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
(couponBean?.id ?? 0) == 0 (couponBean?.id ?? 0) == 0 ? ((promotion?.id ?? productId ?? 0) !=0 ? "ACTIVITY":"AUTO") : "COUPON",
? ((promotion?.id ?? productId ?? 0) != 0 ? "ACTIVITY" : "AUTO")
: "COUPON",
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,
@ -1603,21 +1585,13 @@ class _Settlement extends State<Settlement> {
selectedBtn != 2) selectedBtn != 2)
? diningStatus ? diningStatus
: selectedBtn, : selectedBtn,
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && (((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && (couponListBean?.id ??0) != 0)?couponListBean?.id:0,
(couponListBean?.id ?? 0) != 0)
? couponListBean?.id
: 0,
0, 0,
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && (((pro?.id ?? 0) ?? (productId ?? 0)) == 0 && (couponListBean?.id ??0) != 0) ? 0 :((pro?.id ?? 0) ?? productId),
(couponListBean?.id ?? 0) != 0)
? 0
: ((pro?.id ?? 0) ?? productId),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
(((pro?.id ?? 0) ?? (productId ?? 0)) == 0 (((pro?.id ?? 0) ?? (productId ?? 0)) == 0 ? ((couponListBean?.id ??0) != 0 ? "COUPON":"AUTO") : "ACTIVITY"),
? ((couponListBean?.id ?? 0) != 0 ? "COUPON" : "AUTO")
: "ACTIVITY"),
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,

Loading…
Cancel
Save