Browse Source

生意总览-总览-订单-商品接口对接更改;

订单接口对接更改,(核销显示暂未确定)
我的页面-数据对接;(商户信息板块暂未确定,修改密码接口暂未确定)
商品板块接口对接(未完,暂时仅商品列表,分组列表接口对接)
流水日期选择待优化;
wr_2023_business
wurong 1 year ago
parent
commit
49244f7cf5
  1. 9
      ios/Runner/Info.plist
  2. 9
      lib/business_system/business_page.dart
  3. 138
      lib/business_system/business_scan_code.dart
  4. 4
      lib/business_system/date_select/custom_page.dart
  5. 5
      lib/business_system/goods/business_goods_page.dart
  6. 92
      lib/business_system/goods/on_sale/on_sale_page.dart
  7. 19
      lib/business_system/home/business_home_page.dart
  8. 105
      lib/business_system/home/overview/trade_goods.dart
  9. 790
      lib/business_system/home/overview/trade_order.dart
  10. 2
      lib/business_system/home/overview/trade_overview_page.dart
  11. 216
      lib/business_system/home/overview/trade_summary.dart
  12. 13
      lib/business_system/mine/account_information.dart
  13. 81
      lib/business_system/mine/business_mine_page.dart
  14. 3
      lib/business_system/mine/merchant_info.dart
  15. 3
      lib/business_system/mine/security_setting.dart
  16. 206
      lib/business_system/order/business_order_detail.dart
  17. 109
      lib/business_system/order/business_order_page.dart
  18. 458
      lib/business_system/order/order_list.dart
  19. 332
      lib/business_system/order/request_refund.dart
  20. 10
      lib/main.dart
  21. 3
      lib/qr/qr_code_scan.dart
  22. 47
      lib/retrofit/business_api.dart
  23. 163
      lib/retrofit/business_api.g.dart
  24. 746
      lib/retrofit/data/business_goods.dart
  25. 1083
      lib/retrofit/data/business_order_detail_info.dart
  26. 779
      lib/retrofit/data/business_order_list.dart
  27. 356
      lib/retrofit/data/product_group_list.dart
  28. 232
      lib/retrofit/data/refund_reason_list.dart
  29. 3
      lib/union/union_list.dart
  30. 6
      lib/view_widget/settlement_tips_dialog.dart

9
ios/Runner/Info.plist

@ -95,6 +95,9 @@
<string>lineauth</string>
<string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>alipay</string>
<string>iosamap</string>
<string>qqmap</string>
<string>baidumap</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
@ -177,11 +180,5 @@
<array>
<string>location</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>iosamap</string>
<string>qqmap</string>
<string>baidumap</string>
</array>
</dict>
</plist>

9
lib/business_system/business_page.dart

@ -7,6 +7,7 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/business_login_info.dart';
import 'business_scan_code.dart';
import 'home/business_home_page.dart';
class BusinessPage extends StatefulWidget {
@ -49,10 +50,10 @@ class _BusinessPage extends State<BusinessPage>
selectStoreIndex = index;
});
}),
if (choiceIndex == 1) BusinessOrderPage(),
if (choiceIndex == 2) BusinessOrderPage(),
if (choiceIndex == 3) BusinessGoodsPage(),
if (choiceIndex == 4) BusinessMinePage(),
if (choiceIndex == 1) BusinessOrderPage(businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"),
if (choiceIndex == 2) BusinessScanCode(),
if (choiceIndex == 3) BusinessGoodsPage(businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"),
if (choiceIndex == 4) BusinessMinePage(businessLoginInfo,businessLoginInfo?.storeList[selectStoreIndex]?.id ?? "0"),
Align(
alignment: Alignment.bottomCenter,
child: Container(

138
lib/business_system/business_scan_code.dart

@ -0,0 +1,138 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:image_pickers/image_pickers.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:scan/scan.dart';
import '../generated/l10n.dart';
class BusinessScanCode extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _BusinessScanCode();
}
}
class _BusinessScanCode extends State<BusinessScanCode>
with AutomaticKeepAliveClientMixin {
ScanController controller = ScanController();
final screenWidth = window.physicalSize.width;
final screenHeight = window.physicalSize.height;
@override
void initState() {
super.initState();
}
@override
void dispose() {
if (this.controller != null) {
this.controller.pause();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
body: Container(
child: Stack(
children: [
Positioned(
child: Column(
children: [
Expanded(
child: ScanView(
controller: controller,
scanAreaScale: 0.7,
scanLineColor: Colors.green.shade400,
onCapture: (data) {
if (data != null && data != "") {
// Navigator.of(context).pop(data);
}
},
),
flex: 1,
),
],
),
top: 0,
bottom: 0,
left: 0,
right: 0,
),
Positioned(
child: Container(
margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h),
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child:Text(
S.of(context).saoma,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
pickImage();
},
child:Container(
padding: EdgeInsets.symmetric(horizontal:10.w),
child: Text(
S.of(context).xiangce,
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
top:MediaQuery.of(context).padding.top,
left: 0,
right: 0,
),
],
),
),
);
}
pickImage() async {
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: false,
),
);
if (medias != null && medias.length > 0) {
String result = await Scan.parse(medias[0].path);
if (result != null && result != "") {
// Navigator.of(context).pop(result);
}
}
}
@override
bool get wantKeepAlive => true;
}

4
lib/business_system/date_select/custom_page.dart

@ -21,9 +21,9 @@ class _CustomPage extends State<CustomPage>{
setState(() {
if (args.value is PickerDateRange) {
customDate =
DateFormat('yyyy年MM月dd日').format(args.value.startDate).toString() +
DateFormat('yyyy年MM月dd日 HH:mm:ss').format(args.value.startDate).toString() +
'' +
DateFormat('yyyy年MM月dd日')
DateFormat('yyyy年MM月dd日 23:59:59')
.format(args.value.endDate ?? args.value.startDate)
.toString();
}

5
lib/business_system/goods/business_goods_page.dart

@ -9,6 +9,9 @@ import '../../view_widget/my_tab.dart';
import 'on_sale/on_sale_page.dart';
class BusinessGoodsPage extends StatefulWidget {
final String storeId;
BusinessGoodsPage(this.storeId);
@override
State<StatefulWidget> createState() {
@ -68,7 +71,7 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
),
body: TabBarView(
children: [
OnSalePage(),
OnSalePage(widget.storeId),
OffShelfPage(),],
),
),

92
lib/business_system/goods/on_sale/on_sale_page.dart

@ -1,14 +1,26 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/business_goods.dart';
import '../../../retrofit/data/product_group_list.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
class OnSalePage extends StatefulWidget {
final String storeId;
OnSalePage(this.storeId);
@override
State<StatefulWidget> createState() {
return _OnSalePage();
@ -19,6 +31,9 @@ class _OnSalePage extends State<OnSalePage> {
final RefreshController _refreshController = RefreshController();
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics();
final ScrollController controller = ScrollController();
BusinessApiService businessService;
ProductGroupList productGroupList;
BusinessGoods businessGoods;
@override
void dispose() {
@ -30,8 +45,77 @@ class _OnSalePage extends State<OnSalePage> {
void initState() {
super.initState();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryGroupList();
await queryGoodsList();
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
setState(() {});
}
_onRefresh() async {}
///
queryGroupList() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<ProductGroupList> baseData =
await businessService.productGroup({
"current":1,
"map": {},
"model": {
"groupImg":"",
"groupName":"",
"isDelete":""
},
"size":50,
"sort":"sort"
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
productGroupList = baseData.data;
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
///
queryGoodsList() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<BusinessGoods> baseData =
await businessService.findAdminProductLis({
"groupId": "",
"hasStock": 1,
"keyword": "",
"pageIndex": 1,
"pageSize": 10,
"status": "1",
}).catchError((error) {
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
businessGoods = baseData.data;
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
@ -65,11 +149,7 @@ class _OnSalePage extends State<OnSalePage> {
return MyFooter(mode);
},
),
onRefresh: () {
setState(() {
_onRefresh();
});
},
onRefresh: _onRefresh(),
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(

19
lib/business_system/home/business_home_page.dart

@ -566,16 +566,15 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: 18.h,
),
if (lineChartSample2Data.isNotEmpty)
// (lineChartSample2Data.isNotEmpty)
// ? NoDataView(
// src: "assets/image/xiao_fei.webp",
// isShowBtn: false,
// text: "暂无数据",
// fontSize: 16.sp,
// margin: EdgeInsets.all(20.h),
// )
// :
LineChartSample2(lineChartSample2Data, "销售量"),
(lineChartSample2Data.isNotEmpty)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: LineChartSample2(lineChartSample2Data, "销售量"),
],
),
);

105
lib/business_system/home/overview/trade_goods.dart

@ -71,14 +71,101 @@ class _TradeGoods extends State<TradeGoods> {
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
querySingleSales(
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
isSing: false);
queryGoodsSalesList(
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
isSing: false);
if (dateIndex == 0) {
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
isSing: false);
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
isSing: false);
} else if (dateIndex == 1) {
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23),
isSing: false);
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23),
isSing: false);
} else if (dateIndex == 2) {
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"",
isSing: false);
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"",
isSing: false);
} else if (dateIndex == 3) {
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(timeDate().length <= 15 ? 0 : 12,
timeDate().length <= 15 ? 10 : 23),
isSing: false);
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(timeDate().length <= 15 ? 0 : 12,
timeDate().length <= 15 ? 10 : 23),
isSing: false);
}
});
}
@ -597,7 +684,7 @@ class _TradeGoods extends State<TradeGoods> {
} else if (dateIndex == 3) {
return (customDate == "" || customDate == null)
? "${customDateNum ?? ""}(今日)"
: customDate;
: ("${customDate.substring(0,11)} ""${customDate.substring(21,34)}");
}
}

790
lib/business_system/home/overview/trade_order.dart

