Browse Source

会员余额变动页面时间选择优化,页面边距优化调整,键盘收起优化更改;

新增:店铺信息开启关闭时间,预约信息保存,确认扣款接口;
商品列表实体类更改;
自定义选择器适配更改;
新增预约/预售页面;
在售页面商品列表ui更改;
订单列表新增确认扣款按钮,新增确认扣款提示弹窗;
订单页面日期选择器优化更改;
票券列表,票券记录金额ui更改;
票券板块日期选择器更改;
生意总览:商品,总览,订单页面自定义时间选择器更改;
app-我的-个人信息页面,更改用户信息时,接口请求失败新增失败提示;
新增店铺信息开启关闭时间实体类;
wr_2023_business
wurong 1 year ago
parent
commit
e840d1443e
  1. BIN
      assets/image/2x/bus_close_circle.webp
  2. BIN
      assets/image/2x/bus_time_select.webp
  3. BIN
      assets/image/2x/bus_time_unSelect.webp
  4. BIN
      assets/image/2x/reservation_switch.webp
  5. BIN
      assets/image/2x/reservation_unswitch.webp
  6. BIN
      assets/image/3x/bus_close_circle.webp
  7. BIN
      assets/image/3x/bus_time_select.webp
  8. BIN
      assets/image/3x/bus_time_unSelect.webp
  9. BIN
      assets/image/3x/reservation_switch.webp
  10. BIN
      assets/image/3x/reservation_unswitch.webp
  11. BIN
      assets/image/bus_close_circle.webp
  12. BIN
      assets/image/bus_time_select.webp
  13. BIN
      assets/image/bus_time_unSelect.webp
  14. BIN
      assets/image/reservation_switch.webp
  15. BIN
      assets/image/reservation_unswitch.webp
  16. 14
      lib/business_system/date_select/custom_page.dart
  17. 99
      lib/business_system/goods/on_sale/on_sale_page.dart
  18. 813
      lib/business_system/goods/reservation_ page.dart
  19. 3
      lib/business_system/home/overview/trade_goods.dart
  20. 2
      lib/business_system/home/overview/trade_order.dart
  21. 2
      lib/business_system/home/overview/trade_summary.dart
  22. 37
      lib/business_system/home/vip/balance_change_record.dart
  23. 173
      lib/business_system/order/order_list.dart
  24. 2
      lib/business_system/order/order_list_page.dart
  25. 2
      lib/business_system/order/ticket/ticket_list.dart
  26. 2
      lib/business_system/order/ticket/ticket_page.dart
  27. 2
      lib/business_system/order/ticket/ticket_records_page.dart
  28. 5
      lib/main.dart
  29. 1
      lib/mine/mine_view/mine_item.dart
  30. 16
      lib/mine/user_info_page.dart
  31. 13
      lib/retrofit/business_api.dart
  32. 64
      lib/retrofit/business_api.g.dart
  33. 290
      lib/retrofit/data/business_goods.dart
  34. 42
      lib/retrofit/data/store_time_info_list.dart

BIN
assets/image/2x/bus_close_circle.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

BIN
assets/image/2x/bus_time_select.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/2x/bus_time_unSelect.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/2x/reservation_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/2x/reservation_unswitch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

BIN
assets/image/3x/bus_close_circle.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/bus_time_select.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/3x/bus_time_unSelect.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/3x/reservation_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/3x/reservation_unswitch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/bus_close_circle.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

BIN
assets/image/bus_time_select.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

BIN
assets/image/bus_time_unSelect.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

BIN
assets/image/reservation_switch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

BIN
assets/image/reservation_unswitch.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

14
lib/business_system/date_select/custom_page.dart

