Browse Source

safety

master
fmk 3 years ago
parent
commit
b5839dd08a
  1. 26
      lib/mine/mine_page.dart
  2. 62
      lib/order/order_detail_page.dart
  3. 83
      lib/order/order_history_page.dart
  4. 84
      lib/order/order_utils.dart
  5. 2
      lib/order/order_view/order_address.dart
  6. 147
      lib/order/order_view/order_pay_selected.dart
  7. 125
      lib/qr/qr_code_scan.dart
  8. 1431
      lib/retrofit/data/order_info.dart
  9. 855
      lib/retrofit/data/order_product_vo.dart
  10. 49
      lib/retrofit/data/store_info.dart
  11. 8
      lib/retrofit/min_api.dart
  12. 44
      lib/retrofit/min_api.g.dart
  13. 8
      lib/retrofit/retrofit_api.dart
  14. 2
      lib/retrofit/retrofit_api.g.dart
  15. 73
      lib/settlement/settlement.dart
  16. 453
      lib/store/store_order.dart
  17. 139
      lib/store/store_view/people_num.dart
  18. 21
      lib/store/store_view/store_activity.dart
  19. 108
      lib/store/store_view/store_order_list.dart
  20. 80
      lib/union/union_page.dart
  21. 23
      lib/view_widget/no_data_view.dart
  22. 6
      pubspec.lock
  23. 4
      pubspec.yaml

26
lib/mine/mine_page.dart

@ -51,8 +51,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
@override
void dispose() {
super.dispose();
if (_refreshController != null)
_refreshController.dispose();
if (_refreshController != null) _refreshController.dispose();
}
@override
@ -62,12 +61,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
eventBus.on<EventType>().listen((event) {
print("EventType: ${event.type}");
if (event.type < 3) {
if (mounted)
setState(() {});
if (mounted) setState(() {});
}
if (event.type == 3) {
if (mounted)
setState(() {});
if (mounted) setState(() {});
}
});
}
@ -81,8 +78,12 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
value.getString('user') != "") {
userInfo = UserInfo.fromJson(jsonDecode(value.getString('user')));
}
apiService = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
showLoading: false,
);
BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) {
@ -208,7 +209,6 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
);
}
///
Widget buildNotice() {
return Container(
@ -283,11 +283,11 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
}
/////
Widget attention(){
Widget attention() {
return Container(
margin: EdgeInsets.only(left: 16,right: 17,top: 10),
child:GestureDetector(
onTap:(){
margin: EdgeInsets.only(left: 16, right: 17, top: 10),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/communityFollow',
arguments: {},

62
lib/order/order_detail_page.dart

@ -1,21 +1,28 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_address.dart';
import 'package:huixiang/order/order_view/order_commodity.dart';
import 'package:huixiang/order/order_view/order_info.dart';
import 'package:huixiang/order/order_view/order_pay_selected.dart';
import 'package:huixiang/order/order_view/order_status.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/settlement/settlement_view/pay_method.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'order_utils.dart';
class OrderDetailPage extends StatefulWidget {
final arguments;
@ -41,22 +48,20 @@ class _OrderDetailPage extends State<OrderDetailPage> {
context: context,
token: value.getString("token"),
);
minLogin();
queryDetails();
});
}
///
minLogin() async {
apiService
.minLogin(widget.arguments["id"])
.catchError((onError) {})
apiService.minLogin(orderInfo.storeId)
.catchError((onError) {debugPrint(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"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
@ -82,8 +87,6 @@ class _OrderDetailPage extends State<OrderDetailPage> {
int isTakeOut = 0;
int refundStatus = 0;
// String storeType = "NORMALSTORE"; //NORMALSTORE FASTSTORE RETAILSTORE
queryDetails() async {
BaseData<OrderInfo> baseData = await apiService
.orderDetail(widget.arguments["id"])
@ -101,6 +104,8 @@ class _OrderDetailPage extends State<OrderDetailPage> {
print("order orderStatus: $orderStatus");
print("order sendStatus: $sendStatus");
print("order isTakeOut: $isTakeOut");
minLogin();
if (mounted)
setState(() {
statusTitle();
@ -162,7 +167,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
refundStatus,
title,
center,
carryOnPay,
paySelected,
_orderCancel,
orderInfo,
),
@ -194,34 +199,17 @@ class _OrderDetailPage extends State<OrderDetailPage> {
String title = "";
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;
paySelected() async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected();
},
);
if (payChannel != null && payChannel > 0) {
OrderUtils.carryOnPay(payChannel, minService, orderInfo, queryDetails);
}
}
statusTitle() {

83
lib/order/order_history_page.dart

@ -2,11 +2,14 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_utils.dart';
import 'package:huixiang/order/order_view/order_pay_selected.dart';
import 'package:huixiang/retrofit/data/base_data.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/product.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/status_utils.dart';
import 'package:huixiang/view_widget/classic_header.dart';
@ -21,7 +24,6 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class OrderHistoryPage extends StatefulWidget {
final Map arguments;
OrderHistoryPage({this.arguments});
@ -41,7 +43,8 @@ class _OrderHistoryPage extends State<OrderHistoryPage>
void didChangeDependencies() {
super.didChangeDependencies();
if (tabController == null)
tabController = TabController(initialIndex: widget.arguments["status"], length: 4, vsync: this);
tabController = TabController(
initialIndex: widget.arguments["status"], length: 4, vsync: this);
_pages = [
OrderHistoryList(0),
@ -226,7 +229,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
)
),
],
),
child: Column(
@ -455,26 +458,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
} else if (type == 2) {
orderCancel(orderInfo.id);
} else if (type == 3) {
SmartDialog.show(
widget: Tips(
() {
SmartDialog.dismiss();
},
text: "暂不支持此功能",
));
orderInfo.tenantCode;
orderInfo.id;
///
// Map param = {
// "id": orderInfo.id,
// "orderProductVOList": orderInfo
// .orderDetail.orderProductList
// .map((e) => e.toJson())
// .toList(),
// "payChannel": 1,
// "orderType": 0
// };
// toPay(param);
minLogin(orderInfo);
} else if (type == 4) {
Navigator.of(context).pushNamed(
'/router/logistics_information_page',
@ -500,12 +484,53 @@ class _OrderHistoryList extends State<OrderHistoryList>
);
}
toPay(Map param) async {
apiService.settlement(param).catchError((error) {
minLogin(OrderInfo orderInfo) {
apiService.minLogin(orderInfo.storeId).catchError((onError) {
debugPrint(onError);
}).then((baseData) {
if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode;
String storeId = orderInfo.storeId;
SharedPreferences.getInstance().then(
(value) => {
value.setString('minToken', minToken),
value.setString('tenant', tenant),
value.setString('storeId', storeId),
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
));
}
});
}
paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected();
},
);
if (payChannel != null && payChannel > 0) {
OrderUtils.carryOnPay(payChannel, minService, orderInfo, () {
SmartDialog.showToast("订单支付成功");
Future.delayed(Duration(seconds: 1), () {
_onRefresh();
});
});
}
}
orderCancel(String orderId) async {
BaseData baseData = await apiService.orderCancel(orderId);
if (baseData != null && baseData.isSuccess) {
@ -515,8 +540,10 @@ class _OrderHistoryList extends State<OrderHistoryList>
}
aginOrder(storeId) {
Navigator.of(context)
.pushNamed('/router/union_detail_page', arguments: {"id": storeId});
Navigator.of(context).pushNamed(
'/router/union_detail_page',
arguments: {"id": storeId},
);
}
String totalPrice(orderInfo) {

84
lib/order/order_utils.dart

@ -0,0 +1,84 @@
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/utils/min.dart';
class OrderUtils {
static carryOnPay(payChannel, MinApiService minService, OrderInfo orderInfo, Function queryDetails) async {
PlaceOrderFirst placeOrderFirst = PlaceOrderFirst();
placeOrderFirst.addressId = orderInfo.addressExt.addressId;
placeOrderFirst.isSubscribe = orderInfo.isSubscribe;
placeOrderFirst.isTakeOut = orderInfo.isTakeOut;
placeOrderFirst.notes = orderInfo.notes;
placeOrderFirst.id = orderInfo.id;
placeOrderFirst.orderProductVOList = orderInfo.orderDetail.orderProductList;
placeOrderFirst.numberOfPeople = "0";
placeOrderFirst.orderSource = orderInfo.orderSource;
placeOrderFirst.orderType = "${orderInfo.orderType}";
placeOrderFirst.orderTypeId = 0;
placeOrderFirst.parentCode = orderInfo.parentCode; //
placeOrderFirst.parentId = orderInfo.parentId; //
placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId = orderInfo.promotionId;
placeOrderFirst.promotionInfoDTO.couponId = orderInfo.couponId;
placeOrderFirst.recMobile = "";
placeOrderFirst.shoppingCartSkuItemList = [];
placeOrderFirst.skuItemDTOList = [];
placeOrderFirst.source = 1;
placeOrderFirst.storeId = orderInfo.storeId;
placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = orderInfo.tableId;
if (placeOrderFirst.payChannel == 1) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
//
await Min.initialize();
}
BaseData<WxPay> baseData = await minService
.settlementWx(placeOrderFirst.toJson())
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data;
await registerWxApi(
appId: wxPay.appId,
doOnAndroid: true,
universalLink: "https://hx.lotus-wallet.com/app/",
);
payWithWeChat(
appId: wxPay.appId,
partnerId: wxPay.partnerId,
prepayId: wxPay.prepayId,
packageValue: wxPay.packageValue,
nonceStr: wxPay.nonceStr,
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
queryDetails();
});
}
} else {
BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson())
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
queryDetails();
}
}
}
}

2
lib/order/order_view/order_address.dart

@ -19,7 +19,7 @@ class OrderAddress extends StatefulWidget {
final String title;
final String center;
final Function orderCancel;
final Function carryOnPay;
final Function() carryOnPay;
final OrderInfo orderInfo;
OrderAddress(

147
lib/order/order_view/order_pay_selected.dart

@ -0,0 +1,147 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
class OrderPaySelected extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _OrderPaySelected();
}
}
class _OrderPaySelected extends State<OrderPaySelected> {
@override
Widget build(BuildContext context) {
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return Container(
width: double.infinity,
height: 200,
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 20.h,
bottom: 20.h,
),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color(0x000000).withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12.0,
),
],
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 16.h),
child: Text(
S.of(context).zhifufangshi,
style: TextStyle(
fontSize: 16.sp,
color: Colors.black,
fontWeight: MyFontWeight.regular,
),
),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop(4);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).pingtaiyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,),
),
checkView(1),
],
),
),
SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop(3);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).dianpuyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
checkView(2),
],
),
),
SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop(1);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset("assets/image/icon_we_chat.png"),
Padding(
padding: EdgeInsets.only(left: 8.w),
child: Text(
S.of(context).weixinzhifu,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
),
checkView(3),
],
),
),
],
),
);
},
);
}
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(left: 16.w),
alignment: Alignment.center,
child: Image.asset(
/*checkIndex != index
? */"assets/image/icon_radio_unselected.png",
// : "assets/image/icon_radio_selected.png",
width: 15.w,
height: 15.h,
),
);
}
}

