Browse Source

兑换券跳转类型更改;

生意总览订单统计图更改;
核销数据对接完成;
已下架列表,选中下架数据优化;
管理系统我的页面更改;
管理系统首页更改;
核销接口更改;
wr_2023_business
wurong 1 year ago
parent
commit
a3af43585b
  1. 23
      lib/business_system/goods/off_shelf/off_shelf_page.dart
  2. 21
      lib/business_system/home/business_home_page.dart
  3. 10
      lib/business_system/home/overview/trade_order.dart
  4. 2
      lib/business_system/mine/business_mine_page.dart
  5. 8
      lib/business_system/order/order_list.dart
  6. 261
      lib/business_system/order/order_write_off.dart
  7. 2
      lib/home/welfare_page.dart
  8. 7
      lib/mine/coupon_page.dart
  9. 2
      lib/mine/coupons_page.dart
  10. 2
      lib/mine/roll_center_page.dart
  11. 25
      lib/order/write_off_page.dart
  12. 17
      lib/retrofit/business_api.dart
  13. 52
      lib/retrofit/business_api.g.dart
  14. 386
      lib/retrofit/data/business_order_list.dart
  15. 248
      pubspec.lock

23
lib/business_system/goods/off_shelf/off_shelf_page.dart

@ -40,7 +40,6 @@ class _OffShelfPage extends State<OffShelfPage> {
int _pageIndex = 1; int _pageIndex = 1;
BusinessApiService businessService; BusinessApiService businessService;
List<AdminProductVoList> adminProductVoList = []; List<AdminProductVoList> adminProductVoList = [];
List<dynamic> productIds = [];
bool _shimmer = true; bool _shimmer = true;
@override @override
@ -106,7 +105,7 @@ class _OffShelfPage extends State<OffShelfPage> {
} }
/// ///
queryGoodsUpdate() async { queryGoodsUpdate(productIds) async {
EasyLoading.show( EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (businessService == null) { if (businessService == null) {
@ -134,7 +133,7 @@ class _OffShelfPage extends State<OffShelfPage> {
} }
/// ///
queryDelProduct() async { queryDelProduct(productIds) async {
EasyLoading.show( EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (businessService == null) { if (businessService == null) {
@ -271,16 +270,17 @@ class _OffShelfPage extends State<OffShelfPage> {
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (productIds.length != 0) productIds.clear(); List<dynamic> productIds = [];
adminProductVoList.forEach((element) { adminProductVoList.forEach((element) {
if (element.isSelect) productIds.add(element.id); if (element.isSelect)
productIds.add(element.id);
}); });
if (productIds.length == 0) { if (productIds.length == 0) {
SmartDialog.showToast("请选择要上架的商品", SmartDialog.showToast("请选择要上架的商品",
alignment: Alignment.center); alignment: Alignment.center);
return; return;
} else { } else {
queryGoodsUpdate(); queryGoodsUpdate(productIds);
} }
}, },
child: Container( child: Container(
@ -305,16 +305,17 @@ class _OffShelfPage extends State<OffShelfPage> {
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (productIds.length != 0) productIds.clear(); List<dynamic> productIds = [];
adminProductVoList.forEach((element) { adminProductVoList.forEach((element) {
if (element.isSelect) productIds.add(element.id); if (element.isSelect)
productIds.add(element.id);
}); });
if (productIds.length == 0) { if (productIds.length == 0) {
SmartDialog.showToast("请选择要删除的商品", SmartDialog.showToast("请选择要删除的商品",
alignment: Alignment.center); alignment: Alignment.center);
return; return;
} else { } else {
showDelGoodsDialog(); showDelGoodsDialog(productIds);
} }
}, },
child: Container( child: Container(
@ -388,7 +389,7 @@ class _OffShelfPage extends State<OffShelfPage> {
} }
/// ///
showDelGoodsDialog() { showDelGoodsDialog(productIds) {
showDialog( showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
@ -447,7 +448,7 @@ class _OffShelfPage extends State<OffShelfPage> {
), ),
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
queryDelProduct(); queryDelProduct(productIds);
}, },
), ),
flex: 1, flex: 1,

21
lib/business_system/home/business_home_page.dart

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

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

@ -177,8 +177,8 @@ class _TradeOrder extends State<TradeOrder> {
alignment: Alignment.center); alignment: Alignment.center);
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
int amountIndex = 0; double amountIndex = 0;
int numIndex = 0; double numIndex = 0;
if (baseData.data.saleBusinessAnalysisVOS.isNotEmpty) { if (baseData.data.saleBusinessAnalysisVOS.isNotEmpty) {
lineChartSample2DataOrderAmount.clear(); lineChartSample2DataOrderAmount.clear();
lineChartSample2DataOrderNum.clear(); lineChartSample2DataOrderNum.clear();
@ -186,14 +186,14 @@ class _TradeOrder extends State<TradeOrder> {
tradeSummaryList = baseData.data; tradeSummaryList = baseData.data;
tradeSummaryList.saleBusinessAnalysisVOS.forEach((element) { tradeSummaryList.saleBusinessAnalysisVOS.forEach((element) {
lineChartSample2DataOrderAmount.add(LineChartSample2Data( lineChartSample2DataOrderAmount.add(LineChartSample2Data(
amountIndex.toDouble(), amountIndex,
double.tryParse(element.localDateBigDecimal.toString()), double.tryParse(element.localDateBigDecimal.toString()),
element.localDateTime.substring(0, 10))); element.localDateTime.substring(0, 10)));
amountIndex += 1; amountIndex += 1;
}); });
tradeSummaryList.saleBusinessAnalysisVOS.forEach((element) { tradeSummaryList.saleBusinessAnalysisVOS.forEach((element) {
lineChartSample2DataOrderNum.add(LineChartSample2Data( lineChartSample2DataOrderNum.add(LineChartSample2Data(
numIndex.toDouble(), numIndex,
double.tryParse(element.localDateCount.toString()), double.tryParse(element.localDateCount.toString()),
element.localDateTime.substring(0, 10))); element.localDateTime.substring(0, 10)));
numIndex += 1; numIndex += 1;
@ -491,7 +491,7 @@ class _TradeOrder extends State<TradeOrder> {
} }
}, },
child: Container( child: Container(
width: 194.w, width: 200.w,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(

2
lib/business_system/mine/business_mine_page.dart

@ -106,9 +106,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
), ),
onRefresh: () { onRefresh: () {
if (widget.businessLoginInfo != null){ if (widget.businessLoginInfo != null){
// if(widget.businessLoginInfo.storeList.length <= 1)
queryStoreList(); queryStoreList();
// refreshController.refreshCompleted();
} }
else else
refreshController.refreshFailed(); refreshController.refreshFailed();

8
lib/business_system/order/order_list.dart

@ -327,9 +327,13 @@ class _OrderList extends State<OrderList> {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/order_write_off', arguments:{ .pushNamed('/router/order_write_off', arguments:{
"tickets":adminOrderDtoList.tickets, "tickets":adminOrderDtoList.tickets,
"productName": adminOrderDtoList.orderProductList[index].productName,
"orderCode": adminOrderDtoList?.orderCode ?? "", "orderCode": adminOrderDtoList?.orderCode ?? "",
"userName":adminOrderDtoList?.name ?? "" "userName":adminOrderDtoList?.name ?? "",
"ticketStatus":adminOrderDtoList?.ticketStatus,
}).then((value) async{
// _pageIndex = 1;
adminOrderDTOList.clear();
await _onRefresh(isShowLoad: false);
}); });
}, },
child: Container( child: Container(

261
lib/business_system/order/order_write_off.dart

@ -1,11 +1,15 @@
import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart'; import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart'; import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/business_order_list.dart'; import '../../retrofit/data/business_order_list.dart';
@ -28,51 +32,21 @@ class _OrderWriteOff extends State<OrderWriteOff> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
var writeOffCheck = false; var writeOffCheck = false;
List<Tickets> tickets; List<Tickets> tickets;
String productName; AdminOrderDtoList adminOrderDTOList;
int nameIndex = 0; int nameIndex = 0;
BusinessApiService businessService; BusinessApiService businessService;
List<dynamic> itemMap = [];
List<dynamic> skuTickets = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
tickets = widget.arguments["tickets"]; tickets = widget.arguments["tickets"];
productName = widget.arguments["productName"];
}
///
singleWiped() async {
if (businessService == null) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]);
}
BaseData baseData = await businessService.wiped({
"pageNum":1,
"pageSize":10,
"productId":"",
"productSkuId":"",
"searchKey":"",
"state":"",
"storeId":"",
"ticketCode":"",
"ticketId":"",
"ticketItemIds":[],
"type":""
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center);
Navigator.pop(context);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} }
/// ///
severalWiped() async { severalWiped(ticketWipedBatch) async {
// try {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
if (businessService == null) { if (businessService == null) {
businessService = BusinessApiService(Dio(), businessService = BusinessApiService(Dio(),
context: context, context: context,
@ -80,27 +54,22 @@ class _OrderWriteOff extends State<OrderWriteOff> {
tenant: BusinessInstance.instance.businessTenant, tenant: BusinessInstance.instance.businessTenant,
storeId: widget.arguments["storeId"]); storeId: widget.arguments["storeId"]);
} }
BaseData baseData = await businessService.posTicketRecharge({ BaseData baseData = await businessService
"itemMap":[{ .wipedBatchs(jsonEncode(ticketWipedBatch).replaceAll("\\\"", "\""))
"productSkuld":tickets[nameIndex].productSkuId ?? "", .catchError((error) {});
"skuTickets":[{
"number":1,
"skuTicket":tickets[nameIndex].name ?? "",
"state":tickets[nameIndex].state ?? "",
}]
}],
"ticketCode":tickets[nameIndex].code ?? "",
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center); EasyLoading.dismiss();
Navigator.pop(context); Navigator.pop(context);
SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else { } else {
EasyLoading.dismiss();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
// } finally {
// EasyLoading.dismiss();
// }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -139,36 +108,55 @@ class _OrderWriteOff extends State<OrderWriteOff> {
writeOffInfo(), writeOffInfo(),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (itemMap.length != 0) itemMap.clear(); if (widget.arguments["ticketStatus"] == false) {
return;
} else {
List<dynamic> ticketWipedBatch = [];
tickets.forEach((element) { tickets.forEach((element) {
if (element.isSelect) { List<dynamic> skuTickets = [];
element.ticketItemList.forEach((ele) {
if (ele.isSelect) {
skuTickets.add({ skuTickets.add({
"number": 1, "number": 1,
"skuTicket":element.name, "skuTicket": ele.name,
"state":element.state,}); "state": ele.state,
itemMap.add({ });
}
});
if (skuTickets.isNotEmpty) {
ticketWipedBatch.add({
"itemMap": [
{
"productSkuld": element.productSkuId, "productSkuld": element.productSkuId,
"ticketExchangeName": element.name,
"ticketId": element.id,
"skuTickets": skuTickets "skuTickets": skuTickets
}
],
"ticketCode": element.code,
}); });
} }
}); });
if (itemMap.length == 0) { if (ticketWipedBatch.length == 0) {
SmartDialog.showToast("请选择要核销的商品", SmartDialog.showToast("请选择要核销的商品",
alignment: Alignment.center); alignment: Alignment.center);
return; return;
} else { } else {
severalWiped(); severalWiped(ticketWipedBatch);
}
} }
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(bottom:55.h,), margin: EdgeInsets.only(
bottom: 55.h, top: tickets.length < 2 ? 125.h : 0),
padding: EdgeInsets.symmetric(vertical: 16.h), padding: EdgeInsets.symmetric(vertical: 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27), borderRadius: BorderRadius.circular(27),
color: Color(0xFF30415B) color: widget.arguments["ticketStatus"] == true
), ? Color(0xFF30415B)
: Color(0xFFABACAB)),
child: Text( child: Text(
"确认核销", "确认核销",
style: TextStyle( style: TextStyle(
@ -227,9 +215,7 @@ class _OrderWriteOff extends State<OrderWriteOff> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
basicInfoItem("票券名称:",tickets[nameIndex].name ?? ""),
basicInfoItem("用户名称::", widget?.arguments["userName"] ?? ""), basicInfoItem("用户名称::", widget?.arguments["userName"] ?? ""),
basicInfoItem("票券编号::",tickets[nameIndex].code ?? ""),
basicInfoItem("订单编号::", widget?.arguments["orderCode"] ?? ""), basicInfoItem("订单编号::", widget?.arguments["orderCode"] ?? ""),
], ],
), ),
@ -351,33 +337,122 @@ class _OrderWriteOff extends State<OrderWriteOff> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
tickets?.name ?? "", tickets?.name ?? "",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.bold,
fontSize: 14.sp, fontSize: 14.sp,
color: tickets.state == 1?Color(0xFF0D0D0D):Color(0xFFABACAB), color: tickets.state != 9
? (tickets.state == 7
? Color(0xFFACACAC)
: (tickets.state == 8
? Color(0xFFACACAC)
: Color(0xFF30415B)))
: Color(0xFFABACAB),
), ),
)), )),
Expanded(child: Column( Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Padding(padding: EdgeInsets.only(right:10.w), Padding(
padding: EdgeInsets.only(right: 10.w),
child: Text( child: Text(
(tickets.state == 1)?"待核销":"已核销", (tickets.state != 9)
? (tickets.state == 7
? "已退款"
: (tickets.state == 8 ? "票券已失效" : "待核销"))
: "已核销",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp, fontSize: 12.sp,
color: (tickets.state == 1)?Color(0xFF30415B):Color(0xFFACACAC), color: (tickets.state != 9)
? (tickets.state == 7
? Color(0xFFACACAC)
: (tickets.state == 8
? Color(0xFFACACAC)
: Color(0xFF30415B)))
: Color(0xFFACACAC),
), ),
),), ),
SizedBox(height:25.h,), ),
if(tickets.state == 1) ],
Checkbox( ))
value: tickets.isSelect, ],
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: tickets?.ticketItemList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: skuTicketsItem(tickets.ticketItemList[position]),
);
},
),
Container(
margin: EdgeInsets.only(bottom: 11.h, top: 13.h),
width: double.infinity,
height: 1.h,
color: Color(0xFFEBECEF),
)
],
),
);
}
Widget skuTicketsItem(TicketItemList ticketItemList) {
return Container(
width: double.infinity,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Text(
ticketItemList?.name ?? "",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF0D0D0D),
),
)),
(tickets[nameIndex].state == 7 || tickets[nameIndex].state == 8)
? (ticketItemList.state != 9
? Container(
margin: EdgeInsets.symmetric(vertical: 20.h),
)
: Align(
alignment: Alignment.centerRight,
child: Container(
margin: EdgeInsets.only(
right: 15.w, top: 10.h, bottom: 10.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(
2,
),
border: Border.all(
color: Color(0xFFCFCFCF),
width: 1.w,
),
),
child: Icon(
Icons.check,
color: Color(0xFFCFCFCF),
size: 14.w,
)),
))
: (ticketItemList.state == 1
? Checkbox(
value: ticketItemList.isSelect,
onChanged: (a) { onChanged: (a) {
setState(() { setState(() {
tickets.isSelect = !tickets.isSelect; ticketItemList.isSelect = !ticketItemList.isSelect;
}); });
}, },
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -385,16 +460,12 @@ class _OrderWriteOff extends State<OrderWriteOff> {
), ),
checkColor: Color(0xFFFFFFFF), checkColor: Color(0xFFFFFFFF),
fillColor: MaterialStateProperty.all(Color(0xFF30415B)), fillColor: MaterialStateProperty.all(Color(0xFF30415B)),
), )
], : Align(
))
],
),
if(tickets.state != 1)
Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Container( child: Container(
margin: EdgeInsets.only(right:10.w), margin: EdgeInsets.only(
right: 15.w, top: 10.h, bottom: 10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
@ -409,14 +480,8 @@ class _OrderWriteOff extends State<OrderWriteOff> {
Icons.check, Icons.check,
color: Color(0xFFCFCFCF), color: Color(0xFFCFCFCF),
size: 14.w, size: 14.w,
) )),
),), ))
Container(
margin: EdgeInsets.only(bottom:11.h,top: 13.h),
width: double.infinity,
height: 1.h,
color: Color(0xFFEBECEF),
)
], ],
), ),
); );
@ -431,7 +496,8 @@ class _OrderWriteOff extends State<OrderWriteOff> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
"哈哈哈哈哈", "哈哈哈哈哈",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -439,10 +505,12 @@ class _OrderWriteOff extends State<OrderWriteOff> {
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),
)), )),
Expanded(child: Column( Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Padding(padding: EdgeInsets.only(right:10.w), Padding(
padding: EdgeInsets.only(right: 10.w),
child: Text( child: Text(
"已核销", "已核销",
style: TextStyle( style: TextStyle(
@ -450,8 +518,11 @@ class _OrderWriteOff extends State<OrderWriteOff> {
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF30415B), color: Color(0xFF30415B),
), ),
),), ),
SizedBox(height:25.h,), ),
SizedBox(
height: 25.h,
),
Checkbox( Checkbox(
value: writeOffCheck, value: writeOffCheck,
onChanged: (a) { onChanged: (a) {

2
lib/home/welfare_page.dart

@ -652,7 +652,7 @@ class _WelfarePage extends State<WelfarePage> {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/write_off_page', arguments: { .pushNamed('/router/write_off_page', arguments: {
"couponId": cop.id, "couponId": cop.id,
"coupon": jsonEncode(cop.toJson()), "coupon": cop,
}); });
} else { } else {
showStoreSelector(cop.storeList); showStoreSelector(cop.storeList);

7
lib/mine/coupon_page.dart

@ -241,18 +241,21 @@ class _CouponPage extends State<CouponPage> {
} else { } else {
if (coupons[position].bizType == 5 || if (coupons[position].bizType == 5 ||
coupons[position].bizType == 3) { coupons[position].bizType == 3) {
try{
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/write_off_page', '/router/write_off_page',
arguments: { arguments: {
"couponId": coupons[position].id, "couponId": coupons[position].id,
"coupon": jsonEncode(coupons[position]), "coupon": coupons[position],
}).then((value) { }).then((value) {
_onRefresh(); _onRefresh();
}); });
}catch(e){
print(e);
}
} else { } else {
showStoreSelector( showStoreSelector(
coupons[position].storeList); coupons[position].storeList);
} }
} }
}, },