@ -6,6 +6,9 @@ import 'package:syncfusion_flutter_datepicker/datepicker.dart';
import '../../view_widget/my_appbar.dart';
class CustomPage extends StatefulWidget {
final Map<String, dynamic> arguments;
CustomPage({this.arguments});
@override
State<StatefulWidget> createState() {
@ -60,7 +63,16 @@ class _CustomPage extends State<CustomPage>{
top: 0,
right: 0,
bottom: 0,
child: SfDateRangePicker(
child: (widget.arguments["beyondDateRange"]) == "1"?SfDateRangePicker(
onSelectionChanged: _onSelectionChanged,
selectionMode: DateRangePickerSelectionMode.range,
initialSelectedRange: PickerDateRange(
DateTime.now().subtract(const Duration(days: 4)),
DateTime.now().add(const Duration(days: 3)),),
startRangeSelectionColor: Color(0xFF30415B),
endRangeSelectionColor: Color(0xFF30415B),
todayHighlightColor: Color(0xFF30415B),
):SfDateRangePicker(
onSelectionChanged: _onSelectionChanged,
maxDate: DateTime.now(),
selectionMode: DateRangePickerSelectionMode.range,

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

@ -98,8 +98,7 @@ class _OnSalePage extends State<OnSalePage> {
"order": "ascending",
"size": 100,
"sort": "sort"
}).catchError((error) {
});
}).catchError((error) {});
if (!mounted) return;
if (baseData != null && baseData.isSuccess) {
productGroupList = baseData.data;
@ -201,8 +200,9 @@ class _OnSalePage extends State<OnSalePage> {
width: double.infinity,
),
Expanded(
child: networkStatus == -1 ? noNetwork()
:Container(
child: networkStatus == -1
? noNetwork()
: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -222,7 +222,9 @@ class _OnSalePage extends State<OnSalePage> {
},
)
: ListView.builder(
itemCount: productGroupList?.records?.length ?? 0,
itemCount:
productGroupList?.records?.length ??
0,
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
@ -232,11 +234,12 @@ class _OnSalePage extends State<OnSalePage> {
groupIndex = position;
_pageIndex = 1;
adminProductVoList.clear();
queryGoodsList(
productGroupList?.records[position].id);
queryGoodsList(productGroupList
?.records[position].id);
},
child: leftItem(
productGroupList.records[position],
productGroupList
.records[position],
position),
);
},
@ -247,8 +250,9 @@ class _OnSalePage extends State<OnSalePage> {
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp:
adminProductVoList.length != 0 ? true : false,
enablePullUp: adminProductVoList.length != 0
? true
: false,
header: MyHeader(
color: Color(0xFF30415B),
),
@ -262,7 +266,8 @@ class _OnSalePage extends State<OnSalePage> {
_pageIndex++;
queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex].id);
: productGroupList
?.records[groupIndex].id);
},
onRefresh: () {
_pageIndex = 1;
@ -281,7 +286,8 @@ class _OnSalePage extends State<OnSalePage> {
},
)
: ((adminProductVoList == null ||
adminProductVoList.length == 0)
adminProductVoList.length ==
0)
? NoDataView(
src:
"assets/image/bs_no data_logo.webp",
@ -291,14 +297,18 @@ class _OnSalePage extends State<OnSalePage> {
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
itemCount:
adminProductVoList?.length ?? 0,
itemCount: adminProductVoList
?.length ??
0,
controller: controller,
physics: BouncingScrollPhysics(),
physics:
BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, position) {
itemBuilder:
(context, position) {
return rightGoodsItem(
adminProductVoList[position]);
adminProductVoList[
position]);
},
)))),
),
@ -512,10 +522,20 @@ class _OnSalePage extends State<OnSalePage> {
);
}
///
suclear() {
_pageIndex = 1;
adminProductVoList.clear();
queryGoodsList(groupIndex == -1
? ""
: productGroupList?.records[groupIndex]?.id ?? "");
}
Widget rightGoodsItem(AdminProductVoList adminProductVoList) {
return Container(
margin: EdgeInsets.only(bottom: 21.h, left: 16.w, right: 16.w, top: 10.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
MImage(
adminProductVoList?.productImg ?? "",
@ -528,6 +548,7 @@ class _OnSalePage extends State<OnSalePage> {
width: 12.w,
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -595,6 +616,48 @@ class _OnSalePage extends State<OnSalePage> {
],
),
)),
],
)
],
)),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed('/router/reservation_page', arguments: {
"storeId": widget.storeId,
"shopId": adminProductVoList.productSkuVOList[0].storeId,
"productId": adminProductVoList.id,
"subscribeParam": adminProductVoList.subscribeParam
}).then((value) {
if (value == 1)
suclear();
});
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(33),
border: Border.all(
color: Color(0x29000000),
width: 1,
),
),
margin: EdgeInsets.only(bottom: 12.h),
padding:
EdgeInsets.symmetric(vertical: 2.h, horizontal: 12.w),
child: Text(
"预售",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0x99000000),
),
),
),
),
GestureDetector(
onTap: () {
showOffShelfDialog(adminProductVoList.id ?? "");
@ -623,8 +686,6 @@ class _OnSalePage extends State<OnSalePage> {
],
)
],
)),
],
),
);
}