125
lib/qr/qr_code_scan.dart

@ -1,10 +1,10 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_qr_reader/flutter_qr_reader.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_scankit/scan_kit_widget.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:permission_handler/permission_handler.dart';
@ -16,18 +16,14 @@ class QrCodeScanPage extends StatefulWidget {
}
class _QrCodeScanPage extends State<QrCodeScanPage> {
GlobalKey<_QrCodeScanPage> qrViewKey = GlobalKey();
QrReaderViewController viewController;
ScanKitController _controller;
final screenWidth = window.physicalSize.width;
final screenHeight = window.physicalSize.height;
@override
void initState() {
super.initState();
readerHeight = 812;
Future.delayed(Duration(seconds: 1), () {
buildReaderView();
});
}
@override
@ -37,20 +33,24 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
child: Stack(
children: [
Positioned(
child: qrReaderView != null
? Column(
children: [
Expanded(
child: qrReaderView,
flex: readerHeight.toInt(),
),
// Expanded(child: qrReaderView, flex: readerHeight,),
],
)
: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Column(
children: [
Expanded(
child: ScanKitWidget(
callback: (controller) {
_controller = controller;
controller.onResult.listen((result) {
debugPrint("scanning result:$result");
Navigator.of(context).pop(result);
});
},
continuouslyScan: false,
boundingBox: Rect.fromLTRB(0, 0, screenWidth, screenHeight),
),
flex: 1,
),
],
),
top: 0,
bottom: 0,
left: 0,
@ -68,12 +68,12 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
margin: EdgeInsets.only(right: 16.w),
child: GestureDetector(
onTap: () {
openStorage();
_controller.pickPhoto();
},
child: Text(
S.of(context).xiangce,
style: TextStyle(
color: Colors.white,
color: Colors.black,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
@ -91,80 +91,11 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
);
}
QrReaderView qrReaderView;
double readerHeight;
buildReaderView() async {
double screenWidth = MediaQuery.of(context).size.width;
readerHeight = 1920.0 / 1080.0 * screenWidth;
print("object: $readerHeight");
qrReaderView = await QrReaderView(
key: qrViewKey,
callback: onScan,
width: MediaQuery.of(context).size.width,
height: readerHeight,
);
setState(() {});
}
///
openStorage() async {
if (await Permission.storage.isGranted) {
List<Media> medias = await ImagePickers.pickerPaths(
galleryMode: GalleryMode.image,
selectCount: 1,
showGif: true,
showCamera: false,
compressSize: 500,
uiConfig: UIConfig(
uiThemeColor: Color(0xFFFFFFFF),
),
cropConfig: CropConfig(
enableCrop: true,
width: 200,
height: 200,
),
);
if (medias == null || medias.length == 0) return;
String filePath = medias[0].path;
final String data = await FlutterQrReader.imgScan(filePath);
showData(data);
} else {
await Permission.storage.request();
openStorage();
}
}
void _startCameraResult(String data, List<Offset> offset) {
showData(data);
this.viewController.stopCamera();
}
Future onScan(QrReaderViewController viewController) async {
this.viewController = viewController;
await this.viewController.startCamera(_startCameraResult);
}
showData(String data) {
SmartDialog.show(
widget: Tips(
() {},
text: "$data",
),
onDismiss: () {
Future.delayed(Duration(seconds: 1), () {
this.viewController.startCamera(_startCameraResult);
});
},
);
}
@override
void dispose() {
if (this.viewController != null) {
this.viewController.stopCamera();
}
// if (this._controller != null) {
// this._controller.dispose();
// }
super.dispose();
}
}

1431
lib/retrofit/data/order_info.dart

File diff suppressed because it is too large Load Diff

855
lib/retrofit/data/order_product_vo.dart

@ -1,193 +1,113 @@
class OrderProductVOList {
OrderProductVOList({
ActInfo actInfo,
AdditionalComment additionalComment,
int buyNum,
int canApplyIntervention,
String canApplyIntervention,
Comment comment,
int commentStatus,
int discountAmount,
int id,
int productId,
String commentStatus,
String discountAmount,
String id,
String productId,
String productName,
String returnCode,
int returnStatus,
int returnType,
int sellPrice,
String returnStatus,
String returnType,
String 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;
String skuNameStr,
}) {
this.actInfo = actInfo;
this.additionalComment = additionalComment;
this.buyNum = buyNum;
this.canApplyIntervention = canApplyIntervention;
this.comment = comment;
this.commentStatus = commentStatus;
this.discountAmount = discountAmount;
this.id = id;
this.productId = productId;
this.productName = productName;
this.returnCode = returnCode;
this.returnStatus = returnStatus;
this.returnType = returnType;
this.sellPrice = sellPrice;
this.skuId = skuId;
this.skuImg = skuImg;
this.skuNameStr = skuNameStr;
}
OrderProductVOList.fromJson(dynamic json) {
_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;
this.actInfo =
json['actInfo'] != null ? ActInfo.fromJson(json['actInfo']) : null;
this.additionalComment = json['additionalComment'] != null
? AdditionalComment.fromJson(json['additionalComment'])
: null;
this.buyNum = json['buyNum'];
this.canApplyIntervention = json['canApplyIntervention'];
this.comment =
json['comment'] != null ? Comment.fromJson(json['comment']) : null;
this.commentStatus = json['commentStatus'];
this.discountAmount = json['discountAmount'];
this.id = json['id'];
this.productId = json['productId'];
this.productName = json['productName'];
this.returnCode = json['returnCode'];
this.returnStatus = json['returnStatus'];
this.returnType = json['returnType'];
this.sellPrice = json['sellPrice'];
this.skuId = json['skuId'];
this.skuImg = json['skuImg'];
this.skuNameStr = json['skuNameStr'];
}
ActInfo actInfo;
AdditionalComment additionalComment;
int buyNum;
String canApplyIntervention;
Comment comment;
String commentStatus;
String discountAmount;
String id;
String productId;
String productName;
String returnCode;
String returnStatus;
String returnType;
String sellPrice;
String skuId;
String skuImg;
String skuNameStr;
set actInfo(ActInfo value) {
_actInfo = value;
}
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_actInfo != null) {
map['actInfo'] = _actInfo.toJson();
if (this.actInfo != null) {
map['actInfo'] = this.actInfo.toJson();
}
if (_additionalComment != null) {
map['additionalComment'] = _additionalComment.toJson();
if (this.additionalComment != null) {
map['additionalComment'] = this.additionalComment.toJson();
}
map['buyNum'] = _buyNum;
map['canApplyIntervention'] = _canApplyIntervention;
if (_comment != null) {
map['comment'] = _comment.toJson();
map['buyNum'] = this.buyNum;
map['canApplyIntervention'] = this.canApplyIntervention;
if (this.comment != null) {
map['comment'] = this.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;
map['commentStatus'] = this.commentStatus;
map['discountAmount'] = this.discountAmount;
map['id'] = this.id;
map['productId'] = this.productId;
map['productName'] = this.productName;
map['returnCode'] = this.returnCode;
map['returnStatus'] = this.returnStatus;
map['returnType'] = this.returnType;
map['sellPrice'] = this.sellPrice;
map['skuId'] = this.skuId;
map['skuImg'] = this.skuImg;
map['skuNameStr'] = this.skuNameStr;
return map;
}
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
@ -201,97 +121,58 @@ class OrderProductVOList {
class ActInfo {
ActInfo({
int couponDiscountAmount,
String couponDiscountAmount,
int couponDiscountRate,
int couponId,
String couponId,
int couponType,
int discountAmount,
String discountAmount,
int discountRate,
int promotionId,
int promotionType,}){
_couponDiscountAmount = couponDiscountAmount;
_couponDiscountRate = couponDiscountRate;
_couponId = couponId;
_couponType = couponType;
_discountAmount = discountAmount;
_discountRate = discountRate;
_promotionId = promotionId;
_promotionType = promotionType;
String promotionId,
int promotionType,
}) {
this.couponDiscountAmount = couponDiscountAmount;
this.couponDiscountRate = couponDiscountRate;
this.couponId = couponId;
this.couponType = couponType;
this.discountAmount = discountAmount;
this.discountRate = discountRate;
this.promotionId = promotionId;
this.promotionType = promotionType;
}
ActInfo.fromJson(dynamic json) {
_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;
}
this.couponDiscountAmount = json['couponDiscountAmount'];
this.couponDiscountRate = json['couponDiscountRate'];
this.couponId = json['couponId'];
this.couponType = json['couponType'];
this.discountAmount = json['discountAmount'];
this.discountRate = json['discountRate'];
this.promotionId = json['promotionId'];
this.promotionType = json['promotionType'];
}
String couponDiscountAmount;
int couponDiscountRate;
String couponId;
int couponType;
String discountAmount;
int discountRate;
String promotionId;
int promotionType;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['couponDiscountAmount'] = _couponDiscountAmount;
map['couponDiscountRate'] = _couponDiscountRate;
map['couponId'] = _couponId;
map['couponType'] = _couponType;
map['discountAmount'] = _discountAmount;
map['discountRate'] = _discountRate;
map['promotionId'] = _promotionId;
map['promotionType'] = _promotionType;
map['couponDiscountAmount'] = this.couponDiscountAmount;
map['couponDiscountRate'] = this.couponDiscountRate;
map['couponId'] = this.couponId;
map['couponType'] = this.couponType;
map['discountAmount'] = this.discountAmount;
map['discountRate'] = this.discountRate;
map['promotionId'] = this.promotionId;
map['promotionType'] = this.promotionType;
return map;
}
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 {
@ -313,180 +194,91 @@ class AdditionalComment {
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;
int storeId,
}) {
this.bizType = bizType;
this.commentImgs = commentImgs;
this.commentImgsFlag = commentImgsFlag;
this.commentStar = commentStar;
this.commentText = commentText;
this.descStar = descStar;
this.hideFlag = hideFlag;
this.id = id;
this.isDelete = isDelete;
this.likeNum = likeNum;
this.logisticsStar = logisticsStar;
this.mid = mid;
this.orderProductId = orderProductId;
this.parentId = parentId;
this.productId = productId;
this.sensitiveFlag = sensitiveFlag;
this.serviceStar = serviceStar;
this.storeId = storeId;
}
AdditionalComment.fromJson(dynamic json) {
_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;
}
this.bizType = json['bizType'];
this.commentImgs = json['commentImgs'];
this.commentImgsFlag = json['commentImgsFlag'];
this.commentStar = json['commentStar'];
this.commentText = json['commentText'];
this.descStar = json['descStar'];
this.hideFlag = json['hideFlag'];
this.id = json['id'];
this.isDelete = json['isDelete'];
this.likeNum = json['likeNum'];
this.logisticsStar = json['logisticsStar'];
this.mid = json['mid'];
this.orderProductId = json['orderProductId'];
this.parentId = json['parentId'];
this.productId = json['productId'];
this.sensitiveFlag = json['sensitiveFlag'];
this.serviceStar = json['serviceStar'];
this.storeId = json['storeId'];
}
int bizType;
String commentImgs;
bool commentImgsFlag;
int commentStar;
String commentText;
int descStar;
bool hideFlag;
int id;
bool isDelete;
int likeNum;
int logisticsStar;
int mid;
int orderProductId;
int parentId;
int productId;
bool sensitiveFlag;
int serviceStar;
int storeId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _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;
map['bizType'] = this.bizType;
map['commentImgs'] = this.commentImgs;
map['commentImgsFlag'] = this.commentImgsFlag;
map['commentStar'] = this.commentStar;
map['commentText'] = this.commentText;
map['descStar'] = this.descStar;
map['hideFlag'] = this.hideFlag;
map['id'] = this.id;
map['isDelete'] = this.isDelete;
map['likeNum'] = this.likeNum;
map['logisticsStar'] = this.logisticsStar;
map['mid'] = this.mid;
map['orderProductId'] = this.orderProductId;
map['parentId'] = this.parentId;
map['productId'] = this.productId;
map['sensitiveFlag'] = this.sensitiveFlag;
map['serviceStar'] = this.serviceStar;
map['storeId'] = this.storeId;
return map;
}
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 {
@ -508,178 +300,89 @@ class Comment {
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;
int storeId,
}) {
this.bizType = bizType;
this.commentImgs = commentImgs;
this.commentImgsFlag = commentImgsFlag;
this.commentStar = commentStar;
this.commentText = commentText;
this.descStar = descStar;
this.hideFlag = hideFlag;
this.id = id;
this.isDelete = isDelete;
this.likeNum = likeNum;
this.logisticsStar = logisticsStar;
this.mid = mid;
this.orderProductId = orderProductId;
this.parentId = parentId;
this.productId = productId;
this.sensitiveFlag = sensitiveFlag;
this.serviceStar = serviceStar;
this.storeId = storeId;
}
Comment.fromJson(dynamic json) {
_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;
}
this.bizType = json['bizType'];
this.commentImgs = json['commentImgs'];
this.commentImgsFlag = json['commentImgsFlag'];
this.commentStar = json['commentStar'];
this.commentText = json['commentText'];
this.descStar = json['descStar'];
this.hideFlag = json['hideFlag'];
this.id = json['id'];
this.isDelete = json['isDelete'];
this.likeNum = json['likeNum'];
this.logisticsStar = json['logisticsStar'];
this.mid = json['mid'];
this.orderProductId = json['orderProductId'];
this.parentId = json['parentId'];
this.productId = json['productId'];
this.sensitiveFlag = json['sensitiveFlag'];
this.serviceStar = json['serviceStar'];
this.storeId = json['storeId'];
}
int bizType;
String commentImgs;
bool commentImgsFlag;
int commentStar;
String commentText;
int descStar;
bool hideFlag;
int id;
bool isDelete;
int likeNum;
int logisticsStar;
int mid;
int orderProductId;
int parentId;
int productId;
bool sensitiveFlag;
int serviceStar;
int storeId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['bizType'] = _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;
map['bizType'] = this.bizType;
map['commentImgs'] = this.commentImgs;
map['commentImgsFlag'] = this.commentImgsFlag;
map['commentStar'] = this.commentStar;
map['commentText'] = this.commentText;
map['descStar'] = this.descStar;
map['hideFlag'] = this.hideFlag;
map['id'] = this.id;
map['isDelete'] = this.isDelete;
map['likeNum'] = this.likeNum;
map['logisticsStar'] = this.logisticsStar;
map['mid'] = this.mid;
map['orderProductId'] = this.orderProductId;
map['parentId'] = this.parentId;
map['productId'] = this.productId;
map['sensitiveFlag'] = this.sensitiveFlag;
map['serviceStar'] = this.serviceStar;
map['storeId'] = this.storeId;
return map;
}
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;
}
}

