Browse Source

订单

null_safety
fmk 4 years ago
parent
commit
7400e640a1
  1. 4
      lib/home/home_page.dart
  2. 2
      lib/main.dart
  3. 2
      lib/order/exchange_order_page.dart
  4. 14
      lib/order/exchange_order_success_page.dart
  5. 306
      lib/order/order_detail_page.dart
  6. 189
      lib/order/order_history_page.dart
  7. 72
      lib/order/store_selector_page.dart
  8. 4
      lib/retrofit/data/member_rank.dart
  9. 33
      lib/retrofit/data/member_rank.g.dart
  10. 38
      lib/retrofit/data/page.dart
  11. 34
      lib/retrofit/data/page.g.dart
  12. 59
      lib/retrofit/data/promotion.dart
  13. 67
      lib/retrofit/data/promotion.g.dart
  14. 61
      lib/retrofit/data/sign_in.dart
  15. 46
      lib/retrofit/data/sign_in.g.dart
  16. 29
      lib/retrofit/data/sign_info.dart
  17. 34
      lib/retrofit/data/sign_info.g.dart
  18. 74
      lib/retrofit/data/store.dart
  19. 78
      lib/retrofit/data/store.g.dart
  20. 90
      lib/retrofit/data/store_info.dart
  21. 95
      lib/retrofit/data/store_info.g.dart
  22. 13
      lib/retrofit/data/store_type.dart
  23. 18
      lib/retrofit/data/store_type.g.dart
  24. 38
      lib/retrofit/data/task.dart
  25. 42
      lib/retrofit/data/task.g.dart
  26. 88
      lib/retrofit/data/upload_result.dart
  27. 67
      lib/retrofit/data/upload_result.g.dart
  28. 33
      lib/retrofit/data/user_entity.dart
  29. 39
      lib/retrofit/data/user_entity.g.dart
  30. 53
      lib/retrofit/data/user_info.dart
  31. 48
      lib/retrofit/data/user_info.g.dart
  32. 27
      lib/retrofit/data/verify_code.dart
  33. 33
      lib/retrofit/data/verify_code.g.dart
  34. 8
      lib/retrofit/retrofit_api.dart
  35. 19
      lib/retrofit/retrofit_api.g.dart

4
lib/home/home_page.dart

