Browse Source

修改bug

null_safety
fmk 4 years ago
parent
commit
658da282fe
  1. BIN
      assets/image/2x/icon_permission_location_bg.png
  2. BIN
      assets/image/3x/icon_permission_location_bg.png
  3. BIN
      assets/image/icon_permission_location_bg.png
  4. 3
      ios/Runner.xcodeproj/project.pbxproj
  5. 2
      lib/generated/intl/messages_en.dart
  6. 2
      lib/generated/intl/messages_zh_CN.dart
  7. 2
      lib/generated/intl/messages_zh_TW.dart
  8. 20
      lib/generated/l10n.dart
  9. 88
      lib/integral_store/integral_store_details_page.dart
  10. 2
      lib/l10n/intl_en.arb
  11. 2
      lib/l10n/intl_zh_CN.arb
  12. 2
      lib/l10n/intl_zh_TW.arb
  13. 51
      lib/order/exchange_order_page.dart
  14. 44
      lib/retrofit/data/activity.g.dart
  15. 40
      lib/retrofit/data/address.g.dart
  16. 38
      lib/retrofit/data/banner.g.dart
  17. 30
      lib/retrofit/data/base_data.g.dart
  18. 33
      lib/retrofit/data/brand_data.g.dart
  19. 64
      lib/retrofit/data/coupon.g.dart
  20. 67
      lib/retrofit/data/coupon_vo.g.dart
  21. 18
      lib/retrofit/data/data_type.g.dart
  22. 30
      lib/retrofit/data/delivery_info.g.dart
  23. 45
      lib/retrofit/data/exchange_order.g.dart
  24. 53
      lib/retrofit/data/exchange_order_goods.g.dart
  25. 33
      lib/retrofit/data/member_rank.g.dart
  26. 30
      lib/retrofit/data/page.g.dart
  27. 67
      lib/retrofit/data/promotion.g.dart
  28. 46
      lib/retrofit/data/sign_in.g.dart
  29. 32
      lib/retrofit/data/sign_info.g.dart
  30. 76
      lib/retrofit/data/store.g.dart
  31. 93
      lib/retrofit/data/store_info.g.dart
  32. 18
      lib/retrofit/data/store_type.g.dart
  33. 42
      lib/retrofit/data/task.g.dart
  34. 67
      lib/retrofit/data/upload_result.g.dart
  35. 39
      lib/retrofit/data/user_entity.g.dart
  36. 48
      lib/retrofit/data/user_info.g.dart
  37. 33
      lib/retrofit/data/verify_code.g.dart
  38. 617
      lib/retrofit/retrofit_api.g.dart
  39. 179
      lib/union/union_page.dart
  40. 1
      lib/view_widget/loading_view.dart
  41. 123
      lib/view_widget/request_permission.dart
  42. 9
      pubspec.lock
  43. 2
      pubspec.yaml

BIN
assets/image/2x/icon_permission_location_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/image/3x/icon_permission_location_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
assets/image/icon_permission_location_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

3
ios/Runner.xcodeproj/project.pbxproj

@ -744,7 +744,6 @@
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-l\"TOCropViewController\"",
"-l\"Toast\"",
"-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"",
@ -942,7 +941,6 @@
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-l\"TOCropViewController\"",
"-l\"Toast\"",
"-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"",
@ -1035,7 +1033,6 @@
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-l\"TOCropViewController\"",
"-l\"Toast\"",
"-l\"amap_flutter_location\"",
"-l\"amap_flutter_map\"",

2
lib/generated/intl/messages_en.dart

@ -159,6 +159,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"),
"jixuzhifu" : MessageLookupByLibrary.simpleMessage("继续支付"),
"kabao" : MessageLookupByLibrary.simpleMessage("卡包"),
"kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("开启权限"),
"kaitongriqi" : m8,
"keshiyong" : MessageLookupByLibrary.simpleMessage(" 可使用 "),
"keyongjifen" : MessageLookupByLibrary.simpleMessage("可用积分"),
@ -244,6 +245,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除订单"),
"shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加载"),
"shangpinjifen" : m15,
"shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品详情"),
"shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘积分大礼"),
"shezhi" : MessageLookupByLibrary.simpleMessage("设置"),
"shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("释放加载更多"),

2
lib/generated/intl/messages_zh_CN.dart

@ -152,6 +152,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"),
"jixuzhifu" : MessageLookupByLibrary.simpleMessage("继续支付"),
"kabao" : MessageLookupByLibrary.simpleMessage("卡包"),
"kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("开启权限"),
"kaitongriqi" : m8,
"keshiyong" : MessageLookupByLibrary.simpleMessage("可使用"),
"keyongjifen" : MessageLookupByLibrary.simpleMessage("可用积分"),
@ -231,6 +232,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除订单"),
"shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加载"),
"shangpinjifen" : m15,
"shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品详情"),
"shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘积分大礼"),
"shezhi" : MessageLookupByLibrary.simpleMessage("设置"),
"shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("释放加载更多"),