49
lib/retrofit/data/store_info.dart

@ -38,6 +38,7 @@ class StoreInfo {
String remark;
String shipAddress;
String storeName;
StoreTable storeTable;
String tenantCode;
String updateTime;
String updateUser;
@ -94,6 +95,7 @@ class StoreInfo {
..remark = json['remark'] as String
..shipAddress = json['shipAddress'] as String
..storeName = json['storeName'] as String
..storeTable = json['storeTable'] != null ? StoreTable.fromJson(json['storeTable']) : null
..tenantCode = json['tenantCode'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
@ -138,6 +140,7 @@ class StoreInfo {
'remark': this.remark,
'shipAddress': this.shipAddress,
'storeName': this.storeName,
'storeTable': this.storeTable.toJson(),
'tenantCode': this.tenantCode,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
@ -151,3 +154,49 @@ class StoreInfo {
};
}
class StoreTable {
StoreTable();
String areaId;
String id;
int isDelete;
int numberOfPeople;
String remark;
String storeId;
int tableCapacity;
String tableName;
int tableSort;
int tableType;
String tenantCode;
factory StoreTable.fromJson(Map<String, dynamic> json) => StoreTable()
..areaId = json["areaId"]
..id = json["id"]
..isDelete = json["isDelete"]
..numberOfPeople = json["numberOfPeople"]
..remark = json["remark"]
..storeId = json["storeId"]
..tableCapacity = json["tableCapacity"]
..tableName = json["tableName"]
..tableSort = json["tableSort"]
..tableType = json["tableType"]
..tenantCode = json["tenantCode"];
Map<String, dynamic> toJson() => <String, dynamic>{
"areaId": this.areaId,
"id": this.id,
"isDelete": this.isDelete,
"numberOfPeople": this.numberOfPeople,
"remark": this.remark,
"storeId": this.storeId,
"tableCapacity": this.tableCapacity,
"tableName": this.tableName,
"tableSort": this.tableSort,
"tableType": this.tableType,
"tenantCode": this.tenantCode,
};
}

8
lib/retrofit/min_api.dart

@ -182,4 +182,12 @@ abstract class MinApiService {
@POST("order/settlement")
Future<BaseData> settlementApi(@Body() Map<String, dynamic> param);
///
@POST("store/getStore")
Future<BaseData> queryStoreInfo1(@Body() Map<String, dynamic> param);
//
@GET("order/getParentInfo?tableId={tableId}")
Future<BaseData> getParentInfo(@Path("tableId") String tableId);
}

44
lib/retrofit/min_api.g.dart

@ -291,4 +291,48 @@ class _MinApiService implements MinApiService {
);
return value;
}
@override
Future<BaseData<dynamic>> queryStoreInfo1(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>>('/store/getStore',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
@override
Future<BaseData<dynamic>> getParentInfo(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/order/getParentInfo/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
}

8
lib/retrofit/retrofit_api.dart

@ -266,13 +266,11 @@ abstract class ApiService {
///
@POST("/information/list")
Future<BaseData<PageInfo<Article>>> queryArticle(
@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<Article>>> queryArticle(@Body() Map<String, dynamic> param);
///banner查询
@POST("/banner/page")
Future<BaseData<PageInfo<BannerData>>> queryBanner(
@Body() Map<String, dynamic> param);
Future<BaseData<PageInfo<BannerData>>> queryBanner(@Body() Map<String, dynamic> param);
///
@GET("/home/brand")
@ -357,7 +355,7 @@ abstract class ApiService {
Future<BaseData<bool>> report(@Body() Map<String, String> map);
///
@GET("/order/orderCancel?id={id}")
@GET("/order/cancel/{id}")
Future<BaseData<bool>> orderCancel(@Path("id") String id);
///

2
lib/retrofit/retrofit_api.g.dart

@ -1168,7 +1168,7 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/order/orderCancel?id=$id',
'/order/cancel/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',

73
lib/settlement/settlement.dart

@ -87,7 +87,7 @@ class _Settlement extends State<Settlement> {
"memberCouponId": memberCouponId,
"orderId": orderId,
"promotionId": promotionId
}).catchError((error){});
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
settleOrderInfo = baseData.data;
@ -143,10 +143,10 @@ class _Settlement extends State<Settlement> {
///
queryPlaceOrderFirst() async {
for(int i = 0; i < shopCarGoods.shoppingCartSkuItemList.length; i ++) {
for (int i = 0; i < shopCarGoods.shoppingCartSkuItemList.length; i++) {
settleOrderInfo.orderProductList.forEach((element1) {
if (shopCarGoods.shoppingCartSkuItemList[i].productId == element1.productId) {
if (shopCarGoods.shoppingCartSkuItemList[i].productId ==
element1.productId) {
shopCarGoods.shoppingCartSkuItemList[i].skuId = element1.skuId;
}
});
@ -164,20 +164,27 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.orderType = "0";
placeOrderFirst.orderTypeId = 0;
placeOrderFirst.parentCode = ""; //
placeOrderFirst.parentId = "0"; //
placeOrderFirst.parentId = "0"; //
placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId = promotion != null ? promotion.id : "";
placeOrderFirst.promotionInfoDTO.couponId = couponListBean != null ? couponListBean.id : "";
placeOrderFirst.recMobile = (mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = shopCarGoods.shoppingCartSkuItemList;
placeOrderFirst.promotionInfoDTO.promotionId =
promotion != null ? promotion.id : "";
placeOrderFirst.promotionInfoDTO.couponId =
couponListBean != null ? couponListBean.id : "";
placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList =
shopCarGoods.shoppingCartSkuItemList;
placeOrderFirst.skuItemDTOList = [];
placeOrderFirst.source = 1;
placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = tableId;
BaseData<DownOrder> baseData = await minService.placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) {});
BaseData<DownOrder> baseData = await minService
.placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) {
print("error: $error");
});
if (baseData != null && baseData.isSuccess) {
querySettlement(placeOrderFirst, baseData.data);
}
@ -194,28 +201,34 @@ class _Settlement extends State<Settlement> {
//
await Min.initialize();
}
BaseData<WxPay> baseData = await minService.settlementWx(placeOrderFirst.toJson()).catchError((error) {});
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/");
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);
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) {});
BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson())
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
toOrderDetails(placeOrderFirst.id);
}
@ -223,12 +236,9 @@ class _Settlement extends State<Settlement> {
}
toOrderDetails(String orderId) {
//1451130052983914496
//202110211815390002
Navigator.of(context).popAndPushNamed('/router/order_details', arguments: {
"id": orderId,
});
}
@override
@ -421,11 +431,12 @@ class _Settlement extends State<Settlement> {
this.promotion = pro;
this.couponListBean = null;
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
couponListBean != null ? couponListBean.id : null,
0,
promotion != null ? promotion.id : null);
address != null ? address.id : null,
selectedBtn,
couponListBean != null ? couponListBean.id : null,
0,
promotion != null ? promotion.id : null,
);
}
}
}