813
lib/business_system/goods/reservation_ page.dart

@ -0,0 +1,813 @@
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:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../retrofit/business_api.dart';
import '../../../utils/font_weight.dart';
import '../../generated/l10n.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_goods.dart';
import '../../retrofit/data/store_time_info_list.dart';
import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../view_widget/my_appbar.dart';
class ReservationPage extends StatefulWidget {
final Map<String, dynamic> arguments;
ReservationPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _ReservationPage();
}
}
class _ReservationPage extends State<ReservationPage> {
final RefreshController _refreshController = RefreshController();
BusinessApiService businessService;
String networkError = "";
int networkStatus = 0;
final TextEditingController editingController = TextEditingController();
final TextEditingController daysAfterController = TextEditingController();
final TextEditingController daysWithinController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
bool _subscribeSwitch = false;
bool _paySubscribeSwitch = false;
StoreTimeInfoList storeTimeInfoList;
List<String> timeSlots = [];
SubscribeParam subscribeParam;
String selectTimeDate = "";
///
@override
void dispose() {
super.dispose();
_refreshController.dispose();
_focusNode.unfocus();
}
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
print("object: ${MediaQuery.of(context).viewInsets.bottom}");
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) {
isKeyBoardShow = false;
//
FocusScope.of(context).requestFocus(FocusNode());
}
} else {
isKeyBoardShow = true;
}
});
});
subscribeParam = widget.arguments["subscribeParam"];
queryReservationDetails(widget.arguments["shopId"]);
}
///
queryReservationDetails(shopId) async {
try {
if (subscribeParam != null)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData<StoreTimeInfoList> baseData =
await businessService.storeOpenTime(shopId).catchError((error) {
networkStatus = -1;
networkError = AppUtils.dioErrorTypeToString(error.type);
});
if (baseData != null && baseData.isSuccess) {
storeTimeInfoList = baseData.data;
if (subscribeParam != null) {
timeSlots = subscribeParam.subscribeTimes;
_subscribeSwitch = subscribeParam.isEnableSubscribe;
_paySubscribeSwitch = subscribeParam.isEnableSubscribePay;
universalTypeSelect = subscribeParam.dayOrDate;
setState(() {});
}
networkStatus = 1;
}
} finally {
EasyLoading.dismiss();
}
}
///list
List<String> getTimeSlots(String st, String et, int n) {
List<String> tempTimes = [];
try {
DateTime start = DateTime.parse(st);
DateTime end = DateTime.parse(et);
Duration interval = Duration(minutes: n);
while (start.isBefore(end)) {
DateTime current = start.add(interval);
if (current.isBefore(end)) {
String startTime = start.toString().substring(11, 16);
String endTime = current.toString().substring(11, 16);
tempTimes.add('$startTime-$endTime');
} else {
String startTime = start.toString().substring(11, 16);
String endTime = end.toString().substring(11, 16);
tempTimes.add('$startTime-$endTime');
}
start = current;
}
} catch (ex) {
EasyLoading.dismiss();
}
return tempTimes;
}
///
updateSubscribeInfo() async {
try {
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData baseData = await businessService.updateSubscribe({
"productId": widget.arguments["productId"],
"subscribe": {
"isEnableSubscribe": _subscribeSwitch,
"isEnableSubscribePay": _paySubscribeSwitch,
"timePeriod": editingController.text != ""
? editingController.text
: subscribeParam?.timePeriod ?? "",
"subscribeTimes": timeSlots,
"dayOrDate": (storeTimeInfoList?.posType ?? "") == "FAST_SERVICE"
? 0
: universalTypeSelect,
"startAfterDays": daysAfterController?.text ?? "",
"daysValidate": daysWithinController?.text ?? "",
"subscribeStartTime": selectTimeDate == ""
? ""
: selectTimeDate
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 19),
"subscribeEndTime": selectTimeDate == ""
? ""
: selectTimeDate
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(23, 41),
"stores": []
}
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
Navigator.of(context).pop(1);
SmartDialog.showToast("预约信息编辑成功", alignment: Alignment.center);
setState(() {});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} finally {
EasyLoading.dismiss();
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: MyAppBar(
title: "预约",
titleColor: Colors.black,
leadingColor: Colors.black,
background: Colors.white,
),
body: networkStatus == -1
? noNetwork()
: Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (networkStatus == 1)
Row(
children: [
Text(
"预约开关",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
),
SizedBox(
width: 24.w,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
_subscribeSwitch = !_subscribeSwitch;
});
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: _subscribeSwitch
? Image.asset(
"assets/image/reservation_switch.webp",
width: 44.w,
height: 24.h,
fit: BoxFit.fill,
)
: Image.asset(
"assets/image/reservation_unswitch.webp",
width: 44.w,
height: 24.h,
fit: BoxFit.fill,
),
),
),
],
),
if (networkStatus == 1)
Expanded(
child:
(storeTimeInfoList?.posType ?? "") == "FAST_SERVICE"
? timeIntervalType()
: universalType()),
if (networkStatus == 1)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
updateSubscribeInfo();
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 55.h, top: 15.h),
padding: EdgeInsets.symmetric(vertical: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27),
color: Color(0xFF30415B)),
child: Text(
S.of(context).baocun,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 16.sp,
color: Colors.white,
),
),
),
)
],
),
),
);
}
///
Widget timeIntervalType() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.infinity,
height: 1.h,
color: Color(0x14000000),
margin: EdgeInsets.symmetric(vertical: 24.h),
),
Row(
children: [
Text(
"付费预约开关",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
),
SizedBox(
width: 24.w,
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
_paySubscribeSwitch = !_paySubscribeSwitch;
});
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: _paySubscribeSwitch
? Image.asset(
"assets/image/reservation_switch.webp",
width: 44.w,
height: 24.h,
fit: BoxFit.fill,
)
: Image.asset(
"assets/image/reservation_unswitch.webp",
width: 44.w,
height: 24.h,
fit: BoxFit.fill,
),
),
),
],
),
Container(
width: double.infinity,
height: 1.h,
color: Color(0x14000000),
margin: EdgeInsets.only(top: 24.h, bottom: 10.h),
),
Row(
children: [
Expanded(
child: Text(
"预约间隔时(分钟)",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
child: TextField(
controller: editingController,
keyboardType: TextInputType.phone,
onChanged: (value) {
timeSlots = getTimeSlots(
"2023-11-14 ${storeTimeInfoList?.openStartTime ?? ""}",
"2023-11-14 ${storeTimeInfoList?.openEndTime ?? ""}",
int.tryParse(editingController.text) ?? 30);
},
decoration: InputDecoration(
hintText: subscribeParam != null
? (subscribeParam?.timePeriod ?? 0).toString()
: "分钟",
hintTextDirection: TextDirection.rtl,
hintStyle: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
textAlign: TextAlign.right,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold),
),
),
],
),
Padding(
padding: EdgeInsets.only(bottom: 16.h, top: 38.h),
child: Text(
"选择预约时间段",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
)),
Expanded(
child: GridView.builder(
itemCount: timeSlots.length,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量
crossAxisCount: 3,
//Widget之间间距
crossAxisSpacing: 14,
//Widget之间间距
mainAxisSpacing: 20,
//Widget宽高比例
childAspectRatio: 3,
),
itemBuilder: (context, index) {
return reservationTimeList(index);
},
)),
],
);
}
///
Widget universalType() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 34.h, bottom: 16.h),
child: Text(
"增加有效期",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
)),
Row(
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
universalTypeSelect = 1;
});
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(1),
Text(
"任意时间",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)
],
))),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
universalTypeSelect = 3;
});
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(3),
Text(
"日期范围",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)
],
))),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
universalTypeSelect = 2;
});
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(2),
Text(
"可预定的期限",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular),
)
],
))),
],
),
if ((universalTypeSelect != 0 && universalTypeSelect != 1))
Expanded(
child:
universalTypeSelect == 2 ? expectedDeadline() : dateRange()),
],
);
}
///UI
Widget expectedDeadline() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 34.h, bottom: 16.h),
child: Text(
"预约多少天以后",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
)),
Container(
width: 164.w,
margin: EdgeInsets.only(bottom: 8.h),
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(
color: Color(0xFFF8F9FA),
borderRadius: BorderRadius.circular(4),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: TextField(
controller: daysAfterController,
keyboardType: TextInputType.phone,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
},
decoration: InputDecoration(
border: InputBorder.none,
isCollapsed: true,
hintText: subscribeParam != null
? (subscribeParam?.startAfterDays ?? "").toString()
: "",
hintStyle: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
contentPadding: EdgeInsets.only(left: 16.w),
),
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
),
),
Padding(
padding: EdgeInsets.only(right: 13.w),
child: Text(
"",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF7B8CA7),
fontWeight: MyFontWeight.medium),
),
)
],
),
),
Text(
"*设定预定后整数天后才有效",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFFA5151),
fontWeight: MyFontWeight.regular),
),
Padding(
padding: EdgeInsets.only(top: 25.h, bottom: 16.h),
child: Text(
"预约多少天以内",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
)),
Container(
width: 164.w,
margin: EdgeInsets.only(bottom: 8.h),
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(
color: Color(0xFFF8F9FA),
borderRadius: BorderRadius.circular(4),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: TextField(
controller: daysWithinController,
keyboardType: TextInputType.phone,
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
},
decoration: InputDecoration(
isCollapsed: true,
border: InputBorder.none,
hintText: subscribeParam != null
? (subscribeParam?.daysValidate ?? "").toString()
: "",
hintStyle: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
contentPadding: EdgeInsets.only(left: 16.w),
),
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular),
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 13.w),
child: Text(
"",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF7B8CA7),
fontWeight: MyFontWeight.medium),
),
)
],
),
),
Text(
"*设定预定后整数天内有效",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFFA5151),
fontWeight: MyFontWeight.regular),
)
],
);
}
///UI
Widget dateRange() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 34.h, bottom: 16.h),
child: Text(
"日期范围",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
)),
timeSelect(),
],
);
}
///
Widget timeSelect() {
return Container(
color: Colors.white,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/custom_page',
arguments: {"beyondDateRange": "1"}).then((value) {
setState(() {
selectTimeDate = value;
});
});
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFFF7F8FA),
borderRadius: BorderRadius.circular(2),
),
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 12.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
(selectTimeDate == "" || selectTimeDate == null)
? (((subscribeParam?.subscribeEndTime ?? "") != "" &&
(subscribeParam?.subscribeStartTime ?? "") != "")
? "${subscribeParam?.subscribeStartTime ?? ""}${subscribeParam?.subscribeEndTime ?? ""}"
: "选择开始时间 至 结束时间")
: "${selectTimeDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", "").substring(0, 19)} "
"${selectTimeDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", "").substring(20, 41)}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
],
),
),
),
);
}
var universalTypeSelect = 0;
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(
right: 6.w,
),
alignment: Alignment.center,
child: Image.asset(
universalTypeSelect != index
? "assets/image/bus_time_unSelect.webp"
: "assets/image/bus_time_select.webp",
width: 20.w,
height: 20.h,
),
);
}
Widget reservationTimeList(int index) {
return Container(
decoration: new BoxDecoration(
color: Color(0xFFEFF5FF),
borderRadius: BorderRadius.circular(2),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
timeSlots[index],
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF30415B),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
timeSlots.removeAt(index);
setState(() {});
},
child: Container(
padding: EdgeInsets.all(4),
child: Image.asset(
"assets/image/bus_close_circle.webp",
width: 16.h,
height: 16.h,
fit: BoxFit.fill,
),
),
),
],
),
);
}
Widget noNetwork() {
return Container(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
networkError.substring(0, networkError.indexOf(",")),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.bold),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 10.h),
child: Text(
"请检查网络设置或稍后重试",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7A797F),
fontWeight: MyFontWeight.regular),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
queryReservationDetails(widget.arguments["shopId"]);
},
child: Container(
decoration: BoxDecoration(
color: Color(0xFF30415B),
borderRadius: BorderRadius.circular(15),
),
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 3.h),
child: Text(
"重试",
style: TextStyle(
fontSize: 14.sp,
color: Colors.white,
fontWeight: MyFontWeight.regular),
)),
)
],
),
);
}
}

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

