Browse Source

结算页:更改会员权益,会员等级优惠样式;

新增会员日优惠;
更改我的物流页;
调整物流踪迹顺序,新增揽收状态;
火锅店总优惠更改:(总优惠+优惠券优惠)
new_revision_app
wurong 2 years ago
parent
commit
4119782100
  1. BIN
      assets/image/2x/vip_day_logo.webp
  2. BIN
      assets/image/2x/vip_equity_logo.webp
  3. BIN
      assets/image/2x/vip_level_logo.webp
  4. BIN
      assets/image/3x/vip_day_logo.webp
  5. BIN
      assets/image/3x/vip_equity_logo.webp
  6. BIN
      assets/image/3x/vip_level_logo.webp
  7. BIN
      assets/image/vip_day_logo.webp
  8. BIN
      assets/image/vip_equity_logo.webp
  9. BIN
      assets/image/vip_level_logo.webp
  10. 59
      lib/order/logistics_information_page.dart
  11. 7
      lib/retrofit/data/settleOrderInfo.dart
  12. 172
      lib/settlement/settlement.dart
  13. 277
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  14. 22
      lib/settlement/settlement_view/settlement_order_commodity.dart
  15. 195
      lib/settlement/settlement_view/vip_discounts_select.dart

BIN
assets/image/2x/vip_day_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/2x/vip_equity_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

BIN
assets/image/2x/vip_level_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

BIN
assets/image/3x/vip_day_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/image/3x/vip_equity_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/vip_level_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/vip_day_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

BIN
assets/image/vip_equity_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

BIN
assets/image/vip_level_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

59
lib/order/logistics_information_page.dart