453
lib/store/store_order.dart

@ -14,6 +14,7 @@ import 'package:huixiang/retrofit/data/shoppingCart.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/people_num.dart';
import 'package:huixiang/store/store_view/product_sku.dart';
import 'package:huixiang/store/store_view/shop_car.dart';
import 'package:huixiang/store/store_view/store_activity.dart';
@ -48,43 +49,51 @@ class _StoreOrderPage extends State<StoreOrderPage>
MinApiService minService;
StoreInfo storeInfo;
List<Activity> activitys;
RefreshController refreshController;
StoreOrderListPage storeOrderListPage;
ScrollController controller = ScrollController();
ShoppingCart shopCarGoods;
int tableId = 0;
String tenant = "";
String storeId = "";
int numberOfPeople = 0;
@override
void initState() {
super.initState();
tableId = widget.arguments["tableId"];
tenant = widget.arguments["tenant"];
storeId = widget.arguments["id"];
debugPrint(
"store_param tableId:$tableId tenant:$tenant storeId:$storeId");
if (tabcontroller == null)
tabcontroller = TabController(
length: 2,
vsync: this,
);
minLogin();
queryStoreInfo();
SharedPreferences.getInstance().then((value) {
minLogin(value);
});
}
///
minLogin() async {
final SharedPreferences value = await SharedPreferences.getInstance();
minLogin(SharedPreferences shared) async {
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
token: shared.getString('token'),
);
apiService
.minLogin(widget.arguments["id"])
.catchError((onError) {})
.then((baseData) {
queryStoreInfo();
apiService.minLogin(storeId).catchError((onError) {
debugPrint(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),
@ -103,25 +112,48 @@ class _StoreOrderPage extends State<StoreOrderPage>
this.shopCarGoods = value;
setState(() {});
});
if (tableId > 0) {
queryStoreInfo1();
}
}
});
}
///
getParentInfo() async {
BaseData baseData =
await minService.getParentInfo("$tableId").catchError((error) {
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
}
}
///
queryStoreInfo1() async {
BaseData baseData = await minService.queryStoreInfo1({
"getCoupon": true,
"storeId": storeId,
"tableId": tableId,
}).catchError((error) {
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
StoreInfo storeInfo = StoreInfo.fromJson(baseData.data);
if (storeInfo.storeTable != null) {
showPeopleNum(storeInfo.storeTable.tableName);
}
}
}
///
queryStoreInfo() async {
final SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString('token'),
);
BaseData baseData = await apiService
.queryStoreInfo(widget.arguments["id"])
.catchError((error) {
// refreshController.refreshFailed();
BaseData baseData =
await apiService.queryStoreInfo(storeId).catchError((error) {
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
// refreshController.refreshCompleted();
storeInfo = StoreInfo.fromJson(baseData.data);
activitys = storeInfo.informationVOPageVO.list
.map((e) => Activity.fromJson(e))
@ -143,178 +175,168 @@ class _StoreOrderPage extends State<StoreOrderPage>
bottom: 54.h,
child: DefaultTabController(
length: 2,
child: SmartRefresher(
controller: refreshController =
RefreshController(initialRefresh: false),
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
child: NestedScrollView(
controller: controller,
dragStartBehavior: DragStartBehavior.start,
physics: BouncingScrollPhysics(),
onRefresh: () {
queryStoreInfo();
},
child: NestedScrollView(
controller: controller,
dragStartBehavior: DragStartBehavior.start,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return [
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: SliverAppBar(
expandedHeight: (storeInfo != null &&
storeInfo.couponVOList != null)
? 470.h
: 365.h,
floating: false,
snap: false,
pinned: true,
stretch: false,
brightness: Brightness.light,
leading: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10),
padding: EdgeInsets.all(6),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
size: 24,
),
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return [
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: SliverAppBar(
expandedHeight:
(storeInfo != null && storeInfo.couponVOList != null)
? 470.h
: 365.h,
floating: false,
snap: false,
pinned: true,
stretch: false,
brightness: Brightness.light,
leading: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10),
padding: EdgeInsets.all(6),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
size: 24,
),
),
flexibleSpace: FlexibleSpaceBar(
title: Title(
controller,
storeInfo != null ? storeInfo.storeName : '',
),
collapseMode: CollapseMode.pin,
stretchModes: [
StretchMode.zoomBackground,
StretchMode.fadeTitle,
StretchMode.blurBackground,
],
background: Stack(
children: [
Positioned(
),
flexibleSpace: FlexibleSpaceBar(
title: Title(
controller,
storeInfo != null ? storeInfo.storeName : '',
),
collapseMode: CollapseMode.pin,
stretchModes: [
StretchMode.zoomBackground,
StretchMode.fadeTitle,
StretchMode.blurBackground,
],
background: Stack(
children: [
Positioned(
child: Column(
children: [
buildSwiper(),
Expanded(
child: Container(
color: Colors.transparent,
),
flex: 1,
),
],
),
top: 0,
bottom: 0,
left: 0,
right: 0,
),
Positioned(
child: Container(
child: Column(
children: [
buildSwiper(),
Expanded(
child: Container(
color: Colors.transparent,
///
StoreInfoView(storeInfo),
///
if (storeInfo != null &&
storeInfo.couponVOList != null)
UnionCoupon(
storeInfo,
_receiveCoupon,
coupon: true,
),
flex: 1,
),
if (storeInfo == null ||
storeInfo.couponVOList == null)
SizedBox(
height: 8,
),
///VIP信息
Vip(storeInfo, () {}, false),
],
),
top: 0,
bottom: 0,
left: 0,
right: 0,
),
Positioned(
child: Container(
child: Column(
children: [
///
StoreInfoView(storeInfo),
///
if (storeInfo != null &&
storeInfo.couponVOList != null)
UnionCoupon(
storeInfo,
_receiveCoupon,
coupon: true,
),
if (storeInfo == null ||
storeInfo.couponVOList == null)
SizedBox(
height: 8,
),
///VIP信息
Vip(storeInfo, () {}, false),
],
),
),
top: 110.h,
bottom: 0,
left: 0,
right: 0,
),
],
),
top: 110.h,
bottom: 0,
left: 0,
right: 0,
),
],
),
backgroundColor: Color(0x33FAFAFA),
centerTitle: false,
elevation: 0,
bottom: PreferredSize(
preferredSize: Size(
MediaQuery.of(context).size.width,
38,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
width: MediaQuery.of(context).size.width,
child: TabBar(
controller: tabcontroller,
automaticIndicatorColorAdjustment: true,
isScrollable: true,
indicatorWeight: 1,
indicatorColor: Color(0xFFFAFAFA),
labelPadding: EdgeInsets.only(
left: 8.w,
right: 8.w,
),
indicatorSize: TabBarIndicatorSize.label,
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w400,
),
labelStyle: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
labelColor: Colors.black,
tabs: [
MyTab(text: S.of(context).diancan),
MyTab(text: S.of(context).xindianhuodong),
],
),
backgroundColor: Color(0x33FAFAFA),
centerTitle: false,
elevation: 0,
bottom: PreferredSize(
preferredSize: Size(
MediaQuery.of(context).size.width,
38,
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
width: MediaQuery.of(context).size.width,
child: TabBar(
controller: tabcontroller,
automaticIndicatorColorAdjustment: true,
isScrollable: true,
indicatorWeight: 1,
indicatorColor: Color(0xFFFAFAFA),
labelPadding: EdgeInsets.only(
left: 8.w,
right: 8.w,
),
indicatorSize: TabBarIndicatorSize.label,
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w400,
),
labelStyle: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
labelColor: Colors.black,
tabs: [
MyTab(text: S.of(context).diancan),
MyTab(text: S.of(context).xindianhuodong),
],
),
),
),
),
];
},
body: TabBarView(
physics: BouncingScrollPhysics(),
children: [
StoreOrderListPage(
widget.arguments,
activitys,
storeInfo,
shopCarGoods,
controller,
_queryMiNiDetail,
),
),
];
},
body: TabBarView(
physics: BouncingScrollPhysics(),
children: [
StoreOrderListPage(
widget.arguments,
activitys,
storeInfo,
shopCarGoods,
controller,
_queryMiNiDetail,
),
///,
StoreActivity(
widget.arguments,
activitys,
),
],
controller: tabcontroller,
),
///,
StoreActivity(
widget.arguments,
activitys,
),
],
controller: tabcontroller,
),
),
),
@ -424,6 +446,21 @@ class _StoreOrderPage extends State<StoreOrderPage>
);
}
showPeopleNum(String tableName) async {
var people = await showDialog(
context: context,
builder: (context) {
return PeopleNumView(tableName);
},
);
if (people != null && people > 0) {
setState(() {
this.numberOfPeople = people;
});
}
}
///
int count() {
if (shopCarGoods == null ||
@ -555,7 +592,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
Future _addShopCar(MiNiDetail miNiDetail, selectSkus, int count) async {
ProductSkuVOListBean productSku = miNiDetail.productSkuVOList.firstWhere((element) {
ProductSkuVOListBean productSku =
miNiDetail.productSkuVOList.firstWhere((element) {
bool gg = true;
selectSkus.forEach((element1) {
if (element.skuNameStr.indexOf(element1) < 0) {
@ -567,13 +605,18 @@ class _StoreOrderPage extends State<StoreOrderPage>
});
if (productSku == null) return;
String skuId = productSku.id;
String skuValue = selectSkus.toString().replaceAll("[", "").replaceAll("]", "").replaceAll(",", "");
String skuValue = selectSkus
.toString()
.replaceAll("[", "")
.replaceAll("]", "")
.replaceAll(",", "");
if (miNiDetail != null) {
BaseData<List<ShoppingCart>> baseDate = await minService.addShoppingCart({
"storeId": storeInfo.id,
"storeName": storeInfo.storeName ?? "",
"tableId": 0,
"numberOfPeople": numberOfPeople,
"tableId": tableId,
"shoppingCartSkuItemList": [
{
"buyNum": count,
@ -584,7 +627,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
"storeId": storeInfo.id,
"skuPrice": productSku.applyPrice,
"skuStock": productSku.skuStock,
"tableId": 0,
"tableId": tableId,
},
],
});
@ -599,7 +642,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
Future<ShoppingCart> queryShopCar() async {
BaseData<List<ShoppingCart>> baseDate = await minService.getShoppingCart(0);
BaseData<List<ShoppingCart>> baseDate =
await minService.getShoppingCart(tableId);
if (baseDate != null &&
baseDate.isSuccess &&
baseDate.data != null &&
@ -615,7 +659,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum += 1;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate = await minService.shoppingCartSingle(shopCarTemp);
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
@ -632,7 +677,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
cartSkuItem.buyNum -= 1;
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate = await minService.shoppingCartSingle(shopCarTemp);
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
@ -646,7 +692,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
///1
add(MiNiDetail miNiDetail, selectSkus) async {
ProductSkuVOListBean productSku = miNiDetail.productSkuVOList.firstWhere((element) {
ProductSkuVOListBean productSku =
miNiDetail.productSkuVOList.firstWhere((element) {
return skuY(element, selectSkus);
});
@ -656,20 +703,24 @@ class _StoreOrderPage extends State<StoreOrderPage>
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id);
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.id);
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
shopCarGoods.tableId = "0";
shopCarGoods.tableId = "$tableId";
if (shopSkuIndex >= 0) {
shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum += 1;
ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods.shoppingCartSkuItemList.firstWhere((element) => skuId == element.id);
ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods
.shoppingCartSkuItemList
.firstWhere((element) => skuId == element.id);
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
} else {
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
BaseData<List<ShoppingCart>> baseDate = await minService.shoppingCartSingle(shopCarTemp);
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
@ -680,7 +731,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
///1
reduce(MiNiDetail miNiDetail, selectSkus) async {
ProductSkuVOListBean productSku = miNiDetail.productSkuVOList.firstWhere((element) {
ProductSkuVOListBean productSku =
miNiDetail.productSkuVOList.firstWhere((element) {
return skuY(element, selectSkus);
});
@ -690,8 +742,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods.shoppingCartSkuItemList.firstWhere((element) => skuId == element.skuId);
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.skuId);
ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods
.shoppingCartSkuItemList
.firstWhere((element) => skuId == element.skuId);
int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList
.indexWhere((element) => skuId == element.skuId);
if (shopSkuItem != null) {
if (shopSkuItem.buyNum > 1) {
@ -701,13 +756,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
await _addShopCar(miNiDetail, selectSkus, 2);
return;
}
shopCarGoods.tableId = "0";
shopCarGoods.tableId = "$tableId";
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson();
ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods.shoppingCartSkuItemList.firstWhere((element) => skuId == element.id);
ShoppingCartSkuItemListBean cartSkuItem = shopCarGoods
.shoppingCartSkuItemList
.firstWhere((element) => skuId == element.id);
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()];
BaseData<List<ShoppingCart>> baseDate = await minService.shoppingCartSingle(shopCarTemp);
BaseData<List<ShoppingCart>> baseDate =
await minService.shoppingCartSingle(shopCarTemp);
if (baseDate.isSuccess) {
queryShopCar().then((value) {
this.shopCarGoods = value;
@ -726,7 +784,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
});
return gg;
}
}
class Title extends StatefulWidget {

139
lib/store/store_view/people_num.dart

@ -0,0 +1,139 @@
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
class PeopleNumView extends StatefulWidget {
final String tableName;
// final Function(int peopleNum) callback;
PeopleNumView(this.tableName);
@override
State<StatefulWidget> createState() {
return _PeopleNumView();
}
}
class _PeopleNumView extends State<PeopleNumView> {
int peopleNum = 1;
@override
Widget build(BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
children: [
Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
width: 295,
height: 247,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"桌位:${widget.tableName}",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF171717),
),
),
Text(
"请选择用餐人数:$peopleNum人",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF171717),
),
),
SizedBox(
height: 10,
),
Container(
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 5,
crossAxisSpacing: 24,
mainAxisSpacing: 18,
childAspectRatio: 1,
),
shrinkWrap: true,
itemCount: 10,
padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
setState(() {
peopleNum = position + 1;
});
},
child: Container(
decoration: BoxDecoration(
color: peopleNum == (position + 1)
? Color(0xFF32A060)
: Colors.transparent,
border: Border.all(
color: Color(0xFF32A060),
width: 1,
),
borderRadius: BorderRadius.circular(3),
),
alignment: Alignment.center,
child: Text(
"${position + 1}",
style: TextStyle(
color: peopleNum == (position + 1)
? Colors.white
: Color(0xFF32A060),
fontWeight: MyFontWeight.regular,
fontSize: 16.sp,
),
),
),
);
},
),
),
SizedBox(
height: 10,
),
RoundButton(
text: "确定",
width: 130.w,
height: 34.h,
textColor: Colors.white,
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
backgroup: Color(0xFF32A060),
radius: 4.w,
callback: () {
// widget.callback(peopleNum);
// SmartDialog.dismiss();
Navigator.of(context).pop(peopleNum);
},
),
],
),
),
],
),
],
);
}
}

21
lib/store/store_view/store_activity.dart

@ -22,11 +22,20 @@ class _StoreActivity extends State<StoreActivity> {
@override
Widget build(BuildContext context) {
return (widget.activitys == null || widget.activitys.length == 0)
? NoDataView(
isShowBtn: false,
text: "还没有活动~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 180.h),
? Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h),
margin: EdgeInsets.only(
top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight),
),
color: Colors.white,
child: NoDataView(
isShowBtn: false,
text: "还没有活动~",
iconWidth: 220,
iconHeight: 140,
fontSize: 16.sp,
),
)
: Container(
width: MediaQuery.of(context).size.width,
@ -51,7 +60,7 @@ class _StoreActivity extends State<StoreActivity> {
'/router/web_page',
arguments: {
"activityId": widget.activitys[position].id,
"source": widget.arguments["id"]
"source": widget.arguments["id"],
},
);
}

108
lib/store/store_view/store_order_list.dart

@ -11,7 +11,9 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/shop_goods.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
class StoreOrderListPage extends StatefulWidget {
@ -23,12 +25,13 @@ class StoreOrderListPage extends StatefulWidget {
ShoppingCart shopCarGoods;
StoreOrderListPage(
this.arguments,
this.activitys,
this.storeInfo,
this.shopCarGoods,
this.controller,
this.queryMiNiDetail,);
this.arguments,
this.activitys,
this.storeInfo,
this.shopCarGoods,
this.controller,
this.queryMiNiDetail,
);
@override
State<StatefulWidget> createState() {
@ -64,22 +67,26 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
);
BaseData<List<FindMiNiGroupList>> baseData =
await minService.findMiNiGroupList(
{
"id": widget.arguments["id"],
},
);
await minService.findMiNiGroupList({
"id": widget.arguments["id"],
}).catchError((error) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
setState(() {
appletProducts = baseData.data;
// widget.productListResult(appletProducts);
productListBeans.clear();
if (appletProducts.length > 0)
productListBeans.addAll(appletProducts[0].productList);
productListBeans.addAll(appletProducts[isSelected].productList);
});
} else {
refreshController.refreshFailed();
}
}
RefreshController refreshController;
@override
Widget build(BuildContext context) {
return Container(
@ -88,34 +95,51 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
margin: EdgeInsets.only(
top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
width: 100.w,
child: ListView.builder(
itemCount: appletProducts == null ? 0 : appletProducts.length,
controller: controller1,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(top: 0, bottom: 25),
itemBuilder: (context, position) {
return orderItem(appletProducts[position], position);
},
),
),
Container(
width: MediaQuery.of(context).size.width - 100.w,
child: ListView.builder(
itemCount: productListBeans == null ? 0 : productListBeans.length,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
return goodsItem(position);
},
),
child: SmartRefresher(
controller: refreshController =
RefreshController(initialRefresh: false),
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
appletGoods();
},
child: SingleChildScrollView(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
width: 100.w,
child: ListView.builder(
itemCount: appletProducts == null ? 0 : appletProducts.length,
controller: controller1,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(top: 0, bottom: 25),
itemBuilder: (context, position) {
return orderItem(appletProducts[position], position);
},
),
),
Container(
width: MediaQuery.of(context).size.width - 100.w,
child: ListView.builder(
itemCount:
productListBeans == null ? 0 : productListBeans.length,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (context, position) {
return goodsItem(position);
},
),
),
],
),
],
),
),
);
}
@ -228,8 +252,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
widget.queryMiNiDetail(productListBeans[position].id);
},
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
widget.queryMiNiDetail(productListBeans[position].id);
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
widget.queryMiNiDetail(productListBeans[position].id);
},
productListBean: productListBeans[position],
count: count,

