Browse Source

safety

master
fmk 3 years ago
parent
commit
a0d056ccab
  1. 13
      lib/mine/recharge_page.dart
  2. 2
      lib/mine/vip_detail_page.dart
  3. 113
      lib/order/order_detail_page.dart
  4. 4
      lib/order/order_history_page.dart
  5. 152
      lib/order/order_view/order_address.dart
  6. 84
      lib/order/order_view/order_commodity.dart
  7. 135
      lib/retrofit/data/down_order.dart
  8. 211
      lib/retrofit/data/order_info.dart
  9. 685
      lib/retrofit/data/order_product_vo.dart
  10. 606
      lib/retrofit/data/placeOrderFirst.dart
  11. 182
      lib/retrofit/data/product.dart
  12. 742
      lib/retrofit/data/settlement_bean.dart
  13. 11
      lib/retrofit/min_api.dart
  14. 28
      lib/retrofit/min_api.g.dart
  15. 130
      lib/settlement/settlement.dart
  16. 7
      lib/settlement/settlement_view/pay_method.dart
  17. 21
      lib/store/store_order.dart
  18. 6
      lib/store/store_view/store_order_list.dart

13
lib/mine/recharge_page.dart

@ -207,9 +207,9 @@ class _RechargePage extends State<RechargePage> {
} }
int amount = int.tryParse(money); int amount = int.tryParse(money);
if (checkIndex == 1) { if (checkIndex == 1) {
if (amount < 10) { if (amount < 10) {
SmartDialog.showToast(S.of(context).chongzhizuixiaojine(10), alignment: Alignment.center); SmartDialog.showToast(S.of(context).chongzhizuixiaojine(10),
alignment: Alignment.center);
return; return;
} }
@ -220,13 +220,15 @@ class _RechargePage extends State<RechargePage> {
await Min.initialize(); await Min.initialize();
} }
BaseData<WxPay> baseData = await apiService.recharge({"amount": amount, "rechargeType": 2}); BaseData<WxPay> baseData =
await apiService.recharge({"amount": amount, "rechargeType": 2});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data; WxPay wxPay = baseData.data;
await registerWxApi( await registerWxApi(
appId: wxPay.appId, appId: wxPay.appId,
doOnAndroid: true, doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/"); universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat( payWithWeChat(
appId: wxPay.appId, appId: wxPay.appId,
partnerId: wxPay.partnerId, partnerId: wxPay.partnerId,
@ -234,7 +236,8 @@ class _RechargePage extends State<RechargePage> {
packageValue: wxPay.packageValue, packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr, nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp), timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign); sign: wxPay.sign,
);
weChatResponseEventHandler.listen((event) async { weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}"); print("payCallback: ${event.errCode}");
}); });

2
lib/mine/vip_detail_page.dart

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/data/vip_card.dart'; import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';

113
lib/order/order_detail_page.dart