@ -13,6 +13,9 @@ import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
class LogisticsInformationPage extends StatefulWidget {
final arguments;
@ -53,18 +56,22 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
.shippingTrace(shipperCode, logisticCode)
.catchError((error) {
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
Logistics lgs = baseData.data;
logistics.clear();
logistics.addAll(lgs.traces.reversed);
//lgs.traces.reversed
logistics.addAll(lgs.traces);
setState(() {
shipStatus = logisticsStatus(lgs.state);
if (logistics.length > 0) logistics[0].acceptStation += shipStatus;
_refreshController.refreshCompleted();
_refreshController.loadComplete();
});
} else {
_refreshController.refreshFailed();
_refreshController.loadFailed();
}
}
@ -72,21 +79,40 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
BaseData<Logistics> baseData =
await apiService.getAppShippingTrace(orderId).catchError((error) {
_refreshController.refreshFailed();
_refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
Logistics lgs = baseData.data;
logistics.clear();
logistics.addAll(lgs.traces.reversed);
//lgs.traces.reversed
logistics.addAll(lgs.traces);
setState(() {
shipStatus = logisticsStatus(lgs.state);
widget.arguments["logisticsName"] = lgs.shipperCode;
widget.arguments["logisticsNum"] = lgs.logisticCode;
if (logistics.length > 0) logistics[0].acceptStation += shipStatus;
_refreshController.refreshCompleted();
_refreshController.loadComplete();
});
} else {
_refreshController.refreshFailed();
_refreshController.loadFailed();
}
}
_onRefresh(){
if((widget.arguments["shipperCode"]??"") != "" &&
(widget.arguments["logisticsNum"]??"") != "")
getShippingTrace(widget.arguments["shipperCode"] ?? "",
widget.arguments["logisticsNum"] ?? "");
else
queryAppShippingTrace(widget.arguments["orderId"]);
}
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
@ -98,7 +124,22 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
titleColor: Colors.black,
leadingColor: Colors.black,
),
body: Container(
body: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(
),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
_onRefresh();
},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
@ -337,8 +378,6 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
logistics.acceptTime.split(" ")[0],
@ -372,7 +411,7 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
if (position != size - 1)
Container(
width: 1.w,
height: 75.h,
height: logistics.acceptStation.length > 100 ? 118.h :75.h,
decoration: new BoxDecoration(
color: Color(0xffE1E1E1),
),
@ -433,7 +472,9 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
String tripStatus = "assets/image/icon_sign.webp";
if (type.contains("已签收")) {
tripStatus = "assets/image/icon_sign.webp";
} else if (type.contains("派送中") || type.contains("派件中")) {
} else if (type.contains("派送中") || type.contains("派件")) {
tripStatus = "assets/image/icon_delivery.webp";
}else if (type.contains("揽收") || type.contains("揽收")) {
tripStatus = "assets/image/icon_delivery.webp";
} else if (type.contains("运输中") || type.contains("发往")) {
tripStatus = "assets/image/icon_transport.webp";
@ -449,7 +490,9 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
String logisticsTripStatus = "";
if (state.contains("已签收")) {
logisticsTripStatus = "已签收";
} else if (state.contains("派送中") || state.contains("派件中")) {
} else if (state.contains("揽收")) {
logisticsTripStatus = "已揽件";
}else if (state.contains("派送中") || state.contains("派件")) {
logisticsTripStatus = "派送中";
} else if (state.contains("运输中") || state.contains("发往")) {
logisticsTripStatus = "运输中";

7
lib/retrofit/data/settleOrderInfo.dart

@ -20,10 +20,12 @@ class SettleOrderInfo {
String memberCouponId;
bool usePlateMoney;
bool isRaise;
bool isVipDay;
int selectDiscount;
bool useVipPriceSelect = false;
String vipDiscountAmount;
String totalDiscountAmount;
String vipDayDiscountAmount;
String discountType;
String totalPackagingFee;
@ -55,9 +57,11 @@ class SettleOrderInfo {
settleOrderInfoBean.memberCouponId = map['memberCouponId'];
settleOrderInfoBean.usePlateMoney = map['usePlateMoney'];
settleOrderInfoBean.isRaise = map['isRaise'];
settleOrderInfoBean.isVipDay = map['isVipDay'];
settleOrderInfoBean.selectDiscount = map['selectDiscount'];
settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount'];
settleOrderInfoBean.totalDiscountAmount = map['totalDiscountAmount'];
settleOrderInfoBean.vipDayDiscountAmount = map['vipDayDiscountAmount'];
settleOrderInfoBean.discountType = map['discountType'];
settleOrderInfoBean.totalPackagingFee = map['totalPackagingFee'];
return settleOrderInfoBean;
@ -81,10 +85,11 @@ class SettleOrderInfo {
"promotionId": promotionId,
"memberCouponId": memberCouponId,
"usePlateMoney":usePlateMoney,
"isRaise":isRaise,
"isVipDay":isVipDay,
"selectDiscount":selectDiscount,
"vipDiscountAmount":vipDiscountAmount,
"totalDiscountAmount": totalDiscountAmount,
"vipDayDiscountAmount": vipDayDiscountAmount,
"discountType":discountType,
"packagingFee" : totalPackagingFee,
};

172
lib/settlement/settlement.dart

@ -31,6 +31,7 @@ import 'package:huixiang/settlement/settlement_view/pay_method.dart';
import 'package:huixiang/settlement/settlement_view/settlement_activity.dart';
import 'package:huixiang/settlement/settlement_view/settlement_coupon.dart';
import 'package:huixiang/settlement/settlement_view/settlement_order_commodity.dart';
import 'package:huixiang/settlement/settlement_view/vip_discounts_select.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
@ -96,6 +97,7 @@ class _Settlement extends State<Settlement> {
int storesIndex = 0;
String discountType;
int diningStatus = 4;
int vipSelect = 0;
@override
void initState() {
@ -141,7 +143,10 @@ class _Settlement extends State<Settlement> {
if (promotions != null && promotions != "" && tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
@ -159,7 +164,10 @@ class _Settlement extends State<Settlement> {
} else if (coupons != null && coupons != "" && tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
widget.arguments["cid"],
@ -177,7 +185,10 @@ class _Settlement extends State<Settlement> {
} else
queryOrderInfo(
null,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
@ -186,9 +197,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
(!placeOrder)
? "NONE"
: "AUTO",
(!placeOrder) ? "NONE" : "AUTO",
// useVipPriceSelect,
// (useVipPriceSelect == true && isVips) ? false:useBenefitSelect,
count1,
@ -272,7 +281,10 @@ class _Settlement extends State<Settlement> {
isRaiseChannel = true;
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
couponListBean?.id,
@ -366,7 +378,10 @@ class _Settlement extends State<Settlement> {
if (address != null) {
queryOrderInfo(
address.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
null,
@ -422,7 +437,10 @@ class _Settlement extends State<Settlement> {
}
await queryOrderInfo(
address.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
null,
@ -454,7 +472,10 @@ class _Settlement extends State<Settlement> {
queryOrderInfo(
address.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
@ -554,7 +575,10 @@ class _Settlement extends State<Settlement> {
? true
: false; //
placeOrderFirst.isTakeOut =
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn;
placeOrderFirst.notes = remakers +
@ -846,7 +870,16 @@ class _Settlement extends State<Settlement> {
});
queryOrderInfo(
addressId,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType
?.dineInTakeStatus ??
false) ==
true &&
(subscribeParam
?.isEnableSubscribe ??
false) ==
false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
memberCouponId,
@ -909,6 +942,16 @@ class _Settlement extends State<Settlement> {
useBenefitSelect,
placeOrder),
///
if ((settleOrderInfo != null ||
minOrderInfo != null) && (placeOrder && tableId <= 0 &&
!(settleOrderInfo?.isRaise ?? false)))
VipDiscountsSelect(
vipSelectCheck,
settleOrderInfo,
minOrderInfo,
payChannel,),
/////
if (settleOrderInfo != null ||
minOrderInfo != null)
@ -1096,7 +1139,12 @@ class _Settlement extends State<Settlement> {
diningStatus = 4;
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) ==
true &&
(subscribeParam?.isEnableSubscribe ?? false) ==
false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
(settleOrderInfo.isRaise || payChannel == 5)
@ -1109,7 +1157,11 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
((promotion?.id ?? productId ?? "") != "") ? "ACTIVITY" : ((couponListBean?.id ?? "") != "" ? "COUPON":"AUTO"),
((promotion?.id ?? productId ?? "") != "")
? "ACTIVITY"
: ((couponListBean?.id ?? "") != ""
? "COUPON"
: "AUTO"),
// useVipPriceSelect,
// useBenefitSelect,
count1,
@ -1182,7 +1234,12 @@ class _Settlement extends State<Settlement> {
diningStatus = 3;
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) ==
true &&
(subscribeParam?.isEnableSubscribe ?? false) ==
false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
(settleOrderInfo.isRaise || payChannel == 5)
@ -1195,7 +1252,11 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
((promotion?.id ?? productId ?? "") != "") ? "ACTIVITY" : ((couponListBean?.id ?? "") != "" ? "COUPON":"AUTO"),
((promotion?.id ?? productId ?? "") != "")
? "ACTIVITY"
: ((couponListBean?.id ?? "") != ""
? "COUPON"
: "AUTO"),
// useVipPriceSelect,
// useBenefitSelect,
count1,
@ -1264,6 +1325,44 @@ class _Settlement extends State<Settlement> {
);
}
///
vipSelectCheck(int vipSelect) {
this.vipSelect = vipSelect;
if (tableId > 0) {
queryOrderDetails(parentId);
} else {
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
vipSelectType(),
count1,
payChannel,
tableId);
}
}
String vipSelectType() {
if (vipSelect == 1) return "MEMBER_RANK";
if (vipSelect == 2) {
return "SURPRISE";
} else if (vipSelect == 3) {
return "VIP";
} else {
return "AUTO";
}
}
payChannelCheck(int payChannel) {
this.payChannel = payChannel;
if (tableId > 0) {
@ -1271,7 +1370,10 @@ class _Settlement extends State<Settlement> {
} else {
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
(settleOrderInfo.isRaise || payChannel == 5)
@ -1303,13 +1405,15 @@ class _Settlement extends State<Settlement> {
}
String preferentialType() {
if(settleOrderInfo.isRaise || payChannel == 5)
return "NONE";
if (settleOrderInfo.isRaise || payChannel == 5) return "NONE";
if (settleOrderInfo.discountType == "ACTIVITY") {
return "ACTIVITY";
} else if (settleOrderInfo.discountType == "COUPON") {
return "COUPON";
}else if(settleOrderInfo.discountType == "MEMBER_RANK" || settleOrderInfo.discountType == "SURPRISE"){
} else if (settleOrderInfo.discountType == "SURPRISE") {
return "SURPRISE";
} else if (settleOrderInfo.discountType == "MEMBER_RANK" ||
settleOrderInfo.discountType == "SURPRISE") {
return "MEMBER_RANK";
} else if (settleOrderInfo.discountType == "VIP") {
return "VIP";
@ -1325,7 +1429,10 @@ class _Settlement extends State<Settlement> {
} else {
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
@ -1351,7 +1458,10 @@ class _Settlement extends State<Settlement> {
} else {
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
null,
@ -1411,7 +1521,10 @@ class _Settlement extends State<Settlement> {
} else {
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
couponBean?.id,
@ -1420,9 +1533,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
(couponBean?.id ?? 0) == 0
? "AUTO"
: "COUPON",
(couponBean?.id ?? 0) == 0 ? "AUTO" : "COUPON",
// useVipPriceSelect,
// useBenefitSelect,
count1,
@ -1450,7 +1561,10 @@ class _Settlement extends State<Settlement> {
// this.couponListBean = null;
queryOrderInfo(
address?.id,
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2)
((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true &&
(subscribeParam?.isEnableSubscribe ?? false) == false &&
selectedBtn != 1 &&
selectedBtn != 2)
? diningStatus
: selectedBtn,
0,
@ -1459,9 +1573,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
((pro?.id ?? 0) ?? productId) == 0
?"AUTO"
: "ACTIVITY",
((pro?.id ?? 0) ?? productId) == 0 ? "AUTO" : "ACTIVITY",
// useVipPriceSelect,
// useBenefitSelect,
count1,

277
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -1,5 +1,3 @@
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@ -86,7 +84,6 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
borderRadius: BorderRadius.circular(8),
),
// height: 122.h / (!widget.placeOrder ? 2 : 1),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 14.h, bottom: 14.h),
padding: EdgeInsets.only(
left: 16.w,
@ -98,100 +95,101 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if ((widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) &&
(widget?.settleOrderInfo?.memberVO?.isVip ?? false) &&
widget.placeOrder)
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
"VIP权益",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Platform.isAndroid
? Switch.adaptive(
value:
(widget.coupons != null && widget.coupons != "" ||
widget.promotions != null &&
widget.promotions != "" ||
widget.payChannell == 5 || widget.payChannell == 7 || ((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE") )
? false
: vipSelect,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
activeColor: Color(0xff32A060),
onChanged: (bool value) {
setState(() {
if(widget.settleOrderInfo.usePlateMoney == false || widget.payChannell == 5){
SmartDialog.show(
widget: SettlementTips(
() {
},
text: widget.payChannell == 5 ? "该支付余额为特殊活动充值, 不可参与任何活动" :"该用户平台余额为特殊活动充值, 不可参与任何活动",
));
return;
}
if ((widget?.settleOrderInfo?.memberVO?.isVip ??
false)) {
vipSelect = !vipSelect;
widget.vipPriceSelect(vipSelect);
} else {
widget.showVipTips();
return;
}
});
},
)
: GestureDetector(
onTap: () {
setState(() {
if(widget.settleOrderInfo.usePlateMoney == false || widget.payChannell == 5){
SmartDialog.show(
widget: SettlementTips(
() {
},
text: widget.payChannell == 5 ? "该支付余额为特殊活动充值, 不可参与任何活动" :"该用户平台余额为特殊活动充值, 不可参与任何活动",
));
return;
}
if ((widget?.settleOrderInfo?.memberVO?.isVip ??
false)) {
vipSelect = !vipSelect;
widget.vipPriceSelect(vipSelect);
} else {
widget.showVipTips();
return;
}
});
},
child: Container(
padding: EdgeInsets.only(bottom: 18.w),
alignment: Alignment.center,
child: Image.asset(
((widget.coupons != null && widget.coupons != "" ||
widget.promotions != null &&
widget.promotions != "" ||
widget.payChannell == 5 ||
widget.payChannell == 7 ||((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE")
|| (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0))
? false
: vipSelect)
? "assets/image/vip_price.webp"
: "assets/image/vip_unprice.webp",
width: 38.w,
height: 20.h,
),
),
)
],
),
// if ((widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) &&
// (widget?.settleOrderInfo?.memberVO?.isVip ?? false) &&
// widget.placeOrder)
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// flex: 1,
// child: Text(
// "VIP权益",
// style: TextStyle(
// fontWeight: MyFontWeight.regular,
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ),
// Platform.isAndroid
// ? Switch.adaptive(
// value:
// (widget.coupons != null && widget.coupons != "" ||
// widget.promotions != null &&
// widget.promotions != "" ||
// widget.payChannell == 5 || widget.payChannell == 7 || ((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE") )
// ? false
// : vipSelect,
// materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
// activeColor: Color(0xff32A060),
// onChanged: (bool value) {
// setState(() {
// if(widget.settleOrderInfo.usePlateMoney == false || widget.payChannell == 5){
// SmartDialog.show(
// widget: SettlementTips(
// () {
// },
// text: widget.payChannell == 5 ? "该支付余额为特殊活动充值, 不可参与任何活动" :"该用户平台余额为特殊活动充值, 不可参与任何活动",
// ));
// return;
// }
// if ((widget?.settleOrderInfo?.memberVO?.isVip ??
// false)) {
// vipSelect = !vipSelect;
// widget.vipPriceSelect(vipSelect);
// } else {
// widget.showVipTips();
// return;
// }
// });
// },
// )
// : GestureDetector(
// onTap: () {
// setState(() {
// if(widget.settleOrderInfo.usePlateMoney == false || widget.payChannell == 5){
// SmartDialog.show(
// widget: SettlementTips(
// () {
// },
// text: widget.payChannell == 5 ? "该支付余额为特殊活动充值, 不可参与任何活动" :"该用户平台余额为特殊活动充值, 不可参与任何活动",
// ));
// return;
// }
// if ((widget?.settleOrderInfo?.memberVO?.isVip ??
// false)) {
// vipSelect = !vipSelect;
// widget.vipPriceSelect(vipSelect);
// } else {
// widget.showVipTips();
// return;
// }
// });
// },
// child: Container(
// padding: EdgeInsets.only(bottom: 18.w),
// alignment: Alignment.center,
// child: Image.asset(
// ((widget.coupons != null && widget.coupons != "" ||
// widget.promotions != null &&
// widget.promotions != "" ||
// widget.payChannell == 5 ||
// widget.payChannell == 7 ||((widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" || (widget?.settleOrderInfo?.discountType ?? "") == "SURPRISE")
// || (widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0))
// ? false
// : vipSelect)
// ? "assets/image/vip_price.webp"
// : "assets/image/vip_unprice.webp",
// width: 38.w,
// height: 20.h,
// ),
// ),
// )
// ],
// ),
// if (widget.placeOrder && !(widget?.settleOrderInfo?.isRaise ?? false))
// Container(
// margin: EdgeInsets.only(
@ -278,46 +276,48 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
// ],
// ),
// ),
// if (widget.placeOrder &&
// ((widget?.settleOrderInfo?.discountType == "MEMBER_RANK" || widget?.settleOrderInfo?.discountType == "SURPRISE") && widget?.settleOrderInfo?.benefitDiscountAmount != null &&
// widget?.settleOrderInfo?.benefitDiscountAmount != "0"))
// Container(
// margin: EdgeInsets.only(bottom: 13),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// flex: 1,
// child: Text(
// "会员优惠金额",
// style: TextStyle(
// fontWeight: MyFontWeight.regular,
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ),
// Text(
// widget.settleOrderInfo.benefitDiscountAmount,
// textAlign: TextAlign.end,
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xFF32A060),
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
// ],
// ),
// ),
if (widget.placeOrder &&
((widget?.settleOrderInfo?.discountType == "MEMBER_RANK" || widget?.settleOrderInfo?.discountType == "SURPRISE") && widget?.settleOrderInfo?.benefitDiscountAmount != null &&
widget?.settleOrderInfo?.benefitDiscountAmount != "0"))
Container(
margin: EdgeInsets.only(bottom: 13),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 1,
child: Text(
"会员优惠金额",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
Text(
widget.settleOrderInfo.benefitDiscountAmount,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
),
if (widget.placeOrder && widget.tableId <= 0 && !(widget?.settleOrderInfo?.isRaise ?? false))
widget.tableId <= 0 &&
!(widget?.settleOrderInfo?.isRaise ?? false))
InkWell(
onTap: () {
if (widget.payChannell == 5) {
SmartDialog.show(
widget: SettlementTips(
() {
},
() {},
text: "该支付余额为特殊活动充值, 不可参与任何活动",
));
return;
@ -357,16 +357,18 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
),
if (widget.placeOrder && !(widget?.settleOrderInfo?.isRaise ?? false))
SizedBox(
height: 13,
height: 13.h,
),
if (widget.placeOrder && (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))
if (widget.placeOrder &&
(widget.tableId > 0
? !(widget?.minOrderInfo?.isRaise ?? false)
: !(widget?.settleOrderInfo?.isRaise ?? false)))
InkWell(
onTap: () {
if (widget.payChannell == 5) {
SmartDialog.show(
widget: SettlementTips(
() {
},
() {},
text: "该支付余额为特殊活动充值, 不可参与任何活动",
));
return;
@ -404,7 +406,10 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
),
),
if (widget.placeOrder && (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))
if (widget.placeOrder &&
(widget.tableId > 0
? !(widget?.minOrderInfo?.isRaise ?? false)
: !(widget?.settleOrderInfo?.isRaise ?? false)))
SizedBox(
height: 13,
),

22
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity_details.dart';
import 'package:huixiang/retrofit/data/min_order_info.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
@ -150,8 +149,23 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
}
if (widget.useBenefitSelect &&
((widget?.settleOrderInfo?.discountType == "MEMBER_RANK" ||
widget?.settleOrderInfo?.discountType == "SURPRISE") &&
(widget?.settleOrderInfo?.discountType == "SURPRISE" &&
widget?.settleOrderInfo?.vipDayDiscountAmount != "0") &&
((widget.tableId > 0
? !(widget?.minOrderInfo?.isRaise ?? false)
: !(widget?.settleOrderInfo?.isRaise ?? false)))) {
widgets.add(vipItem(
Color(0xFFFF7A1A),
"会员日优惠金额",
AppUtils.calculateDouble(double.tryParse(
(widget.minOrderInfo != null &&
widget.minOrderInfo.orderProductVOList != null)
? (widget.minOrderInfo?.discountAmount ?? "")
: (widget?.settleOrderInfo?.vipDayDiscountAmount ?? "")))));
}
if (widget.useBenefitSelect &&
((widget?.settleOrderInfo?.discountType == "MEMBER_RANK") &&
widget?.settleOrderInfo?.benefitDiscountAmount != "0") &&
((widget.tableId > 0
? !(widget?.minOrderInfo?.isRaise ?? false)
@ -619,7 +633,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
String discountPrice() {
if (widget.minOrderInfo != null) {
return AppUtils.calculateDouble(
double.tryParse(widget.minOrderInfo?.totalDiscountPrice ?? "0"));
double.tryParse(widget.minOrderInfo?.totalDiscountPrice ?? "0")+double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0"));
} else if (widget.tableId < 0) {
return "0";
} else {

195
lib/settlement/settlement_view/vip_discounts_select.dart

@ -0,0 +1,195 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import '../../retrofit/data/min_order_info.dart';
import '../../retrofit/data/settleOrderInfo.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class VipDiscountsSelect extends StatefulWidget {
final Function(int vipSelect) vipSelectCheck;
final SettleOrderInfo settleOrderInfo;
final MinOrderInfo minOrderInfo;
final int payChannel;
VipDiscountsSelect(this.vipSelectCheck,this.settleOrderInfo,this.minOrderInfo,this.payChannel);
@override
State<StatefulWidget> createState() {
return _VipDiscountsSelect();
}
}
class _VipDiscountsSelect extends State<VipDiscountsSelect> {
var selectVip = 0;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 1),
blurRadius: 8,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 14.h, bottom: 14.h),
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 14.h,
bottom: 14.h,
),
child: Column(
children: [
Padding(padding:EdgeInsets.only(bottom: 14.h),
child: GestureDetector(
onTap: (){
setState(() {
if (widget.settleOrderInfo.usePlateMoney == false || widget.payChannel == 5) {
SmartDialog.show(
widget: SettlementTips(
() {},
text: widget.payChannel == 5
? "该支付余额为特殊活动充值, 不可参与任何活动"
: "该用户平台余额为特殊活动充值, 不可参与任何活动",
));
return;
} else {
selectVip = 1;
widget.vipSelectCheck(1);
}
});},
child: Row(
children: [
Image.asset(
"assets/image/vip_level_logo.webp",
fit: BoxFit.fill,
width: 20,
height: 20,
),
SizedBox(
width: 8.w,
),
Expanded(child:Text(
"会员等级优惠",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF868686),
),
)),
vipCheckView(1)
],
),
),),
if((widget?.settleOrderInfo?.isVipDay?? false) == true)
Padding(padding:EdgeInsets.only(bottom: 14.h),
child: GestureDetector(
onTap: (){
setState(() {
if (widget.settleOrderInfo.usePlateMoney == false || widget.payChannel == 5) {
SmartDialog.show(
widget: SettlementTips(
() {},
text: widget.payChannel == 5
? "该支付余额为特殊活动充值, 不可参与任何活动"
: "该用户平台余额为特殊活动充值, 不可参与任何活动",
));
return;
} else {
selectVip = 2;
widget.vipSelectCheck(2);
}
});},
child: Row(
children: [
Image.asset(
"assets/image/vip_day_logo.webp",
fit: BoxFit.fill,
width: 20,
height: 20,
),
SizedBox(
width: 8.w,
),
Expanded(child:Text(
"会员日",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF868686),
),
)),
vipCheckView(2)
],
),
),),
GestureDetector(
onTap: (){
setState(() {
if (widget.settleOrderInfo.usePlateMoney == false || widget.payChannel == 5) {
SmartDialog.show(
widget: SettlementTips(
() {},
text: widget.payChannel == 5
? "该支付余额为特殊活动充值, 不可参与任何活动"
: "该用户平台余额为特殊活动充值, 不可参与任何活动",
));
return;
} else {
selectVip = 3;
widget.vipSelectCheck(3);
}
});},
child: Row(
children: [
Image.asset(
"assets/image/vip_equity_logo.webp",
fit: BoxFit.fill,
width: 20,
height: 20,
),
SizedBox(
width: 8.w,
),
Expanded(child:Text(
"会员卡优惠",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF868686),
),
)),
vipCheckView(3)
],
),
),
],
),
);
}
Widget vipCheckView(var index) {
return Image.asset(
((widget?.settleOrderInfo?.discountType??"") == "MEMBER_RANK"
? 1
: ((widget?.settleOrderInfo?.discountType??"") == "SURPRISE"
? 2
: ((widget?.settleOrderInfo?.discountType??"") == "VIP"
? 3
: 0))) !=
index
? "assets/image/icon_radio_unselected.webp"
: "assets/image/icon_radio_selected.webp",
width: 15.w,
height: 15.h,
);
}
}
Loading…
Cancel
Save