@ -2,7 +2,6 @@ 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';
@ -576,7 +575,7 @@ class _TradeGoods extends State<TradeGoods> {
});
} else if (dateIndex == 3) {
Navigator.of(context)
.pushNamed('/router/custom_page')
.pushNamed('/router/custom_page',arguments: {"beyondDateRange": "0"})
.then((value) {
customDate = value;
querySingleSales(

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

@ -505,7 +505,7 @@ class _TradeOrder extends State<TradeOrder> {
});
} else if (dateIndex == 3) {
Navigator.of(context)
.pushNamed('/router/custom_page')
.pushNamed('/router/custom_page',arguments: {"beyondDateRange": "0"})
.then((value) {
customDate = value;
queryBusinessAnalysis(

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

@ -512,7 +512,7 @@ class _TradeSummary extends State<TradeSummary> {
});
} else if (dateIndex == 3) {
Navigator.of(context)
.pushNamed('/router/custom_page')
.pushNamed('/router/custom_page',arguments: {"beyondDateRange": "0"})
.then((value) {
customDate = value;
queryBusinessAnalysis(

37
lib/business_system/home/vip/balance_change_record.dart

@ -150,7 +150,11 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
@override
Widget build(BuildContext context) {
return Stack(
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
FocusScope.of(context).requestFocus(FocusNode());},
child: Stack(
children: [
Column(
children: [
@ -328,6 +332,7 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
],
))
],
),
);
}
@ -391,7 +396,7 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
child: GestureDetector(
onTap: () {
_isShow = false;
Navigator.of(context).pushNamed('/router/custom_page').then((value) {
Navigator.of(context).pushNamed('/router/custom_page',arguments: {"beyondDateRange": "0"}).then((value) {
selectTimeDate = value;
records.clear();
_onRefresh();
@ -438,8 +443,8 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
children: [
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
bottom: 12.h,
left: 12.w,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
@ -470,8 +475,8 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
@ -500,8 +505,8 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
@ -530,8 +535,8 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
@ -558,8 +563,8 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
@ -586,8 +591,8 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [
@ -614,8 +619,8 @@ class _BalanceChangeRecord extends State<BalanceChangeRecord> {
),
Padding(
padding: EdgeInsets.only(
bottom: 12,
left: 12.h,
bottom: 12.h,
left: 12.w,
),
child: Row(
children: [

173
lib/business_system/order/order_list.dart

@ -16,7 +16,10 @@ 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/border_text.dart';
import '../../view_widget/no_data_view.dart';
import '../../view_widget/round_button.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class OrderList extends StatefulWidget {
final int status;
@ -134,6 +137,42 @@ class _OrderList extends State<OrderList> {
}
}
///
orderBalancePay(String orderCode,String orderId,String payMoney) async {
try {
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
}
BaseData baseData = await businessService.balancePay({
"orderId": orderId,
"payMoney": payMoney,
"payChannel": 1
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
await queryOrderList(queryId: orderCode);
SmartDialog.showToast("扣款成功", alignment: Alignment.center);
setState(() {});
} else {
SmartDialog.show(
widget: SettlementTips(
() {
},
text: baseData.msg,
color: Color(0xFF30415B),
));
}
} finally {
EasyLoading.dismiss();
}
}
@override
Widget build(BuildContext context) {
return SmartRefresher(
@ -158,7 +197,7 @@ class _OrderList extends State<OrderList> {
},
child: networkStatus == -1
? noNetwork()
: ((networkStatus==0)
: ((networkStatus == 0)
? ListView.builder(
padding: EdgeInsets.zero,
itemCount: 10,
@ -326,7 +365,7 @@ class _OrderList extends State<OrderList> {
),
),
Text(
adminOrderDtoList?.paySum ?? "",
"¥ ${adminOrderDtoList?.paySum ?? ""}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF181818),
@ -361,10 +400,15 @@ class _OrderList extends State<OrderList> {
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 26.w),
margin: EdgeInsets.only(
right: (adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.enableRefundApprover == false)
right: ((adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0 &&
adminOrderDtoList
.enableRefundApprover ==
false) ||
adminOrderDtoList.payStatus == 0)
? 20.w
: 0,top: 20.h),
: 0,
top: 20.h),
child: Text(
"核销",
style: TextStyle(
@ -374,8 +418,37 @@ class _OrderList extends State<OrderList> {
),
),
),
if (adminOrderDtoList.payStatus == 0 &&
adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.orderType == 6)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showPayDialog(adminOrderDtoList.orderCode,adminOrderDtoList.id,adminOrderDtoList.orderSum);
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: Color(0xFF30415B),
width: 1,
),
),
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 14.w),
margin: EdgeInsets.only(top: 20.h),
child: Text(
"确认扣款",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF30415B),
fontWeight: MyFontWeight.regular),
),
),
),
if (adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.enableRefundApprover == false)
adminOrderDtoList.refundStatus == 0 &&
adminOrderDtoList.enableRefundApprover == false)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
@ -403,7 +476,7 @@ class _OrderList extends State<OrderList> {
),
padding: EdgeInsets.symmetric(
vertical: 5.h, horizontal: 14.w),
margin: EdgeInsets.only(top:20.h),
margin: EdgeInsets.only(top: 20.h),
child: Text(
"申请退款",
style: TextStyle(
@ -415,16 +488,19 @@ class _OrderList extends State<OrderList> {
),
],
),
if(adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0 && adminOrderDtoList.enableRefundApprover == true)
Padding(padding: EdgeInsets.only(top:15.h),
if (adminOrderDtoList.payStatus == 1 &&
adminOrderDtoList.refundStatus == 0 &&
adminOrderDtoList.enableRefundApprover == true)
Padding(
padding: EdgeInsets.only(top: 15.h),
child: Text(
"备注:暂无退款权限,请前往企业微信联系退款审核人员进行审批",
style: TextStyle(
fontSize: 12.sp,
color: Colors.red,
fontWeight: MyFontWeight.regular),
),),
),
),
],
),
),
@ -433,6 +509,81 @@ class _OrderList extends State<OrderList> {
);
}
///
showPayDialog(String orderCode,String orderId,String payMoney) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
height: 120.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
" 确定对该订单进行扣款吗?",
style: TextStyle(
color: Color(0xFFF4524D),
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 35.h,
),
Row(
children: [
Expanded(
child: InkWell(
child: BorderText(
text: S.of(context).quxiao,
textColor: Color(0xFF30415B),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
borderColor: Color(0xFF30415B),
radius: 4,
padding: EdgeInsets.all(12),
borderWidth: 1,
),
onTap: () {
Navigator.of(context).pop();
},
),
flex: 1,
),
SizedBox(
width: 16.w,
),
Expanded(
child: InkWell(
child: RoundButton(
text: S.of(context).queren,
textColor: Colors.white,
radius: 4,
padding: EdgeInsets.all(12),
backgroup: Color(0xFF30415B),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
onTap: () {
Navigator.of(context).pop();
orderBalancePay(orderCode,orderId,payMoney);
},
),
flex: 1,
),
],
)
],
),
),
);
},
);
}
Widget orderGoodsList(OrderProductList orderProductList) {
return Container(
margin: EdgeInsets.only(bottom: 13.h),

2
lib/business_system/order/order_list_page.dart

@ -193,7 +193,7 @@ class _OrderListPage extends State<OrderListPage> {
color: Colors.white,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/custom_page').then((value) {
Navigator.of(context).pushNamed('/router/custom_page',arguments: {"beyondDateRange": "0"}).then((value) {
selectTimeDate = value;
loadFinish();
});

2
lib/business_system/order/ticket/ticket_list.dart

@ -334,7 +334,7 @@ class _TicketList extends State<TicketList> {
fontWeight: MyFontWeight.regular),
)),
Text(
ticketShowList?.amount ??"",
"¥ ${ticketShowList?.amount ??""}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF181818),

2
lib/business_system/order/ticket/ticket_page.dart

@ -593,7 +593,7 @@ class _TicketPage extends State<TicketPage>
color: Colors.white,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/custom_page').then((value) {
Navigator.of(context).pushNamed('/router/custom_page',arguments: {"beyondDateRange": "0"}).then((value) {
selectTimeDate = value;
loadFinish();
});

2
lib/business_system/order/ticket/ticket_records_page.dart

@ -324,7 +324,7 @@ class _TicketRecordPage extends State<TicketRecordPage> {
fontWeight: MyFontWeight.regular),
)),
Text(
ticketRecordList?.ticket?.amount ??"",
"¥ ${ticketRecordList?.ticket?.amount ??""}",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF181818),

5
lib/main.dart

@ -95,6 +95,7 @@ import 'business_system/goods/on_sale/add_assort.dart';
import 'business_system/goods/on_sale/batch_shelf.dart';
import 'business_system/goods/on_sale/goods_assort.dart';
import 'business_system/goods/on_sale/goods_sort.dart';
import 'business_system/goods/reservation_ page.dart';
import 'business_system/home/flow_page.dart';
import 'business_system/home/select_shop.dart';
import 'business_system/home/overview/trade_overview_page.dart';
@ -508,11 +509,13 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/monthly_report_page': (context, {arguments}) =>
MonthlyReportPage(),
'/router/custom_page': (context, {arguments}) =>
CustomPage(),
CustomPage(arguments:arguments),
'/router/shop_image_info': (context, {arguments}) =>
ShopImageInfo(arguments:arguments),
'/router/scan_code_page': (context, {arguments}) =>
ScanCodePage(arguments:arguments),
'/router/business_vip_page': (context, {arguments}) =>
BusinessVipPage(arguments:arguments),
'/router/reservation_page': (context, {arguments}) =>
ReservationPage(arguments:arguments),
};

