Browse Source

更改getorderInfo接口,增加优惠类型,去掉(useVipPrice,useBenefit两个字段);

修改各项优惠的显示隐藏;
new_revision_app
wurong 2 years ago
parent
commit
473a06aa8f
  1. 2
      lib/main.dart
  2. 24
      lib/retrofit/data/member_Infor.dart
  3. 8
      lib/retrofit/data/settleOrderInfo.dart
  4. 142
      lib/settlement/settlement.dart
  5. 10
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  6. 11
      lib/settlement/settlement_view/settlement_order_commodity.dart

2
lib/main.dart

@ -202,7 +202,7 @@ class MyApp extends StatelessWidget {
} else if (locales[0].countryCode == "CN"){ } else if (locales[0].countryCode == "CN"){
locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH');
} else{ } else{
locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'US'); locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'CH');
} }
return appLocale ?? locale; return appLocale ?? locale;
}, },

24
lib/retrofit/data/member_Infor.dart

@ -31,10 +31,10 @@ class MemberInfor {
int age, int age,
String signature, String signature,
String background, String background,
String follow, dynamic follow,
String fans, dynamic fans,
String trendTotal, dynamic trendTotal,
String gainLikeTotal,}){ dynamic gainLikeTotal,}){
_id = id; _id = id;
_nickname = nickname; _nickname = nickname;
_headimg = headimg; _headimg = headimg;
@ -86,10 +86,10 @@ class MemberInfor {
int _age; int _age;
String _signature; String _signature;
String _background; String _background;
String _follow; dynamic _follow;
String _fans; dynamic _fans;
String _trendTotal; dynamic _trendTotal;
String _gainLikeTotal; dynamic _gainLikeTotal;
String get id => _id; String get id => _id;
String get nickname => _nickname; String get nickname => _nickname;
@ -104,10 +104,10 @@ class MemberInfor {
int get age => _age; int get age => _age;
String get signature => _signature; String get signature => _signature;
String get background => _background; String get background => _background;
String get follow => _follow; dynamic get follow => _follow;
String get fans => _fans; dynamic get fans => _fans;
String get trendTotal => _trendTotal; dynamic get trendTotal => _trendTotal;
String get gainLikeTotal => _gainLikeTotal; dynamic get gainLikeTotal => _gainLikeTotal;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};

8
lib/retrofit/data/settleOrderInfo.dart

@ -23,6 +23,8 @@ class SettleOrderInfo {
int selectDiscount; int selectDiscount;
bool useVipPriceSelect = false; bool useVipPriceSelect = false;
String vipDiscountAmount; String vipDiscountAmount;
String totalDiscountAmount;
String discountType;
static SettleOrderInfo fromJson(Map<String, dynamic> map) { static SettleOrderInfo fromJson(Map<String, dynamic> map) {
@ -54,6 +56,8 @@ class SettleOrderInfo {
settleOrderInfoBean.isRaise = map['isRaise']; settleOrderInfoBean.isRaise = map['isRaise'];
settleOrderInfoBean.selectDiscount = map['selectDiscount']; settleOrderInfoBean.selectDiscount = map['selectDiscount'];
settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount']; settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount'];
settleOrderInfoBean.totalDiscountAmount = map['totalDiscountAmount'];
settleOrderInfoBean.discountType = map['discountType'];
return settleOrderInfoBean; return settleOrderInfoBean;
} }
@ -77,7 +81,9 @@ class SettleOrderInfo {
"usePlateMoney":usePlateMoney, "usePlateMoney":usePlateMoney,
"isRaise":isRaise, "isRaise":isRaise,
"selectDiscount":selectDiscount, "selectDiscount":selectDiscount,
"vipDiscountAmount":vipDiscountAmount "vipDiscountAmount":vipDiscountAmount,
"totalDiscountAmount": totalDiscountAmount,
"discountType":discountType,
}; };

142
lib/settlement/settlement.dart

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart'; import 'package:fluwx/fluwx.dart';
@ -16,6 +17,7 @@ import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/down_order.dart'; import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/launch_join_act.dart'; import 'package:huixiang/retrofit/data/launch_join_act.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
@ -35,7 +37,6 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/shoppingCart.dart'; import '../retrofit/data/shoppingCart.dart';
import '../view_widget/settlement_tips_dialog.dart'; import '../view_widget/settlement_tips_dialog.dart';
@ -93,6 +94,7 @@ class _Settlement extends State<Settlement> {
String subscribeStoresName; String subscribeStoresName;
String subTime; String subTime;
int storesIndex = 0; int storesIndex = 0;
String discountType;
@override @override
void initState() { void initState() {
@ -145,8 +147,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "NONE",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -160,8 +163,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "NONE",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -175,8 +179,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, (isVips == false || tableId > 0) ? ((vipLevelName == "黄金会员" && placeOrder) ? "MEMBER_RANK" :"NONE"):"AUTO",
(useVipPriceSelect == true && isVips) ? false:useBenefitSelect, // useVipPriceSelect,
// (useVipPriceSelect == true && isVips) ? false:useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -198,8 +203,9 @@ class _Settlement extends State<Settlement> {
productSkuId, productSkuId,
actProductId, actProductId,
actProductSkuId, actProductSkuId,
useVipPriceSelect, discountType,
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
buyNum, buyNum,
payChannel, payChannel,
tableId) async { tableId) async {
@ -215,8 +221,9 @@ class _Settlement extends State<Settlement> {
"productSkuId": productSkuId, "productSkuId": productSkuId,
"actProductId": actProductId, "actProductId": actProductId,
"actProductSkuId": actProductSkuId, "actProductSkuId": actProductSkuId,
"useVipPrice":useVipPriceSelect, "discountType":discountType,
"useBenefit": useBenefitSelect, // "useVipPrice":useVipPriceSelect,
// "useBenefit": useBenefitSelect,
"buyNum": buyNum, "buyNum": buyNum,
"payChannel":payChannel, "payChannel":payChannel,
"tableId": tableId "tableId": tableId
@ -260,8 +267,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "NONE",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
(tableId > 0 ? minOrderInfo.isRaise : settleOrderInfo.isRaise) ? 7 :payChannel, (tableId > 0 ? minOrderInfo.isRaise : settleOrderInfo.isRaise) ? 7 :payChannel,
tableId); tableId);
@ -347,8 +355,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "AUTO",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -400,8 +409,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "AUTO",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -429,8 +439,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "AUTO",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -538,8 +549,8 @@ class _Settlement extends State<Settlement> {
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.recMobile = placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; (mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList;
@ -804,8 +815,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "AUTO",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId ?? 0); tableId ?? 0);
@ -839,7 +851,7 @@ class _Settlement extends State<Settlement> {
(coupons != "" || promotions != "") (coupons != "" || promotions != "")
? false ? false
: useVipPriceSelect, : useVipPriceSelect,
this.showVipTips), this.showVipTips,useBenefitSelect,placeOrder),
///// /////
if (settleOrderInfo != null || if (settleOrderInfo != null ||
@ -854,29 +866,27 @@ class _Settlement extends State<Settlement> {
couponCount(), couponCount(),
placeOrder, placeOrder,
remakers, remakers,
() { () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/edit_remarks_page', '/router/edit_remarks_page',
arguments: { arguments: {
"remake": remakers "remake": remakers
}).then((value) => { }).then((value) => {
setState(() { setState(() {
if (value != null) remakers = value; if (value != null) remakers = value;
}) })
}); });
}, },
tableId, tableId,
vipPriceSelect, vipPriceSelect,
() { () {
setState(() { setState(() {
this.showVipTips = true; this.showVipTips = true;
}); });
}, },
vipBenefitSelect, vipBenefitSelect,
payChannel, payChannel,
vipLevelName, vipLevelName,
),
},
subscribeParam, subscribeParam,
showDateSelector, showDateSelector,
reservationTime, reservationTime,
@ -997,14 +1007,15 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
(settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? "" :couponListBean?.id, (settleOrderInfo.isRaise || payChannel == 5) ? "" :couponListBean?.id,
0, 0,
(settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? "" :promotion?.id ?? productId, (settleOrderInfo.isRaise || payChannel == 5) ? "" :promotion?.id ?? productId,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
(settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect, (settleOrderInfo.isRaise || payChannel == 5) ?"NONE" : ((useVipPriceSelect == false) ? "MEMBER_RANK" : (isVips == false &&vipLevelName == "黄金会员")?"MEMBER_RANK":"AUTO"),
(settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect, // (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false))) ? false :useVipPriceSelect,
// (settleOrderInfo.isRaise || payChannel == 5 || ((payChannel == 4 && settleOrderInfo.usePlateMoney == false)) || useVipPriceSelect == true) ? false :useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId);} tableId);}
@ -1025,13 +1036,15 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, useVipPriceSelect == true ? "VIP": "MEMBER_RANK",
useVipPriceSelect == true ? false :useBenefitSelect, // useVipPriceSelect,
// useVipPriceSelect == true ? false :useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId);} tableId);}
} }
///
vipBenefitSelect(bool useBenefitSelect) { vipBenefitSelect(bool useBenefitSelect) {
this.useBenefitSelect = useBenefitSelect; this.useBenefitSelect = useBenefitSelect;
if (tableId > 0) { if (tableId > 0) {
@ -1046,8 +1059,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, "MEMBER_RANK",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -1103,8 +1117,9 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, (couponBean?.id ?? 0) == 0 ?((isVips == false &&vipLevelName == "黄金会员") ? "MEMBER_RANK" :"AUTO"):"NONE",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -1133,12 +1148,13 @@ class _Settlement extends State<Settlement> {
selectedBtn, selectedBtn,
0, 0,
0, 0,
(pro.id ?? "") ?? productId, (pro?.id ?? 0) ?? productId,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
useVipPriceSelect, ((pro?.id ?? 0) ?? productId) == 0 ?((isVips == false &&vipLevelName == "黄金会员") ? "MEMBER_RANK" :"AUTO"):"NONE",
useBenefitSelect, // useVipPriceSelect,
// useBenefitSelect,
count1, count1,
payChannel, payChannel,
tableId); tableId);
@ -1195,38 +1211,6 @@ class _Settlement extends State<Settlement> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Container(
// padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 14.w),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// GestureDetector(
// onTap: () {
// Navigator.of(context).pop();
// },
// child: Text(
// S.of(context).quxiao,
// style:
// TextStyle(fontSize: 18.sp, color: Colors.black),
// ),
// ),
// GestureDetector(
// onTap: () {
// setState(() {
// subscribeStoresName =
// subscribeParam.stores[storesIndex];
// });
// Navigator.of(context).pop();
// },
// child: Text(
// S.of(context).queding,
// style: TextStyle(
// fontSize: 18.sp, color: Color(0xFF32A060)),
// ),
// ),
// ],
// ),
// ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

10
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -53,13 +53,13 @@ class ActivityCouponRemarks extends StatefulWidget {
this.showVipTips, this.showVipTips,
this.vipBenefitSelect, this.vipBenefitSelect,
this.payChannell, this.payChannell,
this.vipLevelName); this.vipLevelName,
this.showVipTips,
this.subscribeParam, this.subscribeParam,
this.showDateSelector, this.showDateSelector,
this.reservationTime, this.reservationTime,
this.showAlertDialog, this.showAlertDialog,
this.subscribeStoresName); this.subscribeStoresName
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -270,8 +270,8 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
// ), // ),
// ), // ),
if (widget.placeOrder && if (widget.placeOrder &&
widget?.settleOrderInfo?.benefitDiscountAmount != null && (widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != null &&
widget?.settleOrderInfo?.benefitDiscountAmount != "0") widget?.settleOrderInfo?.benefitDiscountAmount != "0"))
Container( Container(
margin: EdgeInsets.only(bottom: 13), margin: EdgeInsets.only(bottom: 13),
child: Row( child: Row(

11
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -117,13 +117,13 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
if (widget.useVipPriceSelect && if (widget.useVipPriceSelect &&
widget.settleOrderInfo.memberVO.isVip && widget.settleOrderInfo.memberVO.isVip &&
(widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) && (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) &&
(widget?.settleOrderInfo?.discountAmount != "0")) { (widget?.settleOrderInfo?.discountType == "VIP" && widget?.settleOrderInfo?.vipDiscountAmount != "0")) {
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠",
(widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.discountAmount ?? ""):(widget?.settleOrderInfo?.discountAmount ?? ""))); (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.discountAmount ?? ""):(widget?.settleOrderInfo?.vipDiscountAmount ?? "")));
} }
if (widget.useBenefitSelect && if (widget.useBenefitSelect &&
(widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))) { (widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))) {
widgets.add(vipItem(Color(0xFFFF7A1A), "会员优惠金额", widgets.add(vipItem(Color(0xFFFF7A1A), "会员优惠金额",
(widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.benefitDiscountAmount ?? "") :(widget?.settleOrderInfo?.benefitDiscountAmount ?? ""))); (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.benefitDiscountAmount ?? "") :(widget?.settleOrderInfo?.benefitDiscountAmount ?? "")));
} }
@ -251,7 +251,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
), ),
if (productList.discountAmount != null) if (productList.discountAmount != null && productList.discountAmount != "0")
Text( Text(
S.of(context).yuan_(productList.sellPrice), S.of(context).yuan_(productList.sellPrice),
style: TextStyle( style: TextStyle(
@ -504,13 +504,14 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
///
String discountPrice() { String discountPrice() {
if (widget.minOrderInfo != null) { if (widget.minOrderInfo != null) {
return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.totalDiscountPrice ?? "0")); return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.totalDiscountPrice ?? "0"));
} else if (widget.tableId < 0) { } else if (widget.tableId < 0) {
return "0"; return "0";
} else { } else {
return AppUtils.calculateDouble(double.tryParse(widget?.settleOrderInfo?.discountAmount ?? "0") + double.tryParse(widget?.settleOrderInfo?.benefitDiscountAmount ?? "0")); return AppUtils.calculateDouble(double.tryParse(widget?.settleOrderInfo?.totalDiscountAmount ?? "0"));
} }
} }

Loading…
Cancel
Save