@ -136,6 +136,10 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
text: S.of(context).jinrihuiyuanrenwu,
imgPath: "assets/image/icon_today_task.png",
moreText: S.of(context).renwuzhongxin,
onTap: () {
Navigator.of(context)
.pushNamed('/router/integral_page');
},
),
InkWell(
onTap: () {

2
lib/main.dart

@ -196,7 +196,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/write_off_success_page': (context, {arguments}) =>
WriteOffSuccessPage(),
'/router/order_history_page': (context, {arguments}) => OrderHistoryPage(),
'/router/order_details': (context, {arguments}) => OrderDetailPage(),
'/router/order_details': (context, {arguments}) => OrderDetailPage(arguments: arguments),
'/router/recharge_page': (context, {arguments}) => RechargePage(),
'/router/hot_article_page': (context, {arguments}) => HotArticlePage(),
'/router/address_edit_page': (context, {arguments}) => EditAddressPage(

2
lib/order/exchange_order_page.dart

@ -442,7 +442,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
if (baseDate.isSuccess) {
await Navigator.of(context).pushNamed(
'/router/exchange_order_success_page',
arguments: {"price": widget.arguments["price"], "points": points, "id": points});
arguments: {"price": widget.arguments["price"], "points": points, "id": baseDate.data});
points =
"${int.tryParse(points) - int.tryParse(widget.arguments["price"])}";
Navigator.of(context).pop();

14
lib/order/exchange_order_success_page.dart

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
@ -196,7 +197,7 @@ class _ExchangeOrderSuccessPage extends State<ExchangeOrderSuccessPage> {
Expanded(
child: InkWell(
onTap: () {
// receiveToCard(id);
receiveToCard();
},
child: RoundButton(
text: S.of(context).lingqudaokabao,
@ -221,9 +222,14 @@ class _ExchangeOrderSuccessPage extends State<ExchangeOrderSuccessPage> {
);
}
receiveToCard(id) async {
// BaseData baseData = await apiService.receiveToCard(id);
// Navigator.of(context).popAndPushNamed('/router/mine_card');
receiveToCard() async {
BaseData baseData = await apiService.receiveToCard(widget.arguments["id"]);
if(baseData != null && baseData.isSuccess) {
await Navigator.of(context).pushNamed('/router/mine_card');
Navigator.of(context).pop();
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
}

306
lib/order/order_detail_page.dart

@ -1,11 +1,22 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/pay_input_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/separator.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class OrderDetailPage extends StatefulWidget {
final arguments;
OrderDetailPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _OrderDetailPage();
@ -13,6 +24,31 @@ class OrderDetailPage extends StatefulWidget {
}
class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
queryDetails();
});
}
OrderInfo orderInfo;
queryDetails() async {
BaseData baseData = await apiService.orderDetail(widget.arguments["id"]);
if (baseData != null && baseData.isSuccess) {
orderInfo = OrderInfo.fromJson(baseData.data);
setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -31,7 +67,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10),
margin: EdgeInsets.only(left: 10.w),
padding: EdgeInsets.all(6),
child: Icon(
Icons.arrow_back_ios,
@ -41,12 +77,12 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
),
titleSpacing: 2,
leadingWidth: 56,
leadingWidth: 56.w,
bottom: PreferredSize(
preferredSize: Size(double.infinity, 88),
preferredSize: Size(double.infinity, 88.h),
child: Container(
height: 88,
padding: EdgeInsets.fromLTRB(16, 0, 16, 14),
height: 88.h,
padding: EdgeInsets.fromLTRB(16.w, 0, 16.w, 14.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
@ -57,12 +93,12 @@ class _OrderDetailPage extends State<OrderDetailPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 20,
width: 82,
height: 20.h,
width: 82.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
border: Border.all(
width: 1,
width: 1.w,
color: Color(0xFF32A060),
),
),
@ -83,10 +119,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
},
child: RoundButton(
text: S.of(context).ziqu,
width: 42,
height: 20,
width: 42.w,
height: 20.h,
textColor: Colors.white,
padding: EdgeInsets.fromLTRB(8, 1, 8, 1),
padding:
EdgeInsets.fromLTRB(8.w, 1.h, 8.w, 1.h),
backgroup: type == 0
? Color(0xFF32A060)
: Colors.transparent,
@ -104,10 +141,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
},
child: RoundButton(
text: S.of(context).waisong,
width: 42,
height: 20,
width: 42.w,
height: 20.h,
textColor: Colors.white,
padding: EdgeInsets.fromLTRB(8, 1, 8, 1),
padding:
EdgeInsets.fromLTRB(8.w, 1.h, 8.w, 1.h),
backgroup: type == 1
? Color(0xFF32A060)
: Colors.transparent,
@ -122,14 +160,14 @@ class _OrderDetailPage extends State<OrderDetailPage> {
S.of(context).qingzaiguidingshijianneizhifu,
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontSize: 12.sp,
),
),
],
),
),
Container(
height: 33,
height: 33.h,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -138,7 +176,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
child: BorderText(
text: "02",
textColor: Colors.white,
fontSize: 21,
fontSize: 21.sp,
fontWeight: FontWeight.bold,
borderColor: Colors.white,
borderWidth: 1,
@ -146,24 +184,24 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
),
SizedBox(
width: 8,
width: 8.w,
),
Text(
":",
style: TextStyle(
color: Colors.white,
fontSize: 21,
fontSize: 21.sp,
),
),
SizedBox(
width: 8,
width: 8.w,
),
AspectRatio(
aspectRatio: 1,
child: BorderText(
text: "02",
textColor: Colors.white,
fontSize: 21,
fontSize: 21.sp,
fontWeight: FontWeight.bold,
borderColor: Colors.white,
borderWidth: 1,
@ -182,7 +220,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
child: Stack(
children: [
Container(
height: 36,
height: 36.h,
color: Color(0xFF3A405A),
),
SingleChildScrollView(
@ -194,7 +232,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
buildCommodity(),
buildOrderInfo(),
Container(
height: 42,
height: 42.h,
),
],
),
@ -210,7 +248,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Widget buildAddress() {
return Container(
margin: EdgeInsets.only(left: 16, right: 16, top: 4, bottom: 2),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 2.h),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
@ -231,14 +269,17 @@ class _OrderDetailPage extends State<OrderDetailPage> {
children: [
Image.asset(
"assets/image/icon_location_address.png",
width: 28,
height: 28,
width: 28.w,
height: 28.h,
),
Expanded(
child: Text(
"前进麦味·天然烘焙(凯德1818店)",
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 14, color: Color(0xFF4C4C4C)),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF4C4C4C),
),
),
),
Icon(
@ -249,18 +290,21 @@ class _OrderDetailPage extends State<OrderDetailPage> {
],
),
Container(
margin: EdgeInsets.only(left: 28),
margin: EdgeInsets.only(left: 28.w),
child: Text(
"武昌区中国铁建凯德1818蓝调步行街中北路109附33门牌号05",
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 10, color: Color(0xFFA29E9E)),
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
),
Container(
margin: EdgeInsets.only(top: 20, bottom: 16),
margin: EdgeInsets.only(top: 20.h, bottom: 16.h),
child: MySeparator(
width: 5,
height: 1,
width: 5.w,
height: 1.h,
color: Color(0xFFA29E9E),
),
),
@ -272,18 +316,18 @@ class _OrderDetailPage extends State<OrderDetailPage> {
children: [
Image.asset(
"assets/image/icon_order_cancel.png",
width: 24,
height: 24,
width: 24.w,
height: 24.h,
fit: BoxFit.contain,
),
SizedBox(
height: 8,
height: 8.h,
),
Text(
S.of(context).quxiaodingdan,
style: TextStyle(
color: Color(0xFF353535),
fontSize: 12,
fontSize: 12.sp,
),
)
],
@ -300,16 +344,19 @@ class _OrderDetailPage extends State<OrderDetailPage> {
children: [
Image.asset(
"assets/image/icon_order_renminbi.png",
width: 24,
height: 24,
width: 24.w,
height: 24.h,
fit: BoxFit.contain,
),
SizedBox(
height: 8,
height: 8.h,
),
Text(
S.of(context).jixuzhifu,
style: TextStyle(color: Color(0xFF32A060), fontSize: 12),
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 12.sp,
),
)
],
),
@ -326,18 +373,21 @@ class _OrderDetailPage extends State<OrderDetailPage> {
alignment: Alignment.centerRight,
children: [
Container(
margin: EdgeInsets.only(left: 16, right: 16, top: 2, bottom: 8),
padding: EdgeInsets.only(left: 20, right: 20, top: 12, bottom: 12),
margin:
EdgeInsets.only(left: 16.w, right: 16.w, top: 2.h, bottom: 8.h),
padding:
EdgeInsets.only(left: 20.w, right: 20.w, top: 12.h, bottom: 12.h),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0)
],
borderRadius: BorderRadius.all(Radius.circular(8))),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: commodityList(),
@ -357,17 +407,17 @@ class _OrderDetailPage extends State<OrderDetailPage> {
commodityItem(),
commodityItem(),
commodityItem(),
SizedBox(height: 20),
SizedBox(height: 20.h),
discountItem(Color(0xFF32A060)),
discountItem(Color(0xFFFF7A1A)),
Container(
margin: EdgeInsets.only(
top: 24,
bottom: 4,
top: 24.h,
bottom: 4.h,
),
child: MySeparator(
height: 1,
width: 5,
width: 5.w,
color: Colors.grey,
),
),
@ -377,27 +427,29 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Widget buildQrCode() {
return Container(
margin: EdgeInsets.only(right: 16),
margin: EdgeInsets.only(right: 16.w),
child: Stack(
children: [
Container(
width: 94,
height: 33,
margin: EdgeInsets.only(left: 12),
padding: EdgeInsets.only(left: 16),
width: 94.w,
height: 33.h,
margin: EdgeInsets.only(left: 12.w),
padding: EdgeInsets.only(left: 16.w),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0)
],
borderRadius: BorderRadius.only(
topLeft: Radius.circular(2),
bottomLeft: Radius.circular(2),
)),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.only(
topLeft: Radius.circular(2),
bottomLeft: Radius.circular(2),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
@ -406,7 +458,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
S.of(context).qujianma,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
fontSize: 12.sp,
color: Colors.black),
),
Icon(
@ -418,16 +470,17 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
),
Container(
margin: EdgeInsets.only(top: 6, bottom: 6),
margin: EdgeInsets.only(top: 6.h, bottom: 6.h),
// padding: EdgeInsets.all(2),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0)
color: Colors.black.withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(2))),
child: Icon(
@ -442,18 +495,21 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Widget buildOrderInfo() {
return Container(
margin: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 8),
padding: EdgeInsets.only(left: 20, right: 20, top: 12, bottom: 12),
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 16.h, bottom: 8.h),
padding:
EdgeInsets.only(left: 20.w, right: 20.w, top: 12.h, bottom: 12.h),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0)
],
borderRadius: BorderRadius.all(Radius.circular(8))),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 1),
blurRadius: 12,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Column(
children: [
orderInfoItem(S.of(context).shoujihao, "13800138000"),
@ -468,7 +524,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Widget orderInfoItem(leftText, rightText) {
return Container(
margin: EdgeInsets.only(top: 8, bottom: 8),
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
@ -476,23 +532,24 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Text(
leftText,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
color: Color(0xFF727272)),
fontWeight: FontWeight.bold,
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
Expanded(
child: Text(
rightText,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12,
fontSize: 12.sp,
color: Color(0xFF353535),
),
),
flex: 1,
),
SizedBox(
width: 16,
width: 16.w,
),
Icon(
Icons.keyboard_arrow_right,
@ -506,22 +563,22 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Widget commodityItem() {
return Container(
margin: EdgeInsets.only(top: 8, bottom: 8),
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: Row(
children: [
Container(
child: Image.network(
"https://t7.baidu.com/it/u=1297102096,3476971300&fm=193&f=GIF",
width: 44,
width: 44.w,
fit: BoxFit.cover,
height: 44,
height: 44.h,
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 16, right: 16),
height: 44,
margin: EdgeInsets.only(left: 16.w, right: 16.w),
height: 44.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
@ -533,14 +590,17 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Text(
"海盐牛角",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: Color(0xFF353535)),
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
Text(
"x2",
style:
TextStyle(fontSize: 12, color: Color(0xFF727272)),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
],
),
@ -554,14 +614,17 @@ class _OrderDetailPage extends State<OrderDetailPage> {
S.of(context).ge(200),
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12, color: Color(0xFFA29E9E)),
fontSize: 12.sp,
color: Color(0xFFA29E9E),
),
)),
Text(
S.of(context).yuan(8),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
color: Color(0xFF4C4C4C)),
fontWeight: FontWeight.bold,
fontSize: 12.sp,
color: Color(0xFF4C4C4C),
),
)
],
),
@ -576,31 +639,32 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Widget discountItem(Color color) {
return Container(
margin: EdgeInsets.only(top: 9, bottom: 9),
margin: EdgeInsets.only(top: 9.h, bottom: 9.h),
child: Row(
children: [
Container(
padding: EdgeInsets.fromLTRB(4, 2, 4, 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(2)),
border: Border.all(
width: 1, color: color, style: BorderStyle.solid)),
borderRadius: BorderRadius.all(Radius.circular(2)),
border:
Border.all(width: 1, color: color, style: BorderStyle.solid),
),
child: Text(
S.of(context).peisongfei,
style: TextStyle(
fontSize: 10,
fontSize: 10.sp,
color: color,
),
),
),
SizedBox(
width: 27,
width: 27.w,
),
Expanded(
child: Text(
S.of(context).huodongjianmianpeisongfei(3),
style: TextStyle(
fontSize: 10,
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
@ -609,7 +673,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Text(
S.of(context).yuan(-3.0),
style: TextStyle(
fontSize: 12,
fontSize: 12.sp,
color: color,
),
),
@ -620,7 +684,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
Widget buildTotalPrice() {
return Container(
margin: EdgeInsets.only(top: 7, bottom: 11),
margin: EdgeInsets.only(top: 7.h, bottom: 11.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.baseline,
@ -630,7 +694,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
child: Text(
S.of(context).huodongjianmianpeisongfei(3),
style: TextStyle(
fontSize: 10,
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
@ -640,7 +704,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
child: Text(
S.of(context).jiesuanjine,
style: TextStyle(
fontSize: 10,
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
@ -649,7 +713,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
"20.4",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 30,
fontSize: 30.sp,
color: Color(0xFF32A060),
),
)

189
lib/order/order_history_page.dart

@ -153,9 +153,10 @@ class _OrderHistoryList extends State<OrderHistoryList>
child: ListView.builder(
itemCount: orderInfos != null ? orderInfos.length : 0,
itemBuilder: (context, position) {
return GestureDetector(
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details');
Navigator.of(context).pushNamed('/router/order_details',
arguments: {"id": orderInfos[position].id});
},
child: orderItem(orderInfos[position]),
);
@ -278,7 +279,9 @@ class _OrderHistoryList extends State<OrderHistoryList>
Padding(
padding: EdgeInsets.only(top: 12.h, right: 12.w),
child: Text(
(orderInfo != null)
(orderInfo != null &&
orderInfo.storeVO != null &&
orderInfo.storeVO.posType != null)
? statusText(
orderInfo.storeVO.posType.code,
orderInfo.orderStatus,
@ -357,90 +360,91 @@ class _OrderHistoryList extends State<OrderHistoryList>
Container(
margin: EdgeInsets.only(right: 12.w, bottom: 12.h),
child: Directionality(
textDirection: TextDirection.rtl,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
textDirection: TextDirection.rtl,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
TextSpan(
text: (orderInfo != null &&
orderInfo.detailDTO != null &&
orderInfo.detailDTO.orderProductList !=
null)
? "${orderInfo.detailDTO.orderProductList.length}"
: "0",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
TextSpan(
text: (orderInfo != null &&
orderInfo.detailDTO != null &&
orderInfo.detailDTO.orderProductList !=
null)
? "${orderInfo.detailDTO.orderProductList.length}"
: "0",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
],
),
),
SizedBox(
width: 4.w,
),
],
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "合计:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
SizedBox(
width: 4.w,
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "合计:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
TextSpan(
text: S.of(context).yuan(orderInfo != null
? orderInfo.finalPayPrice
: "0"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
TextSpan(
text: S.of(context).yuan(orderInfo != null
? orderInfo.finalPayPrice
: "0"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
],
),
),
],
),
],
),
SizedBox(
height: 8.h,
),
Row(
children: statusBtn(
orderInfo != null ? orderInfo.orderStatus : 0),
),
],
)),
),
],
),
SizedBox(
height: 8.h,
),
Row(
children: statusBtn(
orderInfo != null ? orderInfo.orderStatus : 0),
),
],
),
),
),
],
),
@ -453,16 +457,22 @@ class _OrderHistoryList extends State<OrderHistoryList>
case "NORMALSTORE":
switch (status) {
case -1:
statusText = payStatus == 0 ? S.of(context).daizhifu : S.of(context).yizhifu;
statusText =
payStatus == 0 ? S.of(context).daizhifu : S.of(context).yizhifu;
break;
case 1:
statusText = payStatus == 0 ? S.of(context).daizhifu : S.of(context).yizhifu;
statusText =
payStatus == 0 ? S.of(context).daizhifu : S.of(context).yizhifu;
break;
case 2:
statusText = payStatus == 1 ? S.of(context).daiqueren : S.of(context).yizhifu;
statusText = payStatus == 1
? S.of(context).daiqueren
: S.of(context).yizhifu;
break;
case 3:
statusText = payStatus == 1 ? S.of(context).shangjiaqueren : S.of(context).yizhifu;
statusText = payStatus == 1
? S.of(context).shangjiaqueren
: S.of(context).yizhifu;
break;
case 4:
statusText = S.of(context).yizhifu;
@ -481,13 +491,18 @@ class _OrderHistoryList extends State<OrderHistoryList>
case "FASTSTORE":
switch (status) {
case 1:
statusText = payStatus == 1 ? S.of(context).yizhifu : S.of(context).daizhifu;
statusText =
payStatus == 1 ? S.of(context).yizhifu : S.of(context).daizhifu;
break;
case 2:
statusText = payStatus == 1 ? S.of(context).daizhizuo : S.of(context).daizhifu;
statusText = payStatus == 1
? S.of(context).daizhizuo
: S.of(context).daizhifu;
break;
case 3:
statusText = payStatus == 1 ? S.of(context).zhizuowancheng : S.of(context).daizhifu;
statusText = payStatus == 1
? S.of(context).zhizuowancheng
: S.of(context).daizhifu;
break;
case 4:
if (isTakeOut == 0) {
@ -514,7 +529,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
if (sendStatus == 1) {
statusText = S.of(context).yifahuo;
} else if (sendStatus == 4) {
statusText =S.of(context).yisongda;
statusText = S.of(context).yisongda;
}
}
break;

72
lib/order/store_selector_page.dart

@ -37,9 +37,10 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString('token')),
});
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), context: context, token: value.getString('token'));
});
if (aMapFlutterLocation == null) {
AMapFlutterLocation.setApiKey("f39d1daa020a56f208eb2519f63e9534",
@ -50,28 +51,31 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
event["latitude"] != null &&
event["longitude"] != null) {
print("location: $event");
aMapFlutterLocation.stopLocation();
if (event["latitude"] is String && event["longitude"] is String) {
latLng = LatLng(double.tryParse(event["latitude"]),
double.tryParse(event["longitude"]));
} else {
latLng = LatLng(event["latitude"], event["longitude"]);
}
if(Navigator.of(context).canPop()) {
if (Navigator.of(context).canPop()) {
Navigator.of(context).pop();
}
saveLatLng(latLng, event["province"], event["city"], event["district"]);
queryStore("${event["latitude"]}", "${event["longitude"]}", event["province"], event["city"], event["district"]);
saveLatLng(
latLng, event["province"], event["city"], event["district"]);
queryStore("${event["latitude"]}", "${event["longitude"]}",
event["province"], event["city"], event["district"]);
}
});
}
aMapFlutterLocation.setLocationOption(AMapLocationOption(
needAddress: true,
onceLocation: true,
locationInterval: 100000,
locationMode: AMapLocationMode.Hight_Accuracy,
desiredAccuracy: DesiredAccuracy.ThreeKilometers,
pausesLocationUpdatesAutomatically: true,
));
startLocation();
}
@ -112,9 +116,12 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
});
aMapFlutterLocation.startLocation();
} else {
await Permission.location.request();
startLocation();
getLatLng();
PermissionStatus permissionStatus = await Permission.location.request();
if (permissionStatus.isGranted) {
startLocation();
} else {
getLatLng();
}
}
} else {
//enabledLocation
@ -124,20 +131,27 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
getLatLng() async {
SharedPreferences.getInstance().then(
(value) => {
if (value.containsKey("latitude") && value.containsKey("longitude") && value.containsKey("province") && value.containsKey("city") && value.containsKey("district")) {
latLng = LatLng(double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude"))),
queryStore(
value.getString("latitude"),
value.getString("longitude"),
value.getString("province"),
value.getString("city"),
value.getString("district"),),
} else {
queryStore("", "", "", "", ""),
}
(value) => {
if (value.containsKey("latitude") &&
value.containsKey("longitude") &&
value.containsKey("province") &&
value.containsKey("city") &&
value.containsKey("district"))
{
latLng = LatLng(double.tryParse(value.getString("latitude")),
double.tryParse(value.getString("longitude"))),
queryStore(
value.getString("latitude"),
value.getString("longitude"),
value.getString("province"),
value.getString("city"),
value.getString("district"),
),
}
else
{
queryStore("", "", "", "", ""),
}
},
);
}
@ -151,12 +165,11 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
"province": province,
"searchKey": ""
});
if (baseData != null && baseData.isSuccess) {
storeList = (baseData.data as List<dynamic>)
.map((e) => Store.fromJson(e))
.toList();
setState(() {});
if (mounted) setState(() {});
} else {
Fluttertoast.showToast(msg: baseData.msg);
}
@ -216,7 +229,7 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
),
InkWell(
onTap: () {
if (groupValue == null || groupValue == 0) {
if (groupValue == null) {
Fluttertoast.showToast(msg: "请选择一个门店");
return;
}
@ -294,8 +307,9 @@ class _StoreSelectorPage extends State<StoreSelectorPage> {
height: 4,
),
IconText(
(store.openStartTime == null && store.openEndTime == null) ? "全天" :
"${store.openStartTime}-${store.openEndTime}",
(store.openStartTime == null && store.openEndTime == null)
? "全天"
: "${store.openStartTime}-${store.openEndTime}",
textStyle: TextStyle(color: Color(0xFF353535), fontSize: 14),
leftIcon: Icons.access_time,
iconColor: Color(0xFF32A060),

4
lib/retrofit/data/member_rank.dart

@ -1,8 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
part 'member_rank.g.dart';
@JsonSerializable()
class MemberRank {
MemberRank();

33
lib/retrofit/data/member_rank.g.dart

@ -1,33 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'member_rank.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
MemberRank _$MemberRankFromJson(Map<String, dynamic> json) {
return MemberRank()
..id = json['id'] as String
..nextId = json['nextId'] as String
..nextName = json['nextName'] as String
..nextOrigin = json['nextOrigin'] as int
..rankContent = json['rankContent'] as String
..rankImg = json['rankImg'] as String
..rankName = json['rankName'] as String
..rankOrigin = json['rankOrigin'] as int
..status = json['status'] as bool;
}
Map<String, dynamic> _$MemberRankToJson(MemberRank instance) =>
<String, dynamic>{
'id': instance.id,
'nextId': instance.nextId,
'nextName': instance.nextName,
'nextOrigin': instance.nextOrigin,
'rankContent': instance.rankContent,
'rankImg': instance.rankImg,
'rankName': instance.rankName,
'rankOrigin': instance.rankOrigin,
'status': instance.status,
};

38
lib/retrofit/data/page.dart

@ -1,17 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
/// pageNum : 1
/// pageSize : 10
/// size : 0
/// pages : 0
/// hasPreviousPage : false
/// hasNextPage : false
/// total : "0"
/// list : []
part 'page.g.dart';
@JsonSerializable()
class PageInfo {
PageInfo();
@ -27,6 +14,27 @@ class PageInfo {
List<dynamic> records;
factory PageInfo.fromJson(Map<String, dynamic> json) =>
_$PageInfoFromJson(json);
Map<String, dynamic> toJson() => _$PageInfoToJson(this);
PageInfo()
..pageNum = json['pageNum'] as int
..current = json['current']
..pageSize = json['pageSize'] as int
..size = json['size']
..pages = json['pages']
..hasPreviousPage = json['hasPreviousPage'] as bool
..hasNextPage = json['hasNextPage'] as bool
..total = json['total'] as String
..list = json['list'] as List
..records = json['records'] as List;
Map<String, dynamic> toJson() => <String, dynamic>{
'pageNum': this.pageNum,
'current': this.current,
'pageSize': this.pageSize,
'size': this.size,
'pages': this.pages,
'hasPreviousPage': this.hasPreviousPage,
'hasNextPage': this.hasNextPage,
'total': this.total,
'list': this.list,
'records': this.records,
};
}

34
lib/retrofit/data/page.g.dart

@ -1,34 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'page.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PageInfo _$PageInfoFromJson(Map<String, dynamic> json) {
return PageInfo()
..pageNum = json['pageNum'] as int
..current = json['current']
..pageSize = json['pageSize'] as int
..size = json['size']
..pages = json['pages']
..hasPreviousPage = json['hasPreviousPage'] as bool
..hasNextPage = json['hasNextPage'] as bool
..total = json['total'] as String
..list = json['list'] as List
..records = json['records'] as List;
}
Map<String, dynamic> _$PageInfoToJson(PageInfo instance) => <String, dynamic>{
'pageNum': instance.pageNum,
'current': instance.current,
'pageSize': instance.pageSize,
'size': instance.size,
'pages': instance.pages,
'hasPreviousPage': instance.hasPreviousPage,
'hasNextPage': instance.hasNextPage,
'total': instance.total,
'list': instance.list,
'records': instance.records,
};

59
lib/retrofit/data/promotion.dart

@ -1,8 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
part 'promotion.g.dart';
@JsonSerializable()
class Promotion {
String activityEndTime;
String activityStartTime;
@ -27,18 +23,63 @@ class Promotion {
Promotion({this.activityEndTime, this.activityStartTime, this.applyEndTime, this.applyStartTime, this.createTime, this.createUser, this.description, this.id, this.image, this.isDelete, this.isNeedSecurityDeposit, this.name, this.promotionDetail, this.promotionPlan, this.promotionType, this.securityDeposit, this.status, this.tag, this.updateTime, this.updateUser});
factory Promotion.fromJson(Map<String, dynamic> json) => _$PromotionFromJson(json);
factory Promotion.fromJson(Map<String, dynamic> json) => Promotion(
activityEndTime: json['activityEndTime'] as String,
activityStartTime: json['activityStartTime'] as String,
applyEndTime: json['applyEndTime'] as String,
applyStartTime: json['applyStartTime'] as String,
createTime: json['createTime'] as String,
createUser: json['createUser'] as String,
description: json['description'] as String,
id: json['id'] as String,
image: json['image'] as String,
isDelete: json['isDelete'] as num,
isNeedSecurityDeposit: json['isNeedSecurityDeposit'] as num,
name: json['name'] as String,
promotionDetail: (json['promotionDetail'] as List)
?.map((e) => e == null
? null
: PromotionDetailBean.fromJson(e as Map<String, dynamic>))
?.toList(),
promotionPlan: json['promotionPlan'] as num,
promotionType: json['promotionType'] as num,
securityDeposit: json['securityDeposit'] as String,
status: json['status'] as num,
tag: json['tag'] as String,
updateTime: json['updateTime'] as String,
updateUser: json['updateUser'] as String,
);
Map<String, dynamic> toJson() => _$PromotionToJson(this);
Map<String, dynamic> toJson() => <String, dynamic>{
'activityEndTime': this.activityEndTime,
'activityStartTime': this.activityStartTime,
'applyEndTime': this.applyEndTime,
'applyStartTime': this.applyStartTime,
'createTime': this.createTime,
'createUser': this.createUser,
'description': this.description,
'id': this.id,
'image': this.image,
'isDelete': this.isDelete,
'isNeedSecurityDeposit': this.isNeedSecurityDeposit,
'name': this.name,
'promotionDetail': this.promotionDetail,
'promotionPlan': this.promotionPlan,
'promotionType': this.promotionType,
'securityDeposit': this.securityDeposit,
'status': this.status,
'tag': this.tag,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
};
}
@JsonSerializable()
class PromotionDetailBean {
PromotionDetailBean();
factory PromotionDetailBean.fromJson(Map<String, dynamic> json) => _$PromotionDetailBeanFromJson(json);
factory PromotionDetailBean.fromJson(Map<String, dynamic> json) => PromotionDetailBean();
Map<String, dynamic> toJson() => _$PromotionDetailBeanToJson(this);
Map<String, dynamic> toJson() => <String, dynamic>{};
}

67
lib/retrofit/data/promotion.g.dart

@ -1,67 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'promotion.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Promotion _$PromotionFromJson(Map<String, dynamic> json) {
return Promotion(
activityEndTime: json['activityEndTime'] as String,
activityStartTime: json['activityStartTime'] as String,
applyEndTime: json['applyEndTime'] as String,
applyStartTime: json['applyStartTime'] as String,
createTime: json['createTime'] as String,
createUser: json['createUser'] as String,
description: json['description'] as String,
id: json['id'] as String,
image: json['image'] as String,
isDelete: json['isDelete'] as num,
isNeedSecurityDeposit: json['isNeedSecurityDeposit'] as num,
name: json['name'] as String,
promotionDetail: (json['promotionDetail'] as List)
?.map((e) => e == null
? null
: PromotionDetailBean.fromJson(e as Map<String, dynamic>))
?.toList(),
promotionPlan: json['promotionPlan'] as num,
promotionType: json['promotionType'] as num,
securityDeposit: json['securityDeposit'] as String,
status: json['status'] as num,
tag: json['tag'] as String,
updateTime: json['updateTime'] as String,
updateUser: json['updateUser'] as String,
);
}
Map<String, dynamic> _$PromotionToJson(Promotion instance) => <String, dynamic>{
'activityEndTime': instance.activityEndTime,
'activityStartTime': instance.activityStartTime,
'applyEndTime': instance.applyEndTime,
'applyStartTime': instance.applyStartTime,
'createTime': instance.createTime,
'createUser': instance.createUser,
'description': instance.description,
'id': instance.id,
'image': instance.image,
'isDelete': instance.isDelete,
'isNeedSecurityDeposit': instance.isNeedSecurityDeposit,
'name': instance.name,
'promotionDetail': instance.promotionDetail,
'promotionPlan': instance.promotionPlan,
'promotionType': instance.promotionType,
'securityDeposit': instance.securityDeposit,
'status': instance.status,
'tag': instance.tag,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
};
PromotionDetailBean _$PromotionDetailBeanFromJson(Map<String, dynamic> json) {
return PromotionDetailBean();
}
Map<String, dynamic> _$PromotionDetailBeanToJson(
PromotionDetailBean instance) =>
<String, dynamic>{};

61
lib/retrofit/data/sign_in.dart

@ -1,28 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
/// balance : 0
/// category : ""
/// createTime : ""
/// createUser : 0
/// id : 0
/// isDeleted : true
/// linkId : ""
/// mark : ""
/// mid : 0
/// number : 0
/// pm : 0
/// status : true
/// title : ""
/// type : ""
/// updateTime : ""
/// updateUser : 0
part 'sign_in.g.dart';
//{"id":"1408358594532868096","createTime":"2021-06-25 17:37:10","createUser":"1405494095400402944",
// "updateTime":"2021-06-25 17:37:10","updateUser":"1405494095400402944","mid":"1405494095400402944",
// "linkId":"0","pm":1,"title":"bill_title_point","category":"bill_cate_point_get",
// "type":"bill_type_point_signin","number":"10.00","balance":"20.00","mark":"",
// "status":true,"isDeleted":false}
@JsonSerializable()
class SignIn {
SignIn();
String balance;
@ -42,7 +18,40 @@ class SignIn {
String updateTime;
String updateUser;
factory SignIn.fromJson(Map<String, dynamic> json) => _$SignInFromJson(json);
Map<String, dynamic> toJson() => _$SignInToJson(this);
factory SignIn.fromJson(Map<String, dynamic> json) => SignIn()
..balance = json['balance'] as String
..category = json['category'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..id = json['id'] as String
..isDeleted = json['isDeleted'] as bool
..linkId = json['linkId'] as String
..mark = json['mark'] as String
..mid = json['mid'] as String
..number = json['number'] as String
..pm = json['pm'] as int
..status = json['status'] as bool
..title = json['title'] as String
..type = json['type'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String;
Map<String, dynamic> toJson() => <String, dynamic>{
'balance': this.balance,
'category': this.category,
'createTime': this.createTime,
'createUser': this.createUser,
'id': this.id,
'isDeleted': this.isDeleted,
'linkId': this.linkId,
'mark': this.mark,
'mid': this.mid,
'number': this.number,
'pm': this.pm,
'status': this.status,
'title': this.title,
'type': this.type,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
};
}

46
lib/retrofit/data/sign_in.g.dart

@ -1,46 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'sign_in.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SignIn _$SignInFromJson(Map<String, dynamic> json) {
return SignIn()
..balance = json['balance'] as String
..category = json['category'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..id = json['id'] as String
..isDeleted = json['isDeleted'] as bool
..linkId = json['linkId'] as String
..mark = json['mark'] as String
..mid = json['mid'] as String
..number = json['number'] as String
..pm = json['pm'] as int
..status = json['status'] as bool
..title = json['title'] as String
..type = json['type'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String;
}
Map<String, dynamic> _$SignInToJson(SignIn instance) => <String, dynamic>{
'balance': instance.balance,
'category': instance.category,
'createTime': instance.createTime,
'createUser': instance.createUser,
'id': instance.id,
'isDeleted': instance.isDeleted,
'linkId': instance.linkId,
'mark': instance.mark,
'mid': instance.mid,
'number': instance.number,
'pm': instance.pm,
'status': instance.status,
'title': instance.title,
'type': instance.type,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
};

29
lib/retrofit/data/sign_info.dart

@ -1,11 +1,7 @@
import 'package:huixiang/retrofit/data/member_rank.dart';
import 'package:huixiang/retrofit/data/sign_in.dart';
import 'package:huixiang/retrofit/data/task.dart';
import 'package:json_annotation/json_annotation.dart';
part 'sign_info.g.dart';
@JsonSerializable()
class SignInfo {
SignInfo();
String point;
@ -15,8 +11,29 @@ class SignInfo {
List<Task> taskList;
List<int> rewardList;
factory SignInfo.fromJson(Map<String, dynamic> json) => _$SignInfoFromJson(json);
Map<String, dynamic> toJson() => _$SignInfoToJson(this);
factory SignInfo.fromJson(Map<String, dynamic> json) => SignInfo()
..point = json['point'] as String
..todayHasSignin = json['todayHasSignin'] as bool
..rank = json['rank'] == null
? null
: MemberRank.fromJson(json['rank'] as Map<String, dynamic>)
..signInList = (json['signInList'] as List)
?.map((e) =>
e == null ? null : SignIn.fromJson(e as Map<String, dynamic>))
?.toList()
..taskList = (json['taskList'] as List)
?.map(
(e) => e == null ? null : Task.fromJson(e as Map<String, dynamic>))
?.toList()
..rewardList = (json['rewardList'] as List)?.map((e) => e as int)?.toList();
Map<String, dynamic> toJson() => <String, dynamic>{
'point': this.point,
'todayHasSignin': this.todayHasSignin,
'rank': this.rank,
'signInList': this.signInList,
'taskList': this.taskList,
'rewardList': this.rewardList,
};
}

34
lib/retrofit/data/sign_info.g.dart

@ -1,34 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'sign_info.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SignInfo _$SignInfoFromJson(Map<String, dynamic> json) {
return SignInfo()
..point = json['point'] as String
..todayHasSignin = json['todayHasSignin'] as bool
..rank = json['rank'] == null
? null
: MemberRank.fromJson(json['rank'] as Map<String, dynamic>)
..signInList = (json['signInList'] as List)
?.map((e) =>
e == null ? null : SignIn.fromJson(e as Map<String, dynamic>))
?.toList()
..taskList = (json['taskList'] as List)
?.map(
(e) => e == null ? null : Task.fromJson(e as Map<String, dynamic>))
?.toList()
..rewardList = (json['rewardList'] as List)?.map((e) => e as int)?.toList();
}
Map<String, dynamic> _$SignInfoToJson(SignInfo instance) => <String, dynamic>{
'point': instance.point,
'todayHasSignin': instance.todayHasSignin,
'rank': instance.rank,
'signInList': instance.signInList,
'taskList': instance.taskList,
'rewardList': instance.rewardList,
};

74
lib/retrofit/data/store.dart

@ -1,11 +1,6 @@
import 'package:huixiang/retrofit/data/store_type.dart';
import 'package:json_annotation/json_annotation.dart';
part 'store.g.dart';
@JsonSerializable()
class Store {
Store();
@ -41,7 +36,72 @@ class Store {
String businessType;
StoreType posType;
factory Store.fromJson(Map<String, dynamic> json) => _$StoreFromJson(json);
Map<String, dynamic> toJson() => _$StoreToJson(this);
factory Store.fromJson(Map<String, dynamic> json) => Store()
..id = json['id'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
..tenantCode = json['tenantCode'] as String
..useErp = json['useErp'] as bool
..openStartTime = json['openStartTime'] as String
..openEndTime = json['openEndTime'] as String
..perCapitaConsumption = json['perCapitaConsumption'] as String
..storeName = json['storeName'] as String
..distance = (json['distance'] as num)?.toDouble()
..logo = json['logo'] as String
..shipAddress = json['shipAddress'] as String
..remark = json['remark']
..mobile = json['mobile'] as String
..longitude = json['longitude'] as String
..latitude = json['latitude'] as String
..refundAddress = json['refundAddress']
..refundTel = json['refundTel']
..refundContact = json['refundContact']
..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as int
..province = json['province'] as String
..city = json['city'] as String
..district = json['district'] as String
..address = json['address'] as String
..headName = json['headName'] as String
..headMobile = json['headMobile'] as String
..deliveryInfo = json['deliveryInfo']
..businessType = json['businessType'] as String
..posType = json['posType'] == null
? null
: StoreType.fromJson(json['posType'] as Map<String, dynamic>);
Map<String, dynamic> toJson() => <String, dynamic>{
'id': this.id,
'createTime': this.createTime,
'createUser': this.createUser,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
'tenantCode': this.tenantCode,
'useErp': this.useErp,
'openStartTime': this.openStartTime,
'openEndTime': this.openEndTime,
'perCapitaConsumption': this.perCapitaConsumption,
'storeName': this.storeName,
'distance': this.distance,
'logo': this.logo,
'shipAddress': this.shipAddress,
'remark': this.remark,
'mobile': this.mobile,
'longitude': this.longitude,
'latitude': this.latitude,
'refundAddress': this.refundAddress,
'refundTel': this.refundTel,
'refundContact': this.refundContact,
'isAutoSendRefundAddress': this.isAutoSendRefundAddress,
'province': this.province,
'city': this.city,
'district': this.district,
'address': this.address,
'headName': this.headName,
'headMobile': this.headMobile,
'deliveryInfo': this.deliveryInfo,
'businessType': this.businessType,
'posType': this.posType,
};
}

78
lib/retrofit/data/store.g.dart

@ -1,78 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'store.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Store _$StoreFromJson(Map<String, dynamic> json) {
return Store()
..id = json['id'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
..tenantCode = json['tenantCode'] as String
..useErp = json['useErp'] as bool
..openStartTime = json['openStartTime'] as String
..openEndTime = json['openEndTime'] as String
..perCapitaConsumption = json['perCapitaConsumption'] as String
..storeName = json['storeName'] as String
..distance = (json['distance'] as num)?.toDouble()
..logo = json['logo'] as String
..shipAddress = json['shipAddress'] as String
..remark = json['remark']
..mobile = json['mobile'] as String
..longitude = json['longitude'] as String
..latitude = json['latitude'] as String
..refundAddress = json['refundAddress']
..refundTel = json['refundTel']
..refundContact = json['refundContact']
..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as int
..province = json['province'] as String
..city = json['city'] as String
..district = json['district'] as String
..address = json['address'] as String
..headName = json['headName'] as String
..headMobile = json['headMobile'] as String
..deliveryInfo = json['deliveryInfo']
..businessType = json['businessType'] as String
..posType = json['posType'] == null
? null
: StoreType.fromJson(json['posType'] as Map<String, dynamic>);
}
Map<String, dynamic> _$StoreToJson(Store instance) => <String, dynamic>{
'id': instance.id,
'createTime': instance.createTime,
'createUser': instance.createUser,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'tenantCode': instance.tenantCode,
'useErp': instance.useErp,
'openStartTime': instance.openStartTime,
'openEndTime': instance.openEndTime,
'perCapitaConsumption': instance.perCapitaConsumption,
'storeName': instance.storeName,
'distance': instance.distance,
'logo': instance.logo,
'shipAddress': instance.shipAddress,
'remark': instance.remark,
'mobile': instance.mobile,
'longitude': instance.longitude,
'latitude': instance.latitude,
'refundAddress': instance.refundAddress,
'refundTel': instance.refundTel,
'refundContact': instance.refundContact,
'isAutoSendRefundAddress': instance.isAutoSendRefundAddress,
'province': instance.province,
'city': instance.city,
'district': instance.district,
'address': instance.address,
'headName': instance.headName,
'headMobile': instance.headMobile,
'deliveryInfo': instance.deliveryInfo,
'businessType': instance.businessType,
'posType': instance.posType,
};

90
lib/retrofit/data/store_info.dart

@ -4,11 +4,7 @@ import 'package:huixiang/retrofit/data/delivery_info.dart';
import 'package:huixiang/retrofit/data/promotion.dart';
import 'package:huixiang/retrofit/data/store_type.dart';
import 'package:huixiang/retrofit/data/mini.dart';
import 'package:json_annotation/json_annotation.dart';
part 'store_info.g.dart';
@JsonSerializable()
class StoreInfo {
String address;
List<BannerData> bannerList;
@ -47,7 +43,89 @@ class StoreInfo {
StoreInfo();
factory StoreInfo.fromJson(Map<String, dynamic> json) => _$StoreInfoFromJson(json);
factory StoreInfo.fromJson(Map<String, dynamic> json) => StoreInfo()
..address = json['address'] as String
..bannerList = (json['bannerList'] as List)
?.map((e) =>
e == null ? null : BannerData.fromJson(e as Map<String, dynamic>))
?.toList()
..city = json['city'] as String
..couponVOList = (json['couponVOList'] as List)
?.map((e) =>
e == null ? null : CouponVo.fromJson(e as Map<String, dynamic>))
?.toList()
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..deliveryInfo = json['deliveryInfo'] == null
? null
: DeliveryInfo.fromJson(json['deliveryInfo'] as Map<String, dynamic>)
..district = json['district'] as String
..headMobile = json['headMobile'] as String
..headName = json['headName'] as String
..id = json['id'] as String
..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as num
..latitude = json['latitude'] as String
..logo = json['logo'] as String
..longitude = json['longitude'] as String
..mobile = json['mobile'] as String
..openEndTime = json['openEndTime'] as String
..openStartTime = json['openStartTime'] as String
..perCapitaConsumption = json['perCapitaConsumption'] as String
..posType = json['posType'] == null
? null
: StoreType.fromJson(json['posType'] as Map<String, dynamic>)
..promotionList = (json['promotionList'] as List)
?.map((e) =>
e == null ? null : Promotion.fromJson(e as Map<String, dynamic>))
?.toList()
..province = json['province'] as String
..refundAddress = json['refundAddress'] as String
..refundContact = json['refundContact'] as String
..refundTel = json['refundTel'] as String
..remark = json['remark'] as String
..shipAddress = json['shipAddress'] as String
..storeName = json['storeName'] as String
..tenantCode = json['tenantCode'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
..businessService = json['businessService'] as String
..mini = json['mini'] == null ? null : Mini.fromJson(json['mini'])
..useErp = json['useErp'] as bool;
Map<String, dynamic> toJson() => _$StoreInfoToJson(this);
Map<String, dynamic> toJson() => <String, dynamic>{
'address': this.address,
'bannerList': this.bannerList.map((e) => e.toJson()).toList(),
'city': this.city,
'couponVOList': this.couponVOList,
'createTime': this.createTime,
'createUser': this.createUser,
'deliveryInfo': this.deliveryInfo.toJson(),
'district': this.district,
'headMobile': this.headMobile,
'headName': this.headName,
'id': this.id,
'isAutoSendRefundAddress': this.isAutoSendRefundAddress,
'latitude': this.latitude,
'logo': this.logo,
'longitude': this.longitude,
'mobile': this.mobile,
'openEndTime': this.openEndTime,
'openStartTime': this.openStartTime,
'perCapitaConsumption': this.perCapitaConsumption,
'posType': this.posType.toJson(),
'promotionList': this.promotionList.map((e) => e.toJson()).toList(),
'province': this.province,
'refundAddress': this.refundAddress,
'refundContact': this.refundContact,
'refundTel': this.refundTel,
'remark': this.remark,
'shipAddress': this.shipAddress,
'storeName': this.storeName,
'tenantCode': this.tenantCode,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
'businessService': this.businessService,
'mini': this.mini.toJson(),
'useErp': this.useErp,
};
}

95
lib/retrofit/data/store_info.g.dart

@ -1,95 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'store_info.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
StoreInfo _$StoreInfoFromJson(Map<String, dynamic> json) {
return StoreInfo()
..address = json['address'] as String
..bannerList = (json['bannerList'] as List)
?.map((e) =>
e == null ? null : BannerData.fromJson(e as Map<String, dynamic>))
?.toList()
..city = json['city'] as String
..couponVOList = (json['couponVOList'] as List)
?.map((e) =>
e == null ? null : CouponVo.fromJson(e as Map<String, dynamic>))
?.toList()
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..deliveryInfo = json['deliveryInfo'] == null
? null
: DeliveryInfo.fromJson(json['deliveryInfo'] as Map<String, dynamic>)
..district = json['district'] as String
..headMobile = json['headMobile'] as String
..headName = json['headName'] as String
..id = json['id'] as String
..isAutoSendRefundAddress = json['isAutoSendRefundAddress'] as num
..latitude = json['latitude'] as String
..logo = json['logo'] as String
..longitude = json['longitude'] as String
..mobile = json['mobile'] as String
..openEndTime = json['openEndTime'] as String
..openStartTime = json['openStartTime'] as String
..perCapitaConsumption = json['perCapitaConsumption'] as String
..posType = json['posType'] == null
? null
: StoreType.fromJson(json['posType'] as Map<String, dynamic>)
..promotionList = (json['promotionList'] as List)
?.map((e) =>
e == null ? null : Promotion.fromJson(e as Map<String, dynamic>))
?.toList()
..province = json['province'] as String
..refundAddress = json['refundAddress'] as String
..refundContact = json['refundContact'] as String
..refundTel = json['refundTel'] as String
..remark = json['remark'] as String
..shipAddress = json['shipAddress'] as String
..storeName = json['storeName'] as String
..tenantCode = json['tenantCode'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
..businessService = json['businessService'] as String
..mini = json['mini'] == null ? null : Mini.fromJson(json['mini'])
..useErp = json['useErp'] as bool;
}
Map<String, dynamic> _$StoreInfoToJson(StoreInfo instance) => <String, dynamic>{
'address': instance.address,
'bannerList': instance.bannerList,
'city': instance.city,
'couponVOList': instance.couponVOList,
'createTime': instance.createTime,
'createUser': instance.createUser,
'deliveryInfo': instance.deliveryInfo,
'district': instance.district,
'headMobile': instance.headMobile,
'headName': instance.headName,
'id': instance.id,
'isAutoSendRefundAddress': instance.isAutoSendRefundAddress,
'latitude': instance.latitude,
'logo': instance.logo,
'longitude': instance.longitude,
'mobile': instance.mobile,
'openEndTime': instance.openEndTime,
'openStartTime': instance.openStartTime,
'perCapitaConsumption': instance.perCapitaConsumption,
'posType': instance.posType,
'promotionList': instance.promotionList,
'province': instance.province,
'refundAddress': instance.refundAddress,
'refundContact': instance.refundContact,
'refundTel': instance.refundTel,
'remark': instance.remark,
'shipAddress': instance.shipAddress,
'storeName': instance.storeName,
'tenantCode': instance.tenantCode,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'businessService': instance.businessService,
'mini': instance.mini,
'useErp': instance.useErp,
};

13
lib/retrofit/data/store_type.dart

@ -1,15 +1,16 @@
import 'package:json_annotation/json_annotation.dart';
part 'store_type.g.dart';
@JsonSerializable()
class StoreType {
StoreType();
String desc;
String code;
factory StoreType.fromJson(Map<String, dynamic> json) => _$StoreTypeFromJson(json);
Map<String, dynamic> toJson() => _$StoreTypeToJson(this);
factory StoreType.fromJson(Map<String, dynamic> json) => StoreType()
..desc = json['desc'] as String
..code = json['code'] as String;
Map<String, dynamic> toJson() => <String, dynamic>{
'desc': this.desc,
'code': this.code,
};
}

18
lib/retrofit/data/store_type.g.dart

@ -1,18 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'store_type.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
StoreType _$StoreTypeFromJson(Map<String, dynamic> json) {
return StoreType()
..desc = json['desc'] as String
..code = json['code'] as String;
}
Map<String, dynamic> _$StoreTypeToJson(StoreType instance) => <String, dynamic>{
'desc': instance.desc,
'code': instance.code,
};

38
lib/retrofit/data/task.dart

@ -1,9 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
part 'task.g.dart';
@JsonSerializable()
class Task {
Task();
String aspects;
@ -21,7 +16,36 @@ class Task {
String updateTime;
String updateUser;
factory Task.fromJson(Map<String, dynamic> json) => _$TaskFromJson(json);
Map<String, dynamic> toJson() => _$TaskToJson(this);
factory Task.fromJson(Map<String, dynamic> json) => Task()
..aspects = json['aspects'] as String
..complateNum = json['complateNum'] as int
..conplateNum = json['conplateNum'] as int
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..id = json['id'] as String
..limitDay = json['limitDay'] as int
..name = json['name'] as String
..rewardType = json['rewardType'] as int
..rewardValue = json['rewardValue'] as String
..status = json['status'] as bool
..type = json['type'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String;
Map<String, dynamic> toJson() => <String, dynamic>{
'aspects': this.aspects,
'complateNum': this.complateNum,
'conplateNum': this.conplateNum,
'createTime': this.createTime,
'createUser': this.createUser,
'id': this.id,
'limitDay': this.limitDay,
'name': this.name,
'rewardType': this.rewardType,
'rewardValue': this.rewardValue,
'status': this.status,
'type': this.type,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
};
}

42
lib/retrofit/data/task.g.dart

@ -1,42 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'task.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Task _$TaskFromJson(Map<String, dynamic> json) {
return Task()
..aspects = json['aspects'] as String
..complateNum = json['complateNum'] as int
..conplateNum = json['conplateNum'] as int
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..id = json['id'] as String
..limitDay = json['limitDay'] as int
..name = json['name'] as String
..rewardType = json['rewardType'] as int
..rewardValue = json['rewardValue'] as String
..status = json['status'] as bool
..type = json['type'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String;
}
Map<String, dynamic> _$TaskToJson(Task instance) => <String, dynamic>{
'aspects': instance.aspects,
'complateNum': instance.complateNum,
'conplateNum': instance.conplateNum,
'createTime': instance.createTime,
'createUser': instance.createUser,
'id': instance.id,
'limitDay': instance.limitDay,
'name': instance.name,
'rewardType': instance.rewardType,
'rewardValue': instance.rewardValue,
'status': instance.status,
'type': instance.type,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
};

88
lib/retrofit/data/upload_result.dart

@ -1,35 +1,5 @@
import 'package:huixiang/retrofit/data/data_type.dart';
import 'package:json_annotation/json_annotation.dart';
/// id : "1408344470671327232"
/// createTime : "2021-06-25 16:41:02"
/// createUser : "1405494095400402944"
/// updateTime : "2021-06-25 16:41:02"
/// updateUser : "1405494095400402944"
/// dataType : {"desc":"其他","code":"OTHER"}
/// submittedFileName : "image_picker_E8FC145E-9E67-4C1A-93D7-CB0620BCB59E-43438-000017700F6A34FC.jpg"
/// treePath : ","
/// grade : 1
/// isDelete : false
/// folderId : "1231312123"
/// url : "https://pos.upload.gznl.top/admin/2021/06/f09216ed-a4ab-4a8d-87ac-4a74fb519a54.jpg"
/// size : "9604853"
/// folderName : ""
/// group : null
/// path : "admin/2021/06"
/// relativePath : "admin/2021/06"
/// fileMd5 : null
/// contextType : "application/octet-stream"
/// filename : "f09216ed-a4ab-4a8d-87ac-4a74fb519a54.jpg"
/// ext : "jpg"
/// icon : "el-icon-picture"
/// createMonth : "2021年06月"
/// createWeek : "2021年26周"
/// createDay : "2021年06月25日"
part 'upload_result.g.dart';
@JsonSerializable()
class UploadResult {
UploadResult();
String id;
@ -58,8 +28,60 @@ class UploadResult {
String createWeek;
String createDay;
factory UploadResult.fromJson(Map<String, dynamic> json) =>
_$UploadResultFromJson(json);
Map<String, dynamic> toJson() => _$UploadResultToJson(this);
factory UploadResult.fromJson(Map<String, dynamic> json) => UploadResult()
..id = json['id'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
..dataType = json['dataType'] == null
? null
: DataType.fromJson(json['dataType'] as Map<String, dynamic>)
..submittedFileName = json['submittedFileName'] as String
..treePath = json['treePath'] as String
..grade = json['grade'] as int
..isDelete = json['isDelete'] as bool
..folderId = json['folderId'] as String
..url = json['url'] as String
..size = json['size'] as String
..folderName = json['folderName'] as String
..group = json['group']
..path = json['path'] as String
..relativePath = json['relativePath'] as String
..fileMd5 = json['fileMd5']
..contextType = json['contextType'] as String
..filename = json['filename'] as String
..ext = json['ext'] as String
..icon = json['icon'] as String
..createMonth = json['createMonth'] as String
..createWeek = json['createWeek'] as String
..createDay = json['createDay'] as String;
Map<String, dynamic> toJson() => <String, dynamic>{
'id': this.id,
'createTime': this.createTime,
'createUser': this.createUser,
'updateTime': this.updateTime,
'updateUser': this.updateUser,
'dataType': this.dataType.toJson(),
'submittedFileName': this.submittedFileName,
'treePath': this.treePath,
'grade': this.grade,
'isDelete': this.isDelete,
'folderId': this.folderId,
'url': this.url,
'size': this.size,
'folderName': this.folderName,
'group': this.group,
'path': this.path,
'relativePath': this.relativePath,
'fileMd5': this.fileMd5,
'contextType': this.contextType,
'filename': this.filename,
'ext': this.ext,
'icon': this.icon,
'createMonth': this.createMonth,
'createWeek': this.createWeek,
'createDay': this.createDay,
};
}

67
lib/retrofit/data/upload_result.g.dart

@ -1,67 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'upload_result.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
UploadResult _$UploadResultFromJson(Map<String, dynamic> json) {
return UploadResult()
..id = json['id'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser'] as String
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser'] as String
..dataType = json['dataType'] == null
? null
: DataType.fromJson(json['dataType'] as Map<String, dynamic>)
..submittedFileName = json['submittedFileName'] as String
..treePath = json['treePath'] as String
..grade = json['grade'] as int
..isDelete = json['isDelete'] as bool
..folderId = json['folderId'] as String
..url = json['url'] as String
..size = json['size'] as String
..folderName = json['folderName'] as String
..group = json['group']
..path = json['path'] as String
..relativePath = json['relativePath'] as String
..fileMd5 = json['fileMd5']
..contextType = json['contextType'] as String
..filename = json['filename'] as String
..ext = json['ext'] as String
..icon = json['icon'] as String
..createMonth = json['createMonth'] as String
..createWeek = json['createWeek'] as String
..createDay = json['createDay'] as String;
}
Map<String, dynamic> _$UploadResultToJson(UploadResult instance) =>
<String, dynamic>{
'id': instance.id,
'createTime': instance.createTime,
'createUser': instance.createUser,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'dataType': instance.dataType,
'submittedFileName': instance.submittedFileName,
'treePath': instance.treePath,
'grade': instance.grade,
'isDelete': instance.isDelete,
'folderId': instance.folderId,
'url': instance.url,
'size': instance.size,
'folderName': instance.folderName,
'group': instance.group,
'path': instance.path,
'relativePath': instance.relativePath,
'fileMd5': instance.fileMd5,
'contextType': instance.contextType,
'filename': instance.filename,
'ext': instance.ext,
'icon': instance.icon,
'createMonth': instance.createMonth,
'createWeek': instance.createWeek,
'createDay': instance.createDay,
};

33
lib/retrofit/data/user_entity.dart

@ -1,8 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
part 'user_entity.g.dart';
@JsonSerializable()
class UserEntity {
UserEntity();
@ -20,7 +16,32 @@ class UserEntity {
String workDescribe;
factory UserEntity.fromJson(Map<String, dynamic> json) => _$UserEntityFromJson(json);
Map<String, dynamic> toJson() => _$UserEntityToJson(this);
factory UserEntity.fromJson(Map<String, dynamic> json) => UserEntity()
..account = json['account'] as String
..avatar = json['avatar'] as String
..expiration = json['expiration'] as String
..expire = json['expire'] as String
..mobile = json['mobile'] as String
..name = json['name'] as String
..refreshToken = json['refreshToken'] as String
..token = json['token'] as String
..tokenType = json['tokenType'] as String
..userId = json['userId'] as String
..userType = json['userType'] as String
..workDescribe = json['workDescribe'] as String;
Map<String, dynamic> toJson() => <String, dynamic>{
'account': this.account,
'avatar': this.avatar,
'expiration': this.expiration,
'expire': this.expire,
'mobile': this.mobile,
'name': this.name,
'refreshToken': this.refreshToken,
'token': this.token,
'tokenType': this.tokenType,
'userId': this.userId,
'userType': this.userType,
'workDescribe': this.workDescribe,
};
}

39
lib/retrofit/data/user_entity.g.dart

@ -1,39 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_entity.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
UserEntity _$UserEntityFromJson(Map<String, dynamic> json) {
return UserEntity()
..account = json['account'] as String
..avatar = json['avatar'] as String
..expiration = json['expiration'] as String
..expire = json['expire'] as String
..mobile = json['mobile'] as String
..name = json['name'] as String
..refreshToken = json['refreshToken'] as String
..token = json['token'] as String
..tokenType = json['tokenType'] as String
..userId = json['userId'] as String
..userType = json['userType'] as String
..workDescribe = json['workDescribe'] as String;
}
Map<String, dynamic> _$UserEntityToJson(UserEntity instance) =>
<String, dynamic>{
'account': instance.account,
'avatar': instance.avatar,
'expiration': instance.expiration,
'expire': instance.expire,
'mobile': instance.mobile,
'name': instance.name,
'refreshToken': instance.refreshToken,
'token': instance.token,
'tokenType': instance.tokenType,
'userId': instance.userId,
'userType': instance.userType,
'workDescribe': instance.workDescribe,
};

53
lib/retrofit/data/user_info.dart

@ -15,22 +15,10 @@
/// isBind : null
/// memberRankVo : null
import 'package:huixiang/retrofit/data/member_rank.dart';
import 'package:json_annotation/json_annotation.dart';
part 'user_info.g.dart';
@JsonSerializable()
class UserInfo {
UserInfo();
//{"vipNo":"1405494095400402944","nickname":"回乡_888888",
//"headimg":"https://pos.upload.gznl.top/admin/2021/06/6a292087-79fa-4c2b-91a9-db89eb190c27.jpg",
//"userType":true,"sex":"","level":1,"addressId":"0","remark":"",
//"phone":"13800138000","createTime":"2021-06-17 19:54:40",
//"birth":"1994-06-25","balance":null,"money":"0.00","points":"30",
//"isBind":true,"memberRankVo":{"id":"1402563734810918912",
//"rankName":"青铜会员","rankOrigin":88,"rankContent":"","rankImg":"",
//"status":true,"nextId":"1402815061684125696",
//"nextName":"白银会员","nextOrigin":null}
String vipNo;
String nickname;
String headimg;
@ -49,6 +37,41 @@ class UserInfo {
MemberRank memberRankVo;
factory UserInfo.fromJson(Map<String, dynamic> json) =>
_$UserInfoFromJson(json);
Map<String, dynamic> toJson() => _$UserInfoToJson(this);
UserInfo()
..vipNo = json['vipNo'] as String
..nickname = json['nickname'] as String
..headimg = json['headimg'] as String
..userType = json['userType'] as bool
..sex = json['sex'] as String
..level = json['level'] as int
..addressId = json['addressId'] as String
..remark = json['remark'] as String
..phone = json['phone'] as String
..createTime = json['createTime'] as String
..birth = json['birth'] as String
..balance = json['balance']
..money = json['money'] as String
..points = json['points'] as String
..isBind = json['isBind'] as bool
..memberRankVo = json['memberRankVo'] == null
? null
: MemberRank.fromJson(json['memberRankVo'] as Map<String, dynamic>);
Map<String, dynamic> toJson() => <String, dynamic>{
'vipNo': this.vipNo,
'nickname': this.nickname,
'headimg': this.headimg,
'userType': this.userType,
'sex': this.sex,
'level': this.level,
'addressId': this.addressId,
'remark': this.remark,
'phone': this.phone,
'createTime': this.createTime,
'birth': this.birth,
'balance': this.balance,
'money': this.money,
'points': this.points,
'isBind': this.isBind,
'memberRankVo': this.memberRankVo.toJson(),
};
}

48
lib/retrofit/data/user_info.g.dart

@ -1,48 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_info.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
UserInfo _$UserInfoFromJson(Map<String, dynamic> json) {
return UserInfo()
..vipNo = json['vipNo'] as String
..nickname = json['nickname'] as String
..headimg = json['headimg'] as String
..userType = json['userType'] as bool
..sex = json['sex'] as String
..level = json['level'] as int
..addressId = json['addressId'] as String
..remark = json['remark'] as String
..phone = json['phone'] as String
..createTime = json['createTime'] as String
..birth = json['birth'] as String
..balance = json['balance']
..money = json['money'] as String
..points = json['points'] as String
..isBind = json['isBind'] as bool
..memberRankVo = json['memberRankVo'] == null
? null
: MemberRank.fromJson(json['memberRankVo'] as Map<String, dynamic>);
}
Map<String, dynamic> _$UserInfoToJson(UserInfo instance) => <String, dynamic>{
'vipNo': instance.vipNo,
'nickname': instance.nickname,
'headimg': instance.headimg,
'userType': instance.userType,
'sex': instance.sex,
'level': instance.level,
'addressId': instance.addressId,
'remark': instance.remark,
'phone': instance.phone,
'createTime': instance.createTime,
'birth': instance.birth,
'balance': instance.balance,
'money': instance.money,
'points': instance.points,
'isBind': instance.isBind,
'memberRankVo': instance.memberRankVo,
};

27
lib/retrofit/data/verify_code.dart

@ -1,8 +1,4 @@
import 'package:json_annotation/json_annotation.dart';
part 'verify_code.g.dart';
@JsonSerializable()
class VerifyCode {
VerifyCode();
int code;
@ -14,8 +10,27 @@ class VerifyCode {
String path;
String timestamp;
factory VerifyCode.fromJson(Map<String, dynamic> json) => _$VerifyCodeFromJson(json);
Map<String, dynamic> toJson() => _$VerifyCodeToJson(this);
factory VerifyCode.fromJson(Map<String, dynamic> json) => VerifyCode()
..code = json['code'] as int
..data = json['data'] as Map<String, dynamic>
..extra = json['extra'] == null
? null
: BaseDataExtra.fromJson(json['extra'] as Map<String, dynamic>)
..isError = json['isError'] as bool
..isSuccess = json['isSuccess'] as bool
..msg = json['msg'] as String
..path = json['path'] as String
..timestamp = json['timestamp'] as String;
Map<String, dynamic> toJson() => <String, dynamic>{
'code': this.code,
'data': this.data,
'extra': this.extra,
'isError': this.isError,
'isSuccess': this.isSuccess,
'msg': this.msg,
'path': this.path,
'timestamp': this.timestamp,
};
}
class BaseDataExtra {

33
lib/retrofit/data/verify_code.g.dart

@ -1,33 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'verify_code.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
VerifyCode _$VerifyCodeFromJson(Map<String, dynamic> json) {
return VerifyCode()
..code = json['code'] as int
..data = json['data'] as Map<String, dynamic>
..extra = json['extra'] == null
? null
: BaseDataExtra.fromJson(json['extra'] as Map<String, dynamic>)
..isError = json['isError'] as bool
..isSuccess = json['isSuccess'] as bool
..msg = json['msg'] as String
..path = json['path'] as String
..timestamp = json['timestamp'] as String;
}
Map<String, dynamic> _$VerifyCodeToJson(VerifyCode instance) =>
<String, dynamic>{
'code': instance.code,
'data': instance.data,
'extra': instance.extra,
'isError': instance.isError,
'isSuccess': instance.isSuccess,
'msg': instance.msg,
'path': instance.path,
'timestamp': instance.timestamp,
};

8
lib/retrofit/retrofit_api.dart

@ -40,9 +40,9 @@ abstract class ApiService {
// print("data = ${jsonEncode(response.data)}");
p(jsonEncode(response.data));
Map map = response.data;
if (map["code"] == 40005 || map["code"] == 40001) {
if (map["code"] == 40005 || map["code"] == 40001 || map["code"] == -1) {
SharedPreferences.getInstance().then((value) => value.clear());
Navigator.pushAndRemoveUntil(context, new MaterialPageRoute(
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(
builder: (BuildContext context) {
return LoginPage();
},
@ -219,4 +219,8 @@ abstract class ApiService {
///
@POST("/order/continuePay")
Future<BaseData> continuePay(@Body() Map<String, dynamic> param);
///
@GET("/creditOrder/receive/{id}")
Future<BaseData> receiveToCard(@Path("id") String id);
}

19
lib/retrofit/retrofit_api.g.dart

@ -707,4 +707,23 @@ class _ApiService implements ApiService {
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> receiveToCard(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/creditOrder/receive/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
}

Loading…
Cancel
Save