@ -1,15 +1,30 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/business_api.dart';
import '../../../retrofit/data/base_data.dart';
import '../../../retrofit/data/trade_summary_list.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/no_data_view.dart';
import '../home_view/my_line_chart.dart';
class TradeOrder extends StatefulWidget {
final storeId;
TradeOrder(this.storeId);
@override
State<StatefulWidget> createState() {
return _TradeOrder();
@ -19,32 +34,38 @@ class TradeOrder extends StatefulWidget {
class _TradeOrder extends State<TradeOrder> {
final RefreshController _refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
List<LineChartSample2Data> lineChartSample2DataAmount =
[LineChartSample2Data(0,10,"2023-03-09"),
LineChartSample2Data(1,10,"2023-03-10"),
LineChartSample2Data(2,60,"2023-03-11"),
LineChartSample2Data(3,35,"2023-03-12"),
LineChartSample2Data(4,20,"2023-03-13"),
LineChartSample2Data(5,55,"2023-03-14"),
LineChartSample2Data(6,99,"2023-03-15")];
List<LineChartSample2Data> lineChartSample2DataNum =
[LineChartSample2Data(0,60,"2023-03-09"),
LineChartSample2Data(1,30,"2023-03-10"),
LineChartSample2Data(2,50,"2023-03-11"),
LineChartSample2Data(3,80,"2023-03-12"),
LineChartSample2Data(4,5,"2023-03-13"),
LineChartSample2Data(5,55,"2023-03-14"),
LineChartSample2Data(6,98,"2023-03-15")];
List<LineChartSample2Data> lineChartSample2DataOrderAmount = [
LineChartSample2Data(0, 0, "2023-03-09"),
LineChartSample2Data(1, 0, "2023-03-10"),
LineChartSample2Data(2, 0, "2023-03-11"),
LineChartSample2Data(3, 0, "2023-03-12"),
LineChartSample2Data(4, 0, "2023-03-13"),
LineChartSample2Data(5, 0, "2023-03-14"),
LineChartSample2Data(6, 0, "2023-03-15")
];
List<LineChartSample2Data> lineChartSample2DataOrderNum = [
LineChartSample2Data(0, 0, "2023-03-09"),
LineChartSample2Data(1, 0, "2023-03-10"),
LineChartSample2Data(2, 0, "2023-03-11"),
LineChartSample2Data(3, 0, "2023-03-12"),
LineChartSample2Data(4, 0, "2023-03-13"),
LineChartSample2Data(5, 0, "2023-03-14"),
LineChartSample2Data(6, 0, "2023-03-15")
];
int dateIndex = 0;
String selectedDate = "";
String dayDate = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
String weekDate ="";
String weekDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now().subtract(Duration(days:6)))}"
String weekDate = "";
String weekDateNum =
"${DateFormat("yyyy年MM月dd日").format(DateTime.now().subtract(Duration(days: 6)))}"
"${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
String monthlyDate ="";
String monthlyDateNum = "${DateFormat("yyyy年MM月").format(DateTime.now())}";
String customDate ="";
String monthlyDate = "";
String monthlyDateNum = "${DateFormat("yyyy年MM月dd").format(DateTime.now())}";
String customDate = "";
String customDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
int _loadCount = 0;
BusinessApiService businessService;
TradeSummaryList tradeSummaryList;
@override
void dispose() {
@ -55,9 +76,137 @@ class _TradeOrder extends State<TradeOrder> {
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
if (dateIndex == 0) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"day",
isSing: false);
} else if (dateIndex == 1) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23),
"week",
isSing: false);
} else if (dateIndex == 2) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"month",
isSing: false);
} else if (dateIndex == 3) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(timeDate().length <= 15 ? 0 : 12,
timeDate().length <= 15 ? 10 : 23),
"custom",
isSing: false);
}
});
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 1) {
_loadCount = 0;
EasyLoading.dismiss();
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
if (mounted) setState(() {});
}
}
////
queryBusinessAnalysis(selectDay, selectEndDay, queryRange,
{isSing = true}) async {
if (isSing)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
try {
BaseData<TradeSummaryList> baseData = await businessService
.saleBusinessAnalysis({
"selectDay": selectDay,
"selectEndDay": selectEndDay,
"queryRange": queryRange
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
int amountIndex = 0;
int numIndex = 0;
if (baseData.data.saleBusinessAnalysisVOS.isNotEmpty) {
lineChartSample2DataOrderAmount.clear();
lineChartSample2DataOrderNum.clear();
}
tradeSummaryList = baseData.data;
tradeSummaryList.saleBusinessAnalysisVOS.forEach((element) {
lineChartSample2DataOrderAmount.add(LineChartSample2Data(
amountIndex.toDouble(),
double.tryParse(element.localDateBigDecimal.toString()),
element.localDateTime.substring(0, 10)));
amountIndex += 1;
});
tradeSummaryList.saleBusinessAnalysisVOS.forEach((element) {
lineChartSample2DataOrderNum.add(LineChartSample2Data(
numIndex.toDouble(),
double.tryParse(element.localDateCount.toString()),
element.localDateTime.substring(0, 10)));
numIndex += 1;
});
}
} finally {
if (isSing) {
setState(() {});
EasyLoading.dismiss();
} else {
addLoadCount();
}
}
}
@override
@ -71,302 +220,457 @@ class _TradeOrder extends State<TradeOrder> {
width: double.infinity,
height: 1.h,
),
Expanded(child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
scrollController: scrollController,
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
setState(() {
_onRefresh();
});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(2),
border: Border.all(color: Color(0xFFCFD0D1),
width: 1.w),
),
margin: EdgeInsets.only(
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h),
child: Row(
children: [
Expanded(child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
Expanded(
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
scrollController: scrollController,
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(2),
border:
Border.all(color: Color(0xFFCFD0D1), width: 1.w),
),
margin: EdgeInsets.only(
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h),
child: Row(
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
dateIndex = 0;
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 0 ? Color(0xFF30415B):Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"日报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 0 ? Colors.white:Color(0xFF30415B),
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"day");
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 0
? Color(0xFF30415B)
: Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"日报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 0
? Colors.white
: Color(0xFF30415B),
),
),
),
),
)),
Expanded(child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
dateIndex = 1;
});},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 1 ? Color(0xFF30415B):Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"周报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 1 ? Colors.white:Color(0xFF30415B),
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23),
"week");
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 1
? Color(0xFF30415B)
: Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"周报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 1
? Colors.white
: Color(0xFF30415B),
),
),
),
),)),
Expanded(child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
dateIndex = 2;
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 2 ? Color(0xFF30415B):Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"月报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 2 ? Colors.white:Color(0xFF30415B),
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"month");
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 2
? Color(0xFF30415B)
: Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"月报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 2
? Colors.white
: Color(0xFF30415B),
),
),
),
),)),
Expanded(child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
dateIndex = 3;
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 3 ? Color(0xFF30415B):Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"自定义",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 3 ? Colors.white:Color(0xFF30415B),
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(
timeDate().length <= 15 ? 0 : 12,
timeDate().length <= 15 ? 10 : 23),
"custom");
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 3
? Color(0xFF30415B)
: Colors.transparent,
),
),
),)),
],
),
),
Align(alignment: Alignment.center,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
if(dateIndex == 0){
Navigator.of(context).pushNamed('/router/day_report_page').then((value) {
setState((){
selectedDate = value;
});
});
}
else if(dateIndex == 1){
Navigator.of(context).pushNamed('/router/week_report_page').then((value) {
setState((){
weekDate = value;
});
});
}
else if(dateIndex == 2){
Navigator.of(context).pushNamed('/router/monthly_report_page').then((value) {
setState((){
monthlyDate = value;
});
});
}
else if(dateIndex == 3){
Navigator.of(context).pushNamed('/router/custom_page').then((value){
setState((){
customDate = value;
});
});
}
},
child: Container(
width: 194.w,
alignment: Alignment.center,
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(2),
),
margin: EdgeInsets.only(bottom:16.h),
child: Row(
children: [
Expanded(child:Container(
alignment: Alignment.center,
child: Text(
timeDate(),
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
"自定义",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 3
? Colors.white
: Color(0xFF30415B),
),
),
),
)),
Image.asset(
"assets/image/bs_calendar_logo.webp",
width:15,
height:15,
),
],
),
),
),),
Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h),
child:Text(
"订单分析",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
Align(
alignment: Alignment.center,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (dateIndex == 0) {
Navigator.of(context)
.pushNamed('/router/day_report_page')
.then((value) {
selectedDate = value;
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"day");
});
} else if (dateIndex == 1) {
Navigator.of(context)
.pushNamed('/router/week_report_page')
.then((value) {
weekDate = value;
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23),
"week");
});
} else if (dateIndex == 2) {
Navigator.of(context)
.pushNamed('/router/monthly_report_page')
.then((value) {
monthlyDate = value;
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"month");
});
} else if (dateIndex == 3) {
Navigator.of(context)
.pushNamed('/router/custom_page')
.then((value) {
customDate = value;
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23),
"custom");
});
}
},
child: Container(
width: 194.w,
alignment: Alignment.center,
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(2),
),
margin: EdgeInsets.only(bottom: 16.h),
child: Row(
children: [
Expanded(
child: Container(
alignment: Alignment.center,
child: Text(
dateIndex == 2
? ((monthlyDateNum.substring(0, 8) ==
timeDate().substring(0, 8))
? "${timeDate().substring(0, 8)}(当月)"
: timeDate().substring(0, 8))
: timeDate(),
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
)),
Image.asset(
"assets/image/bs_calendar_logo.webp",
width: 15,
height: 15,
),
],
),
),
),
),
)),
orderAmount(),
orderNumTrend(),
],
)),
),)
Padding(
padding: EdgeInsets.only(left: 16.w, bottom: 15.h),
child: Text(
"订单分析",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
)),
orderAmount(),
orderNumTrend(),
],
)),
),
)
],
),
);
}
String timeDate(){
if(dateIndex == 0){
return (selectedDate == "" || selectedDate == null) ? "${dayDate ?? ""}(今日)":(dayDate == DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))
?"${DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))}(今日)":DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate)));
}
else if(dateIndex == 1){
return (weekDate == "" || weekDate == null) ? weekDateNum : weekDate;}
else if(dateIndex == 2){
return (monthlyDate == "" || monthlyDate == null) ? "${monthlyDateNum ?? ""}(当月)":
(monthlyDateNum == (DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8))?
"${(DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8))}(当月)"
:DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8));
String timeDate() {
if (dateIndex == 0) {
return (selectedDate == "" || selectedDate == null)
? "${dayDate ?? ""}(今日)"
: (dayDate ==
DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))
? "${DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))}(今日)"
: DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate)));
} else if (dateIndex == 1) {
return (weekDate == "" || weekDate == null) ? weekDateNum : weekDate;
} else if (dateIndex == 2) {
return (monthlyDate == "" || monthlyDate == null)
? "${monthlyDateNum ?? ""}"
: (monthlyDateNum ==
(DateFormat("yyyy年MM月dd日")
.format(DateTime.parse(monthlyDate)))
? "${(DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)))}"
: DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)));
} else if (dateIndex == 3) {
return (customDate == "" || customDate == null)
? "${customDateNum ?? ""}(今日)"
: ("${customDate.substring(0,11)} ""${customDate.substring(21,34)}");
}
else if(dateIndex == 3){
return (customDate == "" || customDate == null) ? "${customDateNum??""}(今日)" : customDate;}
}
///
Widget orderAmount(){
Widget orderAmount() {
return Column(
children: [
Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h),
child:Row(
Padding(
padding: EdgeInsets.only(left: 16.w, bottom: 15.h),
child: Row(
children: [
Container(
width: 4.w,
height: 16.h,
color: Color(0xFF30415B),
margin: EdgeInsets.only(right:12.w),
margin: EdgeInsets.only(right: 12.w),
),
Text(
"订单金额",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color:Color(0xFF0D0D0D),
color: Color(0xFF0D0D0D),
),
),
SizedBox(width:8.w,),
SizedBox(
width: 8.w,
),
Text(
"近12周",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color:Color(0xFF666666),
color: Color(0xFF666666),
),
)
],
)),
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w),
child:LineChartSample2(lineChartSample2DataAmount,"金额"),),
SizedBox(height:16.h,),
(tradeSummaryList == null ||
tradeSummaryList.saleBusinessAnalysisVOS.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: LineChartSample2(lineChartSample2DataOrderAmount, "金额"),
),
SizedBox(
height: 16.h,
),
],
);
}
///
Widget orderNumTrend(){
Widget orderNumTrend() {
return Container(
padding: EdgeInsets.only(top:12.h,bottom: 33.h),
padding: EdgeInsets.only(top: 12.h, bottom: 33.h),
child: Column(
children: [
Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h),
child:Row(
Padding(
padding: EdgeInsets.only(left: 16.w, bottom: 15.h),
child: Row(
children: [
Container(
width: 4.w,
height: 16.h,
color: Color(0xFF30415B),
margin: EdgeInsets.only(right:12.w),
margin: EdgeInsets.only(right: 12.w),
),
Text(
"订单量趋势",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color:Color(0xFF0D0D0D),
color: Color(0xFF0D0D0D),
),
)
],
)),
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w),
child:LineChartSample2(lineChartSample2DataNum,"订单量"),),
SizedBox(height:16.h,),
(tradeSummaryList == null ||
tradeSummaryList.saleBusinessAnalysisVOS.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: LineChartSample2(lineChartSample2DataOrderNum, "订单量"),
),
SizedBox(
height: 16.h,
),
],
),
);

2
lib/business_system/home/overview/trade_overview_page.dart

@ -70,7 +70,7 @@ class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProvi
body: TabBarView(
children: [
TradeSummary(storeId),
TradeOrder(),
TradeOrder(storeId),
TradeGoods(storeId),],
),
),

216
lib/business_system/home/overview/trade_summary.dart