@ -8,6 +8,8 @@ import 'package:huixiang/order/order_view/order_info.dart';
import 'package:huixiang/order/order_view/order_status.dart'; import 'package:huixiang/order/order_view/order_status.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
@ -27,6 +29,7 @@ class OrderDetailPage extends StatefulWidget {
class _OrderDetailPage extends State<OrderDetailPage> { class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService; ApiService apiService;
MinApiService minService;
@override @override
void initState() { void initState() {
@ -38,10 +41,40 @@ class _OrderDetailPage extends State<OrderDetailPage> {
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
minLogin();
queryDetails(); queryDetails();
}); });
} }
///
minLogin() async {
apiService
.minLogin(widget.arguments["id"])
.catchError((onError) {})
.then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = widget.arguments["tenant"];
String storeId = widget.arguments["id"];
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
minService = MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
}
});
}
OrderInfo orderInfo; OrderInfo orderInfo;
int payStatus = 0; int payStatus = 0;
int orderStatus = 0; int orderStatus = 0;
@ -52,8 +85,9 @@ class _OrderDetailPage extends State<OrderDetailPage> {
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE // String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
queryDetails() async { queryDetails() async {
BaseData<OrderInfo> baseData = BaseData<OrderInfo> baseData = await apiService
await apiService.orderDetail(widget.arguments["id"]); .orderDetail(widget.arguments["id"])
.catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
orderInfo = baseData.data; orderInfo = baseData.data;
payStatus = orderInfo.payStatus; payStatus = orderInfo.payStatus;
@ -70,7 +104,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
if (mounted) if (mounted)
setState(() { setState(() {
statusTitle(); statusTitle();
}); });
} }
} }
@ -100,32 +133,25 @@ class _OrderDetailPage extends State<OrderDetailPage> {
titleColor: Colors.white, titleColor: Colors.white,
background: Colors.transparent, background: Colors.transparent,
leadingColor: Colors.white, leadingColor: Colors.white,
// toolbarHeight: (orderStatus >= 4 ? 118.h : 118.h) +
// MediaQuery.of(context).padding.top +
// kToolbarHeight,
brightness: Brightness.dark, brightness: Brightness.dark,
// bottom: PreferredSize(
// preferredSize: Size(
// double.infinity,
// orderStatus >= 4 ? 118.h : 118,
// ),
// child:
// ),
), ),
body: Container( body: Container(
child: child: SingleChildScrollView(
/*Column(
children: [
Expanded(
child:*/
SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
/// ///
OrderStatus(orderStatus, isTakeOut, sendStatus, payStatus, OrderStatus(
refundStatus, title, center, orderInfo), orderStatus,
isTakeOut,
sendStatus,
payStatus,
refundStatus,
title,
center,
orderInfo,
),
/// ///
OrderAddress( OrderAddress(
@ -136,13 +162,13 @@ class _OrderDetailPage extends State<OrderDetailPage> {
refundStatus, refundStatus,
title, title,
center, center,
carryOnPay,
_orderCancel, _orderCancel,
orderInfo), orderInfo,
),
/// ///
OrderCommodity(orderInfo), OrderCommodity(orderInfo),
// if (payStatus == 0) couponRemarks(),
/*(payStatus == 0) ? paySelector() : */
/// ///
OrderInfoView(orderInfo), OrderInfoView(orderInfo),
@ -154,19 +180,13 @@ class _OrderDetailPage extends State<OrderDetailPage> {
), ),
), ),
), ),
// flex: 1,
// ),
// if (payStatus == 0)
// bottomPay(),
// ],
// ),
), ),
), ),
left: 0, left: 0,
right: 0, right: 0,
top: 0, top: 0,
bottom: 0, bottom: 0,
) ),
], ],
); );
} }
@ -174,6 +194,36 @@ class _OrderDetailPage extends State<OrderDetailPage> {
String title = ""; String title = "";
String center = ""; String center = "";
carryOnPay() {
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 = orderInfo.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;
}
statusTitle() { statusTitle() {
if (isTakeOut == 0) { if (isTakeOut == 0) {
if (payStatus == 0) { if (payStatus == 0) {
@ -261,7 +311,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
} }
} }
Widget couponRemarks() { Widget couponRemarks() {
return Container( return Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 2.h), margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 2.h),

4
lib/order/order_history_page.dart

@ -4,7 +4,9 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/status_utils.dart'; import 'package:huixiang/utils/status_utils.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
@ -528,7 +530,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
return "$totalPrice"; return "$totalPrice";
} }
List<Widget> goodsItem(List<ProductList> products) { List<Widget> goodsItem(List<OrderProductVOList> products) {
if (products == null) return []; if (products == null) return [];
if (products.length > 3) { if (products.length > 3) {
products = products.sublist(0, 3); products = products.sublist(0, 3);

152
lib/order/order_view/order_address.dart

@ -19,6 +19,7 @@ class OrderAddress extends StatefulWidget {
final String title; final String title;
final String center; final String center;
final Function orderCancel; final Function orderCancel;
final Function carryOnPay;
final OrderInfo orderInfo; final OrderInfo orderInfo;
OrderAddress( OrderAddress(
@ -29,8 +30,9 @@ class OrderAddress extends StatefulWidget {
this.refundStatus, this.refundStatus,
this.title, this.title,
this.center, this.center,
this.carryOnPay,
this.orderCancel, this.orderCancel,
this.orderInfo); this.orderInfo,);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -195,7 +197,7 @@ class _OrderAddress extends State<OrderAddress> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (widget.payStatus == 0) { if (widget.payStatus == 0) {
carryOnPay(); widget.carryOnPay();
} else { } else {
String storeId = (widget.orderInfo != null && String storeId = (widget.orderInfo != null &&
widget.orderInfo.storeVO != null) widget.orderInfo.storeVO != null)
@ -258,77 +260,77 @@ class _OrderAddress extends State<OrderAddress> {
arguments: {"id": storeId, "storeName": storeName}); arguments: {"id": storeId, "storeName": storeName});
} }
carryOnPay() async { // carryOnPay() async {
showDialog( // showDialog(
context: context, // context: context,
builder: (context) { // builder: (context) {
return AlertDialog( // return AlertDialog(
content: Container( // content: Container(
width: MediaQuery.of(context).size.width - 84.w, // width: MediaQuery.of(context).size.width - 84.w,
height: 140.h, // height: 140.h,
child: Column( // child: Column(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
Text( // Text(
"app暂不支持支付,\n请前往对应小程序处理", // "app暂不支持支付,\n请前往对应小程序处理",
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle( // style: TextStyle(
fontSize: 16.sp, // fontSize: 16.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: Colors.black, // color: Colors.black,
), // ),
), // ),
SizedBox( // SizedBox(
height: 30.h, // height: 30.h,
), // ),
Row( // Row(
children: [ // children: [
Expanded( // Expanded(
child: InkWell( // child: InkWell(
child: BorderText( // child: BorderText(
text: "取消", // text: "取消",
textColor: Color(0xFF32A060), // textColor: Color(0xFF32A060),
fontSize: 16.sp, // fontSize: 16.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
borderColor: Color(0xFF32A060), // borderColor: Color(0xFF32A060),
radius: 4, // radius: 4,
padding: EdgeInsets.all(12), // padding: EdgeInsets.all(12),
borderWidth: 1, // borderWidth: 1,
), // ),
onTap: () { // onTap: () {
Navigator.of(context).pop(); // Navigator.of(context).pop();
}, // },
), // ),
flex: 1, // flex: 1,
), // ),
SizedBox( // SizedBox(
width: 16.w, // width: 16.w,
), // ),
Expanded( // Expanded(
child: InkWell( // child: InkWell(
child: RoundButton( // child: RoundButton(
text: "好的", // text: "好的",
textColor: Colors.white, // textColor: Colors.white,
radius: 4, // radius: 4,
padding: EdgeInsets.all(12), // padding: EdgeInsets.all(12),
backgroup: Color(0xFF32A060), // backgroup: Color(0xFF32A060),
fontSize: 16.sp, // fontSize: 16.sp,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
onTap: () { // onTap: () {
Navigator.of(context).pop(); // Navigator.of(context).pop();
}, // },
), // ),
flex: 1, // flex: 1,
), // ),
], // ],
), // ),
], // ],
), // ),
), // ),
); // );
}, // },
); // );
} // }
} }

84
lib/order/order_view/order_commodity.dart

@ -1,16 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/product.dart';
import 'package:huixiang/retrofit/data/settlement_bean.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/separator.dart'; import 'package:huixiang/view_widget/separator.dart';
class OrderCommodity extends StatefulWidget { class OrderCommodity extends StatefulWidget {
final OrderInfo orderInfo; final OrderInfo orderInfo;
OrderCommodity(this.orderInfo); OrderCommodity(this.orderInfo);
@ -19,7 +18,6 @@ class OrderCommodity extends StatefulWidget {
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _OrderCommodity(); return _OrderCommodity();
} }
} }
class _OrderCommodity extends State<OrderCommodity> { class _OrderCommodity extends State<OrderCommodity> {
@ -66,38 +64,57 @@ class _OrderCommodity extends State<OrderCommodity> {
); );
} }
List<Widget> commodityList() { List<Widget> commodityList() {
if (widget.orderInfo == null) return []; if (widget.orderInfo == null) return [];
List<Widget> widgets = []; List<Widget> widgets = [];
if (widget.orderInfo.productList != null) { if (widget.orderInfo.productList != null) {
widgets widgets.addAll(
.addAll(widget.orderInfo.productList.map((e) => commodityItem(e)).toList()); widget.orderInfo.productList.map((e) => commodityItem(e)).toList());
} }
widgets.add(SizedBox(height: 20.h)); widgets.add(SizedBox(height: 20.h));
if (widget.orderInfo.isTakeOut != 0) { if (widget.orderInfo.isTakeOut != 0) {
// //
widgets.add(discountItem( widgets.add(
discountItem(
Color(0xFFFF7A1A), Color(0xFFFF7A1A),
widget.orderInfo.isTakeOut == 1 widget.orderInfo.isTakeOut == 1
? S.of(context).peisongfei ? S.of(context).peisongfei
: S.of(context).yunfei, : S.of(context).yunfei,
"", "",
"+${widget.orderInfo.postFee}")); "+${widget.orderInfo.postFee}",
),
);
} }
if (widget.orderInfo.orderDetail != null && if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.couponDTO != null) { widget.orderInfo.orderDetail.couponDTO != null) {
// //
widgets.add(discountItem( widgets.add(
discountItem(
Color(0xFFFF7A1A), Color(0xFFFF7A1A),
S.of(context).youhuiquan, S.of(context).youhuiquan,
widget.orderInfo.orderDetail.couponDTO.name, widget.orderInfo.orderDetail.couponDTO.name,
widget.orderInfo.orderDetail.couponDTO.money)); widget.orderInfo.orderDetail.couponDTO.money,
),
);
}
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.activityPrice != null &&
double.tryParse(widget.orderInfo.orderDetail.activityPrice ?? "0") > 0) {
//
widgets.add(
discountItem(
Color(0xFFFF7A1A),
"活动",
widget.orderInfo.orderDetail.promotionName,
"- ${widget.orderInfo.orderDetail.activityPrice}",
),
);
} }
if (widget.orderInfo.storeVO != null && widget.orderInfo.storeVO.couponVO != null) { if (widget.orderInfo.storeVO != null &&
widget.orderInfo.storeVO.couponVO != null) {
// widgets.add(discountItem(Color(0xFF32A060), // widgets.add(discountItem(Color(0xFF32A060),
// orderInfo.storeVO.couponVO.storeName, // orderInfo.storeVO.couponVO.storeName,
// S.of(context).huodongjianmianpeisongfei(orderInfo.storeVO.couponVO.discountAmount), // S.of(context).huodongjianmianpeisongfei(orderInfo.storeVO.couponVO.discountAmount),
@ -119,7 +136,7 @@ class _OrderCommodity extends State<OrderCommodity> {
return widgets; return widgets;
} }
Widget commodityItem(ProductList productList) { Widget commodityItem(OrderProductVOList productList) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row( child: Row(
@ -171,8 +188,8 @@ class _OrderCommodity extends State<OrderCommodity> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
productList.weight != null productList.skuNameStr != null
? "${productList.weight}kg" ? "${productList.skuNameStr}"
: "", : "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@ -329,39 +346,50 @@ class _OrderCommodity extends State<OrderCommodity> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
S.of(context).gongjijianshangpin( S.of(context).gongjijianshangpin((widget.orderInfo != null &&
(widget.orderInfo != null && widget.orderInfo.productList != null) widget.orderInfo.productList != null)
? widget.orderInfo.productList.length ? widget.orderInfo.productList.length
: "0"), : "0"),
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold),
),
), ),
flex: 1, flex: 1,
), ),
Container(
child: Text(
"已优惠:¥${widget.orderInfo.orderDetail.activityPrice}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7B7B7B),
fontWeight: MyFontWeight.medium,
),
),
),
SizedBox(
width: 15.w,
),
Container( Container(
child: Text( child: Text(
S.of(context).jiesuanjine, S.of(context).jiesuanjine,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight:MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold),
),
), ),
), ),
SizedBox( SizedBox(
width: 5.w, width: 5.w,
), ),
Text( Text(
totalPrice(), "${widget.orderInfo.orderDetail.paySumPrice}"
/*totalPrice()*/,
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
fontSize:14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold),
),
) )
], ],
), ),
@ -374,9 +402,9 @@ class _OrderCommodity extends State<OrderCommodity> {
double.tryParse(widget.orderInfo.postFee)); double.tryParse(widget.orderInfo.postFee));
if (widget.orderInfo.orderDetail != null && if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.couponDTO != null) { widget.orderInfo.orderDetail.couponDTO != null) {
totalPrice -= double.tryParse(widget.orderInfo.orderDetail.couponDTO.money); totalPrice -=
double.tryParse(widget.orderInfo.orderDetail.couponDTO.money);
} }
return "$totalPrice"; return "$totalPrice";
} }
} }

