diff --git a/lib/im/SocketClient.dart b/lib/im/SocketClient.dart index 160108c4..353c7b6a 100644 --- a/lib/im/SocketClient.dart +++ b/lib/im/SocketClient.dart @@ -89,7 +89,7 @@ class SocketClient { } message["id"] = id; Uint8List data = utf8.encode(content); - MsgData msgData = MsgData(to: toId, from: userId, type: MsgType.SINGLE_TEXT, data: data); + MsgData msgData = MsgData(to: toId, from: userId, type: MsgType.COMMAND, data: data); final proto2 = Proto(5, 1, msgData.writeToBuffer()); _socket.add(proto2.toBytes()); debugPrint("sendMessage: ${message["id"]}"); diff --git a/lib/im/chat_details_page.dart b/lib/im/chat_details_page.dart index 42e5c231..049fdeb4 100644 --- a/lib/im/chat_details_page.dart +++ b/lib/im/chat_details_page.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/im/database/message.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; diff --git a/lib/im/im_view/im_page.dart b/lib/im/im_view/im_page.dart index c346a458..12ccec6e 100644 --- a/lib/im/im_view/im_page.dart +++ b/lib/im/im_view/im_page.dart @@ -366,7 +366,7 @@ class _IMPage extends State implements OnChatMessage { Expanded( child: Text( "喽哈 $userId", - overflow: TextOverflow.fade, + // overflow: TextOverflow.fade, maxLines: 1, style: TextStyle( fontSize: 16.sp, diff --git a/lib/im/out/message.pb.dart b/lib/im/out/message.pb.dart index c11e7f1b..42e143de 100644 --- a/lib/im/out/message.pb.dart +++ b/lib/im/out/message.pb.dart @@ -51,7 +51,7 @@ class MsgData extends $pb.GeneratedMessage { ..aOS(1, _omitFieldNames ? '' : 'to') ..aOS(2, _omitFieldNames ? '' : 'from') ..a<$core.int>(3, _omitFieldNames ? '' : 'ctime', $pb.PbFieldType.OU3) - ..e(4, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: MsgType.SINGLE_TEXT, valueOf: MsgType.valueOf, enumValues: MsgType.values) + ..e(4, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: MsgType.COMMAND, valueOf: MsgType.valueOf, enumValues: MsgType.values) ..a<$core.List<$core.int>>(5, _omitFieldNames ? '' : 'data', $pb.PbFieldType.OY) ..hasRequiredFields = false ; diff --git a/lib/im/out/message.pbenum.dart b/lib/im/out/message.pbenum.dart index a78564c4..df67c4a9 100644 --- a/lib/im/out/message.pbenum.dart +++ b/lib/im/out/message.pbenum.dart @@ -14,16 +14,24 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; class MsgType extends $pb.ProtobufEnum { - static const MsgType SINGLE_TEXT = MsgType._(0, _omitEnumNames ? '' : 'SINGLE_TEXT'); - static const MsgType SINGLE_AUDIO = MsgType._(1, _omitEnumNames ? '' : 'SINGLE_AUDIO'); - static const MsgType GROUP_TEXT = MsgType._(2, _omitEnumNames ? '' : 'GROUP_TEXT'); - static const MsgType GROUP_AUDIO = MsgType._(3, _omitEnumNames ? '' : 'GROUP_AUDIO'); + static const MsgType COMMAND = MsgType._(0, _omitEnumNames ? '' : 'COMMAND'); + static const MsgType TEXT = MsgType._(1, _omitEnumNames ? '' : 'TEXT'); + static const MsgType IMAGE = MsgType._(2, _omitEnumNames ? '' : 'IMAGE'); + static const MsgType AUDIO = MsgType._(3, _omitEnumNames ? '' : 'AUDIO'); + static const MsgType VIDEO = MsgType._(4, _omitEnumNames ? '' : 'VIDEO'); + static const MsgType PACKET = MsgType._(5, _omitEnumNames ? '' : 'PACKET'); + static const MsgType TRANSFER = MsgType._(6, _omitEnumNames ? '' : 'TRANSFER'); + static const MsgType LOCATION = MsgType._(7, _omitEnumNames ? '' : 'LOCATION'); static const $core.List values = [ - SINGLE_TEXT, - SINGLE_AUDIO, - GROUP_TEXT, - GROUP_AUDIO, + COMMAND, + TEXT, + IMAGE, + AUDIO, + VIDEO, + PACKET, + TRANSFER, + LOCATION, ]; static final $core.Map<$core.int, MsgType> _byValue = $pb.ProtobufEnum.initByValue(values); diff --git a/lib/im/out/message.pbjson.dart b/lib/im/out/message.pbjson.dart index 28ae82b4..bd7dd1be 100644 --- a/lib/im/out/message.pbjson.dart +++ b/lib/im/out/message.pbjson.dart @@ -17,17 +17,21 @@ import 'dart:typed_data' as $typed_data; const MsgType$json = { '1': 'MsgType', '2': [ - {'1': 'SINGLE_TEXT', '2': 0}, - {'1': 'SINGLE_AUDIO', '2': 1}, - {'1': 'GROUP_TEXT', '2': 2}, - {'1': 'GROUP_AUDIO', '2': 3}, + {'1': 'COMMAND', '2': 0}, + {'1': 'TEXT', '2': 1}, + {'1': 'IMAGE', '2': 2}, + {'1': 'AUDIO', '2': 3}, + {'1': 'VIDEO', '2': 4}, + {'1': 'PACKET', '2': 5}, + {'1': 'TRANSFER', '2': 6}, + {'1': 'LOCATION', '2': 7}, ], }; /// Descriptor for `MsgType`. Decode as a `google.protobuf.EnumDescriptorProto`. final $typed_data.Uint8List msgTypeDescriptor = $convert.base64Decode( - 'CgdNc2dUeXBlEg8KC1NJTkdMRV9URVhUEAASEAoMU0lOR0xFX0FVRElPEAESDgoKR1JPVVBfVE' - 'VYVBACEg8KC0dST1VQX0FVRElPEAM='); + 'CgdNc2dUeXBlEgsKB0NPTU1BTkQQABIICgRURVhUEAESCQoFSU1BR0UQAhIJCgVBVURJTxADEg' + 'kKBVZJREVPEAQSCgoGUEFDS0VUEAUSDAoIVFJBTlNGRVIQBhIMCghMT0NBVElPThAH'); @$core.Deprecated('Use msgDataDescriptor instead') const MsgData$json = { diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index 0b478bb2..2202e9a6 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -26,6 +26,8 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../view_widget/my_tab.dart'; + class PersonalPage extends StatefulWidget { final Map arguments; @@ -37,7 +39,7 @@ class PersonalPage extends StatefulWidget { } } -class _PersonalPage extends State with WidgetsBindingObserver { +class _PersonalPage extends State with WidgetsBindingObserver,SingleTickerProviderStateMixin{ ApiService apiService; final RefreshController refreshController = RefreshController(); final ScrollController scrollController = ScrollController(); @@ -52,6 +54,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { bool isLoadingData = false; String memberId; Map modifyInfo = {"background": ""}; + TabController tabController; @override void initState() { @@ -370,297 +373,80 @@ class _PersonalPage extends State with WidgetsBindingObserver { mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - height: 248.h, - color: Color(0xFFFFFFFF), - // color: Colors.red, - child: Stack( - // alignment: Alignment.bottomLeft, - children: [ + Stack( + children: [ + Container( + color: Colors.black, + child: Opacity( + opacity: 0.9, + child: MImage( + memberInfor?.background ?? "", + width: double.infinity, + height: 210.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ))), + Positioned( + top: MediaQuery.of(context).padding.top + 20.h, + left: 17.w, + child:GestureDetector( + child: Image.asset( + "assets/image/integral_return.webp", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + ), + if (memberId == "0") Positioned( - top: 0, - left: 0, - bottom: 36.h, - right: 0, - child: Stack( - alignment: Alignment.bottomRight, - children: [ - Container( - color: Colors.black, - child: Opacity( - opacity: 0.9, - child: MImage( - memberInfor?.background ?? "", - width: double.infinity, - height: 260.h, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ))), - Container( - margin: EdgeInsets.only( - top: 50.h, left: 16.w, right: 16.w), - alignment: Alignment.topLeft, - decoration: BoxDecoration( - color: Colors.transparent, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - child: Image.asset( - "assets/image/integral_return.webp", - width: 24, - height: 24, - ), - onTap: () { - Navigator.of(context).pop(); - }, - ), - ], - ), + bottom: 9.h, + right: 16.w, + child: GestureDetector( + onTap: () { + showImagePicker(); + }, + child: Container( + padding: + EdgeInsets.only(left: 2, right: 2), + width: 59.w, + height: 23.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0x80000000), ), - if (memberId == "0") - Positioned( - bottom: 9.h, - right: 16.w, - child: GestureDetector( - onTap: () { - showImagePicker(); - }, - child: Container( - padding: - EdgeInsets.only(left: 2, right: 2), - width: 59.w, - height: 23.h, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - color: Color(0x80000000), - ), - child: Text( - S.of(context).genghuanbeijing, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), - ), - ), - ), + child: Text( + S.of(context).genghuanbeijing, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), ), - ], + ), + ), ), ), - homeInfo(), - ], - ), + ], ), Container( - color: Color(0xFFFFFFFF), - margin: EdgeInsets.only(bottom: 30.h), + // margin: EdgeInsets.only(bottom: 30.h), + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + borderRadius: BorderRadius.only( + topRight: Radius.circular(12), + topLeft: Radius.circular(12)), + ), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.only( - left: 86.w, top: 12.h, right: 16.w), - child: GestureDetector( - onTap: () { - setState(() { - isShrink = !isShrink; - }); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - flex: 1, - child: Text( - memberId == "0" - ? ((memberInfor?.signature == "") - ? "还未编辑个性签名~" - : memberInfor?.signature ?? "") - : "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}", - overflow: isShrink - ? TextOverflow.visible - : TextOverflow.ellipsis, - maxLines: isShrink ? 10 : 2, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF868686), - fontWeight: MyFontWeight.regular, - height: 1.5.h), - )), - Icon( - (isShrink != null && !isShrink) - ? Icons.keyboard_arrow_down - : Icons.keyboard_arrow_up, - color: Colors.black, - size: 18, - ), - ], - ), - )), - Container( - margin: EdgeInsets.only(left: 16.w, right: 16.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - memberInfor != null - ? memberInfor.follow.toString() - : "0", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: - MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).guanzhu, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), - ), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - memberInfor != null - ? memberInfor.fans.toString() - : "0", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: - MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).fensi, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), - ), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - (memberInfor?.trendTotal ?? 0) - .toString(), - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: - MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).dongtai, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), - ), - Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () {}, - child: Container( - color: Colors.transparent, - padding: EdgeInsets.all(16), - child: Column( - children: [ - Text( - (memberInfor?.gainLikeTotal ?? 0) - .toString(), - style: TextStyle( - color: Color(0xFF353535), - fontSize: 16.sp, - fontWeight: - MyFontWeight.semi_bold, - ), - ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).huozan, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(16), - height: 1.h, - color: Color(0xFFF7F7F7), - ), + trendsInfo(), Padding( - padding: EdgeInsets.only(left: 16.w), + padding: EdgeInsets.only(left: 16.w,top:24.h), child: Text( memberId != "0" ? "TA的动态" : "我的动态", style: TextStyle( @@ -673,11 +459,315 @@ class _PersonalPage extends State with WidgetsBindingObserver { ], ), ), + // Container( + // height: 248.h, + // // color: Color(0xFFFFFFFF), + // // color: Colors.red, + // child: Stack( + // // alignment: Alignment.bottomLeft, + // children: [ + // Positioned( + // top: 0, + // left: 0, + // bottom: 36.h, + // right: 0, + // child: Stack( + // alignment: Alignment.bottomRight, + // children: [ + // Container( + // color: Colors.black, + // child: Opacity( + // opacity: 0.9, + // child: MImage( + // memberInfor?.background ?? "", + // width: double.infinity, + // height: 260.h, + // fit: BoxFit.cover, + // errorSrc: "assets/image/default_1.webp", + // fadeSrc: "assets/image/default_1.webp", + // ))), + // Container( + // margin: EdgeInsets.only( + // top: 50.h, left: 16.w, right: 16.w), + // alignment: Alignment.topLeft, + // decoration: BoxDecoration( + // color: Colors.transparent, + // ), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // GestureDetector( + // child: Image.asset( + // "assets/image/integral_return.webp", + // width: 24, + // height: 24, + // ), + // onTap: () { + // Navigator.of(context).pop(); + // }, + // ), + // ], + // ), + // ), + // if (memberId == "0") + // Positioned( + // bottom: 9.h, + // right: 16.w, + // child: GestureDetector( + // onTap: () { + // showImagePicker(); + // }, + // child: Container( + // padding: + // EdgeInsets.only(left: 2, right: 2), + // width: 59.w, + // height: 23.h, + // alignment: Alignment.center, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(2), + // color: Color(0x80000000), + // ), + // child: Text( + // S.of(context).genghuanbeijing, + // overflow: TextOverflow.ellipsis, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // color: Color(0xFFFFFFFF), + // ), + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // homeInfo(), + // ], + // ), + // ), + // Container( + // color: Color(0xFFFFFFFF), + // margin: EdgeInsets.only(bottom: 30.h), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // margin: EdgeInsets.only( + // left: 86.w, top: 12.h, right: 16.w), + // child: GestureDetector( + // onTap: () { + // setState(() { + // isShrink = !isShrink; + // }); + // }, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // Expanded( + // flex: 1, + // child: Text( + // memberId == "0" + // ? ((memberInfor?.signature == "") + // ? "还未编辑个性签名~" + // : memberInfor?.signature ?? "") + // : "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}", + // overflow: isShrink + // ? TextOverflow.visible + // : TextOverflow.ellipsis, + // maxLines: isShrink ? 10 : 2, + // style: TextStyle( + // fontSize: 12.sp, + // color: Color(0xFF868686), + // fontWeight: MyFontWeight.regular, + // height: 1.5.h), + // )), + // Icon( + // (isShrink != null && !isShrink) + // ? Icons.keyboard_arrow_down + // : Icons.keyboard_arrow_up, + // color: Colors.black, + // size: 18, + // ), + // ], + // ), + // )), + // Container( + // margin: EdgeInsets.only(left: 16.w, right: 16.w), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Expanded( + // child: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () {}, + // child: Container( + // color: Colors.transparent, + // padding: EdgeInsets.all(16), + // child: Column( + // children: [ + // Text( + // memberInfor != null + // ? memberInfor.follow.toString() + // : "0", + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 16.sp, + // fontWeight: + // MyFontWeight.semi_bold, + // ), + // ), + // SizedBox( + // height: 4.h, + // ), + // Text( + // S.of(context).guanzhu, + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // ], + // )), + // ), + // ), + // Expanded( + // child: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () {}, + // child: Container( + // color: Colors.transparent, + // padding: EdgeInsets.all(16), + // child: Column( + // children: [ + // Text( + // memberInfor != null + // ? memberInfor.fans.toString() + // : "0", + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 16.sp, + // fontWeight: + // MyFontWeight.semi_bold, + // ), + // ), + // SizedBox( + // height: 4.h, + // ), + // Text( + // S.of(context).fensi, + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // ], + // )), + // ), + // ), + // Expanded( + // child: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () {}, + // child: Container( + // color: Colors.transparent, + // padding: EdgeInsets.all(16), + // child: Column( + // children: [ + // Text( + // (memberInfor?.trendTotal ?? 0) + // .toString(), + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 16.sp, + // fontWeight: + // MyFontWeight.semi_bold, + // ), + // ), + // SizedBox( + // height: 4.h, + // ), + // Text( + // S.of(context).dongtai, + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // ], + // )), + // ), + // ), + // Expanded( + // child: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () {}, + // child: Container( + // color: Colors.transparent, + // padding: EdgeInsets.all(16), + // child: Column( + // children: [ + // Text( + // (memberInfor?.gainLikeTotal ?? 0) + // .toString(), + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 16.sp, + // fontWeight: + // MyFontWeight.semi_bold, + // ), + // ), + // SizedBox( + // height: 4.h, + // ), + // Text( + // S.of(context).huozan, + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // ], + // )), + // ), + // ), + // ], + // ), + // ), + // Container( + // margin: EdgeInsets.all(16), + // height: 1.h, + // color: Color(0xFFF7F7F7), + // ), + // Padding( + // padding: EdgeInsets.only(left: 16.w), + // child: Text( + // memberId != "0" ? "TA的动态" : "我的动态", + // style: TextStyle( + // color: Color(0xFF353535), + // fontSize: 15.sp, + // fontWeight: MyFontWeight.semi_bold, + // ), + // )), + // dynamicList(), + // ], + // ), + // ), ], )), )); } + ///个人信息 Widget homeInfo() { return Positioned( top: 0, @@ -711,8 +801,8 @@ class _PersonalPage extends State with WidgetsBindingObserver { child: MImage( memberInfor?.headimg ?? "", isCircle: true, - width: 66, - height: 66, + width: 66.h, + height: 66.h, fit: BoxFit.cover, errorSrc: "assets/image/default_user.webp", fadeSrc: "assets/image/default_user.webp", @@ -831,6 +921,409 @@ class _PersonalPage extends State with WidgetsBindingObserver { )); } + ///个人信息 + Widget trendsInfo() { + return Container( + color: Colors.white, + margin: EdgeInsets.only(top: 17.h,left: 16.w,right: 16.w), + child:Column( + children: [ + ///个人信息 + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PhotoViewGalleryScreen( + images: [ + (memberInfor?.headimg ?? "").isEmpty + ? "https://i.postimg.cc/Pq6vjfnw/default-1.webp" + : memberInfor?.headimg + ], //传入图片list + index: 0, //传入当前点击的图片的index + ), + )); + }, + child: MImage( + memberInfor?.headimg ?? "", + isCircle: true, + width: 69.h, + height: 69.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_user.webp", + fadeSrc: "assets/image/default_user.webp", + ), + ), + Expanded(child:Container(padding:EdgeInsets.only(left: 10.w) + ,child: Column( + children: [ + Row( + children: [ + Text( + ((memberInfor?.nickname ?? "") == "") + ? "回乡" + : memberInfor?.nickname, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + SizedBox(width: 4.w), + Image.asset( + "assets/image/vip_yk.webp", + width: 20, + height: 20, + ), + Spacer(), + if (memberId == "0") + GestureDetector( + onTap: () { + setState(() { + _toUserInfo(); + }); + }, + child: Container( + height: 23.h, + padding: EdgeInsets.only( + left: 6.w, right: 6.w, bottom: 2.h, top: 2.h), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1.w, + color: Color(0xFF353535), + style: BorderStyle.solid, + ), + ), + child: Text( + S.of(context).bianjigerenziliao, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + ), + ], + ), + SizedBox(height: 13.h), + Container( + child: GestureDetector( + onTap: () { + setState(() { + isShrink = !isShrink; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: Text( + memberId == "0" + ? ((memberInfor?.signature == "") + ? "还未编辑个性签名~" + : memberInfor?.signature ?? "") + : "个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? ""}", + overflow: isShrink + ? TextOverflow.visible + : TextOverflow.ellipsis, + maxLines: isShrink ? 10 : 2, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF868686), + fontWeight: MyFontWeight.regular, + height: 1.5.h), + )), + Icon( + (isShrink != null && !isShrink) + ? Icons.keyboard_arrow_down + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, + ), + ], + ), + )), + ], + ))), + ], + ), + ///关注,粉丝,动态,获赞,好友数量 + Container( + margin: EdgeInsets.only(top:24.h,left:10.w,right:10.w,bottom:19.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + child: Column( + children: [ + Text( + memberInfor != null + ? memberInfor.follow.toString() + : "0", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).guanzhu, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + SizedBox(width:56.w,), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + child: Column( + children: [ + Text( + memberInfor != null + ? memberInfor.fans.toString() + : "0", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).fensi, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + SizedBox(width:47.w,), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + child: Column( + children: [ + Text( + (memberInfor?.trendTotal ?? 0) + .toString(), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).dongtai, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + SizedBox(width:44.w,), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + child: Column( + children: [ + Text( + (memberInfor?.gainLikeTotal ?? 0) + .toString(), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).huozan, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + SizedBox(width:50.w,), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + child: Column( + children: [ + Text( + (memberInfor?.gainLikeTotal ?? 0) + .toString(), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4.h, + ), + Text( + S.of(context).haoyou, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + ], + ), + ), + Container( + height: 1.h, + color:Color(0xFFF7F7F7), + margin:EdgeInsets.only(bottom:15.h), + ), + ///关注,聊天按钮 + if (memberId != "0") + Row( + children: [ + Expanded(child:GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + + }, + child: Container( + // padding: EdgeInsets.symmetric(vertical:12.h), + height:41.h, + margin: EdgeInsets.only(right: 8.w,left: 4), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.5), + color: (articles.isNotEmpty && articles.first.followed ?? false) + ? Color(0xFFE6E6E6) + : Color(0xFF32A060) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + (articles.isNotEmpty && articles.first.followed ?? false) + ? Icons.check + : Icons.add, + color: (articles.isNotEmpty && articles.first.followed ?? false) + ? Color(0xFF808080) + : Colors.white, + size: 18.sp, + ), + SizedBox(width:5,), + Text( + (articles.isNotEmpty && articles.first.followed ?? false) + ? S.of(context).yiguanzhu + : S.of(context).guanzhu, + style: TextStyle( + fontSize: 12.sp, + color: (articles.isNotEmpty && articles.first.followed ?? false) + ? Color(0xFF808080) + : Colors.white, + fontWeight: MyFontWeight.regular, + )), + ], + ), + ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context) + .pushNamed('/router/chat_details_page', arguments: { + "toId": memberInfor.id, + },); + + }, + child: Container( + width:110.w, + height:41.h, + margin: EdgeInsets.only(right:1.w), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.5), + color: Color(0xFFFF9640) + ), + child: Text( + "聊一聊", + style: TextStyle( + fontSize: 13.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular, + )), + ), + ) + ], + ), + ], + ), + ); + } + + ///动态 Widget dynamicList() { return Container( child: (articles == null || articles.length == 0) diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index d00fa53c..7cbe6f65 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -445,6 +445,11 @@ abstract class ApiService { Future>> followList( @Body() Map map); + /// 好友列表 + @POST("/member/mutualFollow/list") + Future>> mutualFollowList( + @Body() Map map); + ///关注/取关会员 @PUT("/member/follow/{followId}") Future follow(@Path("followId") String followId); diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index a2d78c6a..752b8278 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -1412,6 +1412,32 @@ class _ApiService implements ApiService { return value; } + @override + Future>> mutualFollowList(map) async { + ArgumentError.checkNotNull(map, 'map'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/member/mutualFollow/list', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => ListData.fromJson(json), + ), + ); + return value; + } + @override Future> follow(followId) async { ArgumentError.checkNotNull(followId, 'followId');