@ -92,11 +92,64 @@ class _TradeSummary extends State<TradeSummary> {
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
queryBusinessAnalysis(
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
"day",
isSing: false);
if (dateIndex == 0) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"day",
isSing: false);
} else if (dateIndex == 1) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23),
"week",
isSing: false);
} else if (dateIndex == 2) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"month",
isSing: false);
} else if (dateIndex == 3) {
queryBusinessAnalysis(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(timeDate().length <= 15 ? 0 : 12,
timeDate().length <= 15 ? 10 : 23),
"custom",
isSing: false);
}
});
}
@ -528,7 +581,7 @@ class _TradeSummary extends State<TradeSummary> {
} else if (dateIndex == 3) {
return (customDate == "" || customDate == null)
? "${customDateNum ?? ""}(今日)"
: customDate;
: ("${customDate.substring(0,11)} ""${customDate.substring(21,34)}");
}
}
@ -621,24 +674,33 @@ class _TradeSummary extends State<TradeSummary> {
margin: EdgeInsets.only(bottom: 30.h),
),
if (operateSelect == 0)
// lineChartSample2DataAmount.isNotEmpty
// ? NoDataView(
// src: "assets/image/bs_no data_logo.webp",
// isShowBtn: false,
// text: "暂无数据",
// fontSize: 16.sp,
// margin: EdgeInsets.all(20.h),
// )
// :
Container(
(tradeSummaryList == null ||
tradeSummaryList.saleBusinessAnalysisVOS.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: LineChartSample2(lineChartSample2DataAmount, "金额"),
),
if (operateSelect == 1)
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: LineChartSample2(lineChartSample2DataNum, "交易笔数"),
),
(tradeSummaryList == null ||
tradeSummaryList.saleBusinessAnalysisVOS.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: LineChartSample2(lineChartSample2DataNum, "交易笔数"),
),
SizedBox(
height: 16.h,
),
@ -751,53 +813,77 @@ class _TradeSummary extends State<TradeSummary> {
),
),
if (expensesSelect == 0)
Container(
height: 150.h,
child: DonutAutoLabelChart([
new charts.Series<LinearSales, int>(
id: 'Sales',
colorFn: (LinearSales sales, __) => sales.color,
domainFn: (LinearSales sales, _) => sales.year,
measureFn: (LinearSales sales, _) => sales.sales,
data: [
new LinearSales(
0,
int.parse((tradeSummaryList?.collectionAmount ?? "0")
.replaceAll(".", "")),
charts.Color.fromHex(code: "#313CA9")),
new LinearSales(
1,
int.parse((tradeSummaryList?.refundAmount ?? "0")
.replaceAll(".", "")),
charts.Color.fromHex(code: "#30415B"))
],
// Set a label accessor to control the text of the arc label.
labelAccessorFn: (LinearSales row, _) =>
'${(row.sales / 100)}',
)
]),
),
(tradeSummaryList == null ||
tradeSummaryList.collectionAmount == null ||
tradeSummaryList.refundAmount == null)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Container(
height: 150.h,
child: DonutAutoLabelChart([
new charts.Series<LinearSales, int>(
id: 'Sales',
colorFn: (LinearSales sales, __) => sales.color,
domainFn: (LinearSales sales, _) => sales.year,
measureFn: (LinearSales sales, _) => sales.sales,
data: [
new LinearSales(
0,
int.parse(
(tradeSummaryList?.collectionAmount ?? "0")
.replaceAll(".", "")),
charts.Color.fromHex(code: "#313CA9")),
new LinearSales(
1,
int.parse((tradeSummaryList?.refundAmount ?? "0")
.replaceAll(".", "")),
charts.Color.fromHex(code: "#30415B"))
],
// Set a label accessor to control the text of the arc label.
labelAccessorFn: (LinearSales row, _) =>
'${(row.sales / 100)}',
)
]),
),
if (expensesSelect == 1)
Container(
height: 150.h,
child: DonutAutoLabelChart([
new charts.Series<LinearSales, int>(
id: 'Sales',
colorFn: (LinearSales sales, __) => sales.color,
domainFn: (LinearSales sales, _) => sales.year,
measureFn: (LinearSales sales, _) => sales.sales,
(tradeSummaryList == null ||
tradeSummaryList.collectionCount == null ||
tradeSummaryList.refundCount == null)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Container(
height: 150.h,
child: DonutAutoLabelChart([
new charts.Series<LinearSales, int>(
id: 'Sales',
colorFn: (LinearSales sales, __) => sales.color,
domainFn: (LinearSales sales, _) => sales.year,
measureFn: (LinearSales sales, _) => sales.sales,
data: [
new LinearSales(0, tradeSummaryList?.collectionCount ?? 0,
charts.Color.fromHex(code: "#313CA9")),
new LinearSales(2, tradeSummaryList?.refundCount ?? 0,
charts.Color.fromHex(code: "#30415B")),
],
// Set a label accessor to control the text of the arc label.
labelAccessorFn: (LinearSales row, _) => '${(row.sales)}',
),
]),
),
data: [
new LinearSales(
0,
tradeSummaryList?.collectionCount ?? 0,
charts.Color.fromHex(code: "#313CA9")),
new LinearSales(2, tradeSummaryList?.refundCount ?? 0,
charts.Color.fromHex(code: "#30415B")),
],
// Set a label accessor to control the text of the arc label.
labelAccessorFn: (LinearSales row, _) =>
'${(row.sales)}',
),
]),
),
],
),
);

13
lib/business_system/mine/account_information.dart

@ -3,11 +3,16 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/data/business_login_info.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
class AccountInformation extends StatefulWidget {
final Map<String, dynamic> arguments;
AccountInformation({this.arguments});
@override
State<StatefulWidget> createState() {
return _AccountInformation();
@ -16,10 +21,12 @@ class AccountInformation extends StatefulWidget {
class _AccountInformation extends State<AccountInformation> {
final RefreshController refreshController = RefreshController();
BusinessLoginInfo businessLoginInfo;
@override
void initState() {
super.initState();
businessLoginInfo = widget.arguments["businessLoginInfo"];
}
@override
@ -72,21 +79,21 @@ class _AccountInformation extends State<AccountInformation> {
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,),
child: Column(
children: [
textItem("账号名称","134****7777"),
textItem("账号名称", businessLoginInfo?.name),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFEBECEF),
margin: EdgeInsets.only(top:2.h,bottom: 16.h)
),
textItem("账号","22221ff"),
textItem("账号",AppUtils.phoneEncode(businessLoginInfo?.account ?? "")),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFEBECEF),
margin: EdgeInsets.only(top:2.h,bottom: 16.h)
),
textItem("电话","13466667777"),
textItem("电话",businessLoginInfo?.mobile?? ""),
],
),
),

81
lib/business_system/mine/business_mine_page.dart

@ -1,13 +1,19 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../retrofit/data/business_login_info.dart';
import '../../utils/font_weight.dart';
class BusinessMinePage extends StatefulWidget {
final BusinessLoginInfo businessLoginInfo;
final String storeId;
BusinessMinePage(this.businessLoginInfo,this.storeId);
@override
State<StatefulWidget> createState() {
return _BusinessMinePage();
@ -39,7 +45,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
header: MyHeader(color:Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
@ -47,7 +53,10 @@ class _BusinessMinePage extends State<BusinessMinePage>
},
),
onRefresh: () {
setState(() {});
if(widget.businessLoginInfo != null)
refreshController.refreshCompleted();
else
refreshController.refreshFailed();
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
@ -98,41 +107,49 @@ class _BusinessMinePage extends State<BusinessMinePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/account_information');
Navigator.of(context).pushNamed('/router/account_information',arguments: {
"businessLoginInfo":widget.businessLoginInfo,
});
},
child: Container(
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 50, left: 16.w),
child: Row(
children: [
Image.asset(
"assets/image/bs_mine_heading.webp",
width: 69,
height: 69,
fit: BoxFit.fill,
MImage(
widget?.businessLoginInfo?.avatar ?? "",
fit: BoxFit.cover,
width: 69.h,
height: 69.h,
radius: BorderRadius.circular(100),
errorSrc: "assets/image/bs_mine_heading.webp",
fadeSrc: "assets/image/bs_mine_heading.webp",
),
SizedBox(
width: 10.w,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
'海峡姐妹茶',
style: TextStyle(
fontSize: 18.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.semi_bold),
),
Text(
'ID:gsy2022',
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.regular),
),
],
Container(
height: 69.h,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
widget?.businessLoginInfo?.name ?? "",
style: TextStyle(
fontSize: 18.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.semi_bold),
),
Text(
'ID:${widget?.businessLoginInfo?.account ?? ""}',
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF374C6C),
fontWeight: MyFontWeight.regular),
),
],
),
)
],
),
@ -170,10 +187,12 @@ class _BusinessMinePage extends State<BusinessMinePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/merchant_info');
Navigator.of(context).pushNamed('/router/merchant_info',arguments:{
"storeId":widget.storeId,
});
},
child:
commonFunctionsItem("assets/image/bs_store_info_logo.webp", "商户信息", "一心回乡农场"),
commonFunctionsItem("assets/image/bs_store_info_logo.webp", "商户信息", widget?.businessLoginInfo?.name ?? ""),
),
Container(
width: double.infinity,
@ -191,7 +210,9 @@ class _BusinessMinePage extends State<BusinessMinePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/security_setting');
Navigator.of(context).pushNamed('/router/security_setting',arguments:{
"storeId":widget.storeId,
});
},
child: commonFunctionsItem("assets/image/bs_secure.webp", "安全设置", "登录手机号/密码")
),

3
lib/business_system/mine/merchant_info.dart

