diff --git a/assets/icons/identify.png b/assets/icons/identify.png new file mode 100644 index 00000000..c4470f09 Binary files /dev/null and b/assets/icons/identify.png differ diff --git a/assets/icons/intergral.png b/assets/icons/intergral.png new file mode 100644 index 00000000..8ba29f0e Binary files /dev/null and b/assets/icons/intergral.png differ diff --git a/assets/icons/vip1.png b/assets/icons/vip1.png new file mode 100644 index 00000000..9652a1c4 Binary files /dev/null and b/assets/icons/vip1.png differ diff --git a/assets/icons/vip2.png b/assets/icons/vip2.png new file mode 100644 index 00000000..dfab267d Binary files /dev/null and b/assets/icons/vip2.png differ diff --git a/assets/icons/vip3.png b/assets/icons/vip3.png new file mode 100644 index 00000000..fce8f396 Binary files /dev/null and b/assets/icons/vip3.png differ diff --git a/assets/icons/vip4.png b/assets/icons/vip4.png new file mode 100644 index 00000000..0d43c0d2 Binary files /dev/null and b/assets/icons/vip4.png differ diff --git a/assets/icons/vip_font.png b/assets/icons/vip_font.png new file mode 100644 index 00000000..4e1ef207 Binary files /dev/null and b/assets/icons/vip_font.png differ diff --git a/assets/static/integral_background.png b/assets/static/integral_background.png new file mode 100644 index 00000000..4a00917b Binary files /dev/null and b/assets/static/integral_background.png differ diff --git a/assets/static/sign_in_background.png b/assets/static/sign_in_background.png new file mode 100644 index 00000000..6c9241e7 Binary files /dev/null and b/assets/static/sign_in_background.png differ diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 42258def..ffa98711 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -1,3 +1,5 @@ +part 'sars_api.dart'; + class API { ///HOST static const String host = 'http://shop.kaidalai.cn'; @@ -24,6 +26,7 @@ class API { static _Search search = _Search(); static _Pay pay = _Pay(); static _House house = _House(); + static _SarsApi sarsApi = _SarsApi(); } class _Login { diff --git a/lib/constants/sars_api.dart b/lib/constants/sars_api.dart new file mode 100644 index 00000000..b4f5c1fe --- /dev/null +++ b/lib/constants/sars_api.dart @@ -0,0 +1,16 @@ +part of 'api.dart'; + +class _SarsApi { + _City city = _City(); + _LoginAndSignup login = _LoginAndSignup(); +} + +class _City { + ///查询所有的城市信息 + String get allCity => '/app/city/allCity'; +} + +class _LoginAndSignup { + ///查询所有小区信息 + String get allCommunity => '/app/login/findAllCommunity'; +} diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 1bd1b401..ce526ccb 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -571,9 +571,17 @@ class $AssetsIconsGen { AssetGenImage get iconTopicThird => const AssetGenImage('assets/icons/icon_topic_third.png'); + /// File path: assets/icons/identify.png + AssetGenImage get identify => + const AssetGenImage('assets/icons/identify.png'); + /// File path: assets/icons/img_add.png AssetGenImage get imgAdd => const AssetGenImage('assets/icons/img_add.png'); + /// File path: assets/icons/intergral.png + AssetGenImage get intergral => + const AssetGenImage('assets/icons/intergral.png'); + /// File path: assets/icons/introduce.png AssetGenImage get introduce => const AssetGenImage('assets/icons/introduce.png'); @@ -914,6 +922,21 @@ class $AssetsIconsGen { AssetGenImage get userIconWdsqhd => const AssetGenImage('assets/icons/user_icon_wdsqhd.png'); + /// File path: assets/icons/vip1.png + AssetGenImage get vip1 => const AssetGenImage('assets/icons/vip1.png'); + + /// File path: assets/icons/vip2.png + AssetGenImage get vip2 => const AssetGenImage('assets/icons/vip2.png'); + + /// File path: assets/icons/vip3.png + AssetGenImage get vip3 => const AssetGenImage('assets/icons/vip3.png'); + + /// File path: assets/icons/vip4.png + AssetGenImage get vip4 => const AssetGenImage('assets/icons/vip4.png'); + + /// File path: assets/icons/vip_font.png + AssetGenImage get vipFont => const AssetGenImage('assets/icons/vip_font.png'); + /// File path: assets/icons/xianshi.png AssetGenImage get xianshi => const AssetGenImage('assets/icons/xianshi.png'); } @@ -1080,6 +1103,10 @@ class $AssetsStaticGen { AssetGenImage get idCardFront => const AssetGenImage('assets/static/id_card_front.png'); + /// File path: assets/static/integral_background.png + AssetGenImage get integralBackground => + const AssetGenImage('assets/static/integral_background.png'); + /// File path: assets/static/parking_grey.webp AssetGenImage get parkingGrey => const AssetGenImage('assets/static/parking_grey.webp'); @@ -1095,6 +1122,10 @@ class $AssetsStaticGen { /// File path: assets/static/reviewing.webp AssetGenImage get reviewing => const AssetGenImage('assets/static/reviewing.webp'); + + /// File path: assets/static/sign_in_background.png + AssetGenImage get signInBackground => + const AssetGenImage('assets/static/sign_in_background.png'); } class $AssetsTabGen { diff --git a/lib/pages/personal/intergral/integral_center_page.dart b/lib/pages/personal/intergral/integral_center_page.dart new file mode 100644 index 00000000..94207701 --- /dev/null +++ b/lib/pages/personal/intergral/integral_center_page.dart @@ -0,0 +1,218 @@ +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/widget/bee_back_button.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class integralCenterPage extends StatefulWidget { + const integralCenterPage({Key? key}) : super(key: key); + + @override + _integralCenterPageState createState() => _integralCenterPageState(); +} + +class _integralCenterPageState extends State { + @override + Widget build(BuildContext context) { + var gridview = Container( + // height: 400.w, + padding: EdgeInsets.symmetric(horizontal: 48.w, vertical: 48.w), + child: GridView.count( + shrinkWrap: true, + padding: EdgeInsets.zero, + crossAxisCount: 3, + physics: NeverScrollableScrollPhysics(), + children: [ + gridCard(Assets.icons.identify.path, '身份标识', () {}), + gridCard(Assets.icons.identify.path, '积分加速', () {}), + gridCard(Assets.icons.identify.path, '支付优惠', () {}), + gridCard(Assets.icons.identify.path, '生日祝福', () {}), + gridCard(Assets.icons.identify.path, '会员活动', () {}), + gridCard(Assets.icons.identify.path, '炫彩用户名', () {}), + ], + ), + ); + var top = Positioned( + top: 198.w, + child: Column( + children: [ + Assets.icons.vip1.image(width: 178.w, height: 220.w), + 32.w.heightBox, + '一级会员'.text.size(32.sp).color(Color(0xFFFFD89F)).bold.make(), + ], + )); + var back = ClipPath( + clipper: _IntegralBackgroundClip(), + child: Container( + color: Color(0xFF303843), + width: double.infinity, + height: 1000.w, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Spacer(), + Padding( + padding: EdgeInsets.only(left: 48.w), + child: Row( + children: [ + '等级特权专属'.text.size(32.sp).white.bold.make(), + 24.w.widthBox, + '更多特权还在路上~' + .text + .size(22.sp) + .color(Colors.white.withOpacity(0.45)) + .make(), + ], + ), + ), + gridview, + ], + ), + ), + ); + return Scaffold( + extendBodyBehindAppBar: true, + extendBody: true, + appBar: AppBar( + backgroundColor: Colors.transparent, + title: RichText( + text: TextSpan(children: [ + WidgetSpan( + child: Assets.icons.vipFont.image(height: 45.w), + ), + TextSpan( + text: ' 积分中心', + style: TextStyle( + color: Colors.white.withOpacity(0.85), + fontSize: 36.w, + fontWeight: FontWeight.bold)) + ])), + centerTitle: true, + leading: BeeBackButton( + color: Colors.white, + ), + actions: [ + IconButton( + onPressed: () {}, + icon: Icon( + CupertinoIcons.question_circle, + size: 32.sp, + color: Colors.white, + )) + ], + ), + backgroundColor: Colors.white, + body: Container( + height: double.infinity, + width: double.infinity, + decoration: BoxDecoration( + image: DecorationImage( + alignment: Alignment.topCenter, + image: AssetImage(Assets.static.integralBackground.path))), + child: Stack( + alignment: Alignment.bottomCenter, + children: [ + back, + top, + Positioned( + top: 547.w, + child: Material( + color: Colors.white, + borderRadius: BorderRadius.circular(24.w), + child: Container( + width: 686.w, + height: 343.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.w), + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color(0xD9FBB246), + Color(0xE6FF7145), + ])), + child: Padding( + padding: EdgeInsets.all(32.w), + child: Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '活跃度'.text.size(28.sp).white.make(), + 24.w.heightBox, + '2501'.text.size(56.sp).white.make(), + ], + ), + 48.w.widthBox, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '积分'.text.size(28.sp).white.make(), + 24.w.heightBox, + '123'.text.size(56.sp).white.make(), + ], + ), + Spacer(), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + '积分获取比例'.text.size(28.sp).white.make(), + 24.w.heightBox, + '5%'.text.size(56.sp).white.make(), + ], + ) + ], + ), + ), + ), + )), + ], + ), + ), + ); + } + + Widget gridCard(String path, String title, VoidCallback onPressed) { + return GestureDetector( + onTap: onPressed, + child: Column( + children: [ + Image.asset( + path, + width: 106.w, + height: 106.w, + ), + 16.w.heightBox, + title.text + .minFontSize(4) + .maxFontSize(28) + .maxLines(1) + .stepGranularity(2) + .white + .make() + ], + ), + ); + } +} + +class _IntegralBackgroundClip extends CustomClipper { + @override + Path getClip(Size size) { + var offset = 25.0; + var path = Path(); + path.moveTo(0, offset); + path.quadraticBezierTo(size.width / 2, 0, size.width, offset); + path.lineTo(size.width, size.height); + path.lineTo(0, size.height); + path.lineTo(0, offset); + path.close(); + return path; + } + + @override + bool shouldReclip(covariant CustomClipper oldClipper) { + return false; + } +} diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 7ede4c27..40e79b18 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -1,5 +1,6 @@ import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/pages/personal/user_profile_page.dart'; import 'package:aku_new_community/pages/setting_page/settings_page.dart'; import 'package:aku_new_community/pages/sign/sign_in_page.dart'; @@ -19,6 +20,7 @@ import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'address/address_list_page.dart'; +import 'intergral/integral_center_page.dart'; class PersonalIndex extends StatefulWidget { final bool? isSign; @@ -201,6 +203,11 @@ class _PersonalIndexState extends State ).expand(); } + @override + void initState() { + super.initState(); + } + @override Widget build(BuildContext context) { super.build(context); @@ -522,6 +529,44 @@ class _PersonalIndexState extends State ], ), ), + 24.w.heightBox, + Container( + width: double.infinity, + height: 100.w, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration( + // color: Colors.white, + borderRadius: BorderRadius.circular(16.w)), + margin: EdgeInsets.symmetric(horizontal: 32.w), + child: Material( + color: Colors.white, + child: InkWell( + onTap: () { + Get.to(() => integralCenterPage()); + }, + borderRadius: BorderRadius.circular(16.w), + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 32.w, vertical: 24.w), + child: Row( + children: [ + '我的积分'.text.size(30.sp).black.bold.make(), + Spacer(), + Assets.icons.intergral + .image(width: 32.w, height: 32.w), + 16.w.widthBox, + '123'.text.size(28.sp).black.make(), + 16.w.widthBox, + Icon( + CupertinoIcons.right_chevron, + size: 24.w, + ), + ], + ), + ), + ), + ), + ), Container( decoration: BoxDecoration( color: Color(0xffffffff), diff --git a/lib/pages/sign/login_page.dart b/lib/pages/sign/login_page.dart deleted file mode 100644 index 59bd3043..00000000 --- a/lib/pages/sign/login_page.dart +++ /dev/null @@ -1,62 +0,0 @@ -import 'package:aku_new_community/base/base_style.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; - -class LoginPage extends StatefulWidget { - const LoginPage({Key? key}) : super(key: key); - - @override - _LoginPageState createState() => _LoginPageState(); -} - -class _LoginPageState extends State { - @override - Widget build(BuildContext context) { - return BeeScaffold( - body: Column( - children: [ - '登录解锁更多功能'.text.size(36.sp).color(ktextPrimary).bold.make(), - 144.w.heightBox, - Column( - children: [ - '${'154793018'}'.text.size(36.sp).color(ktextPrimary).bold.make(), - 40.w.heightBox, - MaterialButton( - onPressed: () {}, - elevation: 0, - height: 45.w, - minWidth: 256.w, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(60.w)), - child: '本机号码一键登录'.text.size(32.sp).black.bold.make(), - ) - ], - ), - Spacer(), - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 24.sp, - color: ktextSubColor, - ), - text: '注册/登记即代表同意', - children: [ - WidgetSpan( - child: InkWell( - onTap: () { - //TODO:跳转隐私政策 - }, - child: '《小蜜蜂隐私政策及用户协议》' - .text - .size(24.sp) - .color(Color(0xFF5096F1)) - .make(), - )), - ])), - ], - ), - ); - } -}