135
lib/retrofit/data/down_order.dart

@ -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;
}
}

211
lib/retrofit/data/order_info.dart

@ -1,4 +1,8 @@
import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/order_product_vo.dart';
import 'package:huixiang/retrofit/data/shoppingCart.dart';
/// id : "1408358257373741056" /// id : "1408358257373741056"
/// createTime : "2021-06-25 17:35:49" /// createTime : "2021-06-25 17:35:49"
/// createUser : "1404743858104827904" /// createUser : "1404743858104827904"
@ -73,6 +77,7 @@ class OrderInfo {
String _parentId; String _parentId;
String _parentCode; String _parentCode;
String _orderCode; String _orderCode;
String _orderType;
String _dayFlowCode; String _dayFlowCode;
int _orderStatus; int _orderStatus;
int _sendStatus; int _sendStatus;
@ -118,7 +123,7 @@ class OrderInfo {
int _orderSource; int _orderSource;
StoreVO _storeVO; StoreVO _storeVO;
OrderDetail _orderDetail; OrderDetail _orderDetail;
List<ProductList> _productList; List<OrderProductVOList> _productList;
String get id => _id; String get id => _id;
@ -145,6 +150,7 @@ class OrderInfo {
String get parentCode => _parentCode; String get parentCode => _parentCode;
String get orderCode => _orderCode; String get orderCode => _orderCode;
String get orderType => _orderType;
String get dayFlowCode => _dayFlowCode; String get dayFlowCode => _dayFlowCode;
@ -236,7 +242,7 @@ class OrderInfo {
OrderDetail get orderDetail => _orderDetail; OrderDetail get orderDetail => _orderDetail;
List<ProductList> get productList => _productList; List<OrderProductVOList> get productList => _productList;
OrderInfo( OrderInfo(
{String id, {String id,
@ -297,7 +303,7 @@ class OrderInfo {
int orderSource, int orderSource,
StoreVO storeVO, StoreVO storeVO,
OrderDetail orderDetail, OrderDetail orderDetail,
List<ProductList> productList}) { List< OrderProductVOList> productList}) {
_id = id; _id = id;
_createTime = createTime; _createTime = createTime;
_createUser = createUser; _createUser = createUser;
@ -311,6 +317,7 @@ class OrderInfo {
_parentId = parentId; _parentId = parentId;
_parentCode = parentCode; _parentCode = parentCode;
_orderCode = orderCode; _orderCode = orderCode;
_orderType = orderType;
_dayFlowCode = dayFlowCode; _dayFlowCode = dayFlowCode;
_orderStatus = orderStatus; _orderStatus = orderStatus;
_sendStatus = sendStatus; _sendStatus = sendStatus;
@ -373,6 +380,7 @@ class OrderInfo {
_parentId = json["parentId"]; _parentId = json["parentId"];
_parentCode = json["parentCode"]; _parentCode = json["parentCode"];
_orderCode = json["orderCode"]; _orderCode = json["orderCode"];
_orderType = json["orderType"];
_dayFlowCode = json["dayFlowCode"]; _dayFlowCode = json["dayFlowCode"];
_orderStatus = json["orderStatus"]; _orderStatus = json["orderStatus"];
_sendStatus = json["sendStatus"]; _sendStatus = json["sendStatus"];
@ -426,7 +434,7 @@ class OrderInfo {
if (json["productList"] != null) { if (json["productList"] != null) {
_productList = []; _productList = [];
json["productList"].forEach((v) { json["productList"].forEach((v) {
_productList.add(ProductList.fromJson(v)); _productList.add( OrderProductVOList.fromJson(v));
}); });
} }
} }
@ -446,6 +454,7 @@ class OrderInfo {
map["parentId"] = _parentId; map["parentId"] = _parentId;
map["parentCode"] = _parentCode; map["parentCode"] = _parentCode;
map["orderCode"] = _orderCode; map["orderCode"] = _orderCode;
map["orderType"] = _orderType;
map["dayFlowCode"] = _dayFlowCode; map["dayFlowCode"] = _dayFlowCode;
map["orderStatus"] = _orderStatus; map["orderStatus"] = _orderStatus;
map["sendStatus"] = _sendStatus; map["sendStatus"] = _sendStatus;
@ -529,187 +538,6 @@ class OrderInfo {
/// status : true /// status : true
/// batch : 1 /// batch : 1
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;
}
}
/// orderProductList : [{"id":"1408358257390518272","platterList":null,"tenantCode":"1177","storeId":"1344490596986781696","orderId":"1408358257373741056","productId":"1404742074535772160","productName":"商品1","skuId":"1404744485652398080","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"weight":0,"applyPrice":"0.00","sellPrice":"10.00","postPay":"0.00","isDelete":0,"discountAmount":"2.20","discountPercent":100}] /// orderProductList : [{"id":"1408358257390518272","platterList":null,"tenantCode":"1177","storeId":"1344490596986781696","orderId":"1408358257373741056","productId":"1404742074535772160","productName":"商品1","skuId":"1404744485652398080","skuNameStr":"","skuImg":"","buyNum":2,"refundNum":0,"weight":0,"applyPrice":"0.00","sellPrice":"10.00","postPay":"0.00","isDelete":0,"discountAmount":"2.20","discountPercent":100}]
/// discountName : null /// discountName : null
@ -738,7 +566,7 @@ class ProductList {
/// predictTime : null /// predictTime : null
class OrderDetail { class OrderDetail {
List<ProductList> _orderProductList; List< OrderProductVOList> _orderProductList;
dynamic _discountName; dynamic _discountName;
dynamic _discountMoney; dynamic _discountMoney;
dynamic _discountNumber; dynamic _discountNumber;
@ -748,6 +576,7 @@ class OrderDetail {
String _paySumPrice; String _paySumPrice;
String _activityNoPrice; String _activityNoPrice;
String _activityPrice; String _activityPrice;
String _promotionName;
List<dynamic> _dishesList; List<dynamic> _dishesList;
String _customPrice; String _customPrice;
String _nextPerson; String _nextPerson;
@ -764,7 +593,7 @@ class OrderDetail {
int _mins; int _mins;
dynamic _predictTime; dynamic _predictTime;
List<ProductList> get orderProductList => _orderProductList; List< OrderProductVOList> get orderProductList => _orderProductList;
dynamic get discountName => _discountName; dynamic get discountName => _discountName;
@ -783,6 +612,7 @@ class OrderDetail {
String get activityNoPrice => _activityNoPrice; String get activityNoPrice => _activityNoPrice;
String get activityPrice => _activityPrice; String get activityPrice => _activityPrice;
String get promotionName => _promotionName;
List<dynamic> get dishesList => _dishesList; List<dynamic> get dishesList => _dishesList;
@ -815,7 +645,7 @@ class OrderDetail {
dynamic get predictTime => _predictTime; dynamic get predictTime => _predictTime;
OrderDetail( OrderDetail(
{List<ProductList> orderProductList, {List< OrderProductVOList> orderProductList,
dynamic discountName, dynamic discountName,
dynamic discountMoney, dynamic discountMoney,
dynamic discountNumber, dynamic discountNumber,
@ -825,6 +655,7 @@ class OrderDetail {
String paySumPrice, String paySumPrice,
String activityNoPrice, String activityNoPrice,
String activityPrice, String activityPrice,
String promotionName,
List<dynamic> dishesList, List<dynamic> dishesList,
String customPrice, String customPrice,
String nextPerson, String nextPerson,
@ -850,6 +681,7 @@ class OrderDetail {
_paySumPrice = paySumPrice; _paySumPrice = paySumPrice;
_activityNoPrice = activityNoPrice; _activityNoPrice = activityNoPrice;
_activityPrice = activityPrice; _activityPrice = activityPrice;
_promotionName = promotionName;
_dishesList = dishesList; _dishesList = dishesList;
_customPrice = customPrice; _customPrice = customPrice;
_nextPerson = nextPerson; _nextPerson = nextPerson;
@ -871,7 +703,7 @@ class OrderDetail {
if (json["orderProductList"] != null) { if (json["orderProductList"] != null) {
_orderProductList = []; _orderProductList = [];
json["orderProductList"].forEach((v) { json["orderProductList"].forEach((v) {
_orderProductList.add(ProductList.fromJson(v)); _orderProductList.add( OrderProductVOList.fromJson(v));
}); });
} }
_discountName = json["discountName"]; _discountName = json["discountName"];
@ -883,6 +715,7 @@ class OrderDetail {
_paySumPrice = json["paySumPrice"]; _paySumPrice = json["paySumPrice"];
_activityNoPrice = json["activityNoPrice"]; _activityNoPrice = json["activityNoPrice"];
_activityPrice = json["activityPrice"]; _activityPrice = json["activityPrice"];
_promotionName = json["promotionName"];
if (json["dishesList"] != null) { if (json["dishesList"] != null) {
_dishesList = []; _dishesList = [];
json["dishesList"].forEach((v) { json["dishesList"].forEach((v) {

685
lib/retrofit/data/order_product_vo.dart

@ -0,0 +1,685 @@
class OrderProductVOList {
OrderProductVOList({
ActInfo actInfo,
AdditionalComment additionalComment,
int buyNum,
int canApplyIntervention,
Comment comment,
int commentStatus,
int discountAmount,
int id,
int productId,
String productName,
String returnCode,
int returnStatus,
int returnType,
int sellPrice,
String skuId,
String skuImg,
String skuNameStr,}){
_actInfo = actInfo;
_additionalComment = additionalComment;
_buyNum = buyNum;
_canApplyIntervention = canApplyIntervention;
_comment = comment;
_commentStatus = commentStatus;
_discountAmount = discountAmount;
_id = id;
_productId = productId;
_productName = productName;
_returnCode = returnCode;
_returnStatus = returnStatus;
_returnType = returnType;
_sellPrice = sellPrice;
_skuId = skuId;
_skuImg = skuImg;
_skuNameStr = skuNameStr;
}
OrderProductVOList.fromJson(dynamic json) {
_actInfo = json['actInfo'] != null ? ActInfo.fromJson(json['actInfo']) : null;
_additionalComment = json['additionalComment'] != null ? AdditionalComment.fromJson(json['additionalComment']) : null;
_buyNum = json['buyNum'];
_canApplyIntervention = json['canApplyIntervention'];
_comment = json['comment'] != null ? Comment.fromJson(json['comment']) : null;
_commentStatus = json['commentStatus'];
_discountAmount = json['discountAmount'];
_id = json['id'];
_productId = json['productId'];
_productName = json['productName'];
_returnCode = json['returnCode'];
_returnStatus = json['returnStatus'];
_returnType = json['returnType'];
_sellPrice = json['sellPrice'];
_skuId = json['skuId'];
_skuImg = json['skuImg'];
_skuNameStr = json['skuNameStr'];
}
ActInfo _actInfo;
AdditionalComment _additionalComment;
int _buyNum;
int _canApplyIntervention;
Comment _comment;
int _commentStatus;
int _discountAmount;
int _id;
int _productId;
String _productName;
String _returnCode;
int _returnStatus;
int _returnType;
int _sellPrice;
String _skuId;
String _skuImg;
String _skuNameStr;
ActInfo get actInfo => _actInfo;
AdditionalComment get additionalComment => _additionalComment;
int get buyNum => _buyNum;
int get canApplyIntervention => _canApplyIntervention;
Comment get comment => _comment;
int get commentStatus => _commentStatus;
int get discountAmount => _discountAmount;
int get id => _id;
int get productId => _productId;
String get productName => _productName;
String get returnCode => _returnCode;
int get returnStatus => _returnStatus;
int get returnType => _returnType;
int get sellPrice => _sellPrice;
String get skuId => _skuId;
String get skuImg => _skuImg;
String get skuNameStr => _skuNameStr;
set actInfo(ActInfo value) {
_actInfo = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actInfo != null) {
map['actInfo'] = _actInfo.toJson();
}
if (_additionalComment != null) {
map['additionalComment'] = _additionalComment.toJson();
}
map['buyNum'] = _buyNum;
map['canApplyIntervention'] = _canApplyIntervention;
if (_comment != null) {
map['comment'] = _comment.toJson();
}
map['commentStatus'] = _commentStatus;
map['discountAmount'] = _discountAmount;
map['id'] = _id;
map['productId'] = _productId;
map['productName'] = _productName;
map['returnCode'] = _returnCode;
map['returnStatus'] = _returnStatus;
map['returnType'] = _returnType;
map['sellPrice'] = _sellPrice;
map['skuId'] = _skuId;
map['skuImg'] = _skuImg;
map['skuNameStr'] = _skuNameStr;
return map;
}
set additionalComment(AdditionalComment value) {
_additionalComment = value;
}
set buyNum(int value) {
_buyNum = value;
}
set canApplyIntervention(int value) {
_canApplyIntervention = value;
}
set comment(Comment value) {
_comment = value;
}
set commentStatus(int value) {
_commentStatus = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set id(int value) {
_id = value;
}
set productId(int value) {
_productId = value;
}
set productName(String value) {
_productName = value;
}
set returnCode(String value) {
_returnCode = value;
}
set returnStatus(int value) {
_returnStatus = value;
}
set returnType(int value) {
_returnType = value;
}
set sellPrice(int value) {
_sellPrice = value;
}
set skuId(String value) {
_skuId = value;
}
set skuImg(String value) {
_skuImg = value;
}
set skuNameStr(String value) {
_skuNameStr = value;
}
}
/// couponDiscountAmount : 0
/// couponDiscountRate : 0
/// couponId : 0
/// couponType : 0
/// discountAmount : 0
/// discountRate : 0
/// promotionId : 0
/// promotionType : 0
class ActInfo {
ActInfo({
int couponDiscountAmount,
int couponDiscountRate,
int couponId,
int couponType,
int discountAmount,
int discountRate,
int promotionId,
int promotionType,}){
_couponDiscountAmount = couponDiscountAmount;
_couponDiscountRate = couponDiscountRate;
_couponId = couponId;
_couponType = couponType;
_discountAmount = discountAmount;
_discountRate = discountRate;
_promotionId = promotionId;
_promotionType = promotionType;
}
ActInfo.fromJson(dynamic json) {
_couponDiscountAmount = json['couponDiscountAmount'];
_couponDiscountRate = json['couponDiscountRate'];
_couponId = json['couponId'];
_couponType = json['couponType'];
_discountAmount = json['discountAmount'];
_discountRate = json['discountRate'];
_promotionId = json['promotionId'];
_promotionType = json['promotionType'];
}
int _couponDiscountAmount;
int _couponDiscountRate;
int _couponId;
int _couponType;
int _discountAmount;
int _discountRate;
int _promotionId;
int _promotionType;
int get couponDiscountAmount => _couponDiscountAmount;
int get couponDiscountRate => _couponDiscountRate;
int get couponId => _couponId;
int get couponType => _couponType;
int get discountAmount => _discountAmount;
int get discountRate => _discountRate;
int get promotionId => _promotionId;
int get promotionType => _promotionType;
set couponDiscountAmount(int value) {
_couponDiscountAmount = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponDiscountAmount'] = _couponDiscountAmount;
map['couponDiscountRate'] = _couponDiscountRate;
map['couponId'] = _couponId;
map['couponType'] = _couponType;
map['discountAmount'] = _discountAmount;
map['discountRate'] = _discountRate;
map['promotionId'] = _promotionId;
map['promotionType'] = _promotionType;
return map;
}
set couponDiscountRate(int value) {
_couponDiscountRate = value;
}
set couponId(int value) {
_couponId = value;
}
set couponType(int value) {
_couponType = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set discountRate(int value) {
_discountRate = value;
}
set promotionId(int value) {
_promotionId = value;
}
set promotionType(int value) {
_promotionType = value;
}
}
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,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
AdditionalComment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_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;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}
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,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
Comment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_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;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}

606
lib/retrofit/data/placeOrderFirst.dart

@ -1,491 +1,135 @@
import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/order_product_vo.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<ShoppingCartSkuItemListBean> 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) => ShoppingCartSkuItemListBean.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;
}
} }

182
lib/retrofit/data/product.dart

@ -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;
}
}

742
lib/retrofit/data/settlement_bean.dart

@ -1,3 +1,5 @@
import 'package:huixiang/retrofit/data/order_product_vo.dart';
/// addressId : 0 /// addressId : 0
/// buyNum : 0 /// buyNum : 0
/// id : 0 /// id : 0
@ -139,743 +141,3 @@ class PromotionInfoDTO {
} }
} }
/// actInfo : {"couponDiscountAmount":0,"couponDiscountRate":0,"couponId":0,"couponType":0,"discountAmount":0,"discountRate":0,"promotionId":0,"promotionType":0}
/// additionalComment : {"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0}
/// buyNum : 0
/// canApplyIntervention : 0
/// comment : {"bizType":0,"commentImgs":"","commentImgsFlag":true,"commentStar":0,"commentText":"","descStar":0,"hideFlag":true,"id":0,"isDelete":true,"likeNum":0,"logisticsStar":0,"mid":0,"orderProductId":0,"parentId":0,"productId":0,"sensitiveFlag":true,"serviceStar":0,"storeId":0}
/// commentStatus : 0
/// discountAmount : 0
/// id : 0
/// productId : 0
/// productName : ""
/// returnCode : ""
/// returnStatus : 0
/// returnType : 0
/// sellPrice : 0
/// skuId : 0
/// skuImg : ""
/// skuNameStr : ""
class OrderProductVOList {
OrderProductVOList({
ActInfo actInfo,
AdditionalComment additionalComment,
int buyNum,
int canApplyIntervention,
Comment comment,
int commentStatus,
int discountAmount,
int id,
int productId,
String productName,
String returnCode,
int returnStatus,
int returnType,
int sellPrice,
String skuId,
String skuImg,
String skuNameStr,}){
_actInfo = actInfo;
_additionalComment = additionalComment;
_buyNum = buyNum;
_canApplyIntervention = canApplyIntervention;
_comment = comment;
_commentStatus = commentStatus;
_discountAmount = discountAmount;
_id = id;
_productId = productId;
_productName = productName;
_returnCode = returnCode;
_returnStatus = returnStatus;
_returnType = returnType;
_sellPrice = sellPrice;
_skuId = skuId;
_skuImg = skuImg;
_skuNameStr = skuNameStr;
}
OrderProductVOList.fromJson(dynamic json) {
_actInfo = json['actInfo'] != null ? ActInfo.fromJson(json['actInfo']) : null;
_additionalComment = json['additionalComment'] != null ? AdditionalComment.fromJson(json['additionalComment']) : null;
_buyNum = json['buyNum'];
_canApplyIntervention = json['canApplyIntervention'];
_comment = json['comment'] != null ? Comment.fromJson(json['comment']) : null;
_commentStatus = json['commentStatus'];
_discountAmount = json['discountAmount'];
_id = json['id'];
_productId = json['productId'];
_productName = json['productName'];
_returnCode = json['returnCode'];
_returnStatus = json['returnStatus'];
_returnType = json['returnType'];
_sellPrice = json['sellPrice'];
_skuId = json['skuId'];
_skuImg = json['skuImg'];
_skuNameStr = json['skuNameStr'];
}
ActInfo _actInfo;
AdditionalComment _additionalComment;
int _buyNum;
int _canApplyIntervention;
Comment _comment;
int _commentStatus;
int _discountAmount;
int _id;
int _productId;
String _productName;
String _returnCode;
int _returnStatus;
int _returnType;
int _sellPrice;
String _skuId;
String _skuImg;
String _skuNameStr;
ActInfo get actInfo => _actInfo;
AdditionalComment get additionalComment => _additionalComment;
int get buyNum => _buyNum;
int get canApplyIntervention => _canApplyIntervention;
Comment get comment => _comment;
int get commentStatus => _commentStatus;
int get discountAmount => _discountAmount;
int get id => _id;
int get productId => _productId;
String get productName => _productName;
String get returnCode => _returnCode;
int get returnStatus => _returnStatus;
int get returnType => _returnType;
int get sellPrice => _sellPrice;
String get skuId => _skuId;
String get skuImg => _skuImg;
String get skuNameStr => _skuNameStr;
set actInfo(ActInfo value) {
_actInfo = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actInfo != null) {
map['actInfo'] = _actInfo.toJson();
}
if (_additionalComment != null) {
map['additionalComment'] = _additionalComment.toJson();
}
map['buyNum'] = _buyNum;
map['canApplyIntervention'] = _canApplyIntervention;
if (_comment != null) {
map['comment'] = _comment.toJson();
}
map['commentStatus'] = _commentStatus;
map['discountAmount'] = _discountAmount;
map['id'] = _id;
map['productId'] = _productId;
map['productName'] = _productName;
map['returnCode'] = _returnCode;
map['returnStatus'] = _returnStatus;
map['returnType'] = _returnType;
map['sellPrice'] = _sellPrice;
map['skuId'] = _skuId;
map['skuImg'] = _skuImg;
map['skuNameStr'] = _skuNameStr;
return map;
}
set additionalComment(AdditionalComment value) {
_additionalComment = value;
}
set buyNum(int value) {
_buyNum = value;
}
set canApplyIntervention(int value) {
_canApplyIntervention = value;
}
set comment(Comment value) {
_comment = value;
}
set commentStatus(int value) {
_commentStatus = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set id(int value) {
_id = value;
}
set productId(int value) {
_productId = value;
}
set productName(String value) {
_productName = value;
}
set returnCode(String value) {
_returnCode = value;
}
set returnStatus(int value) {
_returnStatus = value;
}
set returnType(int value) {
_returnType = value;
}
set sellPrice(int value) {
_sellPrice = value;
}
set skuId(String value) {
_skuId = value;
}
set skuImg(String value) {
_skuImg = value;
}
set skuNameStr(String value) {
_skuNameStr = value;
}
}
/// bizType : 0
/// commentImgs : ""
/// commentImgsFlag : true
/// commentStar : 0
/// commentText : ""
/// descStar : 0
/// hideFlag : true
/// id : 0
/// isDelete : true
/// likeNum : 0
/// logisticsStar : 0
/// mid : 0
/// orderProductId : 0
/// parentId : 0
/// productId : 0
/// sensitiveFlag : true
/// serviceStar : 0
/// storeId : 0
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,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
Comment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_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;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}
/// bizType : 0
/// commentImgs : ""
/// commentImgsFlag : true
/// commentStar : 0
/// commentText : ""
/// descStar : 0
/// hideFlag : true
/// id : 0
/// isDelete : true
/// likeNum : 0
/// logisticsStar : 0
/// mid : 0
/// orderProductId : 0
/// parentId : 0
/// productId : 0
/// sensitiveFlag : true
/// serviceStar : 0
/// storeId : 0
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,}){
_bizType = bizType;
_commentImgs = commentImgs;
_commentImgsFlag = commentImgsFlag;
_commentStar = commentStar;
_commentText = commentText;
_descStar = descStar;
_hideFlag = hideFlag;
_id = id;
_isDelete = isDelete;
_likeNum = likeNum;
_logisticsStar = logisticsStar;
_mid = mid;
_orderProductId = orderProductId;
_parentId = parentId;
_productId = productId;
_sensitiveFlag = sensitiveFlag;
_serviceStar = serviceStar;
_storeId = storeId;
}
AdditionalComment.fromJson(dynamic json) {
_bizType = json['bizType'];
_commentImgs = json['commentImgs'];
_commentImgsFlag = json['commentImgsFlag'];
_commentStar = json['commentStar'];
_commentText = json['commentText'];
_descStar = json['descStar'];
_hideFlag = json['hideFlag'];
_id = json['id'];
_isDelete = json['isDelete'];
_likeNum = json['likeNum'];
_logisticsStar = json['logisticsStar'];
_mid = json['mid'];
_orderProductId = json['orderProductId'];
_parentId = json['parentId'];
_productId = json['productId'];
_sensitiveFlag = json['sensitiveFlag'];
_serviceStar = json['serviceStar'];
_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;
int get bizType => _bizType;
String get commentImgs => _commentImgs;
bool get commentImgsFlag => _commentImgsFlag;
int get commentStar => _commentStar;
String get commentText => _commentText;
int get descStar => _descStar;
bool get hideFlag => _hideFlag;
int get id => _id;
bool get isDelete => _isDelete;
int get likeNum => _likeNum;
int get logisticsStar => _logisticsStar;
int get mid => _mid;
int get orderProductId => _orderProductId;
int get parentId => _parentId;
int get productId => _productId;
bool get sensitiveFlag => _sensitiveFlag;
int get serviceStar => _serviceStar;
int get storeId => _storeId;
set bizType(int value) {
_bizType = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _bizType;
map['commentImgs'] = _commentImgs;
map['commentImgsFlag'] = _commentImgsFlag;
map['commentStar'] = _commentStar;
map['commentText'] = _commentText;
map['descStar'] = _descStar;
map['hideFlag'] = _hideFlag;
map['id'] = _id;
map['isDelete'] = _isDelete;
map['likeNum'] = _likeNum;
map['logisticsStar'] = _logisticsStar;
map['mid'] = _mid;
map['orderProductId'] = _orderProductId;
map['parentId'] = _parentId;
map['productId'] = _productId;
map['sensitiveFlag'] = _sensitiveFlag;
map['serviceStar'] = _serviceStar;
map['storeId'] = _storeId;
return map;
}
set commentImgs(String value) {
_commentImgs = value;
}
set commentImgsFlag(bool value) {
_commentImgsFlag = value;
}
set commentStar(int value) {
_commentStar = value;
}
set commentText(String value) {
_commentText = value;
}
set descStar(int value) {
_descStar = value;
}
set hideFlag(bool value) {
_hideFlag = value;
}
set id(int value) {
_id = value;
}
set isDelete(bool value) {
_isDelete = value;
}
set likeNum(int value) {
_likeNum = value;
}
set logisticsStar(int value) {
_logisticsStar = value;
}
set mid(int value) {
_mid = value;
}
set orderProductId(int value) {
_orderProductId = value;
}
set parentId(int value) {
_parentId = value;
}
set productId(int value) {
_productId = value;
}
set sensitiveFlag(bool value) {
_sensitiveFlag = value;
}
set serviceStar(int value) {
_serviceStar = value;
}
set storeId(int value) {
_storeId = value;
}
}
/// couponDiscountAmount : 0
/// couponDiscountRate : 0
/// couponId : 0
/// couponType : 0
/// discountAmount : 0
/// discountRate : 0
/// promotionId : 0
/// promotionType : 0
class ActInfo {
ActInfo({
int couponDiscountAmount,
int couponDiscountRate,
int couponId,
int couponType,
int discountAmount,
int discountRate,
int promotionId,
int promotionType,}){
_couponDiscountAmount = couponDiscountAmount;
_couponDiscountRate = couponDiscountRate;
_couponId = couponId;
_couponType = couponType;
_discountAmount = discountAmount;
_discountRate = discountRate;
_promotionId = promotionId;
_promotionType = promotionType;
}
ActInfo.fromJson(dynamic json) {
_couponDiscountAmount = json['couponDiscountAmount'];
_couponDiscountRate = json['couponDiscountRate'];
_couponId = json['couponId'];
_couponType = json['couponType'];
_discountAmount = json['discountAmount'];
_discountRate = json['discountRate'];
_promotionId = json['promotionId'];
_promotionType = json['promotionType'];
}
int _couponDiscountAmount;
int _couponDiscountRate;
int _couponId;
int _couponType;
int _discountAmount;
int _discountRate;
int _promotionId;
int _promotionType;
int get couponDiscountAmount => _couponDiscountAmount;
int get couponDiscountRate => _couponDiscountRate;
int get couponId => _couponId;
int get couponType => _couponType;
int get discountAmount => _discountAmount;
int get discountRate => _discountRate;
int get promotionId => _promotionId;
int get promotionType => _promotionType;
set couponDiscountAmount(int value) {
_couponDiscountAmount = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponDiscountAmount'] = _couponDiscountAmount;
map['couponDiscountRate'] = _couponDiscountRate;
map['couponId'] = _couponId;
map['couponType'] = _couponType;
map['discountAmount'] = _discountAmount;
map['discountRate'] = _discountRate;
map['promotionId'] = _promotionId;
map['promotionType'] = _promotionType;
return map;
}
set couponDiscountRate(int value) {
_couponDiscountRate = value;
}
set couponId(int value) {
_couponId = value;
}
set couponType(int value) {
_couponType = value;
}
set discountAmount(int value) {
_discountAmount = value;
}
set discountRate(int value) {
_discountRate = value;
}
set promotionId(int value) {
_promotionId = value;
}
set promotionType(int value) {
_promotionType = value;
}
}

11
lib/retrofit/min_api.dart

@ -9,8 +9,10 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/settlement_bean.dart'; import 'package:huixiang/retrofit/data/settlement_bean.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
@ -45,7 +47,6 @@ abstract class MinApiService {
String tenant, String tenant,
String storeId, String storeId,
bool showLoading = true, bool showLoading = true,
bool pay = false,
}) { }) {
Map<String, dynamic> headers = Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"}; (token == null || token == "") ? {} : {'token': "Bearer $token"};
@ -55,9 +56,7 @@ abstract class MinApiService {
if (storeId != null && storeId != "") { if (storeId != null && storeId != "") {
headers["store_id"] = storeId; headers["store_id"] = storeId;
} }
if (pay) {
headers["Environment"] = "app"; headers["Environment"] = "app";
}
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 60000, connectTimeout: 60000,
receiveTimeout: 60000, receiveTimeout: 60000,
@ -173,7 +172,11 @@ abstract class MinApiService {
/// ///
@POST("order/placeOrderFirst") @POST("order/placeOrderFirst")
Future<BaseData> placeOrderFirst(@Body() Map<String, dynamic> param); Future<BaseData<DownOrder>> placeOrderFirst(@Body() Map<String, dynamic> param);
///
@POST("order/settlement")
Future<BaseData<WxPay>> settlementWx(@Body() Map<String, dynamic> param);
/// ///
@POST("order/settlement") @POST("order/settlement")

28
lib/retrofit/min_api.g.dart

@ -226,7 +226,7 @@ class _MinApiService implements MinApiService {
} }
@override @override
Future<BaseData<dynamic>> placeOrderFirst(param) async { Future<BaseData<DownOrder>> placeOrderFirst(param) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
@ -241,9 +241,31 @@ class _MinApiService implements MinApiService {
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<DownOrder>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => DownOrder.fromJson(json),
);
return value;
}
@override
Future<BaseData<WxPay>> settlementWx(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('order/settlement',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<WxPay>.fromJson(
_result.data,
(json) => WxPay.fromJson(json),
); );
return value; return value;
} }

130
lib/settlement/settlement.dart

@ -4,13 +4,17 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/address.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/down_order.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/settleOrderInfo.dart'; import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
import 'package:huixiang/retrofit/data/settlement_bean.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/store_info.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/settlement/settlement_view/activity_coupon_remarks.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/distribution.dart';
@ -20,6 +24,7 @@ import 'package:huixiang/settlement/settlement_view/settlement_activity.dart';
import 'package:huixiang/settlement/settlement_view/settlement_coupon.dart'; import 'package:huixiang/settlement/settlement_view/settlement_coupon.dart';
import 'package:huixiang/settlement/settlement_view/settlement_order_commodity.dart'; import 'package:huixiang/settlement/settlement_view/settlement_order_commodity.dart';
import 'package:huixiang/utils/font_weight.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/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -40,9 +45,14 @@ class _Settlement extends State<Settlement> {
MinApiService minService; MinApiService minService;
Function(int type) callback; Function(int type) callback;
StoreInfo storeInfo; StoreInfo storeInfo;
ShoppingCart shopCarGoods;
SettleOrderInfo settleOrderInfo; SettleOrderInfo settleOrderInfo;
int selectedBtn = 0; int selectedBtn = 0;
String remakers = "";
int payChannel = 4;
String tableId = "0";
Address address;
CouponListBean couponListBean; CouponListBean couponListBean;
PromotionInfoListBean promotion; PromotionInfoListBean promotion;
String mobile; String mobile;
@ -51,6 +61,7 @@ class _Settlement extends State<Settlement> {
void initState() { void initState() {
super.initState(); super.initState();
storeInfo = widget.arguments["storeInfo"]; storeInfo = widget.arguments["storeInfo"];
shopCarGoods = widget.arguments["shoppingCart"];
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
String minToken = value.getString("minToken"); String minToken = value.getString("minToken");
@ -76,7 +87,7 @@ class _Settlement extends State<Settlement> {
"memberCouponId": memberCouponId, "memberCouponId": memberCouponId,
"orderId": orderId, "orderId": orderId,
"promotionId": promotionId "promotionId": promotionId
}); }).catchError((error){});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
settleOrderInfo = baseData.data; settleOrderInfo = baseData.data;
@ -84,8 +95,6 @@ class _Settlement extends State<Settlement> {
} }
} }
Address address;
queryAddress(int selectedBtn) async { queryAddress(int selectedBtn) async {
this.selectedBtn = selectedBtn; this.selectedBtn = selectedBtn;
if (address != null) { if (address != null) {
@ -134,53 +143,92 @@ class _Settlement extends State<Settlement> {
/// ///
queryPlaceOrderFirst() async { queryPlaceOrderFirst() async {
for(int i = 0; i < shopCarGoods.shoppingCartSkuItemList.length; i ++) {
settleOrderInfo.orderProductList.forEach((element1) {
if (shopCarGoods.shoppingCartSkuItemList[i].productId == element1.productId) {
shopCarGoods.shoppingCartSkuItemList[i].skuId = element1.skuId;
}
});
}
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst(); PlaceOrderFirst placeOrderFirst = PlaceOrderFirst();
placeOrderFirst.addressId = null; placeOrderFirst.cartNum = settleOrderInfo.orderNum;
placeOrderFirst.cartSum = settleOrderInfo.price;
placeOrderFirst.addressId = address == null ? null : address.id;
placeOrderFirst.isSubscribe = false; placeOrderFirst.isSubscribe = false;
placeOrderFirst.isTakeOut = 0; placeOrderFirst.isTakeOut = selectedBtn;
placeOrderFirst.notes = ""; placeOrderFirst.notes = remakers;
placeOrderFirst.numberOfPeople = null; placeOrderFirst.numberOfPeople = "0";
placeOrderFirst.orderSource = 0; placeOrderFirst.orderSource = 2;
placeOrderFirst.orderType = 0; placeOrderFirst.orderType = "0";
placeOrderFirst.orderTypeId = 0; placeOrderFirst.orderTypeId = 0;
placeOrderFirst.parentCode = ""; placeOrderFirst.parentCode = ""; //
placeOrderFirst.parentId = 0; placeOrderFirst.parentId = "0"; //
placeOrderFirst.payChannel = 1; placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PlaceOrderFirstPromotionInfoDTO(); placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
// placeOrderFirst.promotionInfoDTO.couponId = selectedCouponIndex == -1 placeOrderFirst.promotionInfoDTO.promotionId = promotion != null ? promotion.id : "";
// ? null placeOrderFirst.promotionInfoDTO.couponId = couponListBean != null ? couponListBean.id : "";
// : settleOrderInfo.couponList[selectedCouponIndex].couponId; placeOrderFirst.recMobile = (mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.promotionInfoDTO.promotionId = "0"; placeOrderFirst.shoppingCartSkuItemList = shopCarGoods.shoppingCartSkuItemList;
placeOrderFirst.recMobile = storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = [];
placeOrderFirst.skuItemDTOList = []; placeOrderFirst.skuItemDTOList = [];
placeOrderFirst.source = 1; placeOrderFirst.source = 1;
placeOrderFirst.storeId = storeInfo.id; placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null; placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = 0; placeOrderFirst.tableId = tableId;
BaseData baseData = await minService.placeOrderFirst(placeOrderFirst.toJson()) BaseData<DownOrder> baseData = await minService.placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) {}); .catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
querySettlement(); querySettlement(placeOrderFirst, baseData.data);
} }
} }
/// ///
querySettlement() async { querySettlement(PlaceOrderFirst placeOrderFirst, DownOrder downOrder) async {
SettlementBean settlementBean = SettlementBean(); placeOrderFirst.id = downOrder.id;
settlementBean.addressId = 0; placeOrderFirst.orderProductVOList = downOrder.orderProductVOList;
settlementBean.buyNum = 0; if (placeOrderFirst.payChannel == 1) {
settlementBean.id = 0; if (!(await Min.isInitialize())) {
settlementBean.isLogistics = true; // app的充值支付使用同一个WXPayEntryActivity回调
settlementBean.orderProductVOList = []; // 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) {
//1451130052983914496
//202110211815390002
Navigator.of(context).popAndPushNamed('/router/order_details', arguments: {
"id": orderId,
});
settlementBean.payChannel = 0;
settlementBean.promotionInfoDTO = PromotionInfoDTO();
settlementBean.promotionInfoDTO.couponId = 0;
settlementBean.promotionInfoDTO.promotionId = 0;
BaseData baseData = await minService.settlementApi({}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {}
} }
@override @override
@ -251,7 +299,7 @@ class _Settlement extends State<Settlement> {
), ),
/// ///
PayMethod(), PayMethod(payChannelCheck),
], ],
), ),
), ),
@ -296,7 +344,9 @@ class _Settlement extends State<Settlement> {
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 5.h, vertical: 5.h,
), ),
callback: () {}, callback: () {
queryPlaceOrderFirst();
},
), ),
], ],
), ),
@ -314,6 +364,10 @@ class _Settlement extends State<Settlement> {
); );
} }
payChannelCheck(int payChannel) {
this.payChannel = payChannel;
}
mobileChange(String mobile) { mobileChange(String mobile) {
this.mobile = mobile; this.mobile = mobile;
} }

