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. 68
      lib/settlement/settlement.dart

68
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) {
@ -595,7 +587,9 @@ class _Settlement extends State<Settlement> {
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;
@ -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,9 +961,7 @@ class _Settlement extends State<Settlement> {
/// ///
if ((settleOrderInfo != null || if ((settleOrderInfo != null ||
minOrderInfo != null) && minOrderInfo != null) && (placeOrder && tableId <= 0 &&
(placeOrder &&
tableId <= 0 &&
!(settleOrderInfo?.isRaise ?? false))) !(settleOrderInfo?.isRaise ?? false)))
VipDiscountsSelect( VipDiscountsSelect(
vipSelectCheck, vipSelectCheck,
@ -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