From 4f03080506f4bed53cfa0a33d260c19a7333e595 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Fri, 18 Mar 2022 18:06:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=80=E9=97=A8=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opening_code_page/opening_code_page.dart | 273 ++++++++++++------ lib/pages/sign/login/forgot_set_psd_page.dart | 2 +- lib/pages/sign/sign_func.dart | 2 +- lib/provider/app_provider.dart | 1 + lib/widget/animated/OverlayWidget.dart | 10 +- 5 files changed, 199 insertions(+), 89 deletions(-) diff --git a/lib/pages/opening_code_page/opening_code_page.dart b/lib/pages/opening_code_page/opening_code_page.dart index d3b0cd22..072ca80d 100644 --- a/lib/pages/opening_code_page/opening_code_page.dart +++ b/lib/pages/opening_code_page/opening_code_page.dart @@ -1,15 +1,20 @@ import 'dart:async'; import 'package:aku_new_community/constants/api.dart'; +import 'package:aku_new_community/ui/profile/new_house/certification/certification_page.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/net_util.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; +import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_icons/flutter_icons.dart'; +import 'package:get/get.dart'; import 'package:qr_flutter/qr_flutter.dart'; class OpeningCodePage extends StatefulWidget { @@ -79,95 +84,201 @@ class _OpeningCodePageState extends State { return BeeScaffold( bgColor: Colors.white, title: '开门码', - body: EasyRefresh( - firstRefresh: true, - header: MaterialHeader(), - onRefresh: () async { - await getQrcode(); - }, - child: _onload - ? Container() - : ListView( - children: [ - Container( - margin: EdgeInsets.only( - top: 70.w, + body: SafeArea( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color(0xFFFFD487), + Color(0xFFFFD76F).withOpacity(0.19) + ])), + child: EasyRefresh( + firstRefresh: true, + header: MaterialHeader(), + onRefresh: () async { + // await getQrcode(); + _qrCode = DateTime.now().toString(); + _overDate = true; + _onload = false; + setState(() {}); + }, + child: _onload + ? Container() + : ListView( + padding: EdgeInsets.only( + top: 123.w, left: 32.w, right: 32.w, - bottom: 76.w, ), - padding: EdgeInsets.symmetric( - horizontal: 20.w, - vertical: 32.w, - ), - decoration: BoxDecoration( - color: Color(0xffffffff), - borderRadius: BorderRadius.all(Radius.circular(8.w)), - ), - height: 746.w, - width: 686.w, - child: Column( - children: [ - Container( - margin: EdgeInsets.only( - top: 44.w, - bottom: 32.w, - ), - height: 460.w, - width: 460.w, - child: QrImage( - padding: EdgeInsets.zero, - data: _qrCode, - size: 460.w, - ), - ), - Container( - padding: EdgeInsets.symmetric( - horizontal: 29.w, - vertical: 33.w, - ), - decoration: BoxDecoration( - color: Color(0xfffffbf6), - borderRadius: - BorderRadius.all(Radius.circular(8.w)), + children: [ + Stack( + clipBehavior: Clip.none, + children: [ + Container( + padding: EdgeInsets.symmetric( + horizontal: 20.w, + vertical: 32.w, + ), + decoration: BoxDecoration( + color: Color(0xFFFEFDF3), + borderRadius: + BorderRadius.all(Radius.circular(32.w)), + ), + height: 952.w, + child: Column( + children: [ + 107.hb, + Container( + width: 192.w, + height: 42.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.06), + borderRadius: + BorderRadius.circular(45.w)), + alignment: Alignment.center, + child: Text( + UserTool.userProvider.userInfoModel! + .nickName ?? + "", + style: TextStyle( + color: Colors.black, fontSize: 24.sp), + ), + ), + 48.hb, + Text( + '2栋 1单元 1402室', + style: TextStyle( + fontSize: 32.sp, + color: Colors.black, + ), + ), + 24.hb, + Container( + margin: + EdgeInsets.symmetric(horizontal: 65.w), + height: 556.w, + width: 556.w, + color: Colors.white, + padding: EdgeInsets.all(56.w), + child: QrImage( + padding: EdgeInsets.zero, + data: _qrCode, + size: 460.w, + ), + ), + ], + ), ), - width: 646.w, - height: 146.w, - child: Text( - '扫一扫,你的专属二维码,人人文明出行,路路畅通安宁,智慧小区祝您一路顺风', - maxLines: 2, - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff666666), + Positioned( + top: -80.w, + left: 257.w, + child: Container( + width: 160.w, + height: 160.w, + decoration: BoxDecoration( + color: Color(0xFFFEFDF3), + borderRadius: BorderRadius.circular(80.w), + ), + alignment: Alignment.center, + child: Container( + clipBehavior: Clip.antiAliasWithSaveLayer, + width: 146.w, + height: 146.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(73.w), + ), + child: BeeImageNetwork( + width: 146.w, + height: 146.w, + imgs: UserTool + .userProvider.userInfoModel!.imgList, + ), + ), ), ), + ], + ), + 32.hb, + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16.w), ), - ], - ), - ), - Container( - alignment: Alignment.center, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - AntDesign.checkcircleo, - color: Color(0xffffc40c), - size: 32.sp, + child: Column( + children: [ + buildRow( + onTap: () { + BotToast.showText(text: '当前小区未接入开门码功能'); + }, + text: '开门记录', + suffix: ''), + buildRow( + onTap: () { + BotToast.showText(text: '当前小区未接入开门码功能'); + }, + text: '人脸识别', + suffix: ''), + buildRow( + onTap: () { + UserTool.userProvider.userInfoModel!.idCard == + null + ? Get.off(() => CertificationPage()) + : BotToast.showText(text: '已实名认证'); + }, + text: '开门记录', + suffix: UserTool.userProvider.userInfoModel! + .idCard == + null + ? '未认证' + : '已认证') + ].sepWidget( + separate: BeeDivider.horizontal( + indent: 32.w, + endIndent: 32.w, + )), ), - SizedBox(width: 19.w), - Text( - _overDate ? '已过期' : '已刷新', - style: TextStyle( - fontSize: 32.sp, - color: Color(0xff999999), - ), - ), - ], - ), + ), + ], ), - ], - ), + ), + ), + ), + ); + } + + GestureDetector buildRow( + {required VoidCallback onTap, + required String text, + required String suffix}) { + return GestureDetector( + onTap: onTap, + child: Material( + color: Colors.transparent, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + child: Row( + children: [ + text.text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + Spacer(), + suffix.text + .size(28.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + 24.wb, + Icon( + CupertinoIcons.chevron_right, + size: 24.w, + color: Colors.black.withOpacity(0.25), + ) + ], + ), + ), ), ); } diff --git a/lib/pages/sign/login/forgot_set_psd_page.dart b/lib/pages/sign/login/forgot_set_psd_page.dart index dc849f0b..dda4472b 100644 --- a/lib/pages/sign/login/forgot_set_psd_page.dart +++ b/lib/pages/sign/login/forgot_set_psd_page.dart @@ -171,7 +171,7 @@ class _ForgotSetPsdPageState extends State { widget.tel, _codeController.text); if (result) { - Get.to(() => LoginPage()); + Get.offAll(() => LoginPage()); } } : null, diff --git a/lib/pages/sign/sign_func.dart b/lib/pages/sign/sign_func.dart index 0f1836d8..2a48ac14 100644 --- a/lib/pages/sign/sign_func.dart +++ b/lib/pages/sign/sign_func.dart @@ -51,7 +51,7 @@ class SignFunc { static Future login( String phone, String code, int communityId) async { Response response = await NetUtil().dio!.post( - API.login.login, + SAASAPI.login.login, data: { 'tel': phone, 'password': code, diff --git a/lib/provider/app_provider.dart b/lib/provider/app_provider.dart index 293d3c74..7b95162a 100644 --- a/lib/provider/app_provider.dart +++ b/lib/provider/app_provider.dart @@ -350,6 +350,7 @@ class AppProvider extends ChangeNotifier { notifyListeners(); } + ///登录页验证码计时器 int second = 60; bool timerStart = false; Timer? timer; diff --git a/lib/widget/animated/OverlayWidget.dart b/lib/widget/animated/OverlayWidget.dart index 50792f41..1d1083b0 100644 --- a/lib/widget/animated/OverlayWidget.dart +++ b/lib/widget/animated/OverlayWidget.dart @@ -1,11 +1,9 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/pages/opening_code_page/opening_code_page.dart'; import 'package:aku_new_community/utils/headers.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; class OverlayLivingBtnWidget extends StatefulWidget { OverlayLivingBtnWidget({ @@ -67,7 +65,7 @@ class _OverlayLivingBtnWidgetState extends State ), GestureDetector( onTap: () { - Get.to(OpeningCodePage()); + Get.to(() => OpeningCodePage()); }, onPanUpdate: (detail) { setState(() {