2
lib/generated/intl/messages_zh_TW.dart

@ -152,6 +152,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jixuduihuan" : MessageLookupByLibrary.simpleMessage("继续兑换"),
"jixuzhifu" : MessageLookupByLibrary.simpleMessage("继续支付"),
"kabao" : MessageLookupByLibrary.simpleMessage("卡包"),
"kaiqiquanxian" : MessageLookupByLibrary.simpleMessage("开启权限"),
"kaitongriqi" : m8,
"keshiyong" : MessageLookupByLibrary.simpleMessage("可使用"),
"keyongjifen" : MessageLookupByLibrary.simpleMessage("可用积分"),
@ -231,6 +232,7 @@ class MessageLookup extends MessageLookupByLibrary {
"shanchudingdan" : MessageLookupByLibrary.simpleMessage("删除订单"),
"shanglajiazai" : MessageLookupByLibrary.simpleMessage("上拉加载"),
"shangpinjifen" : m15,
"shangpinxiangqing" : MessageLookupByLibrary.simpleMessage("商品详情"),
"shenmijifendali" : MessageLookupByLibrary.simpleMessage("神秘积分大礼"),
"shezhi" : MessageLookupByLibrary.simpleMessage("设置"),
"shifangjiazaigengduo" : MessageLookupByLibrary.simpleMessage("释放加载更多"),

20
lib/generated/l10n.dart

@ -2695,6 +2695,26 @@ class S {
);
}
/// ``
String get shangpinxiangqing {
return Intl.message(
'商品详情',
name: 'shangpinxiangqing',
desc: '',
args: [],
);
}
/// ``
String get kaiqiquanxian {
return Intl.message(
'开启权限',
name: 'kaiqiquanxian',
desc: '',
args: [],
);
}
/// `使`
String get privacy_policy4 {
return Intl.message(

88
lib/integral_store/integral_store_details_page.dart

@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class IntegralStoreDetailsPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -27,6 +28,7 @@ class _IntegralStoreDetailsPage extends State {
String points;
final Map<String, dynamic> arguments;
_IntegralStoreDetailsPage(this.arguments);
@override
@ -75,11 +77,19 @@ class _IntegralStoreDetailsPage extends State {
),
),
),
title: Text(
S.of(context).shangpinxiangqing,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
titleSpacing: 2,
leadingWidth: 56,
leadingWidth: 56.w,
actions: [
Container(
margin: EdgeInsets.only(right: 15),
margin: EdgeInsets.only(right: 15.w),
child: GestureDetector(
onTap: () {},
child: Icon(
@ -103,21 +113,24 @@ class _IntegralStoreDetailsPage extends State {
children: [
buildProduct(),
Container(
padding: EdgeInsets.fromLTRB(16, 32, 16, 16),
padding: EdgeInsets.fromLTRB(16.w, 32.h, 16.w, 16.h),
child: Text(
S.of(context).duihuanguize,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
color: Color(0xFFFF7A1A)),
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFFF7A1A),
),
),
),
Container(
padding: EdgeInsets.fromLTRB(16, 6, 16, 40),
padding: EdgeInsets.fromLTRB(16.w, 6.h, 16.w, 40.h),
child: Text(
"(1) 兑换商品中所要求的积分达到方可兑换\n\n(2) 积分仅兑换商城指定商品,不能折算现金或兑换其他非指定商品项目\n\n(3) 兑换商品图片仅供参考,商品以实际领取为准,如商品有多种颜色,则随机发送\n\n(4) 使用积分兑换商品成功后,默认客户主动签收验货,非存在商品质量问题,不得退货或积分退回账户操作,若商品存在质量问题,请于收货后三日内联系客服解决\n\n(5) 兑换商品仅按客户指定地址进行配送,如因客户地址变更未及时通知本中心或客户所提供的联系方式和地址信息错误而导致商品配送失败的,由客户自行承担相关责任\n\n(6) 部分积分商品数量有限,先兑先得,兑完为止",
style:
TextStyle(fontSize: 12, color: Color(0xFF353535)),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
),
),
),
],
@ -130,7 +143,7 @@ class _IntegralStoreDetailsPage extends State {
toExchangeOrder();
},
child: Container(
padding: EdgeInsets.only(top: 16, bottom: 16),
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
decoration: BoxDecoration(
color: (goods != null &&
int.tryParse(goods.price) < int.tryParse(points))
@ -143,9 +156,10 @@ class _IntegralStoreDetailsPage extends State {
child: Text(
S.of(context).duihuan,
style: TextStyle(
fontSize: 16,
color: Color(0xFFFFFFFF),
fontWeight: FontWeight.bold),
fontSize: 16.sp,
color: Color(0xFFFFFFFF),
fontWeight: FontWeight.bold,
),
),
),
)
@ -181,10 +195,11 @@ class _IntegralStoreDetailsPage extends State {
bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0)
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white),
child: Column(
@ -198,18 +213,26 @@ class _IntegralStoreDetailsPage extends State {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
goods == null ? "" : goods.name,
style: TextStyle(
Expanded(
child: Text(
goods == null ? "" : goods.name,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Color(0xFF353535)),
color: Color(0xFF353535),
),
),
flex: 1,
),
Text(
goods == null
? ""
: S.of(context).yiduihuanjian("${goods.sales}"),
style: TextStyle(fontSize: 10, color: Color(0xFFA29E9E)),
style: TextStyle(
fontSize: 10,
color: Color(0xFFA29E9E),
),
),
],
),
@ -218,18 +241,25 @@ class _IntegralStoreDetailsPage extends State {
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
goods == null ? "" : goods.description,
style: TextStyle(fontSize: 12, color: Color(0xFF727272)),
Expanded(
child: Text(
goods == null ? "" : goods.description,
style: TextStyle(
fontSize: 12,
color: Color(0xFF727272),
),
),
flex: 1,
),
Text(
goods == null ? "" : S.of(context).jifen_(goods.price),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
color: Color(0xFF32A060)),
fontWeight: FontWeight.bold,
fontSize: 16,
color: Color(0xFF32A060),
),
),
],
),

2
lib/l10n/intl_en.arb

@ -272,6 +272,8 @@
"jiazaishibai": "加载失败",
"shifangjiazaigengduo": "释放加载更多",
"meiyougengduoshujule": "没有更多的数据了",
"shangpinxiangqing": "商品详情",
"kaiqiquanxian": "开启权限",

2
lib/l10n/intl_zh_CN.arb

@ -251,6 +251,8 @@
"jiazaishibai": "加载失败",
"shifangjiazaigengduo": "释放加载更多",
"meiyougengduoshujule": "没有更多的数据了",
"shangpinxiangqing": "商品详情",
"kaiqiquanxian": "开启权限",

2
lib/l10n/intl_zh_TW.arb

@ -251,6 +251,8 @@
"jiazaishibai": "加载失败",
"shifangjiazaigengduo": "释放加载更多",
"meiyougengduoshujule": "没有更多的数据了",
"shangpinxiangqing": "商品详情",
"kaiqiquanxian": "开启权限",

51
lib/order/exchange_order_page.dart

@ -9,6 +9,7 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ExchangeOrderPage extends StatefulWidget {
final Map<String, dynamic> arguments;
@ -279,33 +280,41 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Image.network(
widget.arguments["image"],
fit: BoxFit.cover,
width: 80,
height: 80,
width: 80.w,
height: 80.h,
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
widget.arguments["name"],
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xFF353535)),
Expanded(
child: Container(
height: 80.h,
margin: EdgeInsets.only(left: 16.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
widget.arguments["name"],
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xFF353535)),
),
SizedBox(
height: 4,
),
Text(
"x1",
style: TextStyle(
fontSize: 12, color: Color(0xFF727272)),
),
],
),
SizedBox(
height: 4,
),
Text(
"x1",
style: TextStyle(
fontSize: 12, color: Color(0xFF727272)),
),
],
),
flex: 1,
)
],
),

44
lib/retrofit/data/activity.g.dart

@ -0,0 +1,44 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'activity.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Activity _$ActivityFromJson(Map<String, dynamic> json) {
return Activity()
..id = json['id'] as String
..createTime = json['createTime'] as String
..createUser = json['createUser']
..updateTime = json['updateTime'] as String
..updateUser = json['updateUser']
..storeId = json['storeId'] as String
..mainTitle = json['mainTitle'] as String
..viceTitle = json['viceTitle'] as String
..content = json['content'] as String
..coverImg = json['coverImg'] as String
..startTime = json['startTime'] as String
..endTime = json['endTime'] as String
..state = json['state'] as int
..isDelete = json['isDelete'] as int
..storeName = json['storeName'] as String;
}
Map<String, dynamic> _$ActivityToJson(Activity instance) => <String, dynamic>{
'id': instance.id,
'createTime': instance.createTime,
'createUser': instance.createUser,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'storeId': instance.storeId,
'mainTitle': instance.mainTitle,
'viceTitle': instance.viceTitle,
'content': instance.content,
'coverImg': instance.coverImg,
'startTime': instance.startTime,
'endTime': instance.endTime,
'state': instance.state,
'isDelete': instance.isDelete,
'storeName': instance.storeName,
};

40
lib/retrofit/data/address.g.dart

@ -0,0 +1,40 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'address.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Address _$AddressFromJson(Map<String, dynamic> json) {
return Address()
..address = json['address'] as String
..area = json['area'] as String
..city = json['city'] as String
..cityInfo = json['cityInfo'] as String
..id = json['id'] as String
..isDefault = json['isDefault'] as bool
..latitude = json['latitude'] as String
..longitude = json['longitude'] as String
..mid = json['mid'] as String
..phone = json['phone'] as String
..province = json['province'] as String
..tag = json['tag'] as String
..username = json['username'] as String;
}
Map<String, dynamic> _$AddressToJson(Address instance) => <String, dynamic>{
'address': instance.address,
'area': instance.area,
'city': instance.city,
'cityInfo': instance.cityInfo,
'id': instance.id,
'isDefault': instance.isDefault,
'latitude': instance.latitude,
'longitude': instance.longitude,
'mid': instance.mid,
'phone': instance.phone,
'province': instance.province,
'tag': instance.tag,
'username': instance.username,
};

38
lib/retrofit/data/banner.g.dart

@ -0,0 +1,38 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'banner.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BannerData _$BannerDataFromJson(Map<String, dynamic> json) {
return BannerData(
content: json['content'] as String,
createTime: json['createTime'] as String,
createUser: json['createUser'] as String,
id: json['id'] as String,
imgUrl: json['imgUrl'] as String,
isDelete: json['isDelete'] as bool,
storeId: json['storeId'] as String,
tenantCode: json['tenantCode'] as String,
type: json['type'] as String,
updateTime: json['updateTime'] as String,
updateUser: json['updateUser'] as String,
);
}
Map<String, dynamic> _$BannerDataToJson(BannerData instance) =>
<String, dynamic>{
'content': instance.content,
'createTime': instance.createTime,
'createUser': instance.createUser,
'id': instance.id,
'imgUrl': instance.imgUrl,
'isDelete': instance.isDelete,
'storeId': instance.storeId,
'tenantCode': instance.tenantCode,
'type': instance.type,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
};

30
lib/retrofit/data/base_data.g.dart

@ -0,0 +1,30 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_data.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BaseData _$BaseDataFromJson(Map<String, dynamic> json) {
return BaseData()
..code = json['code'] as int
..data = json['data']
..extra = json['extra']
..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> _$BaseDataToJson(BaseData 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,
};

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

@ -0,0 +1,33 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'brand_data.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BrandData _$BrandDataFromJson(Map<String, dynamic> json) {
return BrandData()
..bannerList = (json['bannerList'] as List)
?.map((e) =>
e == null ? null : BannerData.fromJson(e as Map<String, dynamic>))
?.toList()
..company = json['company'] as String
..companyDesc = json['companyDesc'] as String
..originAvatar = json['originAvatar'] as String
..originDesc = json['originDesc'] as String
..originator = json['originator'] as String
..contents = json['contents']
..ideals = json['ideals'];
}
Map<String, dynamic> _$BrandDataToJson(BrandData instance) => <String, dynamic>{
'bannerList': instance.bannerList,
'company': instance.company,
'companyDesc': instance.companyDesc,
'originAvatar': instance.originAvatar,
'originDesc': instance.originDesc,
'originator': instance.originator,
'contents': instance.contents,
'ideals': instance.ideals,
};

64
lib/retrofit/data/coupon.g.dart

@ -0,0 +1,64 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'coupon.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Coupon _$CouponFromJson(Map<String, dynamic> json) {
return Coupon()
..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
..bizType = json['bizType'] as int
..fullAmount = json['fullAmount'] as String
..discountAmount = json['discountAmount'] as String
..discountPercent = json['discountPercent'] as int
..bizId = json['bizId'] as String
..publishStartTime = json['publishStartTime'] as String
..publishEndTime = json['publishEndTime'] as String
..useStartTime = json['useStartTime'] as String
..useEndTime = json['useEndTime'] as String
..promotionId = json['promotionId'] as String
..centreDisplay = json['centreDisplay'] as bool
..tenantCode = json['tenantCode'] as String
..isDelete = json['isDelete'] as int
..couponName = json['couponName'] as String
..couponImg = json['couponImg'] as String
..couponDescription = json['couponDescription'] as String
..memberCouponId = json['memberCouponId'] as String
..receiveTime = json['receiveTime'] as String
..useTime = json['useTime']
..status = json['status'] as int;
}
Map<String, dynamic> _$CouponToJson(Coupon instance) => <String, dynamic>{
'id': instance.id,
'createTime': instance.createTime,
'createUser': instance.createUser,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'bizType': instance.bizType,
'fullAmount': instance.fullAmount,
'discountAmount': instance.discountAmount,
'discountPercent': instance.discountPercent,
'bizId': instance.bizId,
'publishStartTime': instance.publishStartTime,
'publishEndTime': instance.publishEndTime,
'useStartTime': instance.useStartTime,
'useEndTime': instance.useEndTime,
'promotionId': instance.promotionId,
'centreDisplay': instance.centreDisplay,
'tenantCode': instance.tenantCode,
'isDelete': instance.isDelete,
'couponName': instance.couponName,
'couponImg': instance.couponImg,
'couponDescription': instance.couponDescription,
'memberCouponId': instance.memberCouponId,
'receiveTime': instance.receiveTime,
'useTime': instance.useTime,
'status': instance.status,
};

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

@ -0,0 +1,67 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'coupon_vo.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CouponVo _$CouponVoFromJson(Map<String, dynamic> json) {
return CouponVo(
bizId: json['bizId'] as String,
bizType: json['bizType'] as num,
centreDisplay: json['centreDisplay'] as bool,
couponDescription: json['couponDescription'] as String,
couponImg: json['couponImg'] as String,
couponName: json['couponName'] as String,
createTime: json['createTime'] as String,
createUser: json['createUser'] as String,
discountAmount: json['discountAmount'] as String,
discountPercent: json['discountPercent'] as num,
fullAmount: json['fullAmount'] as String,
id: json['id'] as String,
isDelete: json['isDelete'] as num,
memberCouponId: json['memberCouponId'] as num,
promotionId: json['promotionId'] as String,
publishEndTime: json['publishEndTime'] as String,
publishStartTime: json['publishStartTime'] as String,
receiveTime: json['receiveTime'] as String,
received: json['received'] as bool,
status: json['status'] as num,
tenantCode: json['tenantCode'] as String,
updateTime: json['updateTime'] as String,
updateUser: json['updateUser'] as String,
useEndTime: json['useEndTime'] as String,
useStartTime: json['useStartTime'] as String,
useTime: json['useTime'] as String,
);
}
Map<String, dynamic> _$CouponVoToJson(CouponVo instance) => <String, dynamic>{
'bizId': instance.bizId,
'bizType': instance.bizType,
'centreDisplay': instance.centreDisplay,
'couponDescription': instance.couponDescription,
'couponImg': instance.couponImg,
'couponName': instance.couponName,
'createTime': instance.createTime,
'createUser': instance.createUser,
'discountAmount': instance.discountAmount,
'discountPercent': instance.discountPercent,
'fullAmount': instance.fullAmount,
'id': instance.id,
'isDelete': instance.isDelete,
'memberCouponId': instance.memberCouponId,
'promotionId': instance.promotionId,
'publishEndTime': instance.publishEndTime,
'publishStartTime': instance.publishStartTime,
'receiveTime': instance.receiveTime,
'received': instance.received,
'status': instance.status,
'tenantCode': instance.tenantCode,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'useEndTime': instance.useEndTime,
'useStartTime': instance.useStartTime,
'useTime': instance.useTime,
};

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

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

30
lib/retrofit/data/delivery_info.g.dart

@ -0,0 +1,30 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'delivery_info.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
DeliveryInfo _$DeliveryInfoFromJson(Map<String, dynamic> json) {
return DeliveryInfo(
dadaRegStatus: json['dadaRegStatus'] as bool,
dadaSourceId: json['dadaSourceId'] as String,
dadaStatus: json['dadaStatus'] as bool,
dianwodaRegStatus: json['dianwodaRegStatus'] as bool,
dianwodaStatus: json['dianwodaStatus'] as bool,
meituanRegStatus: json['meituanRegStatus'] as bool,
meituanStatus: json['meituanStatus'] as bool,
);
}
Map<String, dynamic> _$DeliveryInfoToJson(DeliveryInfo instance) =>
<String, dynamic>{
'dadaRegStatus': instance.dadaRegStatus,
'dadaSourceId': instance.dadaSourceId,
'dadaStatus': instance.dadaStatus,
'dianwodaRegStatus': instance.dianwodaRegStatus,
'dianwodaStatus': instance.dianwodaStatus,
'meituanRegStatus': instance.meituanRegStatus,
'meituanStatus': instance.meituanStatus,
};

45
lib/retrofit/data/exchange_order.g.dart

@ -0,0 +1,45 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'exchange_order.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ExchangeOrder _$ExchangeOrderFromJson(Map<String, dynamic> json) {
return ExchangeOrder()
..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
..storeId = json['storeId'] as String
..mid = json['mid'] as String
..orderCode = json['orderCode'] as String
..amount = json['amount'] as String
..state = json['state'] as int
..useTyped = json['useTyped'] as int
..isDelete = json['isDelete'] as int
..creditOrderDetailList = (json['creditOrderDetailList'] as List)
?.map((e) => e == null
? null
: ExchangeOrderGoods.fromJson(e as Map<String, dynamic>))
?.toList();
}
Map<String, dynamic> _$ExchangeOrderToJson(ExchangeOrder instance) =>
<String, dynamic>{
'id': instance.id,
'createTime': instance.createTime,
'createUser': instance.createUser,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'storeId': instance.storeId,
'mid': instance.mid,
'orderCode': instance.orderCode,
'amount': instance.amount,
'state': instance.state,
'useTyped': instance.useTyped,
'isDelete': instance.isDelete,
'creditOrderDetailList': instance.creditOrderDetailList,
};

53
lib/retrofit/data/exchange_order_goods.g.dart

@ -0,0 +1,53 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'exchange_order_goods.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ExchangeOrderGoods _$ExchangeOrderGoodsFromJson(Map<String, dynamic> json) {
return ExchangeOrderGoods()
..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
..orderId = json['orderId'] as String
..goodsId = json['goodsId'] as String
..categoryId = json['categoryId'] as String
..name = json['name'] as String
..description = json['description'] as String
..worth = json['worth'] as String
..price = json['price'] as String
..couponId = json['couponId'] as String
..canPick = json['canPick'] as bool
..canDelivery = json['canDelivery'] as bool
..goodsMainImg = json['goodsMainImg'] as String
..goodsViceImg = json['goodsViceImg'] as String
..goodsNumber = json['goodsNumber'] as int
..isDelete = json['isDelete'] as int;
}
Map<String, dynamic> _$ExchangeOrderGoodsToJson(ExchangeOrderGoods instance) =>
<String, dynamic>{
'id': instance.id,
'createTime': instance.createTime,
'createUser': instance.createUser,
'updateTime': instance.updateTime,
'updateUser': instance.updateUser,
'orderId': instance.orderId,
'goodsId': instance.goodsId,
'categoryId': instance.categoryId,
'name': instance.name,
'description': instance.description,
'worth': instance.worth,
'price': instance.price,
'couponId': instance.couponId,
'canPick': instance.canPick,
'canDelivery': instance.canDelivery,
'goodsMainImg': instance.goodsMainImg,
'goodsViceImg': instance.goodsViceImg,
'goodsNumber': instance.goodsNumber,
'isDelete': instance.isDelete,
};

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

@ -0,0 +1,33 @@
// 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,
};

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

@ -0,0 +1,30 @@
// 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
..pageSize = json['pageSize'] as int
..size = json['size'] as int
..pages = json['pages'] as int
..hasPreviousPage = json['hasPreviousPage'] as bool
..hasNextPage = json['hasNextPage'] as bool
..total = json['total'] as String
..list = json['list'] as List;
}
Map<String, dynamic> _$PageInfoToJson(PageInfo instance) => <String, dynamic>{
'pageNum': instance.pageNum,
'pageSize': instance.pageSize,
'size': instance.size,
'pages': instance.pages,
'hasPreviousPage': instance.hasPreviousPage,
'hasNextPage': instance.hasNextPage,
'total': instance.total,
'list': instance.list,
};

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

@ -0,0 +1,67 @@
// 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>{};

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

@ -0,0 +1,46 @@
// 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,
};

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

@ -0,0 +1,32 @@
// 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
..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,
'rank': instance.rank,
'signInList': instance.signInList,
'taskList': instance.taskList,
'rewardList': instance.rewardList,
};

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

@ -0,0 +1,76 @@
// 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']
..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,
'posType': instance.posType,
};

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

@ -0,0 +1,93 @@
// 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
..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,
'mini': instance.mini,
'useErp': instance.useErp,
};

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

@ -0,0 +1,18 @@
// 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,
};

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

@ -0,0 +1,42 @@
// 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,
};

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

@ -0,0 +1,67 @@
// 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,
};

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

@ -0,0 +1,39 @@
// 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,
};

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

@ -0,0 +1,48 @@
// 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,
};

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

@ -0,0 +1,33 @@
// 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,
};

617
lib/retrofit/retrofit_api.g.dart

@ -0,0 +1,617 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'retrofit_api.dart';
// **************************************************************************
// RetrofitGenerator
// **************************************************************************
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://platform.test.api.lotus-wallet.com/app';
}
final Dio _dio;
String baseUrl;
@override
Future<BaseData> upload(data, folderId) async {
ArgumentError.checkNotNull(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = FormData();
_data.files.add(MapEntry(
'file',
MultipartFile.fromFileSync(data.path,
filename: data.path.split(Platform.pathSeparator).last)));
if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString()));
}
final _result = await _dio.request<Map<String, dynamic>>('/file/upload',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<dynamic> searchPoi(lat, lng, keywords, size, page) async {
ArgumentError.checkNotNull(lat, 'lat');
ArgumentError.checkNotNull(lng, 'lng');
ArgumentError.checkNotNull(keywords, 'keywords');
ArgumentError.checkNotNull(size, 'size');
ArgumentError.checkNotNull(page, 'page');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request(
'https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location=$lat,$lng&keywords=$keywords&offset={size}&page={page}&extensions=all',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = _result.data;
return value;
}
@override
Future<BaseData> memberLogin(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>>(
'/auth/platform/memberLogin',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> sendVerify(mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/sendVerify/$mobile',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditGoods(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>>(
'/creditGoods/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditGoodsById(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>>('/creditGoods/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/info',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> editInfo(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/editMemberInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> signInInfo() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/member/signInInfo',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> signIn() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/member/signIn',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> recharge(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/recharge',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> receiveCoupon(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/receiveCoupon',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrderList(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>>(
'/creditOrder/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrder(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>>(
'/creditOrder/create',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> addAddress(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>>('/address/add',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> deleteAddress(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>>('/address/delete',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryAddress(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>>(
'/address/detail/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryMemberAddress() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/address/queryMemberAddress',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> updateAddress(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>>('/address/update',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryCoupon(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>>(
'/coupon/centreList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryCard(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>>(
'/coupon/packageList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryStore(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/store/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> informationList(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>>(
'/information/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> informationInfo(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>>(
'/information/{id}',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> creditOrderReceive(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;
}
@override
Future<BaseData> queryHome() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/home/home',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryStoreInfo(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>>('/store/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryArticle(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>>(
'/information/list',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryBanner(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>>('/banner/page',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> queryHomeBrand() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('/home/brand',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
@override
Future<BaseData> minLogin(storeId) async {
ArgumentError.checkNotNull(storeId, 'storeId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/mini/login/$storeId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData.fromJson(_result.data);
return value;
}
}

179
lib/union/union_page.dart

@ -1,7 +1,9 @@
import 'dart:io';
import 'dart:ui';
import 'package:amap_flutter_location/amap_flutter_location.dart';
import 'package:amap_flutter_location/amap_location_option.dart';
import 'package:android_intent_plus/android_intent.dart';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
@ -19,6 +21,7 @@ import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:huixiang/view_widget/loading_view.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -115,13 +118,8 @@ class _UnionPage extends State<UnionPage> with AutomaticKeepAliveClientMixin {
_loadCustomData();
SharedPreferences.getInstance().then(
(value) => {
apiService = ApiService(Dio(), token: value.getString('token')),
print("startLocation"),
startLocation(),
},
);
getLatLng();
startLocation();
}
LatLng latLng;
@ -139,32 +137,45 @@ class _UnionPage extends State<UnionPage> with AutomaticKeepAliveClientMixin {
SharedPreferences.getInstance().then(
(value) => {
apiService = ApiService(Dio(), token: value.getString('token')),
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"),
editingController.text),
setState(() {
if (_mapController != null) {
_mapController.moveCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: latLng,
zoom: 15.0,
),
),
);
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"),
editingController.text,
),
setState(() {
if (_mapController != null) {
_mapController.moveCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: latLng,
zoom: 15.0,
),
),
);
}
})
}
else
{
queryStore("", "", "", "", "", editingController.text),
}
})
},
);
}
List<Store> storeList;
bool isFirst = true;
queryStore(latitude, longitude, province, city, district, searchKey) async {
BaseData baseData = await apiService.queryStore({
@ -178,7 +189,9 @@ class _UnionPage extends State<UnionPage> with AutomaticKeepAliveClientMixin {
refreshController.refreshFailed();
});
if (Navigator.canPop(context)) Navigator.of(context).pop();
if (Navigator.canPop(context) && !isFirst) Navigator.of(context).pop();
isFirst = false;
if (baseData != null && baseData.isSuccess) {
storeList = (baseData.data as List<dynamic>)
@ -288,40 +301,82 @@ class _UnionPage extends State<UnionPage> with AutomaticKeepAliveClientMixin {
}
startLocation() async {
if (await Permission.locationWhenInUse.serviceStatus.isEnabled) {
bool isShown = await Permission.contacts.shouldShowRequestRationale;
if (isShown) {
Fluttertoast.showToast(
msg: "shouldShowRequestRationale",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0.sp,
);
}
if (await Permission.location.isPermanentlyDenied) {
//openAppSettings
print("Permission.location.isPermanentlyDenied");
getLatLng();
} else if (await Permission.location.isGranted) {
showLoadingDialog();
print("Permission.location.startLocation");
aMapFlutterLocation.startLocation();
} else {
await Permission.location.request();
startLocation();
print("Permission.location.request");
getLatLng();
if (Platform.isAndroid) {
if (!(await Permission.locationWhenInUse.serviceStatus.isEnabled)) {
enableLocation();
refreshController.refreshCompleted();
return;
}
}
// bool isShown = await Permission.location.shouldShowRequestRationale;
// if (isShown) {
// Fluttertoast.showToast(
// msg: "shouldShowRequestRationale",
// toastLength: Toast.LENGTH_SHORT,
// gravity: ToastGravity.CENTER,
// timeInSecForIosWeb: 1,
// backgroundColor: Colors.red,
// textColor: Colors.white,
// fontSize: 16.0.sp,
// );
// }
if (await Permission.location.isPermanentlyDenied) {
requestDialog();
refreshController.refreshCompleted();
} else if (await Permission.location.isGranted) {
showLoadingDialog();
aMapFlutterLocation.startLocation();
} else {
//enabledLocation
print("getLatLng");
getLatLng();
await Permission.location.request();
// startLocation();
refreshController.refreshCompleted();
}
}
enableLocation() {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_permission_location_bg.png",
"您定位功能开关未开启,请点击去开启",
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息",
S.of(context).kaiqiquanxian, (result) async {
if (result) {
final AndroidIntent intent = AndroidIntent(
action: 'action_location_source_settings',
package: "com.zsw.huixiang");
await intent.launch();
startLocation();
}
});
});
}
requestDialog() {
showCupertinoDialog(
context: context,
builder: (context) {
return RequestPermission(
"assets/image/icon_permission_location_bg.png",
"您未开启位置权限,请点击开启",
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息",
S.of(context).kaiqiquanxian, (result) async {
if (result) {
if (Platform.isAndroid) {
final AndroidIntent intent = AndroidIntent(
action: 'action_application_details_settings',
data: 'package:com.zsw.huixiang');
await intent.launch();
if (await Permission.location.isGranted) {
startLocation();
}
}
}
});
});
}
AMapController _mapController;
TextEditingController editingController = TextEditingController();
@ -472,12 +527,12 @@ class _UnionPage extends State<UnionPage> with AutomaticKeepAliveClientMixin {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
store.distance > 1000
(store.distance ?? 0) > 1000
? S.of(context).gongli(
(store.distance / 1000 * 100).toInt() / 100.0)
: S
.of(context)
.mi((store.distance * 100).toInt() / 100.0),
((store.distance ?? 0) / 1000 * 100).toInt() /
100.0)
: S.of(context).mi(
((store.distance ?? 0) * 100).toInt() / 100.0),
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 12,

1
lib/view_widget/loading_view.dart

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:huixiang/view_widget/rotate_container.dart';
class LoadingView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(

123
lib/view_widget/request_permission.dart

@ -0,0 +1,123 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/round_button.dart';
class RequestPermission extends StatefulWidget {
final src;
final mainText;
final subText;
final leftText;
final rightText;
final Function(bool) open;
RequestPermission(this.src,this.mainText,this.subText,this.rightText, this.open, {this.leftText,});
@override
State<StatefulWidget> createState() {
return _RequestPermission();
}
}
class _RequestPermission extends State<RequestPermission> {
@override
Widget build(BuildContext context) {
return Material(
type: MaterialType.transparency,
child: Center(
child: Container(
width: 0.7867.sw,
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: AspectRatio(
aspectRatio: 0.9,
child: Column(
children: [
Image.asset(
widget.src,
width: 0.7867.sw * 0.6,
height: 0.7867.sw * 0.6 * 0.7,
fit: BoxFit.fill,
),
SizedBox(
height: 20.w,
),
Text(
widget.mainText,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
SizedBox(
height: 3.w,
),
Text(
widget.subText,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
SizedBox(
height: 20.w,
),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: InkWell(
onTap: (){
widget.open(false);
Navigator.of(context).pop("cancel");
},
child: BorderText(
text: S.of(context).quxiao,
textColor: Color(0xFF32A060),
borderWidth: 1.w,
borderColor: Color(0xFF32A060),
padding: EdgeInsets.all(12.w),
fontSize: 16.sp,
fontWeight: FontWeight.bold,
radius: 4,
),
),
flex: 1,
),
SizedBox(
width: 13.w,
),
Expanded(
child: InkWell(
onTap: (){
widget.open(true);
Navigator.of(context).pop("open");
},
child: RoundButton(
text: widget.rightText,
textColor: Colors.white,
padding: EdgeInsets.all(12.w),
fontSize: 16.sp,
backgroup: Color(0xFF32A060),
fontWeight: FontWeight.bold,
radius: 4,
),
),
flex: 1,
),
],
),
],
),
),
),
),
);
}
}

9
pubspec.lock

@ -36,6 +36,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.41.2"
android_intent_plus:
dependency: "direct main"
description:
name: android_intent_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
args:
dependency: transitive
description:
@ -168,7 +175,7 @@ packages:
name: cli_util
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
version: "0.3.3"
clock:
dependency: transitive
description:

2
pubspec.yaml

@ -48,6 +48,8 @@ dependencies:
# webview_flutter: ^2.0.8
logger: ^1.0.0
android_intent_plus: ^1.0.2
# android_intent: ^2.0.2
flutter_screenutil: ^5.0.0+2
bubble_tab_indicator: ^0.1.6
# permission_handler: ^8.1.0 # Null safety

Loading…
Cancel
Save