@ -8,6 +8,9 @@ import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
class MerchantInfo extends StatefulWidget {
final Map<String, dynamic> arguments;
MerchantInfo({this.arguments});
@override
State<StatefulWidget> createState() {
return _MerchantInfo();

3
lib/business_system/mine/security_setting.dart

@ -8,6 +8,9 @@ import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
class SecuritySetting extends StatefulWidget {
final Map<String, dynamic> arguments;
SecuritySetting({this.arguments});
@override
State<StatefulWidget> createState() {
return _SecuritySetting();

206
lib/business_system/order/business_order_detail.dart

@ -1,13 +1,27 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_order_detail_info.dart';
import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
class BusinessOrderDetail extends StatefulWidget {
final Map<String, dynamic> arguments;
BusinessOrderDetail({this.arguments});
@override
State<StatefulWidget> createState() {
return _BusinessOrderDetail();
@ -16,10 +30,49 @@ class BusinessOrderDetail extends StatefulWidget {
class _BusinessOrderDetail extends State<BusinessOrderDetail> {
final RefreshController refreshController = RefreshController();
BusinessApiService businessService;
BusinessOrderDetailInfo orderDetailInfo;
@override
void initState() {
super.initState();
queryOrderDetail();
}
@override
void dispose() {
super.dispose();
refreshController.dispose();
}
///
queryOrderDetail() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
try {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData<BusinessOrderDetailInfo> baseData = await businessService.getAdminOrderDetail({
"id": widget.arguments["id"],
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
orderDetailInfo = baseData.data;
} else {
SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center);
}
} finally {
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
setState(() {});
}
}
@override
@ -38,14 +91,14 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
enablePullDown: true,
enablePullUp: false,
header: MyHeader(
color: Colors.white,
color: Color(0xFF30415B),
),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {},
onRefresh:(){queryOrderDetail();},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
@ -98,7 +151,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
fontWeight: MyFontWeight.semi_bold),
)),
Text(
"已完成",
status()?? "",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFFFA5151),
@ -111,14 +164,14 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: 5,
itemCount: orderDetailInfo?.orderProductDTOList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: goodsInfoItem(),
child: goodsInfoItem(orderDetailInfo.orderProductDTOList[position]),
);
},
)
@ -127,16 +180,16 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
);
}
Widget goodsInfoItem() {
Widget goodsInfoItem(OrderProductDtoList orderProductDTOList) {
return Container(
margin: EdgeInsets.only(bottom: 12.h),
height: 77.h,
child: Row(
children: [
Image.asset(
"assets/image/hot_list.webp",
width: 77,
height: 77,
MImage(
orderProductDTOList?.skuImg ?? "",
width: 77.h,
height: 77.h,
fit: BoxFit.fill,
),
SizedBox(
@ -146,7 +199,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Text(
"御林古桑园啤酒节大肠包小肠美味...",
orderProductDTOList?.productName ?? "",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
@ -156,7 +209,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
Row(
children: [
Expanded(child: Text(
"×1",
"×${orderProductDTOList?.buyNum ?? 0}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
@ -164,7 +217,7 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
),
)),
Text(
"12",
"${orderProductDTOList?.sellPrice ?? ""}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
@ -221,57 +274,64 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
SizedBox(
height: 12.h,
),
Row(
children: [
Expanded(
child: Text(
"订单号",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF808080),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
copyOrderCode(orderDetailInfo?.orderCode ?? "");
SmartDialog.showToast("复制成功!",
alignment: Alignment.center);
},
child:Row(
children: [
Expanded(
child: Text(
"订单号",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 14.sp,
color: Color(0xFF808080),
),
)),
Text(
orderDetailInfo?.orderCode ?? "",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
)),
Text(
"1222222222222222",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(
2,
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(
2,
),
border: Border.all(
color: Color(0xFF30415B),
width: 1.w,
),
),
border: Border.all(
color: Color(0xFF30415B),
width: 1.w,
padding: EdgeInsets.symmetric(horizontal: 7.w, vertical: 2.h),
margin: EdgeInsets.only(left: 4.w),
child: Text(
"复制",
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
),
padding: EdgeInsets.symmetric(horizontal: 7.w, vertical: 2.h),
margin: EdgeInsets.only(left: 4.w),
child: Text(
"复制",
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
),
],
],
)
),
orderInfoItem("创建时间", "2022-08-09 12:33:12"),
orderInfoItem("门店", "海峡姐妹茶"),
orderInfoItem("用户名", "2233"),
orderInfoItem("手机号", "17671877666"),
orderInfoItem("订单金额", "766"),
orderInfoItem("创建时间", "海峡姐妹茶"),
orderInfoItem("优惠金额", "22.33"),
orderInfoItem("实付金额", "2233.00"),
orderInfoItem("预约时间", "2022-08-09 12:33:12"),
orderInfoItem("创建时间", orderDetailInfo?.createTime ?? ""),
orderInfoItem("门店", orderDetailInfo?.storeName ?? ""),
orderInfoItem("用户名", orderDetailInfo?.memberInfo?.name ?? ""),
orderInfoItem("手机号", orderDetailInfo?.memberInfo?.phone ?? ""),
orderInfoItem("订单金额", orderDetailInfo?.orderSum ?? "0.00"),
orderInfoItem("优惠金额", orderDetailInfo?.discountAmount ??"0.00"),
orderInfoItem("实付金额", orderDetailInfo?.paySum ?? "0.00"),
orderInfoItem("预约时间", orderDetailInfo?.subcribeTime ?? ""),
],
),
);
@ -308,4 +368,32 @@ class _BusinessOrderDetail extends State<BusinessOrderDetail> {
),
);
}
///
copyOrderCode(String orderCode) {
print(orderCode);
Clipboard.setData(ClipboardData(text: orderCode));
}
String status (){
if(orderDetailInfo?.orderStatus == -1){
return "错误订单";
}else {
if(orderDetailInfo?.orderStatus == 1){
return "未付款";
}else if(orderDetailInfo?.orderStatus == 5){
return "已取消";
}else if(orderDetailInfo?.payStatus == 1 && orderDetailInfo?.refundStatus == 2){
return "退款待审核";
}else if(orderDetailInfo?.orderStatus == 3 && orderDetailInfo?.refundStatus == 1){
return "已退款";
}else if(orderDetailInfo?.orderStatus == 4){
return "已完成";
}else if(orderDetailInfo?.orderStatus == 2){
return "已付款";
}else if(orderDetailInfo?.orderStatus == 3){
return "已确认";
}
}
}
}

109
lib/business_system/order/business_order_page.dart

@ -1,19 +1,19 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../generated/l10n.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/my_appbar.dart';
import '../../view_widget/my_tab.dart';
import '../goods/off_shelf/off_shelf_page.dart';
import '../goods/on_sale/on_sale_page.dart';
import 'order_list.dart';
class BusinessOrderPage extends StatefulWidget {
final String storeId;
BusinessOrderPage(this.storeId);
@override
State<StatefulWidget> createState() {
@ -28,9 +28,11 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
final TextEditingController editingController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
String selectTimeDate ="";
String selectTimeDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now().subtract(Duration(days:1)))}"
"${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
List<GlobalKey> _allKey = [];
String selectTimeDate = "";
String selectTimeDateNum =
"${DateFormat("yyyy年MM月dd日 00:00:00").format(DateTime.now().subtract(Duration(days: 2)))}"
"${DateFormat("yyyy年MM月dd日 23:59:59").format(DateTime.now())}";
@override
void initState() {
@ -49,6 +51,12 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
}
});
});
loadFinish();
}
loadFinish() {
_allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
///
@ -63,25 +71,25 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
super.build(context);
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Column(
children: [
orderSearch(),
Expanded(
child:
Stack(
child: Stack(
children: [
DefaultTabController(
length:4,
length: 4,
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title:"",
title: "",
leading: false,
background: Colors.white,
toolbarHeight: kToolbarHeight+MediaQuery.of(context).padding.top,
toolbarHeight:
kToolbarHeight + MediaQuery.of(context).padding.top,
bottom: TabBar(
// isScrollable: true, //
//
@ -95,27 +103,31 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)
),
color: Color(0xFF666666)),
// controller: tabController,
//
unselectedLabelColor: Color(0xffA29E9E),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text:"全部"),
MyTab(text: "全部"),
MyTab(text: "未付款"),
MyTab(text:"已付款"),
MyTab(text: "已付款"),
MyTab(text: "已退款"),
],
),
),
body: TabBarView(
children: [
OrderList(0),
OrderList(1),
OrderList(2),
OrderList(3),],
OrderList(_allKey[0], 0, widget.storeId,
editingController.text, selectTime()),
OrderList(_allKey[1], 1, widget.storeId,
editingController.text, selectTime()),
OrderList(_allKey[2], 2, widget.storeId,
editingController.text, selectTime()),
OrderList(_allKey[3], 3, widget.storeId,
editingController.text, selectTime()),
],
),
),
),
@ -142,7 +154,11 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
color: Colors.white,
child: Container(
height: 40.h,
margin: EdgeInsets.only(left: 18.w,right: 18.w,top:55.h,),
margin: EdgeInsets.only(
left: 18.w,
right: 18.w,
top: 55.h,
),
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
@ -152,6 +168,7 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
textInputAction: TextInputAction.search,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
loadFinish();
},
style: TextStyle(
fontSize: 15.sp,
@ -164,12 +181,10 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
hintStyle: TextStyle(
color: Color(0xFF808080),
fontSize: 15.sp,
fontWeight: MyFontWeight.regular
),
fontWeight: MyFontWeight.regular),
contentPadding: EdgeInsets.symmetric(
vertical: 12.h,
),
prefixIcon: Image.asset(
"assets/image/bs_goods_search.webp",
width: 20,
@ -178,52 +193,39 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
border: InputBorder.none,
),
),
),),
),
),
);
}
Widget timeSelect(){
Widget timeSelect() {
return Container(
color: Colors.white,
child: GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/custom_page').then((value){
setState((){
onTap: () {
Navigator.of(context).pushNamed('/router/custom_page').then((value) {
selectTimeDate = value;
loadFinish();
});
});},
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
margin: EdgeInsets.only(left: 18.w,right: 18.w,top: 12.h,bottom: 16.h),
padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 12.h),
margin:
EdgeInsets.only(left: 18.w, right: 18.w, top: 12.h, bottom: 16.h),
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
(selectTimeDate == "" || selectTimeDate == null) ? selectTimeDateNum : selectTimeDate,
("${selectTime().substring(0, 11)} ${selectTime().substring(21, 34)}"),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
// Padding(padding:EdgeInsets.only(left:22.w,right: 26.w),
// child: Text(
// '',
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xFF30415B),
// fontWeight: MyFontWeight.regular),
// ),),
// Text(
// '2022-08-24 16:50',
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xFF30415B),
// fontWeight: MyFontWeight.regular),
// ),
],
),
),
@ -231,6 +233,13 @@ class _BusinessOrderPage extends State<BusinessOrderPage>
);
}
String selectTime() {
if (selectTimeDate == "" || selectTimeDate == null) {
return selectTimeDateNum;
} else
return selectTimeDate;
}
@override
bool get wantKeepAlive => true;
}

458
lib/business_system/order/order_list.dart