1
lib/mine/mine_view/mine_item.dart

@ -2,7 +2,6 @@ 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/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';

16
lib/mine/user_info_page.dart

@ -44,13 +44,13 @@ class _UserInfoPage extends State<UserInfoPage> {
SharedPreferences.getInstance().then((value) => {
print(value.getString('user')),
user = UserInfo.fromJson(jsonDecode(value.getString('user'))),
mobile = user.phone,
modifyInfo["nickname"] = user.nickname,
modifyInfo["signature"] = user.signature,
modifyInfo["birth"] = user.birth,
modifyInfo["headimg"] = user.headimg,
modifyInfo["sex"] = user.sex,
age = AppUtils.getAgeByString(user.birth),
mobile = user?.phone ?? "",
modifyInfo["nickname"] = user?.nickname ?? "",
modifyInfo["signature"] = user?.signature ?? "",
modifyInfo["birth"] = user?.birth ?? "",
modifyInfo["headimg"] = user?.headimg ?? "",
modifyInfo["sex"] = user?.sex ?? "",
age = AppUtils.getAgeByString(user?.birth ?? ""),
refresh(),
apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
@ -478,6 +478,8 @@ class _UserInfoPage extends State<UserInfoPage> {
setState(() {
SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center);
});
}else{
SmartDialog.showToast("用户信息修改失败 " + info.msg, alignment: Alignment.center);
}
}

13
lib/retrofit/business_api.dart

@ -26,6 +26,7 @@ import 'data/product_group_list.dart';
import 'data/recharge_flow_list.dart';
import 'data/refund_reason_list.dart';
import 'data/single_sales_list.dart';
import 'data/store_time_info_list.dart';
import 'data/ticket_details.dart';
import 'data/ticket_record.dart';
import 'data/ticket_show.dart';
@ -288,4 +289,16 @@ abstract class BusinessApiService {
///
@POST("member/getTenantMemberBill")
Future<BaseData<BalanceChangeList>> getTenantMemberBill(@Body() Map<String, dynamic> param);
////
@GET("store/storeOpenTime/{storeId}")
Future<BaseData<StoreTimeInfoList>> storeOpenTime(@Path("storeId") String storeId);
///
@POST("product/updateSubscribe")
Future<BaseData> updateSubscribe(@Body() Map<String, dynamic> param);
///
@POST("order/balancePay")
Future<BaseData> balancePay(@Body() Map<String, dynamic> param);
}

64
lib/retrofit/business_api.g.dart

@ -765,4 +765,68 @@ class _BusinessApiService implements BusinessApiService {
return value;
}
@override
Future<BaseData<StoreTimeInfoList>> storeOpenTime(storeId) async {
ArgumentError.checkNotNull(storeId, 'storeId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'store/storeOpenTime/$storeId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<StoreTimeInfoList>.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : StoreTimeInfoList.fromJson(json),
);
return value;
}
@override
Future<BaseData> updateSubscribe(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'product/updateSubscribe',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: param);
final value = BaseData.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : json,
);
return value;
}
@override
Future<BaseData> balancePay(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'order/balancePay',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: param);
final value = BaseData.fromJson(
_result.data,
(json) => (json ?? "") == "" ? null : json,
);
return value;
}
}

