Browse Source

Merge branch 'dev' into wr_2023_business

wr_2023_business
wurong 2 years ago
parent
commit
dc78a93e57
  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. 63
      lib/order/logistics_information_page.dart
  11. 7
      lib/retrofit/data/settleOrderInfo.dart
  12. 6
      lib/retrofit/data/store_info.dart
  13. 193
      lib/settlement/settlement.dart
  14. 297
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  15. 22
      lib/settlement/settlement_view/settlement_order_commodity.dart
  16. 198
      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

63
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:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
class LogisticsInformationPage extends StatefulWidget { class LogisticsInformationPage extends StatefulWidget {
final arguments; final arguments;
@ -53,42 +56,65 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
.shippingTrace(shipperCode, logisticCode) .shippingTrace(shipperCode, logisticCode)
.catchError((error) { .catchError((error) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
_refreshController.loadFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
Logistics lgs = baseData.data; Logistics lgs = baseData.data;
logistics.clear(); logistics.clear();
logistics.addAll(lgs.traces.reversed); //lgs.traces.reversed
logistics.addAll(lgs.traces);
setState(() { setState(() {
shipStatus = logisticsStatus(lgs.state); shipStatus = logisticsStatus(lgs.state);
if (logistics.length > 0) logistics[0].acceptStation += shipStatus; if (logistics.length > 0) logistics[0].acceptStation += shipStatus;
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
_refreshController.loadComplete();
}); });
} else { } else {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
_refreshController.loadFailed();
} }
} }
queryAppShippingTrace(orderId) async { queryAppShippingTrace(orderId) async {
BaseData<Logistics> baseData = BaseData<Logistics> baseData =
await apiService.getAppShippingTrace(orderId).catchError((error) { await apiService.getAppShippingTrace(orderId).catchError((error) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
_refreshController.loadFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
Logistics lgs = baseData.data; Logistics lgs = baseData.data;
logistics.clear(); logistics.clear();
logistics.addAll(lgs.traces.reversed); //lgs.traces.reversed
logistics.addAll(lgs.traces);
setState(() { setState(() {
shipStatus = logisticsStatus(lgs.state); shipStatus = logisticsStatus(lgs.state);
widget.arguments["logisticsName"] = lgs.shipperCode; widget.arguments["logisticsName"] = lgs.shipperCode;
widget.arguments["logisticsNum"] = lgs.logisticCode; widget.arguments["logisticsNum"] = lgs.logisticCode;
if (logistics.length > 0) logistics[0].acceptStation += shipStatus; if (logistics.length > 0) logistics[0].acceptStation += shipStatus;
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
_refreshController.loadComplete();
}); });
} else { } else {
_refreshController.refreshFailed(); _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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -98,7 +124,22 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
titleColor: Colors.black, titleColor: Colors.black,
leadingColor: 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( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
@ -337,8 +378,6 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column( Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
logistics.acceptTime.split(" ")[0], logistics.acceptTime.split(" ")[0],
@ -372,7 +411,7 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
if (position != size - 1) if (position != size - 1)
Container( Container(
width: 1.w, width: 1.w,
height: 75.h, height: logistics.acceptStation.length > 100 ? 118.h :75.h,
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Color(0xffE1E1E1), color: Color(0xffE1E1E1),
), ),
@ -433,9 +472,11 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
String tripStatus = "assets/image/icon_sign.webp"; String tripStatus = "assets/image/icon_sign.webp";
if (type.contains("已签收")) { if (type.contains("已签收")) {
tripStatus = "assets/image/icon_sign.webp"; 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"; tripStatus = "assets/image/icon_delivery.webp";
} else if (type.contains("运输中") || type.contains("发往")) { } else if (type.contains("运输中") || type.contains("发往")) {
tripStatus = "assets/image/icon_transport.webp"; tripStatus = "assets/image/icon_transport.webp";
} else if (type.contains("已发货") || type.contains("分配")) { } else if (type.contains("已发货") || type.contains("分配")) {
tripStatus = "assets/image/icon_deliver_goods.webp"; tripStatus = "assets/image/icon_deliver_goods.webp";
@ -449,7 +490,9 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
String logisticsTripStatus = ""; String logisticsTripStatus = "";
if (state.contains("已签收")) { if (state.contains("已签收")) {
logisticsTripStatus = "已签收"; logisticsTripStatus = "已签收";
} else if (state.contains("派送中") || state.contains("派件中")) { } else if (state.contains("揽收")) {
logisticsTripStatus = "已揽件";
}else if (state.contains("派送中") || state.contains("派件")) {
logisticsTripStatus = "派送中"; logisticsTripStatus = "派送中";
} else if (state.contains("运输中") || state.contains("发往")) { } else if (state.contains("运输中") || state.contains("发往")) {
logisticsTripStatus = "运输中"; logisticsTripStatus = "运输中";

7
lib/retrofit/data/settleOrderInfo.dart

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

6
lib/retrofit/data/store_info.dart

@ -47,6 +47,8 @@ class StoreInfo {
String businessService; String businessService;
Mini mini; Mini mini;
bool useErp; bool useErp;
bool usePlatformVip;
bool usePlatformPay;
String expireTime; String expireTime;
String vipFee; String vipFee;
MemberSource memberSource; MemberSource memberSource;
@ -107,6 +109,8 @@ class StoreInfo {
..businessService = json['businessService'] as String ..businessService = json['businessService'] as String
..mini = json['mini'] == null ? null : Mini.fromJson(json['mini']) ..mini = json['mini'] == null ? null : Mini.fromJson(json['mini'])
..useErp = json['useErp'] as bool ..useErp = json['useErp'] as bool
..usePlatformVip = json['usePlatformVip'] as bool
..usePlatformPay = json['usePlatformPay'] as bool
..expireTime = json['expireTime'] as String ..expireTime = json['expireTime'] as String
..vipFee = json['vipFee'] as String ..vipFee = json['vipFee'] as String
..memberSource = json['memberSource'] != null ? MemberSource.fromJson(json['memberSource']) : null ..memberSource = json['memberSource'] != null ? MemberSource.fromJson(json['memberSource']) : null
@ -153,6 +157,8 @@ class StoreInfo {
'businessService': this.businessService, 'businessService': this.businessService,
'mini': this.mini.toJson(), 'mini': this.mini.toJson(),
'useErp': this.useErp, 'useErp': this.useErp,
'usePlatformVip': this.usePlatformVip,
'usePlatformPay': this.usePlatformPay,
'expireTime': this.expireTime, 'expireTime': this.expireTime,
'vipFee': this.vipFee, 'vipFee': this.vipFee,
'memberSource': this.memberSource.toJson(), 'memberSource': this.memberSource.toJson(),

193
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_activity.dart';
import 'package:huixiang/settlement/settlement_view/settlement_coupon.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/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/font_weight.dart';
import 'package:huixiang/utils/min.dart'; import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
@ -96,6 +97,7 @@ class _Settlement extends State<Settlement> {
int storesIndex = 0; int storesIndex = 0;
String discountType; String discountType;
int diningStatus = 4; int diningStatus = 4;
int vipSelect = 0;
@override @override
void initState() { void initState() {
@ -141,7 +143,10 @@ class _Settlement extends State<Settlement> {
if (promotions != null && promotions != "" && tableId <= 0) { if (promotions != null && promotions != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, 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 ? diningStatus
: selectedBtn, : selectedBtn,
0, 0,
@ -159,7 +164,10 @@ class _Settlement extends State<Settlement> {
} else if (coupons != null && coupons != "" && tableId <= 0) { } else if (coupons != null && coupons != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, 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 ? diningStatus
: selectedBtn, : selectedBtn,
widget.arguments["cid"], widget.arguments["cid"],
@ -177,7 +185,10 @@ class _Settlement extends State<Settlement> {
} else } else
queryOrderInfo( queryOrderInfo(
null, 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 ? diningStatus
: selectedBtn, : selectedBtn,
0, 0,
@ -186,9 +197,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
(!placeOrder) (!placeOrder) ? "NONE" : "AUTO",
? "NONE"
: "AUTO",
// useVipPriceSelect, // useVipPriceSelect,
// (useVipPriceSelect == true && isVips) ? false:useBenefitSelect, // (useVipPriceSelect == true && isVips) ? false:useBenefitSelect,
count1, count1,
@ -272,7 +281,10 @@ class _Settlement extends State<Settlement> {
isRaiseChannel = true; isRaiseChannel = true;
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
couponListBean?.id, couponListBean?.id,
@ -366,7 +378,10 @@ class _Settlement extends State<Settlement> {
if (address != null) { if (address != null) {
queryOrderInfo( queryOrderInfo(
address.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
null, null,
@ -422,7 +437,10 @@ class _Settlement extends State<Settlement> {
} }
await queryOrderInfo( await queryOrderInfo(
address.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
null, null,
@ -454,7 +472,10 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
address.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
0, 0,
@ -554,7 +575,10 @@ class _Settlement extends State<Settlement> {
? true ? true
: false; // : false; //
placeOrderFirst.isTakeOut = 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 ? diningStatus
: selectedBtn; : selectedBtn;
placeOrderFirst.notes = remakers + placeOrderFirst.notes = remakers +
@ -846,7 +870,16 @@ class _Settlement extends State<Settlement> {
}); });
queryOrderInfo( queryOrderInfo(
addressId, 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 ? diningStatus
: selectedBtn, : selectedBtn,
memberCouponId, memberCouponId,
@ -909,6 +942,17 @@ class _Settlement extends State<Settlement> {
useBenefitSelect, useBenefitSelect,
placeOrder), placeOrder),
///
if ((settleOrderInfo != null ||
minOrderInfo != null) && (placeOrder && tableId <= 0 &&
!(settleOrderInfo?.isRaise ?? false)))
VipDiscountsSelect(
vipSelectCheck,
settleOrderInfo,
minOrderInfo,
payChannel,
storeInfo),
///// /////
if (settleOrderInfo != null || if (settleOrderInfo != null ||
minOrderInfo != null) minOrderInfo != null)
@ -1096,7 +1140,12 @@ class _Settlement extends State<Settlement> {
diningStatus = 4; diningStatus = 4;
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
(settleOrderInfo.isRaise || payChannel == 5) (settleOrderInfo.isRaise || payChannel == 5)
@ -1109,7 +1158,11 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
((promotion?.id ?? productId ?? "") != "") ? "ACTIVITY" : ((couponListBean?.id ?? "") != "" ? "COUPON":"AUTO"), ((promotion?.id ?? productId ?? "") != "")
? "ACTIVITY"
: ((couponListBean?.id ?? "") != ""
? "COUPON"
: "AUTO"),
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,
@ -1182,7 +1235,12 @@ class _Settlement extends State<Settlement> {
diningStatus = 3; diningStatus = 3;
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
(settleOrderInfo.isRaise || payChannel == 5) (settleOrderInfo.isRaise || payChannel == 5)
@ -1195,7 +1253,11 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
((promotion?.id ?? productId ?? "") != "") ? "ACTIVITY" : ((couponListBean?.id ?? "") != "" ? "COUPON":"AUTO"), ((promotion?.id ?? productId ?? "") != "")
? "ACTIVITY"
: ((couponListBean?.id ?? "") != ""
? "COUPON"
: "AUTO"),
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,
@ -1264,6 +1326,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) { payChannelCheck(int payChannel) {
this.payChannel = payChannel; this.payChannel = payChannel;
if (tableId > 0) { if (tableId > 0) {
@ -1271,7 +1371,10 @@ class _Settlement extends State<Settlement> {
} else { } else {
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
(settleOrderInfo.isRaise || payChannel == 5) (settleOrderInfo.isRaise || payChannel == 5)
@ -1302,20 +1405,22 @@ class _Settlement extends State<Settlement> {
} }
} }
String preferentialType(){ String preferentialType() {
if(settleOrderInfo.isRaise || payChannel == 5) if (settleOrderInfo.isRaise || payChannel == 5) return "NONE";
return "NONE"; if (settleOrderInfo.discountType == "ACTIVITY") {
if(settleOrderInfo.discountType == "ACTIVITY"){ return "ACTIVITY";
return "ACTIVITY"; } else if (settleOrderInfo.discountType == "COUPON") {
}else if(settleOrderInfo.discountType == "COUPON"){ return "COUPON";
return "COUPON"; } else if (settleOrderInfo.discountType == "SURPRISE") {
}else if(settleOrderInfo.discountType == "MEMBER_RANK" || settleOrderInfo.discountType == "SURPRISE"){ return "SURPRISE";
return "MEMBER_RANK"; } else if (settleOrderInfo.discountType == "MEMBER_RANK" ||
}else if(settleOrderInfo.discountType == "VIP"){ settleOrderInfo.discountType == "SURPRISE") {
return "MEMBER_RANK";
} else if (settleOrderInfo.discountType == "VIP") {
return "VIP"; return "VIP";
}else { } else {
return "AUTO"; return "AUTO";
} }
} }
vipPriceSelect(bool useVipPriceSelect) { vipPriceSelect(bool useVipPriceSelect) {
@ -1325,7 +1430,10 @@ class _Settlement extends State<Settlement> {
} else { } else {
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
0, 0,
@ -1351,7 +1459,10 @@ class _Settlement extends State<Settlement> {
} else { } else {
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
null, null,
@ -1411,7 +1522,10 @@ class _Settlement extends State<Settlement> {
} else { } else {
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
couponBean?.id, couponBean?.id,
@ -1420,9 +1534,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
(couponBean?.id ?? 0) == 0 (couponBean?.id ?? 0) == 0 ? "AUTO" : "COUPON",
? "AUTO"
: "COUPON",
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,
@ -1450,7 +1562,10 @@ class _Settlement extends State<Settlement> {
// this.couponListBean = null; // this.couponListBean = null;
queryOrderInfo( queryOrderInfo(
address?.id, 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 ? diningStatus
: selectedBtn, : selectedBtn,
0, 0,
@ -1459,9 +1574,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
((pro?.id ?? 0) ?? productId) == 0 ((pro?.id ?? 0) ?? productId) == 0 ? "AUTO" : "ACTIVITY",
?"AUTO"
: "ACTIVITY",
// useVipPriceSelect, // useVipPriceSelect,
// useBenefitSelect, // useBenefitSelect,
count1, count1,

297
lib/settlement/settlement_view/activity_coupon_remarks.dart

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

22
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -1,7 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.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/min_order_info.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart'; import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
@ -150,8 +149,23 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
} }
if (widget.useBenefitSelect && 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?.settleOrderInfo?.benefitDiscountAmount != "0") &&
((widget.tableId > 0 ((widget.tableId > 0
? !(widget?.minOrderInfo?.isRaise ?? false) ? !(widget?.minOrderInfo?.isRaise ?? false)
@ -619,7 +633,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
String discountPrice() { String discountPrice() {
if (widget.minOrderInfo != null) { if (widget.minOrderInfo != null) {
return AppUtils.calculateDouble( 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) { } else if (widget.tableId < 0) {
return "0"; return "0";
} else { } else {

198
lib/settlement/settlement_view/vip_discounts_select.dart

@ -0,0 +1,198 @@
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 '../../retrofit/data/store_info.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;
final StoreInfo storeInfo;
VipDiscountsSelect(this.vipSelectCheck,this.settleOrderInfo,this.minOrderInfo,this.payChannel,this.storeInfo);
@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: (widget?.storeInfo?.usePlatformVip ?? false) == true ? 14.h :0),
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 || (widget?.storeInfo?.usePlatformVip ?? 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)
],
),
),),
if((widget?.storeInfo?.usePlatformVip ?? false) == true)
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