diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6fdc7cc3..901257cf 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -706,7 +706,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -739,7 +739,7 @@ "$(inherited)", "$(PROJECT_DIR)/UniMPSDK/Libs", ); - MARKETING_VERSION = 1.0.3; + MARKETING_VERSION = 1.0.4; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", @@ -903,7 +903,7 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -936,7 +936,7 @@ "$(inherited)", "$(PROJECT_DIR)/UniMPSDK/Libs", ); - MARKETING_VERSION = 1.0.3; + MARKETING_VERSION = 1.0.4; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -995,7 +995,7 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1028,7 +1028,7 @@ "$(inherited)", "$(PROJECT_DIR)/UniMPSDK/Libs", ); - MARKETING_VERSION = 1.0.3; + MARKETING_VERSION = 1.0.4; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 1d91b211..c33c4bbd 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -468,7 +468,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { ), Container( height: MediaQuery.of(context).size.height * 0.78, - margin: EdgeInsets.only(top: 56), + margin: EdgeInsets.only(top: 56.h), alignment: Alignment.topCenter, child: AspectRatio( aspectRatio: 1.1, @@ -489,8 +489,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { children: [ Image.asset( "assets/image/icon_login_logo.png", - width: 91, - height: 91, + width: 91.w, + height: 91.h, ), SizedBox( height: 0.596.sh, @@ -538,7 +538,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { top: MediaQuery.of(context).size.height * 0.1039, bottom: 0, child: Container( - padding: EdgeInsets.symmetric(horizontal: 40), + padding: EdgeInsets.symmetric(horizontal: 40.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -548,7 +548,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { child: Text( "Hello,", style: TextStyle( - fontSize: 23, + fontSize: 23.sp, color: Color(0xFF32A060), ), ), @@ -559,15 +559,15 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Opacity( opacity: (255 - changeAlpha) / 255, child: Text( - "欢迎来到一心回乡", + S.of(context).login_splash, style: TextStyle( - fontSize: 18, + fontSize: 18.sp, color: Color(0xFF32A060), ), ), ), SizedBox( - height: 20, + height: 20.h, ), Expanded( child: inputWidgets(), @@ -596,7 +596,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { borderRadius: BorderRadius.circular(2), ), child: Text( - "登录", + S.of(context).login, style: TextStyle(fontSize: 18.sp, color: Colors.white), ), ), @@ -623,7 +623,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { ), ), ), - bottom: 33, + bottom: 33.h, left: 0, right: 0, ) @@ -801,10 +801,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { borderWidth: 1.w, radius: 2, padding: EdgeInsets.only( - left: 6.sp, - right: 6.sp, - top: 6.sp, - bottom: 6.sp, + left: 6.w, + right: 6.w, ), fontSize: 10.sp, textColor: _sendCodeStatus == 0 ? Color(0xFF32A060) : Color(0xFFFF7A1A), diff --git a/lib/main.dart b/lib/main.dart index 74ff1df8..a79b367d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -52,7 +52,11 @@ void main() { SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle(statusBarColor: Colors.transparent)); } - + WidgetsFlutterBinding.ensureInitialized(); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + // DeviceOrientation.portraitDown + ]); runApp(MyApp()); } diff --git a/lib/retrofit/data/activity.dart b/lib/retrofit/data/activity.dart index 91c0dcc9..54bdb56e 100644 --- a/lib/retrofit/data/activity.dart +++ b/lib/retrofit/data/activity.dart @@ -1,13 +1,8 @@ -import 'package:json_annotation/json_annotation.dart'; -part 'activity.g.dart'; - -@JsonSerializable() class Activity { Activity(); - String id; String createTime; dynamic createUser; @@ -24,8 +19,77 @@ class Activity { int isDelete; String storeName; - factory Activity.fromJson(Map json) => - _$ActivityFromJson(json); - Map toJson() => _$ActivityToJson(this); + factory Activity.fromJson(Map json) => Activity() + ..id = json['id'] + ..createTime = json['createTime'] + ..createUser = json['createUser'] + ..updateTime = json['updateTime'] + ..updateUser = json['updateUser'] + ..storeId = json['storeId'] + ..mainTitle = json['mainTitle'] + ..viceTitle = json['viceTitle'] + ..content = json['content'] + ..coverImg = json['coverImg'] + ..startTime = json['startTime'] + ..endTime = json['endTime'] + ..state = json['state'] + ..isDelete = json['isDelete'] + ..storeName = json['storeName']; + + + Map toJson() => { + 'id': this.id, + 'createTime': this.createTime, + 'createUser': this.createUser, + 'updateTime': this.updateTime, + 'updateUser': this.updateUser, + 'storeId': this.storeId, + 'mainTitle': this.mainTitle, + 'viceTitle': this.viceTitle, + 'content': this.content, + 'coverImg': this.coverImg, + 'startTime': this.startTime, + 'endTime': this.endTime, + 'state': this.state, + 'isDelete': this.isDelete, + 'storeName': this.storeName, + }; + + // 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, + // }; } \ No newline at end of file diff --git a/lib/retrofit/data/activity.g.dart b/lib/retrofit/data/activity.g.dart deleted file mode 100644 index de88e232..00000000 --- a/lib/retrofit/data/activity.g.dart +++ /dev/null @@ -1,44 +0,0 @@ -// 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.dart b/lib/retrofit/data/address.dart index e2a7a777..acd8494c 100644 --- a/lib/retrofit/data/address.dart +++ b/lib/retrofit/data/address.dart @@ -1,22 +1,5 @@ -import 'package:json_annotation/json_annotation.dart'; -/// address : "" -/// area : "" -/// city : "" -/// cityInfo : "" -/// id : 0 -/// isDefault : true -/// latitude : 0 -/// longitude : 0 -/// mid : 0 -/// phone : "" -/// province : "" -/// tag : "" -/// username : "" -part 'address.g.dart'; - -@JsonSerializable() class Address { Address(); @@ -34,7 +17,34 @@ class Address { String tag; String username; - factory Address.fromJson(Map json) => - _$AddressFromJson(json); - Map toJson() => _$AddressToJson(this); + factory Address.fromJson(Map json) => 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 toJson() => { + 'address': this.address, + 'area': this.area, + 'city': this.city, + 'cityInfo': this.cityInfo, + 'id': this.id, + 'isDefault': this.isDefault, + 'latitude': this.latitude, + 'longitude': this.longitude, + 'mid': this.mid, + 'phone': this.phone, + 'province': this.province, + 'tag': this.tag, + 'username': this.username, + }; } diff --git a/lib/retrofit/data/address.g.dart b/lib/retrofit/data/address.g.dart deleted file mode 100644 index 392f0ad0..00000000 --- a/lib/retrofit/data/address.g.dart +++ /dev/null @@ -1,40 +0,0 @@ -// 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.dart b/lib/retrofit/data/banner.dart index 46981967..acada831 100644 --- a/lib/retrofit/data/banner.dart +++ b/lib/retrofit/data/banner.dart @@ -1,8 +1,4 @@ -import 'package:json_annotation/json_annotation.dart'; -part 'banner.g.dart'; - -@JsonSerializable() class BannerData { String content; String createTime; @@ -18,8 +14,32 @@ class BannerData { BannerData({this.content, this.createTime, this.createUser, this.id, this.imgUrl, this.isDelete, this.storeId, this.tenantCode, this.type, this.updateTime, this.updateUser}); - factory BannerData.fromJson(Map json) => _$BannerDataFromJson(json); + factory BannerData.fromJson(Map json) => 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 toJson() => _$BannerDataToJson(this); + Map toJson() => { + 'content': this.content, + 'createTime': this.createTime, + 'createUser': this.createUser, + 'id': this.id, + 'imgUrl': this.imgUrl, + 'isDelete': this.isDelete, + 'storeId': this.storeId, + 'tenantCode': this.tenantCode, + 'type': this.type, + 'updateTime': this.updateTime, + 'updateUser': this.updateUser, + }; } diff --git a/lib/retrofit/data/banner.g.dart b/lib/retrofit/data/banner.g.dart deleted file mode 100644 index 1eca663a..00000000 --- a/lib/retrofit/data/banner.g.dart +++ /dev/null @@ -1,38 +0,0 @@ -// 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.dart b/lib/retrofit/data/base_data.dart index e24b1d25..e536de2d 100644 --- a/lib/retrofit/data/base_data.dart +++ b/lib/retrofit/data/base_data.dart @@ -1,9 +1,3 @@ - -import 'package:json_annotation/json_annotation.dart'; - -part 'base_data.g.dart'; - -@JsonSerializable() class BaseData { BaseData(); @@ -16,7 +10,24 @@ class BaseData { String path; String timestamp; - factory BaseData.fromJson(Map json) => - _$BaseDataFromJson(json); - Map toJson() => _$BaseDataToJson(this); + factory BaseData.fromJson(Map json) => 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 toJson() => { + 'code': this.code, + 'data': this.data, + 'extra': this.extra, + 'isError': this.isError, + 'isSuccess': this.isSuccess, + 'msg': this.msg, + 'path': this.path, + 'timestamp': this.timestamp, + }; } diff --git a/lib/retrofit/data/base_data.g.dart b/lib/retrofit/data/base_data.g.dart deleted file mode 100644 index 6985c4ef..00000000 --- a/lib/retrofit/data/base_data.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// 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.dart b/lib/retrofit/data/brand_data.dart index a83a2a27..c88e21ea 100644 --- a/lib/retrofit/data/brand_data.dart +++ b/lib/retrofit/data/brand_data.dart @@ -1,13 +1,6 @@ - import 'package:huixiang/retrofit/data/banner.dart'; -import 'package:json_annotation/json_annotation.dart'; - - -part 'brand_data.g.dart'; - -@JsonSerializable() class BrandData { BrandData(); @@ -23,9 +16,27 @@ class BrandData { dynamic ideals; - factory BrandData.fromJson(Map json) => - _$BrandDataFromJson(json); - Map toJson() => _$BrandDataToJson(this); + factory BrandData.fromJson(Map json) => 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 toJson() => { + 'bannerList': this.bannerList.map((e) => e.toJson()).toList(), + 'company': this.company, + 'companyDesc': this.companyDesc, + 'originAvatar': this.originAvatar, + 'originDesc': this.originDesc, + 'originator': this.originator, + 'contents': this.contents, + 'ideals': this.ideals, + }; } \ No newline at end of file diff --git a/lib/retrofit/data/brand_data.g.dart b/lib/retrofit/data/brand_data.g.dart deleted file mode 100644 index bce83c38..00000000 --- a/lib/retrofit/data/brand_data.g.dart +++ /dev/null @@ -1,33 +0,0 @@ -// 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.dart b/lib/retrofit/data/coupon.dart index 6f364a49..f6d691b6 100644 --- a/lib/retrofit/data/coupon.dart +++ b/lib/retrofit/data/coupon.dart @@ -1,45 +1,6 @@ -import 'package:json_annotation/json_annotation.dart'; - -/// bizId : "" -/// bizType : 0 -/// centreDisplay : true -/// createTime : "" -/// createUser : 0 -/// discountAmount : 0 -/// discountPercent : 0 -/// fullAmount : 0 -/// id : 0 -/// isDelete : 0 -/// memberCouponId : 0 -/// promotionId : 0 -/// publishEndTime : "" -/// publishStartTime : "" -/// receiveTime : "" -/// received : true -/// tenantCode : "" -/// updateTime : "" -/// updateUser : 0 -/// useEndTime : "" -/// useStartTime : "" -/// useTime : "" - -part 'coupon.g.dart'; - -///{"id":"1409793980522037248","createTime":"2021-06-29 16:40:52", -///"createUser":"1","updateTime":"2021-06-29 16:40:52","updateUser":"1", -///"bizType":5,"fullAmount":"0.00","discountAmount":"0.00","discountPercent":100, -///"bizId":"1409793980488482816","publishStartTime":"2021-06-29 16:39:14", -///"publishEndTime":"2021-06-29 16:39:14","useStartTime":"2021-06-29 16:39:14", -///"useEndTime":"2021-06-29 16:39:14","promotionId":"0","centreDisplay":false, -///"tenantCode":"admin","isDelete":0,"couponName":null, -///"memberCouponId":"1409806872449384448","receiveTime":"2021-06-29 17:32:06", -///"useTime":null,"status":1} -@JsonSerializable() class Coupon { - Coupon(); - String id; String createTime; String createUser; @@ -66,9 +27,58 @@ class Coupon { dynamic useTime; int status; + factory Coupon.fromJson(Map json) => 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; - factory Coupon.fromJson(Map json) => - _$CouponFromJson(json); - Map toJson() => _$CouponToJson(this); - -} \ No newline at end of file + Map toJson() => { + 'id': this.id, + 'createTime': this.createTime, + 'createUser': this.createUser, + 'updateTime': this.updateTime, + 'updateUser': this.updateUser, + 'bizType': this.bizType, + 'fullAmount': this.fullAmount, + 'discountAmount': this.discountAmount, + 'discountPercent': this.discountPercent, + 'bizId': this.bizId, + 'publishStartTime': this.publishStartTime, + 'publishEndTime': this.publishEndTime, + 'useStartTime': this.useStartTime, + 'useEndTime': this.useEndTime, + 'promotionId': this.promotionId, + 'centreDisplay': this.centreDisplay, + 'tenantCode': this.tenantCode, + 'isDelete': this.isDelete, + 'couponName': this.couponName, + 'couponImg': this.couponImg, + 'couponDescription': this.couponDescription, + 'memberCouponId': this.memberCouponId, + 'receiveTime': this.receiveTime, + 'useTime': this.useTime, + 'status': this.status, + }; +} diff --git a/lib/retrofit/data/coupon.g.dart b/lib/retrofit/data/coupon.g.dart deleted file mode 100644 index 2e658e18..00000000 --- a/lib/retrofit/data/coupon.g.dart +++ /dev/null @@ -1,64 +0,0 @@ -// 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.dart b/lib/retrofit/data/coupon_vo.dart index 064ddb3b..0b4ee87b 100644 --- a/lib/retrofit/data/coupon_vo.dart +++ b/lib/retrofit/data/coupon_vo.dart @@ -1,8 +1,4 @@ -import 'package:json_annotation/json_annotation.dart'; -part 'coupon_vo.g.dart'; - -@JsonSerializable() class CouponVo { String bizId; num bizType; @@ -33,15 +29,62 @@ class CouponVo { CouponVo({this.bizId, this.bizType, this.centreDisplay, this.couponDescription, this.couponImg, this.couponName, this.createTime, this.createUser, this.discountAmount, this.discountPercent, this.fullAmount, this.id, this.isDelete, this.memberCouponId, this.promotionId, this.publishEndTime, this.publishStartTime, this.receiveTime, this.received, this.status, this.tenantCode, this.updateTime, this.updateUser, this.useEndTime, this.useStartTime, this.useTime}); - //{"id":"1407301814381969408","createTime":"2021-06-22 19:37:54","createUser":"1336877238389309440", - // "updateTime":"2021-06-22 19:37:54","updateUser":"1336877238389309440","bizType":3,"fullAmo - //unt":"0.00","discountAmount":"0.00","discountPercent":100,"bizId":"","publishStartTime":"2021-06-08 12:00:00", - // "publishEndTime":"2021-07-30 12:00:00","useStartTime":"2021-06-09 12:00:00","useEndTime":"2021-06-26 12:00:00", - // "promotionId":"1407301660300017664","centreDisplay":true,"tenantCode":"1174","isDelete":0,"couponName":"兑换券", - // "couponImg":"https://pos.upload.gznl.top/1174/2021/06/0e80c809-4ea5-449d-a8b3-2c7b7e6dc9a7.jpg", - // "couponDescription":"11","memberCouponId":null,"receiveTime":null,"useTime":null,"status":0} - factory CouponVo.fromJson(Map json) => _$CouponVoFromJson(json); + factory CouponVo.fromJson(Map json) => 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 toJson() => _$CouponVoToJson(this); + Map toJson() => { + 'bizId': this.bizId, + 'bizType': this.bizType, + 'centreDisplay': this.centreDisplay, + 'couponDescription': this.couponDescription, + 'couponImg': this.couponImg, + 'couponName': this.couponName, + 'createTime': this.createTime, + 'createUser': this.createUser, + 'discountAmount': this.discountAmount, + 'discountPercent': this.discountPercent, + 'fullAmount': this.fullAmount, + 'id': this.id, + 'isDelete': this.isDelete, + 'memberCouponId': this.memberCouponId, + 'promotionId': this.promotionId, + 'publishEndTime': this.publishEndTime, + 'publishStartTime': this.publishStartTime, + 'receiveTime': this.receiveTime, + 'received': this.received, + 'status': this.status, + 'tenantCode': this.tenantCode, + 'updateTime': this.updateTime, + 'updateUser': this.updateUser, + 'useEndTime': this.useEndTime, + 'useStartTime': this.useStartTime, + 'useTime': this.useTime, + }; } diff --git a/lib/retrofit/data/coupon_vo.g.dart b/lib/retrofit/data/coupon_vo.g.dart deleted file mode 100644 index 3b2b8e04..00000000 --- a/lib/retrofit/data/coupon_vo.g.dart +++ /dev/null @@ -1,67 +0,0 @@ -// 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.dart b/lib/retrofit/data/data_type.dart index 5be78cec..cf67431b 100644 --- a/lib/retrofit/data/data_type.dart +++ b/lib/retrofit/data/data_type.dart @@ -1,16 +1,16 @@ -import 'package:json_annotation/json_annotation.dart'; -/// desc : "其他" -/// code : "OTHER" - -part 'data_type.g.dart'; - -@JsonSerializable() class DataType { DataType(); + String desc; String code; - factory DataType.fromJson(Map json) => - _$DataTypeFromJson(json); - Map toJson() => _$DataTypeToJson(this); -} \ No newline at end of file + + factory DataType.fromJson(Map json) => DataType() + ..desc = json['desc'] as String + ..code = json['code'] as String; + + Map toJson() => { + 'desc': this.desc, + 'code': this.code, + }; +} diff --git a/lib/retrofit/data/data_type.g.dart b/lib/retrofit/data/data_type.g.dart deleted file mode 100644 index 1ea5414e..00000000 --- a/lib/retrofit/data/data_type.g.dart +++ /dev/null @@ -1,18 +0,0 @@ -// 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.dart b/lib/retrofit/data/delivery_info.dart index f2b1ba83..c58156cb 100644 --- a/lib/retrofit/data/delivery_info.dart +++ b/lib/retrofit/data/delivery_info.dart @@ -1,8 +1,4 @@ -import 'package:json_annotation/json_annotation.dart'; -part 'delivery_info.g.dart'; - -@JsonSerializable() class DeliveryInfo { bool dadaRegStatus; String dadaSourceId; @@ -14,8 +10,24 @@ class DeliveryInfo { DeliveryInfo({this.dadaRegStatus, this.dadaSourceId, this.dadaStatus, this.dianwodaRegStatus, this.dianwodaStatus, this.meituanRegStatus, this.meituanStatus}); - factory DeliveryInfo.fromJson(Map json) => _$DeliveryInfoFromJson(json); + factory DeliveryInfo.fromJson(Map json) => 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 toJson() => _$DeliveryInfoToJson(this); + Map toJson() => { + 'dadaRegStatus': this.dadaRegStatus, + 'dadaSourceId': this.dadaSourceId, + 'dadaStatus': this.dadaStatus, + 'dianwodaRegStatus': this.dianwodaRegStatus, + 'dianwodaStatus': this.dianwodaStatus, + 'meituanRegStatus': this.meituanRegStatus, + 'meituanStatus': this.meituanStatus, + }; } diff --git a/lib/retrofit/data/delivery_info.g.dart b/lib/retrofit/data/delivery_info.g.dart deleted file mode 100644 index b3f141fc..00000000 --- a/lib/retrofit/data/delivery_info.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// 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.dart b/lib/retrofit/data/exchange_order.dart index 023200d3..81d5a887 100644 --- a/lib/retrofit/data/exchange_order.dart +++ b/lib/retrofit/data/exchange_order.dart @@ -1,25 +1,8 @@ import 'package:huixiang/retrofit/data/exchange_order_goods.dart'; -import 'package:json_annotation/json_annotation.dart'; -/// id : "1408693824171016192" -/// createTime : "2021-06-26 15:49:15" -/// createUser : "1405494095400402944" -/// updateTime : "2021-06-26 15:49:15" -/// updateUser : "1405494095400402944" -/// storeId : "1174" -/// mid : "1405494095400402944" -/// orderCode : "JF202106261549141" -/// amount : "77" -/// state : 1 -/// useTyped : 1 -/// isDelete : 0 -/// creditOrderDetailList : [{"id":"1408693824410091520","createTime":"2021-06-26 15:49:15","createUser":"1405494095400402944","updateTime":"2021-06-26 15:49:15","updateUser":"1405494095400402944","orderId":"1408693824171016192","goodsId":"1","categoryId":"1","name":"包包包1111","description":"包治百病","worth":"999.00","price":"77","couponId":"0","canPick":true,"canDelivery":false,"goodsMainImg":"https://pos.upload.gznl.top/0000/2020/10/e59fecd9-4533-463b-bef3-59f02b74e58f.jpg","goodsViceImg":"https://pos.upload.gznl.top/0000/2020/10/9c7beb43-9758-44d3-9cde-e09f979faeab.jpg","goodsNumber":1,"isDelete":0}] - -part 'exchange_order.g.dart'; - -@JsonSerializable() class ExchangeOrder { ExchangeOrder(); + String id; String createTime; String createUser; @@ -34,8 +17,38 @@ class ExchangeOrder { int isDelete; List creditOrderDetailList; - factory ExchangeOrder.fromJson(Map json) => - _$ExchangeOrderFromJson(json); - Map toJson() => _$ExchangeOrderToJson(this); + factory ExchangeOrder.fromJson(Map json) => 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 toJson() => { + 'id': this.id, + 'createTime': this.createTime, + 'createUser': this.createUser, + 'updateTime': this.updateTime, + 'updateUser': this.updateUser, + 'storeId': this.storeId, + 'mid': this.mid, + 'orderCode': this.orderCode, + 'amount': this.amount, + 'state': this.state, + 'useTyped': this.useTyped, + 'isDelete': this.isDelete, + 'creditOrderDetailList': this.creditOrderDetailList.map((e) => e.toJson()).toList(), + }; } diff --git a/lib/retrofit/data/exchange_order.g.dart b/lib/retrofit/data/exchange_order.g.dart deleted file mode 100644 index dfe5cd44..00000000 --- a/lib/retrofit/data/exchange_order.g.dart +++ /dev/null @@ -1,45 +0,0 @@ -// 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.dart b/lib/retrofit/data/exchange_order_goods.dart index 4f47f766..6f5acd30 100644 --- a/lib/retrofit/data/exchange_order_goods.dart +++ b/lib/retrofit/data/exchange_order_goods.dart @@ -1,31 +1,7 @@ -import 'package:json_annotation/json_annotation.dart'; -/// id : "1408693824410091520" -/// createTime : "2021-06-26 15:49:15" -/// createUser : "1405494095400402944" -/// updateTime : "2021-06-26 15:49:15" -/// updateUser : "1405494095400402944" -/// orderId : "1408693824171016192" -/// goodsId : "1" -/// categoryId : "1" -/// name : "包包包1111" -/// description : "包治百病" -/// worth : "999.00" -/// price : "77" -/// couponId : "0" -/// canPick : true -/// canDelivery : false -/// goodsMainImg : "https://pos.upload.gznl.top/0000/2020/10/e59fecd9-4533-463b-bef3-59f02b74e58f.jpg" -/// goodsViceImg : "https://pos.upload.gznl.top/0000/2020/10/9c7beb43-9758-44d3-9cde-e09f979faeab.jpg" -/// goodsNumber : 1 -/// isDelete : 0 - -part 'exchange_order_goods.g.dart'; - - -@JsonSerializable() class ExchangeOrderGoods { ExchangeOrderGoods(); + String id; String createTime; String createUser; @@ -46,10 +22,47 @@ class ExchangeOrderGoods { int goodsNumber; int isDelete; - factory ExchangeOrderGoods.fromJson(Map json) => - _$ExchangeOrderGoodsFromJson(json); - Map toJson() => _$ExchangeOrderGoodsToJson(this); - + 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; -} \ No newline at end of file + Map toJson() => { + 'id': this.id, + 'createTime': this.createTime, + 'createUser': this.createUser, + 'updateTime': this.updateTime, + 'updateUser': this.updateUser, + 'orderId': this.orderId, + 'goodsId': this.goodsId, + 'categoryId': this.categoryId, + 'name': this.name, + 'description': this.description, + 'worth': this.worth, + 'price': this.price, + 'couponId': this.couponId, + 'canPick': this.canPick, + 'canDelivery': this.canDelivery, + 'goodsMainImg': this.goodsMainImg, + 'goodsViceImg': this.goodsViceImg, + 'goodsNumber': this.goodsNumber, + 'isDelete': this.isDelete, + }; +} diff --git a/lib/retrofit/data/exchange_order_goods.g.dart b/lib/retrofit/data/exchange_order_goods.g.dart deleted file mode 100644 index 8ffd8d2d..00000000 --- a/lib/retrofit/data/exchange_order_goods.g.dart +++ /dev/null @@ -1,53 +0,0 @@ -// 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/union/union_page.dart b/lib/union/union_page.dart index 441c9e1b..4b22a5f1 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -257,55 +257,74 @@ class _UnionPage extends State with AutomaticKeepAliveClientMixin { child: Scaffold( resizeToAvoidBottomInset: true, body: NestedScrollView( - physics: BouncingScrollPhysics(), + physics: PageScrollPhysics(), headerSliverBuilder: (context, inner) { return [ - buildSliverAppBar(AMapWidget( - initialCameraPosition: CameraPosition( - target: LatLng(30.553111, 114.342366), - zoom: 12.0, - ), - onMapCreated: onMapCreated, - apiKey: aMapApiKeys, - touchPoiEnabled: true, - markers: markers.toSet(), - scrollGesturesEnabled: true, - customStyleOptions: _customStyleOptions, - onPoiTouched: (poiTouch) { - FocusScope.of(context).requestFocus(FocusNode()); - }, - gestureRecognizers: >[ - Factory( - () => EagerGestureRecognizer()), - ].toSet(), - )), + SliverOverlapAbsorber( + sliver: buildSliverAppBar(AMapWidget( + initialCameraPosition: CameraPosition( + target: LatLng(30.553111, 114.342366), + zoom: 12.0, + ), + onMapCreated: onMapCreated, + apiKey: aMapApiKeys, + touchPoiEnabled: true, + markers: markers.toSet(), + scrollGesturesEnabled: true, + customStyleOptions: _customStyleOptions, + onPoiTouched: (poiTouch) { + FocusScope.of(context).requestFocus(FocusNode()); + }, + gestureRecognizers: >[ + Factory( + () => EagerGestureRecognizer()), + ].toSet(), + )), + handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), + ) ]; }, - body: Container( - child: SmartRefresher( - controller: refreshController, - enablePullUp: false, - enablePullDown: true, - physics: BouncingScrollPhysics(), - header: MyHeader(), - onRefresh: () { - startLocation(); - }, - child: ListView.builder( - itemCount: storeList == null ? 0 : storeList.length, - padding: EdgeInsets.only(top: 8.h, bottom: 84.h), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - Navigator.of(context).pushNamed( - '/router/union_detail_page', - arguments: {"id": storeList[position].id}); - }, - child: buildStoreItem(storeList[position], position), - ); - }), - ), - ), + body: Builder( + builder: (context) { + return CustomScrollView( + physics: NeverScrollableScrollPhysics(), + slivers: [ + SliverOverlapInjector( + handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), + ), + SliverToBoxAdapter( + child: Container( + height: MediaQuery.of(context).size.height - 102.h - MediaQuery.of(context).padding.top, + child: SmartRefresher( + controller: refreshController, + enablePullUp: false, + enablePullDown: true, + physics: BouncingScrollPhysics(), + header: MyHeader(), + onRefresh: () { + startLocation(); + }, + child: ListView.builder( + itemCount: storeList == null ? 0 : storeList.length, + padding: EdgeInsets.only(top: 8.h, bottom: 84.h + (375.h - 88.h) + 4.h), + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/union_detail_page', + arguments: {"id": storeList[position].id}); + }, + child: buildStoreItem(storeList[position], position), + ); + }), + ), + ), + ), + ], + ); + }, + ) ), ), ); @@ -319,18 +338,6 @@ class _UnionPage extends State with AutomaticKeepAliveClientMixin { 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(); @@ -397,15 +404,16 @@ class _UnionPage extends State with AutomaticKeepAliveClientMixin { Widget buildSliverAppBar(AMapWidget map) { return SliverAppBar( + // 滑上去时搜索隐藏 + // floating: true, + // snap: true, pinned: true, - floating: true, - snap: true, backgroundColor: Color(0xFFFAFAFA), elevation: 0, automaticallyImplyLeading: false, title: Container( height: 36.h, - margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), + margin: EdgeInsets.fromLTRB(16.w,0, 16.w, 0), padding: EdgeInsets.fromLTRB(13.w, 6.h, 16.w, 6.h), decoration: BoxDecoration( color: Colors.white,