diff --git a/circle_app/assets/images/base/no_result.png b/circle_app/assets/images/base/no_result.png new file mode 100644 index 0000000..4f58dad Binary files /dev/null and b/circle_app/assets/images/base/no_result.png differ diff --git a/circle_app/lib/app/aboutapp/logic.dart b/circle_app/lib/app/aboutapp/logic.dart index 2b3d5cb..b6a46d7 100644 --- a/circle_app/lib/app/aboutapp/logic.dart +++ b/circle_app/lib/app/aboutapp/logic.dart @@ -1,5 +1,5 @@ import 'package:dio/dio.dart'; -// import 'package:flutter_install_app/flutter_install_app.dart'; +import 'package:flutter_install_app/flutter_install_app.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; @@ -42,7 +42,7 @@ class AboutappLogic extends GetxController { // SmartDialog.dismiss(); // print(error); // }); - // await AppInstaller.installApk(filePath, actionRequired: false); + await AppInstaller.installApk(filePath, actionRequired: false); } diff --git a/circle_app/lib/app/blacklist/logic.dart b/circle_app/lib/app/blacklist/logic.dart index 5bdd249..5598bf4 100644 --- a/circle_app/lib/app/blacklist/logic.dart +++ b/circle_app/lib/app/blacklist/logic.dart @@ -11,6 +11,8 @@ class BlacklistLogic extends GetxController { final RefreshController refreshController = RefreshController(); int page = 1; List lists = []; + + bool isLoad = true; @override void onInit() async{ super.onInit(); @@ -31,6 +33,7 @@ class BlacklistLogic extends GetxController { if (bean.isSuccess()) { lists.addAll(bean.data.lists); } + isLoad = false; update(); if (page == 1) { refreshController.refreshCompleted(); diff --git a/circle_app/lib/app/blacklist/view.dart b/circle_app/lib/app/blacklist/view.dart index 66b3a24..8b760be 100644 --- a/circle_app/lib/app/blacklist/view.dart +++ b/circle_app/lib/app/blacklist/view.dart @@ -34,7 +34,7 @@ class BlacklistPage extends StatelessWidget { backgroundColor: Colors.transparent, appBar: MyAppBar(centerTitle: '黑名单',), body: SafeArea( - child: SmartRefresher( + child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher( controller: logic.refreshController, child: ListView.builder( diff --git a/circle_app/lib/app/circle/view.dart b/circle_app/lib/app/circle/view.dart index 391708e..7d2a55b 100644 --- a/circle_app/lib/app/circle/view.dart +++ b/circle_app/lib/app/circle/view.dart @@ -68,7 +68,7 @@ class _CirclePageState extends State }, index: controller.state.index, itemCount: logic.circle.lists.length, - viewportFraction: 0.95, + viewportFraction: 0.93, // scale: 0.9, loop: false, // pagination: new SwiperPagination(),//如果不填则不显示指示点 @@ -105,7 +105,7 @@ class _CirclePageState extends State List urlList = []; List infoList = []; if (logic.statistics != null) { - infoList = logic.statistics!["users"]; + infoList = logic.statistics!["last_visit_users"]; if (infoList.isNotEmpty) { for (var element in infoList) { urlList.add(element["avatar"]); @@ -119,24 +119,17 @@ class _CirclePageState extends State var element = urlList[i]; widgets.add(Positioned( left: 15.sp * i, - child: GestureDetector( - onTap: () { - logic.pushHome(infoList[i]['id'].toString()); - }, + child: circleWidget(element), ), - )); + ); } - if (urlList.length == 3) { + if (logic.statistics != null) { widgets.add(Positioned( - left: 15.sp * 3, - child: GestureDetector( - onTap: () { - - }, - child: circleWidget(logic.statistics!['total'].toString()), + left: 15.sp * urlList.length, + child: circleWidget(logic.statistics!['visit_count'].toString()), ), - )); + ); } return Container( width: Get.width, @@ -147,13 +140,18 @@ class _CirclePageState extends State children: [ Positioned( left: 0, - child: Container( + child: GestureDetector( + onTap: () { + Get.toNamed(AppRoutes.FriendsActivity,arguments: '2'); + }, + child: Container( - width: 30.sp * widgets.length, - height: 44.sp, - child: Stack( - alignment: Alignment.centerLeft, - children: widgets, + width: 30.sp * widgets.length, + height: 44.sp, + child: Stack( + alignment: Alignment.centerLeft, + children: widgets, + ), ), )), ShaderMask( 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 64dbb39..221463f 100644 --- a/circle_app/lib/app/circle/widgets/info_list_view.dart +++ b/circle_app/lib/app/circle/widgets/info_list_view.dart @@ -117,7 +117,7 @@ class _InfoListViewState extends State { listLogic.refreshData(); }, child: listLogic.lists.isEmpty - ? loaddingWidget(true) + ? !listLogic.callOutMore ? noResultWidget() : loaddingWidget(true) : ListView.builder( physics: const AlwaysScrollableScrollPhysics(), scrollDirection: Axis.vertical, diff --git a/circle_app/lib/app/feedback/view.dart b/circle_app/lib/app/feedback/view.dart index 6431a62..caa9e1d 100644 --- a/circle_app/lib/app/feedback/view.dart +++ b/circle_app/lib/app/feedback/view.dart @@ -17,152 +17,157 @@ class FeedbackPage extends StatelessWidget { @override Widget build(BuildContext context) { return GetBuilder(builder: (FeedbackLogic controller) { - return Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getBaseImage("home_back")), - fit: BoxFit.cover, - ), - ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: MyAppBar( - centerTitle: '意见反馈', + return GestureDetector( + onTap: () { + FocusManager.instance.primaryFocus?.unfocus(); + }, + child: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, ), - body: SingleChildScrollView( - child: SafeArea( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Container( - height: 200, - margin: EdgeInsets.symmetric( - horizontal: 16, vertical: 20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(13), - color: Color( - 0xFF4C3E5F), // Use your desired background color - ), - padding: EdgeInsets.all(13), - child: TextField( - maxLength: 200, - - onChanged: (msg){ - print(msg); - controller.state.maxMsg = '${msg.length}/200'; - controller.update(); - - - }, - decoration: InputDecoration( - hintText: '请补充详细问题和意见,我们会认真看完的哦~', - counterText: '', - hintStyle: TextStyle( - color: Color(0xFFB7BECC), fontSize: 14.sp), - border: InputBorder.none, - ), - maxLines: null, - inputFormatters: [ - LengthLimitingTextInputFormatter(200), - ], - style: TextStyle(color: Colors.white), - ), - ), - Positioned( - right: 30.sp, - bottom: 30.sp, - child: Text( - controller.state.maxMsg, - style: TextStyle(color: Colors.white), - )) - ], - ), - Container( - height: 120.sp, - margin: EdgeInsets.only(left: 16.sp, right: 16.sp), - child: GridView.builder( - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, // 每行显示的项目数量 - ), - itemCount:controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count - itemBuilder: (context, index) { - - if (index == 0&&controller.state.imaglist.length<3) { - // 第一个项目,显示固定的图片 - return GestureDetector( - onTap: () { - controller.getImageFile(); - }, - child: Container( - margin: EdgeInsets.all(5.sp), - child: Image( - image: - AssetImage(getMineImage("icon_img_add")), - ), - ), - ); - } else { - // 后续项目,根据接口获取数据 - // 假设通过接口获取到的数据存储在一个名为 data 的列表中 - // var itemData = data[index - 1]; // 减去第一个固定图片的索引 - return Container( - margin: EdgeInsets.all(5.sp), - child: Center( - child: _buildImageItem(controller.state.imaglist.length<3 ? - controller.state.imaglist[index-1]: controller.state.imaglist[index], // Replace with your item count - controller,controller.state.imaglist.length<3 ? index-1:index ), - ), - ); - } - }, - ), - ), - Padding( - padding: EdgeInsets.only(left: 16, top: 10), - child: Text( - '最多选择3张图片', - style: - TextStyle(color: Color(0xFFB7BECC), fontSize: 12), - ), - ), - SizedBox(height: 50), - GestureDetector( - onTap: () { - // showToast("完善资料"); - Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user"); - // controller.onInit(); - }, - child: Center( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(21), - gradient: LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - padding: EdgeInsets.only( - top: 14.sp, bottom: 14.sp, left: 95.sp, right: 95.sp), - child: Text( - "提交", - style: TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - ), - ), - ], - ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '意见反馈', ), - )), + body: SingleChildScrollView( + child: SafeArea( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Container( + height: 200, + margin: EdgeInsets.symmetric( + horizontal: 16, vertical: 20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(13), + color: Color( + 0xFF4C3E5F), // Use your desired background color + ), + padding: EdgeInsets.all(13), + child: TextField( + maxLength: 200, + + onChanged: (msg){ + print(msg); + controller.state.maxMsg = '${msg.length}/200'; + controller.update(); + + + }, + decoration: InputDecoration( + hintText: '请补充详细问题和意见,我们会认真看完的哦~', + counterText: '', + hintStyle: TextStyle( + color: Color(0xFFB7BECC), fontSize: 14.sp), + border: InputBorder.none, + ), + maxLines: null, + inputFormatters: [ + LengthLimitingTextInputFormatter(200), + ], + style: TextStyle(color: Colors.white), + ), + ), + Positioned( + right: 30.sp, + bottom: 30.sp, + child: Text( + controller.state.maxMsg, + style: TextStyle(color: Colors.white), + )) + ], + ), + Container( + height: 120.sp, + margin: EdgeInsets.only(left: 16.sp, right: 16.sp), + child: GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, // 每行显示的项目数量 + ), + itemCount:controller.state.imaglist.length<3 ? controller.state.imaglist.length+1: controller.state.imaglist.length, // Replace with your item count + itemBuilder: (context, index) { + + if (index == 0&&controller.state.imaglist.length<3) { + // 第一个项目,显示固定的图片 + return GestureDetector( + onTap: () { + controller.getImageFile(); + }, + child: Container( + margin: EdgeInsets.all(5.sp), + child: Image( + image: + AssetImage(getMineImage("icon_img_add")), + ), + ), + ); + } else { + // 后续项目,根据接口获取数据 + // 假设通过接口获取到的数据存储在一个名为 data 的列表中 + // var itemData = data[index - 1]; // 减去第一个固定图片的索引 + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + child: _buildImageItem(controller.state.imaglist.length<3 ? + controller.state.imaglist[index-1]: controller.state.imaglist[index], // Replace with your item count + controller,controller.state.imaglist.length<3 ? index-1:index ), + ), + ); + } + }, + ), + ), + Padding( + padding: EdgeInsets.only(left: 16, top: 10), + child: Text( + '最多选择3张图片', + style: + TextStyle(color: Color(0xFFB7BECC), fontSize: 12), + ), + ), + SizedBox(height: 50), + GestureDetector( + onTap: () { + // showToast("完善资料"); + Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user"); + // controller.onInit(); + }, + child: Center( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(21), + gradient: LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.only( + top: 14.sp, bottom: 14.sp, left: 95.sp, right: 95.sp), + child: Text( + "提交", + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + ), + ], + ), + ), + )), + ), ); }); } diff --git a/circle_app/lib/app/friendslist/logic.dart b/circle_app/lib/app/friendslist/logic.dart index f39465f..ca61ef5 100644 --- a/circle_app/lib/app/friendslist/logic.dart +++ b/circle_app/lib/app/friendslist/logic.dart @@ -12,6 +12,7 @@ class FriendslistLogic extends GetxController { final type = Get.arguments as String; int page = 1; int isVip = 0; + bool isLoad = true; List lists = []; @override void onInit() async{ @@ -34,6 +35,7 @@ class FriendslistLogic extends GetxController { if (bean.isSuccess()) { lists.addAll(bean.data.lists); } + isLoad = false; update(); if(page == 1){ refreshController.refreshCompleted(); @@ -50,6 +52,7 @@ class FriendslistLogic extends GetxController { if (bean.isSuccess()) { lists.addAll(bean.data.lists); } + isLoad = false; update(); if(page == 1){ refreshController.refreshCompleted(); @@ -66,6 +69,8 @@ class FriendslistLogic extends GetxController { if (bean.isSuccess()) { lists.addAll(bean.data.lists); } + + isLoad = false; update(); if(page == 1){ refreshController.refreshCompleted(); diff --git a/circle_app/lib/app/friendslist/view.dart b/circle_app/lib/app/friendslist/view.dart index d81fd15..96d297f 100644 --- a/circle_app/lib/app/friendslist/view.dart +++ b/circle_app/lib/app/friendslist/view.dart @@ -31,7 +31,7 @@ class FriendslistPage extends StatelessWidget { centerTitle: _getTitleName(logic.type), ), body: SafeArea( - child: SmartRefresher( + child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher( controller: logic.refreshController, onRefresh: _onRefresh, onLoading: _onLoading, diff --git a/circle_app/lib/app/my_circle/view.dart b/circle_app/lib/app/my_circle/view.dart index f77b3e8..53cb036 100644 --- a/circle_app/lib/app/my_circle/view.dart +++ b/circle_app/lib/app/my_circle/view.dart @@ -61,7 +61,7 @@ class _My_circlePageState extends State }, index: logic.circle.lists.isNotEmpty ? 0 : controller.state.index, itemCount: logic.circle.lists.length, - viewportFraction: 0.95, + viewportFraction: 0.93, // scale: 0.9, loop: false, onIndexChanged: (index) { diff --git a/circle_app/lib/app/report/view.dart b/circle_app/lib/app/report/view.dart index 13b591b..36e23e2 100644 --- a/circle_app/lib/app/report/view.dart +++ b/circle_app/lib/app/report/view.dart @@ -16,141 +16,146 @@ class ReportPage extends StatelessWidget { @override Widget build(BuildContext context) { return GetBuilder(builder: (ReportLogic controller) { - return Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getBaseImage("home_back")), - fit: BoxFit.cover, - ), - ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: MyAppBar( - centerTitle: '举报', - actionWdiget: Text( - "提交", - style: TextStyle(color: Colors.white), + return GestureDetector( + onTap: () { + FocusManager.instance.primaryFocus?.unfocus(); + }, + child: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, ), - onPressed: () { - logic.onSubmit(); - }, ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 16, top: 16), - child: Text( - '举报类目', - style: TextStyle( - color: Colors.white, - fontSize: 16, + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: '举报', + actionWdiget: Text( + "提交", + style: TextStyle(color: Colors.white), + ), + onPressed: () { + logic.onSubmit(); + }, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 16, top: 16), + child: Text( + '举报类目', + style: TextStyle( + color: Colors.white, + fontSize: 16, + ), ), ), - ), - Container( - height: 120.sp, - child: _reportAdapter(controller), - ), - Expanded( - child: Padding( - padding: EdgeInsets.fromLTRB(16, 20, 16, 0), - child: ListView( - children: [ - Text( - '详细截图(请至少上传一张图片,帮助审核处理)', - style: TextStyle( - color: Colors.white70, - fontSize: 16, + Container( + height: 120.sp, + child: _reportAdapter(controller), + ), + Expanded( + child: Padding( + padding: EdgeInsets.fromLTRB(16, 20, 16, 0), + child: ListView( + children: [ + Text( + '详细截图(请至少上传一张图片,帮助审核处理)', + style: TextStyle( + color: Colors.white70, + fontSize: 16, + ), ), - ), - SizedBox(height: 20), - // 添加 RecyclerView(ListView) 的内容 - // 例如: MyRecyclerViewWidget(), - Container( - height: 130.sp, - child: _imageAdapter(controller)), - Text( - '补充说明', - style: TextStyle( - color: Colors.white, - fontSize: 14, + SizedBox(height: 20), + // 添加 RecyclerView(ListView) 的内容 + // 例如: MyRecyclerViewWidget(), + Container( + height: 130.sp, + child: _imageAdapter(controller)), + Text( + '补充说明', + style: TextStyle( + color: Colors.white, + fontSize: 14, + ), ), - ), - SizedBox(height: 30), - Container( - // margin: EdgeInsets.only(left: 10, right: 10), - height: 200, - width: double.infinity, - decoration: BoxDecoration( - color: Color(0xFF4C3E5F), - borderRadius: BorderRadius.circular(10), - ), - padding: EdgeInsets.all(16.sp), - child: Stack( - children: [ - Container( - height: 200.sp, - child: TextField( - controller: controller.textEditingController, - onChanged: (value) { - controller.update(); - }, - style: TextStyle( - color: Colors.white, fontSize: 14.0.sp), - maxLines: 32, - maxLength: 200, - decoration: InputDecoration( - hintStyle: TextStyle( - color: Color.fromRGBO( - 255, 255, 255, 0.6), - fontSize: 14.sp), - hintText: '违规补充说明,帮助审核处理,选填', - border: InputBorder.none, - - counter: Text('')), - ), - ), - Positioned( - // right: 1.sp, - top: 160.sp, - child: Text( - '${controller.textEditingController.text.length}/200', + SizedBox(height: 30), + Container( + // margin: EdgeInsets.only(left: 10, right: 10), + height: 200, + width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFF4C3E5F), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(16.sp), + child: Stack( + children: [ + Container( + height: 200.sp, + child: TextField( + controller: controller.textEditingController, + onChanged: (value) { + controller.update(); + }, style: TextStyle( - color: Colors.white, fontSize: 12.sp), - )), + color: Colors.white, fontSize: 14.0.sp), + maxLines: 32, + maxLength: 200, + decoration: InputDecoration( + hintStyle: TextStyle( + color: Color.fromRGBO( + 255, 255, 255, 0.6), + fontSize: 14.sp), + hintText: '违规补充说明,帮助审核处理,选填', + border: InputBorder.none, + + counter: Text('')), + ), + ), + Positioned( + // right: 1.sp, + top: 160.sp, + child: Text( + '${controller.textEditingController.text.length}/200', + style: TextStyle( + color: Colors.white, fontSize: 12.sp), + )), - ], - ) + ], + ) - // Stack( - // children: [ - // TextField( - // decoration: InputDecoration.collapsed( - // hintText: '违规补充说明,帮助审核处理,选填', - // border: InputBorder.none, - // hintStyle: TextStyle( - // color: Color(0xFFB7BECC), - // fontSize: 12, - // ), - // ), - // maxLength: 200, - // style: TextStyle( - // color: Color(0xFFFFFFFF), - // fontSize: 12, - // ), - // ), - // ], - // ), - ), - ], + // Stack( + // children: [ + // TextField( + // decoration: InputDecoration.collapsed( + // hintText: '违规补充说明,帮助审核处理,选填', + // border: InputBorder.none, + // hintStyle: TextStyle( + // color: Color(0xFFB7BECC), + // fontSize: 12, + // ), + // ), + // maxLength: 200, + // style: TextStyle( + // color: Color(0xFFFFFFFF), + // fontSize: 12, + // ), + // ), + // ], + // ), + ), + ], + ), ), ), - ), - ], + ], + ), ), ), ); diff --git a/circle_app/lib/network/api.dart b/circle_app/lib/network/api.dart index 6a5e1c7..5514f1a 100644 --- a/circle_app/lib/network/api.dart +++ b/circle_app/lib/network/api.dart @@ -169,7 +169,7 @@ class Api { //发现页统计 - static const getInterestsCount = 'up-service/interest/statistics'; + static const getInterestsCount = 'user-service/my/statistics'; // /up-service/my/interests /up-service/interest/statistics diff --git a/circle_app/lib/util/util.dart b/circle_app/lib/util/util.dart index aed259b..9327d5d 100644 --- a/circle_app/lib/util/util.dart +++ b/circle_app/lib/util/util.dart @@ -74,6 +74,20 @@ loaddingWidget(bool isMore) { ); } +noResultWidget() { + return Container( + width: Get.width, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset(getBaseImage('no_result'),width: 200.sp,), + SizedBox(height: 8.sp,), + Text('正在等待被填充~',style: TextStyle(color: Color(0xffdbdbdb),fontSize: 15.sp),), + ], + ), + ); +} + ///value: 文本内容;fontSize : 文字的大小;fontWeight:文字权重;maxWidth:文本框的最大宽度;maxLines:文本支持最大多少行 double calculateTextHeight(String value, fontSize, FontWeight fontWeight, double maxWidth, int maxLines) {