diff --git a/circle_app/lib/app/aboutapp/view.dart b/circle_app/lib/app/aboutapp/view.dart index 2092125..e5f778f 100644 --- a/circle_app/lib/app/aboutapp/view.dart +++ b/circle_app/lib/app/aboutapp/view.dart @@ -94,8 +94,8 @@ class AboutappPage extends StatelessWidget { GestureDetector( behavior: HitTestBehavior.opaque, onTap: (){ - Get.toNamed(AppRoutes.WebViewActivity,arguments: {'title':"用户协议","url":"https://www.baidu.com"}); - }, + navigateToUserAgreement(); + }, child: Row( children: [ Text( @@ -118,7 +118,7 @@ class AboutappPage extends StatelessWidget { GestureDetector( behavior: HitTestBehavior.opaque, onTap: (){ - Get.toNamed(AppRoutes.WebViewActivity,arguments: {'title':"隐私协议","url":"https://www.baidu.com"}); + navigateToPrivacyPolicy(); }, child: Row( diff --git a/circle_app/lib/app/feedback/logic.dart b/circle_app/lib/app/feedback/logic.dart index 28e1a25..bb35e33 100644 --- a/circle_app/lib/app/feedback/logic.dart +++ b/circle_app/lib/app/feedback/logic.dart @@ -1,5 +1,6 @@ -import 'dart:io'; +import 'package:circle_app/util/util.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:image_picker/image_picker.dart'; @@ -9,11 +10,12 @@ import '../../common/config.dart'; import '../../network/api.dart'; import '../../network/dio_manager.dart'; import '../../util/qiniu.dart'; +import '../call_out/logic.dart'; import 'state.dart'; class FeedbackLogic extends GetxController { final FeedbackState state = FeedbackState(); - + TextEditingController textEditingController = TextEditingController(); final ImagePicker _picker = ImagePicker(); var storage = Storage(); var quToken = ''; @@ -39,12 +41,36 @@ class FeedbackLogic extends GetxController { return; } SmartDialog.showLoading(); - upDataImage(quToken,pickedFile!,CONFIG.USER_INFO_AVATAR,(result){ + upDataImage(quToken,pickedFile,CONFIG.USER_INFO_AVATAR,(result){ SmartDialog.dismiss(force: true); state.imaglist.add(result); update(); }); - } catch (e) { + } catch (_) { + } + } + + + getFeedBack() async{ + + List myBean = []; + if (!state.imaglist.isEmpty) { + state.imaglist.forEach((element) { + myBean.add(MyBean(type: 1, url: element).toJson()); + }); + } + textEditingController.text; + + var data = + await DioManager.instance.post(url: Api.getFeedBack, params: { + 'album': myBean, + 'content': textEditingController.text, + 'type':1 + }); + var bean = BaseResponse.fromJson(data, (jsonData) => jsonData,); + showToast(bean.msg); + if(bean.isSuccess()){ + Get.back(); } } diff --git a/circle_app/lib/app/feedback/view.dart b/circle_app/lib/app/feedback/view.dart index caa9e1d..e862e75 100644 --- a/circle_app/lib/app/feedback/view.dart +++ b/circle_app/lib/app/feedback/view.dart @@ -52,7 +52,7 @@ class FeedbackPage extends StatelessWidget { padding: EdgeInsets.all(13), child: TextField( maxLength: 200, - + controller: controller.textEditingController, onChanged: (msg){ print(msg); controller.state.maxMsg = '${msg.length}/200'; @@ -63,6 +63,7 @@ class FeedbackPage extends StatelessWidget { decoration: InputDecoration( hintText: '请补充详细问题和意见,我们会认真看完的哦~', counterText: '', + hintStyle: TextStyle( color: Color(0xFFB7BECC), fontSize: 14.sp), border: InputBorder.none, @@ -135,7 +136,8 @@ class FeedbackPage extends StatelessWidget { GestureDetector( onTap: () { // showToast("完善资料"); - Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user"); + controller.getFeedBack(); + // Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user"); // controller.onInit(); }, child: Center( diff --git a/circle_app/lib/app/friendslist/logic.dart b/circle_app/lib/app/friendslist/logic.dart index ca61ef5..c5f69d7 100644 --- a/circle_app/lib/app/friendslist/logic.dart +++ b/circle_app/lib/app/friendslist/logic.dart @@ -78,6 +78,24 @@ class FriendslistLogic extends GetxController { refreshController.loadComplete(); } return ; + case "3": + var data = + await DioManager.instance.get(url: Api.visitList, params: { + 'page':page + }); + var bean = BaseResponse.fromJson(data, (data) => User.fromJson(data)); + if (bean.isSuccess()) { + lists.addAll(bean.data.lists); + } + + isLoad = false; + update(); + if(page == 1){ + refreshController.refreshCompleted(); + }else{ + refreshController.loadComplete(); + } + break; } diff --git a/circle_app/lib/app/help/logic.dart b/circle_app/lib/app/help/logic.dart index 0fb26b4..fa96545 100644 --- a/circle_app/lib/app/help/logic.dart +++ b/circle_app/lib/app/help/logic.dart @@ -1,8 +1,31 @@ import 'package:get/get.dart'; +import '../../network/api.dart'; +import '../../network/dio_manager.dart'; import 'state.dart'; class HelpLogic extends GetxController { + // @override + // void onInit() async{ + // // TODO: implement onInit + // super.onInit(); + // var data = + // await DioManager.instance.get(url: Api.getQuestions, params:{}); + // BaseResponse> bean = BaseResponse>.fromJson( + // data, + // (jsonData) => List.from(jsonData), + // ); + // if (bean.isSuccess()) { + // msgList.clear(); + // (bean.data as List ).forEach((element) { + // lists.add(StoryBean(question:element.question,answers:element.answers,selected: false)); + // }); + // lists.addAll(bean.data); + // } + // + // } + + List lists = []; final HelpState state = HelpState(); List msgList = [ @@ -40,4 +63,24 @@ class FaqItem { required this.answer, this.selected = false, }); -} \ No newline at end of file +} + +class StoryBean { + final String question; + final List answers; + bool selected = false; + + StoryBean({ + required this.question, + required this.answers, + this.selected = false, + }); + + factory StoryBean.fromJson(Map json) { + return StoryBean( + question: json['question'], + answers: List.from(json['answers']), + selected: false + ); + } +} diff --git a/circle_app/lib/app/help/view.dart b/circle_app/lib/app/help/view.dart index 9526a44..a3a1dc2 100644 --- a/circle_app/lib/app/help/view.dart +++ b/circle_app/lib/app/help/view.dart @@ -29,6 +29,14 @@ class HelpPage extends StatelessWidget { backgroundColor: Colors.transparent, appBar: MyAppBar( centerTitle: '帮助与反馈', + actionWdiget: const Text( + "我的反馈", + style: TextStyle(color: Colors.white), + ), + onPressed: () { + Get.toNamed(AppRoutes.MyFeedBackListActivity); + //logic.onSubmit(); + }, ), body: SafeArea( child: Column( diff --git a/circle_app/lib/app/login/login/logic.dart b/circle_app/lib/app/login/login/logic.dart index 8b41dd1..f0dbb23 100644 --- a/circle_app/lib/app/login/login/logic.dart +++ b/circle_app/lib/app/login/login/logic.dart @@ -1,14 +1,11 @@ import 'dart:async'; -import 'dart:convert'; import 'package:circle_app/network/dio_manager.dart'; import 'package:circle_app/router/app_routers.dart'; import 'package:circle_app/util/util.dart'; -import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:get/get.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import '../../../network/api.dart'; import '../../../util/SharedPreferencesHelper.dart'; @@ -86,8 +83,10 @@ class LoginLogic extends GetxController { Get.offNamed(AppRoutes.Complete_materialPage); return; + }else{ + showToast(bean.msg.toString()); } - showToast(bean.msg.toString()); + // try { // var response = await dio.post('user-service/login/smscode', data: { // "phone": phoneEditingController.text, diff --git a/circle_app/lib/app/login/login/view.dart b/circle_app/lib/app/login/login/view.dart index 65de2ae..3fc619c 100644 --- a/circle_app/lib/app/login/login/view.dart +++ b/circle_app/lib/app/login/login/view.dart @@ -199,12 +199,17 @@ class LoginPage extends StatelessWidget { SizedBox( width: 2.sp, ), - Text( - '《用户协议》', - style: TextStyle( - color: Color(0xff00FFF4), - fontSize: 11.sp, - fontWeight: FontWeight.w400, + GestureDetector( + onTap: (){ + navigateToUserAgreement(); + }, + child: Text( + '《用户协议》', + style: TextStyle( + color: Color(0xff00FFF4), + fontSize: 11.sp, + fontWeight: FontWeight.w400, + ), ), ), Text( @@ -217,12 +222,17 @@ class LoginPage extends StatelessWidget { SizedBox( width: 2.sp, ), - Text( - '《隐私协议》', - style: TextStyle( - color: Color(0xff00FFF4), - fontSize: 11.sp, - fontWeight: FontWeight.w400, + GestureDetector( + onTap: (){ + navigateToPrivacyPolicy(); + }, + child: Text( + '《隐私协议》', + style: TextStyle( + color: Color(0xff00FFF4), + fontSize: 11.sp, + fontWeight: FontWeight.w400, + ), ), ), ], diff --git a/circle_app/lib/app/minefragment/view.dart b/circle_app/lib/app/minefragment/view.dart index 2273041..4d3f4cc 100644 --- a/circle_app/lib/app/minefragment/view.dart +++ b/circle_app/lib/app/minefragment/view.dart @@ -3,7 +3,6 @@ import 'package:circle_app/router/app_routers.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import '../../util/SharedPreferencesHelper.dart'; import '../../util/util.dart'; @@ -401,8 +400,8 @@ class MinefragmentPage extends StatelessWidget { ), ), SizedBox( - width: 65.sp, - height: 65.sp, + width: 63.sp, + height: 63.sp, child: _buildAvatar1(logic), ) ], @@ -410,12 +409,12 @@ class MinefragmentPage extends StatelessWidget { ), Expanded( child: Container( - padding: EdgeInsets.only(left: 10), + padding: EdgeInsets.only(left: 10.sp), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _buildNameRow(logic), - SizedBox(height: 18.sp), + SizedBox(height: 10.sp), _buildInfoRow(logic), ], ), @@ -445,14 +444,14 @@ class MinefragmentPage extends StatelessWidget { }, child:logic.userInfoBean==null ? Container( - width: 65.sp, - height: 65.sp, + width: 63.sp, + height: 63.sp, ): CachedNetworkImage( fit: BoxFit.cover, placeholder: null, imageUrl: logic.avatar, - width: 65.sp, - height: 65.sp, + width: 63.sp, + height: 63.sp, ), ), diff --git a/circle_app/lib/app/myfeedbacklist/binding.dart b/circle_app/lib/app/myfeedbacklist/binding.dart new file mode 100644 index 0000000..1d946b0 --- /dev/null +++ b/circle_app/lib/app/myfeedbacklist/binding.dart @@ -0,0 +1,10 @@ +import 'package:get/get.dart'; + +import 'logic.dart'; + +class MyfeedbacklistBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut(() => MyfeedbacklistLogic()); + } +} diff --git a/circle_app/lib/app/myfeedbacklist/logic.dart b/circle_app/lib/app/myfeedbacklist/logic.dart new file mode 100644 index 0000000..e7cc83a --- /dev/null +++ b/circle_app/lib/app/myfeedbacklist/logic.dart @@ -0,0 +1,110 @@ +import 'package:get/get.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +import '../../network/api.dart'; +import '../../network/dio_manager.dart'; +import 'state.dart'; + +class MyfeedbacklistLogic extends GetxController { +@override + void onInit() { + // TODO: implement onInit + super.onInit(); + initList(); + } + final MyfeedbacklistState state = MyfeedbacklistState(); + + List lists = []; + final RefreshController refreshController = RefreshController(); + bool isLoad = true; + int page = 1; + initList() async{ + if(page==1){ + lists.clear(); + } + var data = + await DioManager.instance.get(url: Api.getFeedBackList, params: { + 'page': page, + 'page_size':20 + }); + var bean = BaseResponse.fromJson( + data, (data) => PostList.fromJson(data)); + if (bean.isSuccess()) { + lists.addAll(bean.data.lists); + } + isLoad = false; + update(); + if (page == 1) { + refreshController.refreshCompleted(); + } else { + refreshController.loadComplete(); + } + + } +} + + + +class Post { + int id; + String content; + List album; + dynamic reply; + String createTime; + int auditState; + + Post({ + required this.id, + required this.content, + required this.album, + required this.reply, + required this.createTime, + required this.auditState, + }); + + factory Post.fromJson(Map json) { + return Post( + id: json['id'], + content: json['content'], + album: List.from(json['album'].map((album) => Album.fromJson(album))), + reply: json['reply'], + createTime: json['create_time'], + auditState: json['audit_state'], + ); + } +} + +class Album { + int type; + String url; + + Album({ + required this.type, + required this.url, + }); + + factory Album.fromJson(Map json) { + return Album( + type: json['type'], + url: json['url'], + ); + } +} + +class PostList { + List lists; + int total; + + PostList({ + required this.lists, + required this.total, + }); + + factory PostList.fromJson(Map json) { + return PostList( + lists: List.from(json['lists'].map((post) => Post.fromJson(post))), + total: json['total'], + ); + } +} + diff --git a/circle_app/lib/app/myfeedbacklist/state.dart b/circle_app/lib/app/myfeedbacklist/state.dart new file mode 100644 index 0000000..5bbd9a3 --- /dev/null +++ b/circle_app/lib/app/myfeedbacklist/state.dart @@ -0,0 +1,5 @@ +class MyfeedbacklistState { + MyfeedbacklistState() { + ///Initialize variables + } +} diff --git a/circle_app/lib/app/myfeedbacklist/view.dart b/circle_app/lib/app/myfeedbacklist/view.dart new file mode 100644 index 0000000..f2f4f97 --- /dev/null +++ b/circle_app/lib/app/myfeedbacklist/view.dart @@ -0,0 +1,161 @@ +import 'dart:math'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +import '../../components/my_app_bar.dart'; +import '../../router/app_routers.dart'; +import '../../util/util.dart'; +import 'logic.dart'; + +class MyfeedbacklistPage extends StatelessWidget { + MyfeedbacklistPage({Key? key}) : super(key: key); + + final logic = Get.find(); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return GetBuilder(builder: (logic) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: const MyAppBar(centerTitle: '我的反馈',), + body: SafeArea( + child: logic.isLoad ? loaddingWidget(true) : logic.lists.isEmpty ? noResultWidget() : SmartRefresher( + controller: logic.refreshController, + child: ListView.builder( + + itemCount: logic.lists.length, + itemBuilder: (context, index) { + return ListTile( + title: ListItem(logic.lists[index]), + ); + }, + ), + onRefresh: _onRefresh, + onLoading: _onLoading, + ), + ),), + ); + }); + } + Widget ListItem(Post item) { + return Column(children: [ + Text(item.createTime , style: TextStyle( + color: Colors.white, + fontSize: 14.0.sp, + ),), + Container( + margin: EdgeInsets.only(bottom: 12.0,top: 12.sp), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + color: Color(0xff282733), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Container( + padding: + EdgeInsets.symmetric(vertical: 16.0.sp, horizontal: 16.0.sp), + decoration: BoxDecoration( + color: Color(0xff282733), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8.0.sp), + topRight: Radius.circular(8.0.sp), + ), + ), + child: Text( + item.content, + style: TextStyle( + color: Colors.white, + fontSize: 14.0.sp, + ), + ), + ), + Container( + height: 120.sp, + child: GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, // 每行显示的项目数量 + ), + itemCount:item.album.length, // Replace with your item count + itemBuilder: (context, index) { + + // 后续项目,根据接口获取数据 + // 假设通过接口获取到的数据存储在一个名为 data 的列表中 + // var itemData = data[index - 1]; // 减去第一个固定图片的索引 + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + child: _buildImageItem( item.album[index].url,// Replace with your item count + logic,index), + ), + ); + + }, + ), + ), + Container( + margin: EdgeInsets.only(left: 16.sp,right: 16.sp,bottom: 16.sp), + child: Text( + item.reply!=null?"反馈回复:"+item.reply:"审核中", + style: TextStyle( + color: Colors.grey, + fontSize: 12.0.sp, + ), + ), + ), + ], + ), + ) + ],); + } + + + + Widget _buildImageItem(String url, MyfeedbacklistLogic controller, int index) { + return ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: Container( + width: double.infinity, // 设置容器宽度为屏幕宽度 + height: double.infinity, // 设置容器高度为屏幕高度 + child: ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: GestureDetector( + onTap: () { + // Get.toNamed(AppRoutes.Swiper, arguments: { + // 'imaglist': controller.lists.album, + // 'index': index + // }); + }, + child: Image.network( + fit: BoxFit.cover, + url, + ), + ), + ), + ), + ); + } + + void _onRefresh() async { + logic.page = 1; + logic.initList(); + } + + void _onLoading() async { + logic.page = logic.page + 1; + logic.initList(); + } +} diff --git a/circle_app/lib/app/userinfo/view.dart b/circle_app/lib/app/userinfo/view.dart index 8b7d9f6..c0e495d 100644 --- a/circle_app/lib/app/userinfo/view.dart +++ b/circle_app/lib/app/userinfo/view.dart @@ -56,57 +56,120 @@ class _MyTabbedScreenState extends State @override Widget build(BuildContext context) { - return GetBuilder(builder: (UserinfoLogic logic) { - return Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(getBaseImage("home_back")), - fit: BoxFit.cover, - ), - ), - child: Scaffold( - backgroundColor: Colors.transparent, - appBar: MyAppBar( - centerTitle: logic.userInfoBean != null - ? "${logic.userInfoBean!.nickname}的主页" - : "个人主页", - ), - body: Stack( - children: [ - Container( - child: buildContent(logic), - ), - Positioned( - bottom: 27.sp, - width: Get.width, - child: _MeInfoButton(logic), - ) - ], - ), - )); - }); + return GetBuilder( + builder: (logic) { + return _buildPage(logic); + }, + ); } + Widget _buildPage(UserinfoLogic logic) { + return Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage(getBaseImage("home_back")), + fit: BoxFit.cover, + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + centerTitle: logic.userInfoBean != null + ? "${logic.userInfoBean!.nickname}的主页" + : "个人主页", + ), + body: Stack( + children: [ + Container( + child: buildContent(logic), + ), + Positioned( + bottom: 27.sp, + width: Get.width, + child: _MeInfoButton(logic), + ), + ], + ), + ), + ); + } + + + + Widget _MeInfoButton(UserinfoLogic controller) { if (controller.isMe) { - return Container(); + return const SizedBox(); } else { + final likeButton = GestureDetector( + onTap: () { + _showBottomSheet(context); + }, + child: Image( + image: AssetImage(getMineImage("icon_like")), + width: 40.sp, + height: 40.sp, + ), + ); + + final likeText = Text( + controller.isLike ? "取消喜欢" : "喜欢", + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + ), + ); + + final chatText = Text( + "私聊", + style: TextStyle( + color: Colors.white, + fontSize: 12.sp, + ), + ); + + final gradientDecoration = BoxDecoration( + borderRadius: BorderRadius.circular(17.sp), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ); + + final chatButton = GestureDetector( + onTap: () { + if (logic.userInfoBean != null) { + pushChatPage(logic.imId, logic.userInfoBean!.nickname); + } + }, + child: Container( + width: 130.sp, + height: 34.sp, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17.sp), + gradient: const LinearGradient( + colors: [ + Color(0x26FFFFFF), + Color(0x26FFFFFF), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + child: Center(child: chatText), + ), + ); + return Container( margin: EdgeInsets.only(left: 18.sp, right: 18.sp), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - GestureDetector( - onTap: () { - // showToast("鼓掌"); - _showBottomSheet(context); - }, - child: Image( - image: AssetImage(getMineImage("icon_like")), - width: 40.sp, - height: 40.sp, - ), - ), + likeButton, GestureDetector( onTap: () { logic.setLike(); @@ -114,67 +177,22 @@ class _MyTabbedScreenState extends State child: Container( width: 130.sp, height: 34.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17.sp), - gradient: const LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - child: Center( - child: Text( - logic.isLike ? "取消喜欢" : "喜欢", - style: TextStyle( - color: Colors.white, - fontSize: 12.sp, - ), - ), - ), + decoration: gradientDecoration, + child: Center(child: likeText), ), ), - GestureDetector( - onTap: () { - if (logic.userInfoBean != null) { - pushChatPage(logic.imId, logic.userInfoBean!.nickname); - } - - }, - child: Container( - width: 130.sp, - height: 34.sp, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17.sp), - gradient: const LinearGradient( - colors: [ - Color(0x26FFFFFF), - Color(0x26FFFFFF), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - child: Center( - child: Text( - "私聊", - style: TextStyle( - color: Colors.white, - fontSize: 12.sp, - ), - ), - ), - ), - ) + chatButton, ], ), ); } } + Widget buildContent(UserinfoLogic controller) { + final userInfoBean = controller.userInfoBean; + final interests = userInfoBean?.interests ?? []; + return Container( padding: EdgeInsets.symmetric(horizontal: 19.sp, vertical: 14.sp), child: Column( @@ -182,7 +200,7 @@ class _MyTabbedScreenState extends State Row( children: [ _imagelistView(controller), - Flexible( + Expanded( child: buildUserContainer(controller), ), ], @@ -193,9 +211,7 @@ class _MyTabbedScreenState extends State Row( children: [ Text( - controller.userInfoBean != null - ? controller.userInfoBean!.nickname - : "", + userInfoBean?.nickname ?? "", style: const TextStyle( color: Color.fromRGBO(247, 250, 250, 1.0), fontSize: 14, @@ -221,33 +237,29 @@ class _MyTabbedScreenState extends State Text( controller.onLineCity, style: TextStyle( - fontSize: 12, - color: logic.isOnline - ? const Color(0xFF00FFF4) - : const Color(0xFF787575)), - ) + fontSize: 12, + color: logic.isOnline + ? const Color(0xFF00FFF4) + : const Color(0xFF787575), + ), + ), ], ), ], ), SizedBox( - // margin: EdgeInsets.only(top: 18.sp, bottom: 18.sp), height: 59.sp, child: ListView.builder( - itemCount: controller.userInfoBean == null - ? 0 - : controller.userInfoBean!.interests.length, - // 替换为实际的 item 数量 + itemCount: interests.length, scrollDirection: Axis.horizontal, - // 设置为水平方向 padding: EdgeInsets.symmetric(vertical: 18.sp), - // 替换为实际的边距值 itemBuilder: (context, index) { + final interest = interests[index]; return Container( - margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距 + margin: EdgeInsets.only(right: 11.sp), child: Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17.0), // 设置圆角半径 + borderRadius: BorderRadius.circular(17.0), gradient: const LinearGradient( colors: [ Color(0xFF06F9FA), @@ -260,15 +272,18 @@ class _MyTabbedScreenState extends State margin: EdgeInsets.all(0.2.sp), decoration: BoxDecoration( borderRadius: BorderRadius.circular(17.0), - // shape: BoxShape.circle, color: const Color(0xFF392D53), ), child: Padding( padding: EdgeInsets.only( - top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp), + top: 2.sp, + bottom: 2.sp, + left: 15.sp, + right: 15.sp, + ), child: Center( child: Text( - controller.userInfoBean!.interests[index].title, + interest.title, style: const TextStyle( fontSize: 11.0, color: Colors.white, @@ -277,59 +292,185 @@ class _MyTabbedScreenState extends State ), ), ), - ), // 替换为实际的列表项小部件 + ), ); }, ), ), titleTab(controller), Expanded( - child: TabBarView( - controller: _tabController, - children: [ - _imageAdapter(controller), - Container( - margin: EdgeInsets.only(bottom: 26.sp), - child: HomeCallOutView(controller.userId)), - ], - )) + child: TabBarView( + controller: _tabController, + children: [ + _imageAdapter(controller), + Container( + margin: EdgeInsets.only(bottom: 26.sp), + child: HomeCallOutView(controller.userId), + ), + ], + ), + ), ], ), ); } + Widget titleTab(UserinfoLogic controller) { return Container( - alignment: Alignment.centerLeft, - height: 27.sp, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - TabBar( - isScrollable: true, - controller: _tabController, - indicatorColor: const Color(0xFF00FFF4), - indicatorWeight: 2.sp, - labelColor: const Color(0xFF00FFF4), - unselectedLabelColor: const Color(0xB3FFFFFF), - indicatorSize: TabBarIndicatorSize.label, - tabs: const [ - Tab( - text: "形象照", - ), - Tab(text: "喊话") - ], - ), - GestureDetector( - onTap: () { - controller.isMe - ? controller.isEdit = !controller.isEdit - : controller.urgeChange(); + alignment: Alignment.centerLeft, + height: 27.sp, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TabBar( + isScrollable: true, + controller: _tabController, + indicatorColor: const Color(0xFF00FFF4), + indicatorWeight: 2.sp, + labelColor: const Color(0xFF00FFF4), + unselectedLabelColor: const Color(0xB3FFFFFF), + indicatorSize: TabBarIndicatorSize.label, + tabs: const [ + Tab( + text: "形象照", + ), + Tab(text: "喊话"), + ], + ), + GestureDetector( + onTap: () { + if (controller.isMe) { + controller.isEdit = !controller.isEdit; controller.update(); - // controller.updataImage(); + } else { + controller.urgeChange(); + } + }, + child: Visibility( + visible: logic.isShowAlbum, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(17), + gradient: const LinearGradient( + colors: [ + Color(0xFF06F9FA), + Color(0xFFDC5BFD), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + padding: EdgeInsets.symmetric( + vertical: 2.sp, + horizontal: 12.sp, + ), + child: Text( + controller.isMe + ? controller.isEdit + ? "完成" + : "管理" + : controller.isUrgeStatus + ? "已催更" + : "催更", + style: const TextStyle( + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + ), + ], + ), + ); + } + + + Widget _imageAdapter(UserinfoLogic controller) { + return Stack( + children: [ + Column( + children: [ + if (controller.isMe) + Container( + margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp), + child: Text( + controller.isLikeFoMsg, + style: const TextStyle(color: Colors.white30), + ), + ), + Expanded( + child: Container( + margin: const EdgeInsets.only(bottom: 58.0), + child: GridView.builder( + shrinkWrap: true, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + ), + itemCount: controller.isMe + ? controller.isEdit + ? controller.state.imaglist.length + 1 + : controller.state.imaglist.length + : controller.state.imaglist.length, + itemBuilder: (BuildContext context, int index) { + if (controller.isMe && controller.isEdit) { + if (index == 0) { + return GestureDetector( + onTap: () { + controller.getImageFile(); + }, + child: Container( + margin: EdgeInsets.all(5.sp), + child: Image( + image: AssetImage(getMineImage("icon_img_add")), + ), + ), + ); + } else { + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + child: _buildImageItem( + controller.state.imaglist[index - 1].url, + controller, + index - 1, + ), + ), + ); + } + } else { + return Container( + margin: EdgeInsets.all(5.sp), + child: Center( + child: _buildImageItem( + controller.state.imaglist[index].url, + controller, + index, + ), + ), + ); + } + }, + ), + ), + ), + ], + ), + if (logic.isMe) + Positioned( + left: 0, + right: 0, + bottom: 26.sp, + child: GestureDetector( + onTap: () async { + var data = await Get.toNamed( + AppRoutes.Complete_materialPage, + arguments: "user", + ); + logic.onInit(); }, - child: Visibility( - visible: logic.isShowAlbum, + child: Center( child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(17), @@ -342,17 +483,13 @@ class _MyTabbedScreenState extends State end: Alignment.centerRight, ), ), - padding: EdgeInsets.only( - top: 2.sp, bottom: 2.sp, left: 12.sp, right: 12.sp), - child: Text( - controller.isMe - ? controller.isEdit - ? "完成" - : "管理" - : controller.isUrgeStatus - ? "已催更" - : "催更", - style: const TextStyle( + padding: EdgeInsets.symmetric( + vertical: 10.sp, + horizontal: 55.sp, + ), + child: const Text( + "完善个人形象", + style: TextStyle( color: Colors.white, fontSize: 12, ), @@ -360,113 +497,7 @@ class _MyTabbedScreenState extends State ), ), ), - ], - )); - } - - Widget _imageAdapter(UserinfoLogic controller) { - return Stack( - children: [ - Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: [ - controller.isMe? Container( - margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp), - child: - Text( - controller.isLikeFoMsg, - style: const TextStyle(color: Colors.white30), - )):Container(), - Expanded(child: Container( - margin: const EdgeInsets.only(bottom: 58.0), - child: GridView.builder( - shrinkWrap: true, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, // 每行显示的项目数量 - ), - itemCount: controller.isMe - ? controller.isEdit - ? controller.state.imaglist.length + 1 - : controller.state.imaglist.length - : controller.state.imaglist.length, // 项目的总数量,包括固定图片和接口获取的项目 - itemBuilder: (BuildContext context, int index) { - if (controller.isMe && controller.isEdit) { - if (index == 0) { - // 第一个项目,显示固定的图片 - return GestureDetector( - onTap: () { - controller.getImageFile(); - }, - child: Container( - margin: EdgeInsets.all(5.sp), - child: Image( - image: AssetImage(getMineImage("icon_img_add")), - ), - ), - ); - } else { - return Container( - margin: EdgeInsets.all(5.sp), - child: Center( - child: _buildImageItem( - controller.state.imaglist[index - 1].url, - controller, - index - 1)), - ); - } - } else { - return Container( - margin: EdgeInsets.all(5.sp), - child: Center( - child: _buildImageItem( - controller.state.imaglist[index].url, - controller, - index)), - ); - } - }, - ), - )) - ], - ), - logic.isMe - ? Positioned( - left: 0, - right: 0, - bottom: 26.sp, - child: GestureDetector( - onTap: () async{ - // showToast("完善资料"); - var data = await Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user"); - logic.onInit(); - // controller.onInit(); - }, - child: Center( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(17), - gradient: const LinearGradient( - colors: [ - Color(0xFF06F9FA), - Color(0xFFDC5BFD), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - padding: EdgeInsets.only( - top: 10.sp, bottom: 10.sp, left: 55.sp, right: 55.sp), - child: const Text( - "完善个人形象", - style: TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - ), - )) - : Container() + ), ], ); } @@ -487,7 +518,11 @@ class _MyTabbedScreenState extends State ), ), padding: EdgeInsets.only( - top: 2.sp, bottom: 2.sp, left: 10.sp, right: 10.sp), + top: 2.sp, + bottom: 2.sp, + left: 10.sp, + right: 10.sp, + ), child: Text( controller.ageMsg, style: const TextStyle( @@ -496,18 +531,18 @@ class _MyTabbedScreenState extends State ), ), ), - SizedBox(width: 6.sp), - controller.isVip > 0 - ? Image( - image: AssetImage(getBaseImage("vip")), - width: 44.sp, - height: 18.sp, - ) - : Container(), + const SizedBox(width: 6), + if (controller.isVip > 0) + Image( + image: AssetImage(getBaseImage("vip")), + width: 44.sp, + height: 18.sp, + ), ], ); } + Widget buildUserContainer(UserinfoLogic controller) { return Container( margin: EdgeInsets.symmetric(horizontal: 1.sp, vertical: 14.sp), @@ -554,11 +589,12 @@ class _MyTabbedScreenState extends State width: 66.sp, height: 66.sp, child: _buildAvatar1(controller), - ) + ), ], ); } + Widget _buildAvatar1(UserinfoLogic controller) { if (controller.userInfoBean == null) { return SizedBox( @@ -588,11 +624,12 @@ class _MyTabbedScreenState extends State } } + Widget _buildImageItem(String url, UserinfoLogic controller, int index) { return Stack( children: [ SizedBox( - width: double.infinity, // 设置容器宽度为屏幕宽度 + width: double.infinity, height: double.infinity, child: ClipRRect( borderRadius: BorderRadius.circular(0.0), @@ -614,104 +651,102 @@ class _MyTabbedScreenState extends State ), if (controller.userId == "") Positioned( - top: 0, - right: 0, - child: GestureDetector( - onTap: () { - // showToast("删除"); - _showDelImgDialog(context, controller, index); - }, - child: controller.isEdit - ? Image( - image: AssetImage(getMineImage("icon_img_del")), - width: 20.sp, - height: 20.sp, - ) - : Container(), - )) + top: 0, + right: 0, + child: GestureDetector( + onTap: () { + _showDelImgDialog(context, controller, index); + }, + child: Visibility( + visible: controller.isEdit, + child: Image( + image: AssetImage(getMineImage("icon_img_del")), + width: 20.sp, + height: 20.sp, + ), + ), + ), + ), ], ); } + void _showBottomSheet(BuildContext context) { showModalBottomSheet( context: context, backgroundColor: Colors.transparent, builder: (BuildContext context) { return Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(16.0), - topRight: Radius.circular(16.0), - ), - gradient: LinearGradient( - colors: [ - Color(0xFF4A3E5D), - Color(0xFF344143), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0), ), - height: 118.0, - width: double.infinity, - child: Container( - alignment: Alignment.center, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () { - Navigator.pop(context); - Get.toNamed(AppRoutes.ReportActivity, - arguments: {"userId": logic.userId}); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image( - image: AssetImage(getMineImage("icon_report")), - width: 40.sp, - height: 40.sp, - ), - Container( - margin: EdgeInsets.only(top: 2.sp), - child: const Text( - "举报", - style: TextStyle(color: Colors.white), - ), - ) - ], + gradient: LinearGradient( + colors: [ + Color(0xFF4A3E5D), + Color(0xFF344143), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + height: 118.0, + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + Navigator.pop(context); + Get.toNamed(AppRoutes.ReportActivity, + arguments: {"userId": logic.userId}); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage(getMineImage("icon_report")), + width: 40.sp, + height: 40.sp, ), - ), - SizedBox(width: 75.sp), - GestureDetector( - onTap: () { - Navigator.pop(context); - _showReportDialog(context); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image( - image: AssetImage(getMineImage("icon_block")), - width: 40.sp, - height: 40.sp, - ), - Container( - margin: EdgeInsets.only(top: 2.sp), - child: const Text( - "拉黑", - style: TextStyle(color: Colors.white), - ), - ) - ], + Container( + margin: EdgeInsets.only(top: 2.sp), + child: const Text( + "举报", + style: TextStyle(color: Colors.white), + ), ), - ), - ], + ], + ), ), - )); + GestureDetector( + onTap: () { + Navigator.pop(context); + _showReportDialog(context); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage(getMineImage("icon_block")), + width: 40.sp, + height: 40.sp, + ), + Container( + margin: EdgeInsets.only(top: 2.sp), + child: const Text( + "拉黑", + style: TextStyle(color: Colors.white), + ), + ), + ], + ), + ), + ], + ), + ); }, ); } diff --git a/circle_app/lib/network/api.dart b/circle_app/lib/network/api.dart index 628dfad..8c55b3a 100644 --- a/circle_app/lib/network/api.dart +++ b/circle_app/lib/network/api.dart @@ -135,6 +135,33 @@ class Api { + //意见反馈 + static const getFeedBack = 'up-service/feedback'; + + + + //意见反馈列表 + static const getFeedBackList = 'up-service/my/feedbacks'; + + + + + // //圈子访客记录 + // static const getInterestList = 'up-service/interest/20/users'; + + + + + + //猜你想问 + static const getQuestions = 'up-service/guide/feedback/questions'; + + + + + + + diff --git a/circle_app/lib/router/app_pages.dart b/circle_app/lib/router/app_pages.dart index 45baf07..0ce784e 100644 --- a/circle_app/lib/router/app_pages.dart +++ b/circle_app/lib/router/app_pages.dart @@ -25,6 +25,8 @@ import 'package:circle_app/app/msg/binding.dart'; import 'package:circle_app/app/msg/view.dart'; import 'package:circle_app/app/my_circle/binding.dart'; import 'package:circle_app/app/my_circle/view.dart'; +import 'package:circle_app/app/myfeedbacklist/binding.dart'; +import 'package:circle_app/app/myfeedbacklist/view.dart'; import 'package:circle_app/app/offaccount/binding.dart'; import 'package:circle_app/app/offaccount/view.dart'; import 'package:circle_app/app/photoinfo/binding.dart'; @@ -172,5 +174,10 @@ class AppPages { page: () => My_circlePage(), binding: My_circleBinding(), ), + GetPage( + name: AppRoutes.MyFeedBackListActivity, + page: () => MyfeedbacklistPage(), + binding: MyfeedbacklistBinding(), + ), ]; } diff --git a/circle_app/lib/router/app_routers.dart b/circle_app/lib/router/app_routers.dart index af8cce2..5a6d6f8 100644 --- a/circle_app/lib/router/app_routers.dart +++ b/circle_app/lib/router/app_routers.dart @@ -23,4 +23,6 @@ abstract class AppRoutes { static const SelectCircleActivity = '/user/SelectCircleActivity'; static const SplashActivity = '/user/SplashActivity'; static const MyCircle = '/myCircle'; + + static const MyFeedBackListActivity = '/mine/MyFeedBackListActivity'; } \ No newline at end of file diff --git a/circle_app/lib/util/util.dart b/circle_app/lib/util/util.dart index af8342f..d93ccec 100644 --- a/circle_app/lib/util/util.dart +++ b/circle_app/lib/util/util.dart @@ -249,3 +249,12 @@ Future getLibraryDirectoryPath() async { final directory = await getLibraryDirectory(); return directory.path; } +//跳转到用户协议 +navigateToUserAgreement(){ + Get.toNamed(AppRoutes.WebViewActivity,arguments: {'title':"用户协议","url":"https://docs.qq.com/doc/DZVV1SkttZGlPUW1H"}); +} + +//跳转到隐私政策 +navigateToPrivacyPolicy(){ + Get.toNamed(AppRoutes.WebViewActivity,arguments: {'title':"隐私协议","url":"https://docs.qq.com/doc/DZXhvcXV6b1RNTUx1"}); +} \ No newline at end of file