@ -1,15 +1,31 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../utils/font_weight.dart';
import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_order_list.dart';
import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../view_widget/no_data_view.dart';
class OrderList extends StatefulWidget {
final int status;
OrderList(this.status);
final String storeId;
final String keyword;
final String time;
OrderList(Key key, this.status, this.storeId, this.keyword, this.time)
: super(key: key);
@override
State<StatefulWidget> createState() {
@ -21,6 +37,9 @@ class _OrderList extends State<OrderList> {
final RefreshController _refreshController = RefreshController();
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics();
final ScrollController controller = ScrollController();
BusinessApiService businessService;
List<AdminOrderDtoList> adminOrderDTOList = [];
int _pageIndex = 1;
@override
void dispose() {
@ -31,17 +50,78 @@ class _OrderList extends State<OrderList> {
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh({bool isShowLoad = true}) async {
if (isShowLoad)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
await queryOrderList();
EasyLoading.dismiss();
if (!mounted) return;
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
setState(() {});
}
_onRefresh() async {}
///
queryOrderList() async {
if (businessService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData<BusinessOrderList> baseData =
await businessService.findAdminOrderList({
"orderCode": "",
"keywordType": 1,
"keyword": widget?.keyword ?? "",
"orderStatus": "",
"startTime": widget.time
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 19),
"endTime": widget.time
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(widget.time.length >= 21 ? 22 : 0,
widget.time.length >= 21 ? 41 : 0),
"pageIndex": _pageIndex,
"pageSize": 10,
"refundStatus": widget.status == 3 ? "1" : "",
"payStatus": widget.status == 1 ? "0" : (widget.status == 2 ? "1" : ""),
"showCancelOrder": 1,
"orderType": ""
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
adminOrderDTOList.addAll(baseData?.data?.adminOrderDTOList ?? []);
if ((baseData?.data?.adminOrderDTOList ?? []).isEmpty ||
adminOrderDTOList.length == baseData.data.total)
_refreshController.loadNoData();
else
_refreshController.loadComplete();
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
enablePullUp: adminOrderDTOList.length == 0 ? false : true,
header: MyHeader(color: Color(0xFF30415B)),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
builder: (context, mode) {
@ -49,224 +129,274 @@ class _OrderList extends State<OrderList> {
},
),
onRefresh: () {
setState(() {
_onRefresh();
});
_pageIndex = 1;
adminOrderDTOList.clear();
_onRefresh();
},
child:Padding(padding:EdgeInsets.symmetric(vertical: 16.w),
child: ListView.builder(
itemCount: 5,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/business_order_detail');
},
child: orderItem(),
);
},
),),
onLoading: () {
_pageIndex++;
_onRefresh();
},
child: (adminOrderDTOList == null || adminOrderDTOList.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
iconHeight: 120.h,
margin: EdgeInsets.all(50.h),
)
: Padding(
padding: EdgeInsets.symmetric(vertical: 16.w),
child: ListView.builder(
itemCount: adminOrderDTOList?.length ?? 0,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/business_order_detail',arguments: {"id":adminOrderDTOList[position].id,"storeId":widget.storeId});
},
child: orderItem(adminOrderDTOList[position]),
);
},
),
),
);
}
Widget orderItem() {
Widget orderItem(AdminOrderDtoList adminOrderDtoList) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
margin: EdgeInsets.only(left: 16.w,right: 16.w,bottom: 16.h),
padding:EdgeInsets.symmetric(vertical: 12.h),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h),
padding: EdgeInsets.symmetric(vertical: 12.h),
child: Column(
children: [
Padding(padding:EdgeInsets.only(bottom:12.h,left: 12.w,right: 12.w),
child: Row(
children: [
Image.asset(
"assets/image/bs_switch_shop.webp",
width:16,
height:16,
),
SizedBox(width: 3.w,),
Expanded(child: Text(
"海峡姐妹奶茶",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.semi_bold
Padding(
padding: EdgeInsets.only(bottom: 12.h, left: 12.w, right: 12.w),
child: Row(
children: [
Image.asset(
"assets/image/bs_switch_shop.webp",
width: 16,
height: 16,
),
)),
Text(
widget.status == 0 ?"全部":widget.status == 1 ? "未付款":widget.status == 2 ? "已付款":"已退款",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFFFA5151),
fontWeight: MyFontWeight.semi_bold
SizedBox(
width: 3.w,
),
)
],
),),
Expanded(
child: Text(
adminOrderDtoList?.storeName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.semi_bold),
)),
Text(
widget.status == 0
? "全部"
: widget.status == 1
? "未付款"
: widget.status == 2
? "已付款"
: "已退款",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFFFA5151),
fontWeight: MyFontWeight.semi_bold),
)
],
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFF4F6F7),
),
Padding(padding:EdgeInsets.symmetric(horizontal: 12.w),
child: Column(
children: [
Container(
height:170.h,
margin: EdgeInsets.only(top: 17.h,bottom:13.h),
child:
ListView.builder(
padding: EdgeInsets.zero,
itemCount:6,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: orderGoodsList(),
);
},
),
),
Row(children: [
Text(
"订单编号:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular
Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 17.h, bottom: 13.h),
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: adminOrderDtoList?.orderProductList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: orderGoodsList(
adminOrderDtoList.orderProductList[position]),
);
},
),
),
Padding(padding:EdgeInsets.only(left: 14.w),
child:
Text(
"1223211111112333333",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular
Row(
children: [
Text(
"订单编号:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
),),
],),
SizedBox(height: 4.h,),
Row(children: [
Text(
"支付时间::",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular
),
Padding(
padding: EdgeInsets.only(left: 14.w),
child: Text(
adminOrderDtoList?.orderCode ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
),
],
),
SizedBox(width: 14.w,),
Expanded(child: Text(
"2022-08-09 12:33:12",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular
),
),),
Text(
"¥245",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.medium
),
SizedBox(
height: 4.h,
),
],),
SizedBox(height:20.h,),
Row(
children: [
Spacer(),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/order_write_off');
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(4),
),
padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 26.w),
margin: EdgeInsets.only(right:20.h),
child:Text(
"核销",
Row(
children: [
Text(
"支付时间:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
SizedBox(
width: 14.w,
),
Expanded(
child: Text(
adminOrderDtoList?.createTime ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
fontWeight: MyFontWeight.regular
),
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
),
),GestureDetector(
Text(
adminOrderDtoList?.paySum ?? "",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF181818),
fontWeight: MyFontWeight.medium),
),
],
),
SizedBox(
height: 20.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
// Spacer(),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.of(context).pushNamed('/router/request_refund');
onTap: () {
Navigator.of(context)
.pushNamed('/router/order_write_off');
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: Color(0xFF30415B),
width: 1,
),
),
padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 14.w),
child:Text(
"申请退款",
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 26.w),
margin: EdgeInsets.only(
right: (adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0)
? 20.w
: 0),
child: Text(
"核销",
style: TextStyle(
fontSize: 12.sp,
color: Colors.white,
fontWeight: MyFontWeight.regular),
),
),
),
if (adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/request_refund', arguments: {
"refundAmount": adminOrderDtoList?.paySum ?? "",
"mid": adminOrderDtoList?.mid ?? "",
"orderId": adminOrderDtoList?.id ?? "",
"storeId": widget.storeId ?? "",
}).then((value) => {
_pageIndex = 1,
adminOrderDTOList.clear(),
_onRefresh(isShowLoad: false),
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular
width: 1,
),
),
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 14.w),
child: Text(
"申请退款",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
),
),
),
],
)
],
),),
],
)
],
),
),
],
),
);
}
Widget orderGoodsList(){
Widget orderGoodsList(OrderProductList orderProductList) {
return Container(
margin: EdgeInsets.only(bottom: 13.h),
child: Row(
children: [
Expanded(child: Text(
"葡萄榨汁饮料",
Expanded(
child: Text(
orderProductList?.productName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.medium
),
fontWeight: MyFontWeight.medium),
)),
Text(
"x1",
"x${(orderProductList?.buyNum ?? 0).toString()}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF000000),
fontWeight: MyFontWeight.regular
),
fontWeight: MyFontWeight.regular),
)
],
),

332
lib/business_system/order/request_refund.dart

@ -1,16 +1,28 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/refund_reason_list.dart';
import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../view_widget/border_text.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
import '../../view_widget/round_button.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class RequestRefund extends StatefulWidget {
final Map<String, dynamic> arguments;
RequestRefund({this.arguments});
@override
State<StatefulWidget> createState() {
return _RequestRefund();
@ -24,6 +36,10 @@ class _RequestRefund extends State<RequestRefund> {
bool isKeyBoardShow = false;
int modifyAmountState = 0;
int refundState = 0;
RefundReasonList reasonReasonList;
BusinessApiService businessService;
String refundAmount;
String selectRefundReason;
@override
void initState() {
@ -42,6 +58,8 @@ class _RequestRefund extends State<RequestRefund> {
}
});
});
refundAmount = widget.arguments["refundAmount"];
queryRefundReason();
}
///
@ -51,10 +69,73 @@ class _RequestRefund extends State<RequestRefund> {
super.dispose();
}
///退
queryRefundReason() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData<RefundReasonList> baseData = await businessService.refundReason({
"current": 1,
"model": {"type": 3},
"size": 20
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
reasonReasonList = baseData.data;
}
}
///退
orderRefund() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
try {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData baseData = await businessService.refundOrder({
"tenant_code": BusinessInstance.instance.businessTenant,
"orderId": widget.arguments["orderId"],
"mid": widget.arguments["mid"],
"reason": selectRefundReason,
"backMoney": modifyAmountController.text == ""
? refundAmount
: modifyAmountController.text,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.show(
widget: SettlementTips(
() {},
text: baseData?.data ?? "",
color: Color(0xFF30415B),
));
Navigator.of(context).pop();
} else {
SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center);
}
} finally {
EasyLoading.dismiss();
}
}
@override
Widget build(BuildContext context) {
return
Scaffold(
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFFF8F8FA),
appBar: MyAppBar(
@ -65,8 +146,8 @@ class _RequestRefund extends State<RequestRefund> {
brightness: Brightness.dark,
),
body: Container(
margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w),
child:Column(
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
child: Column(
children: [
Container(
decoration: BoxDecoration(
@ -81,7 +162,11 @@ class _RequestRefund extends State<RequestRefund> {
),
],
),
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,),
padding: EdgeInsets.only(
top: 16.h,
left: 16.w,
right: 16.w,
),
child: Column(
children: [
Row(
@ -90,7 +175,7 @@ class _RequestRefund extends State<RequestRefund> {
width: 2.w,
height: 16.h,
color: Color(0xFF30415B),
margin: EdgeInsets.only(right:6.w),
margin: EdgeInsets.only(right: 6.w),
),
Text(
"申请金额",
@ -102,11 +187,14 @@ class _RequestRefund extends State<RequestRefund> {
),
],
),
SizedBox(height:32.h,),
SizedBox(
height: modifyAmountState == 0 ? 32.h : 16.h,
),
Row(
children: [
if(modifyAmountState == 0)
Expanded(child:Text.rich(
if (modifyAmountState == 0)
Expanded(
child: Text.rich(
TextSpan(
children: [
TextSpan(
@ -118,7 +206,7 @@ class _RequestRefund extends State<RequestRefund> {
),
),
TextSpan(
text: "1112.33",
text: refundAmount ?? "",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 24.sp,
@ -128,7 +216,7 @@ class _RequestRefund extends State<RequestRefund> {
],
),
)),
if(modifyAmountState == 1)
if (modifyAmountState == 1)
Text(
"",
style: TextStyle(
@ -137,30 +225,30 @@ class _RequestRefund extends State<RequestRefund> {
fontWeight: MyFontWeight.semi_bold,
),
),
if(modifyAmountState == 1)
Expanded(child: TextField(
controller: modifyAmountController,
decoration: InputDecoration(
hintText: "请输入修改金额",
hintStyle: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
if (modifyAmountState == 1)
Expanded(
child: TextField(
controller: modifyAmountController,
decoration: InputDecoration(
hintText: "请输入修改金额",
hintStyle: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
border: InputBorder.none,
),
border: InputBorder.none,
),
keyboardType: TextInputType.phone,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 24.sp,
fontWeight: MyFontWeight.medium
keyboardType: TextInputType.phone,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 24.sp,
fontWeight: MyFontWeight.medium),
),
),),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
onTap: () {
// showModifyAmountDialog();
setState((){
setState(() {
modifyAmountState = 1;
});
},
@ -169,10 +257,12 @@ class _RequestRefund extends State<RequestRefund> {
Image.asset(
"assets/image/bs_edit.webp",
fit: BoxFit.cover,
width:16,
height:16,
width: 16,
height: 16,
),
SizedBox(
width: 4.w,
),
SizedBox(width: 4.w,),
Text(
"修改金额",
style: TextStyle(
@ -190,7 +280,44 @@ class _RequestRefund extends State<RequestRefund> {
height: 1.h,
width: double.infinity,
color: Color(0xFFEBECEF),
margin: EdgeInsets.only(bottom: 50.h),
margin: EdgeInsets.only(bottom: 24.h),
),
Padding(
padding: EdgeInsets.only(bottom: 25.h),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showRefundReason();
},
child: Row(
children: [
Expanded(
child: Text(
"退款原因",
style: TextStyle(
color: Color(0xFF7A797F),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
)),
Text(
selectRefundReason ?? "请选择退款原因",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
Padding(
padding: EdgeInsets.only(left: 8.w),
child: Image.asset(
"assets/image/bs_right.webp",
width: 8.w,
height: 12.h,
)),
],
),
),
)
],
),
@ -198,22 +325,25 @@ class _RequestRefund extends State<RequestRefund> {
Spacer(),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
if(refundState == 1){
Navigator.of(context).pop();
}else{
showModifyAmountDialog();
onTap: () {
if (refundState == 1) {
orderRefund();
} else {
if (selectRefundReason == null) {
SmartDialog.showToast("请选择退款原因",
alignment: Alignment.center);
} else
showModifyAmountDialog();
}
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
margin: EdgeInsets.only(bottom:55.h,top: 125.h),
padding: EdgeInsets.symmetric(vertical:16.h),
margin: EdgeInsets.only(bottom: 55.h, top: 125.h),
padding: EdgeInsets.symmetric(vertical: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27),
color: Color(0xFF30415B)
),
color: Color(0xFF30415B)),
child: Text(
"确定退款",
style: TextStyle(
@ -227,7 +357,8 @@ class _RequestRefund extends State<RequestRefund> {
],
),
),
);
),
);
}
///
@ -300,7 +431,7 @@ class _RequestRefund extends State<RequestRefund> {
fontWeight: FontWeight.bold,
),
onTap: () {
setState((){
setState(() {
refundState = 1;
Navigator.of(context).pop();
});
@ -318,4 +449,111 @@ class _RequestRefund extends State<RequestRefund> {
);
}
///退
showRefundReason() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return Container(
width: double.infinity,
height: 309.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12),
child: Text(
"退款原因",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 17.sp,
color: Color(0xFF1A1A1A),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Padding(
padding: EdgeInsets.only(right: 16.w),
child: Image.asset(
"assets/image/cancel.webp",
width: 25.h,
height: 25.h,
),
),
),
],
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount: reasonReasonList?.records?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
selectRefundReason =
reasonReasonList.records[position].reason;
});
Navigator.of(context).pop();
},
child: refundReasonItem(
reasonReasonList.records[position]),
);
},
),
)
],
),
);
});
}
refundReasonItem(Records records) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 16.h),
child: Text(
records?.reason ?? "",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
),
),
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0xFFEBEBEB),
)
],
);
}
}

10
lib/main.dart

@ -491,17 +491,17 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/batch_shelf': (context, {arguments}) =>
BatchShelf(),
'/router/business_order_detail': (context, {arguments}) =>
BusinessOrderDetail(),
BusinessOrderDetail(arguments: arguments),
'/router/order_write_off': (context, {arguments}) =>
OrderWriteOff(),
'/router/security_setting': (context, {arguments}) =>
SecuritySetting(),
SecuritySetting(arguments: arguments),
'/router/merchant_info': (context, {arguments}) =>
MerchantInfo(),
MerchantInfo(arguments: arguments),
'/router/account_information': (context, {arguments}) =>
AccountInformation(),
AccountInformation(arguments: arguments),
'/router/request_refund': (context, {arguments}) =>
RequestRefund(),
RequestRefund(arguments:arguments),
'/router/day_report_page': (context, {arguments}) =>
DayReportPage(),
'/router/week_report_page': (context, {arguments}) =>

3
lib/qr/qr_code_scan.dart