7
lib/settlement/settlement_view/pay_method.dart

@ -6,6 +6,10 @@ import 'package:huixiang/utils/font_weight.dart';
class PayMethod extends StatefulWidget { class PayMethod extends StatefulWidget {
final Function(int payChannel) payChannelCheck;
PayMethod(this.payChannelCheck);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _PayMethod(); return _PayMethod();
@ -61,6 +65,7 @@ class _PayMethod extends State<PayMethod> {
setState(() { setState(() {
checkIndex = 1; checkIndex = 1;
}); });
widget.payChannelCheck(4);
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -85,6 +90,7 @@ class _PayMethod extends State<PayMethod> {
setState(() { setState(() {
checkIndex = 2; checkIndex = 2;
}); });
widget.payChannelCheck(3);
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -109,6 +115,7 @@ class _PayMethod extends State<PayMethod> {
onTap: () { onTap: () {
setState(() { setState(() {
checkIndex = 3; checkIndex = 3;
widget.payChannelCheck(1);
}); });
}, },
child: Row( child: Row(

21
lib/store/store_order.dart

@ -68,17 +68,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
queryStoreInfo(); queryStoreInfo();
} }
_fc(int count, String productId, int allCount, double allPrice) {
// if (count == 0) {
// int index = shopCarGoods.indexWhere((element) => element.id == productId);
// shopCarGoods.removeAt(index);
// }
// setState(() {
// this.allCount = allCount;
// this.allPrice = allPrice;
// });
}
/// ///
minLogin() async { minLogin() async {
final SharedPreferences value = await SharedPreferences.getInstance(); final SharedPreferences value = await SharedPreferences.getInstance();
@ -316,7 +305,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
shopCarGoods, shopCarGoods,
controller, controller,
_queryMiNiDetail, _queryMiNiDetail,
_fc,
), ),
///, ///,
@ -449,7 +437,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
} }
/// ///
toDownOrder() { toDownOrder() async {
int num = count(); int num = count();
if (num == 0) { if (num == 0) {
@ -457,12 +445,17 @@ class _StoreOrderPage extends State<StoreOrderPage>
return; return;
} }
Navigator.of(context).pushNamed( await Navigator.of(context).pushNamed(
'/router/settlement', '/router/settlement',
arguments: { arguments: {
"storeInfo": storeInfo, "storeInfo": storeInfo,
"shoppingCart": shopCarGoods,
}, },
); );
queryShopCar().then((value) {
this.shopCarGoods = value;
setState(() {});
});
} }
Widget buildSwiper() { Widget buildSwiper() {

6
lib/store/store_view/store_order_list.dart

@ -19,9 +19,7 @@ class StoreOrderListPage extends StatefulWidget {
final List<Activity> activitys; final List<Activity> activitys;
final StoreInfo storeInfo; final StoreInfo storeInfo;
final ScrollController controller; final ScrollController controller;
final Function(int count, String productId, int allCount, double allPrice) fc;
final Function(String id) queryMiNiDetail; final Function(String id) queryMiNiDetail;
// final Function(List<FindMiNiGroupList> appletProducts) productListResult;
ShoppingCart shopCarGoods; ShoppingCart shopCarGoods;
StoreOrderListPage( StoreOrderListPage(
@ -30,9 +28,7 @@ class StoreOrderListPage extends StatefulWidget {
this.storeInfo, this.storeInfo,
this.shopCarGoods, this.shopCarGoods,
this.controller, this.controller,
this.queryMiNiDetail, this.queryMiNiDetail,);
// this.productListResult,
this.fc);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {

Loading…
Cancel
Save