From 3783400390475cb0eaebe50d9390d4ea4140a152 Mon Sep 17 00:00:00 2001 From: CYH <13923927013@163.com> Date: Thu, 24 Aug 2023 16:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=B8=BA=E5=B8=B8=E9=87=8F=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E7=BB=98=E5=88=B6=EF=BC=8C=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E9=97=AA=E7=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- circle_app/lib/app/circle/view.dart | 13 +++--- .../app/circle/widgets/info_list_view.dart | 10 ++--- circle_app/lib/app/home/logic.dart | 41 +++++++++---------- circle_app/lib/app/invite/view.dart | 8 ++-- circle_app/lib/app/login/login/view.dart | 41 +++++++++---------- circle_app/lib/app/minefragment/view.dart | 29 +++++++------ circle_app/lib/app/msg/view.dart | 7 ++-- 7 files changed, 76 insertions(+), 73 deletions(-) diff --git a/circle_app/lib/app/circle/view.dart b/circle_app/lib/app/circle/view.dart index bab8ec6..605e71f 100644 --- a/circle_app/lib/app/circle/view.dart +++ b/circle_app/lib/app/circle/view.dart @@ -18,6 +18,11 @@ import '../select_circle/logic.dart'; import '../userinfo/logic.dart'; import 'logic.dart'; + +const bgWidget = DecorationImage( +fit: BoxFit.fill, +image: AssetImage('assets/images/base/home_back.png')); + class CirclePage extends StatefulWidget { CirclePage({Key? key}) : super(key: key); @@ -71,11 +76,9 @@ class _CirclePageState extends State return Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, - decoration: BoxDecoration( - color: const Color(0xFF423055), - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage(getBaseImage('home_back')))), + decoration: const BoxDecoration( + color: Color(0xFF423055), + image: bgWidget), child: Scaffold( backgroundColor: Colors.transparent, body: SafeArea( diff --git a/circle_app/lib/app/circle/widgets/info_list_view.dart b/circle_app/lib/app/circle/widgets/info_list_view.dart index 959c59c..d12c969 100644 --- a/circle_app/lib/app/circle/widgets/info_list_view.dart +++ b/circle_app/lib/app/circle/widgets/info_list_view.dart @@ -20,7 +20,10 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../../../util/SharedPreferencesHelper.dart'; import '../../../util/eventBus.dart'; - +const listBgWidget = Image( + image: AssetImage('assets/images/circle/circle_bg.png'), + fit: BoxFit.fill, +); class InfoListView extends StatefulWidget { // Get.lazyPut(() => ListLogic()); @@ -267,10 +270,7 @@ class InfoListViewState extends State with AutomaticKeepAliveClien borderRadius: BorderRadius.circular(10.sp), child: SizedBox( width: Get.width, - child: Image.asset( - getCircleImage('circle_bg'), - fit: BoxFit.fill, - ), + child: listBgWidget )), Container( height: Get.height, diff --git a/circle_app/lib/app/home/logic.dart b/circle_app/lib/app/home/logic.dart index 06bace7..964fab1 100644 --- a/circle_app/lib/app/home/logic.dart +++ b/circle_app/lib/app/home/logic.dart @@ -55,14 +55,12 @@ class HomeLogic extends GetxController { userInfo, text, ) async { - print("收到新消息"+text); - unreadSIze.value = (int.parse(unreadSIze.value)+1).toString(); + print("收到新消息" + text); + unreadSIze.value = (int.parse(unreadSIze.value) + 1).toString(); //getUnreadSize(); }); _messageService.addSimpleMsgListener(listener: msgListener); - - var data = await DioManager.instance.get(url: Api.APP_VERSION); var bean = BaseResponse.fromJson( data, (data) => UpdateInfo.fromJson(data)); @@ -76,35 +74,37 @@ class HomeLogic extends GetxController { await TencentImSDKPlugin.v2TIMManager .getConversationManager() .getTotalUnreadMessageCount(); - print("未读数量desc=" + getTotalUnreadMessageCountRes.desc.toString()+"code="+getTotalUnreadMessageCountRes.code.toString()+"data="+getTotalUnreadMessageCountRes.data.toString()); + print("未读数量desc=" + + getTotalUnreadMessageCountRes.desc.toString() + + "code=" + + getTotalUnreadMessageCountRes.code.toString() + + "data=" + + getTotalUnreadMessageCountRes.data.toString()); if (getTotalUnreadMessageCountRes.code == 0) { unreadSIze.value = getTotalUnreadMessageCountRes.data.toString(); if (Platform.isAndroid) { setOfflinePushStatus(status: AppStatus.foreground); } - - }else{ + } else { getUnreadSize(); } - } @override Future setOfflinePushStatus( {required AppStatus status, int? totalCount}) { - - if (status == AppStatus.foreground) { - // 当应用status为前台时,上报doForeground() - return TencentImSDKPlugin.v2TIMManager - .getOfflinePushManager() - .doForeground(); - } else { - // 当应用status为后台时,上报doBackground(),并带上未读数 - return TencentImSDKPlugin.v2TIMManager - .getOfflinePushManager() - .doBackground(unreadCount: totalCount ?? 0); - } + if (status == AppStatus.foreground) { + // 当应用status为前台时,上报doForeground() + return TencentImSDKPlugin.v2TIMManager + .getOfflinePushManager() + .doForeground(); + } else { + // 当应用status为后台时,上报doBackground(),并带上未读数 + return TencentImSDKPlugin.v2TIMManager + .getOfflinePushManager() + .doBackground(unreadCount: totalCount ?? 0); + } } @override @@ -113,7 +113,6 @@ class HomeLogic extends GetxController { super.onReady(); FlutterNativeSplash.remove(); - } void showReportDialog( diff --git a/circle_app/lib/app/invite/view.dart b/circle_app/lib/app/invite/view.dart index 00751aa..4f7092d 100644 --- a/circle_app/lib/app/invite/view.dart +++ b/circle_app/lib/app/invite/view.dart @@ -275,12 +275,12 @@ class InvitePage extends StatelessWidget { Container( margin: EdgeInsets.only(top: 15.sp), alignment: Alignment.center, - child: Image.asset(getMineImage('invite_title'),width: 256.sp,), + child: Image.asset(getMineImage('invite_title'),height: 22.sp,), ), Container( - margin: EdgeInsets.only(top: 10.sp), + margin: EdgeInsets.only(top: 15.sp), alignment: Alignment.center, - child: Image.asset(getMineImage('invite_line'),width: 328.sp,), + child: Image.asset(getMineImage('invite_line'),height: 1.2.sp,), ), Container( height: 70.sp, @@ -353,7 +353,7 @@ class InvitePage extends StatelessWidget { Expanded(child: Container()), Container( margin: EdgeInsets.only( - left: 15.sp, right: 15.sp,bottom: 20.sp), + left: 15.sp, right: 15.sp,bottom: 15.sp), child: RichText( text: TextSpan( children: allSpan diff --git a/circle_app/lib/app/login/login/view.dart b/circle_app/lib/app/login/login/view.dart index 957d74f..23e29b6 100644 --- a/circle_app/lib/app/login/login/view.dart +++ b/circle_app/lib/app/login/login/view.dart @@ -6,7 +6,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'logic.dart'; - +const loginBgWidget = Image( + image: AssetImage('assets/images/base/bg.png'), + fit: BoxFit.fill, +); class LoginPage extends StatelessWidget { LoginPage({Key? key}) : super(key: key); @@ -19,13 +22,9 @@ class LoginPage extends StatelessWidget { @override Widget build(BuildContext context) { return Stack( + fit: StackFit.expand, children: [ - Image.asset( - getBaseImage('bg'), - fit: BoxFit.fill, - width: Get.width, - height: Get.height, - ), + loginBgWidget, GestureDetector( onTap: () { FocusManager.instance.primaryFocus?.unfocus(); @@ -61,10 +60,10 @@ class LoginPage extends StatelessWidget { child: Container( width: 280.sp, - height: 50.sp, + height: 60.sp, decoration: BoxDecoration( // color: Colors.white60, - borderRadius: BorderRadius.circular(25.sp), + borderRadius: BorderRadius.circular(30.sp), border: Border.all(color: Colors.white60,width: 0.5.sp) ),)), Row( @@ -118,7 +117,7 @@ class LoginPage extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(top: 20.sp), + margin: EdgeInsets.only(top: 25.sp), child: Stack( alignment: Alignment.center, children: [ @@ -127,10 +126,10 @@ class LoginPage extends StatelessWidget { child: Container( width: 280.sp, - height: 50.sp, + height: 60.sp, decoration: BoxDecoration( // color: Colors.white60, - borderRadius: BorderRadius.circular(25.sp), + borderRadius: BorderRadius.circular(30.sp), border: Border.all(color: Colors.white60,width: 0.5.sp) ),)), Row( @@ -205,18 +204,18 @@ class LoginPage extends StatelessWidget { logic.login(); }, child: Container( - width: 168.sp, - height: 42.sp, + width: 200.sp, + height: 50.sp, alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(21.sp), + borderRadius: BorderRadius.circular(25.sp), gradient: const LinearGradient( begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Color(0xff0AFCFF), Color(0xffD739EA)])), child: Text( '登录', - style: TextStyle(color: Colors.white, fontSize: 16.sp), + style: TextStyle(color: Colors.white, fontSize: 16.sp,fontWeight: FontWeight.w500), ), ), ), @@ -232,13 +231,13 @@ class LoginPage extends StatelessWidget { child: Container( child: Row( children: [ - !logic.check ? Container(width: 14.sp,height: 14.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 15.sp,color: Color(0xff00FFF4),), + !logic.check ? Container(width: 18.sp,height: 18.sp,decoration: BoxDecoration(border: Border.all(color: Colors.white70,width: 1.sp),borderRadius: BorderRadius.circular(10)),): Icon(Icons.check_circle_rounded,size: 19.sp,color: Color(0xff00FFF4),), SizedBox(width: 4.sp,), Text( '同意', style: TextStyle( color: Colors.white, - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w600), ), SizedBox( @@ -252,7 +251,7 @@ class LoginPage extends StatelessWidget { '《用户协议》', style: TextStyle( color: Color(0xff00FFF4), - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w400, ), ), @@ -261,7 +260,7 @@ class LoginPage extends StatelessWidget { '和', style: TextStyle( color: Colors.white, - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w600), ), SizedBox( @@ -275,7 +274,7 @@ class LoginPage extends StatelessWidget { '《隐私协议》', style: TextStyle( color: Color(0xff00FFF4), - fontSize: 11.sp, + fontSize: 14.sp, fontWeight: FontWeight.w400, ), ), diff --git a/circle_app/lib/app/minefragment/view.dart b/circle_app/lib/app/minefragment/view.dart index eacc498..4b1ec7c 100644 --- a/circle_app/lib/app/minefragment/view.dart +++ b/circle_app/lib/app/minefragment/view.dart @@ -2,8 +2,10 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:circle_app/app/circle/view.dart'; import 'package:circle_app/router/app_routers.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -12,11 +14,18 @@ import '../../util/SharedPreferencesHelper.dart'; import '../../util/util.dart'; import 'logic.dart'; +const vipIcon = 'assets/images/home/icon_vip.png'; + +const MyImageWidget = const Image( + image: AssetImage(vipIcon), + fit: BoxFit.fill, +); class MinefragmentPage extends StatelessWidget { MinefragmentPage({Key? key}) : super(key: key); final logic = Get.lazyPut(() => MinefragmentLogic()); + final state = Get .find() .state; @@ -34,11 +43,8 @@ class MinefragmentPage extends StatelessWidget { body: Container( width: Get.width, height: Get.height, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getBaseImage("home_back")), - fit: BoxFit.cover, - ), + decoration: const BoxDecoration( + image: bgWidget ), child: Padding( padding: EdgeInsets.only( @@ -55,17 +61,14 @@ class MinefragmentPage extends StatelessWidget { showRechargeDialog(logic); }, child: Stack(children: [ - Image( - image: AssetImage(getHomeImage("icon_vip")), - fit: BoxFit.fill, - ), + MyImageWidget, Positioned( - top: 54.sp, - left: 71.3.sp, + top: 58.sp, + left: 90.sp, child: Text(logic.vipMsg,style: TextStyle(color: const Color(0x99FFFFFF),fontSize: 12.sp),)), Positioned( - top: 24.sp, - left: 71.3.sp, + top: 32.sp, + left: 90.sp, child: Text("会员-微乐园贵宾",style: TextStyle(color: const Color(0xFFFFFFFF),fontSize: 16.sp),)) ],), ), diff --git a/circle_app/lib/app/msg/view.dart b/circle_app/lib/app/msg/view.dart index 1ab3b78..8fada4a 100644 --- a/circle_app/lib/app/msg/view.dart +++ b/circle_app/lib/app/msg/view.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'package:circle_app/app/circle/logic.dart'; +import 'package:circle_app/app/circle/view.dart'; import 'package:circle_app/common/Widgets/open_vip_tip/view.dart'; import 'package:circle_app/main.dart'; import 'package:circle_app/network/api.dart'; @@ -63,10 +64,8 @@ class MsgPage extends StatelessWidget { Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, - decoration: BoxDecoration( - image: DecorationImage( - fit: BoxFit.fill, - image: AssetImage(getBaseImage('home_back')))), + decoration: const BoxDecoration( + image: bgWidget), ), SafeArea( child: GetBuilder(builder: (MsgLogic controller) {