@ -1,12 +1,9 @@
import 'dart:ui';
import 'package:flutter/material.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:image_pickers/image_pickers.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:scan/scan.dart';
class QrCodeScanPage extends StatefulWidget {

47
lib/retrofit/business_api.dart

@ -12,9 +12,14 @@ import 'package:huixiang/retrofit/data/vip_counts_info.dart';
import 'package:retrofit/retrofit.dart';
import 'data/base_data.dart';
import 'data/business_goods.dart';
import 'data/business_order_detail_info.dart';
import 'data/business_order_list.dart';
import 'data/day_flow_list.dart';
import 'data/goods_type_sales_list.dart';
import 'data/popular_sales_list.dart';
import 'data/product_group_list.dart';
import 'data/refund_reason_list.dart';
import 'data/single_sales_list.dart';
import 'data/trade_summary_list.dart';
@ -22,6 +27,7 @@ part 'business_api.g.dart';
///
const localBaseUrl = "http://admin-api.test.yixinhuixiang.com/";
///
// const localBaseUrl = "http://test-merchant.lotus-wallet.com/test-merchant/";
@ -147,8 +153,7 @@ abstract class BusinessApiService {
////
@GET("largeScreenReport/getDayCounts?date={date}")
Future<BaseData<VipCountsInfo>> vipCounts(
@Path("date") String date);
Future<BaseData<VipCountsInfo>> vipCounts(@Path("date") String date);
////isMonth=0()isMonth=1()
@GET("dashBoard/order?yearMonth={yearMonth}&isMonth={isMonth}")
@ -157,14 +162,46 @@ abstract class BusinessApiService {
////
@POST("audit/salesLeaderboard")
Future<BaseData<List<SingleSalesList>>> singleSales(@Body() Map<String, dynamic> param);
Future<BaseData<List<SingleSalesList>>> singleSales(
@Body() Map<String, dynamic> param);
////
@POST("audit/allKindsSalesStatistics")
Future<BaseData<List<GoodsTypeSalesList>>> goodsSalesList(@Body() Map<String, dynamic> param);
Future<BaseData<List<GoodsTypeSalesList>>> goodsSalesList(
@Body() Map<String, dynamic> param);
//// day week month custom
@POST("largeScreenReport/saleBusinessAnalysis")
Future<BaseData<TradeSummaryList>> saleBusinessAnalysis(@Body() Map<String, dynamic> param);
Future<BaseData<TradeSummaryList>> saleBusinessAnalysis(
@Body() Map<String, dynamic> param);
///
@POST("order/findAdminOrderList")
Future<BaseData<BusinessOrderList>> findAdminOrderList(
@Body() Map<String, dynamic> param);
///
@POST("order/getAdminOrderDetail")
Future<BaseData<BusinessOrderDetailInfo>> getAdminOrderDetail(
@Body() Map<String, dynamic> param);
///退
@POST("reason/page")
Future<BaseData<RefundReasonList>> refundReason(
@Body() Map<String, dynamic> param);
///退
@POST("order/refundOrder")
Future<BaseData> refundOrder(@Body() Map<String, dynamic> param);
////
@POST("productGroup/page")
Future<BaseData<ProductGroupList>> productGroup(
@Body() Map<String, dynamic> param);
////
@POST("product/findAdminProductListNew")
Future<BaseData<BusinessGoods>> findAdminProductLis(
@Body() Map<String, dynamic> param);
}

163
lib/retrofit/business_api.g.dart

@ -28,8 +28,7 @@ class _BusinessApiService implements BusinessApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'anno/token',
final _result = await _dio.request<Map<String, dynamic>>('anno/token',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -39,7 +38,7 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData.fromJson(
_result.data,
(json) => json == null ? null : json,
(json) => json == null ? null : json,
);
return value;
}
@ -62,7 +61,7 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<DayCount>.fromJson(
_result.data,
(json) => json == "" ? null :DayCount.fromJson(json),
(json) => json == "" ? null : DayCount.fromJson(json),
);
return value;
}
@ -84,7 +83,7 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<PopularSalesList>.fromJson(
_result.data,
(json) => PopularSalesList.fromJson(json),
(json) => PopularSalesList.fromJson(json),
);
return value;
}
@ -94,8 +93,7 @@ class _BusinessApiService implements BusinessApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'trend/orderTrend',
final _result = await _dio.request<Map<String, dynamic>>('trend/orderTrend',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -105,7 +103,7 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<List<OrderTrend>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
(json) => (json as List<dynamic>)
.map<OrderTrend>(
(i) => OrderTrend.fromJson(i as Map<String, dynamic>))
.toList());
@ -129,13 +127,13 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<VipCountsInfo>.fromJson(
_result.data,
(json) => VipCountsInfo.fromJson(json),
(json) => VipCountsInfo.fromJson(json),
);
return value;
}
@override
Future<BaseData<List<DayFlowList>>> dayFlow(yearMonth,isMonth) async {
Future<BaseData<List<DayFlowList>>> dayFlow(yearMonth, isMonth) async {
ArgumentError.checkNotNull(yearMonth, 'yearMonth');
ArgumentError.checkNotNull(isMonth, 'isMonth');
const _extra = <String, dynamic>{};
@ -152,7 +150,7 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<List<DayFlowList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
(json) => (json as List<dynamic>)
.map<DayFlowList>(
(i) => DayFlowList.fromJson(i as Map<String, dynamic>))
.toList());
@ -177,7 +175,7 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<List<SingleSalesList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
(json) => (json as List<dynamic>)
.map<SingleSalesList>(
(i) => SingleSalesList.fromJson(i as Map<String, dynamic>))
.toList());
@ -202,7 +200,7 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<List<GoodsTypeSalesList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
(json) => (json as List<dynamic>)
.map<GoodsTypeSalesList>(
(i) => GoodsTypeSalesList.fromJson(i as Map<String, dynamic>))
.toList());
@ -227,7 +225,144 @@ class _BusinessApiService implements BusinessApiService {
data: _data);
final value = BaseData<TradeSummaryList>.fromJson(
_result.data,
(json) => json == "" ? null :TradeSummaryList.fromJson(json),
(json) => json == "" ? null : TradeSummaryList.fromJson(json),
);
return value;
}
@override
Future<BaseData<BusinessOrderList>> findAdminOrderList(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/findAdminOrderList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<BusinessOrderList>.fromJson(
_result.data,
(json) => json == "" ? null : BusinessOrderList.fromJson(json),
);
return value;
}
@override
Future<BaseData<BusinessOrderDetailInfo>> getAdminOrderDetail(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/getAdminOrderDetail',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<BusinessOrderDetailInfo>.fromJson(
_result.data,
(json) => json == "" ? null : BusinessOrderDetailInfo.fromJson(json),
);
return value;
}
@override
Future<BaseData<RefundReasonList>> refundReason(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>>('reason/page',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<RefundReasonList>.fromJson(
_result.data,
(json) => json == "" ? null : RefundReasonList.fromJson(json),
);
return value;
}
@override
Future<BaseData> refundOrder(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/refundOrder',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(
_result.data,
(json) => json == null ? null : json,
);
return value;
}
@override
Future<BaseData<ProductGroupList>> productGroup(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>>(
'productGroup/page',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<ProductGroupList>.fromJson(
_result.data,
(json) => json == "" ? null : ProductGroupList.fromJson(json),
);
return value;
}
@override
Future<BaseData<BusinessGoods>> findAdminProductLis(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>>(
'product/findAdminProductListNew',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<BusinessGoods>.fromJson(
_result.data,
(json) => json == "" ? null : BusinessGoods.fromJson(json),
);
return value;
}

746
lib/retrofit/data/business_goods.dart

File diff suppressed because one or more lines are too long

1083
lib/retrofit/data/business_order_detail_info.dart

File diff suppressed because it is too large Load Diff

779
lib/retrofit/data/business_order_list.dart

@ -0,0 +1,779 @@
/// total : 1
/// adminOrderDTOList : [{"id":"1704311046749028352","orderCode":"202309200946320001","storeName":"士林鲜果&牛奶","productCount":1,"orderStatus":1,"orderSum":"0.01","paySum":"0","createTime":"2023-09-20 09:46:33","returnType":0,"orderType":0,"returnCode":null,"returnStatus":null,"applyTime":null,"applySum":null,"memberAccount":"郑州小吃街","name":null,"payStatus":0,"couponSubPrice":"0.00","totalDiscountPrice":"0.00","orderSource":3,"dayFlowCode":"352","tableId":"0","tableName":null,"realPeople":null,"refundStatus":0,"notes":"","payNum":null,"reason":null,"isSubscribe":false,"subcribeTime":null,"endRefundTime":null,"memberInfo":null,"orderProductList":[{"id":"1704311046925189120","createTime":"2023-09-20 09:46:33","createUser":"1640233401329909760","updateTime":"2023-09-20 09:46:33","updateUser":"1640233401329909760","tenantCode":"1195","storeId":"1645316356192600064","orderId":"1704311046749028352","actInfo":null,"productId":"1685891939443933184","productName":"芒果牛乳","skuId":"1704310860643565568","skuNameStr":"700ml 冰 七分糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"19.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}],"mid":"1640233401329909760","isTakeOut":0,"logisticsId":"0","shipperCode":"","logisticsName":"","logisticsNum":"","logisticsCase":null,"postFee":"0.00","finalPayPrice":"0.00"}]
class BusinessOrderList {
BusinessOrderList({
num total,
List<AdminOrderDtoList> adminOrderDTOList,}){
_total = total;
_adminOrderDTOList = adminOrderDTOList;
}
BusinessOrderList.fromJson(dynamic json) {
_total = json['total'];
if (json['adminOrderDTOList'] != null) {
_adminOrderDTOList = [];
json['adminOrderDTOList'].forEach((v) {
_adminOrderDTOList.add(AdminOrderDtoList.fromJson(v));
});
}
}
num _total;
List<AdminOrderDtoList> _adminOrderDTOList;
BusinessOrderList copyWith({ num total,
List<AdminOrderDtoList> adminOrderDTOList,
}) => BusinessOrderList( total: total ?? _total,
adminOrderDTOList: adminOrderDTOList ?? _adminOrderDTOList,
);
num get total => _total;
List<AdminOrderDtoList> get adminOrderDTOList => _adminOrderDTOList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['total'] = _total;
if (_adminOrderDTOList != null) {
map['adminOrderDTOList'] = _adminOrderDTOList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// id : "1704311046749028352"
/// orderCode : "202309200946320001"
/// storeName : "士林鲜果&牛奶"
/// productCount : 1
/// orderStatus : 1
/// orderSum : "0.01"
/// paySum : "0"
/// createTime : "2023-09-20 09:46:33"
/// returnType : 0
/// orderType : 0
/// returnCode : null
/// returnStatus : null
/// applyTime : null
/// applySum : null
/// memberAccount : "郑州小吃街"
/// name : null
/// payStatus : 0
/// couponSubPrice : "0.00"
/// totalDiscountPrice : "0.00"
/// orderSource : 3
/// dayFlowCode : "352"
/// tableId : "0"
/// tableName : null
/// realPeople : null
/// refundStatus : 0
/// notes : ""
/// payNum : null
/// reason : null
/// isSubscribe : false
/// subcribeTime : null
/// endRefundTime : null
/// memberInfo : null
/// orderProductList : [{"id":"1704311046925189120","createTime":"2023-09-20 09:46:33","createUser":"1640233401329909760","updateTime":"2023-09-20 09:46:33","updateUser":"1640233401329909760","tenantCode":"1195","storeId":"1645316356192600064","orderId":"1704311046749028352","actInfo":null,"productId":"1685891939443933184","productName":"芒果牛乳","skuId":"1704310860643565568","skuNameStr":"700ml 冰 七分糖","skuImg":"","buyNum":1,"refundNum":0,"type":0,"reason":null,"weight":0.0,"applyPrice":"19.00","sellPrice":"0.01","postPay":"0.00","isDelete":0,"discountAmount":"0.00","discountPercent":100,"status":true,"batch":1,"deliveries":0,"ticketType":"","ticketDays":"0","takeType":null,"skuTickets":[],"ticketStyle":"","setMealDataList":null,"packagingFee":"0.00"}]
/// mid : "1640233401329909760"
/// isTakeOut : 0
/// logisticsId : "0"
/// shipperCode : ""
/// logisticsName : ""
/// logisticsNum : ""
/// logisticsCase : null
/// postFee : "0.00"
/// finalPayPrice : "0.00"
class AdminOrderDtoList {
AdminOrderDtoList({
String id,
String orderCode,
String storeName,
num productCount,
num orderStatus,
String orderSum,
String paySum,
String createTime,
num returnType,
num orderType,
dynamic returnCode,
dynamic returnStatus,
dynamic applyTime,
dynamic applySum,
String memberAccount,
dynamic name,
num payStatus,
String couponSubPrice,
String totalDiscountPrice,
num orderSource,
String dayFlowCode,
String tableId,
dynamic tableName,
dynamic realPeople,
num refundStatus,
String notes,
dynamic payNum,
dynamic reason,
bool isSubscribe,
dynamic subcribeTime,
dynamic endRefundTime,
dynamic memberInfo,
List<OrderProductList> orderProductList,
String mid,
num isTakeOut,
String logisticsId,
String shipperCode,
String logisticsName,
String logisticsNum,
dynamic logisticsCase,
String postFee,
String finalPayPrice,}){
_id = id;
_orderCode = orderCode;
_storeName = storeName;
_productCount = productCount;
_orderStatus = orderStatus;
_orderSum = orderSum;
_paySum = paySum;
_createTime = createTime;
_returnType = returnType;
_orderType = orderType;
_returnCode = returnCode;
_returnStatus = returnStatus;
_applyTime = applyTime;
_applySum = applySum;
_memberAccount = memberAccount;
_name = name;
_payStatus = payStatus;
_couponSubPrice = couponSubPrice;
_totalDiscountPrice = totalDiscountPrice;
_orderSource = orderSource;
_dayFlowCode = dayFlowCode;
_tableId = tableId;
_tableName = tableName;
_realPeople = realPeople;
_refundStatus = refundStatus;
_notes = notes;
_payNum = payNum;
_reason = reason;
_isSubscribe = isSubscribe;
_subcribeTime = subcribeTime;
_endRefundTime = endRefundTime;
_memberInfo = memberInfo;
_orderProductList = orderProductList;
_mid = mid;
_isTakeOut = isTakeOut;
_logisticsId = logisticsId;
_shipperCode = shipperCode;
_logisticsName = logisticsName;
_logisticsNum = logisticsNum;
_logisticsCase = logisticsCase;
_postFee = postFee;
_finalPayPrice = finalPayPrice;
}
AdminOrderDtoList.fromJson(dynamic json) {
_id = json['id'];
_orderCode = json['orderCode'];
_storeName = json['storeName'];
_productCount = json['productCount'];
_orderStatus = json['orderStatus'];
_orderSum = json['orderSum'];
_paySum = json['paySum'];
_createTime = json['createTime'];
_returnType = json['returnType'];
_orderType = json['orderType'];
_returnCode = json['returnCode'];
_returnStatus = json['returnStatus'];
_applyTime = json['applyTime'];
_applySum = json['applySum'];
_memberAccount = json['memberAccount'];
_name = json['name'];
_payStatus = json['payStatus'];
_couponSubPrice = json['couponSubPrice'];
_totalDiscountPrice = json['totalDiscountPrice'];
_orderSource = json['orderSource'];
_dayFlowCode = json['dayFlowCode'];
_tableId = json['tableId'];
_tableName = json['tableName'];
_realPeople = json['realPeople'];
_refundStatus = json['refundStatus'];
_notes = json['notes'];
_payNum = json['payNum'];
_reason = json['reason'];
_isSubscribe = json['isSubscribe'];
_subcribeTime = json['subcribeTime'];
_endRefundTime = json['endRefundTime'];
_memberInfo = json['memberInfo'];
if (json['orderProductList'] != null) {
_orderProductList = [];
json['orderProductList'].forEach((v) {
_orderProductList.add(OrderProductList.fromJson(v));
});
}
_mid = json['mid'];
_isTakeOut = json['isTakeOut'];
_logisticsId = json['logisticsId'];
_shipperCode = json['shipperCode'];
_logisticsName = json['logisticsName'];
_logisticsNum = json['logisticsNum'];
_logisticsCase = json['logisticsCase'];
_postFee = json['postFee'];
_finalPayPrice = json['finalPayPrice'];
}
String _id;
String _orderCode;
String _storeName;
num _productCount;
num _orderStatus;
String _orderSum;
String _paySum;
String _createTime;
num _returnType;
num _orderType;
dynamic _returnCode;
dynamic _returnStatus;
dynamic _applyTime;
dynamic _applySum;
String _memberAccount;
dynamic _name;
num _payStatus;
String _couponSubPrice;
String _totalDiscountPrice;
num _orderSource;
String _dayFlowCode;
String _tableId;
dynamic _tableName;
dynamic _realPeople;
num _refundStatus;
String _notes;
dynamic _payNum;
dynamic _reason;
bool _isSubscribe;
dynamic _subcribeTime;
dynamic _endRefundTime;
dynamic _memberInfo;
List<OrderProductList> _orderProductList;
String _mid;
num _isTakeOut;
String _logisticsId;
String _shipperCode;
String _logisticsName;
String _logisticsNum;
dynamic _logisticsCase;
String _postFee;
String _finalPayPrice;
AdminOrderDtoList copyWith({ String id,
String orderCode,
String storeName,
num productCount,
num orderStatus,
String orderSum,
String paySum,
String createTime,
num returnType,
num orderType,
dynamic returnCode,
dynamic returnStatus,
dynamic applyTime,
dynamic applySum,
String memberAccount,
dynamic name,
num payStatus,
String couponSubPrice,
String totalDiscountPrice,
num orderSource,
String dayFlowCode,
String tableId,
dynamic tableName,
dynamic realPeople,
num refundStatus,
String notes,
dynamic payNum,
dynamic reason,
bool isSubscribe,
dynamic subcribeTime,
dynamic endRefundTime,
dynamic memberInfo,
List<OrderProductList> orderProductList,
String mid,
num isTakeOut,
String logisticsId,
String shipperCode,
String logisticsName,
String logisticsNum,
dynamic logisticsCase,
String postFee,
String finalPayPrice,
}) => AdminOrderDtoList( id: id ?? _id,
orderCode: orderCode ?? _orderCode,
storeName: storeName ?? _storeName,
productCount: productCount ?? _productCount,
orderStatus: orderStatus ?? _orderStatus,
orderSum: orderSum ?? _orderSum,
paySum: paySum ?? _paySum,
createTime: createTime ?? _createTime,
returnType: returnType ?? _returnType,
orderType: orderType ?? _orderType,
returnCode: returnCode ?? _returnCode,
returnStatus: returnStatus ?? _returnStatus,
applyTime: applyTime ?? _applyTime,
applySum: applySum ?? _applySum,
memberAccount: memberAccount ?? _memberAccount,
name: name ?? _name,
payStatus: payStatus ?? _payStatus,
couponSubPrice: couponSubPrice ?? _couponSubPrice,
totalDiscountPrice: totalDiscountPrice ?? _totalDiscountPrice,
orderSource: orderSource ?? _orderSource,
dayFlowCode: dayFlowCode ?? _dayFlowCode,
tableId: tableId ?? _tableId,
tableName: tableName ?? _tableName,
realPeople: realPeople ?? _realPeople,
refundStatus: refundStatus ?? _refundStatus,
notes: notes ?? _notes,
payNum: payNum ?? _payNum,
reason: reason ?? _reason,
isSubscribe: isSubscribe ?? _isSubscribe,
subcribeTime: subcribeTime ?? _subcribeTime,
endRefundTime: endRefundTime ?? _endRefundTime,
memberInfo: memberInfo ?? _memberInfo,
orderProductList: orderProductList ?? _orderProductList,
mid: mid ?? _mid,
isTakeOut: isTakeOut ?? _isTakeOut,
logisticsId: logisticsId ?? _logisticsId,
shipperCode: shipperCode ?? _shipperCode,
logisticsName: logisticsName ?? _logisticsName,
logisticsNum: logisticsNum ?? _logisticsNum,
logisticsCase: logisticsCase ?? _logisticsCase,
postFee: postFee ?? _postFee,
finalPayPrice: finalPayPrice ?? _finalPayPrice,
);
String get id => _id;
String get orderCode => _orderCode;
String get storeName => _storeName;
num get productCount => _productCount;
num get orderStatus => _orderStatus;
String get orderSum => _orderSum;
String get paySum => _paySum;
String get createTime => _createTime;
num get returnType => _returnType;
num get orderType => _orderType;
dynamic get returnCode => _returnCode;
dynamic get returnStatus => _returnStatus;
dynamic get applyTime => _applyTime;
dynamic get applySum => _applySum;
String get memberAccount => _memberAccount;
dynamic get name => _name;
num get payStatus => _payStatus;
String get couponSubPrice => _couponSubPrice;
String get totalDiscountPrice => _totalDiscountPrice;
num get orderSource => _orderSource;
String get dayFlowCode => _dayFlowCode;
String get tableId => _tableId;
dynamic get tableName => _tableName;
dynamic get realPeople => _realPeople;
num get refundStatus => _refundStatus;
String get notes => _notes;
dynamic get payNum => _payNum;
dynamic get reason => _reason;
bool get isSubscribe => _isSubscribe;
dynamic get subcribeTime => _subcribeTime;
dynamic get endRefundTime => _endRefundTime;
dynamic get memberInfo => _memberInfo;
List<OrderProductList> get orderProductList => _orderProductList;
String get mid => _mid;
num get isTakeOut => _isTakeOut;
String get logisticsId => _logisticsId;
String get shipperCode => _shipperCode;
String get logisticsName => _logisticsName;
String get logisticsNum => _logisticsNum;
dynamic get logisticsCase => _logisticsCase;
String get postFee => _postFee;
String get finalPayPrice => _finalPayPrice;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['orderCode'] = _orderCode;
map['storeName'] = _storeName;
map['productCount'] = _productCount;
map['orderStatus'] = _orderStatus;
map['orderSum'] = _orderSum;
map['paySum'] = _paySum;
map['createTime'] = _createTime;
map['returnType'] = _returnType;
map['orderType'] = _orderType;
map['returnCode'] = _returnCode;
map['returnStatus'] = _returnStatus;
map['applyTime'] = _applyTime;
map['applySum'] = _applySum;
map['memberAccount'] = _memberAccount;
map['name'] = _name;
map['payStatus'] = _payStatus;
map['couponSubPrice'] = _couponSubPrice;
map['totalDiscountPrice'] = _totalDiscountPrice;
map['orderSource'] = _orderSource;
map['dayFlowCode'] = _dayFlowCode;
map['tableId'] = _tableId;
map['tableName'] = _tableName;
map['realPeople'] = _realPeople;
map['refundStatus'] = _refundStatus;
map['notes'] = _notes;
map['payNum'] = _payNum;
map['reason'] = _reason;
map['isSubscribe'] = _isSubscribe;
map['subcribeTime'] = _subcribeTime;
map['endRefundTime'] = _endRefundTime;
map['memberInfo'] = _memberInfo;
if (_orderProductList != null) {
map['orderProductList'] = _orderProductList.map((v) => v.toJson()).toList();
}
map['mid'] = _mid;
map['isTakeOut'] = _isTakeOut;
map['logisticsId'] = _logisticsId;
map['shipperCode'] = _shipperCode;
map['logisticsName'] = _logisticsName;
map['logisticsNum'] = _logisticsNum;
map['logisticsCase'] = _logisticsCase;
map['postFee'] = _postFee;
map['finalPayPrice'] = _finalPayPrice;
return map;
}
}
/// id : "1704311046925189120"
/// createTime : "2023-09-20 09:46:33"
/// createUser : "1640233401329909760"
/// updateTime : "2023-09-20 09:46:33"
/// updateUser : "1640233401329909760"
/// tenantCode : "1195"
/// storeId : "1645316356192600064"
/// orderId : "1704311046749028352"
/// actInfo : null
/// productId : "1685891939443933184"
/// productName : "芒果牛乳"
/// skuId : "1704310860643565568"
/// skuNameStr : "700ml 冰 七分糖"
/// skuImg : ""
/// buyNum : 1
/// refundNum : 0
/// type : 0
/// reason : null
/// weight : 0.0
/// applyPrice : "19.00"
/// sellPrice : "0.01"
/// postPay : "0.00"
/// isDelete : 0
/// discountAmount : "0.00"
/// discountPercent : 100
/// status : true
/// batch : 1
/// deliveries : 0
/// ticketType : ""
/// ticketDays : "0"
/// takeType : null
/// skuTickets : []
/// ticketStyle : ""
/// setMealDataList : null
/// packagingFee : "0.00"
class OrderProductList {
OrderProductList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String tenantCode,
String storeId,
String orderId,
dynamic actInfo,
String productId,
String productName,
String skuId,
String skuNameStr,
String skuImg,
num buyNum,
num refundNum,
num type,
dynamic reason,
num weight,
String applyPrice,
String sellPrice,
String postPay,
num isDelete,
String discountAmount,
num discountPercent,
bool status,
num batch,
num deliveries,
String ticketType,
String ticketDays,
dynamic takeType,
List<dynamic> skuTickets,
String ticketStyle,
dynamic setMealDataList,
String packagingFee,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_tenantCode = tenantCode;
_storeId = storeId;
_orderId = orderId;
_actInfo = actInfo;
_productId = productId;
_productName = productName;
_skuId = skuId;
_skuNameStr = skuNameStr;
_skuImg = skuImg;
_buyNum = buyNum;
_refundNum = refundNum;
_type = type;
_reason = reason;
_weight = weight;
_applyPrice = applyPrice;
_sellPrice = sellPrice;
_postPay = postPay;
_isDelete = isDelete;
_discountAmount = discountAmount;
_discountPercent = discountPercent;
_status = status;
_batch = batch;
_deliveries = deliveries;
_ticketType = ticketType;
_ticketDays = ticketDays;
_takeType = takeType;
_skuTickets = skuTickets;
_ticketStyle = ticketStyle;
_setMealDataList = setMealDataList;
_packagingFee = packagingFee;
}
OrderProductList.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'];
_actInfo = json['actInfo'];
_productId = json['productId'];
_productName = json['productName'];
_skuId = json['skuId'];
_skuNameStr = json['skuNameStr'];
_skuImg = json['skuImg'];
_buyNum = json['buyNum'];
_refundNum = json['refundNum'];
_type = json['type'];
_reason = json['reason'];
_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'];
_deliveries = json['deliveries'];
_ticketType = json['ticketType'];
_ticketDays = json['ticketDays'];
_takeType = json['takeType'];
// if (json['skuTickets'] != null) {
// _skuTickets = [];
// json['skuTickets'].forEach((v) {
// _skuTickets.add(Dynamic.fromJson(v));
// });
// }
_ticketStyle = json['ticketStyle'];
_setMealDataList = json['setMealDataList'];
_packagingFee = json['packagingFee'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _tenantCode;
String _storeId;
String _orderId;
dynamic _actInfo;
String _productId;
String _productName;
String _skuId;
String _skuNameStr;
String _skuImg;
num _buyNum;
num _refundNum;
num _type;
dynamic _reason;
num _weight;
String _applyPrice;
String _sellPrice;
String _postPay;
num _isDelete;
String _discountAmount;
num _discountPercent;
bool _status;
num _batch;
num _deliveries;
String _ticketType;
String _ticketDays;
dynamic _takeType;
List<dynamic> _skuTickets;
String _ticketStyle;
dynamic _setMealDataList;
String _packagingFee;
OrderProductList copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String tenantCode,
String storeId,
String orderId,
dynamic actInfo,
String productId,
String productName,
String skuId,
String skuNameStr,
String skuImg,
num buyNum,
num refundNum,
num type,
dynamic reason,
num weight,
String applyPrice,
String sellPrice,
String postPay,
num isDelete,
String discountAmount,
num discountPercent,
bool status,
num batch,
num deliveries,
String ticketType,
String ticketDays,
dynamic takeType,
List<dynamic> skuTickets,
String ticketStyle,
dynamic setMealDataList,
String packagingFee,
}) => OrderProductList( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
tenantCode: tenantCode ?? _tenantCode,
storeId: storeId ?? _storeId,
orderId: orderId ?? _orderId,
actInfo: actInfo ?? _actInfo,
productId: productId ?? _productId,
productName: productName ?? _productName,
skuId: skuId ?? _skuId,
skuNameStr: skuNameStr ?? _skuNameStr,
skuImg: skuImg ?? _skuImg,
buyNum: buyNum ?? _buyNum,
refundNum: refundNum ?? _refundNum,
type: type ?? _type,
reason: reason ?? _reason,
weight: weight ?? _weight,
applyPrice: applyPrice ?? _applyPrice,
sellPrice: sellPrice ?? _sellPrice,
postPay: postPay ?? _postPay,
isDelete: isDelete ?? _isDelete,
discountAmount: discountAmount ?? _discountAmount,
discountPercent: discountPercent ?? _discountPercent,
status: status ?? _status,
batch: batch ?? _batch,
deliveries: deliveries ?? _deliveries,
ticketType: ticketType ?? _ticketType,
ticketDays: ticketDays ?? _ticketDays,
takeType: takeType ?? _takeType,
skuTickets: skuTickets ?? _skuTickets,
ticketStyle: ticketStyle ?? _ticketStyle,
setMealDataList: setMealDataList ?? _setMealDataList,
packagingFee: packagingFee ?? _packagingFee,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get tenantCode => _tenantCode;
String get storeId => _storeId;
String get orderId => _orderId;
dynamic get actInfo => _actInfo;
String get productId => _productId;
String get productName => _productName;
String get skuId => _skuId;
String get skuNameStr => _skuNameStr;
String get skuImg => _skuImg;
num get buyNum => _buyNum;
num get refundNum => _refundNum;
num get type => _type;
dynamic get reason => _reason;
num get weight => _weight;
String get applyPrice => _applyPrice;
String get sellPrice => _sellPrice;
String get postPay => _postPay;
num get isDelete => _isDelete;
String get discountAmount => _discountAmount;
num get discountPercent => _discountPercent;
bool get status => _status;
num get batch => _batch;
num get deliveries => _deliveries;
String get ticketType => _ticketType;
String get ticketDays => _ticketDays;
dynamic get takeType => _takeType;
List<dynamic> get skuTickets => _skuTickets;
String get ticketStyle => _ticketStyle;
dynamic get setMealDataList => _setMealDataList;
String get packagingFee => _packagingFee;
Map<String, dynamic> toJson() {
final 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['actInfo'] = _actInfo;
map['productId'] = _productId;
map['productName'] = _productName;
map['skuId'] = _skuId;
map['skuNameStr'] = _skuNameStr;
map['skuImg'] = _skuImg;
map['buyNum'] = _buyNum;
map['refundNum'] = _refundNum;
map['type'] = _type;
map['reason'] = _reason;
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;
map['deliveries'] = _deliveries;
map['ticketType'] = _ticketType;
map['ticketDays'] = _ticketDays;
map['takeType'] = _takeType;
if (_skuTickets != null) {
map['skuTickets'] = _skuTickets.map((v) => v.toJson()).toList();
}
map['ticketStyle'] = _ticketStyle;
map['setMealDataList'] = _setMealDataList;
map['packagingFee'] = _packagingFee;
return map;
}
}

356
lib/retrofit/data/product_group_list.dart

File diff suppressed because one or more lines are too long

232
lib/retrofit/data/refund_reason_list.dart

@ -0,0 +1,232 @@
/// records : [{"id":"1701507861319778304","createTime":"2023-09-12 16:07:41","createUser":"1640233401329909760","updateTime":"2023-09-12 16:07:41","updateUser":"1640233401329909760","storeId":"0","type":3,"reason":"测试退款","isDelete":0},{"id":"1689577561031442432","createTime":"2023-08-10 18:00:56","createUser":"1640233401329909760","updateTime":"2023-08-10 18:01:09","updateUser":"1640233401329909760","storeId":"1645316356192600064","type":3,"reason":"错误下单","isDelete":0},{"id":"1685119824058908672","createTime":"2023-07-29 10:47:29","createUser":"1640233401329909760","updateTime":"2023-07-29 10:47:29","updateUser":"1640233401329909760","storeId":"0","type":3,"reason":"客户取消","isDelete":0}]
/// total : "3"
/// size : "999"
/// current : "1"
/// orders : [{"column":"id","asc":false}]
/// hitCount : false
/// searchCount : true
/// pages : "1"
class RefundReasonList {
RefundReasonList({
List<Records> records,
String total,
String size,
String current,
List<Orders> orders,
bool hitCount,
bool searchCount,
String pages,}){
_records = records;
_total = total;
_size = size;
_current = current;
_orders = orders;
_hitCount = hitCount;
_searchCount = searchCount;
_pages = pages;
}
RefundReasonList.fromJson(dynamic json) {
if (json['records'] != null) {
_records = [];
json['records'].forEach((v) {
_records.add(Records.fromJson(v));
});
}
_total = json['total'];
_size = json['size'];
_current = json['current'];
if (json['orders'] != null) {
_orders = [];
json['orders'].forEach((v) {
_orders.add(Orders.fromJson(v));
});
}
_hitCount = json['hitCount'];
_searchCount = json['searchCount'];
_pages = json['pages'];
}
List<Records> _records;
String _total;
String _size;
String _current;
List<Orders> _orders;
bool _hitCount;
bool _searchCount;
String _pages;
RefundReasonList copyWith({ List<Records> records,
String total,
String size,
String current,
List<Orders> orders,
bool hitCount,
bool searchCount,
String pages,
}) => RefundReasonList( records: records ?? _records,
total: total ?? _total,
size: size ?? _size,
current: current ?? _current,
orders: orders ?? _orders,
hitCount: hitCount ?? _hitCount,
searchCount: searchCount ?? _searchCount,
pages: pages ?? _pages,
);
List<Records> get records => _records;
String get total => _total;
String get size => _size;
String get current => _current;
List<Orders> get orders => _orders;
bool get hitCount => _hitCount;
bool get searchCount => _searchCount;
String get pages => _pages;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_records != null) {
map['records'] = _records.map((v) => v.toJson()).toList();
}
map['total'] = _total;
map['size'] = _size;
map['current'] = _current;
if (_orders != null) {
map['orders'] = _orders.map((v) => v.toJson()).toList();
}
map['hitCount'] = _hitCount;
map['searchCount'] = _searchCount;
map['pages'] = _pages;
return map;
}
}
/// column : "id"
/// asc : false
class Orders {
Orders({
String column,
bool asc,}){
_column = column;
_asc = asc;
}
Orders.fromJson(dynamic json) {
_column = json['column'];
_asc = json['asc'];
}
String _column;
bool _asc;
Orders copyWith({ String column,
bool asc,
}) => Orders( column: column ?? _column,
asc: asc ?? _asc,
);
String get column => _column;
bool get asc => _asc;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['column'] = _column;
map['asc'] = _asc;
return map;
}
}
/// id : "1701507861319778304"
/// createTime : "2023-09-12 16:07:41"
/// createUser : "1640233401329909760"
/// updateTime : "2023-09-12 16:07:41"
/// updateUser : "1640233401329909760"
/// storeId : "0"
/// type : 3
/// reason : "测试退款"
/// isDelete : 0
class Records {
Records({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
num type,
String reason,
num isDelete,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_type = type;
_reason = reason;
_isDelete = isDelete;
}
Records.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_type = json['type'];
_reason = json['reason'];
_isDelete = json['isDelete'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
num _type;
String _reason;
num _isDelete;
Records copyWith({ String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
num type,
String reason,
num isDelete,
}) => Records( id: id ?? _id,
createTime: createTime ?? _createTime,
createUser: createUser ?? _createUser,
updateTime: updateTime ?? _updateTime,
updateUser: updateUser ?? _updateUser,
storeId: storeId ?? _storeId,
type: type ?? _type,
reason: reason ?? _reason,
isDelete: isDelete ?? _isDelete,
);
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
num get type => _type;
String get reason => _reason;
num get isDelete => _isDelete;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['type'] = _type;
map['reason'] = _reason;
map['isDelete'] = _isDelete;
return map;
}
}

3
lib/union/union_list.dart

@ -2,14 +2,11 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

6
lib/view_widget/settlement_tips_dialog.dart

@ -7,7 +7,8 @@ import 'package:huixiang/utils/font_weight.dart';
class SettlementTips extends StatefulWidget {
final Function tips;
final String text;
SettlementTips(this.tips, {this.text});
final Color color;
SettlementTips(this.tips, {this.text,this.color});
@override
State<StatefulWidget> createState() {
@ -16,6 +17,7 @@ class SettlementTips extends StatefulWidget {
}
class _SettlementTips extends State<SettlementTips> {
@override
Widget build(BuildContext context) {
return Material(
@ -64,7 +66,7 @@ class _SettlementTips extends State<SettlementTips> {
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
color: widget?.color ?? Color(0xFF32A060),
),
),
),

Loading…
Cancel
Save