290
lib/retrofit/data/business_goods.dart

File diff suppressed because one or more lines are too long

42
lib/retrofit/data/store_time_info_list.dart

@ -0,0 +1,42 @@
/// openEndTime : "20:30:00"
/// openStartTime : "09:00:00"
/// posType : "FAST_SERVICE"
class StoreTimeInfoList {
StoreTimeInfoList({
String openEndTime,
String openStartTime,
String posType,}){
_openEndTime = openEndTime;
_openStartTime = openStartTime;
_posType = posType;
}
StoreTimeInfoList.fromJson(dynamic json) {
_openEndTime = json['openEndTime'];
_openStartTime = json['openStartTime'];
_posType = json['posType'];
}
String _openEndTime;
String _openStartTime;
String _posType;
StoreTimeInfoList copyWith({ String openEndTime,
String openStartTime,
String posType,
}) => StoreTimeInfoList( openEndTime: openEndTime ?? _openEndTime,
openStartTime: openStartTime ?? _openStartTime,
posType: posType ?? _posType,
);
String get openEndTime => _openEndTime;
String get openStartTime => _openStartTime;
String get posType => _posType;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['openEndTime'] = _openEndTime;
map['openStartTime'] = _openStartTime;
map['posType'] = _posType;
return map;
}
}
Loading…
Cancel
Save