2
lib/mine/coupons_page.dart

@ -180,7 +180,7 @@ class _CouponsPage extends State<CouponsPage> {
'/router/write_off_page', '/router/write_off_page',
arguments: { arguments: {
"couponId": coupons[position].id, "couponId": coupons[position].id,
"coupon": jsonEncode(coupons[position]), "coupon": coupons[position],
}).then((value) { }).then((value) {
_onRefresh(); _onRefresh();
}); });

2
lib/mine/roll_center_page.dart

@ -134,7 +134,7 @@ class _RollCenterPage extends State<RollCenterPage> {
'/router/write_off_page', '/router/write_off_page',
arguments: { arguments: {
"couponId": coupons[position].id, "couponId": coupons[position].id,
"coupon": coupons[position].toJson() "coupon": coupons[position]
}); });
} else { } else {
showStoreSelector(coupons[position].storeList); showStoreSelector(coupons[position].storeList);

25
lib/order/write_off_page.dart

@ -33,7 +33,7 @@ class WriteOffPage extends StatefulWidget {
} }
class _WriteOffPage extends State<WriteOffPage> { class _WriteOffPage extends State<WriteOffPage> {
dynamic coupon; Coupon coupon;
ApiService apiService; ApiService apiService;
CouponDetail queryCoupon; CouponDetail queryCoupon;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
@ -42,10 +42,10 @@ class _WriteOffPage extends State<WriteOffPage> {
void initState() { void initState() {
super.initState(); super.initState();
coupon = jsonDecode(widget.arguments["coupon"]); coupon = widget.arguments["coupon"];
if (mounted) setState(() {}); if (mounted) setState(() {});
queryCouponDetail(coupon["memberCouponId"]); queryCouponDetail(coupon.memberCouponId);
} }
//// ////
@ -60,15 +60,14 @@ class _WriteOffPage extends State<WriteOffPage> {
} }
BaseData baseData = await apiService.couponDetail(memberCouponId); BaseData baseData = await apiService.couponDetail(memberCouponId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() {
queryCoupon = baseData.data; queryCoupon = baseData.data;
if(queryCoupon.status==2){ if(queryCoupon.status==2){
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
} }
else Future.delayed(Duration(seconds: 1), () { // else Future.delayed(Duration(seconds: 15), () {
queryCouponDetail(coupon["memberCouponId"]); // queryCouponDetail(coupon["memberCouponId"]);
}); // });
}); // setState(() {});
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
@ -127,7 +126,7 @@ class _WriteOffPage extends State<WriteOffPage> {
child: Column( child: Column(
children: [ children: [
Text( Text(
coupon != null ? coupon["couponName"] : "", coupon != null ? coupon.couponName : "",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -137,8 +136,8 @@ class _WriteOffPage extends State<WriteOffPage> {
height:11.h, height:11.h,
), ),
Text( Text(
(coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi( (coupon.useStartTime == null || coupon.useEndTime == null) ? "" : S.of(context).youxiaoqi(
"${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"), "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]}-${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}"),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
@ -203,7 +202,7 @@ class _WriteOffPage extends State<WriteOffPage> {
height: 16.h, height: 16.h,
), ),
Expanded(child: QrImage( Expanded(child: QrImage(
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}", data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon.memberCouponId}\"}",
version: QrVersions.auto, version: QrVersions.auto,
size: 250.w, size: 250.w,
gapless: true, gapless: true,
@ -560,7 +559,7 @@ class _WriteOffPage extends State<WriteOffPage> {
Container( Container(
child: Html( child: Html(
data: data:
coupon != null ? coupon["remark"] : "", coupon != null ? coupon.remark : "",
customImageRenders: { customImageRenders: {
networkSourceMatcher(): networkImageRender( networkSourceMatcher(): networkImageRender(
loadingWidget: () { loadingWidget: () {

17
lib/retrofit/business_api.dart

@ -247,20 +247,9 @@ abstract class BusinessApiService {
Future<BaseData<UploadResult>> upload(@Part(name: "file") File data, Future<BaseData<UploadResult>> upload(@Part(name: "file") File data,
@Part(name: "folderId") int folderId); @Part(name: "folderId") int folderId);
///
@POST("ticket/wiped")
Future<BaseData> wiped(
@Body() Map<String, dynamic> param);
/// ///
@POST("ticket/wipedBatch") @POST("ticket/wipedBatchs")
Future<BaseData> wipedBatch( Future<BaseData> wipedBatchs(
@Body() Map<String, dynamic> param); @Body() String param);
///pos端核销接口
@POST("member/posTicketRecharge")
Future<BaseData> posTicketRecharge(
@Body() Map<String, dynamic> param);
} }

52
lib/retrofit/business_api.g.dart

@ -554,64 +554,18 @@ class _BusinessApiService implements BusinessApiService {
} }
@override @override
Future<BaseData> wiped(param) async { Future<BaseData> wipedBatchs(param) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _result = await _dio.request<Map<String, dynamic>>('ticket/wipedBatchs',
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('ticket/wiped',
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> wipedBatch(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>>('ticket/wipedBatch',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
headers: <String, dynamic>{}, headers: <String, dynamic>{},
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: param);
final value = BaseData.fromJson(
_result.data,
(json) => json == null ? null : json,
);
return value;
}
@override
Future<BaseData> posTicketRecharge(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>>('member/posTicketRecharge',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson( final value = BaseData.fromJson(
_result.data, _result.data,
(json) => json == null ? null : json, (json) => json == null ? null : json,

386
lib/retrofit/data/business_order_list.dart

File diff suppressed because one or more lines are too long

248
pubspec.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save