80
lib/union/union_page.dart

@ -12,6 +12,7 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/retrofit/data/store_type.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/location.dart';
@ -20,6 +21,8 @@ import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/item_title.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter/rendering.dart';
@ -263,21 +266,26 @@ class _UnionPage extends State<UnionPage>
},
child: ListView.builder(
itemCount: storeList == null ? 0 : storeList.length,
// padding: EdgeInsets.only(top: 8.h, bottom: 84.h + (375.h - 88.h) + 4.h),
padding: EdgeInsets.only(
top: 8.h, bottom: 84.h /* + (375.h - 88.h) + 4.h*/),
top: 8.h,
bottom: 84.h, /* + (375.h - 88.h) + 4.h*/
),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName
},
);
if(storeList[position].posType.code == "NORMALSTORE") {
toScan(storeList[position]);
} else {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": storeList[position].id,
"tenant": storeList[position].tenantCode,
"storeName": storeList[position].storeName
},
);
}
},
child: buildStoreItem(storeList[position], position),
);
@ -293,6 +301,58 @@ class _UnionPage extends State<UnionPage>
_mapController = controller;
}
toScan(Store store) async {
Navigator.of(context).pushNamed(
'/router/store_order',
arguments: {
"id": store.id,
"tenant": store.tenantCode,
"storeName": store.storeName,
"tableId": 1315903669597634560,
},
);
// if (await Permission.camera.isPermanentlyDenied) {
// showCupertinoDialog(
// context: context,
// builder: (context) {
// return RequestPermission(
// "assets/image/icon_camera_permission_tips.png",
// S.of(context).ninxiangjiquanxianweikaiqi,
// S.of(context).weilekaipaizhaoxuanzhetouxiang,
// S.of(context).kaiqiquanxian,
// (result) async {
// if (result) {
// await openAppSettings();
// }
// },
// heightRatioWithWidth: 0.82,
// );
// });
// } else if (await Permission.camera.isGranted) {
// var result = await Navigator.of(context).pushNamed('/router/qr_scan');
//
// if (result != null && result != "") {
// Uri uri = Uri.parse(result);
// String table = uri.queryParameters["tableId"];
// if (table != null && table != "") {
// int tableId = int.tryParse(table);
// Navigator.of(context).pushNamed(
// '/router/store_order',
// arguments: {
// "id": store.id,
// "tenant": store.tenantCode,
// "storeName": store.storeName,
// "tableId": tableId,
// },
// );
// }
// }
// } else {
// await Permission.camera.request();
// }
}
Widget buildSearchItem() {
return Container(
height: 36.h,

23
lib/view_widget/no_data_view.dart

@ -6,13 +6,18 @@ class NoDataView extends StatelessWidget {
final bool isShowBtn;
final String text;
final double fontSize;
final double iconWidth;
final double iconHeight;
final EdgeInsets margin;
NoDataView(
{this.isShowBtn = true,
this.text,
this.fontSize,
this.margin = const EdgeInsets.only(top: 30)});
NoDataView({
this.isShowBtn = true,
this.text,
this.fontSize,
this.iconWidth = 270,
this.iconHeight = 180,
this.margin = const EdgeInsets.only(top: 30),
});
@override
Widget build(BuildContext context) {
@ -21,7 +26,11 @@ class NoDataView extends StatelessWidget {
alignment: Alignment.center,
child: Column(
children: [
Image(image: AssetImage("assets/image/icon_empty.png")),
Image(
image: AssetImage("assets/image/icon_empty.png"),
width: iconWidth,
height: iconHeight,
),
SizedBox(
height: 35.h,
),
@ -46,7 +55,7 @@ class NoDataView extends StatelessWidget {
backgroup: Color(0xFF32A060),
radius: 4,
),
)
),
],
),
);

6
pubspec.lock

@ -375,13 +375,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.11"
flutter_qr_reader:
flutter_scankit:
dependency: "direct main"
description:
name: flutter_qr_reader
name: flutter_scankit
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
version: "1.2.0"
flutter_screenutil:
dependency: "direct main"
description:

4
pubspec.yaml

@ -54,7 +54,7 @@ dependencies:
flutter_smart_dialog: ^2.1.6
barcode_widget: ^2.0.1
flutter_qr_reader: ^1.0.5
# flutter_qr_reader: ^1.0.5
qr_flutter: ^4.0.0
url_launcher: ^5.0.0
@ -64,6 +64,8 @@ dependencies:
#多图, 裁剪
image_pickers: ^2.0.0
flutter_scankit: ^1.2.0
# 数量,视频时长
# images_picker: ^1.2.4

Loading…
Cancel
Save