w-R
3 years ago
68 changed files with 7664 additions and 5960 deletions
@ -0,0 +1,84 @@ |
|||||||
|
|
||||||
|
|
||||||
|
import 'package:fluwx/fluwx.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/order_info.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/wx_pay.dart'; |
||||||
|
import 'package:huixiang/retrofit/min_api.dart'; |
||||||
|
import 'package:huixiang/utils/min.dart'; |
||||||
|
|
||||||
|
class OrderUtils { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static carryOnPay(payChannel, MinApiService minService, OrderInfo orderInfo, Function queryDetails) async { |
||||||
|
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst(); |
||||||
|
placeOrderFirst.addressId = orderInfo.addressExt.addressId; |
||||||
|
placeOrderFirst.isSubscribe = orderInfo.isSubscribe; |
||||||
|
placeOrderFirst.isTakeOut = orderInfo.isTakeOut; |
||||||
|
placeOrderFirst.notes = orderInfo.notes; |
||||||
|
placeOrderFirst.id = orderInfo.id; |
||||||
|
placeOrderFirst.orderProductVOList = orderInfo.orderDetail.orderProductList; |
||||||
|
placeOrderFirst.numberOfPeople = "0"; |
||||||
|
placeOrderFirst.orderSource = orderInfo.orderSource; |
||||||
|
placeOrderFirst.orderType = "${orderInfo.orderType}"; |
||||||
|
placeOrderFirst.orderTypeId = 0; |
||||||
|
placeOrderFirst.parentCode = orderInfo.parentCode; // 火锅加菜 |
||||||
|
placeOrderFirst.parentId = orderInfo.parentId; // 火锅加菜 |
||||||
|
placeOrderFirst.payChannel = payChannel; |
||||||
|
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); |
||||||
|
placeOrderFirst.promotionInfoDTO.promotionId = orderInfo.promotionId; |
||||||
|
placeOrderFirst.promotionInfoDTO.couponId = orderInfo.couponId; |
||||||
|
placeOrderFirst.recMobile = ""; |
||||||
|
placeOrderFirst.shoppingCartSkuItemList = []; |
||||||
|
placeOrderFirst.skuItemDTOList = []; |
||||||
|
placeOrderFirst.source = 1; |
||||||
|
placeOrderFirst.storeId = orderInfo.storeId; |
||||||
|
placeOrderFirst.subcribeTime = null; |
||||||
|
placeOrderFirst.tableId = orderInfo.tableId; |
||||||
|
|
||||||
|
if (placeOrderFirst.payChannel == 1) { |
||||||
|
if (!(await Min.isInitialize())) { |
||||||
|
// 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, |
||||||
|
// 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, |
||||||
|
// 故而在此初始化一下 |
||||||
|
await Min.initialize(); |
||||||
|
} |
||||||
|
BaseData<WxPay> baseData = await minService |
||||||
|
.settlementWx(placeOrderFirst.toJson()) |
||||||
|
.catchError((error) {}); |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
WxPay wxPay = baseData.data; |
||||||
|
await registerWxApi( |
||||||
|
appId: wxPay.appId, |
||||||
|
doOnAndroid: true, |
||||||
|
universalLink: "https://hx.lotus-wallet.com/app/", |
||||||
|
); |
||||||
|
payWithWeChat( |
||||||
|
appId: wxPay.appId, |
||||||
|
partnerId: wxPay.partnerId, |
||||||
|
prepayId: wxPay.prepayId, |
||||||
|
packageValue: wxPay.packageValue, |
||||||
|
nonceStr: wxPay.nonceStr, |
||||||
|
timeStamp: int.tryParse(wxPay.timeStamp), |
||||||
|
sign: wxPay.sign, |
||||||
|
); |
||||||
|
weChatResponseEventHandler.listen((event) async { |
||||||
|
print("payCallback: ${event.errCode}"); |
||||||
|
queryDetails(); |
||||||
|
}); |
||||||
|
} |
||||||
|
} else { |
||||||
|
BaseData baseData = await minService |
||||||
|
.settlementApi(placeOrderFirst.toJson()) |
||||||
|
.catchError((error) {}); |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
queryDetails(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,147 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
|
||||||
|
class OrderPaySelected extends StatefulWidget { |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _OrderPaySelected(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
class _OrderPaySelected extends State<OrderPaySelected> { |
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return StatefulBuilder( |
||||||
|
builder: (BuildContext context, StateSetter setState) { |
||||||
|
return Container( |
||||||
|
width: double.infinity, |
||||||
|
height: 200, |
||||||
|
padding: EdgeInsets.only( |
||||||
|
left: 16.w, |
||||||
|
right: 16.w, |
||||||
|
top: 20.h, |
||||||
|
bottom: 20.h, |
||||||
|
), |
||||||
|
decoration: BoxDecoration( |
||||||
|
boxShadow: [ |
||||||
|
BoxShadow( |
||||||
|
color: Color(0x000000).withAlpha(25), |
||||||
|
offset: Offset(0, 1), |
||||||
|
blurRadius: 12.0, |
||||||
|
), |
||||||
|
], |
||||||
|
color: Colors.white, |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
), |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Padding( |
||||||
|
padding: EdgeInsets.only(bottom: 16.h), |
||||||
|
child: Text( |
||||||
|
S.of(context).zhifufangshi, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 16.sp, |
||||||
|
color: Colors.black, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
Navigator.of(context).pop(4); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
S.of(context).pingtaiyue, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xff353535), |
||||||
|
fontWeight: MyFontWeight.semi_bold,), |
||||||
|
), |
||||||
|
checkView(1), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 10, |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
Navigator.of(context).pop(3); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
S.of(context).dianpuyue, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xff353535), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
), |
||||||
|
), |
||||||
|
checkView(2), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 10, |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
Navigator.of(context).pop(1); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Image.asset("assets/image/icon_we_chat.png"), |
||||||
|
Padding( |
||||||
|
padding: EdgeInsets.only(left: 8.w), |
||||||
|
child: Text( |
||||||
|
S.of(context).weixinzhifu, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xff353535), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
checkView(3), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
}, |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
Widget checkView(var index) { |
||||||
|
return Container( |
||||||
|
padding: EdgeInsets.only(left: 16.w), |
||||||
|
alignment: Alignment.center, |
||||||
|
child: Image.asset( |
||||||
|
/*checkIndex != index |
||||||
|
? */"assets/image/icon_radio_unselected.png", |
||||||
|
// : "assets/image/icon_radio_selected.png", |
||||||
|
width: 15.w, |
||||||
|
height: 15.h, |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,135 @@ |
|||||||
|
import 'package:huixiang/retrofit/data/order_product_vo.dart'; |
||||||
|
|
||||||
|
class DownOrder { |
||||||
|
DownOrder({ |
||||||
|
String id, |
||||||
|
String orderCode, |
||||||
|
dynamic storeId, |
||||||
|
dynamic storeName, |
||||||
|
dynamic orderStatus, |
||||||
|
dynamic returnType, |
||||||
|
dynamic shipperCode, |
||||||
|
dynamic logisticsNum, |
||||||
|
String orderSum, |
||||||
|
dynamic accountPay, |
||||||
|
dynamic discountAmount, |
||||||
|
dynamic postFee, |
||||||
|
dynamic paySum, |
||||||
|
dynamic overTime, |
||||||
|
List<OrderProductVOList> orderProductVOList, |
||||||
|
dynamic moneyReturnList, |
||||||
|
dynamic goodsReturnList, |
||||||
|
dynamic tablePrice, |
||||||
|
dynamic parentCode, |
||||||
|
String parentId, |
||||||
|
dynamic peopleNum, |
||||||
|
int orderSource, |
||||||
|
}) { |
||||||
|
this.id = id; |
||||||
|
this.orderCode = orderCode; |
||||||
|
this.storeId = storeId; |
||||||
|
this.storeName = storeName; |
||||||
|
this.orderStatus = orderStatus; |
||||||
|
this.returnType = returnType; |
||||||
|
this.shipperCode = shipperCode; |
||||||
|
this.logisticsNum = logisticsNum; |
||||||
|
this.orderSum = orderSum; |
||||||
|
this.accountPay = accountPay; |
||||||
|
this.discountAmount = discountAmount; |
||||||
|
this.postFee = postFee; |
||||||
|
this.paySum = paySum; |
||||||
|
this.overTime = overTime; |
||||||
|
this.orderProductVOList = orderProductVOList; |
||||||
|
this.moneyReturnList = moneyReturnList; |
||||||
|
this.goodsReturnList = goodsReturnList; |
||||||
|
this.tablePrice = tablePrice; |
||||||
|
this.parentCode = parentCode; |
||||||
|
this.parentId = parentId; |
||||||
|
this.peopleNum = peopleNum; |
||||||
|
this.orderSource = orderSource; |
||||||
|
} |
||||||
|
|
||||||
|
DownOrder.fromJson(dynamic json) { |
||||||
|
this.id = json['id']; |
||||||
|
this.orderCode = json['orderCode']; |
||||||
|
this.storeId = json['storeId']; |
||||||
|
this.storeName = json['storeName']; |
||||||
|
this.orderStatus = json['orderStatus']; |
||||||
|
this.returnType = json['returnType']; |
||||||
|
this.shipperCode = json['shipperCode']; |
||||||
|
this.logisticsNum = json['logisticsNum']; |
||||||
|
this.orderSum = json['orderSum']; |
||||||
|
this.accountPay = json['accountPay']; |
||||||
|
this.discountAmount = json['discountAmount']; |
||||||
|
this.postFee = json['postFee']; |
||||||
|
this.paySum = json['paySum']; |
||||||
|
this.overTime = json['overTime']; |
||||||
|
if (json['orderProductVOList'] != null) { |
||||||
|
this.orderProductVOList = []; |
||||||
|
json['orderProductVOList'].forEach((v) { |
||||||
|
this.orderProductVOList.add(OrderProductVOList.fromJson(v)); |
||||||
|
}); |
||||||
|
} |
||||||
|
this.moneyReturnList = json['moneyReturnList']; |
||||||
|
this.goodsReturnList = json['goodsReturnList']; |
||||||
|
this.tablePrice = json['tablePrice']; |
||||||
|
this.parentCode = json['parentCode']; |
||||||
|
this.parentId = json['parentId']; |
||||||
|
this.peopleNum = json['peopleNum']; |
||||||
|
this.orderSource = json['orderSource']; |
||||||
|
} |
||||||
|
|
||||||
|
String id; |
||||||
|
String orderCode; |
||||||
|
dynamic storeId; |
||||||
|
dynamic storeName; |
||||||
|
dynamic orderStatus; |
||||||
|
dynamic returnType; |
||||||
|
dynamic shipperCode; |
||||||
|
dynamic logisticsNum; |
||||||
|
String orderSum; |
||||||
|
dynamic accountPay; |
||||||
|
dynamic discountAmount; |
||||||
|
dynamic postFee; |
||||||
|
dynamic paySum; |
||||||
|
dynamic overTime; |
||||||
|
List<OrderProductVOList> orderProductVOList; |
||||||
|
dynamic moneyReturnList; |
||||||
|
dynamic goodsReturnList; |
||||||
|
dynamic tablePrice; |
||||||
|
dynamic parentCode; |
||||||
|
String parentId; |
||||||
|
dynamic peopleNum; |
||||||
|
int orderSource; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['id'] = this.id; |
||||||
|
map['orderCode'] = this.orderCode; |
||||||
|
map['storeId'] = this.storeId; |
||||||
|
map['storeName'] = this.storeName; |
||||||
|
map['orderStatus'] = this.orderStatus; |
||||||
|
map['returnType'] = this.returnType; |
||||||
|
map['shipperCode'] = this.shipperCode; |
||||||
|
map['logisticsNum'] = this.logisticsNum; |
||||||
|
map['orderSum'] = this.orderSum; |
||||||
|
map['accountPay'] = this.accountPay; |
||||||
|
map['discountAmount'] = this.discountAmount; |
||||||
|
map['postFee'] = this.postFee; |
||||||
|
map['paySum'] = this.paySum; |
||||||
|
map['overTime'] = this.overTime; |
||||||
|
if (this.orderProductVOList != null) { |
||||||
|
map['orderProductVOList'] = |
||||||
|
this.orderProductVOList.map((v) => v.toJson()).toList(); |
||||||
|
} |
||||||
|
map['moneyReturnList'] = this.moneyReturnList; |
||||||
|
map['goodsReturnList'] = this.goodsReturnList; |
||||||
|
map['tablePrice'] = this.tablePrice; |
||||||
|
map['parentCode'] = this.parentCode; |
||||||
|
map['parentId'] = this.parentId; |
||||||
|
map['peopleNum'] = this.peopleNum; |
||||||
|
map['orderSource'] = this.orderSource; |
||||||
|
return map; |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,713 @@ |
|||||||
|
import 'package:huixiang/retrofit/data/order_product_vo.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
|
|
||||||
|
class MinOrderInfo { |
||||||
|
MinOrderInfo({ |
||||||
|
String id, |
||||||
|
String createTime, |
||||||
|
String createUser, |
||||||
|
String updateTime, |
||||||
|
String updateUser, |
||||||
|
String tenantCode, |
||||||
|
String storeId, |
||||||
|
String storeName, |
||||||
|
String tableId, |
||||||
|
int orderType, |
||||||
|
bool clearTable, |
||||||
|
String mid, |
||||||
|
String parentId, |
||||||
|
String parentCode, |
||||||
|
String orderCode, |
||||||
|
String dayFlowCode, |
||||||
|
int orderStatus, |
||||||
|
int sendStatus, |
||||||
|
int payStatus, |
||||||
|
String memberAccount, |
||||||
|
String logisticsId, |
||||||
|
String shipperCode, |
||||||
|
String logisticsName, |
||||||
|
String logisticsNum, |
||||||
|
dynamic logisticsCase, |
||||||
|
int refundStatus, |
||||||
|
dynamic addressExt, |
||||||
|
String postFee, |
||||||
|
String orderSum, |
||||||
|
String paySum, |
||||||
|
String paySumSub, |
||||||
|
String accountPay, |
||||||
|
String couponSubPrice, |
||||||
|
String customPrice, |
||||||
|
String removeDecimal, |
||||||
|
bool isSubscribe, |
||||||
|
dynamic subcribeTime, |
||||||
|
dynamic sendTime, |
||||||
|
dynamic confirmTime, |
||||||
|
dynamic returnMoneyTime, |
||||||
|
String notes, |
||||||
|
dynamic prepayId, |
||||||
|
dynamic payTime, |
||||||
|
int payChannel, |
||||||
|
dynamic payNum, |
||||||
|
String promotionId, |
||||||
|
String couponId, |
||||||
|
int isDelete, |
||||||
|
int isTakeOut, |
||||||
|
int batch, |
||||||
|
String orderDiscountPrice, |
||||||
|
String dishesDiscountPrice, |
||||||
|
String orderPercentPrice, |
||||||
|
String finalPayPrice, |
||||||
|
String activityNoPrice, |
||||||
|
String activityDiscountPrice, |
||||||
|
String totalDiscountPrice, |
||||||
|
int orderSource, |
||||||
|
dynamic address, |
||||||
|
dynamic discountPercent, |
||||||
|
dynamic discountAmount, |
||||||
|
dynamic discountType, |
||||||
|
dynamic discountMoney, |
||||||
|
dynamic overTime, |
||||||
|
List<OrderProductListBean> orderProductVOList, |
||||||
|
dynamic moneyReturnList, |
||||||
|
dynamic goodsReturnList, |
||||||
|
dynamic moneyReturnVOList, |
||||||
|
dynamic goodsReturnVOList, |
||||||
|
dynamic moneyReturnActionHistoryList, |
||||||
|
dynamic goodsReturnActionHistoryList, |
||||||
|
String currentTime, |
||||||
|
dynamic tablePrice, |
||||||
|
String tableName, |
||||||
|
String balance, |
||||||
|
String money, |
||||||
|
dynamic prodNum, |
||||||
|
bool onCredit, |
||||||
|
OrderInfoVo orderInfoVo, |
||||||
|
String endPayTime, |
||||||
|
String orderSumPrice,}){ |
||||||
|
this.id = id; |
||||||
|
this.createTime = createTime; |
||||||
|
this.createUser = createUser; |
||||||
|
this.updateTime = updateTime; |
||||||
|
this.updateUser = updateUser; |
||||||
|
this.tenantCode = tenantCode; |
||||||
|
this.storeId = storeId; |
||||||
|
this.storeName = storeName; |
||||||
|
this.tableId = tableId; |
||||||
|
this.orderType = orderType; |
||||||
|
this.clearTable = clearTable; |
||||||
|
this.mid = mid; |
||||||
|
this.parentId = parentId; |
||||||
|
this.parentCode = parentCode; |
||||||
|
this.orderCode = orderCode; |
||||||
|
this.dayFlowCode = dayFlowCode; |
||||||
|
this.orderStatus = orderStatus; |
||||||
|
this.sendStatus = sendStatus; |
||||||
|
this.payStatus = payStatus; |
||||||
|
this.memberAccount = memberAccount; |
||||||
|
this.logisticsId = logisticsId; |
||||||
|
this.shipperCode = shipperCode; |
||||||
|
this.logisticsName = logisticsName; |
||||||
|
this.logisticsNum = logisticsNum; |
||||||
|
this.logisticsCase = logisticsCase; |
||||||
|
this.refundStatus = refundStatus; |
||||||
|
this.addressExt = addressExt; |
||||||
|
this.postFee = postFee; |
||||||
|
this.orderSum = orderSum; |
||||||
|
this.paySum = paySum; |
||||||
|
this.paySumSub = paySumSub; |
||||||
|
this.accountPay = accountPay; |
||||||
|
this.couponSubPrice = couponSubPrice; |
||||||
|
this.customPrice = customPrice; |
||||||
|
this.removeDecimal = removeDecimal; |
||||||
|
this.isSubscribe = isSubscribe; |
||||||
|
this.subcribeTime = subcribeTime; |
||||||
|
this.sendTime = sendTime; |
||||||
|
this.confirmTime = confirmTime; |
||||||
|
this.returnMoneyTime = returnMoneyTime; |
||||||
|
this.notes = notes; |
||||||
|
this.prepayId = prepayId; |
||||||
|
this.payTime = payTime; |
||||||
|
this.payChannel = payChannel; |
||||||
|
this.payNum = payNum; |
||||||
|
this.promotionId = promotionId; |
||||||
|
this.couponId = couponId; |
||||||
|
this.isDelete = isDelete; |
||||||
|
this.isTakeOut = isTakeOut; |
||||||
|
this.batch = batch; |
||||||
|
this.orderDiscountPrice = orderDiscountPrice; |
||||||
|
this.dishesDiscountPrice = dishesDiscountPrice; |
||||||
|
this.orderPercentPrice = orderPercentPrice; |
||||||
|
this.finalPayPrice = finalPayPrice; |
||||||
|
this.activityNoPrice = activityNoPrice; |
||||||
|
this.activityDiscountPrice = activityDiscountPrice; |
||||||
|
this.totalDiscountPrice = totalDiscountPrice; |
||||||
|
this.orderSource = orderSource; |
||||||
|
this.address = address; |
||||||
|
this.discountPercent = discountPercent; |
||||||
|
this.discountAmount = discountAmount; |
||||||
|
this.discountType = discountType; |
||||||
|
this.discountMoney = discountMoney; |
||||||
|
this.overTime = overTime; |
||||||
|
this.orderProductVOList = orderProductVOList; |
||||||
|
this.moneyReturnList = moneyReturnList; |
||||||
|
this.goodsReturnList = goodsReturnList; |
||||||
|
this.moneyReturnVOList = moneyReturnVOList; |
||||||
|
this.goodsReturnVOList = goodsReturnVOList; |
||||||
|
this.moneyReturnActionHistoryList = moneyReturnActionHistoryList; |
||||||
|
this.goodsReturnActionHistoryList = goodsReturnActionHistoryList; |
||||||
|
this.currentTime = currentTime; |
||||||
|
this.tablePrice = tablePrice; |
||||||
|
this.tableName = tableName; |
||||||
|
this.balance = balance; |
||||||
|
this.money = money; |
||||||
|
this.prodNum = prodNum; |
||||||
|
this.onCredit = onCredit; |
||||||
|
this.orderInfoVo = orderInfoVo; |
||||||
|
this.endPayTime = endPayTime; |
||||||
|
this.orderSumPrice = orderSumPrice; |
||||||
|
} |
||||||
|
|
||||||
|
MinOrderInfo.fromJson(dynamic json) { |
||||||
|
this.id = json['id']; |
||||||
|
this.createTime = json['createTime']; |
||||||
|
this.createUser = json['createUser']; |
||||||
|
this.updateTime = json['updateTime']; |
||||||
|
this.updateUser = json['updateUser']; |
||||||
|
this.tenantCode = json['tenantCode']; |
||||||
|
this.storeId = json['storeId']; |
||||||
|
this.storeName = json['storeName']; |
||||||
|
this.tableId = json['tableId']; |
||||||
|
this.orderType = json['orderType']; |
||||||
|
this.clearTable = json['clearTable']; |
||||||
|
this.mid = json['mid']; |
||||||
|
this.parentId = json['parentId']; |
||||||
|
this.parentCode = json['parentCode']; |
||||||
|
this.orderCode = json['orderCode']; |
||||||
|
this.dayFlowCode = json['dayFlowCode']; |
||||||
|
this.orderStatus = json['orderStatus']; |
||||||
|
this.sendStatus = json['sendStatus']; |
||||||
|
this.payStatus = json['payStatus']; |
||||||
|
this.memberAccount = json['memberAccount']; |
||||||
|
this.logisticsId = json['logisticsId']; |
||||||
|
this.shipperCode = json['shipperCode']; |
||||||
|
this.logisticsName = json['logisticsName']; |
||||||
|
this.logisticsNum = json['logisticsNum']; |
||||||
|
this.logisticsCase = json['logisticsCase']; |
||||||
|
this.refundStatus = json['refundStatus']; |
||||||
|
this.addressExt = json['addressExt']; |
||||||
|
this.postFee = json['postFee']; |
||||||
|
this.orderSum = json['orderSum']; |
||||||
|
this.paySum = json['paySum']; |
||||||
|
this.paySumSub = json['paySumSub']; |
||||||
|
this.accountPay = json['accountPay']; |
||||||
|
this.couponSubPrice = json['couponSubPrice']; |
||||||
|
this.customPrice = json['customPrice']; |
||||||
|
this.removeDecimal = json['removeDecimal']; |
||||||
|
this.isSubscribe = json['isSubscribe']; |
||||||
|
this.subcribeTime = json['subcribeTime']; |
||||||
|
this.sendTime = json['sendTime']; |
||||||
|
this.confirmTime = json['confirmTime']; |
||||||
|
this.returnMoneyTime = json['returnMoneyTime']; |
||||||
|
this.notes = json['notes']; |
||||||
|
this.prepayId = json['prepayId']; |
||||||
|
this.payTime = json['payTime']; |
||||||
|
this.payChannel = json['payChannel']; |
||||||
|
this.payNum = json['payNum']; |
||||||
|
this.promotionId = json['promotionId']; |
||||||
|
this.couponId = json['couponId']; |
||||||
|
this.isDelete = json['isDelete']; |
||||||
|
this.isTakeOut = json['isTakeOut']; |
||||||
|
this.batch = json['batch']; |
||||||
|
this.orderDiscountPrice = json['orderDiscountPrice']; |
||||||
|
this.dishesDiscountPrice = json['dishesDiscountPrice']; |
||||||
|
this.orderPercentPrice = json['orderPercentPrice']; |
||||||
|
this.finalPayPrice = json['finalPayPrice']; |
||||||
|
this.activityNoPrice = json['activityNoPrice']; |
||||||
|
this.activityDiscountPrice = json['activityDiscountPrice']; |
||||||
|
this.totalDiscountPrice = json['totalDiscountPrice']; |
||||||
|
this.orderSource = json['orderSource']; |
||||||
|
this.address = json['address']; |
||||||
|
this.discountPercent = json['discountPercent']; |
||||||
|
this.discountAmount = json['discountAmount']; |
||||||
|
this.discountType = json['discountType']; |
||||||
|
this.discountMoney = json['discountMoney']; |
||||||
|
this.overTime = json['overTime']; |
||||||
|
if (json['orderProductVOList'] != null) { |
||||||
|
this.orderProductVOList = []; |
||||||
|
json['orderProductVOList'].forEach((v) { |
||||||
|
this.orderProductVOList.add(OrderProductListBean.fromJson(v)); |
||||||
|
}); |
||||||
|
} |
||||||
|
this.moneyReturnList = json['moneyReturnList']; |
||||||
|
this.goodsReturnList = json['goodsReturnList']; |
||||||
|
this.moneyReturnVOList = json['moneyReturnVOList']; |
||||||
|
this.goodsReturnVOList = json['goodsReturnVOList']; |
||||||
|
this.moneyReturnActionHistoryList = json['moneyReturnActionHistoryList']; |
||||||
|
this.goodsReturnActionHistoryList = json['goodsReturnActionHistoryList']; |
||||||
|
this.currentTime = json['currentTime']; |
||||||
|
this.tablePrice = json['tablePrice']; |
||||||
|
this.tableName = json['tableName']; |
||||||
|
this.balance = json['balance']; |
||||||
|
this.money = json['money']; |
||||||
|
this.prodNum = json['prodNum']; |
||||||
|
this.onCredit = json['onCredit']; |
||||||
|
this.orderInfoVo = json['orderInfoVo'] != null ? OrderInfoVo.fromJson(json['orderInfoVo']) : null; |
||||||
|
this.endPayTime = json['endPayTime']; |
||||||
|
this.orderSumPrice = json['orderSumPrice']; |
||||||
|
} |
||||||
|
String id; |
||||||
|
String createTime; |
||||||
|
String createUser; |
||||||
|
String updateTime; |
||||||
|
String updateUser; |
||||||
|
String tenantCode; |
||||||
|
String storeId; |
||||||
|
String storeName; |
||||||
|
String tableId; |
||||||
|
int orderType; |
||||||
|
bool clearTable; |
||||||
|
String mid; |
||||||
|
String parentId; |
||||||
|
String parentCode; |
||||||
|
String orderCode; |
||||||
|
String dayFlowCode; |
||||||
|
int orderStatus; |
||||||
|
int sendStatus; |
||||||
|
int payStatus; |
||||||
|
String memberAccount; |
||||||
|
String logisticsId; |
||||||
|
String shipperCode; |
||||||
|
String logisticsName; |
||||||
|
String logisticsNum; |
||||||
|
dynamic logisticsCase; |
||||||
|
int refundStatus; |
||||||
|
dynamic addressExt; |
||||||
|
String postFee; |
||||||
|
String orderSum; |
||||||
|
String paySum; |
||||||
|
String paySumSub; |
||||||
|
String accountPay; |
||||||
|
String couponSubPrice; |
||||||
|
String customPrice; |
||||||
|
String removeDecimal; |
||||||
|
bool isSubscribe; |
||||||
|
dynamic subcribeTime; |
||||||
|
dynamic sendTime; |
||||||
|
dynamic confirmTime; |
||||||
|
dynamic returnMoneyTime; |
||||||
|
String notes; |
||||||
|
dynamic prepayId; |
||||||
|
dynamic payTime; |
||||||
|
int payChannel; |
||||||
|
dynamic payNum; |
||||||
|
String promotionId; |
||||||
|
String couponId; |
||||||
|
int isDelete; |
||||||
|
int isTakeOut; |
||||||
|
int batch; |
||||||
|
String orderDiscountPrice; |
||||||
|
String dishesDiscountPrice; |
||||||
|
String orderPercentPrice; |
||||||
|
String finalPayPrice; |
||||||
|
String activityNoPrice; |
||||||
|
String activityDiscountPrice; |
||||||
|
String totalDiscountPrice; |
||||||
|
int orderSource; |
||||||
|
dynamic address; |
||||||
|
dynamic discountPercent; |
||||||
|
dynamic discountAmount; |
||||||
|
dynamic discountType; |
||||||
|
dynamic discountMoney; |
||||||
|
dynamic overTime; |
||||||
|
List<OrderProductListBean> orderProductVOList; |
||||||
|
dynamic moneyReturnList; |
||||||
|
dynamic goodsReturnList; |
||||||
|
dynamic moneyReturnVOList; |
||||||
|
dynamic goodsReturnVOList; |
||||||
|
dynamic moneyReturnActionHistoryList; |
||||||
|
dynamic goodsReturnActionHistoryList; |
||||||
|
String currentTime; |
||||||
|
dynamic tablePrice; |
||||||
|
String tableName; |
||||||
|
String balance; |
||||||
|
String money; |
||||||
|
dynamic prodNum; |
||||||
|
bool onCredit; |
||||||
|
OrderInfoVo orderInfoVo; |
||||||
|
String endPayTime; |
||||||
|
String orderSumPrice; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['id'] = this.id; |
||||||
|
map['createTime'] = this.createTime; |
||||||
|
map['createUser'] = this.createUser; |
||||||
|
map['updateTime'] = this.updateTime; |
||||||
|
map['updateUser'] = this.updateUser; |
||||||
|
map['tenantCode'] = this.tenantCode; |
||||||
|
map['storeId'] = this.storeId; |
||||||
|
map['storeName'] = this.storeName; |
||||||
|
map['tableId'] = this.tableId; |
||||||
|
map['orderType'] = this.orderType; |
||||||
|
map['clearTable'] = this.clearTable; |
||||||
|
map['mid'] = this.mid; |
||||||
|
map['parentId'] = this.parentId; |
||||||
|
map['parentCode'] = this.parentCode; |
||||||
|
map['orderCode'] = this.orderCode; |
||||||
|
map['dayFlowCode'] = this.dayFlowCode; |
||||||
|
map['orderStatus'] = this.orderStatus; |
||||||
|
map['sendStatus'] = this.sendStatus; |
||||||
|
map['payStatus'] = this.payStatus; |
||||||
|
map['memberAccount'] = this.memberAccount; |
||||||
|
map['logisticsId'] = this.logisticsId; |
||||||
|
map['shipperCode'] = this.shipperCode; |
||||||
|
map['logisticsName'] = this.logisticsName; |
||||||
|
map['logisticsNum'] = this.logisticsNum; |
||||||
|
map['logisticsCase'] = this.logisticsCase; |
||||||
|
map['refundStatus'] = this.refundStatus; |
||||||
|
map['addressExt'] = this.addressExt; |
||||||
|
map['postFee'] = this.postFee; |
||||||
|
map['orderSum'] = this.orderSum; |
||||||
|
map['paySum'] = this.paySum; |
||||||
|
map['paySumSub'] = this.paySumSub; |
||||||
|
map['accountPay'] = this.accountPay; |
||||||
|
map['couponSubPrice'] = this.couponSubPrice; |
||||||
|
map['customPrice'] = this.customPrice; |
||||||
|
map['removeDecimal'] = this.removeDecimal; |
||||||
|
map['isSubscribe'] = this.isSubscribe; |
||||||
|
map['subcribeTime'] = this.subcribeTime; |
||||||
|
map['sendTime'] = this.sendTime; |
||||||
|
map['confirmTime'] = this.confirmTime; |
||||||
|
map['returnMoneyTime'] = this.returnMoneyTime; |
||||||
|
map['notes'] = this.notes; |
||||||
|
map['prepayId'] = this.prepayId; |
||||||
|
map['payTime'] = this.payTime; |
||||||
|
map['payChannel'] = this.payChannel; |
||||||
|
map['payNum'] = this.payNum; |
||||||
|
map['promotionId'] = this.promotionId; |
||||||
|
map['couponId'] = this.couponId; |
||||||
|
map['isDelete'] = this.isDelete; |
||||||
|
map['isTakeOut'] = this.isTakeOut; |
||||||
|
map['batch'] = this.batch; |
||||||
|
map['orderDiscountPrice'] = this.orderDiscountPrice; |
||||||
|
map['dishesDiscountPrice'] = this.dishesDiscountPrice; |
||||||
|
map['orderPercentPrice'] = this.orderPercentPrice; |
||||||
|
map['finalPayPrice'] = this.finalPayPrice; |
||||||
|
map['activityNoPrice'] = this.activityNoPrice; |
||||||
|
map['activityDiscountPrice'] = this.activityDiscountPrice; |
||||||
|
map['totalDiscountPrice'] = this.totalDiscountPrice; |
||||||
|
map['orderSource'] = this.orderSource; |
||||||
|
map['address'] = this.address; |
||||||
|
map['discountPercent'] = this.discountPercent; |
||||||
|
map['discountAmount'] = this.discountAmount; |
||||||
|
map['discountType'] = this.discountType; |
||||||
|
map['discountMoney'] = this.discountMoney; |
||||||
|
map['overTime'] = this.overTime; |
||||||
|
if (this.orderProductVOList != null) { |
||||||
|
map['orderProductVOList'] = this.orderProductVOList.map((v) => v.toJson()).toList(); |
||||||
|
} |
||||||
|
map['moneyReturnList'] = this.moneyReturnList; |
||||||
|
map['goodsReturnList'] = this.goodsReturnList; |
||||||
|
map['moneyReturnVOList'] = this.moneyReturnVOList; |
||||||
|
map['goodsReturnVOList'] = this.goodsReturnVOList; |
||||||
|
map['moneyReturnActionHistoryList'] = this.moneyReturnActionHistoryList; |
||||||
|
map['goodsReturnActionHistoryList'] = this.goodsReturnActionHistoryList; |
||||||
|
map['currentTime'] = this.currentTime; |
||||||
|
map['tablePrice'] = this.tablePrice; |
||||||
|
map['tableName'] = this.tableName; |
||||||
|
map['balance'] = this.balance; |
||||||
|
map['money'] = this.money; |
||||||
|
map['prodNum'] = this.prodNum; |
||||||
|
map['onCredit'] = this.onCredit; |
||||||
|
if (this.orderInfoVo != null) { |
||||||
|
map['orderInfoVo'] = this.orderInfoVo.toJson(); |
||||||
|
} |
||||||
|
map['endPayTime'] = this.endPayTime; |
||||||
|
map['orderSumPrice'] = this.orderSumPrice; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/// orderNum : 0 |
||||||
|
/// productNum : 0 |
||||||
|
/// mins : 1 |
||||||
|
/// memberVO : {"vipNo":"1406879717390286848","nickname":"","headimg":"","userType":true,"sex":"0","level":1,"addressId":null,"remark":null,"phone":"15827991714","createTime":"2021-07-10 15:44:23","birth":"1993-02-19","balance":"0.00","money":"9999608.09","points":"1147","isBind":true,"memberRankVo":{"id":"1402947503522840576","rankName":"黄金会员","rankOrigin":8888,"rankContent":"","rankImg":"","status":true,"nextId":"1402947503522840577","nextName":"钻石会员","nextOrigin":null},"age":28} |
||||||
|
/// postAge : "0.00" |
||||||
|
/// price : "208.00" |
||||||
|
/// orderSum : "208.00" |
||||||
|
/// discountAmount : null |
||||||
|
/// promotionInfoList : null |
||||||
|
/// couponList : null |
||||||
|
/// threshold : "0" |
||||||
|
/// freePostAge : "0" |
||||||
|
/// orderProductList : null |
||||||
|
|
||||||
|
class OrderInfoVo { |
||||||
|
OrderInfoVo({ |
||||||
|
int orderNum, |
||||||
|
int productNum, |
||||||
|
int mins, |
||||||
|
MemberVO memberVO, |
||||||
|
String postAge, |
||||||
|
String price, |
||||||
|
String orderSum, |
||||||
|
dynamic discountAmount, |
||||||
|
dynamic promotionInfoList, |
||||||
|
dynamic couponList, |
||||||
|
String threshold, |
||||||
|
String freePostAge, |
||||||
|
dynamic orderProductList,}){ |
||||||
|
this.orderNum = orderNum; |
||||||
|
this.productNum = productNum; |
||||||
|
this.mins = mins; |
||||||
|
this.memberVO = memberVO; |
||||||
|
this.postAge = postAge; |
||||||
|
this.price = price; |
||||||
|
this.orderSum = orderSum; |
||||||
|
this.discountAmount = discountAmount; |
||||||
|
this.promotionInfoList = promotionInfoList; |
||||||
|
this.couponList = couponList; |
||||||
|
this.threshold = threshold; |
||||||
|
this.freePostAge = freePostAge; |
||||||
|
this.orderProductList = orderProductList; |
||||||
|
} |
||||||
|
|
||||||
|
OrderInfoVo.fromJson(dynamic json) { |
||||||
|
this.orderNum = json['orderNum']; |
||||||
|
this.productNum = json['productNum']; |
||||||
|
this.mins = json['mins']; |
||||||
|
this.memberVO = json['memberVO'] != null ? MemberVO.fromJson(json['memberVO']) : null; |
||||||
|
this.postAge = json['postAge']; |
||||||
|
this.price = json['price']; |
||||||
|
this.orderSum = json['orderSum']; |
||||||
|
this.discountAmount = json['discountAmount']; |
||||||
|
this.promotionInfoList = json['promotionInfoList']; |
||||||
|
this.couponList = json['couponList']; |
||||||
|
this.threshold = json['threshold']; |
||||||
|
this.freePostAge = json['freePostAge']; |
||||||
|
this.orderProductList = json['orderProductList']; |
||||||
|
} |
||||||
|
int orderNum; |
||||||
|
int productNum; |
||||||
|
int mins; |
||||||
|
MemberVO memberVO; |
||||||
|
String postAge; |
||||||
|
String price; |
||||||
|
String orderSum; |
||||||
|
dynamic discountAmount; |
||||||
|
dynamic promotionInfoList; |
||||||
|
dynamic couponList; |
||||||
|
String threshold; |
||||||
|
String freePostAge; |
||||||
|
dynamic orderProductList; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['orderNum'] = this.orderNum; |
||||||
|
map['productNum'] = this.productNum; |
||||||
|
map['mins'] = this.mins; |
||||||
|
if (this.memberVO != null) { |
||||||
|
map['memberVO'] = this.memberVO.toJson(); |
||||||
|
} |
||||||
|
map['postAge'] = this.postAge; |
||||||
|
map['price'] = this.price; |
||||||
|
map['orderSum'] = this.orderSum; |
||||||
|
map['discountAmount'] = this.discountAmount; |
||||||
|
map['promotionInfoList'] = this.promotionInfoList; |
||||||
|
map['couponList'] = this.couponList; |
||||||
|
map['threshold'] = this.threshold; |
||||||
|
map['freePostAge'] = this.freePostAge; |
||||||
|
map['orderProductList'] = this.orderProductList; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/// vipNo : "1406879717390286848" |
||||||
|
/// nickname : "" |
||||||
|
/// headimg : "" |
||||||
|
/// userType : true |
||||||
|
/// sex : "0" |
||||||
|
/// level : 1 |
||||||
|
/// addressId : null |
||||||
|
/// remark : null |
||||||
|
/// phone : "15827991714" |
||||||
|
/// createTime : "2021-07-10 15:44:23" |
||||||
|
/// birth : "1993-02-19" |
||||||
|
/// balance : "0.00" |
||||||
|
/// money : "9999608.09" |
||||||
|
/// points : "1147" |
||||||
|
/// isBind : true |
||||||
|
/// memberRankVo : {"id":"1402947503522840576","rankName":"黄金会员","rankOrigin":8888,"rankContent":"","rankImg":"","status":true,"nextId":"1402947503522840577","nextName":"钻石会员","nextOrigin":null} |
||||||
|
/// age : 28 |
||||||
|
|
||||||
|
class MemberVO { |
||||||
|
MemberVO({ |
||||||
|
String vipNo, |
||||||
|
String nickname, |
||||||
|
String headimg, |
||||||
|
bool userType, |
||||||
|
String sex, |
||||||
|
int level, |
||||||
|
dynamic addressId, |
||||||
|
dynamic remark, |
||||||
|
String phone, |
||||||
|
String createTime, |
||||||
|
String birth, |
||||||
|
String balance, |
||||||
|
String money, |
||||||
|
String points, |
||||||
|
bool isBind, |
||||||
|
MemberRankVo memberRankVo, |
||||||
|
int age,}){ |
||||||
|
this.vipNo = vipNo; |
||||||
|
this.nickname = nickname; |
||||||
|
this.headimg = headimg; |
||||||
|
this.userType = userType; |
||||||
|
this.sex = sex; |
||||||
|
this.level = level; |
||||||
|
this.addressId = addressId; |
||||||
|
this.remark = remark; |
||||||
|
this.phone = phone; |
||||||
|
this.createTime = createTime; |
||||||
|
this.birth = birth; |
||||||
|
this.balance = balance; |
||||||
|
this.money = money; |
||||||
|
this.points = points; |
||||||
|
this.isBind = isBind; |
||||||
|
this.memberRankVo = memberRankVo; |
||||||
|
this.age = age; |
||||||
|
} |
||||||
|
|
||||||
|
MemberVO.fromJson(dynamic json) { |
||||||
|
this.vipNo = json['vipNo']; |
||||||
|
this.nickname = json['nickname']; |
||||||
|
this.headimg = json['headimg']; |
||||||
|
this.userType = json['userType']; |
||||||
|
this.sex = json['sex']; |
||||||
|
this.level = json['level']; |
||||||
|
this.addressId = json['addressId']; |
||||||
|
this.remark = json['remark']; |
||||||
|
this.phone = json['phone']; |
||||||
|
this.createTime = json['createTime']; |
||||||
|
this.birth = json['birth']; |
||||||
|
this.balance = json['balance']; |
||||||
|
this.money = json['money']; |
||||||
|
this.points = json['points']; |
||||||
|
this.isBind = json['isBind']; |
||||||
|
this.memberRankVo = json['memberRankVo'] != null ? MemberRankVo.fromJson(json['memberRankVo']) : null; |
||||||
|
this.age = json['age']; |
||||||
|
} |
||||||
|
String vipNo; |
||||||
|
String nickname; |
||||||
|
String headimg; |
||||||
|
bool userType; |
||||||
|
String sex; |
||||||
|
int level; |
||||||
|
dynamic addressId; |
||||||
|
dynamic remark; |
||||||
|
String phone; |
||||||
|
String createTime; |
||||||
|
String birth; |
||||||
|
String balance; |
||||||
|
String money; |
||||||
|
String points; |
||||||
|
bool isBind; |
||||||
|
MemberRankVo memberRankVo; |
||||||
|
int age; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['vipNo'] = this.vipNo; |
||||||
|
map['nickname'] = this.nickname; |
||||||
|
map['headimg'] = this.headimg; |
||||||
|
map['userType'] = this.userType; |
||||||
|
map['sex'] = this.sex; |
||||||
|
map['level'] = this.level; |
||||||
|
map['addressId'] = this.addressId; |
||||||
|
map['remark'] = this.remark; |
||||||
|
map['phone'] = this.phone; |
||||||
|
map['createTime'] = this.createTime; |
||||||
|
map['birth'] = this.birth; |
||||||
|
map['balance'] = this.balance; |
||||||
|
map['money'] = this.money; |
||||||
|
map['points'] = this.points; |
||||||
|
map['isBind'] = this.isBind; |
||||||
|
if (this.memberRankVo != null) { |
||||||
|
map['memberRankVo'] = this.memberRankVo.toJson(); |
||||||
|
} |
||||||
|
map['age'] = this.age; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/// id : "1402947503522840576" |
||||||
|
/// rankName : "黄金会员" |
||||||
|
/// rankOrigin : 8888 |
||||||
|
/// rankContent : "" |
||||||
|
/// rankImg : "" |
||||||
|
/// status : true |
||||||
|
/// nextId : "1402947503522840577" |
||||||
|
/// nextName : "钻石会员" |
||||||
|
/// nextOrigin : null |
||||||
|
|
||||||
|
class MemberRankVo { |
||||||
|
MemberRankVo({ |
||||||
|
String id, |
||||||
|
String rankName, |
||||||
|
int rankOrigin, |
||||||
|
String rankContent, |
||||||
|
String rankImg, |
||||||
|
bool status, |
||||||
|
String nextId, |
||||||
|
String nextName, |
||||||
|
dynamic nextOrigin,}){ |
||||||
|
this.id = id; |
||||||
|
this.rankName = rankName; |
||||||
|
this.rankOrigin = rankOrigin; |
||||||
|
this.rankContent = rankContent; |
||||||
|
this.rankImg = rankImg; |
||||||
|
this.status = status; |
||||||
|
this.nextId = nextId; |
||||||
|
this.nextName = nextName; |
||||||
|
this.nextOrigin = nextOrigin; |
||||||
|
} |
||||||
|
|
||||||
|
MemberRankVo.fromJson(dynamic json) { |
||||||
|
this.id = json['id']; |
||||||
|
this.rankName = json['rankName']; |
||||||
|
this.rankOrigin = json['rankOrigin']; |
||||||
|
this.rankContent = json['rankContent']; |
||||||
|
this.rankImg = json['rankImg']; |
||||||
|
this.status = json['status']; |
||||||
|
this.nextId = json['nextId']; |
||||||
|
this.nextName = json['nextName']; |
||||||
|
this.nextOrigin = json['nextOrigin']; |
||||||
|
} |
||||||
|
String id; |
||||||
|
String rankName; |
||||||
|
int rankOrigin; |
||||||
|
String rankContent; |
||||||
|
String rankImg; |
||||||
|
bool status; |
||||||
|
String nextId; |
||||||
|
String nextName; |
||||||
|
dynamic nextOrigin; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['id'] = this.id; |
||||||
|
map['rankName'] = this.rankName; |
||||||
|
map['rankOrigin'] = this.rankOrigin; |
||||||
|
map['rankContent'] = this.rankContent; |
||||||
|
map['rankImg'] = this.rankImg; |
||||||
|
map['status'] = this.status; |
||||||
|
map['nextId'] = this.nextId; |
||||||
|
map['nextName'] = this.nextName; |
||||||
|
map['nextOrigin'] = this.nextOrigin; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,388 @@ |
|||||||
|
class OrderProductVOList { |
||||||
|
OrderProductVOList({ |
||||||
|
ActInfo actInfo, |
||||||
|
AdditionalComment additionalComment, |
||||||
|
int buyNum, |
||||||
|
String canApplyIntervention, |
||||||
|
Comment comment, |
||||||
|
String commentStatus, |
||||||
|
String discountAmount, |
||||||
|
String id, |
||||||
|
String productId, |
||||||
|
String productName, |
||||||
|
String returnCode, |
||||||
|
String returnStatus, |
||||||
|
String returnType, |
||||||
|
String sellPrice, |
||||||
|
String skuId, |
||||||
|
String skuImg, |
||||||
|
String skuNameStr, |
||||||
|
}) { |
||||||
|
this.actInfo = actInfo; |
||||||
|
this.additionalComment = additionalComment; |
||||||
|
this.buyNum = buyNum; |
||||||
|
this.canApplyIntervention = canApplyIntervention; |
||||||
|
this.comment = comment; |
||||||
|
this.commentStatus = commentStatus; |
||||||
|
this.discountAmount = discountAmount; |
||||||
|
this.id = id; |
||||||
|
this.productId = productId; |
||||||
|
this.productName = productName; |
||||||
|
this.returnCode = returnCode; |
||||||
|
this.returnStatus = returnStatus; |
||||||
|
this.returnType = returnType; |
||||||
|
this.sellPrice = sellPrice; |
||||||
|
this.skuId = skuId; |
||||||
|
this.skuImg = skuImg; |
||||||
|
this.skuNameStr = skuNameStr; |
||||||
|
} |
||||||
|
|
||||||
|
OrderProductVOList.fromJson(dynamic json) { |
||||||
|
this.actInfo = |
||||||
|
json['actInfo'] != null ? ActInfo.fromJson(json['actInfo']) : null; |
||||||
|
this.additionalComment = json['additionalComment'] != null |
||||||
|
? AdditionalComment.fromJson(json['additionalComment']) |
||||||
|
: null; |
||||||
|
this.buyNum = json['buyNum']; |
||||||
|
this.canApplyIntervention = json['canApplyIntervention']; |
||||||
|
this.comment = |
||||||
|
json['comment'] != null ? Comment.fromJson(json['comment']) : null; |
||||||
|
this.commentStatus = json['commentStatus']; |
||||||
|
this.discountAmount = json['discountAmount']; |
||||||
|
this.id = json['id']; |
||||||
|
this.productId = json['productId']; |
||||||
|
this.productName = json['productName']; |
||||||
|
this.returnCode = json['returnCode']; |
||||||
|
this.returnStatus = json['returnStatus']; |
||||||
|
this.returnType = json['returnType']; |
||||||
|
this.sellPrice = json['sellPrice']; |
||||||
|
this.skuId = json['skuId']; |
||||||
|
this.skuImg = json['skuImg']; |
||||||
|
this.skuNameStr = json['skuNameStr']; |
||||||
|
} |
||||||
|
|
||||||
|
ActInfo actInfo; |
||||||
|
AdditionalComment additionalComment; |
||||||
|
int buyNum; |
||||||
|
String canApplyIntervention; |
||||||
|
Comment comment; |
||||||
|
String commentStatus; |
||||||
|
String discountAmount; |
||||||
|
String id; |
||||||
|
String productId; |
||||||
|
String productName; |
||||||
|
String returnCode; |
||||||
|
String returnStatus; |
||||||
|
String returnType; |
||||||
|
String sellPrice; |
||||||
|
String skuId; |
||||||
|
String skuImg; |
||||||
|
String skuNameStr; |
||||||
|
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
if (this.actInfo != null) { |
||||||
|
map['actInfo'] = this.actInfo.toJson(); |
||||||
|
} |
||||||
|
if (this.additionalComment != null) { |
||||||
|
map['additionalComment'] = this.additionalComment.toJson(); |
||||||
|
} |
||||||
|
map['buyNum'] = this.buyNum; |
||||||
|
map['canApplyIntervention'] = this.canApplyIntervention; |
||||||
|
if (this.comment != null) { |
||||||
|
map['comment'] = this.comment.toJson(); |
||||||
|
} |
||||||
|
map['commentStatus'] = this.commentStatus; |
||||||
|
map['discountAmount'] = this.discountAmount; |
||||||
|
map['id'] = this.id; |
||||||
|
map['productId'] = this.productId; |
||||||
|
map['productName'] = this.productName; |
||||||
|
map['returnCode'] = this.returnCode; |
||||||
|
map['returnStatus'] = this.returnStatus; |
||||||
|
map['returnType'] = this.returnType; |
||||||
|
map['sellPrice'] = this.sellPrice; |
||||||
|
map['skuId'] = this.skuId; |
||||||
|
map['skuImg'] = this.skuImg; |
||||||
|
map['skuNameStr'] = this.skuNameStr; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/// couponDiscountAmount : 0 |
||||||
|
/// couponDiscountRate : 0 |
||||||
|
/// couponId : 0 |
||||||
|
/// couponType : 0 |
||||||
|
/// discountAmount : 0 |
||||||
|
/// discountRate : 0 |
||||||
|
/// promotionId : 0 |
||||||
|
/// promotionType : 0 |
||||||
|
|
||||||
|
class ActInfo { |
||||||
|
ActInfo({ |
||||||
|
String couponDiscountAmount, |
||||||
|
int couponDiscountRate, |
||||||
|
String couponId, |
||||||
|
int couponType, |
||||||
|
String discountAmount, |
||||||
|
int discountRate, |
||||||
|
String promotionId, |
||||||
|
int promotionType, |
||||||
|
}) { |
||||||
|
this.couponDiscountAmount = couponDiscountAmount; |
||||||
|
this.couponDiscountRate = couponDiscountRate; |
||||||
|
this.couponId = couponId; |
||||||
|
this.couponType = couponType; |
||||||
|
this.discountAmount = discountAmount; |
||||||
|
this.discountRate = discountRate; |
||||||
|
this.promotionId = promotionId; |
||||||
|
this.promotionType = promotionType; |
||||||
|
} |
||||||
|
|
||||||
|
ActInfo.fromJson(dynamic json) { |
||||||
|
this.couponDiscountAmount = json['couponDiscountAmount']; |
||||||
|
this.couponDiscountRate = json['couponDiscountRate']; |
||||||
|
this.couponId = json['couponId']; |
||||||
|
this.couponType = json['couponType']; |
||||||
|
this.discountAmount = json['discountAmount']; |
||||||
|
this.discountRate = json['discountRate']; |
||||||
|
this.promotionId = json['promotionId']; |
||||||
|
this.promotionType = json['promotionType']; |
||||||
|
} |
||||||
|
|
||||||
|
String couponDiscountAmount; |
||||||
|
int couponDiscountRate; |
||||||
|
String couponId; |
||||||
|
int couponType; |
||||||
|
String discountAmount; |
||||||
|
int discountRate; |
||||||
|
String promotionId; |
||||||
|
int promotionType; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['couponDiscountAmount'] = this.couponDiscountAmount; |
||||||
|
map['couponDiscountRate'] = this.couponDiscountRate; |
||||||
|
map['couponId'] = this.couponId; |
||||||
|
map['couponType'] = this.couponType; |
||||||
|
map['discountAmount'] = this.discountAmount; |
||||||
|
map['discountRate'] = this.discountRate; |
||||||
|
map['promotionId'] = this.promotionId; |
||||||
|
map['promotionType'] = this.promotionType; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
class AdditionalComment { |
||||||
|
AdditionalComment({ |
||||||
|
int bizType, |
||||||
|
String commentImgs, |
||||||
|
bool commentImgsFlag, |
||||||
|
int commentStar, |
||||||
|
String commentText, |
||||||
|
int descStar, |
||||||
|
bool hideFlag, |
||||||
|
int id, |
||||||
|
bool isDelete, |
||||||
|
int likeNum, |
||||||
|
int logisticsStar, |
||||||
|
int mid, |
||||||
|
int orderProductId, |
||||||
|
int parentId, |
||||||
|
int productId, |
||||||
|
bool sensitiveFlag, |
||||||
|
int serviceStar, |
||||||
|
int storeId, |
||||||
|
}) { |
||||||
|
this.bizType = bizType; |
||||||
|
this.commentImgs = commentImgs; |
||||||
|
this.commentImgsFlag = commentImgsFlag; |
||||||
|
this.commentStar = commentStar; |
||||||
|
this.commentText = commentText; |
||||||
|
this.descStar = descStar; |
||||||
|
this.hideFlag = hideFlag; |
||||||
|
this.id = id; |
||||||
|
this.isDelete = isDelete; |
||||||
|
this.likeNum = likeNum; |
||||||
|
this.logisticsStar = logisticsStar; |
||||||
|
this.mid = mid; |
||||||
|
this.orderProductId = orderProductId; |
||||||
|
this.parentId = parentId; |
||||||
|
this.productId = productId; |
||||||
|
this.sensitiveFlag = sensitiveFlag; |
||||||
|
this.serviceStar = serviceStar; |
||||||
|
this.storeId = storeId; |
||||||
|
} |
||||||
|
|
||||||
|
AdditionalComment.fromJson(dynamic json) { |
||||||
|
this.bizType = json['bizType']; |
||||||
|
this.commentImgs = json['commentImgs']; |
||||||
|
this.commentImgsFlag = json['commentImgsFlag']; |
||||||
|
this.commentStar = json['commentStar']; |
||||||
|
this.commentText = json['commentText']; |
||||||
|
this.descStar = json['descStar']; |
||||||
|
this.hideFlag = json['hideFlag']; |
||||||
|
this.id = json['id']; |
||||||
|
this.isDelete = json['isDelete']; |
||||||
|
this.likeNum = json['likeNum']; |
||||||
|
this.logisticsStar = json['logisticsStar']; |
||||||
|
this.mid = json['mid']; |
||||||
|
this.orderProductId = json['orderProductId']; |
||||||
|
this.parentId = json['parentId']; |
||||||
|
this.productId = json['productId']; |
||||||
|
this.sensitiveFlag = json['sensitiveFlag']; |
||||||
|
this.serviceStar = json['serviceStar']; |
||||||
|
this.storeId = json['storeId']; |
||||||
|
} |
||||||
|
|
||||||
|
int bizType; |
||||||
|
String commentImgs; |
||||||
|
bool commentImgsFlag; |
||||||
|
int commentStar; |
||||||
|
String commentText; |
||||||
|
int descStar; |
||||||
|
bool hideFlag; |
||||||
|
int id; |
||||||
|
bool isDelete; |
||||||
|
int likeNum; |
||||||
|
int logisticsStar; |
||||||
|
int mid; |
||||||
|
int orderProductId; |
||||||
|
int parentId; |
||||||
|
int productId; |
||||||
|
bool sensitiveFlag; |
||||||
|
int serviceStar; |
||||||
|
int storeId; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['bizType'] = this.bizType; |
||||||
|
map['commentImgs'] = this.commentImgs; |
||||||
|
map['commentImgsFlag'] = this.commentImgsFlag; |
||||||
|
map['commentStar'] = this.commentStar; |
||||||
|
map['commentText'] = this.commentText; |
||||||
|
map['descStar'] = this.descStar; |
||||||
|
map['hideFlag'] = this.hideFlag; |
||||||
|
map['id'] = this.id; |
||||||
|
map['isDelete'] = this.isDelete; |
||||||
|
map['likeNum'] = this.likeNum; |
||||||
|
map['logisticsStar'] = this.logisticsStar; |
||||||
|
map['mid'] = this.mid; |
||||||
|
map['orderProductId'] = this.orderProductId; |
||||||
|
map['parentId'] = this.parentId; |
||||||
|
map['productId'] = this.productId; |
||||||
|
map['sensitiveFlag'] = this.sensitiveFlag; |
||||||
|
map['serviceStar'] = this.serviceStar; |
||||||
|
map['storeId'] = this.storeId; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
class Comment { |
||||||
|
Comment({ |
||||||
|
int bizType, |
||||||
|
String commentImgs, |
||||||
|
bool commentImgsFlag, |
||||||
|
int commentStar, |
||||||
|
String commentText, |
||||||
|
int descStar, |
||||||
|
bool hideFlag, |
||||||
|
int id, |
||||||
|
bool isDelete, |
||||||
|
int likeNum, |
||||||
|
int logisticsStar, |
||||||
|
int mid, |
||||||
|
int orderProductId, |
||||||
|
int parentId, |
||||||
|
int productId, |
||||||
|
bool sensitiveFlag, |
||||||
|
int serviceStar, |
||||||
|
int storeId, |
||||||
|
}) { |
||||||
|
this.bizType = bizType; |
||||||
|
this.commentImgs = commentImgs; |
||||||
|
this.commentImgsFlag = commentImgsFlag; |
||||||
|
this.commentStar = commentStar; |
||||||
|
this.commentText = commentText; |
||||||
|
this.descStar = descStar; |
||||||
|
this.hideFlag = hideFlag; |
||||||
|
this.id = id; |
||||||
|
this.isDelete = isDelete; |
||||||
|
this.likeNum = likeNum; |
||||||
|
this.logisticsStar = logisticsStar; |
||||||
|
this.mid = mid; |
||||||
|
this.orderProductId = orderProductId; |
||||||
|
this.parentId = parentId; |
||||||
|
this.productId = productId; |
||||||
|
this.sensitiveFlag = sensitiveFlag; |
||||||
|
this.serviceStar = serviceStar; |
||||||
|
this.storeId = storeId; |
||||||
|
} |
||||||
|
|
||||||
|
Comment.fromJson(dynamic json) { |
||||||
|
this.bizType = json['bizType']; |
||||||
|
this.commentImgs = json['commentImgs']; |
||||||
|
this.commentImgsFlag = json['commentImgsFlag']; |
||||||
|
this.commentStar = json['commentStar']; |
||||||
|
this.commentText = json['commentText']; |
||||||
|
this.descStar = json['descStar']; |
||||||
|
this.hideFlag = json['hideFlag']; |
||||||
|
this.id = json['id']; |
||||||
|
this.isDelete = json['isDelete']; |
||||||
|
this.likeNum = json['likeNum']; |
||||||
|
this.logisticsStar = json['logisticsStar']; |
||||||
|
this.mid = json['mid']; |
||||||
|
this.orderProductId = json['orderProductId']; |
||||||
|
this.parentId = json['parentId']; |
||||||
|
this.productId = json['productId']; |
||||||
|
this.sensitiveFlag = json['sensitiveFlag']; |
||||||
|
this.serviceStar = json['serviceStar']; |
||||||
|
this.storeId = json['storeId']; |
||||||
|
} |
||||||
|
|
||||||
|
int bizType; |
||||||
|
String commentImgs; |
||||||
|
bool commentImgsFlag; |
||||||
|
int commentStar; |
||||||
|
String commentText; |
||||||
|
int descStar; |
||||||
|
bool hideFlag; |
||||||
|
int id; |
||||||
|
bool isDelete; |
||||||
|
int likeNum; |
||||||
|
int logisticsStar; |
||||||
|
int mid; |
||||||
|
int orderProductId; |
||||||
|
int parentId; |
||||||
|
int productId; |
||||||
|
bool sensitiveFlag; |
||||||
|
int serviceStar; |
||||||
|
int storeId; |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
final map = <String, dynamic>{}; |
||||||
|
map['bizType'] = this.bizType; |
||||||
|
map['commentImgs'] = this.commentImgs; |
||||||
|
map['commentImgsFlag'] = this.commentImgsFlag; |
||||||
|
map['commentStar'] = this.commentStar; |
||||||
|
map['commentText'] = this.commentText; |
||||||
|
map['descStar'] = this.descStar; |
||||||
|
map['hideFlag'] = this.hideFlag; |
||||||
|
map['id'] = this.id; |
||||||
|
map['isDelete'] = this.isDelete; |
||||||
|
map['likeNum'] = this.likeNum; |
||||||
|
map['logisticsStar'] = this.logisticsStar; |
||||||
|
map['mid'] = this.mid; |
||||||
|
map['orderProductId'] = this.orderProductId; |
||||||
|
map['parentId'] = this.parentId; |
||||||
|
map['productId'] = this.productId; |
||||||
|
map['sensitiveFlag'] = this.sensitiveFlag; |
||||||
|
map['serviceStar'] = this.serviceStar; |
||||||
|
map['storeId'] = this.storeId; |
||||||
|
return map; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,491 +1,136 @@ |
|||||||
|
import 'package:huixiang/retrofit/data/down_order.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/order_product_vo.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
import 'package:huixiang/retrofit/data/shoppingCart.dart'; |
import 'package:huixiang/retrofit/data/shoppingCart.dart'; |
||||||
|
|
||||||
/// addressId : 0 |
|
||||||
/// isSubscribe : true |
|
||||||
/// isTakeOut : 0 |
|
||||||
/// notes : "" |
|
||||||
/// numberOfPeople : 0 |
|
||||||
/// orderSource : 0 |
|
||||||
/// orderType : 0 |
|
||||||
/// orderTypeId : 0 |
|
||||||
/// parentCode : "" |
|
||||||
/// parentId : 0 |
|
||||||
/// payChannel : 0 |
|
||||||
/// promotionInfoDTO : {"couponId":0,"promotionId":0} |
|
||||||
/// recMobile : "" |
|
||||||
/// shoppingCartSkuItemList : [] |
|
||||||
/// skuItemDTOList : [{"buyNum":0,"couponId":0,"couponName":"","discountPercent":0,"orderId":0,"orderProductId":0,"platterList":[{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}],"promotionId":0,"promotionName":"","refundNum":0,"skuId":0}] |
|
||||||
/// source : 0 |
|
||||||
/// storeId : 0 |
|
||||||
/// subcribeTime : "" |
|
||||||
/// tableId : 0 |
|
||||||
|
|
||||||
class PlaceOrderFirst { |
class PlaceOrderFirst { |
||||||
PlaceOrderFirst({ |
int cartNum; |
||||||
String addressId, |
String cartSum; |
||||||
bool isSubscribe, |
String addressId; |
||||||
int isTakeOut, |
bool isSubscribe; |
||||||
String notes, |
num isTakeOut; |
||||||
String numberOfPeople, |
String notes; |
||||||
int orderSource, |
String id; |
||||||
int orderType, |
String numberOfPeople; |
||||||
int orderTypeId, |
num orderSource; |
||||||
String parentCode, |
String orderType; |
||||||
int parentId, |
num orderTypeId; |
||||||
int payChannel, |
String parentCode; |
||||||
PlaceOrderFirstPromotionInfoDTO promotionInfoDTO, |
String parentId; |
||||||
String recMobile, |
num payChannel; |
||||||
List<ShoppingCartSkuItemListBean> shoppingCartSkuItemList, |
PromotionInfoDTOBean promotionInfoDTO; |
||||||
List<SkuItemDTOList> skuItemDTOList, |
String recMobile; |
||||||
int source, |
List<OrderProductVOList> orderProductVOList; |
||||||
String storeId, |
List<OrderProductListBean> shoppingCartSkuItemList; |
||||||
String subcribeTime, |
List<dynamic> skuItemDTOList; |
||||||
int tableId,}){ |
num source; |
||||||
_addressId = addressId; |
String storeId; |
||||||
_isSubscribe = isSubscribe; |
String subcribeTime; |
||||||
_isTakeOut = isTakeOut; |
String tableId; |
||||||
_notes = notes; |
|
||||||
_numberOfPeople = numberOfPeople; |
PlaceOrderFirst( |
||||||
_orderSource = orderSource; |
{ |
||||||
_orderType = orderType; |
this.cartNum, |
||||||
_orderTypeId = orderTypeId; |
this.cartSum, |
||||||
_parentCode = parentCode; |
this.addressId, |
||||||
_parentId = parentId; |
this.isSubscribe, |
||||||
_payChannel = payChannel; |
this.isTakeOut, |
||||||
_promotionInfoDTO = promotionInfoDTO; |
this.notes, |
||||||
_recMobile = recMobile; |
this.id, |
||||||
_skuItemDTOList = skuItemDTOList; |
this.numberOfPeople, |
||||||
_shoppingCartSkuItemList = shoppingCartSkuItemList; |
this.orderSource, |
||||||
_source = source; |
this.orderType, |
||||||
_storeId = storeId; |
this.orderTypeId, |
||||||
_subcribeTime = subcribeTime; |
this.parentCode, |
||||||
_tableId = tableId; |
this.parentId, |
||||||
|
this.payChannel, |
||||||
|
this.promotionInfoDTO, |
||||||
|
this.recMobile, |
||||||
|
this.orderProductVOList, |
||||||
|
this.shoppingCartSkuItemList, |
||||||
|
this.skuItemDTOList, |
||||||
|
this.source, |
||||||
|
this.storeId, |
||||||
|
this.subcribeTime, |
||||||
|
this.tableId}); |
||||||
|
|
||||||
|
static PlaceOrderFirst fromJson(Map<String, dynamic> json) { |
||||||
|
if (json == null) return null; |
||||||
|
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst(); |
||||||
|
placeOrderFirst.cartNum = json['cartNum']; |
||||||
|
placeOrderFirst.cartSum = json['cartSum']; |
||||||
|
placeOrderFirst.addressId = json['addressId']; |
||||||
|
placeOrderFirst.isSubscribe = json['isSubscribe']; |
||||||
|
placeOrderFirst.isTakeOut = json['isTakeOut']; |
||||||
|
placeOrderFirst.notes = json['notes']; |
||||||
|
placeOrderFirst.id = json['id']; |
||||||
|
placeOrderFirst.numberOfPeople = json['numberOfPeople']; |
||||||
|
placeOrderFirst.orderSource = json['orderSource']; |
||||||
|
placeOrderFirst.orderType = json['orderType']; |
||||||
|
placeOrderFirst.orderTypeId = json['orderTypeId']; |
||||||
|
placeOrderFirst.parentCode = json['parentCode']; |
||||||
|
placeOrderFirst.parentId = json['parentId']; |
||||||
|
placeOrderFirst.payChannel = json['payChannel']; |
||||||
|
placeOrderFirst.promotionInfoDTO = |
||||||
|
PromotionInfoDTOBean.fromJson(json['promotionInfoDTO']); |
||||||
|
placeOrderFirst.recMobile = json['recMobile']; |
||||||
|
placeOrderFirst.shoppingCartSkuItemList = []..addAll( |
||||||
|
(json['shoppingCartSkuItemList'] as List ?? []) |
||||||
|
.map((o) => OrderProductListBean.fromJson(o))); |
||||||
|
placeOrderFirst.orderProductVOList = []..addAll( |
||||||
|
(json['orderProductVOList'] as List ?? []) |
||||||
|
.map((o) => OrderProductVOList.fromJson(o))); |
||||||
|
placeOrderFirst.skuItemDTOList = json['skuItemDTOList']; |
||||||
|
placeOrderFirst.source = json['source']; |
||||||
|
placeOrderFirst.storeId = json['storeId']; |
||||||
|
placeOrderFirst.subcribeTime = json['subcribeTime']; |
||||||
|
placeOrderFirst.tableId = json['tableId']; |
||||||
|
return placeOrderFirst; |
||||||
|
} |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => { |
||||||
|
"cartNum": cartNum, |
||||||
|
"cartSum": cartSum, |
||||||
|
"addressId": addressId, |
||||||
|
"isSubscribe": isSubscribe, |
||||||
|
"isTakeOut": isTakeOut, |
||||||
|
"notes": notes, |
||||||
|
"id": id, |
||||||
|
"numberOfPeople": numberOfPeople, |
||||||
|
"orderSource": orderSource, |
||||||
|
"orderType": orderType, |
||||||
|
"orderTypeId": orderTypeId, |
||||||
|
"parentCode": parentCode, |
||||||
|
"parentId": parentId, |
||||||
|
"payChannel": payChannel, |
||||||
|
"promotionInfoDTO": promotionInfoDTO == null ? null : promotionInfoDTO.toJson(), |
||||||
|
"recMobile": recMobile, |
||||||
|
"shoppingCartSkuItemList": shoppingCartSkuItemList == null ? null : shoppingCartSkuItemList.map((e) => e.toJson()).toList(), |
||||||
|
"orderProductVOList": orderProductVOList == null ? null : orderProductVOList.map((e) => e.toJson()).toList(), |
||||||
|
"skuItemDTOList": skuItemDTOList, |
||||||
|
"source": source, |
||||||
|
"storeId": storeId, |
||||||
|
"subcribeTime": subcribeTime, |
||||||
|
"tableId": tableId, |
||||||
|
}; |
||||||
} |
} |
||||||
|
|
||||||
PlaceOrderFirst.fromJson(dynamic json) { |
class PromotionInfoDTOBean { |
||||||
_addressId = json['addressId']; |
String couponId; |
||||||
_isSubscribe = json['isSubscribe']; |
String promotionId; |
||||||
_isTakeOut = json['isTakeOut']; |
|
||||||
_notes = json['notes']; |
|
||||||
_numberOfPeople = json['numberOfPeople']; |
|
||||||
_orderSource = json['orderSource']; |
|
||||||
_orderType = json['orderType']; |
|
||||||
_orderTypeId = json['orderTypeId']; |
|
||||||
_parentCode = json['parentCode']; |
|
||||||
_parentId = json['parentId']; |
|
||||||
_payChannel = json['payChannel']; |
|
||||||
_promotionInfoDTO = json['promotionInfoDTO'] != null ? PlaceOrderFirstPromotionInfoDTO.fromJson(json['promotionInfoDTO']) : null; |
|
||||||
_recMobile = json['recMobile']; |
|
||||||
if (json['skuItemDTOList'] != null) { |
|
||||||
_skuItemDTOList = []; |
|
||||||
json['skuItemDTOList'].forEach((v) { |
|
||||||
_skuItemDTOList.add(SkuItemDTOList.fromJson(v)); |
|
||||||
}); |
|
||||||
} |
|
||||||
if (json['shoppingCartSkuItemList'] != null) { |
|
||||||
_shoppingCartSkuItemList = []; |
|
||||||
json['shoppingCartSkuItemList'].forEach((v) { |
|
||||||
_shoppingCartSkuItemList.add(ShoppingCartSkuItemListBean.fromJson(v)); |
|
||||||
}); |
|
||||||
} |
|
||||||
_source = json['source']; |
|
||||||
_storeId = json['storeId']; |
|
||||||
_subcribeTime = json['subcribeTime']; |
|
||||||
_tableId = json['tableId']; |
|
||||||
} |
|
||||||
String _addressId; |
|
||||||
bool _isSubscribe; |
|
||||||
int _isTakeOut; |
|
||||||
String _notes; |
|
||||||
String _numberOfPeople; |
|
||||||
int _orderSource; |
|
||||||
int _orderType; |
|
||||||
int _orderTypeId; |
|
||||||
String _parentCode; |
|
||||||
int _parentId; |
|
||||||
int _payChannel; |
|
||||||
PlaceOrderFirstPromotionInfoDTO _promotionInfoDTO; |
|
||||||
String _recMobile; |
|
||||||
List<SkuItemDTOList> _skuItemDTOList; |
|
||||||
List<ShoppingCartSkuItemListBean> _shoppingCartSkuItemList; |
|
||||||
int _source; |
|
||||||
String _storeId; |
|
||||||
String _subcribeTime; |
|
||||||
int _tableId; |
|
||||||
|
|
||||||
set addressId(String value) { |
|
||||||
_addressId = value; |
|
||||||
} |
|
||||||
|
|
||||||
String get addressId => _addressId; |
|
||||||
bool get isSubscribe => _isSubscribe; |
|
||||||
int get isTakeOut => _isTakeOut; |
|
||||||
String get notes => _notes; |
|
||||||
String get numberOfPeople => _numberOfPeople; |
|
||||||
int get orderSource => _orderSource; |
|
||||||
int get orderType => _orderType; |
|
||||||
int get orderTypeId => _orderTypeId; |
|
||||||
String get parentCode => _parentCode; |
|
||||||
int get parentId => _parentId; |
|
||||||
int get payChannel => _payChannel; |
|
||||||
PlaceOrderFirstPromotionInfoDTO get promotionInfoDTO => _promotionInfoDTO; |
|
||||||
String get recMobile => _recMobile; |
|
||||||
List<SkuItemDTOList> get skuItemDTOList => _skuItemDTOList; |
|
||||||
List<ShoppingCartSkuItemListBean> get shoppingCartSkuItemList => _shoppingCartSkuItemList; |
|
||||||
int get source => _source; |
|
||||||
String get storeId => _storeId; |
|
||||||
String get subcribeTime => _subcribeTime; |
|
||||||
int get tableId => _tableId; |
|
||||||
|
|
||||||
Map<String, dynamic> toJson() { |
|
||||||
final map = <String, dynamic>{}; |
|
||||||
map['addressId'] = _addressId; |
|
||||||
map['isSubscribe'] = _isSubscribe; |
|
||||||
map['isTakeOut'] = _isTakeOut; |
|
||||||
map['notes'] = _notes; |
|
||||||
map['numberOfPeople'] = _numberOfPeople; |
|
||||||
map['orderSource'] = _orderSource; |
|
||||||
map['orderType'] = _orderType; |
|
||||||
map['orderTypeId'] = _orderTypeId; |
|
||||||
map['parentCode'] = _parentCode; |
|
||||||
map['parentId'] = _parentId; |
|
||||||
map['payChannel'] = _payChannel; |
|
||||||
if (_promotionInfoDTO != null) { |
|
||||||
map['promotionInfoDTO'] = _promotionInfoDTO.toJson(); |
|
||||||
} |
|
||||||
map['recMobile'] = _recMobile; |
|
||||||
if (_skuItemDTOList != null) { |
|
||||||
map['skuItemDTOList'] = _skuItemDTOList.map((v) => v.toJson()).toList(); |
|
||||||
} |
|
||||||
if (_shoppingCartSkuItemList != null) { |
|
||||||
map['shoppingCartSkuItemList'] = _shoppingCartSkuItemList.map((v) => v.toJson()).toList(); |
|
||||||
} |
|
||||||
map['source'] = _source; |
|
||||||
map['storeId'] = _storeId; |
|
||||||
map['subcribeTime'] = _subcribeTime; |
|
||||||
map['tableId'] = _tableId; |
|
||||||
return map; |
|
||||||
} |
|
||||||
|
|
||||||
set isSubscribe(bool value) { |
|
||||||
_isSubscribe = value; |
|
||||||
} |
|
||||||
|
|
||||||
set isTakeOut(int value) { |
|
||||||
_isTakeOut = value; |
|
||||||
} |
|
||||||
|
|
||||||
set notes(String value) { |
|
||||||
_notes = value; |
|
||||||
} |
|
||||||
|
|
||||||
set numberOfPeople(String value) { |
|
||||||
_numberOfPeople = value; |
|
||||||
} |
|
||||||
|
|
||||||
set orderSource(int value) { |
|
||||||
_orderSource = value; |
|
||||||
} |
|
||||||
|
|
||||||
set orderType(int value) { |
|
||||||
_orderType = value; |
|
||||||
} |
|
||||||
|
|
||||||
set orderTypeId(int value) { |
|
||||||
_orderTypeId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set parentCode(String value) { |
|
||||||
_parentCode = value; |
|
||||||
} |
|
||||||
|
|
||||||
set parentId(int value) { |
|
||||||
_parentId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set payChannel(int value) { |
|
||||||
_payChannel = value; |
|
||||||
} |
|
||||||
|
|
||||||
set promotionInfoDTO(PlaceOrderFirstPromotionInfoDTO value) { |
|
||||||
_promotionInfoDTO = value; |
|
||||||
} |
|
||||||
|
|
||||||
set recMobile(String value) { |
|
||||||
_recMobile = value; |
|
||||||
} |
|
||||||
|
|
||||||
set skuItemDTOList(List<SkuItemDTOList> value) { |
|
||||||
_skuItemDTOList = value; |
|
||||||
} |
|
||||||
|
|
||||||
set shoppingCartSkuItemList(List<ShoppingCartSkuItemListBean> value) { |
|
||||||
_shoppingCartSkuItemList = value; |
|
||||||
} |
|
||||||
|
|
||||||
set source(int value) { |
|
||||||
_source = value; |
|
||||||
} |
|
||||||
|
|
||||||
set storeId(String value) { |
|
||||||
_storeId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set subcribeTime(String value) { |
|
||||||
_subcribeTime = value; |
|
||||||
} |
|
||||||
|
|
||||||
set tableId(int value) { |
|
||||||
_tableId = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// buyNum : 0 |
|
||||||
/// couponId : 0 |
|
||||||
/// couponName : "" |
|
||||||
/// discountPercent : 0 |
|
||||||
/// orderId : 0 |
|
||||||
/// orderProductId : 0 |
|
||||||
/// platterList : [{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}] |
|
||||||
/// promotionId : 0 |
|
||||||
/// promotionName : "" |
|
||||||
/// refundNum : 0 |
|
||||||
/// skuId : 0 |
|
||||||
|
|
||||||
class SkuItemDTOList { |
|
||||||
SkuItemDTOList({ |
|
||||||
int buyNum, |
|
||||||
int couponId, |
|
||||||
String couponName, |
|
||||||
int discountPercent, |
|
||||||
int orderId, |
|
||||||
int orderProductId, |
|
||||||
List<PlatterList> platterList, |
|
||||||
int promotionId, |
|
||||||
String promotionName, |
|
||||||
int refundNum, |
|
||||||
String skuId,}){ |
|
||||||
_buyNum = buyNum; |
|
||||||
_couponId = couponId; |
|
||||||
_couponName = couponName; |
|
||||||
_discountPercent = discountPercent; |
|
||||||
_orderId = orderId; |
|
||||||
_orderProductId = orderProductId; |
|
||||||
_platterList = platterList; |
|
||||||
_promotionId = promotionId; |
|
||||||
_promotionName = promotionName; |
|
||||||
_refundNum = refundNum; |
|
||||||
_skuId = skuId; |
|
||||||
} |
|
||||||
|
|
||||||
SkuItemDTOList.fromJson(dynamic json) { |
|
||||||
_buyNum = json['buyNum']; |
|
||||||
_couponId = json['couponId']; |
|
||||||
_couponName = json['couponName']; |
|
||||||
_discountPercent = json['discountPercent']; |
|
||||||
_orderId = json['orderId']; |
|
||||||
_orderProductId = json['orderProductId']; |
|
||||||
if (json['platterList'] != null) { |
|
||||||
_platterList = []; |
|
||||||
json['platterList'].forEach((v) { |
|
||||||
_platterList.add(PlatterList.fromJson(v)); |
|
||||||
}); |
|
||||||
} |
|
||||||
_promotionId = json['promotionId']; |
|
||||||
_promotionName = json['promotionName']; |
|
||||||
_refundNum = json['refundNum']; |
|
||||||
_skuId = json['skuId']; |
|
||||||
} |
|
||||||
int _buyNum; |
|
||||||
int _couponId; |
|
||||||
String _couponName; |
|
||||||
int _discountPercent; |
|
||||||
int _orderId; |
|
||||||
int _orderProductId; |
|
||||||
List<PlatterList> _platterList; |
|
||||||
int _promotionId; |
|
||||||
String _promotionName; |
|
||||||
int _refundNum; |
|
||||||
String _skuId; |
|
||||||
|
|
||||||
int get buyNum => _buyNum; |
PromotionInfoDTOBean({this.couponId, this.promotionId}); |
||||||
int get couponId => _couponId; |
|
||||||
String get couponName => _couponName; |
|
||||||
int get discountPercent => _discountPercent; |
|
||||||
int get orderId => _orderId; |
|
||||||
int get orderProductId => _orderProductId; |
|
||||||
List<PlatterList> get platterList => _platterList; |
|
||||||
int get promotionId => _promotionId; |
|
||||||
String get promotionName => _promotionName; |
|
||||||
int get refundNum => _refundNum; |
|
||||||
String get skuId => _skuId; |
|
||||||
|
|
||||||
set buyNum(int value) { |
static PromotionInfoDTOBean fromJson(Map<String, dynamic> json) { |
||||||
_buyNum = value; |
if (json == null) return null; |
||||||
|
PromotionInfoDTOBean promotionInfoDTOBean = PromotionInfoDTOBean(); |
||||||
|
promotionInfoDTOBean.couponId = json['couponId']; |
||||||
|
promotionInfoDTOBean.promotionId = json['promotionId']; |
||||||
|
return promotionInfoDTOBean; |
||||||
} |
} |
||||||
|
|
||||||
Map<String, dynamic> toJson() { |
Map<String, dynamic> toJson() => { |
||||||
final map = <String, dynamic>{}; |
"couponId": couponId, |
||||||
map['buyNum'] = _buyNum; |
"promotionId": promotionId, |
||||||
map['couponId'] = _couponId; |
}; |
||||||
map['couponName'] = _couponName; |
|
||||||
map['discountPercent'] = _discountPercent; |
|
||||||
map['orderId'] = _orderId; |
|
||||||
map['orderProductId'] = _orderProductId; |
|
||||||
if (_platterList != null) { |
|
||||||
map['platterList'] = _platterList.map((v) => v.toJson()).toList(); |
|
||||||
} |
|
||||||
map['promotionId'] = _promotionId; |
|
||||||
map['promotionName'] = _promotionName; |
|
||||||
map['refundNum'] = _refundNum; |
|
||||||
map['skuId'] = _skuId; |
|
||||||
return map; |
|
||||||
} |
|
||||||
|
|
||||||
set couponId(int value) { |
|
||||||
_couponId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set couponName(String value) { |
|
||||||
_couponName = value; |
|
||||||
} |
|
||||||
|
|
||||||
set discountPercent(int value) { |
|
||||||
_discountPercent = value; |
|
||||||
} |
|
||||||
|
|
||||||
set orderId(int value) { |
|
||||||
_orderId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set orderProductId(int value) { |
|
||||||
_orderProductId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set platterList(List<PlatterList> value) { |
|
||||||
_platterList = value; |
|
||||||
} |
|
||||||
|
|
||||||
set promotionId(int value) { |
|
||||||
_promotionId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set promotionName(String value) { |
|
||||||
_promotionName = value; |
|
||||||
} |
|
||||||
|
|
||||||
set refundNum(int value) { |
|
||||||
_refundNum = value; |
|
||||||
} |
|
||||||
|
|
||||||
set skuId(String value) { |
|
||||||
_skuId = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// deleted : true |
|
||||||
/// id : 0 |
|
||||||
/// productId : 0 |
|
||||||
/// required : true |
|
||||||
/// skuId : 0 |
|
||||||
|
|
||||||
class PlatterList { |
|
||||||
PlatterList({ |
|
||||||
bool deleted, |
|
||||||
int id, |
|
||||||
String productId, |
|
||||||
bool required, |
|
||||||
String skuId,}){ |
|
||||||
_deleted = deleted; |
|
||||||
_id = id; |
|
||||||
_productId = productId; |
|
||||||
_required = required; |
|
||||||
_skuId = skuId; |
|
||||||
} |
|
||||||
|
|
||||||
PlatterList.fromJson(dynamic json) { |
|
||||||
_deleted = json['deleted']; |
|
||||||
_id = json['id']; |
|
||||||
_productId = json['productId']; |
|
||||||
_required = json['required']; |
|
||||||
_skuId = json['skuId']; |
|
||||||
} |
|
||||||
bool _deleted; |
|
||||||
int _id; |
|
||||||
String _productId; |
|
||||||
bool _required; |
|
||||||
String _skuId; |
|
||||||
|
|
||||||
bool get deleted => _deleted; |
|
||||||
int get id => _id; |
|
||||||
String get productId => _productId; |
|
||||||
bool get required => _required; |
|
||||||
String get skuId => _skuId; |
|
||||||
|
|
||||||
set deleted(bool value) { |
|
||||||
_deleted = value; |
|
||||||
} |
|
||||||
|
|
||||||
Map<String, dynamic> toJson() { |
|
||||||
final map = <String, dynamic>{}; |
|
||||||
map['deleted'] = _deleted; |
|
||||||
map['id'] = _id; |
|
||||||
map['productId'] = _productId; |
|
||||||
map['required'] = _required; |
|
||||||
map['skuId'] = _skuId; |
|
||||||
return map; |
|
||||||
} |
|
||||||
|
|
||||||
set id(int value) { |
|
||||||
_id = value; |
|
||||||
} |
|
||||||
|
|
||||||
set productId(String value) { |
|
||||||
_productId = value; |
|
||||||
} |
|
||||||
|
|
||||||
set required(bool value) { |
|
||||||
_required = value; |
|
||||||
} |
|
||||||
|
|
||||||
set skuId(String value) { |
|
||||||
_skuId = value; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// couponId : 0 |
|
||||||
/// promotionId : 0 |
|
||||||
|
|
||||||
class PlaceOrderFirstPromotionInfoDTO { |
|
||||||
PlaceOrderFirstPromotionInfoDTO({ |
|
||||||
String couponId, |
|
||||||
String promotionId,}){ |
|
||||||
_couponId = couponId; |
|
||||||
_promotionId = promotionId; |
|
||||||
} |
|
||||||
|
|
||||||
PlaceOrderFirstPromotionInfoDTO.fromJson(dynamic json) { |
|
||||||
_couponId = json['couponId']; |
|
||||||
_promotionId = json['promotionId']; |
|
||||||
} |
|
||||||
String _couponId; |
|
||||||
String _promotionId; |
|
||||||
|
|
||||||
set couponId(String value) { |
|
||||||
_couponId = value; |
|
||||||
} |
|
||||||
|
|
||||||
String get couponId => _couponId; |
|
||||||
String get promotionId => _promotionId; |
|
||||||
|
|
||||||
Map<String, dynamic> toJson() { |
|
||||||
final map = <String, dynamic>{}; |
|
||||||
map['couponId'] = _couponId; |
|
||||||
map['promotionId'] = _promotionId; |
|
||||||
return map; |
|
||||||
} |
|
||||||
|
|
||||||
set promotionId(String value) { |
|
||||||
_promotionId = value; |
|
||||||
} |
|
||||||
} |
} |
@ -0,0 +1,182 @@ |
|||||||
|
|
||||||
|
class ProductList { |
||||||
|
String _id; |
||||||
|
String _createTime; |
||||||
|
String _createUser; |
||||||
|
String _updateTime; |
||||||
|
String _updateUser; |
||||||
|
dynamic _tenantCode; |
||||||
|
String _storeId; |
||||||
|
String _orderId; |
||||||
|
String _productId; |
||||||
|
String _productName; |
||||||
|
String _skuId; |
||||||
|
String _skuNameStr; |
||||||
|
String _skuImg; |
||||||
|
int _buyNum; |
||||||
|
int _refundNum; |
||||||
|
double _weight; |
||||||
|
String _applyPrice; |
||||||
|
String _sellPrice; |
||||||
|
String _postPay; |
||||||
|
int _isDelete; |
||||||
|
String _discountAmount; |
||||||
|
int _discountPercent; |
||||||
|
bool _status; |
||||||
|
int _batch; |
||||||
|
|
||||||
|
String get id => _id; |
||||||
|
|
||||||
|
String get createTime => _createTime; |
||||||
|
|
||||||
|
String get createUser => _createUser; |
||||||
|
|
||||||
|
String get updateTime => _updateTime; |
||||||
|
|
||||||
|
String get updateUser => _updateUser; |
||||||
|
|
||||||
|
dynamic get tenantCode => _tenantCode; |
||||||
|
|
||||||
|
String get storeId => _storeId; |
||||||
|
|
||||||
|
String get orderId => _orderId; |
||||||
|
|
||||||
|
String get productId => _productId; |
||||||
|
|
||||||
|
String get productName => _productName; |
||||||
|
|
||||||
|
String get skuId => _skuId; |
||||||
|
|
||||||
|
String get skuNameStr => _skuNameStr; |
||||||
|
|
||||||
|
String get skuImg => _skuImg; |
||||||
|
|
||||||
|
int get buyNum => _buyNum; |
||||||
|
|
||||||
|
int get refundNum => _refundNum; |
||||||
|
|
||||||
|
double get weight => _weight; |
||||||
|
|
||||||
|
String get applyPrice => _applyPrice; |
||||||
|
|
||||||
|
String get sellPrice => _sellPrice; |
||||||
|
|
||||||
|
String get postPay => _postPay; |
||||||
|
|
||||||
|
int get isDelete => _isDelete; |
||||||
|
|
||||||
|
String get discountAmount => _discountAmount; |
||||||
|
|
||||||
|
int get discountPercent => _discountPercent; |
||||||
|
|
||||||
|
bool get status => _status; |
||||||
|
|
||||||
|
int get batch => _batch; |
||||||
|
|
||||||
|
ProductList( |
||||||
|
{String id, |
||||||
|
String createTime, |
||||||
|
String createUser, |
||||||
|
String updateTime, |
||||||
|
String updateUser, |
||||||
|
dynamic tenantCode, |
||||||
|
String storeId, |
||||||
|
String orderId, |
||||||
|
String productId, |
||||||
|
String productName, |
||||||
|
String skuId, |
||||||
|
String skuNameStr, |
||||||
|
String skuImg, |
||||||
|
int buyNum, |
||||||
|
int refundNum, |
||||||
|
double weight, |
||||||
|
String applyPrice, |
||||||
|
String sellPrice, |
||||||
|
String postPay, |
||||||
|
int isDelete, |
||||||
|
String discountAmount, |
||||||
|
int discountPercent, |
||||||
|
bool status, |
||||||
|
int batch}) { |
||||||
|
_id = id; |
||||||
|
_createTime = createTime; |
||||||
|
_createUser = createUser; |
||||||
|
_updateTime = updateTime; |
||||||
|
_updateUser = updateUser; |
||||||
|
_tenantCode = tenantCode; |
||||||
|
_storeId = storeId; |
||||||
|
_orderId = orderId; |
||||||
|
_productId = productId; |
||||||
|
_productName = productName; |
||||||
|
_skuId = skuId; |
||||||
|
_skuNameStr = skuNameStr; |
||||||
|
_skuImg = skuImg; |
||||||
|
_buyNum = buyNum; |
||||||
|
_refundNum = refundNum; |
||||||
|
_weight = weight; |
||||||
|
_applyPrice = applyPrice; |
||||||
|
_sellPrice = sellPrice; |
||||||
|
_postPay = postPay; |
||||||
|
_isDelete = isDelete; |
||||||
|
_discountAmount = discountAmount; |
||||||
|
_discountPercent = discountPercent; |
||||||
|
_status = status; |
||||||
|
_batch = batch; |
||||||
|
} |
||||||
|
|
||||||
|
ProductList.fromJson(dynamic json) { |
||||||
|
_id = json["id"]; |
||||||
|
_createTime = json["createTime"]; |
||||||
|
_createUser = json["createUser"]; |
||||||
|
_updateTime = json["updateTime"]; |
||||||
|
_updateUser = json["updateUser"]; |
||||||
|
_tenantCode = json["tenantCode"]; |
||||||
|
_storeId = json["storeId"]; |
||||||
|
_orderId = json["orderId"]; |
||||||
|
_productId = json["productId"]; |
||||||
|
_productName = json["productName"]; |
||||||
|
_skuId = json["skuId"]; |
||||||
|
_skuNameStr = json["skuNameStr"]; |
||||||
|
_skuImg = json["skuImg"]; |
||||||
|
_buyNum = json["buyNum"]; |
||||||
|
_refundNum = json["refundNum"]; |
||||||
|
_weight = json["weight"]; |
||||||
|
_applyPrice = json["applyPrice"]; |
||||||
|
_sellPrice = json["sellPrice"]; |
||||||
|
_postPay = json["postPay"]; |
||||||
|
_isDelete = json["isDelete"]; |
||||||
|
_discountAmount = json["discountAmount"]; |
||||||
|
_discountPercent = json["discountPercent"]; |
||||||
|
_status = json["status"]; |
||||||
|
_batch = json["batch"]; |
||||||
|
} |
||||||
|
|
||||||
|
Map<String, dynamic> toJson() { |
||||||
|
var map = <String, dynamic>{}; |
||||||
|
map["id"] = _id; |
||||||
|
map["createTime"] = _createTime; |
||||||
|
map["createUser"] = _createUser; |
||||||
|
map["updateTime"] = _updateTime; |
||||||
|
map["updateUser"] = _updateUser; |
||||||
|
map["tenantCode"] = _tenantCode; |
||||||
|
map["storeId"] = _storeId; |
||||||
|
map["orderId"] = _orderId; |
||||||
|
map["productId"] = _productId; |
||||||
|
map["productName"] = _productName; |
||||||
|
map["skuId"] = _skuId; |
||||||
|
map["skuNameStr"] = _skuNameStr; |
||||||
|
map["skuImg"] = _skuImg; |
||||||
|
map["buyNum"] = _buyNum; |
||||||
|
map["refundNum"] = _refundNum; |
||||||
|
map["weight"] = _weight; |
||||||
|
map["applyPrice"] = _applyPrice; |
||||||
|
map["sellPrice"] = _sellPrice; |
||||||
|
map["postPay"] = _postPay; |
||||||
|
map["isDelete"] = _isDelete; |
||||||
|
map["discountAmount"] = _discountAmount; |
||||||
|
map["discountPercent"] = _discountPercent; |
||||||
|
map["status"] = _status; |
||||||
|
map["batch"] = _batch; |
||||||
|
return map; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,519 @@ |
|||||||
|
import 'package:dio/dio.dart'; |
||||||
|
import 'package:flutter/cupertino.dart'; |
||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter/services.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:fluwx/fluwx.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/address.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/down_order.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/min_order_info.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settlement_bean.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/shoppingCart.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/wx_pay.dart'; |
||||||
|
import 'package:huixiang/retrofit/min_api.dart'; |
||||||
|
import 'package:huixiang/settlement/settlement_view/activity_coupon_remarks.dart'; |
||||||
|
import 'package:huixiang/settlement/settlement_view/distribution.dart'; |
||||||
|
import 'package:huixiang/settlement/settlement_view/edit_phone.dart'; |
||||||
|
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/utils/font_weight.dart'; |
||||||
|
import 'package:huixiang/utils/min.dart'; |
||||||
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||||
|
import 'package:huixiang/view_widget/round_button.dart'; |
||||||
|
import 'package:shared_preferences/shared_preferences.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
|
||||||
|
class Settlement extends StatefulWidget { |
||||||
|
final arguments; |
||||||
|
|
||||||
|
Settlement({this.arguments}); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _Settlement(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _Settlement extends State<Settlement> { |
||||||
|
MinApiService minService; |
||||||
|
Function(int type) callback; |
||||||
|
StoreInfo storeInfo; |
||||||
|
|
||||||
|
// ShoppingCart shopCarGoods; |
||||||
|
SettleOrderInfo settleOrderInfo; |
||||||
|
MinOrderInfo minOrderInfo; |
||||||
|
int selectedBtn = 0; |
||||||
|
String remakers = ""; |
||||||
|
String parentCode = ""; |
||||||
|
String parentId = ""; |
||||||
|
int payChannel = 4; |
||||||
|
int tableId = 0; |
||||||
|
|
||||||
|
Address address; |
||||||
|
CouponListBean couponListBean; |
||||||
|
PromotionInfoListBean promotion; |
||||||
|
String mobile; |
||||||
|
|
||||||
|
bool placeOrder = false; |
||||||
|
|
||||||
|
@override |
||||||
|
void initState() { |
||||||
|
super.initState(); |
||||||
|
tableId = widget.arguments["tableId"] ?? 0; |
||||||
|
parentCode = widget.arguments["parentCode"] ?? ""; |
||||||
|
parentId = widget.arguments["parentId"] ?? ""; |
||||||
|
storeInfo = widget.arguments["storeInfo"]; |
||||||
|
|
||||||
|
if (tableId == 0) { |
||||||
|
placeOrder = true; |
||||||
|
} |
||||||
|
|
||||||
|
SharedPreferences.getInstance().then((value) { |
||||||
|
String minToken = value.getString("minToken"); |
||||||
|
String tenant = value.getString("tenant"); |
||||||
|
String storeId = value.getString("storeId"); |
||||||
|
minService = MinApiService( |
||||||
|
Dio(), |
||||||
|
context: context, |
||||||
|
token: minToken, |
||||||
|
tenant: tenant, |
||||||
|
storeId: storeId, |
||||||
|
); |
||||||
|
queryOrderInfo(null, selectedBtn, null, 0, null); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
///订单结算信息 |
||||||
|
queryOrderInfo( |
||||||
|
addressId, |
||||||
|
isTake, |
||||||
|
memberCouponId, |
||||||
|
orderId, |
||||||
|
promotionId, |
||||||
|
) async { |
||||||
|
BaseData<SettleOrderInfo> baseData = await minService.getOrderInfo({ |
||||||
|
"addressId": addressId, |
||||||
|
"isTake": isTake, |
||||||
|
"memberCouponId": memberCouponId, |
||||||
|
"orderId": orderId, |
||||||
|
"promotionId": promotionId |
||||||
|
}).catchError((error) {}); |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
setState(() { |
||||||
|
settleOrderInfo = baseData.data; |
||||||
|
if (settleOrderInfo.orderProductList == null || |
||||||
|
settleOrderInfo.orderProductList.length == 0) { |
||||||
|
queryOrderDetails(parentId); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
///查看订单详情 |
||||||
|
queryOrderDetails(id) async { |
||||||
|
BaseData<MinOrderInfo> baseData = await minService.getOrderDetails({ |
||||||
|
"id": id, |
||||||
|
}).catchError((error) {}); |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
setState(() { |
||||||
|
minOrderInfo = baseData.data; |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
queryAddress(int selectedBtn) async { |
||||||
|
this.selectedBtn = selectedBtn; |
||||||
|
if (address != null) { |
||||||
|
queryOrderInfo(address.id, selectedBtn, null, 0, null); |
||||||
|
return; |
||||||
|
} |
||||||
|
BaseData<List<Address>> baseDate = |
||||||
|
await minService.queryAddress().catchError((error) {}); |
||||||
|
|
||||||
|
BMFCoordinate bmfCoordinate = BMFCoordinate( |
||||||
|
double.tryParse(storeInfo.latitude), |
||||||
|
double.tryParse(storeInfo.longitude), |
||||||
|
); |
||||||
|
if (baseDate != null && baseDate.isSuccess) { |
||||||
|
address = baseDate.data[0]; |
||||||
|
for (int i = 1; i < baseDate.data.length; i++) { |
||||||
|
Address address1 = baseDate.data[i]; |
||||||
|
|
||||||
|
BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert( |
||||||
|
coordinate: BMFCoordinate( |
||||||
|
double.tryParse(address.longitude), |
||||||
|
double.tryParse(address.latitude), |
||||||
|
), |
||||||
|
fromType: BMF_COORD_TYPE.COMMON, |
||||||
|
toType: BMF_COORD_TYPE.BD09LL); |
||||||
|
BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert( |
||||||
|
coordinate: BMFCoordinate( |
||||||
|
double.tryParse(address1.longitude), |
||||||
|
double.tryParse(address1.latitude), |
||||||
|
), |
||||||
|
fromType: BMF_COORD_TYPE.COMMON, |
||||||
|
toType: BMF_COORD_TYPE.BD09LL); |
||||||
|
|
||||||
|
double mi = await BMFCalculateUtils.getLocationDistance( |
||||||
|
bmfCoordinate, coordinate); |
||||||
|
double mi1 = await BMFCalculateUtils.getLocationDistance( |
||||||
|
bmfCoordinate, coordinate1); |
||||||
|
if (mi1 < mi) { |
||||||
|
address = address1; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
queryOrderInfo(address.id, selectedBtn, null, 0, null); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
PlaceOrderFirst placeOrderFirst; |
||||||
|
DownOrder downOrder; |
||||||
|
|
||||||
|
///小程序下单 |
||||||
|
queryPlaceOrderFirst() async { |
||||||
|
for (int i = 0; i < settleOrderInfo.orderProductList.length; i++) { |
||||||
|
settleOrderInfo.orderProductList.forEach((element1) { |
||||||
|
if (settleOrderInfo.orderProductList[i].productId == |
||||||
|
element1.productId) { |
||||||
|
settleOrderInfo.orderProductList[i].skuId = element1.skuId; |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
placeOrderFirst = PlaceOrderFirst(); |
||||||
|
placeOrderFirst.cartNum = settleOrderInfo.orderNum; |
||||||
|
placeOrderFirst.cartSum = settleOrderInfo.price; |
||||||
|
placeOrderFirst.addressId = address == null ? null : address.id; |
||||||
|
placeOrderFirst.isSubscribe = false; |
||||||
|
placeOrderFirst.isTakeOut = selectedBtn; |
||||||
|
placeOrderFirst.notes = remakers; |
||||||
|
placeOrderFirst.numberOfPeople = "0"; |
||||||
|
placeOrderFirst.orderSource = 2; |
||||||
|
placeOrderFirst.orderType = "0"; |
||||||
|
placeOrderFirst.orderTypeId = 0; |
||||||
|
placeOrderFirst.parentCode = parentCode; // 火锅加菜 |
||||||
|
placeOrderFirst.parentId = parentId; // 火锅加菜 |
||||||
|
placeOrderFirst.payChannel = payChannel; |
||||||
|
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); |
||||||
|
placeOrderFirst.promotionInfoDTO.promotionId = |
||||||
|
promotion != null ? promotion.id : ""; |
||||||
|
placeOrderFirst.promotionInfoDTO.couponId = |
||||||
|
couponListBean != null ? couponListBean.id : ""; |
||||||
|
placeOrderFirst.recMobile = |
||||||
|
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile; |
||||||
|
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList; |
||||||
|
placeOrderFirst.skuItemDTOList = []; |
||||||
|
placeOrderFirst.source = 1; |
||||||
|
placeOrderFirst.storeId = storeInfo.id; |
||||||
|
placeOrderFirst.subcribeTime = null; |
||||||
|
placeOrderFirst.tableId = "$tableId"; |
||||||
|
|
||||||
|
if (tableId == 0) { |
||||||
|
///正常的商店下单 |
||||||
|
BaseData<DownOrder> baseData = await minService |
||||||
|
.placeOrderFirst(placeOrderFirst.toJson()) |
||||||
|
.catchError((error) { |
||||||
|
print("error: $error"); |
||||||
|
}); |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
placeOrder = true; |
||||||
|
this.downOrder = baseData.data; |
||||||
|
querySettlement(); |
||||||
|
} |
||||||
|
} else { |
||||||
|
///火锅店下单, 等待结算 |
||||||
|
BaseData<DownOrder> baseData; |
||||||
|
if (parentId == "") { |
||||||
|
baseData = await minService |
||||||
|
.placeOrderFirst(placeOrderFirst.toJson()) |
||||||
|
.catchError((error) { |
||||||
|
print("error: $error"); |
||||||
|
}); |
||||||
|
} else { |
||||||
|
baseData = await minService |
||||||
|
.addOrder(placeOrderFirst.toJson()) |
||||||
|
.catchError((error) { |
||||||
|
print("error: $error"); |
||||||
|
}); |
||||||
|
} |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
placeOrder = true; |
||||||
|
this.downOrder = baseData.data; |
||||||
|
queryOrderDetails(parentId); |
||||||
|
setState(() {}); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
///结算 |
||||||
|
querySettlement() async { |
||||||
|
placeOrderFirst.id = parentId != "" ? parentId : downOrder.id; |
||||||
|
placeOrderFirst.orderProductVOList = downOrder.orderProductVOList; |
||||||
|
if (placeOrderFirst.payChannel == 1) { |
||||||
|
if (!(await Min.isInitialize())) { |
||||||
|
// 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, |
||||||
|
// 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, |
||||||
|
// 故而在此初始化一下 |
||||||
|
await Min.initialize(); |
||||||
|
} |
||||||
|
BaseData<WxPay> baseData = await minService |
||||||
|
.settlementWx(placeOrderFirst.toJson()) |
||||||
|
.catchError((error) {}); |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
WxPay wxPay = baseData.data; |
||||||
|
await registerWxApi( |
||||||
|
appId: wxPay.appId, |
||||||
|
doOnAndroid: true, |
||||||
|
universalLink: "https://hx.lotus-wallet.com/app/", |
||||||
|
); |
||||||
|
payWithWeChat( |
||||||
|
appId: wxPay.appId, |
||||||
|
partnerId: wxPay.partnerId, |
||||||
|
prepayId: wxPay.prepayId, |
||||||
|
packageValue: wxPay.packageValue, |
||||||
|
nonceStr: wxPay.nonceStr, |
||||||
|
timeStamp: int.tryParse(wxPay.timeStamp), |
||||||
|
sign: wxPay.sign, |
||||||
|
); |
||||||
|
weChatResponseEventHandler.listen((event) async { |
||||||
|
print("payCallback: ${event.errCode}"); |
||||||
|
toOrderDetails(placeOrderFirst.id); |
||||||
|
}); |
||||||
|
} |
||||||
|
} else { |
||||||
|
BaseData baseData = await minService |
||||||
|
.settlementApi(placeOrderFirst.toJson()) |
||||||
|
.catchError((error) {}); |
||||||
|
if (baseData != null && baseData.isSuccess) { |
||||||
|
toOrderDetails(placeOrderFirst.id); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
toOrderDetails(String orderId) { |
||||||
|
Navigator.of(context).popAndPushNamed( |
||||||
|
'/router/order_details', |
||||||
|
arguments: { |
||||||
|
"id": orderId, |
||||||
|
}, |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Stack( |
||||||
|
children: [ |
||||||
|
Positioned( |
||||||
|
top: 0, |
||||||
|
left: 0, |
||||||
|
right: 0, |
||||||
|
child: Container( |
||||||
|
height: 175.h, |
||||||
|
color: Color(0xFF3A405A), |
||||||
|
width: MediaQuery.of(context).size.width, |
||||||
|
), |
||||||
|
), |
||||||
|
Positioned( |
||||||
|
child: Scaffold( |
||||||
|
backgroundColor: Colors.transparent, |
||||||
|
appBar: MyAppBar( |
||||||
|
background: Color(0xFF3A405A), |
||||||
|
leadingColor: Colors.white, |
||||||
|
title: S.of(context).dingdanjiesuan, |
||||||
|
titleColor: Colors.white, |
||||||
|
brightness: Brightness.dark, |
||||||
|
titleSize: 18.sp, |
||||||
|
), |
||||||
|
body: Container( |
||||||
|
child: Column( |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Container( |
||||||
|
child: SingleChildScrollView( |
||||||
|
physics: BouncingScrollPhysics(), |
||||||
|
child: Container( |
||||||
|
child: Column( |
||||||
|
children: [ |
||||||
|
DistributionMode( |
||||||
|
queryOrderInfo, |
||||||
|
queryAddress, |
||||||
|
storeInfo, |
||||||
|
address, |
||||||
|
), |
||||||
|
|
||||||
|
SizedBox( |
||||||
|
height: 16, |
||||||
|
), |
||||||
|
|
||||||
|
/// 预留的手机号, 可修改 |
||||||
|
EditPhoneWidget( |
||||||
|
storeInfo, |
||||||
|
mobileChange, |
||||||
|
), |
||||||
|
|
||||||
|
///订单商品 |
||||||
|
SettlementOrderCommodity( |
||||||
|
selectedBtn, |
||||||
|
settleOrderInfo, |
||||||
|
minOrderInfo, |
||||||
|
), |
||||||
|
|
||||||
|
///优惠券/备注 |
||||||
|
ActivityCouponRemarks( |
||||||
|
couponCart, |
||||||
|
activityCart, |
||||||
|
settleOrderInfo, |
||||||
|
coupons, |
||||||
|
promotions, |
||||||
|
couponCount(), |
||||||
|
), |
||||||
|
|
||||||
|
///支付方式 |
||||||
|
PayMethod(payChannelCheck), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
flex: 1, |
||||||
|
), |
||||||
|
Container( |
||||||
|
height: 54.h, |
||||||
|
color: Colors.white, |
||||||
|
child: Row( |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Spacer(), |
||||||
|
Text( |
||||||
|
S.of(context).heji, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Colors.black, |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
minOrderInfo != null |
||||||
|
? "¥${minOrderInfo.orderSumPrice}" |
||||||
|
: "¥${settleOrderInfo == null ? "0" : settleOrderInfo.price}", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 20.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xFF32A060), |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
width: 28, |
||||||
|
), |
||||||
|
RoundButton( |
||||||
|
width: 103.w, |
||||||
|
height: 54.h, |
||||||
|
text: placeOrder ? S.current.jiesuan : "下单", |
||||||
|
textColor: Colors.white, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
backgroup: Color(0xFF32A060), |
||||||
|
fontSize: 16.sp, |
||||||
|
padding: EdgeInsets.symmetric( |
||||||
|
vertical: 5.h, |
||||||
|
), |
||||||
|
callback: () { |
||||||
|
queryPlaceOrderFirst(); |
||||||
|
}, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
left: 0, |
||||||
|
right: 0, |
||||||
|
top: 0, |
||||||
|
bottom: 0, |
||||||
|
), |
||||||
|
], |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
payChannelCheck(int payChannel) { |
||||||
|
this.payChannel = payChannel; |
||||||
|
} |
||||||
|
|
||||||
|
mobileChange(String mobile) { |
||||||
|
this.mobile = mobile; |
||||||
|
} |
||||||
|
|
||||||
|
int couponCount() { |
||||||
|
if (settleOrderInfo == null || |
||||||
|
settleOrderInfo.couponList == null || |
||||||
|
settleOrderInfo.couponList.length == 0) return 0; |
||||||
|
int count = 0; |
||||||
|
settleOrderInfo.couponList.forEach((element) { |
||||||
|
if (element.tenantCode == "") { |
||||||
|
count++; |
||||||
|
} |
||||||
|
}); |
||||||
|
return count; |
||||||
|
} |
||||||
|
|
||||||
|
String coupons = ""; |
||||||
|
String promotions = ""; |
||||||
|
|
||||||
|
///优惠券弹窗 |
||||||
|
couponCart() async { |
||||||
|
CouponListBean couponBean = await showModalBottomSheet( |
||||||
|
context: context, |
||||||
|
backgroundColor: Colors.transparent, |
||||||
|
builder: (context) { |
||||||
|
return SettlementCoupon(settleOrderInfo, storeInfo, |
||||||
|
couponBean: couponListBean); |
||||||
|
}, |
||||||
|
); |
||||||
|
if (couponBean != null) { |
||||||
|
this.couponListBean = couponBean; |
||||||
|
coupons = couponListBean.promotionName; |
||||||
|
promotions = ""; |
||||||
|
queryOrderInfo( |
||||||
|
address != null ? address.id : null, |
||||||
|
selectedBtn, |
||||||
|
couponListBean != null ? couponListBean.id : null, |
||||||
|
0, |
||||||
|
null, |
||||||
|
); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
///活动弹窗 |
||||||
|
activityCart() async { |
||||||
|
// if (couponListBean != null) return; |
||||||
|
PromotionInfoListBean pro = await showModalBottomSheet( |
||||||
|
context: context, |
||||||
|
backgroundColor: Colors.transparent, |
||||||
|
builder: (context) { |
||||||
|
return SettlementActivity(settleOrderInfo, storeInfo); |
||||||
|
}, |
||||||
|
); |
||||||
|
if (pro != null) { |
||||||
|
this.promotion = pro; |
||||||
|
promotions = promotion.name; |
||||||
|
coupons = ""; |
||||||
|
queryOrderInfo( |
||||||
|
address != null ? address.id : null, |
||||||
|
selectedBtn, |
||||||
|
null, |
||||||
|
0, |
||||||
|
promotion != null ? promotion.id : null, |
||||||
|
); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,165 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:huixiang/view_widget/custom_image.dart'; |
||||||
|
import 'package:huixiang/view_widget/icon_text.dart'; |
||||||
|
import 'package:huixiang/view_widget/round_button.dart'; |
||||||
|
|
||||||
|
class ActivityWidget extends StatefulWidget { |
||||||
|
final PromotionInfoListBean promotionInfoListBean; |
||||||
|
final StoreInfo storeInfo; |
||||||
|
final int index; |
||||||
|
|
||||||
|
final Function() callback; |
||||||
|
|
||||||
|
ActivityWidget(this.promotionInfoListBean, this.storeInfo, this.index, { this.callback, }); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _ActivityWidget(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _ActivityWidget extends State<ActivityWidget> { |
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Container( |
||||||
|
height: 177, |
||||||
|
width: double.infinity, |
||||||
|
padding: EdgeInsets.all(16), |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Colors.white, |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
boxShadow: [ |
||||||
|
BoxShadow( |
||||||
|
color: Colors.black.withAlpha(12), |
||||||
|
offset: Offset(0, 3), |
||||||
|
blurRadius: 14, |
||||||
|
spreadRadius: 0, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
child: Column( |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Row( |
||||||
|
children: [ |
||||||
|
MImage( |
||||||
|
widget.promotionInfoListBean != null |
||||||
|
? widget.promotionInfoListBean.image |
||||||
|
: "", |
||||||
|
fit: BoxFit.cover, |
||||||
|
aspectRatio: 1, |
||||||
|
errorSrc: "assets/image/default_1.png", |
||||||
|
fadeSrc: "assets/image/default_1.png", |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
width: 12.w, |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
widget.promotionInfoListBean != null |
||||||
|
? (widget.promotionInfoListBean.name ?? "") |
||||||
|
: "", |
||||||
|
style: TextStyle( |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Colors.black, |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
widget.promotionInfoListBean != null |
||||||
|
? (widget.promotionInfoListBean.description ?? "") |
||||||
|
: "", |
||||||
|
maxLines: 2, |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF727272), |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 8.w, |
||||||
|
), |
||||||
|
IconText( |
||||||
|
"全场通用", |
||||||
|
leftIcon: Icons.circle, |
||||||
|
iconColor: Color(0xFF32A060), |
||||||
|
iconSize: 6, |
||||||
|
textStyle: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF181818), |
||||||
|
), |
||||||
|
), |
||||||
|
IconText( |
||||||
|
widget.promotionInfoListBean != null |
||||||
|
? ("${widget.promotionInfoListBean.activityStartTime.split(" ")[0].replaceAll("-", ".")}-${widget.promotionInfoListBean.activityEndTime.split(" ")[0].replaceAll("-", ".")}") |
||||||
|
: "", |
||||||
|
leftIcon: Icons.circle, |
||||||
|
iconColor: Color(0xFF32A060), |
||||||
|
iconSize: 6, |
||||||
|
textStyle: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF181818), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
flex: 1, |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 12.w, |
||||||
|
), |
||||||
|
Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
"*优惠券与活动不可同时选择", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFFACACAC), |
||||||
|
), |
||||||
|
), |
||||||
|
if (widget.promotionInfoListBean != null && |
||||||
|
widget.promotionInfoListBean.canPartake) |
||||||
|
RoundButton( |
||||||
|
text: "选择活动", |
||||||
|
textColor: Colors.white, |
||||||
|
padding: EdgeInsets.symmetric( |
||||||
|
vertical: 4, |
||||||
|
horizontal: 8, |
||||||
|
), |
||||||
|
backgroup: Color(0xFF32A060), |
||||||
|
radius: 12, |
||||||
|
callback: widget.callback, |
||||||
|
) |
||||||
|
else |
||||||
|
Text( |
||||||
|
"条件未达", |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF868686), |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
fontSize: 12.sp, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,203 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
|
||||||
|
class ActivityCouponRemarks extends StatefulWidget { |
||||||
|
final Function() couponCart; |
||||||
|
final Function() activityCart; |
||||||
|
|
||||||
|
final String coupons; |
||||||
|
final String promotions; |
||||||
|
final SettleOrderInfo settleOrderInfo; |
||||||
|
final int couponCount; |
||||||
|
|
||||||
|
ActivityCouponRemarks( |
||||||
|
this.couponCart, |
||||||
|
this.activityCart, |
||||||
|
this.settleOrderInfo, |
||||||
|
this.coupons, |
||||||
|
this.promotions, |
||||||
|
this.couponCount, |
||||||
|
); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _ActivityCouponRemarks(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> { |
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Container( |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Colors.white, |
||||||
|
boxShadow: [ |
||||||
|
BoxShadow( |
||||||
|
color: Color(0x0D000000), |
||||||
|
offset: Offset(0, 3), |
||||||
|
blurRadius: 14, |
||||||
|
spreadRadius: 0, |
||||||
|
), |
||||||
|
], |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
), |
||||||
|
height: 122.h, |
||||||
|
margin: EdgeInsets.only( |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
top: 15, |
||||||
|
), |
||||||
|
padding: EdgeInsets.only( |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
top: 14, |
||||||
|
bottom: 14, |
||||||
|
), |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
InkWell( |
||||||
|
onTap: () { |
||||||
|
widget.activityCart(); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
flex: 1, |
||||||
|
child: Text( |
||||||
|
S.of(context).huodong, |
||||||
|
style: TextStyle( |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xFF353535), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
activityText(), |
||||||
|
textAlign: TextAlign.end, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xFF32A060), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
), |
||||||
|
), |
||||||
|
Icon( |
||||||
|
Icons.keyboard_arrow_right, |
||||||
|
size: 16, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 13, |
||||||
|
), |
||||||
|
InkWell( |
||||||
|
onTap: () { |
||||||
|
widget.couponCart(); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
flex: 1, |
||||||
|
child: Text( |
||||||
|
S.of(context).youhuiquan, |
||||||
|
style: TextStyle( |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xFF353535), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
couponText(), |
||||||
|
textAlign: TextAlign.end, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xFF32A060), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
), |
||||||
|
), |
||||||
|
Icon( |
||||||
|
Icons.keyboard_arrow_right, |
||||||
|
size: 16, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 13, |
||||||
|
), |
||||||
|
Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
flex: 1, |
||||||
|
child: Text( |
||||||
|
S.of(context).beizhu, |
||||||
|
style: TextStyle( |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xFF353535), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
"口味、面包硬度等", |
||||||
|
textAlign: TextAlign.end, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xFF353535), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
), |
||||||
|
), |
||||||
|
Icon( |
||||||
|
Icons.keyboard_arrow_right, |
||||||
|
size: 16, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
String activityText() { |
||||||
|
String promotion = ""; |
||||||
|
if (widget.promotions == null || widget.promotions == "") { |
||||||
|
promotion = "未选择任何活动"; |
||||||
|
if (widget.settleOrderInfo == null || widget.settleOrderInfo.promotionInfoList == null) { |
||||||
|
promotion = "暂无可选活动"; |
||||||
|
} else if (widget.coupons != null && widget.coupons != "") { |
||||||
|
promotion = "活动与优惠券不可同享"; |
||||||
|
} |
||||||
|
} else { |
||||||
|
promotion = widget.promotions; |
||||||
|
} |
||||||
|
return promotion; |
||||||
|
} |
||||||
|
|
||||||
|
String couponText() { |
||||||
|
String coupon = ""; |
||||||
|
if (widget.coupons == null || widget.coupons == "") { |
||||||
|
coupon = "未选择任何优惠券"; |
||||||
|
if (widget.settleOrderInfo == null || widget.settleOrderInfo.couponList == null) { |
||||||
|
coupon = "暂无可选优惠券"; |
||||||
|
} else if (widget.promotions != null && widget.promotions != "") { |
||||||
|
coupon = "优惠券与活动不可同享"; |
||||||
|
} |
||||||
|
} else { |
||||||
|
coupon = widget.coupons; |
||||||
|
} |
||||||
|
return coupon; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,268 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:huixiang/view_widget/separator.dart'; |
||||||
|
|
||||||
|
class CouponWidget extends StatefulWidget { |
||||||
|
final CouponListBean couponList; |
||||||
|
final StoreInfo storeInfo; |
||||||
|
final bool selected; |
||||||
|
|
||||||
|
CouponWidget( |
||||||
|
this.couponList, |
||||||
|
this.storeInfo, { |
||||||
|
this.selected = false, |
||||||
|
}); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _CouponWidget(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _CouponWidget extends State<CouponWidget> { |
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Container( |
||||||
|
height: 170, |
||||||
|
width: double.infinity, |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Colors.white, |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
boxShadow: [ |
||||||
|
BoxShadow( |
||||||
|
color: Colors.black.withAlpha(12), |
||||||
|
offset: Offset(0, 3), |
||||||
|
blurRadius: 14, |
||||||
|
spreadRadius: 0, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Container( |
||||||
|
margin: EdgeInsets.only(top: 14.h, bottom: 8.h), |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.baseline, |
||||||
|
textBaseline: TextBaseline.alphabetic, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
"¥", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 22.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
color: Color(0xff32A060), |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 4.h, |
||||||
|
), |
||||||
|
Text( |
||||||
|
"${double.tryParse(widget.couponList.discountAmount).toInt()}", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 40.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xff32A060), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
S |
||||||
|
.of(context) |
||||||
|
.manyuankeyong(widget.couponList.fullAmount), |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xff32A060), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
flex: 1, |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
flex: 2, |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Row( |
||||||
|
children: [ |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.fromLTRB(4, 2, 4, 2), |
||||||
|
decoration: BoxDecoration( |
||||||
|
borderRadius: BorderRadius.circular(2), |
||||||
|
border: Border.all( |
||||||
|
width: 1, |
||||||
|
color: Color(0xFFFF7A1A), |
||||||
|
style: BorderStyle.solid, |
||||||
|
), |
||||||
|
), |
||||||
|
child: Text( |
||||||
|
S.of(context).shangjiaquan, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 10.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
color: Color(0xFFFF7A1A), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
width: 8.w, |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
child: Text( |
||||||
|
widget.storeInfo.storeName, |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 16.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xff353535), |
||||||
|
), |
||||||
|
), |
||||||
|
flex: 1, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
Text( |
||||||
|
widget.couponList.promotionName, |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xff727272), |
||||||
|
), |
||||||
|
), |
||||||
|
Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.end, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
S.of(context).quanchangtongyong, |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF353535), |
||||||
|
fontSize: 12.sp, |
||||||
|
), |
||||||
|
), |
||||||
|
if (widget.couponList.usable) |
||||||
|
Container( |
||||||
|
margin: EdgeInsets.only(right: 23.w), |
||||||
|
child: GestureDetector( |
||||||
|
onTap: () { |
||||||
|
Navigator.of(context).pop(widget.couponList); |
||||||
|
}, |
||||||
|
child: Image.asset( |
||||||
|
widget.selected |
||||||
|
? "assets/image/icon_radio_unselected.png" |
||||||
|
: "assets/image/icon_radio_selected.png", |
||||||
|
width: 24, |
||||||
|
height: 24, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
flex: (widget.couponList?.isEx ?? false) ? 97 : 97, |
||||||
|
), |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.symmetric(horizontal: 23.w), |
||||||
|
child: MySeparator( |
||||||
|
width: 5.w, |
||||||
|
height: 1.h, |
||||||
|
color: Color(0xFF353535), |
||||||
|
), |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
flex: (widget.couponList?.isEx ?? false) ? 56 : 42, |
||||||
|
child: Container( |
||||||
|
margin: EdgeInsets.symmetric( |
||||||
|
horizontal: 23.w, |
||||||
|
vertical: 8.h, |
||||||
|
), |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
||||||
|
children: [ |
||||||
|
Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
S.of(context).xiangqing, |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF353535), |
||||||
|
fontSize: 10.sp, |
||||||
|
), |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
child: Icon( |
||||||
|
(!(widget.couponList?.isEx ?? false)) |
||||||
|
? Icons.keyboard_arrow_down |
||||||
|
: Icons.keyboard_arrow_up, |
||||||
|
color: Colors.black, |
||||||
|
size: 18, |
||||||
|
), //点击按钮布局 |
||||||
|
onTap: () { |
||||||
|
setState(() { |
||||||
|
widget.couponList.isEx = |
||||||
|
!(widget.couponList.isEx ?? false); |
||||||
|
}); |
||||||
|
}, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
if (widget.couponList?.isEx ?? false) |
||||||
|
Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
S.of(context).shiyongriqi, |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF353535), |
||||||
|
fontSize: 10.sp, |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
(widget.couponList.useStartTime == null && |
||||||
|
widget.couponList.useEndTime == null) |
||||||
|
? S.of(context).quantian |
||||||
|
: "${widget.couponList.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${widget.couponList.useEndTime.replaceAll("-", ".").split(" ")[0]}", |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF353535), |
||||||
|
fontSize: 10.sp, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,357 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; |
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||||
|
import 'package:flutter_svg/flutter_svg.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/address.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||||
|
import 'package:huixiang/utils/flutter_utils.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:huixiang/utils/location.dart'; |
||||||
|
import 'package:huixiang/view_widget/round_button.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
|
||||||
|
class DistributionMode extends StatefulWidget { |
||||||
|
final Function( |
||||||
|
String addressId, |
||||||
|
int isTake, |
||||||
|
String memberCouponId, |
||||||
|
int orderId, |
||||||
|
String promotionId, |
||||||
|
) queryOrderInfo; |
||||||
|
final Function(int selectedBtn) queryAddress; |
||||||
|
final StoreInfo storeInfo; |
||||||
|
final Address address; |
||||||
|
|
||||||
|
DistributionMode( |
||||||
|
this.queryOrderInfo, this.queryAddress, this.storeInfo, this.address); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _DistributionMode(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _DistributionMode extends State<DistributionMode> { |
||||||
|
List<String> addressBgs = [ |
||||||
|
"assets/svg/dingdan_ziqu.svg", |
||||||
|
"assets/svg/dingdan_waimai.svg", |
||||||
|
"assets/svg/dingdan_wuliu.svg", |
||||||
|
]; |
||||||
|
|
||||||
|
BMFCoordinate myLatLng; |
||||||
|
String distance = "0"; |
||||||
|
int selectedBtn = 0; |
||||||
|
|
||||||
|
@override |
||||||
|
void initState() { |
||||||
|
super.initState(); |
||||||
|
|
||||||
|
startLocation(); |
||||||
|
} |
||||||
|
|
||||||
|
///定位获取当前的位置 |
||||||
|
void startLocation() async { |
||||||
|
Location.getInstance() |
||||||
|
.aMapFlutterLocation |
||||||
|
.onResultCallback() |
||||||
|
.listen((event) { |
||||||
|
if (event != null && |
||||||
|
event["latitude"] != null && |
||||||
|
event["longitude"] != null) { |
||||||
|
print("location: $event"); |
||||||
|
if (event["latitude"] is String && event["longitude"] is String) { |
||||||
|
myLatLng = BMFCoordinate(double.tryParse(event["latitude"]), |
||||||
|
double.tryParse(event["longitude"])); |
||||||
|
} else { |
||||||
|
myLatLng = BMFCoordinate(event["latitude"], event["longitude"]); |
||||||
|
} |
||||||
|
calculate(); |
||||||
|
Location.getInstance().stopLocation(); |
||||||
|
} |
||||||
|
}); |
||||||
|
Location.getInstance().prepareLoc(); |
||||||
|
Location.getInstance().startLocation(context); |
||||||
|
} |
||||||
|
|
||||||
|
calculate() async { |
||||||
|
BMFCoordinate bmfCoordinate = BMFCoordinate( |
||||||
|
double.tryParse(widget.storeInfo.latitude), |
||||||
|
double.tryParse(widget.storeInfo.longitude), |
||||||
|
); |
||||||
|
distance = await AppUtils.calculateDistance(bmfCoordinate, myLatLng); |
||||||
|
setState(() {}); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Container( |
||||||
|
height: 143.h, |
||||||
|
margin: EdgeInsets.only( |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
top: 10, |
||||||
|
), |
||||||
|
child: Stack( |
||||||
|
children: [ |
||||||
|
Container( |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Color(0x80FFFFFF), |
||||||
|
boxShadow: [ |
||||||
|
BoxShadow( |
||||||
|
color: Color(0x0D000000), |
||||||
|
offset: Offset(0, 3), |
||||||
|
blurRadius: 14, |
||||||
|
spreadRadius: 0, |
||||||
|
), |
||||||
|
], |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
), |
||||||
|
child: SvgPicture.asset( |
||||||
|
addressBgs[selectedBtn], |
||||||
|
width: double.infinity, |
||||||
|
height: double.infinity, |
||||||
|
fit: BoxFit.fill, |
||||||
|
), |
||||||
|
), |
||||||
|
Column( |
||||||
|
children: [ |
||||||
|
Container( |
||||||
|
height: 50.h, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
mainAxisSize: MainAxisSize.max, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
flex: 1, |
||||||
|
child: GestureDetector( |
||||||
|
onTap: () { |
||||||
|
selectedBtn = 0; |
||||||
|
widget.queryOrderInfo( |
||||||
|
null, selectedBtn, null, 0, null); |
||||||
|
}, |
||||||
|
child: Container( |
||||||
|
height: 50.h, |
||||||
|
alignment: Alignment.center, |
||||||
|
child: Text( |
||||||
|
S.of(context).daodianziqu, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Colors.black, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
flex: 1, |
||||||
|
child: GestureDetector( |
||||||
|
onTap: () { |
||||||
|
selectedBtn = 1; |
||||||
|
widget.queryAddress(selectedBtn); |
||||||
|
}, |
||||||
|
child: Container( |
||||||
|
height: 50.h, |
||||||
|
alignment: Alignment.center, |
||||||
|
child: Text( |
||||||
|
S.of(context).waimaipeisong, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Colors.black, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
flex: 1, |
||||||
|
child: GestureDetector( |
||||||
|
onTap: () { |
||||||
|
SmartDialog.showToast("该功能暂未开放!", |
||||||
|
alignment: Alignment.center); |
||||||
|
}, |
||||||
|
child: Container( |
||||||
|
height: 50.h, |
||||||
|
alignment: Alignment.center, |
||||||
|
child: Text( |
||||||
|
S.of(context).kuaidiwuliu, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Colors.black, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
selectedBtn == 0 |
||||||
|
? Container( |
||||||
|
width: double.infinity, |
||||||
|
padding: EdgeInsets.only(left: 16, right: 16, top: 15), |
||||||
|
child: Column( |
||||||
|
children: [ |
||||||
|
Row( |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: |
||||||
|
MainAxisAlignment.spaceEvenly, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
mainAxisSize: MainAxisSize.max, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
widget.storeInfo != null |
||||||
|
? (widget.storeInfo.storeName ?? "") |
||||||
|
: "", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xFF4C4C4C), |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 6, |
||||||
|
), |
||||||
|
Text( |
||||||
|
widget.storeInfo != null |
||||||
|
? widget.storeInfo.address |
||||||
|
: "", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
maxLines: 2, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF727272), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
width: 18, |
||||||
|
), |
||||||
|
Stack( |
||||||
|
alignment: Alignment.center, |
||||||
|
children: [ |
||||||
|
Column( |
||||||
|
children: [ |
||||||
|
Image.asset( |
||||||
|
"assets/image/map.png", |
||||||
|
height: 61.h, |
||||||
|
width: 61.w, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
Column( |
||||||
|
children: [ |
||||||
|
RoundButton( |
||||||
|
width: 41.w, |
||||||
|
height: 13, |
||||||
|
text: distance.length > 3 |
||||||
|
? "${distance}km" |
||||||
|
: "距离您${distance}km", |
||||||
|
textColor: Color(0xFF34A262), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
radius: 7.5, |
||||||
|
backgroup: Colors.white, |
||||||
|
fontSize: 7.sp, |
||||||
|
), |
||||||
|
Image.asset( |
||||||
|
"assets/image/landmark.png", |
||||||
|
height: 24.h, |
||||||
|
width: 24.w, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
mainAxisSize: MainAxisSize.max, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
) |
||||||
|
: Container( |
||||||
|
width: double.infinity, |
||||||
|
padding: EdgeInsets.only(left: 16, right: 16, top: 15), |
||||||
|
child: Column( |
||||||
|
children: [ |
||||||
|
Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Image.asset( |
||||||
|
"assets/image/icon_permission_location.png", |
||||||
|
height: 24.h, |
||||||
|
width: 24.w, |
||||||
|
), |
||||||
|
Text( |
||||||
|
"张先生", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 15.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
color: Color(0xFF4C4C4C), |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
width: 13, |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
child: Text( |
||||||
|
"12309090909", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
maxLines: 2, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 15.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
color: Color(0xFF4C4C4C), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
InkWell( |
||||||
|
onTap: () { |
||||||
|
setState(() { |
||||||
|
Navigator.of(context).popAndPushNamed( |
||||||
|
'/router/manage_address_page'); |
||||||
|
}); |
||||||
|
}, |
||||||
|
child: Icon( |
||||||
|
Icons.keyboard_arrow_right, |
||||||
|
size: 24, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
Padding( |
||||||
|
padding: EdgeInsets.only(top: 4, left: 25), |
||||||
|
child: Text( |
||||||
|
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
maxLines: 2, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF727272), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,150 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter/services.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||||
|
import 'package:huixiang/utils/flutter_utils.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
|
||||||
|
class EditPhoneWidget extends StatefulWidget { |
||||||
|
|
||||||
|
final StoreInfo storeInfo; |
||||||
|
final Function(String headMobile) mobileChange; |
||||||
|
|
||||||
|
EditPhoneWidget(this.storeInfo, this.mobileChange); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _EditPhoneWidget(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _EditPhoneWidget extends State<EditPhoneWidget> { |
||||||
|
bool isEdit = false; |
||||||
|
TextEditingController _vc; |
||||||
|
|
||||||
|
@override |
||||||
|
void initState() { |
||||||
|
// TODO: implement initState |
||||||
|
super.initState(); |
||||||
|
_vc = TextEditingController( |
||||||
|
text: widget.storeInfo != null ? widget.storeInfo.headMobile : ""); |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Container( |
||||||
|
margin: EdgeInsets.only( |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
), |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Colors.white, |
||||||
|
boxShadow: [ |
||||||
|
BoxShadow( |
||||||
|
color: Color(0x0D000000), |
||||||
|
offset: Offset(0, 3), |
||||||
|
blurRadius: 14, |
||||||
|
spreadRadius: 0, |
||||||
|
), |
||||||
|
], |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
), |
||||||
|
padding: EdgeInsets.symmetric( |
||||||
|
horizontal: 12.w, |
||||||
|
vertical: 15.h, |
||||||
|
), |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.center, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
S.of(context).yuliudianhua, |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF4C4C4C), |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
width: 50, |
||||||
|
), |
||||||
|
Expanded( |
||||||
|
child: isEdit |
||||||
|
? Container( |
||||||
|
height: 25.h, |
||||||
|
alignment: Alignment.centerRight, |
||||||
|
child: TextField( |
||||||
|
controller: _vc, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
color: Color(0xFF4C4C4C), |
||||||
|
), |
||||||
|
textAlign: TextAlign.right, |
||||||
|
textAlignVertical: TextAlignVertical.center, |
||||||
|
keyboardType: TextInputType.phone, |
||||||
|
decoration: InputDecoration( |
||||||
|
errorBorder: InputBorder.none, |
||||||
|
focusedBorder: InputBorder.none, |
||||||
|
enabledBorder: InputBorder.none, |
||||||
|
hintText: "", |
||||||
|
hintStyle: TextStyle( |
||||||
|
fontSize: 10.sp, |
||||||
|
color: Color(0xFFA29E9E), |
||||||
|
), |
||||||
|
), |
||||||
|
textInputAction: TextInputAction.next, |
||||||
|
inputFormatters: [LengthLimitingTextInputFormatter(11)], |
||||||
|
cursorColor: Colors.grey, |
||||||
|
), |
||||||
|
) |
||||||
|
: Container( |
||||||
|
height: 25.h, |
||||||
|
alignment: Alignment.centerRight, |
||||||
|
child: Text( |
||||||
|
widget.storeInfo != null |
||||||
|
? widget.storeInfo.headMobile |
||||||
|
: "", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
textAlign: TextAlign.end, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF4C4C4C), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
String mobile = _vc.text; |
||||||
|
if (mobile != null && AppUtils.isPhone(mobile)) { |
||||||
|
widget.mobileChange(mobile); |
||||||
|
widget.storeInfo.headMobile = mobile; |
||||||
|
} |
||||||
|
setState(() { |
||||||
|
this.isEdit = !this.isEdit; |
||||||
|
}); |
||||||
|
}, |
||||||
|
child: Container( |
||||||
|
padding: EdgeInsets.all(8), |
||||||
|
child: isEdit |
||||||
|
? Icon( |
||||||
|
Icons.check, |
||||||
|
size: 14.w, |
||||||
|
color: Color(0xFF32A060), |
||||||
|
) |
||||||
|
: Image.asset( |
||||||
|
"assets/image/pen.png", |
||||||
|
height: 14.h, |
||||||
|
width: 14.w, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,163 @@ |
|||||||
|
|
||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
|
||||||
|
class PayMethod extends StatefulWidget { |
||||||
|
|
||||||
|
final Function(int payChannel) payChannelCheck; |
||||||
|
|
||||||
|
PayMethod(this.payChannelCheck); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _PayMethod(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
class _PayMethod extends State<PayMethod> { |
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Container( |
||||||
|
width: double.infinity, |
||||||
|
margin: EdgeInsets.only( |
||||||
|
left: 16.w, |
||||||
|
right: 16.w, |
||||||
|
top: 12.h, |
||||||
|
bottom: 4.h, |
||||||
|
), |
||||||
|
padding: EdgeInsets.only( |
||||||
|
left: 16.w, |
||||||
|
right: 16.w, |
||||||
|
top: 20.h, |
||||||
|
bottom: 20.h, |
||||||
|
), |
||||||
|
decoration: BoxDecoration( |
||||||
|
boxShadow: [ |
||||||
|
BoxShadow( |
||||||
|
color: Color(0x000000).withAlpha(25), |
||||||
|
offset: Offset(0, 1), |
||||||
|
blurRadius: 12.0, |
||||||
|
), |
||||||
|
], |
||||||
|
color: Colors.white, |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
), |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Padding( |
||||||
|
padding: EdgeInsets.only(bottom: 16.h), |
||||||
|
child: Text( |
||||||
|
S.of(context).zhifufangshi, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 16.sp, |
||||||
|
color: Colors.black, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
setState(() { |
||||||
|
checkIndex = 1; |
||||||
|
}); |
||||||
|
widget.payChannelCheck(4); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
checkView(1), |
||||||
|
Text( |
||||||
|
S.of(context).pingtaiyue, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xff353535), |
||||||
|
fontWeight: MyFontWeight.semi_bold,), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 10, |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
setState(() { |
||||||
|
checkIndex = 2; |
||||||
|
}); |
||||||
|
widget.payChannelCheck(3); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
checkView(2), |
||||||
|
Text( |
||||||
|
S.of(context).dianpuyue, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xff353535), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 10, |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
setState(() { |
||||||
|
checkIndex = 3; |
||||||
|
widget.payChannelCheck(1); |
||||||
|
}); |
||||||
|
}, |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
checkView(3), |
||||||
|
Spacer(), |
||||||
|
Image.asset("assets/image/icon_we_chat.png"), |
||||||
|
Padding( |
||||||
|
padding: EdgeInsets.only(left: 8.w), |
||||||
|
child: Text( |
||||||
|
S.of(context).weixinzhifu, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xff353535), |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
var checkIndex = 1; |
||||||
|
|
||||||
|
Widget checkView(var index) { |
||||||
|
return Container( |
||||||
|
padding: EdgeInsets.only(right: 16.w), |
||||||
|
alignment: Alignment.center, |
||||||
|
child: Image.asset( |
||||||
|
checkIndex != index |
||||||
|
? "assets/image/icon_radio_unselected.png" |
||||||
|
: "assets/image/icon_radio_selected.png", |
||||||
|
width: 15.w, |
||||||
|
height: 15.h, |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,174 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||||
|
import 'package:huixiang/settlement/settlement_view/activity.dart'; |
||||||
|
import 'package:huixiang/settlement/settlement_view/coupon.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
|
||||||
|
class SettlementActivity extends StatefulWidget { |
||||||
|
|
||||||
|
final StoreInfo storeInfo; |
||||||
|
final SettleOrderInfo settleOrderInfo; |
||||||
|
|
||||||
|
SettlementActivity(this.settleOrderInfo, this.storeInfo); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _SettlementActivity(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _SettlementActivity extends State<SettlementActivity> { |
||||||
|
List<PromotionInfoListBean> promotionInfoCan = []; |
||||||
|
List<PromotionInfoListBean> promotionInfoNo = []; |
||||||
|
|
||||||
|
@override |
||||||
|
void initState() { |
||||||
|
super.initState(); |
||||||
|
|
||||||
|
promotionInfoCan.clear(); |
||||||
|
promotionInfoNo.clear(); |
||||||
|
|
||||||
|
if (widget.settleOrderInfo != null && |
||||||
|
widget.settleOrderInfo.promotionInfoList != null && |
||||||
|
widget.settleOrderInfo.promotionInfoList.length > 0) { |
||||||
|
widget.settleOrderInfo.promotionInfoList.forEach((element) { |
||||||
|
if (element.canPartake) { |
||||||
|
promotionInfoCan.add(element); |
||||||
|
} else { |
||||||
|
promotionInfoNo.add(element); |
||||||
|
} |
||||||
|
}); |
||||||
|
setState(() {}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return StatefulBuilder( |
||||||
|
builder: (context1, state) { |
||||||
|
return Container( |
||||||
|
alignment: Alignment.topCenter, |
||||||
|
width: double.infinity, |
||||||
|
height: MediaQuery.of(context).size.height / 3 * 2, |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Colors.white, |
||||||
|
borderRadius: BorderRadius.only( |
||||||
|
topLeft: Radius.circular(8), |
||||||
|
topRight: Radius.circular(8), |
||||||
|
), |
||||||
|
), |
||||||
|
child: SingleChildScrollView( |
||||||
|
physics: BouncingScrollPhysics(), |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.start, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 16, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
bottom: 8, |
||||||
|
), |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Text( |
||||||
|
"可参加的活动(${promotionInfoCan.length})", |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF000000), |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
InkWell( |
||||||
|
onTap: () { |
||||||
|
Navigator.of(context).pop(); |
||||||
|
}, |
||||||
|
child: Image.asset( |
||||||
|
"assets/image/cancel.png", |
||||||
|
width: 24, |
||||||
|
height: 24, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 8, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
), |
||||||
|
child: ListView.builder( |
||||||
|
itemCount: (promotionInfoCan == null || |
||||||
|
promotionInfoCan.length == 0) |
||||||
|
? 0 |
||||||
|
: promotionInfoCan.length, |
||||||
|
shrinkWrap: true, |
||||||
|
physics: NeverScrollableScrollPhysics(), |
||||||
|
itemBuilder: (context, position) { |
||||||
|
return ActivityWidget( |
||||||
|
promotionInfoCan[position], |
||||||
|
widget.storeInfo, |
||||||
|
position, |
||||||
|
callback: (){ |
||||||
|
Navigator.of(context).pop(promotionInfoCan[position]); |
||||||
|
}, |
||||||
|
); |
||||||
|
}, |
||||||
|
), |
||||||
|
), |
||||||
|
if (promotionInfoNo != null || promotionInfoNo.length > 0) |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 16, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
bottom: 8, |
||||||
|
), |
||||||
|
child: Text( |
||||||
|
"不可参加的活动", |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF000000), |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
if (promotionInfoNo != null || promotionInfoNo.length > 0) |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 8, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
), |
||||||
|
child: ListView.builder( |
||||||
|
itemCount: (promotionInfoNo == null || |
||||||
|
promotionInfoNo.length == 0) |
||||||
|
? 0 |
||||||
|
: promotionInfoNo.length, |
||||||
|
shrinkWrap: true, |
||||||
|
physics: NeverScrollableScrollPhysics(), |
||||||
|
itemBuilder: (context, position) { |
||||||
|
return ActivityWidget( |
||||||
|
promotionInfoNo[position], |
||||||
|
widget.storeInfo, |
||||||
|
position, |
||||||
|
); |
||||||
|
}, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
); |
||||||
|
}, |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,166 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||||
|
import 'package:huixiang/settlement/settlement_view/coupon.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
|
||||||
|
class SettlementCoupon extends StatefulWidget { |
||||||
|
final StoreInfo storeInfo; |
||||||
|
final SettleOrderInfo settleOrderInfo; |
||||||
|
final CouponListBean couponBean; |
||||||
|
|
||||||
|
SettlementCoupon( |
||||||
|
this.settleOrderInfo, |
||||||
|
this.storeInfo, { |
||||||
|
this.couponBean, |
||||||
|
}); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _SettlementCoupon(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _SettlementCoupon extends State<SettlementCoupon> { |
||||||
|
List<CouponListBean> couponCan = []; |
||||||
|
List<CouponListBean> couponNo = []; |
||||||
|
|
||||||
|
@override |
||||||
|
void initState() { |
||||||
|
super.initState(); |
||||||
|
|
||||||
|
couponCan.clear(); |
||||||
|
couponNo.clear(); |
||||||
|
|
||||||
|
if (widget.settleOrderInfo != null && |
||||||
|
widget.settleOrderInfo.couponList != null && |
||||||
|
widget.settleOrderInfo.couponList.length > 0) { |
||||||
|
widget.settleOrderInfo.couponList.forEach((element) { |
||||||
|
if (element.usable) { |
||||||
|
couponCan.add(element); |
||||||
|
} else { |
||||||
|
couponNo.add(element); |
||||||
|
} |
||||||
|
}); |
||||||
|
setState(() {}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return StatefulBuilder( |
||||||
|
builder: (context1, state) { |
||||||
|
return Container( |
||||||
|
alignment: Alignment.topCenter, |
||||||
|
width: double.infinity, |
||||||
|
height: MediaQuery.of(context).size.height / 3 * 2, |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Colors.white, |
||||||
|
borderRadius: BorderRadius.only( |
||||||
|
topLeft: Radius.circular(8), |
||||||
|
topRight: Radius.circular(8), |
||||||
|
), |
||||||
|
), |
||||||
|
child: SingleChildScrollView( |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.start, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 16, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
bottom: 8, |
||||||
|
), |
||||||
|
child: Row( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: Text( |
||||||
|
"可用优惠券(${couponCan.length})", |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF000000), |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
InkWell( |
||||||
|
onTap: () { |
||||||
|
Navigator.of(context).pop(); |
||||||
|
}, |
||||||
|
child: Image.asset( |
||||||
|
"assets/image/cancel.png", |
||||||
|
width: 24, |
||||||
|
height: 24, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 8, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
), |
||||||
|
child: ListView.builder( |
||||||
|
itemCount: couponCan == null ? 0 : couponCan.length, |
||||||
|
physics: NeverScrollableScrollPhysics(), |
||||||
|
shrinkWrap: true, |
||||||
|
itemBuilder: (context, position) { |
||||||
|
return CouponWidget( |
||||||
|
couponCan[position], |
||||||
|
widget.storeInfo, |
||||||
|
selected: widget.couponBean == couponCan[position], |
||||||
|
); |
||||||
|
}, |
||||||
|
), |
||||||
|
), |
||||||
|
if (couponNo != null || couponNo.length > 0) |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 16, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
bottom: 8, |
||||||
|
), |
||||||
|
child: Text( |
||||||
|
"不可用优惠券", |
||||||
|
style: TextStyle( |
||||||
|
color: Color(0xFF000000), |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
if (couponNo != null || couponNo.length > 0) |
||||||
|
Container( |
||||||
|
padding: EdgeInsets.only( |
||||||
|
top: 8, |
||||||
|
left: 16, |
||||||
|
right: 16, |
||||||
|
), |
||||||
|
child: ListView.builder( |
||||||
|
itemCount: couponNo == null ? 0 : couponNo.length, |
||||||
|
physics: NeverScrollableScrollPhysics(), |
||||||
|
shrinkWrap: true, |
||||||
|
itemBuilder: (context, position) { |
||||||
|
return CouponWidget( |
||||||
|
couponNo[position], |
||||||
|
widget.storeInfo, |
||||||
|
); |
||||||
|
}, |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
); |
||||||
|
}, |
||||||
|
); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,53 @@ |
|||||||
|
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/view_widget/request_permission.dart'; |
||||||
|
import 'package:permission_handler/permission_handler.dart'; |
||||||
|
|
||||||
|
class Scan { |
||||||
|
|
||||||
|
static toScan(context, id, tenantCode, storeName) async { |
||||||
|
if (await Permission.camera.isPermanentlyDenied) { |
||||||
|
showCupertinoDialog( |
||||||
|
context: context, |
||||||
|
builder: (context) { |
||||||
|
return RequestPermission( |
||||||
|
"assets/image/icon_camera_permission_tips.png", |
||||||
|
S.of(context).ninxiangjiquanxianweikaiqi, |
||||||
|
S.of(context).weilekaipaizhaoxuanzhetouxiang, |
||||||
|
S.of(context).kaiqiquanxian, |
||||||
|
(result) async { |
||||||
|
if (result) { |
||||||
|
await openAppSettings(); |
||||||
|
} |
||||||
|
}, |
||||||
|
heightRatioWithWidth: 0.82, |
||||||
|
); |
||||||
|
}); |
||||||
|
} else if (await Permission.camera.isGranted) { |
||||||
|
var result = await Navigator.of(context).pushNamed('/router/qr_scan'); |
||||||
|
|
||||||
|
if (result != null && result != "") { |
||||||
|
Uri uri = Uri.parse(result); |
||||||
|
String table = uri.queryParameters["tableId"]; |
||||||
|
if (table != null && table != "") { |
||||||
|
int tableId = int.tryParse(table); |
||||||
|
Navigator.of(context).pushNamed( |
||||||
|
'/router/store_order', |
||||||
|
arguments: { |
||||||
|
"id": id, |
||||||
|
"tenant": tenantCode, |
||||||
|
"storeName": storeName, |
||||||
|
"tableId": tableId, |
||||||
|
}, |
||||||
|
); |
||||||
|
} |
||||||
|
} |
||||||
|
} else { |
||||||
|
await Permission.camera.request(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,139 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
import 'package:huixiang/view_widget/round_button.dart'; |
||||||
|
|
||||||
|
class PeopleNumView extends StatefulWidget { |
||||||
|
final String tableName; |
||||||
|
|
||||||
|
// final Function(int peopleNum) callback; |
||||||
|
|
||||||
|
PeopleNumView(this.tableName); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _PeopleNumView(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _PeopleNumView extends State<PeopleNumView> { |
||||||
|
int peopleNum = 1; |
||||||
|
|
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return SimpleDialog( |
||||||
|
titlePadding: EdgeInsets.all(10), |
||||||
|
backgroundColor: Colors.transparent, |
||||||
|
elevation: 0, |
||||||
|
shape: RoundedRectangleBorder( |
||||||
|
borderRadius: BorderRadius.circular(6), |
||||||
|
), |
||||||
|
children: [ |
||||||
|
Stack( |
||||||
|
alignment: Alignment.bottomCenter, |
||||||
|
children: [ |
||||||
|
Container( |
||||||
|
width: 295, |
||||||
|
height: 247, |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: Colors.white, |
||||||
|
borderRadius: BorderRadius.circular(8), |
||||||
|
), |
||||||
|
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20), |
||||||
|
child: Column( |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
"桌位:${widget.tableName}", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 16.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF171717), |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
"请选择用餐人数:$peopleNum人", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 16.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF171717), |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 10, |
||||||
|
), |
||||||
|
Container( |
||||||
|
child: GridView.builder( |
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
||||||
|
crossAxisCount: 5, |
||||||
|
crossAxisSpacing: 24, |
||||||
|
mainAxisSpacing: 18, |
||||||
|
childAspectRatio: 1, |
||||||
|
), |
||||||
|
shrinkWrap: true, |
||||||
|
itemCount: 10, |
||||||
|
padding: EdgeInsets.zero, |
||||||
|
physics: NeverScrollableScrollPhysics(), |
||||||
|
itemBuilder: (context, position) { |
||||||
|
return InkWell( |
||||||
|
onTap: () { |
||||||
|
setState(() { |
||||||
|
peopleNum = position + 1; |
||||||
|
}); |
||||||
|
}, |
||||||
|
child: Container( |
||||||
|
decoration: BoxDecoration( |
||||||
|
color: peopleNum == (position + 1) |
||||||
|
? Color(0xFF32A060) |
||||||
|
: Colors.transparent, |
||||||
|
border: Border.all( |
||||||
|
color: Color(0xFF32A060), |
||||||
|
width: 1, |
||||||
|
), |
||||||
|
borderRadius: BorderRadius.circular(3), |
||||||
|
), |
||||||
|
alignment: Alignment.center, |
||||||
|
child: Text( |
||||||
|
"${position + 1}", |
||||||
|
style: TextStyle( |
||||||
|
color: peopleNum == (position + 1) |
||||||
|
? Colors.white |
||||||
|
: Color(0xFF32A060), |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
fontSize: 16.sp, |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
); |
||||||
|
}, |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox( |
||||||
|
height: 10, |
||||||
|
), |
||||||
|
RoundButton( |
||||||
|
text: "确定", |
||||||
|
width: 130.w, |
||||||
|
height: 34.h, |
||||||
|
textColor: Colors.white, |
||||||
|
fontSize: 16.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
backgroup: Color(0xFF32A060), |
||||||
|
radius: 4.w, |
||||||
|
callback: () { |
||||||
|
// widget.callback(peopleNum); |
||||||
|
// SmartDialog.dismiss(); |
||||||
|
Navigator.of(context).pop(peopleNum); |
||||||
|
}, |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
], |
||||||
|
); |
||||||
|
} |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue