diff --git a/assets/image/2x/icon_permission_location_bg.png b/assets/image/2x/icon_permission_location_bg.png new file mode 100644 index 00000000..18d4d453 Binary files /dev/null and b/assets/image/2x/icon_permission_location_bg.png differ diff --git a/assets/image/3x/icon_permission_location_bg.png b/assets/image/3x/icon_permission_location_bg.png new file mode 100644 index 00000000..b992f9a3 Binary files /dev/null and b/assets/image/3x/icon_permission_location_bg.png differ diff --git a/assets/image/icon_permission_location_bg.png b/assets/image/icon_permission_location_bg.png new file mode 100644 index 00000000..34011521 Binary files /dev/null and b/assets/image/icon_permission_location_bg.png differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index aa8ab932..6fdc7cc3 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/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\"", diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 7e6cfe24..0707cc9b 100644 --- a/lib/generated/intl/messages_en.dart +++ b/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("释放加载更多"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 05df487e..458a94b8 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/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("释放加载更多"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 89abf65a..8ca4d329 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/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("释放加载更多"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index d0606517..94853d1b 100644 --- a/lib/generated/l10n.dart +++ b/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( diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 52acded5..e3540a60 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/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 arguments; @@ -27,6 +28,7 @@ class _IntegralStoreDetailsPage extends State { String points; final Map 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), + ), ), ], ), diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 16263ac8..e3bf0ee4 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -272,6 +272,8 @@ "jiazaishibai": "加载失败", "shifangjiazaigengduo": "释放加载更多", "meiyougengduoshujule": "没有更多的数据了", + "shangpinxiangqing": "商品详情", + "kaiqiquanxian": "开启权限", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 090dedf7..957e5d53 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -251,6 +251,8 @@ "jiazaishibai": "加载失败", "shifangjiazaigengduo": "释放加载更多", "meiyougengduoshujule": "没有更多的数据了", + "shangpinxiangqing": "商品详情", + "kaiqiquanxian": "开启权限", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 3d691208..ba50e8a0 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -251,6 +251,8 @@ "jiazaishibai": "加载失败", "shifangjiazaigengduo": "释放加载更多", "meiyougengduoshujule": "没有更多的数据了", + "shangpinxiangqing": "商品详情", + "kaiqiquanxian": "开启权限", diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index d38a8701..353d626e 100644 --- a/lib/order/exchange_order_page.dart +++ b/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 arguments; @@ -279,33 +280,41 @@ class _ExchangeOrderPage extends State { 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, ) ], ), diff --git a/lib/retrofit/data/activity.g.dart b/lib/retrofit/data/activity.g.dart new file mode 100644 index 00000000..de88e232 --- /dev/null +++ b/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 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 _$ActivityToJson(Activity instance) => { + '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, + }; diff --git a/lib/retrofit/data/address.g.dart b/lib/retrofit/data/address.g.dart new file mode 100644 index 00000000..392f0ad0 --- /dev/null +++ b/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 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 _$AddressToJson(Address instance) => { + '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, + }; diff --git a/lib/retrofit/data/banner.g.dart b/lib/retrofit/data/banner.g.dart new file mode 100644 index 00000000..1eca663a --- /dev/null +++ b/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 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 _$BannerDataToJson(BannerData instance) => + { + '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, + }; diff --git a/lib/retrofit/data/base_data.g.dart b/lib/retrofit/data/base_data.g.dart new file mode 100644 index 00000000..6985c4ef --- /dev/null +++ b/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 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 _$BaseDataToJson(BaseData instance) => { + 'code': instance.code, + 'data': instance.data, + 'extra': instance.extra, + 'isError': instance.isError, + 'isSuccess': instance.isSuccess, + 'msg': instance.msg, + 'path': instance.path, + 'timestamp': instance.timestamp, + }; diff --git a/lib/retrofit/data/brand_data.g.dart b/lib/retrofit/data/brand_data.g.dart new file mode 100644 index 00000000..bce83c38 --- /dev/null +++ b/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 json) { + return BrandData() + ..bannerList = (json['bannerList'] as List) + ?.map((e) => + e == null ? null : BannerData.fromJson(e as Map)) + ?.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 _$BrandDataToJson(BrandData instance) => { + 'bannerList': instance.bannerList, + 'company': instance.company, + 'companyDesc': instance.companyDesc, + 'originAvatar': instance.originAvatar, + 'originDesc': instance.originDesc, + 'originator': instance.originator, + 'contents': instance.contents, + 'ideals': instance.ideals, + }; diff --git a/lib/retrofit/data/coupon.g.dart b/lib/retrofit/data/coupon.g.dart new file mode 100644 index 00000000..2e658e18 --- /dev/null +++ b/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 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 _$CouponToJson(Coupon instance) => { + '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, + }; diff --git a/lib/retrofit/data/coupon_vo.g.dart b/lib/retrofit/data/coupon_vo.g.dart new file mode 100644 index 00000000..3b2b8e04 --- /dev/null +++ b/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 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 _$CouponVoToJson(CouponVo instance) => { + '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, + }; diff --git a/lib/retrofit/data/data_type.g.dart b/lib/retrofit/data/data_type.g.dart new file mode 100644 index 00000000..1ea5414e --- /dev/null +++ b/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 json) { + return DataType() + ..desc = json['desc'] as String + ..code = json['code'] as String; +} + +Map _$DataTypeToJson(DataType instance) => { + 'desc': instance.desc, + 'code': instance.code, + }; diff --git a/lib/retrofit/data/delivery_info.g.dart b/lib/retrofit/data/delivery_info.g.dart new file mode 100644 index 00000000..b3f141fc --- /dev/null +++ b/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 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 _$DeliveryInfoToJson(DeliveryInfo instance) => + { + 'dadaRegStatus': instance.dadaRegStatus, + 'dadaSourceId': instance.dadaSourceId, + 'dadaStatus': instance.dadaStatus, + 'dianwodaRegStatus': instance.dianwodaRegStatus, + 'dianwodaStatus': instance.dianwodaStatus, + 'meituanRegStatus': instance.meituanRegStatus, + 'meituanStatus': instance.meituanStatus, + }; diff --git a/lib/retrofit/data/exchange_order.g.dart b/lib/retrofit/data/exchange_order.g.dart new file mode 100644 index 00000000..dfe5cd44 --- /dev/null +++ b/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 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)) + ?.toList(); +} + +Map _$ExchangeOrderToJson(ExchangeOrder instance) => + { + '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, + }; diff --git a/lib/retrofit/data/exchange_order_goods.g.dart b/lib/retrofit/data/exchange_order_goods.g.dart new file mode 100644 index 00000000..8ffd8d2d --- /dev/null +++ b/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 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 _$ExchangeOrderGoodsToJson(ExchangeOrderGoods instance) => + { + '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, + }; diff --git a/lib/retrofit/data/member_rank.g.dart b/lib/retrofit/data/member_rank.g.dart new file mode 100644 index 00000000..5971713a --- /dev/null +++ b/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 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 _$MemberRankToJson(MemberRank instance) => + { + '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, + }; diff --git a/lib/retrofit/data/page.g.dart b/lib/retrofit/data/page.g.dart new file mode 100644 index 00000000..0eae5c04 --- /dev/null +++ b/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 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 _$PageInfoToJson(PageInfo instance) => { + 'pageNum': instance.pageNum, + 'pageSize': instance.pageSize, + 'size': instance.size, + 'pages': instance.pages, + 'hasPreviousPage': instance.hasPreviousPage, + 'hasNextPage': instance.hasNextPage, + 'total': instance.total, + 'list': instance.list, + }; diff --git a/lib/retrofit/data/promotion.g.dart b/lib/retrofit/data/promotion.g.dart new file mode 100644 index 00000000..d6971154 --- /dev/null +++ b/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 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)) + ?.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 _$PromotionToJson(Promotion instance) => { + '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 json) { + return PromotionDetailBean(); +} + +Map _$PromotionDetailBeanToJson( + PromotionDetailBean instance) => + {}; diff --git a/lib/retrofit/data/sign_in.g.dart b/lib/retrofit/data/sign_in.g.dart new file mode 100644 index 00000000..5d4abcd0 --- /dev/null +++ b/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 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 _$SignInToJson(SignIn instance) => { + '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, + }; diff --git a/lib/retrofit/data/sign_info.g.dart b/lib/retrofit/data/sign_info.g.dart new file mode 100644 index 00000000..9b6e5f9c --- /dev/null +++ b/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 json) { + return SignInfo() + ..point = json['point'] as String + ..rank = json['rank'] == null + ? null + : MemberRank.fromJson(json['rank'] as Map) + ..signInList = (json['signInList'] as List) + ?.map((e) => + e == null ? null : SignIn.fromJson(e as Map)) + ?.toList() + ..taskList = (json['taskList'] as List) + ?.map( + (e) => e == null ? null : Task.fromJson(e as Map)) + ?.toList() + ..rewardList = (json['rewardList'] as List)?.map((e) => e as int)?.toList(); +} + +Map _$SignInfoToJson(SignInfo instance) => { + 'point': instance.point, + 'rank': instance.rank, + 'signInList': instance.signInList, + 'taskList': instance.taskList, + 'rewardList': instance.rewardList, + }; diff --git a/lib/retrofit/data/store.g.dart b/lib/retrofit/data/store.g.dart new file mode 100644 index 00000000..41ee6090 --- /dev/null +++ b/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 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); +} + +Map _$StoreToJson(Store instance) => { + '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, + }; diff --git a/lib/retrofit/data/store_info.g.dart b/lib/retrofit/data/store_info.g.dart new file mode 100644 index 00000000..c29af47d --- /dev/null +++ b/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 json) { + return StoreInfo() + ..address = json['address'] as String + ..bannerList = (json['bannerList'] as List) + ?.map((e) => + e == null ? null : BannerData.fromJson(e as Map)) + ?.toList() + ..city = json['city'] as String + ..couponVOList = (json['couponVOList'] as List) + ?.map((e) => + e == null ? null : CouponVo.fromJson(e as Map)) + ?.toList() + ..createTime = json['createTime'] as String + ..createUser = json['createUser'] as String + ..deliveryInfo = json['deliveryInfo'] == null + ? null + : DeliveryInfo.fromJson(json['deliveryInfo'] as Map) + ..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) + ..promotionList = (json['promotionList'] as List) + ?.map((e) => + e == null ? null : Promotion.fromJson(e as Map)) + ?.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 _$StoreInfoToJson(StoreInfo instance) => { + '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, + }; diff --git a/lib/retrofit/data/store_type.g.dart b/lib/retrofit/data/store_type.g.dart new file mode 100644 index 00000000..7466837c --- /dev/null +++ b/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 json) { + return StoreType() + ..desc = json['desc'] as String + ..code = json['code'] as String; +} + +Map _$StoreTypeToJson(StoreType instance) => { + 'desc': instance.desc, + 'code': instance.code, + }; diff --git a/lib/retrofit/data/task.g.dart b/lib/retrofit/data/task.g.dart new file mode 100644 index 00000000..d3e953c3 --- /dev/null +++ b/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 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 _$TaskToJson(Task instance) => { + '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, + }; diff --git a/lib/retrofit/data/upload_result.g.dart b/lib/retrofit/data/upload_result.g.dart new file mode 100644 index 00000000..dcfe4bb9 --- /dev/null +++ b/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 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) + ..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 _$UploadResultToJson(UploadResult instance) => + { + '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, + }; diff --git a/lib/retrofit/data/user_entity.g.dart b/lib/retrofit/data/user_entity.g.dart new file mode 100644 index 00000000..7554c6ed --- /dev/null +++ b/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 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 _$UserEntityToJson(UserEntity instance) => + { + '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, + }; diff --git a/lib/retrofit/data/user_info.g.dart b/lib/retrofit/data/user_info.g.dart new file mode 100644 index 00000000..2b13dca0 --- /dev/null +++ b/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 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); +} + +Map _$UserInfoToJson(UserInfo instance) => { + '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, + }; diff --git a/lib/retrofit/data/verify_code.g.dart b/lib/retrofit/data/verify_code.g.dart new file mode 100644 index 00000000..662a87e0 --- /dev/null +++ b/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 json) { + return VerifyCode() + ..code = json['code'] as int + ..data = json['data'] as Map + ..extra = json['extra'] == null + ? null + : BaseDataExtra.fromJson(json['extra'] as Map) + ..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 _$VerifyCodeToJson(VerifyCode instance) => + { + 'code': instance.code, + 'data': instance.data, + 'extra': instance.extra, + 'isError': instance.isError, + 'isSuccess': instance.isSuccess, + 'msg': instance.msg, + 'path': instance.path, + 'timestamp': instance.timestamp, + }; diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart new file mode 100644 index 00000000..9bf498cf --- /dev/null +++ b/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 upload(data, folderId) async { + ArgumentError.checkNotNull(data, 'data'); + ArgumentError.checkNotNull(folderId, 'folderId'); + const _extra = {}; + final queryParameters = {}; + 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>('/file/upload', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future 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 = {}; + final queryParameters = {}; + final _data = {}; + 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: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = _result.data; + return value; + } + + @override + Future memberLogin(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/auth/platform/memberLogin', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future sendVerify(mobile) async { + ArgumentError.checkNotNull(mobile, 'mobile'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/auth/sendVerify/$mobile', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future creditGoods(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/creditGoods/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future creditGoodsById(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/creditGoods/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryInfo() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/info', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future editInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/member/editMemberInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future signInInfo() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/member/signInInfo', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future signIn() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/signIn', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future recharge(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/member/recharge', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future receiveCoupon(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/member/receiveCoupon', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future creditOrderList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/creditOrder/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future creditOrder(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/creditOrder/create', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future addAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/address/add', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future deleteAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/address/delete', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryAddress(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/address/detail/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryMemberAddress() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/address/queryMemberAddress', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future updateAddress(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/address/update', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryCoupon(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/coupon/centreList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryCard(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/coupon/packageList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryStore(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/store/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future informationList(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/information/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future informationInfo(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/information/{id}', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future creditOrderReceive(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/creditOrder/receive/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryHome() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/home/home', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryStoreInfo(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/store/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryArticle(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>( + '/information/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryBanner(param) async { + ArgumentError.checkNotNull(param, 'param'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(param ?? {}); + final _result = await _dio.request>('/banner/page', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future queryHomeBrand() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/home/brand', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } + + @override + Future minLogin(storeId) async { + ArgumentError.checkNotNull(storeId, 'storeId'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/auth/mini/login/$storeId', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson(_result.data); + return value; + } +} diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 455b5aa0..4c4b6a8e 100644 --- a/lib/union/union_page.dart +++ b/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 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 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 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 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) @@ -288,40 +301,82 @@ class _UnionPage extends State 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 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, diff --git a/lib/view_widget/loading_view.dart b/lib/view_widget/loading_view.dart index 02a6c638..2d8d99de 100644 --- a/lib/view_widget/loading_view.dart +++ b/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( diff --git a/lib/view_widget/request_permission.dart b/lib/view_widget/request_permission.dart new file mode 100644 index 00000000..f8aa4f29 --- /dev/null +++ b/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 createState() { + return _RequestPermission(); + } +} + +class _RequestPermission extends State { + @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, + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index b8e0f496..7a787b2d 100644 --- a/pubspec.lock +++ b/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: diff --git a/pubspec.yaml b/pubspec.yaml index c74493d8..06e6eb0d 100644 --- a/pubspec.yaml +++ b/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