From fe702371676e18fc5da9350460c83fdbb00e4559 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 23 Feb 2022 11:32:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/icon_mine_edit.png | Bin 1152 -> 1463 bytes assets/image/3x/icon_mine_edit.png | Bin 2122 -> 2593 bytes assets/image/icon_mine_edit.png | Bin 576 -> 707 bytes lib/community/headlines/article_page.dart | 5 - lib/community/release_dynamic.dart | 99 ++++++++--- lib/home/home_page.dart | 12 +- lib/main.dart | 3 + lib/mine/mine_page.dart | 3 +- lib/mine/personal_page.dart | 193 ++++++++++++++++++++++ lib/retrofit/min_api.dart | 8 +- lib/retrofit/min_api.g.dart | 2 +- lib/retrofit/retrofit_api.dart | 8 +- lib/retrofit/retrofit_api.g.dart | 2 +- 13 files changed, 286 insertions(+), 49 deletions(-) create mode 100644 lib/mine/personal_page.dart diff --git a/assets/image/2x/icon_mine_edit.png b/assets/image/2x/icon_mine_edit.png index 876eac442dc4b3d1f520e96067336d295c5297ea..21dad93f7996e9ae81601d07167f174699dd67cb 100644 GIT binary patch delta 1433 zcmV;K1!nqy3AYQ7Fn<9`vgxQilTG`MgZP`3*ZRY8e9|u*?&MLa14kOLfmbtd(jj{ zMNwV@!hkmb%cj@>Rls2&TnKTZF&ncWilR6HUju&9QKi0$)SOJxaxZbEAe%eIc@#e^ zQ`fL<*@_ozJJGGZBcAp>=czH#7!+AO%O#O3Zn5&5t zR+KchId#6Rm46N6orf@~yAQT4TgxFCx|u?V9~*MeAc&$Up8%f%A|d-Ut4{sEz4D?a z0hlV;SwF*qes43>v9Fv`q+cP#a#Ou}AO?tKdPQN~g;+La{QOh^rbg4;{F&uG2Axos zTxtqa2gDGL?RrHKi;u4-{$~2W0%3IG&vllv{<6zbaWG*!(^2^NWHP)CjJ&g%m8$`yyPv*pe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GCQtF~VAip45>!*NfS)*@cfW1H0 zbKsYw{4v}g?0@Bq{+pwxlYh@cJbiB#wx}EBk!)R|Qfi+s0iPgR>sNu-0M*!ilC3{} z#?_%eEdiJZ#l_5^e91E`Pq<&YwCF0OwwT9xfw&-EAJdv$_CtK!{#8f-=1DIsT*1pJ ztB6p>lAFyi6F^+sv1d$cwW+y^`im`70^t_PN?c6EvVZjgBbHe+ew#cXF2`&WpV--Y zaLO#<%QD6HJ?ZwDMQ#Tk4KQch(zTyeGFD-hE!j#A5*_TSG zmCBX2dq&5ck&hhMXgN>#3e)QBGKQQZ6g9kKz&xLvLuqP0$9qmw(zs*76v;E+T0nr7~*GShV z0&)^aU3a8{c1P!=KmC4|8fwdMJZKEpNH$-diIZ7G>L&z#|F*X`jzb`+p2#9Q6blRr{hR0iJ;%EXfFLsXC z@Yde*ls4{QAb=&@lcYMIcy_n^9iB9ZKqWoLaeV}Cu_iA%h6PdmB{h(HnI3&!lMmcsX@=;_qw zze{AqbrUp0g%A;Q_*zP6c}Yvzl3p+YqQh~4Vprm_;^gKr=7c6E^PnmIjr0O?la?A< z1EWLKb~dx~)WLvxA`qNcikHD!>!3wXiq!4XZsB-OJI8w3jhb>T&8z6SK;*hGWmw06 zV1Ry)0WO#+I~WB6@p~|Gfyf;u{6|F>jNE0ydw6!6^M7%jFu{cPf;A2%{8!F#FyX(1 lj}O7Hf0i)kga7hF%|FC3QlmyNTe<)M002ovPDHLkV1lh8BOm|( diff --git a/assets/image/3x/icon_mine_edit.png b/assets/image/3x/icon_mine_edit.png index f636944cc315458daa3c51c0b8a869cb635aec86..0d95663f540027567af8bdfe714acd048b21d818 100644 GIT binary patch delta 2572 zcmV+n3iI{K5TO*1FnYH}8#J4WW{Vf*`NUZ`MBC zix;?;doSRuW&0oa-FtuMobTD^?C*E)b2RE{x~^+L6QCK;8h;o7gaRSPXK%nAxCh(; zvVc_JByhm^oC_3anx@xhI5Lnro387@z+fN-=m&HJ+#G1I7`Ol&1rmYXnxL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ingController, - maxLines: 5, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF4C4C4C), - ), - onChanged: (text) { - bool release = text != "" && text != null; - if (release != isRelease) { - isRelease = release; - setState(() {}); - } - }, - decoration: InputDecoration( - contentPadding: EdgeInsets.symmetric( - vertical: 18.h, + child: Column( + children: [ + TextField( + controller: textEditingController, + maxLines: 5, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + onChanged: (text) { + bool release = text != "" && text != null; + if (release != isRelease) { + isRelease = release; + setState(() {}); + } + }, + decoration: InputDecoration( + contentPadding: EdgeInsets.symmetric( + vertical: 18.h, + ), + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: "此时此刻的想法~", + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), ), - errorBorder: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - hintText: "此时此刻的想法~", - hintStyle: TextStyle( - fontSize: 14.sp, - color: Color(0xFFA29E9E), + Row( + children: [ + Container( + margin: EdgeInsets.only(top: 8, right: 8), + padding: EdgeInsets.only(left:10, right:8), + height: 21.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.5), + color: Color(0xFFF2F2F2), + ), + child: Row( + children: [ + Image.asset( + "assets/image/icon_union_location_black.png", + color: Color(0xFFB3B2B2), + width: 16, + height: 16, + ), + SizedBox(width:2,), + Text( + "你在哪里呢?", + overflow:TextOverflow.ellipsis, + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFB3B2B2), + ), + ), + ], + ) + ), + Spacer(), + Align(alignment: Alignment.centerRight, + child:Icon( + Icons.close, + color: Colors.black, + size: 16, + ),) + ], ), - ), - ), + ], + ) ); } } diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 52e69705..55ba4d15 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -321,12 +321,12 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ), child: GestureDetector( onTap: () { - Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { - setState(() { - totalMsg = 0; - }); - }); - // Navigator.of(context).pushNamed('/router/web_turntable_activity'); + // Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { + // setState(() { + // totalMsg = 0; + // }); + // }); + Navigator.of(context).pushNamed('/router/web_turntable_activity'); }, child: Container( height: 24, diff --git a/lib/main.dart b/lib/main.dart index 2775f999..04807350 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -85,6 +85,7 @@ import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/mine_attainment_page.dart'; import 'mine/mine_vip/mine_vip_core.dart'; +import 'mine/personal_page.dart'; import 'order/exchange_write_off_page.dart'; import 'mine/release_page.dart'; import 'mine/roll_center_page.dart'; @@ -346,4 +347,6 @@ Map routers = { SystemDetails(arguments: arguments), '/router/invitation_record': (context, {arguments}) => InvitationRecord(), + '/router/personal_page': (context, {arguments}) => + PersonalPage(), }; diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 8bd6ed96..6a3ff2dd 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -46,7 +46,8 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { .pushNamed('/router/login_page', arguments: {"login": "login"}); return; } - await Navigator.of(context).pushNamed('/router/user_info_page'); + // await Navigator.of(context).pushNamed('/router/user_info_page'); + await Navigator.of(context).pushNamed('/router/personal_page'); setState(() {}); } diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart new file mode 100644 index 00000000..b9f546be --- /dev/null +++ b/lib/mine/personal_page.dart @@ -0,0 +1,193 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; + +class PersonalPage extends StatefulWidget { + @override + State createState() { + return _PersonalPage(); + } +} + +class _PersonalPage extends State + with WidgetsBindingObserver { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + _onRefresh(); + } + + _onRefresh() { + + } + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Positioned( + child: Container( + color: Colors.white, + child: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: _onRefresh, + onLoading: () { + _onRefresh(); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + color: Color(0xFFF7F7F7), + child:Column( + children: [ + Stack( + alignment: Alignment.bottomLeft, + children: [ + Container( + // height: 286, + child: + Stack( + alignment: Alignment.bottomCenter, + children: [ + Stack( + children: [ + Positioned( + child: Container( + color: Colors.black, + child:Opacity( + opacity:0.9, + child: MImage( + "", + width: double.infinity, + height: 260.h, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ) + ) + ) + ), + Container( + margin: EdgeInsets.only( + top: 50.h, left: 16.w, right: 16.w), + decoration: BoxDecoration( + color: Colors.transparent, + ), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.png", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + ], + ), + ), + ], + ), + Container( + child: Column( + children: [ + Padding(padding:EdgeInsets.only(right:16.w,bottom:16.h), + child: Row( + children: [ + Spacer(), + Container( + margin: EdgeInsets.only(top: 8, right: 8), + padding: EdgeInsets.only(left: 2, right: 2), + width: 59.w, + height: 21.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0x80000000), + ), + child: Text( + "更换背景", + overflow:TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ), + ], + )), + + ], + ), + ), + ], + ), + ), + // homeInfo(), + ], + ), + ], + ), + ), + ), + ), + ), + ), + bottom: 0, + top: 0, + left: 0, + right: 0, + ), + ], + ); + } + + Widget homeInfo(){ + return Container( + margin: EdgeInsets.only(left: 16), + child: Row( + children: [ + MImage( + "", + isCircle: true, + width: 66, + height: 66, + fit: BoxFit.cover, + errorSrc: "assets/image/default_user.png", + fadeSrc: "assets/image/default_user.png", + ), + ], + ), + ); + } + +} diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index d27c7d0b..84461685 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -28,12 +28,12 @@ part 'min_api.g.dart'; // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 -// const base_url = "http://192.168.10.236:8765/app/";///费韬 -// const baseUrl = "http://192.168.10.236:8765/app/";///费韬 +const base_url = "http://192.168.10.236:8765/app/";///费韬 +const baseUrl = "http://192.168.10.236:8765/app/";///费韬 -const base_url = "http://192.168.10.88:8765/app/";///詹云久 -const baseUrl = "http://192.168.10.88:8765/app/";///詹云久 +// const base_url = "http://192.168.10.88:8765/app/";///詹云久 +// const baseUrl = "http://192.168.10.88:8765/app/";///詹云久 // const base_url = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 856ae6e1..1c1cc751 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.88:8765/app/'; + baseUrl ??= 'http://192.168.10.236:8765/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 7206d070..55730ee0 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -62,15 +62,15 @@ part 'retrofit_api.g.dart'; // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; -const base_url = "http://192.168.10.88:8766/app/";///詹云久 -const baseUrl = "http://192.168.10.88:8766/app/";///詹云久 +// const base_url = "http://192.168.10.88:8766/app/";///詹云久 +// const baseUrl = "http://192.168.10.88:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index aac9c038..ad727613 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.88:8766/app/'; + baseUrl ??= 'http://192.168.10.236:8766/app/'; } final Dio _dio; From 25184b5e88d85534ab433180162bf5fffac3ea96 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 2 Mar 2022 14:53:39 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=9B=B4=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_child_page.dart | 6 +- .../community_view/class_list_view.dart | 2 +- .../community_view/community_dynamic.dart | 135 ++- lib/community/community_view/home_class.dart | 2 +- lib/community/new_community_details.dart | 4 +- lib/community/release_dynamic.dart | 252 +++--- lib/home/home_page.dart | 12 +- lib/main.dart | 4 +- lib/mine/edit_signature.dart | 99 +++ lib/mine/mine_page.dart | 2 +- lib/mine/mine_view/mine_item.dart | 60 +- lib/mine/personal_page.dart | 832 +++++++++++++++--- lib/mine/recharge_page.dart | 1 + lib/mine/release_page.dart | 5 +- lib/mine/user_info_page.dart | 61 +- lib/retrofit/data/article.dart | 426 +++++---- lib/retrofit/data/comunity_comment.dart | 39 +- lib/retrofit/data/member_Infor.dart | 134 +++ lib/retrofit/data/user_info.dart | 10 +- lib/retrofit/min_api.dart | 4 +- lib/retrofit/retrofit_api.dart | 15 +- lib/retrofit/retrofit_api.g.dart | 21 + lib/settlement/settlement.dart | 5 +- lib/store/store_order.dart | 2 - lib/web/web_view/web_content.dart | 2 +- 25 files changed, 1657 insertions(+), 478 deletions(-) create mode 100644 lib/mine/edit_signature.dart create mode 100644 lib/retrofit/data/member_Infor.dart diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 6747abf6..968a0140 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -62,6 +62,7 @@ class _CommunityChildPage extends State with AutomaticKeepAl } else pageNum = 1; BaseData> baseData = await apiService.trendList({ + "mid":"", "onlyFollow": widget.typeStr == "关注" ? true : false, "onlyMe": false, "pageNum": pageNum, @@ -83,11 +84,12 @@ class _CommunityChildPage extends State with AutomaticKeepAl article.id = element.id; article.content = jsonEncode(element.subjectInfo); article.mainTitle =element.subject; - article.isFollow = element.selfFollow; + article.followed = element.selfFollow; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; + article.location = element.location; article.createTime = element.createTime; - article.updateUser = element.memberInfo?.mid; + article.author = element.memberInfo?.mid; article.viewers = element?.viewers; article.likes = element?.likes; article.comments = element?.comments; diff --git a/lib/community/community_view/class_list_view.dart b/lib/community/community_view/class_list_view.dart index 4622a8e8..1d98a33f 100644 --- a/lib/community/community_view/class_list_view.dart +++ b/lib/community/community_view/class_list_view.dart @@ -94,7 +94,7 @@ class _ClassListView extends State { child: ClipRRect( child: Opacity( - opacity: 0.6, + opacity: 0.7, child:MImage( classList.coverImg, width: double.infinity, diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 6e894817..ec888c6b 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -14,7 +14,11 @@ import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/share_dialog.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_defines.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; +import 'package:sharesdk_plugin/sharesdk_map.dart'; import 'package:video_player/video_player.dart'; import '../photo_view_gallery_screen.dart'; @@ -121,7 +125,7 @@ class _CommunityDynamic extends State { alignment: Alignment.center); setState(() {}); } else { - // SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -172,16 +176,19 @@ class _CommunityDynamic extends State { children: [ GestureDetector( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PhotoViewGalleryScreen( - images: [(widget?.article?.authorHeadImg ?? "").isEmpty? - "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":widget?.article?.authorHeadImg - ], //传入图片list - index: 0, //传入当前点击的图片的index - ), - )); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => PhotoViewGalleryScreen( + // images: [(widget?.article?.authorHeadImg ?? "").isEmpty? + // "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":widget?.article?.authorHeadImg + // ], //传入图片list + // index: 0, //传入当前点击的图片的index + // ), + // )); + Navigator.of(context).pushNamed('/router/personal_page', + arguments:{"memberId":(widget.article.author == widget.userId) ? "0" :widget.article.author, + }); }, child: MImage( @@ -222,14 +229,14 @@ class _CommunityDynamic extends State { ], ), ), - if (widget?.article?.updateUser != widget.userId ?? "") + if (widget?.article?.author != widget.userId ?? "") GestureDetector( onTap: () { setState(() { if (widget.commentType == 0) { - widget.article.isFollow = !(widget.article.isFollow ?? false); - _vipFollow(widget.article.updateUser, - widget.article.isFollow ?? false); + widget.article.followed = !(widget.article.followed ?? false); + _vipFollow(widget.article.author, + widget.article.followed ?? false); } else { showDeleteDialog(); } @@ -242,21 +249,21 @@ class _CommunityDynamic extends State { alignment: Alignment.center, child: RoundButton( height: 25.h, - backgroup: (widget?.article?.isFollow ?? false) + backgroup: (widget?.article?.followed ?? false) ? Color(0xFFE6E6E6) : Color(0xFF32A060), - textColor: (widget?.article?.isFollow ?? false) + textColor: (widget?.article?.followed ?? false) ? Color(0xFF808080) : Colors.white, - text: (widget?.article?.isFollow ?? false) + text: (widget?.article?.followed ?? false) ? "已关注" : "关注", radius: 20, icons: Icon( - (widget?.article?.isFollow ?? false) + (widget?.article?.followed ?? false) ? Icons.check : Icons.add, - color: (widget?.article?.isFollow ?? false) + color: (widget?.article?.followed ?? false) ? Color(0xFF808080) : Colors.white, size: 15, @@ -287,9 +294,34 @@ class _CommunityDynamic extends State { ), ), buildMedia(widget?.article?.content), + SizedBox( + height:5.h, + ), + if(widget.article.location != "") + Row( + children: [ + Icon( + Icons.place, + size: 16, + color: Color(0xFFB3B2B2), + ), + SizedBox(width:2,), + Expanded(child: + Text( + widget?.article?.location ?? "", + overflow:TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFB3B2B2), + ), + )), + ], + ), if (!widget.isDetails) SizedBox( - height: 12.h, + height:5.h, ), if (!widget.isDetails) Row( @@ -328,6 +360,27 @@ class _CommunityDynamic extends State { ), ), ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + share(); + }); + }, + child: Container( + // color: Colors.red, + padding: EdgeInsets.only(left:30,right:10), + // alignment: Alignment.center, + child: Text( + "...", + style: TextStyle( + fontSize:18.sp, + fontWeight: MyFontWeight.medium, + color: Colors.black, + ), + ), + ), + ), ], ), ], @@ -341,6 +394,46 @@ class _CommunityDynamic extends State { ); } + share() async { + SSDKMap params = SSDKMap() + ..setGeneral( + widget?.article?.mainTitle, + "", + [ + jsonDecode(widget.article.content) + ], + "", + "", + buildShareUrl(), + "", + "", + "", + "", + SSDKContentTypes.webpage, + ); + + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return ShareDialog((platform) { + if (platform == ShareSDKPlatforms.line) { + params.map["type"] = SSDKContentTypes.text.value; + params.map["text"] = + "${widget.article.mainTitle} ${buildShareUrl()}"; + } + SharesdkPlugin.share(platform, params, + (state, userData, contentEntity, error) { + print("share!$state"); + }); + }); + }); + } + + String buildShareUrl() { + return "https://hx.lotus-wallet.com/index.html?id=${widget.article.id }&type=${""}"; + } + ///动态内容 Widget buildMedia(String subjectInfo) { if (subjectInfo == null || !subjectInfo.startsWith("{")) { diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index 2d960d4f..c7651740 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -149,7 +149,7 @@ class _HomeClass extends State { ), child: ClipRRect( child: Opacity( - opacity: 0.6, + opacity: 0.7, child: MImage( collect.coverImg, width: double.infinity, diff --git a/lib/community/new_community_details.dart b/lib/community/new_community_details.dart index 9c441cd3..3c5afc10 100644 --- a/lib/community/new_community_details.dart +++ b/lib/community/new_community_details.dart @@ -216,13 +216,13 @@ class _NewCommunityDetails extends State with WidgetsBindin ], ), ), - if (article?.updateUser != userId) + if (article?.author != userId) GestureDetector( onTap: () { setState(() { article.liked = !(article.liked ?? false); - _vipFollow(article.updateUser, + _vipFollow(article.author, article.liked ?? false); }); }, diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 78ec8d23..1b3833a7 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -6,6 +6,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/upload_result.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -28,8 +29,12 @@ class _ReleaseDynamic extends State { List mediaPaths = []; bool isRelease = false; int dynamicType = 0; - TextEditingController textEditingController = TextEditingController(); + TextEditingController textController = TextEditingController(); + TextEditingController addressController = TextEditingController(); + // TextEditingController houseNumberController = TextEditingController(); ApiService apiService; + Map addressMap; + Address preAddress; @override void initState() { @@ -88,7 +93,7 @@ class _ReleaseDynamic extends State { Container( width: double.infinity, margin: EdgeInsets.all(16), - padding: EdgeInsets.only(left: 16,right: 16), + padding: EdgeInsets.only(left: 16, right: 16), child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, @@ -98,21 +103,25 @@ class _ReleaseDynamic extends State { overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.semi_bold, - fontSize:18.sp, + fontSize: 18.sp, color: Colors.red, ), ), - SizedBox(width: 10,), - Expanded(child: Text( - "用户发布内容需要等待系统审核,审核通过后才会在推荐广场展示", - maxLines:2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Colors.black, + SizedBox( + width: 10, + ), + Expanded( + child: Text( + "用户发布内容需要等待系统审核,审核通过后才会在推荐广场展示", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Colors.black, + ), ), - ),) + ) ], ), ), @@ -150,7 +159,7 @@ class _ReleaseDynamic extends State { } releaseDynamic() async { - String dynamicText = textEditingController.text; + String dynamicText = textController.text; if (dynamicText == null || dynamicText == "") { SmartDialog.showToast("请输入您此刻的想法!"); return; @@ -185,6 +194,11 @@ class _ReleaseDynamic extends State { "subjectType": subjectType, "video": remoteVideoUrl, "coverImg": remoteVideoCoverImg, + "latitude": "", + "location": addressController.text == "" + ? "" + : addressController.text, + "longitude": "", }).catchError((onError) { EasyLoading.dismiss(); }); @@ -225,10 +239,7 @@ class _ReleaseDynamic extends State { thumbnail != "" && await File(thumbnail).exists()) { BaseData baseData = await apiService.upload( - File(thumbnail), - 123123123, - dynamicType == 2 - ); + File(thumbnail), 123123123, dynamicType == 2); if (baseData != null && baseData.isSuccess) { UploadResult uploadResult = baseData.data; mediaPaths[mediaPaths.indexOf(element)].thumbPath = @@ -236,11 +247,8 @@ class _ReleaseDynamic extends State { } } } - BaseData baseData = await apiService.upload( - file, - 123123123, - dynamicType == 2 - ); + BaseData baseData = + await apiService.upload(file, 123123123, dynamicType == 2); if (baseData != null && baseData.isSuccess) { UploadResult uploadResult = baseData.data; mediaPaths[mediaPaths.indexOf(element)].remotePath = @@ -278,7 +286,6 @@ class _ReleaseDynamic extends State { ///显示图片选择方式 showImagePicker() { - FocusScope.of(context).requestFocus(FocusNode()); if (dynamicType == 1) { @@ -422,95 +429,134 @@ class _ReleaseDynamic extends State { setState(() {}); } + toMap() async { + Navigator.of(context).pushNamed('/router/address_map_page').then( + (value) => { + setState(() { + if (value != null) { + addressMap = value; + addressController.text = "${(value as Map)['cityInfo']}"; + if (preAddress != null) { + preAddress.cityInfo = addressMap['cityInfo']; + } + // houseNumberController.text = "${(value as Map)['address']}"; + } + }) + }, + ); + } + ///动态输入框 Widget buildEdit() { return Container( - height: 174.h, - margin: EdgeInsets.symmetric(horizontal: 16.w), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1.w, - color: Color(0xFFD8D8D8), - style: BorderStyle.solid, + // height: 174.h, + margin: EdgeInsets.symmetric(horizontal: 16.w), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 1.w, + color: Color(0xFFD8D8D8), + style: BorderStyle.solid, + ), ), ), - ), - child: Column( - children: [ - TextField( - controller: textEditingController, - maxLines: 5, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF4C4C4C), - ), - onChanged: (text) { - bool release = text != "" && text != null; - if (release != isRelease) { - isRelease = release; - setState(() {}); - } - }, - decoration: InputDecoration( - contentPadding: EdgeInsets.symmetric( - vertical: 18.h, - ), - errorBorder: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - hintText: "此时此刻的想法~", - hintStyle: TextStyle( + child: Column( + children: [ + TextField( + controller: textController, + maxLines: 5, + style: TextStyle( fontSize: 14.sp, - color: Color(0xFFA29E9E), + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), ), - ), - ), - Row( - children: [ - Container( - margin: EdgeInsets.only(top: 8, right: 8), - padding: EdgeInsets.only(left:10, right:8), - height: 21.h, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.5), - color: Color(0xFFF2F2F2), + onChanged: (text) { + bool release = text != "" && text != null; + if (release != isRelease) { + isRelease = release; + setState(() {}); + } + }, + decoration: InputDecoration( + contentPadding: EdgeInsets.symmetric( + vertical: 18.h, ), - child: Row( - children: [ - Image.asset( - "assets/image/icon_union_location_black.png", - color: Color(0xFFB3B2B2), - width: 16, - height: 16, - ), - SizedBox(width:2,), - Text( - "你在哪里呢?", - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 11.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFB3B2B2), - ), + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: "此时此刻的想法~", + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + ), + Container( + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + toMap(); + }, + child:Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon( + Icons.place, + size: 16, + color: Color(0xFFB3B2B2), + ), + SizedBox( + width: 2, + ), + Text( + addressController.text == "" + ? "你在哪里呢?" + : addressController.text , + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFB3B2B2), + ), + ), + ], ), - ], - ) + )), + addressController.text == "" + ? Container() + : GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + addressController.text = ""; + }); + }, + child: Container( + // color: Colors.red, + height: 21.h, + padding: EdgeInsets.only(left: 10, right: 10), + alignment: Alignment.centerRight, + child: Icon( + Icons.close, + color: Colors.black, + size: 16, + ), + ), + ), + ], ), - Spacer(), - Align(alignment: Alignment.centerRight, - child:Icon( - Icons.close, - color: Colors.black, - size: 16, - ),) - ], - ), - ], - ) - ); + ), + SizedBox( + height: 5, + ) + ], + )); } } diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 55ba4d15..52e69705 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -321,12 +321,12 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ), child: GestureDetector( onTap: () { - // Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { - // setState(() { - // totalMsg = 0; - // }); - // }); - Navigator.of(context).pushNamed('/router/web_turntable_activity'); + Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { + setState(() { + totalMsg = 0; + }); + }); + // Navigator.of(context).pushNamed('/router/web_turntable_activity'); }, child: Container( height: 24, diff --git a/lib/main.dart b/lib/main.dart index 04807350..463ebf14 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -78,6 +78,7 @@ import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; import 'main_page.dart'; import 'message/system_details.dart'; +import 'mine/edit_signature.dart'; import 'mine/invitation_record.dart'; import 'mine/manage_address_page.dart'; import 'mine/mine_view/community_follow.dart'; @@ -299,6 +300,7 @@ Map routers = { '/router/login_page': (context, {arguments}) => LoginPage(arguments: arguments), '/router/edit_name': (context, {arguments}) => EditName(arguments: arguments), + '/router/edit_signature': (context, {arguments}) => EditSignature(arguments: arguments), '/router/mine_card_invalid': (context, {arguments}) => MineCardInvalidPage(), '/router/store_selector_page': (context, {arguments}) => StoreSelectorPage(), '/router/video_playback_page': (context, {arguments}) => VideoPlaybackPage(), @@ -348,5 +350,5 @@ Map routers = { '/router/invitation_record': (context, {arguments}) => InvitationRecord(), '/router/personal_page': (context, {arguments}) => - PersonalPage(), + PersonalPage(arguments:arguments), }; diff --git a/lib/mine/edit_signature.dart b/lib/mine/edit_signature.dart new file mode 100644 index 00000000..77a30c47 --- /dev/null +++ b/lib/mine/edit_signature.dart @@ -0,0 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class EditSignature extends StatefulWidget { + final Map arguments; + + EditSignature({this.arguments}); + + @override + State createState() { + return _EditSignature(); + } +} + +class _EditSignature extends State { + TextEditingController _controller = TextEditingController(); + int textLength = 0; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "个性签名", + titleColor: Colors.black, + leadingColor: Colors.black, + action: Container( + alignment: Alignment.center, + margin: EdgeInsets.only(right: 16.w), + child: GestureDetector( + onTap: () { + String signature = _controller.text; + if (signature != null && signature != "") { + Navigator.of(context).pop(signature); + } else { + SmartDialog.showToast("请输入个性签名~", alignment: Alignment.center); + } + }, + child:Container( + width: 46.w, + height: 24.h, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF319E5F), + borderRadius: BorderRadius.all(Radius.circular(4))), + child: Text( + "保存", + style: TextStyle( + color: Colors.white, + fontSize:14.sp, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + ), + body: Container( + margin: EdgeInsets.all(16), + child: Column( + children: [ + TextField( + maxLines: 5, + controller: _controller, + keyboardType: TextInputType.text, + onChanged: (value) { + setState(() { + textLength = value.length; + }); + }, + maxLength: 50, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: widget.arguments['signature'], + // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), + hintStyle: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + ), + Container( + height: 1.h, + color: Color(0xFFD8D8D8), + ), + ], + ), + ), + ); + } + + +} diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 6a3ff2dd..18e7c182 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -47,7 +47,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { return; } // await Navigator.of(context).pushNamed('/router/user_info_page'); - await Navigator.of(context).pushNamed('/router/personal_page'); + await Navigator.of(context).pushNamed('/router/personal_page',arguments:{"memberId":"0",}); setState(() {}); } diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index c3d37113..d0335c75 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -62,24 +62,27 @@ class _MineItem extends State { ), Row( children: [ - Expanded(child: InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context) - .pushNamed('/router/releasePage', - arguments: {}); - }); - }, - child: mineItem( - S.of(context).wodedongtai, - "assets/image/dynamic.png", - ), - ),), + ///我的动态 + // Expanded(child: + // InkWell( + // onTap: () { + // SharedPreferences.getInstance().then((value) { + // if (value.getString("token") == null || + // value.getString("token") == "") { + // LoginTipsDialog().show(context); + // return; + // } + // Navigator.of(context) + // .pushNamed('/router/releasePage', + // arguments: {}); + // }); + // }, + // child: mineItem( + // S.of(context).wodedongtai, + // "assets/image/dynamic.png", + // ), + // ), + // ), Expanded(child: InkWell( onTap: () { SharedPreferences.getInstance().then((value) { @@ -128,20 +131,20 @@ class _MineItem extends State { S.of(context).guanlidizhi, "assets/image/icon_location_address.png", ), - ),) + ),), + Expanded(child:InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + }, + child: mineItem( + S.of(context).tuiguangma, + "assets/image/icon_mine_promotion_code.png", + ), + ),), ], ), Row( children: [ - Expanded(child:InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); - }, - child: mineItem( - S.of(context).tuiguangma, - "assets/image/icon_mine_promotion_code.png", - ), - ),), Expanded(child:InkWell( onTap: () { Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); @@ -152,6 +155,7 @@ class _MineItem extends State { ), ),), Expanded(child:Container()), + Expanded(child:Container()), Expanded(child:Container()) ], ), diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index b9f546be..3b9cab84 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -1,35 +1,283 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/community/community_view/community_dynamic.dart'; +import 'package:huixiang/community/photo_view_gallery_screen.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/comunity_comment.dart'; +import 'package:huixiang/retrofit/data/member_Infor.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/social_info.dart'; +import 'package:huixiang/retrofit/data/upload_result.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; +import 'package:image_pickers/image_pickers.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class PersonalPage extends StatefulWidget { + final Map arguments; + + PersonalPage({this.arguments}); @override State createState() { return _PersonalPage(); } } -class _PersonalPage extends State - with WidgetsBindingObserver { +class _PersonalPage extends State with WidgetsBindingObserver { ApiService apiService; final RefreshController refreshController = RefreshController(); final ScrollController scrollController = ScrollController(); + var isShrink = false; + int pageNum = 1; + String userId; + List
articles = []; + MemberInfor memberInfor; + String filePath; + bool isLoadMore = false; + String memberId; + Map modifyInfo = { + "background": "" + }; @override void initState() { super.initState(); + memberId = widget.arguments["memberId"]; WidgetsBinding.instance.addObserver(this); - _onRefresh(); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService(Dio(), + showLoading: true, + context: context, token: value.getString('token')), + _onRefresh(), + }); + } + + _onRefresh() async { + pageNum = 1; + setState(() { + queryCommunity(); + queryMember(memberId); + }); + } + + ///查询会员信息 + queryMember(id) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = + await apiService.memberDetail(id).catchError((error) { + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + setState(() { + memberInfor = baseData.data; + }); + refreshController.refreshCompleted(); + }else { + refreshController.refreshFailed(); + } + } + + ///动态列表 + queryCommunity() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + userId = value.getString('userId'); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + if(isLoadMore){ + pageNum += 1; + isLoadMore = false; + } + BaseData> baseData = await apiService.trendList({ + "mid":memberId == "0" ? userId : memberId, + "onlyFollow": false, + "onlyMe": true, + "pageNum": pageNum, + "pageSize": 10, + "searchKey": "" + }).catchError((error) { + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + + refreshController.refreshCompleted(); + refreshController.loadComplete(); + if (baseData.isSuccess) { + if (pageNum == 1) { + articles.clear(); + } + baseData.data.list.forEach((element) { + var article = Article(); + article.id = element.id; + article.content = jsonEncode(element.subjectInfo); + article.mainTitle = element.subject; + article.followed = element.selfFollow; + article.authorHeadImg = element.memberInfo?.avatar; + article.authorName = element.memberInfo?.nickname; + article.location = element.location; + article.createTime = element.createTime; + article.author = element.memberInfo?.mid; + article.viewers = element?.viewers; + article.likes = element?.likes; + article.comments = element?.comments; + articles.add(article); + }); + // print("comments: ${comments.length}"); + if (int.tryParse(baseData.data.total) < (pageNum * 10)) { + refreshController.loadNoData(); + } + } + } + + ///去编辑个人资料 + _toUserInfo() async { + SharedPreferences shared = await SharedPreferences.getInstance(); + if (shared.getString("token") == null || shared.getString("token") == "") { + Navigator.of(context) + .pushNamed('/router/login_page', arguments: {"login": "login"}); + return; + } + await Navigator.of(context).pushNamed('/router/user_info_page').then((value) { + _onRefresh(); + setState(() {}); + }); + setState(() {}); + } + + ///显示图片选择方式 + showImagePicker() { + showCupertinoModalPopup( + context: context, + builder: (contetx) { + return CupertinoActionSheet( + title: Text(S.of(context).genghuantouxiang), + actions: [ + CupertinoActionSheetAction( + child: Text(S.of(context).paizhao), + onPressed: () { + openCamera(); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + CupertinoActionSheetAction( + child: Text(S.of(context).xiangce), + onPressed: () { + openStorage(); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + ], + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(S.of(context).quxiao), + isDestructiveAction: true, + ), + ); + }); + } + + ///拍照 + openCamera() async { + if (await Permission.camera.isGranted) { + Media medias = await ImagePickers.openCamera( + cameraMimeType: CameraMimeType.photo, + cropConfig: CropConfig( + enableCrop: true, + width: 200, + height: 200, + ), + compressSize: 500, + ); + if (medias == null) return; + filePath = medias.path; + fileUpload(); + } else { + await Permission.camera.request(); + openCamera(); + } + } + + ///打开相册 + openStorage() async { + if (await Permission.storage.isGranted) { + List medias = await ImagePickers.pickerPaths( + galleryMode: GalleryMode.image, + selectCount: 1, + showGif: true, + showCamera: false, + compressSize: 500, + uiConfig: UIConfig( + uiThemeColor: Color(0xFFFFFFFF), + ), + cropConfig: CropConfig( + enableCrop: true, + width: 200, + height: 200, + ), + ); + if (medias == null || medias.length == 0) return; + filePath = medias[0].path; + setState(() {}); + fileUpload(); + } else { + await Permission.storage.request(); + openStorage(); + } } - _onRefresh() { + ///调用修改用户信息接口 + modifyInfos() async { + var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); + if (info.isSuccess) { + setState(() { + SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); + }); + _onRefresh(); + } + } + ///文件上传 + fileUpload() async { + if (filePath != null && filePath != "" && await File(filePath).exists()) { + BaseData baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + UploadResult uploadResult = baseData.data; + modifyInfo["background"] = uploadResult.url; + modifyInfos(); + } + } } @override @@ -51,112 +299,320 @@ class _PersonalPage extends State ), onRefresh: _onRefresh, onLoading: () { - _onRefresh(); + isLoadMore = true; + setState(() { + _onRefresh(); + }); }, physics: BouncingScrollPhysics(), scrollController: scrollController, child: Container( + height: double.infinity, child: SingleChildScrollView( physics: BouncingScrollPhysics(), - child: Container( - color: Color(0xFFF7F7F7), - child:Column( - children: [ - Stack( - alignment: Alignment.bottomLeft, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + alignment: Alignment.bottomLeft, + children: [ + Container( + height: 286, + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Stack( + children: [ + Positioned( + child: 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.png", + fadeSrc: + "assets/image/default_1.png", + )))), + Container( + margin: EdgeInsets.only( + top: 50.h, left: 16.w, right: 16.w), + decoration: BoxDecoration( + color: Colors.transparent, + ), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.png", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + ], + ), + ), + ], + ), + if(memberId == "0") + Positioned( + bottom: 49.h, + right: 16.w, + child:GestureDetector( + onTap: (){ + showImagePicker(); + }, + child:Container( + padding: EdgeInsets.only(left: 2, right: 2), + width: 59.w, + height: 21.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0x80000000), + ), + child: Text( + "更换背景", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ), + ), + ), + ], + ), + ), + homeInfo(), + ], + ), + Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - // height: 286, - child: - Stack( - alignment: Alignment.bottomCenter, - children: [ - Stack( + margin: EdgeInsets.only( + left: 86, top: 12, right: 16), + child: GestureDetector( + onTap: () { + setState(() { + isShrink = !isShrink; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - Positioned( - child: Container( - color: Colors.black, - child:Opacity( - opacity:0.9, - child: MImage( - "", - width: double.infinity, - height: 260.h, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ) - ) - ) + Expanded( + flex: 1, + child: Text( + memberId == "0" ? ((memberInfor?.signature == null) ? "还未编辑个性签名~" : 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), + )), + Icon( + (isShrink != null && !isShrink) + ? Icons.chevron_right + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, ), - Container( - margin: EdgeInsets.only( - top: 50.h, left: 16.w, right: 16.w), - decoration: BoxDecoration( + ], + ), + )), + Container( + margin: EdgeInsets.only(left: 16, right: 16), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( color: Colors.transparent, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - GestureDetector( - child: Image.asset( - "assets/image/integral_return.png", - width: 24, - height: 24, + 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, + ), ), - onTap: () { - Navigator.of(context).pop(); - }, - ), - ], - ), - ), - ], + SizedBox( + height: 4, + ), + Text( + S.of(context).guanzhu, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), + ), + ], + )), + ), ), - Container( - child: Column( - children: [ - Padding(padding:EdgeInsets.only(right:16.w,bottom:16.h), - child: Row( - children: [ - Spacer(), - Container( - margin: EdgeInsets.only(top: 8, right: 8), - padding: EdgeInsets.only(left: 2, right: 2), - width: 59.w, - height: 21.h, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - color: Color(0x80000000), - ), - child: Text( - "更换背景", - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), - ), + 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, + ), + 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, + ), + Text( + "动态", + 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, + ), + Text( + "获赞", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), + ), + ], + )), ), ), ], ), ), - // homeInfo(), + Container( + margin: EdgeInsets.all(16), + height: 1.h, + color: Color(0xFFF7F7F7), + ), + Padding( + padding: EdgeInsets.only(left: 16), + child: Text( + memberId != "0" ? + "TA的动态": + "我的动态", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + )), + dynamicList() ], ), - ], - ), + ), + ], ), ), ), @@ -171,23 +627,201 @@ class _PersonalPage extends State ); } - Widget homeInfo(){ + Widget homeInfo() { return Container( - margin: EdgeInsets.only(left: 16), + margin: EdgeInsets.only( + left: 16, + right: 16, + ), child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - MImage( - "", - isCircle: true, - width: 66, - height: 66, - fit: BoxFit.cover, - errorSrc: "assets/image/default_user.png", - fadeSrc: "assets/image/default_user.png", + GestureDetector( + onTap: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PhotoViewGalleryScreen( + images: [(memberInfor?.headimg ?? "").isEmpty? + "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":memberInfor?.headimg + ], //传入图片list + index: 0, //传入当前点击的图片的index + ), + )); + }, + child: MImage( + memberInfor?.headimg ?? "", + isCircle: true, + width: 66, + height: 66, + fit: BoxFit.cover, + errorSrc: "assets/image/default_user.png", + fadeSrc: "assets/image/default_user.png", + ), + ), + SizedBox(width: 10.w), + Text( + 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.png", + width: 20, + height: 20, + ), + Spacer(), + if(memberId == "0") + GestureDetector( + onTap: () { + setState(() { + _toUserInfo(); + }); + }, + child: Container( + padding: EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1, + color: Color(0xFF353535), + style: BorderStyle.solid, + ), + ), + child: Text( + "编辑个人资料", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + ) + // GestureDetector( + // onTap: (){ + // setState(() { + // _vipFollow(messageRelational["mid"].toString(),message?.followed ?? false); + // }); + // }, + // child: + // RoundButton( + // height: 21.h, + // width:56.w, + // padding: EdgeInsets.all(2), + // backgroup: (message?.followed ?? false) + // ? Color(0xFFE6E6E6) + // : Color(0xFF32A060), + // textColor: (message?.followed ?? false) + // ? Color(0xFF808080) + // : Colors.white, + // text: (message?.followed ?? false) ? "已关注" : "回关", + // radius:20, + // icons: Icon( + // (message?.followed ?? false) + // ? Icons.check + // : Icons.add, + // color: (message?.followed?? false) + // ? Color(0xFF808080) + // : Colors.white, + // size: 12, + // ), + // ) + // // Container( + // // height: 21.h, + // // width:56.w, + // // padding:EdgeInsets.only(left:5,right:5), + // // alignment: Alignment.center, + // // decoration: BoxDecoration( + // // borderRadius: BorderRadius.circular(11), + // // border: Border.all( + // // width: 1, + // // color: Color(0xFF00A359), + // // style: BorderStyle.solid, + // // ), + // // color: (message?.followed ?? false) + // // ? Color(0xFFE6E6E6) + // // : Color(0xFF32A060), + // // ), + // // child: Row( + // // children: [ + // // Icon((message?.followed ?? false) + // // ? Icons.check + // // : Icons.add, + // // color:(message?.followed?? false) + // // ? Color(0xFF808080) + // // : Colors.white, + // // size: 16, + // // ), + // // Text( + // // (message?.followed ?? false) ? "已关注" : "回关", + // // style: TextStyle( + // // fontSize: 12.sp, + // // fontWeight: MyFontWeight.medium, + // // color:(message?.followed ?? false) + // // ? Color(0xFF808080) + // // : Colors.white, + // // ), + // // ), + // // ], + // // ), + // // ) + // ) ], ), ); } + Widget dynamicList() { + return Container( + color: Color(0xFFFFFFFF), + child: (articles == null || articles.length == 0)? NoDataView( + src: "assets/image/dong_tai.png", + isShowBtn: false, + text: "目前暂无发布动态,要把开心的事讲出来哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(left: 60.w,right: 60.w), + ):ListView.builder( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return InkWell( + child: CommunityDynamic( + articles[position], + memberId == "0" ? 1 : 0, + exitFull: () { + setState(() { + _onRefresh(); + }); + }, + removalDynamic: () { + setState(() { + _onRefresh(); + }); + }, + ), + onTap: () { + Navigator.of(context).pushNamed( + '/router/community_details', + arguments: { + "businessId": articles[position].id, + "userId": userId, + }, + ).then((value) { + _onRefresh(); + }); + }, + ); + }, + itemCount: articles.length, + ), + ); + } } diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index e44217cc..0f46b319 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -1,3 +1,4 @@ + import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/lib/mine/release_page.dart b/lib/mine/release_page.dart index d38f1ba1..68ffbd42 100644 --- a/lib/mine/release_page.dart +++ b/lib/mine/release_page.dart @@ -55,6 +55,7 @@ class _ReleasePage extends State { } pageNum += 1; BaseData> baseData = await apiService.trendList({ + "mid":"", "onlyFollow": false, "onlyMe": true, "pageNum": pageNum, @@ -76,11 +77,11 @@ class _ReleasePage extends State { article.id = element.id; article.content = jsonEncode(element.subjectInfo); article.mainTitle =element.subject; - article.isFollow = element.selfFollow; + article.followed = element.selfFollow; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; article.createTime = element.createTime; - article.updateUser = element.memberInfo?.mid; + article.author = element.memberInfo?.mid; article.viewers = element?.viewers; article.likes = element?.likes; article.comments = element?.comments; diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index e774a7aa..53e495c0 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/upload_result.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/cupertino_date_picker.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -33,7 +34,8 @@ class _UserInfoPage extends State { "birth": "", "headimg": "", "nickname": "", - "sex": "" + "sex": "", + "signature":"" }; @override @@ -44,6 +46,7 @@ class _UserInfoPage extends State { user = UserInfo.fromJson(jsonDecode(value.getString('user'))), mobile = value.getString('mobile'), modifyInfo["nickname"] = user.nickname, + modifyInfo["signature"] = user.signature, modifyInfo["birth"] = user.birth, modifyInfo["headimg"] = user.headimg, modifyInfo["sex"] = user.sex, @@ -173,17 +176,24 @@ class _UserInfoPage extends State { child: avatarItem(1, (modifyInfo["nickname"]) == "" ? "回乡" : modifyInfo["nickname"]), ), + InkWell( + onTap: () { + editSignature(); + }, + child:avatarItem(2, + (modifyInfo["signature"]) == "" ? "还未编辑个性签名~" : modifyInfo["signature"]), + ), InkWell( onTap:(modifyInfo["birth"] == "")?showDateSelector:(){}, child: avatarItem( - 2, + 3, (modifyInfo["birth"] != null && modifyInfo["birth"] != "") ? modifyInfo["birth"] : S.of(context).wanshanshengrixinxi_yhq), ), - avatarItem(3, mobile), + avatarItem(4, mobile), avatarItem( - 4, + 5, (age == null || age == "") ? S.of(context).wanshanshengrixinxi_nl : S.of(context).sui(age)), @@ -202,9 +212,20 @@ class _UserInfoPage extends State { } } + editSignature() async { + dynamic signature = await Navigator.of(context).pushNamed('/router/edit_signature', + arguments: {"signature": modifyInfo['signature']}); + if (signature != null && signature != "") { + modifyInfo["signature"] = signature; + setState(() {}); + modifyInfos(); + } + } + List itemLefts = [ S.current.touxiang, S.current.yonghuming, + "个性签名", S.current.wodeshengri, S.current.shoujihao, S.current.wodenianling, @@ -347,6 +368,9 @@ class _UserInfoPage extends State { modifyInfos() async { var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); if (info.isSuccess) { + SharedPreferences.getInstance().then((value){ + value.setString('user', jsonEncode(modifyInfo)); + }); setState(() { SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); }); @@ -365,6 +389,8 @@ class _UserInfoPage extends State { } } + + Widget avatarItem(type, value) { print("object: $value"); return Container( @@ -383,7 +409,8 @@ class _UserInfoPage extends State { flex: 1, ), buildValue(type, value), - if (type != 4 && type != 3 && (((modifyInfo["birth"] == "")) || type != 2)) valueEnd(), + if (type != 5 && type != 4 && type != 3 && (((modifyInfo["birth"] == "")) || type != 3)) + valueEnd(), ], ), ); @@ -391,17 +418,10 @@ class _UserInfoPage extends State { Widget valueEnd() { return Container( - child: Row( - children: [ - SizedBox( - width: 8.w, - ), - Icon( - Icons.keyboard_arrow_right, - size: 20.sp, - ) - ], - ), + child: Icon( + Icons.keyboard_arrow_right, + size: 20.sp, + ) ); } @@ -433,6 +453,8 @@ class _UserInfoPage extends State { } else if (type == 1) { return Text( value, + maxLines: 1, + overflow:TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, @@ -440,14 +462,17 @@ class _UserInfoPage extends State { ), ); } else { - return Text( + return Expanded(child: Text( value, + maxLines: 1, + overflow:TextOverflow.ellipsis, + textAlign: TextAlign.right, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, color: Color(0xFF727272), ), - ); + )); } } } diff --git a/lib/retrofit/data/article.dart b/lib/retrofit/data/article.dart index 5af314d9..e1a3be86 100644 --- a/lib/retrofit/data/article.dart +++ b/lib/retrofit/data/article.dart @@ -1,269 +1,359 @@ import 'dart:convert'; -import 'package:huixiang/retrofit/data/author.dart'; - +import 'author.dart'; + +/// id : "1498607093517647872" +/// createTime : "2022-03-01 18:32:29" +/// createUser : "1495959790726152192" +/// updateTime : "2022-03-01 18:45:04" +/// updateUser : "1495959790726152192" +/// storeId : "0" +/// categoryId : "0" +/// mainTitle : "哈哈哈哈" +/// viceTitle : null +/// content : "{\"images\":[],\"video\":\"\",\"type\":\"text\"}" +/// coverImg : "" +/// author : "1495959790726152192" +/// type : 3 +/// likes : 0 +/// viewers : 2 +/// startTime : "2022-03-01 18:32:28" +/// endTime : "2121-03-01 18:32:28" +/// isHot : false +/// state : 1 +/// location : "" +/// longitude : "0.000000" +/// latitude : "0.000000" +/// remark : "" +/// isDelete : 0 +/// tenantCode : "" +/// storeName : null +/// liked : false +/// followed : false +/// comments : null +/// authorName : "小帽子" +/// authorHeadImg : "https://pos.upload.gznl.top/admin/2022/02/5877a3fe-0d25-405b-a86b-7bac293ab048.jpeg" class Article { + Article({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String storeId, + String categoryId, + String mainTitle, + dynamic viceTitle, + String content, + String coverImg, + dynamic author, + int type, + int likes, + int viewers, + String startTime, + String endTime, + bool isHot, + int state, + String location, + String longitude, + String latitude, + String remark, + int isDelete, + String tenantCode, + dynamic storeName, + bool liked, + bool followed, + dynamic comments, + String authorName, + String authorHeadImg,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _storeId = storeId; + _categoryId = categoryId; + _mainTitle = mainTitle; + _viceTitle = viceTitle; + _content = content; + _coverImg = coverImg; + _author = author; + _type = type; + _likes = likes; + _viewers = viewers; + _startTime = startTime; + _endTime = endTime; + _isHot = isHot; + _state = state; + _location = location; + _longitude = longitude; + _latitude = latitude; + _remark = remark; + _isDelete = isDelete; + _tenantCode = tenantCode; + _storeName = storeName; + _liked = liked; + _followed = followed; + _comments = comments; + _authorName = authorName; + _authorHeadImg = authorHeadImg; + } + + Article.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _storeId = json['storeId']; + _categoryId = json['categoryId']; + _mainTitle = json['mainTitle']; + _viceTitle = json['viceTitle']; + _content = json['content']; + _coverImg = json['coverImg']; + _author = json["author"] == null ? author : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):json["author"]; + _type = json['type']; + _likes = json['likes']; + _viewers = json['viewers']; + _startTime = json['startTime']; + _endTime = json['endTime']; + _isHot = json['isHot']; + _state = json['state']; + _location = json['location']; + _longitude = json['longitude']; + _latitude = json['latitude']; + _remark = json['remark']; + _isDelete = json['isDelete']; + _tenantCode = json['tenantCode']; + _storeName = json['storeName']; + _liked = json['liked']; + _followed = json['followed']; + _comments = json['comments']; + _authorName = json['authorName']; + _authorHeadImg = json['authorHeadImg']; + } String _id; String _createTime; - dynamic _createUser; + String _createUser; String _updateTime; - dynamic _updateUser; + String _updateUser; String _storeId; + String _categoryId; String _mainTitle; dynamic _viceTitle; String _content; String _coverImg; dynamic _author; int _type; + int _likes; + int _viewers; String _startTime; - String _categoryId; String _endTime; + bool _isHot; int _state; + String _location; + String _longitude; + String _latitude; + String _remark; int _isDelete; - int _likes; - bool _isHot; + String _tenantCode; + dynamic _storeName; bool _liked; - int _viewers; - int _comments; + bool _followed; + dynamic _comments; String _authorName; String _authorHeadImg; - bool isFollow; - dynamic _storeName; String get id => _id; String get createTime => _createTime; - dynamic get createUser => _createUser; + String get createUser => _createUser; String get updateTime => _updateTime; - dynamic get updateUser => _updateUser; + String get updateUser => _updateUser; String get storeId => _storeId; + String get categoryId => _categoryId; String get mainTitle => _mainTitle; dynamic get viceTitle => _viceTitle; String get content => _content; String get coverImg => _coverImg; dynamic get author => _author; int get type => _type; + int get likes => _likes; + int get viewers => _viewers; String get startTime => _startTime; - String get categoryId => _categoryId; String get endTime => _endTime; + bool get isHot => _isHot; int get state => _state; + String get location => _location; + String get longitude => _longitude; + String get latitude => _latitude; + String get remark => _remark; int get isDelete => _isDelete; - int get likes => _likes; - bool get isHot => _isHot; + String get tenantCode => _tenantCode; + dynamic get storeName => _storeName; bool get liked => _liked; - int get viewers => _viewers; - int get comments => _comments; + bool get followed => _followed; + dynamic get comments => _comments; String get authorName => _authorName; String get authorHeadImg => _authorHeadImg; - dynamic get storeName => _storeName; - set id(String value) { - _id = value; + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['storeId'] = _storeId; + map['categoryId'] = _categoryId; + map['mainTitle'] = _mainTitle; + map['viceTitle'] = _viceTitle; + map['content'] = _content; + map['coverImg'] = _coverImg; + map["author"] = _author.toJson() ?? _author; + map['type'] = _type; + map['likes'] = _likes; + map['viewers'] = _viewers; + map['startTime'] = _startTime; + map['endTime'] = _endTime; + map['isHot'] = _isHot; + map['state'] = _state; + map['location'] = _location; + map['longitude'] = _longitude; + map['latitude'] = _latitude; + map['remark'] = _remark; + map['isDelete'] = _isDelete; + map['tenantCode'] = _tenantCode; + map['storeName'] = _storeName; + map['liked'] = _liked; + map['followed'] = _followed; + map['comments'] = _comments; + map['authorName'] = _authorName; + map['authorHeadImg'] = _authorHeadImg; + return map; } - set likes(int value) { - _likes = value; + set authorHeadImg(String value) { + _authorHeadImg = value; + } + + set authorName(String value) { + _authorName = value; + } + + set comments(dynamic value) { + _comments = value; + } + + set followed(bool value) { + _followed = value; } set liked(bool value) { _liked = value; } - set viewers(int value) { - _viewers = value; + set storeName(dynamic value) { + _storeName = value; } - set comments(int value) { - _comments = value; + set tenantCode(String value) { + _tenantCode = value; } - set authorName(String value) { - _authorName = value; + set isDelete(int value) { + _isDelete = value; } - set authorHeadImg(String value) { - _authorHeadImg = value; + set remark(String value) { + _remark = value; } - Article({ - String id, - String createTime, - dynamic createUser, - String updateTime, - dynamic updateUser, - String storeId, - String mainTitle, - dynamic viceTitle, - String content, - String coverImg, - Author author, - int type, - String startTime, - String endTime, - int state, - int isDelete, - int likes, - bool isHot, - int viewers, - int comments, - String authorName, - String authorHeadImg, - - dynamic storeName}){ - _id = id; - _createTime = createTime; - _createUser = createUser; - _updateTime = updateTime; - _updateUser = updateUser; - _storeId = storeId; - _mainTitle = mainTitle; - _viceTitle = viceTitle; - _content = content; - _coverImg = coverImg; - _author = author; - _type = type; - _startTime = startTime; - _categoryId = categoryId; - _endTime = endTime; - _state = state; - _isDelete = isDelete; - _likes = likes; - _isHot = isHot; - _liked = liked; - _viewers = viewers; - _comments = comments; - _authorName = authorName; - _authorHeadImg = authorHeadImg; - _storeName = storeName; -} + set latitude(String value) { + _latitude = value; + } - Article.fromJson(dynamic json) { - _id = json["id"]; - _createTime = json["createTime"]; - _createUser = json["createUser"]; - _updateTime = json["updateTime"]; - _updateUser = json["updateUser"]; - _storeId = json["storeId"]; - _mainTitle = json["mainTitle"]; - _viceTitle = json["viceTitle"]; - _content = json["content"]; - _coverImg = json["coverImg"]; - _author = json["author"] == null ? null : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):null; - _type = json["type"]; - _startTime = json["startTime"]; - _categoryId = json["categoryId"]; - _endTime = json["endTime"]; - _state = json["state"]; - _isDelete = json["isDelete"]; - _likes = json["likes"]; - _isHot = json["isHot"]; - _liked = json["liked"]; - _viewers = json["viewers"]; - _comments = json["comments"]; - _authorName = json["authorName"]; - _authorHeadImg = json["authorHeadImg"]; - _storeName = json["storeName"]; + set longitude(String value) { + _longitude = value; } - Map toJson() { - var map = {}; - map["id"] = _id; - map["createTime"] = _createTime; - map["createUser"] = _createUser; - map["updateTime"] = _updateTime; - map["updateUser"] = _updateUser; - map["storeId"] = _storeId; - map["mainTitle"] = _mainTitle; - map["viceTitle"] = _viceTitle; - map["content"] = _content; - map["coverImg"] = _coverImg; - map["author"] = _author.toJson(); - map["type"] = _type; - map["startTime"] = _startTime; - map["categoryId"] = _categoryId; - map["endTime"] = _endTime; - map["state"] = _state; - map["isDelete"] = _isDelete; - map["likes"] = _likes; - map["isHot"] = _isHot; - map["liked"] = _liked; - map["viewers"] = _viewers; - map["comments"] = _comments; - map["authorName"] = _authorName; - map["authorHeadImg"] = _authorHeadImg; - map["storeName"] = _storeName; - return map; + set location(String value) { + _location = value; } - set createTime(String value) { - _createTime = value; + set state(int value) { + _state = value; } - set createUser(dynamic value) { - _createUser = value; + set isHot(bool value) { + _isHot = value; } - set updateTime(String value) { - _updateTime = value; + set endTime(String value) { + _endTime = value; } - set updateUser(dynamic value) { - _updateUser = value; + set startTime(String value) { + _startTime = value; } - set storeId(String value) { - _storeId = value; + set viewers(int value) { + _viewers = value; } - set mainTitle(String value) { - _mainTitle = value; + set likes(int value) { + _likes = value; } - set viceTitle(dynamic value) { - _viceTitle = value; + set type(int value) { + _type = value; } - set content(String value) { - _content = value; + set author(dynamic value) { + _author = value; } set coverImg(String value) { _coverImg = value; } - set author(dynamic value) { - _author = value; + set content(String value) { + _content = value; } - set type(int value) { - _type = value; + set viceTitle(dynamic value) { + _viceTitle = value; } - set startTime(String value) { - _startTime = value; + set mainTitle(String value) { + _mainTitle = value; } set categoryId(String value) { _categoryId = value; } - set endTime(String value) { - _endTime = value; + set storeId(String value) { + _storeId = value; } - set state(int value) { - _state = value; + set updateUser(String value) { + _updateUser = value; } - set isDelete(int value) { - _isDelete = value; + set updateTime(String value) { + _updateTime = value; } - set isHot(bool value) { - _isHot = value; + set createUser(String value) { + _createUser = value; } - set storeName(dynamic value) { - _storeName = value; + set createTime(String value) { + _createTime = value; + } + + set id(String value) { + _id = value; } } \ No newline at end of file diff --git a/lib/retrofit/data/comunity_comment.dart b/lib/retrofit/data/comunity_comment.dart index 3cb78955..ba218cd3 100644 --- a/lib/retrofit/data/comunity_comment.dart +++ b/lib/retrofit/data/comunity_comment.dart @@ -11,16 +11,19 @@ class ComunityComment { ComunityComment({ - String id, - String subject, - SubjectInfo subjectInfo, - MemberInfo memberInfo, - int likes, - int viewers, - int comments, - bool selfLike, + String id, + String subject, + SubjectInfo subjectInfo, + MemberInfo memberInfo, + int likes, + int viewers, + int comments, + bool selfLike, bool selfFollow, String createTime, + String location, + String longitude, + String latitude, String coverImg,}){ this.id = id; this.subject = subject; @@ -32,6 +35,9 @@ class ComunityComment { this.selfLike = selfLike; this.selfFollow = selfFollow; this.createTime = createTime; + this.location = location; + this.longitude = longitude; + this.latitude = latitude; this.coverImg = coverImg; } @@ -46,6 +52,9 @@ class ComunityComment { this.selfLike = json['selfLike']; this.selfFollow = json['selfFollow']; this.createTime = json['createTime']; + this.location = json['location']; + this.longitude = json['longitude']; + this.latitude = json['latitude']; this.coverImg = json['coverImg']; } String id; @@ -58,6 +67,9 @@ class ComunityComment { bool selfLike; bool selfFollow; String createTime; + String location; + String longitude; + String latitude; String coverImg; Map toJson() { @@ -76,6 +88,9 @@ class ComunityComment { map['selfLike'] = this.selfLike; map['selfFollow'] = this.selfFollow; map['createTime'] = this.createTime; + map['location'] = this.location; + map['longitude'] = this.longitude; + map['latitude'] = this.latitude; map['coverImg'] = this.coverImg; return map; } @@ -88,8 +103,8 @@ class ComunityComment { class MemberInfo { MemberInfo({ - dynamic mid, - dynamic nickname, + dynamic mid, + dynamic nickname, String avatar,}){ this.mid = mid; this.nickname = nickname; @@ -121,8 +136,8 @@ class MemberInfo { class SubjectInfo { SubjectInfo({ - String type, - List images, + String type, + List images, String video, String coverImg,}){ this.type = type; diff --git a/lib/retrofit/data/member_Infor.dart b/lib/retrofit/data/member_Infor.dart new file mode 100644 index 00000000..c9daf168 --- /dev/null +++ b/lib/retrofit/data/member_Infor.dart @@ -0,0 +1,134 @@ +/// id : "1379254113602109440" +/// nickname : "哈哈哈" +/// headimg : "https://pos.upload.gznl.top/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg" +/// userType : true +/// sex : "0" +/// level : 1 +/// remark : "" +/// createTime : "2021-04-06 10:06:21" +/// birth : "1998-09-17" +/// organic : 0 +/// age : 23 +/// signature : "" +/// background : "" +/// follow : 1 +/// fans : 0 +/// trendTotal : 4 +/// gainLikeTotal : 9 + +class MemberInfor { + MemberInfor({ + String id, + String nickname, + String headimg, + bool userType, + String sex, + int level, + String remark, + String createTime, + String birth, + int organic, + int age, + String signature, + String background, + int follow, + int fans, + int trendTotal, + int gainLikeTotal,}){ + _id = id; + _nickname = nickname; + _headimg = headimg; + _userType = userType; + _sex = sex; + _level = level; + _remark = remark; + _createTime = createTime; + _birth = birth; + _organic = organic; + _age = age; + _signature = signature; + _background = background; + _follow = follow; + _fans = fans; + _trendTotal = trendTotal; + _gainLikeTotal = gainLikeTotal; +} + + MemberInfor.fromJson(dynamic json) { + _id = json['id']; + _nickname = json['nickname']; + _headimg = json['headimg']; + _userType = json['userType']; + _sex = json['sex']; + _level = json['level']; + _remark = json['remark']; + _createTime = json['createTime']; + _birth = json['birth']; + _organic = json['organic']; + _age = json['age']; + _signature = json['signature']; + _background = json['background']; + _follow = json['follow']; + _fans = json['fans']; + _trendTotal = json['trendTotal']; + _gainLikeTotal = json['gainLikeTotal']; + } + String _id; + String _nickname; + String _headimg; + bool _userType; + String _sex; + int _level; + String _remark; + String _createTime; + String _birth; + int _organic; + int _age; + String _signature; + String _background; + int _follow; + int _fans; + int _trendTotal; + int _gainLikeTotal; + + String get id => _id; + String get nickname => _nickname; + String get headimg => _headimg; + bool get userType => _userType; + String get sex => _sex; + int get level => _level; + String get remark => _remark; + String get createTime => _createTime; + String get birth => _birth; + int get organic => _organic; + int get age => _age; + String get signature => _signature; + String get background => _background; + int get follow => _follow; + int get fans => _fans; + int get trendTotal => _trendTotal; + int get gainLikeTotal => _gainLikeTotal; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['nickname'] = _nickname; + map['headimg'] = _headimg; + map['userType'] = _userType; + map['sex'] = _sex; + map['level'] = _level; + map['remark'] = _remark; + map['createTime'] = _createTime; + map['birth'] = _birth; + map['organic'] = _organic; + map['age'] = _age; + map['signature'] = _signature; + map['background'] = _background; + map['follow'] = _follow; + map['fans'] = _fans; + map['trendTotal'] = _trendTotal; + map['gainLikeTotal'] = _gainLikeTotal; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index ad65f6f7..2eb63867 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -41,6 +41,10 @@ class UserInfo { String masterCardRankName; MemberRank memberRankVo; String inviteCode; + String signature; + String background; + + factory UserInfo.fromJson(Map json) => UserInfo() @@ -65,6 +69,8 @@ class UserInfo { ..todayInviteNumber = json['todayInviteNumber'] as int ..masterCardRankName = json['masterCardRankName'] as String ..inviteCode = json['inviteCode'] as String + ..signature = json['signature'] as String + ..background = json['background'] as String ..memberRankVo = json['memberRankVo'] == null ? null : MemberRank.fromJson(json['memberRankVo'] as Map); @@ -91,6 +97,8 @@ class UserInfo { "todayInviteNumber": this.todayInviteNumber, 'masterCardRankName': this.masterCardRankName, 'inviteCode' : this.inviteCode, - 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), + 'signature' : this.signature, + 'background' : this.background, + 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), }; } diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 84461685..0c0e7b7e 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -32,8 +32,8 @@ const base_url = "http://192.168.10.236:8765/app/";///费韬 const baseUrl = "http://192.168.10.236:8765/app/";///费韬 -// const base_url = "http://192.168.10.88:8765/app/";///詹云久 -// const baseUrl = "http://192.168.10.88:8765/app/";///詹云久 +// const base_url = "http://192.168.10.143:8765/app/";///詹云久 +// const baseUrl = "http://192.168.10.143:8765/app/";///詹云久 // const base_url = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 55730ee0..287592f9 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -36,6 +36,7 @@ import 'data/headlines_list.dart'; import 'data/headlines_list_details.dart'; import 'data/invitation_list.dart'; import 'data/logistics.dart'; +import 'data/member_Infor.dart'; import 'data/member_comment_list.dart'; import 'data/message.dart'; import 'data/msg_stats.dart'; @@ -69,8 +70,8 @@ const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.37:8766/app/"; -// const base_url = "http://192.168.10.88:8766/app/";///詹云久 -// const baseUrl = "http://192.168.10.88:8766/app/";///詹云久 +// const base_url = "http://192.168.10.143:8766/app/";///詹云久 +// const baseUrl = "http://192.168.10.143:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { @@ -88,8 +89,8 @@ abstract class ApiService { headers["Environment"] = "app"; } dio.options = BaseOptions( - connectTimeout: 20000, - receiveTimeout: 20000, + connectTimeout: 60000, + receiveTimeout: 60000, headers: headers, responseType: ResponseType.json, ); @@ -496,7 +497,11 @@ abstract class ApiService { Future wiped(@Path("memberCouponId") String memberCouponId); ///查询优惠券详情 - @GET("coupon/detail/") + @GET("/coupon/detail/") Future> couponDetail(@Path("") String memberCouponId); + ///查询会员信息 + @GET("/member/detail/{id}") + Future> memberDetail(@Path("id") String id); + } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index ad727613..205b7a37 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -1851,4 +1851,25 @@ class _ApiService implements ApiService { ); return value; } + + @override + Future> memberDetail(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/detail/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => MemberInfor.fromJson(json), + ); + return value; + } } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 60bc4a6c..03e494ee 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -284,8 +284,9 @@ class _Settlement extends State { this.downOrder = baseData.data; querySettlement(); } else { - SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center); - // SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + baseData?.isSuccess ?? false ? + SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center): + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } else { ///火锅店下单, 等待结算 diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 9c1738c4..ea98a22a 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -506,8 +506,6 @@ class _StoreOrderPage extends State } } - - /// 领取成功弹窗 showAlertDialog() { //显示对话框 diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart index 16227c23..fcbc63f9 100644 --- a/lib/web/web_view/web_content.dart +++ b/lib/web/web_view/web_content.dart @@ -59,7 +59,7 @@ class _WebContent extends State { // + "立即购买", style: { "html": Style( - backgroundColor: Colors.white + backgroundColor: Color(0xffffffff) ) }, onLinkTap: (url, ct, attributes, element) { From b209f5bcc6f71e81a5c8ded549fb2ce18896df27 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 4 Mar 2022 14:48:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A4=BE=E7=BE=A4?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E4=B8=BE=E6=8A=A5,=E5=88=86=E4=BA=ABh5?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=85=BC=E5=AE=B9=E5=8A=A8=E6=80=81,?= =?UTF-8?q?=E6=9A=82=E6=B2=A1=E6=97=B6=E9=97=B4=E5=85=BC=E5=AE=B9,?= =?UTF-8?q?=E6=9A=82=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/ju_bao.png | Bin 0 -> 2757 bytes assets/image/3x/ju_bao.png | Bin 0 -> 5439 bytes assets/image/ju_bao.png | Bin 0 -> 1223 bytes assets/svg/ju_b.svg | 1 + lib/address/edit_address_page.dart | 2 +- .../community_view/community_dynamic.dart | 373 ++++++--- lib/community/report/report_notice.dart | 98 +++ lib/community/report/report_page.dart | 195 +++++ lib/community/report/report_success.dart | 51 ++ lib/main.dart | 9 + lib/mine/personal_page.dart | 753 ++++++++---------- pubspec.lock | 57 +- pubspec.yaml | 2 + 13 files changed, 1009 insertions(+), 532 deletions(-) create mode 100644 assets/image/2x/ju_bao.png create mode 100644 assets/image/3x/ju_bao.png create mode 100644 assets/image/ju_bao.png create mode 100644 assets/svg/ju_b.svg create mode 100644 lib/community/report/report_notice.dart create mode 100644 lib/community/report/report_page.dart create mode 100644 lib/community/report/report_success.dart diff --git a/assets/image/2x/ju_bao.png b/assets/image/2x/ju_bao.png new file mode 100644 index 0000000000000000000000000000000000000000..9a1f86c818af8252c71bd97a47197540bbabe3ff GIT binary patch literal 2757 zcmV;$3OePx+Ul-x2rzY)m2^fEmftZ?q5}1 z_ndR@uh0GN+3x)iV%Xljdso5bay8G(%c}Y+Af6n7b22b9%lMS z3_v2%bY1@=08AyK+GYmjR9{4V2mmWIP5UPz>Q3?X<>NSjo@F|oh^7KS)kqB50?((2 z$UtszdU-nvpp^0tM6?C~YFe0NG)OWKF--{Zy;H&*0g#Al=(@g!i26D;ut@Sj#6y~< zr6FRbT{*S^)OEdoUS8fm5b>9G2NO+tB6^#cnD{46(+=2?YZ*WyO4fD#uSApz0G9dK z8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gG(~F zA`)tBY&?mXFH#g`poj$W=Esh}Ku|gny+TBDG)-H^%qD)>pC^Fkb5$qOpeYflV`i+S|Aj@I$z&E(R#tBC5*#+VG@hkV33fR&cRk|392!Px(fk{L`R9HvNnM+7yM-+ztx^3Gf7&lQNgg{UsL5<)8<3`0GDg;y{AqI6J5j78@ z;==gKBEE1TYRF7f3@%h+$RH{NR3xHq9Pt50Wd>9NLkMVRW5ll8ZFhyb+D$*SyX%@6 zx^{i*)H&Zh_n!aMttQYhIOmGZX3My~zWzW_lym^^aL(TV@Y=1re+eOf19o3h?6M;`Q+G@b5V1 zp8+rh>--)&l@Rii)oT4VDk|!qK)wP3s;c^l!{PV=Ky)BylJjOoQNA*nOuzVBcP}94 zJWN&9?>Xo700Q2KB%ITn6GBEzCezo1kn6jA+!>g29>Ey<6~Ko&1IsS^jZ*qCA;jXn z&<9Xtjxjd(3gMhg0Jw6w@B^{^*| zJf@V2hHxVvw;kf-AtHQuc!S7E3RH)`xg3D=Wk5 z>Z;}qPXypT=lnfA9>&JT(9qC;@$qpji?y}2 znj3LlWUr>C2E)U{uIsWf2qAwEi^X!TN1QJ&FEuHNjg7_T<|YgVgH|YFhyt%jr0#4|m zct1sTOAfPik(`{IAT>1=B_$=8oSgKC=Uyc46IE4Jn4h1=-rgSK(+uPg7$;m-oT^$Ao2Ymvqudi#@gpK!TYHGsh=qQ9u zMn*wY3G60dJ$;-d=Qd zb$LjWA4fNv1z`|qyX6$!^Ye2Y931EsT?lbcPEJNlOpHt1{Q%xf&BJw1ilY{taI1j@_H@AKukVHH;Xw)`tAD-fN-;gCN2xf4K96s@!5 z=jY!!@3Z9>Rw4h$dEn) lb_WgFLv(Msf0chj{0C^hUp2a2w=)0$002ovPDHLkV1n-xO&9 \ No newline at end of file diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index a89c5c57..ab40d4ee 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -82,7 +82,7 @@ class _EditAddressPage extends State { bottomRight: Radius.circular(8), ), ), - child: Expanded(child:Column( + child: Expanded(flex: 1,child: Column( children: [ editItem( S.of(context).xingming, diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index ec888c6b..116c55ed 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -4,6 +4,8 @@ import 'package:chewie/chewie.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:chewie/src/chewie_progress_colors.dart' as chewie; @@ -175,32 +177,36 @@ class _CommunityDynamic extends State { child: Row( children: [ GestureDetector( - onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => PhotoViewGalleryScreen( - // images: [(widget?.article?.authorHeadImg ?? "").isEmpty? - // "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":widget?.article?.authorHeadImg - // ], //传入图片list - // index: 0, //传入当前点击的图片的index - // ), - // )); - Navigator.of(context).pushNamed('/router/personal_page', - arguments:{"memberId":(widget.article.author == widget.userId) ? "0" :widget.article.author, - }); - }, - child: - MImage( - (widget?.article?.authorHeadImg ?? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"), - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - ), + onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => PhotoViewGalleryScreen( + // images: [(widget?.article?.authorHeadImg ?? "").isEmpty? + // "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":widget?.article?.authorHeadImg + // ], //传入图片list + // index: 0, //传入当前点击的图片的index + // ), + // )); + Navigator.of(context) + .pushNamed('/router/personal_page', arguments: { + "memberId": + (widget.article.author == widget.userId) + ? "0" + : widget.article.author, + }); + }, + child: MImage( + (widget?.article?.authorHeadImg ?? + "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"), + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + ), SizedBox( width: 8, ), @@ -234,7 +240,8 @@ class _CommunityDynamic extends State { onTap: () { setState(() { if (widget.commentType == 0) { - widget.article.followed = !(widget.article.followed ?? false); + widget.article.followed = + !(widget.article.followed ?? false); _vipFollow(widget.article.author, widget.article.followed ?? false); } else { @@ -294,93 +301,134 @@ class _CommunityDynamic extends State { ), ), buildMedia(widget?.article?.content), - SizedBox( - height:5.h, - ), - if(widget.article.location != "") - Row( - children: [ - Icon( - Icons.place, - size: 16, - color: Color(0xFFB3B2B2), - ), - SizedBox(width:2,), - Expanded(child: - Text( - widget?.article?.location ?? "", - overflow:TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - fontSize:12.sp, - fontWeight: MyFontWeight.medium, + SizedBox( + height:8.h, + ), + if (widget.article.location != "") + Row( + children: [ + Icon( + Icons.place, + size: 16, color: Color(0xFFB3B2B2), ), - )), - ], - ), + SizedBox( + width: 2, + ), + Expanded( + child: Text( + widget?.article?.location ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFB3B2B2), + ), + )), + ], + ), if (!widget.isDetails) SizedBox( - height:5.h, + height: 5.h, ), if (!widget.isDetails) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - IconText( - (widget.article != null) - ? "${widget.article.viewers}" - : "", - space: 4.w, - leftImage: "assets/svg/liulanliang.svg", - iconSize: 16, - textStyle: TextStyle( - fontSize: 14.sp, - ), - ), - IconText( - "${widget.article.comments ?? 0}", - space: 4.w, - leftImage: "assets/svg/pinglun.svg", - iconSize: 16, - textStyle: TextStyle( - fontSize: 14.sp, + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/svg/liulanliang.svg", + width: 16, + height: 16, + ), + SizedBox( + width: 5, + ), + Text( + (widget.article != null) + ? "${widget.article.viewers}" + : "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], ), ), - GestureDetector( - onTap: () {}, - child: IconText( - "${widget.article.likes ?? 0}", - space: 4.w, - leftImage: "assets/svg/xihuan.svg", - iconSize: 16, - textStyle: TextStyle( - fontSize: 14.sp, + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/svg/pinglun.svg", + width: 16, + height: 16, ), - ), - ), - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - share(); - }); - }, - child: Container( - // color: Colors.red, - padding: EdgeInsets.only(left:30,right:10), - // alignment: Alignment.center, - child: Text( - "...", + SizedBox( + width: 5, + ), + Text( + "${widget.article.comments ?? 0}", style: TextStyle( - fontSize:18.sp, - fontWeight: MyFontWeight.medium, - color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), ), ), + ], + )), + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/svg/xihuan.svg", + width: 16, + height: 16, + ), + SizedBox( + width: 5, + ), + Text( + "${widget.article.likes ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], ), ), + // Expanded( + // child: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () { + // setState(() { + // choiceShowBottomSheet(); + // }); + // }, + // child: Container( + // alignment: Alignment.center, + // child: Text( + // "...", + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.black, + // ), + // ), + // ))), ], ), ], @@ -397,13 +445,26 @@ class _CommunityDynamic extends State { share() async { SSDKMap params = SSDKMap() ..setGeneral( - widget?.article?.mainTitle, + widget?.article?.mainTitle ?? "", "", [ - jsonDecode(widget.article.content) + widget?.article?.content != null && + widget.article.content.contains("images\":[\"") + ? jsonDecode(widget.article.content)["images"][0] + : "", + widget?.article?.content != null && + widget.article.content.contains("video\":[\"") + ? jsonDecode(widget.article.content)["video"][0] + : "", ], - "", - "", + widget?.article?.content != null && + widget.article.content.contains("images\":[\"") + ? jsonDecode(widget.article.content)["images"][0] + : "", + widget?.article?.content != null && + widget.article.content.contains("video\":[\"") + ? jsonDecode(widget.article.content)["video"][0] + : "", buildShareUrl(), "", "", @@ -420,18 +481,18 @@ class _CommunityDynamic extends State { if (platform == ShareSDKPlatforms.line) { params.map["type"] = SSDKContentTypes.text.value; params.map["text"] = - "${widget.article.mainTitle} ${buildShareUrl()}"; + "${widget?.article?.mainTitle ?? ""} ${buildShareUrl()}"; } SharesdkPlugin.share(platform, params, - (state, userData, contentEntity, error) { - print("share!$state"); - }); + (state, userData, contentEntity, error) { + print("share!$state"); + }); }); }); } String buildShareUrl() { - return "https://hx.lotus-wallet.com/index.html?id=${widget.article.id }&type=${""}"; + return "https://hx.lotus-wallet.com/index.html?id=${widget.article.id}&type="; } ///动态内容 @@ -463,7 +524,7 @@ class _CommunityDynamic extends State { cnt["images"][0], fit: BoxFit.contain, radius: BorderRadius.circular(2), - height:MediaQuery.of(context).size.width/1.5, + height: MediaQuery.of(context).size.width / 1.5, errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", )), @@ -685,6 +746,106 @@ class _CommunityDynamic extends State { ); } + ///更多选择弹窗 + choiceShowBottomSheet() { + showModalBottomSheet( + builder: (BuildContext context) { + return buildBottomSheetWidget(context); + }, + backgroundColor: Colors.transparent, + context: context); + } + + Widget buildBottomSheetWidget(BuildContext context) { + return Container( + padding: EdgeInsets.all(16), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: new BorderRadius.only( + topLeft: const Radius.circular(25.0), + topRight: const Radius.circular(25.0))), + child: Container( + width: 100.w, + height: 100.h, + child: Column( + children: [ + SizedBox( + height: 10, + ), + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context).pop(); + share(); + }); + }, + child: Container( + child: Row( + children: [ + SizedBox( + width: 4, + ), + Image.asset( + "assets/image/icon_share.png", + fit: BoxFit.cover, + width: 25, + height: 25, + color: Color(0xff515151), + ), + SizedBox( + width: 12, + ), + Text( + "分享", + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), + )), + Container( + margin: EdgeInsets.symmetric(vertical: 12), + height: 1.h, + color: Color(0xFFF7F7F7), + ), + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context) + .popAndPushNamed('/router/report_page'); + }); + }, + child: Row( + children: [ + SizedBox( + width: 4, + ), + SvgPicture.asset( + "assets/svg/ju_b.svg", + width: 20, + height: 20, + ), + SizedBox( + width: 15, + ), + Text( + "举报", + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + )) + ], + ), + )); + } + @override void didChangeDependencies() { if (widget.heightFun != null) diff --git a/lib/community/report/report_notice.dart b/lib/community/report/report_notice.dart new file mode 100644 index 00000000..197fd882 --- /dev/null +++ b/lib/community/report/report_notice.dart @@ -0,0 +1,98 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ReportNotice extends StatefulWidget { + @override + State createState() { + return _ReportNotice(); + } +} + +class _ReportNotice extends State { + ApiService apiService; + int checkIndex = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + background: Color(0xFFFFFFFFF), + leadingColor: Colors.black, + title: "", + titleSize: 18, + titleColor: Colors.black, + ), + body: Container( + width: double.infinity, + color: Color(0xFFFFFFFFF), + padding: EdgeInsets.only(left: 16, top: 10, right: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + alignment: Alignment.center, + padding: EdgeInsets.only(top: 14, bottom: 16), + child: Text( + "投诉须知", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF1A1A1A), + ), + )), + Text( + "     为了更好地帮助您解决问题,保障您使用产品和服务的良好体验,首先您要保证您的投诉行为是基于客观事实的,是为了营造良好的社群环境,并代表您的真实感想。平台作为中立的服务者,在收到您的投诉申请后,我们会在7~15个工作日内按照相关的法律法规的规定来进行核实和处理。平台会采取合理的措施保护你的个人信息:除法律法规规定的情形外,未经用户许可,我们不会向第三方公开、透露您的相关信息。", + style: TextStyle( + fontSize: 14.sp, + height: 1.5, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + SizedBox(height: 4), + Text( + "     为了各用户的合法权益得以保障,相关投诉能有效提交,如平台有合理理由相信投诉存在以下情形,将有权根据实际情况调整处理方式。包括但不限于:" + "\n    (1)明知、应知不构成内容违规 而进行投诉;" + "\n    (2)平台已告知未发现内容存在违规仍不断重复投诉且无实质补充等情形;" + "\n    (3)多次或大量提交投诉,但整体通过率低或涉嫌滥用投诉;" + "\n    (4)非合理且正当理由,对平台正常处理其他用户人投诉造成不利影响的情形;" + "\n   上述行为一经发现,将不排除采取特殊的处理机制或限制措施,包括但不限于限制频次、记入非正常投诉名单、调整侵权投诉单处理顺序等,由此将可能导致侵权投诉不可高频提交、无法通过或审核评估时效延长等效果。", + style: TextStyle( + fontSize: 14.sp, + height: 1.5, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), + ), + flex: 1, + ), + ], + ), + ), + ); + } +} diff --git a/lib/community/report/report_page.dart b/lib/community/report/report_page.dart new file mode 100644 index 00000000..fdebdfe7 --- /dev/null +++ b/lib/community/report/report_page.dart @@ -0,0 +1,195 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ReportPage extends StatefulWidget { + final Map arguments; + + ReportPage({this.arguments}); + + @override + State createState() { + return _ReportPage(); + } +} + +class _ReportPage extends State { + ApiService apiService; + int checkIndex = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + background: Color(0xFFFFFFFFF), + leadingColor: Colors.black, + title: "举报", + titleSize: 18, + titleColor: Colors.black, + ), + body: Container( + height: double.infinity, + color: Color(0xFFFFFFFF), + child: Stack( + children: [ + SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + color: Color(0XFFFFFFFF), + padding: EdgeInsets.only(bottom: 4, left: 16, right: 16), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "举报", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + TextSpan( + text: "@百花谷", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF319E5F), + ), + ), + TextSpan( + text: "的动态", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), + ), + ), + report(), + ], + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, + height:95, + child: Column( + children: [ + GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/report_notice'); + }, + child: Container( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom:25), + child: Text( + "投诉须知", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF3C425C), + ), + ), + )), + Expanded(child: + GestureDetector( + onTap: (){ + Navigator.of(context) + .pushNamed('/router/report_success'); + }, + child: Container( + width: double.infinity, + height:double.infinity, + color: Color(0xFF319E5F), + alignment: Alignment.center, + child: Text( + "提交", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFFFFFF), + ), + ), + ),)) + ], + ), + )) + ], + ), + ), + ); + } + + Widget report() { + return Container( + padding: EdgeInsets.only(left: 16, right: 16), + child: + // (articles == null || articles.length == 0) + // ? NoDataView( + // src: "assets/image/dong_tai.png", + // isShowBtn: false, + // text: "目前暂无发布动态,要把开心的事讲出来哦~", + // fontSize: 16.sp, + // margin: EdgeInsets.only(left: 60.w, right: 60.w), + // ) : + ListView.builder( + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: reportList(), + ); + }, + itemCount: 9, + ), + ); + } + + Widget reportList() { + return Container( + padding: EdgeInsets.only(top: 18, bottom: 20), + color: Color(0xFFFFFFFF), + child: Row( + children: [ + Image.asset( + "assets/image/icon_radio_unselected.png", + width: 16, + height: 16, + ), + SizedBox( + width: 8, + ), + Expanded( + child: Text( + "色情低俗", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + )) + ], + )); + } +} diff --git a/lib/community/report/report_success.dart b/lib/community/report/report_success.dart new file mode 100644 index 00000000..e6965ba3 --- /dev/null +++ b/lib/community/report/report_success.dart @@ -0,0 +1,51 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ReportSuccess extends StatefulWidget { + @override + State createState() { + return _ReportSuccess(); + } +} + +class _ReportSuccess extends State { + ApiService apiService; + int checkIndex = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + background: Color(0xFFFFFFFFF), + leadingColor: Colors.black, + title: "", + titleSize: 18, + titleColor: Colors.black, + ), + body: Container( + width: double.infinity, + color: Color(0xFFFFFFFFF), + padding: EdgeInsets.only(left: 16, top: 10, right: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ], + ), + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 463ebf14..351fc260 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -74,6 +74,9 @@ import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; import 'community/new_community_details.dart'; import 'community/photo_view_gallery_screen.dart'; +import 'community/report/report_notice.dart'; +import 'community/report/report_page.dart'; +import 'community/report/report_success.dart'; import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; import 'main_page.dart'; @@ -351,4 +354,10 @@ Map routers = { InvitationRecord(), '/router/personal_page': (context, {arguments}) => PersonalPage(arguments:arguments), + '/router/report_page': (context, {arguments}) => + ReportPage(arguments:arguments), + '/router/report_notice': (context, {arguments}) => + ReportNotice(), + '/router/report_success': (context, {arguments}) => + ReportSuccess(), }; diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index 3b9cab84..fae93819 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -61,18 +61,14 @@ class _PersonalPage extends State with WidgetsBindingObserver { WidgetsBinding.instance.addObserver(this); SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), - showLoading: true, context: context, token: value.getString('token')), _onRefresh(), }); } _onRefresh() async { - pageNum = 1; - setState(() { queryCommunity(); queryMember(memberId); - }); } ///查询会员信息 @@ -114,6 +110,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { pageNum += 1; isLoadMore = false; } + else pageNum = 1; BaseData> baseData = await apiService.trendList({ "mid":memberId == "0" ? userId : memberId, "onlyFollow": false, @@ -125,10 +122,9 @@ class _PersonalPage extends State with WidgetsBindingObserver { refreshController.refreshFailed(); refreshController.loadFailed(); }); - - refreshController.refreshCompleted(); - refreshController.loadComplete(); if (baseData.isSuccess) { + refreshController.refreshCompleted(); + refreshController.loadComplete(); if (pageNum == 1) { articles.clear(); } @@ -282,354 +278,340 @@ class _PersonalPage extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { - return Stack( - children: [ - Positioned( - child: Container( - color: Colors.white, - child: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: true, - header: MyHeader(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, + return SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: _onRefresh, + onLoading: () { + isLoadMore = true; + setState(() { + _onRefresh(); + }); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child:Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + alignment: Alignment.bottomLeft, + children: [ + Container( + height: 286, + color: Color(0xFFFFFFFF), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Stack( + children: [ + Positioned( + child: 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.png", + fadeSrc: + "assets/image/default_1.png", + )))), + Container( + margin: EdgeInsets.only( + top: 50.h, left: 16.w, right: 16.w), + decoration: BoxDecoration( + color: Colors.transparent, + ), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.png", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + ], + ), + ), + ], + ), + if(memberId == "0") + Positioned( + bottom: 49.h, + right: 16.w, + child:GestureDetector( + onTap: (){ + showImagePicker(); + }, + child:Container( + padding: EdgeInsets.only(left: 2, right: 2), + width: 59.w, + height: 21.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0x80000000), + ), + child: Text( + "更换背景", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ), + ), + ), + ], + ), ), - onRefresh: _onRefresh, - onLoading: () { - isLoadMore = true; - setState(() { - _onRefresh(); - }); - }, - physics: BouncingScrollPhysics(), - scrollController: scrollController, - child: Container( - height: double.infinity, - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + homeInfo(), + ], + ), + Container( + color: Color(0xFFFFFFFF), + child: + Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 86, top: 12, right: 16), + 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), + )), + Icon( + (isShrink != null && !isShrink) + ? Icons.chevron_right + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, + ), + ], + ), + )), + Container( + margin: EdgeInsets.only(left: 16, right: 16), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Stack( - alignment: Alignment.bottomLeft, - children: [ - Container( - height: 286, - child: Stack( - alignment: Alignment.bottomRight, - children: [ - Stack( - children: [ - Positioned( - child: 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.png", - fadeSrc: - "assets/image/default_1.png", - )))), - Container( - margin: EdgeInsets.only( - top: 50.h, left: 16.w, right: 16.w), - decoration: BoxDecoration( - color: Colors.transparent, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - GestureDetector( - child: Image.asset( - "assets/image/integral_return.png", - width: 24, - height: 24, - ), - onTap: () { - Navigator.of(context).pop(); - }, - ), - ], - ), + 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, ), - ], - ), - if(memberId == "0") - Positioned( - bottom: 49.h, - right: 16.w, - child:GestureDetector( - onTap: (){ - showImagePicker(); - }, - child:Container( - padding: EdgeInsets.only(left: 2, right: 2), - width: 59.w, - height: 21.h, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - color: Color(0x80000000), - ), - child: Text( - "更换背景", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), - ), + ), + SizedBox( + height: 4, + ), + Text( + S.of(context).guanzhu, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, ), ), - ), - ], - ), - ), - homeInfo(), - ], + ], + )), + ), ), - Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only( - left: 86, top: 12, right: 16), - child: GestureDetector( - onTap: () { - setState(() { - isShrink = !isShrink; - }); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - flex: 1, - child: Text( - memberId == "0" ? ((memberInfor?.signature == null) ? "还未编辑个性签名~" : 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), - )), - Icon( - (isShrink != null && !isShrink) - ? Icons.chevron_right - : Icons.keyboard_arrow_up, - color: Colors.black, - size: 18, - ), - ], - ), - )), - Container( - margin: EdgeInsets.only(left: 16, right: 16), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( 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, - ), - Text( - S.of(context).guanzhu, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: - MyFontWeight.regular, - ), - ), - ], - )), + Text( + memberInfor != null ? memberInfor.fans.toString() : "0", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, ), ), - 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, - ), - Text( - S.of(context).fensi, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: - MyFontWeight.regular, - ), - ), - ], - )), + SizedBox( + height: 4, + ), + 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, - ), - Text( - "动态", - 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, ), ), - 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, - ), - Text( - "获赞", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: - MyFontWeight.regular, - ), - ), - ], - )), + SizedBox( + height: 4, + ), + Text( + "动态", + 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), - child: Text( - memberId != "0" ? - "TA的动态": - "我的动态", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, + )), + ), + ), + 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, + ), + Text( + "获赞", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), ), - )), - dynamicList() - ], + ], + )), ), ), ], ), ), - ), + Container( + margin: EdgeInsets.all(16), + height: 1.h, + color: Color(0xFFF7F7F7), + ), + Padding( + padding: EdgeInsets.only(left: 16), + child: Text( + memberId != "0" ? + "TA的动态": + "我的动态", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + )), + dynamicList() + ], ), ), - bottom: 0, - top: 0, - left: 0, - right: 0, - ), - ], + ], + )), ); } Widget homeInfo() { return Container( - margin: EdgeInsets.only( + padding: EdgeInsets.only( left: 16, right: 16, ), @@ -678,110 +660,39 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), Spacer(), if(memberId == "0") - GestureDetector( - onTap: () { - setState(() { - _toUserInfo(); - }); - }, - child: Container( - padding: EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - border: Border.all( - width: 1, - color: Color(0xFF353535), - style: BorderStyle.solid, + GestureDetector( + onTap: () { + setState(() { + _toUserInfo(); + }); + }, + child: Container( + padding: EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1, + color: Color(0xFF353535), + style: BorderStyle.solid, + ), ), - ), - child: Text( - "编辑个人资料", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF353535), + child: Text( + "编辑个人资料", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), ), ), - ), - ) - // GestureDetector( - // onTap: (){ - // setState(() { - // _vipFollow(messageRelational["mid"].toString(),message?.followed ?? false); - // }); - // }, - // child: - // RoundButton( - // height: 21.h, - // width:56.w, - // padding: EdgeInsets.all(2), - // backgroup: (message?.followed ?? false) - // ? Color(0xFFE6E6E6) - // : Color(0xFF32A060), - // textColor: (message?.followed ?? false) - // ? Color(0xFF808080) - // : Colors.white, - // text: (message?.followed ?? false) ? "已关注" : "回关", - // radius:20, - // icons: Icon( - // (message?.followed ?? false) - // ? Icons.check - // : Icons.add, - // color: (message?.followed?? false) - // ? Color(0xFF808080) - // : Colors.white, - // size: 12, - // ), - // ) - // // Container( - // // height: 21.h, - // // width:56.w, - // // padding:EdgeInsets.only(left:5,right:5), - // // alignment: Alignment.center, - // // decoration: BoxDecoration( - // // borderRadius: BorderRadius.circular(11), - // // border: Border.all( - // // width: 1, - // // color: Color(0xFF00A359), - // // style: BorderStyle.solid, - // // ), - // // color: (message?.followed ?? false) - // // ? Color(0xFFE6E6E6) - // // : Color(0xFF32A060), - // // ), - // // child: Row( - // // children: [ - // // Icon((message?.followed ?? false) - // // ? Icons.check - // // : Icons.add, - // // color:(message?.followed?? false) - // // ? Color(0xFF808080) - // // : Colors.white, - // // size: 16, - // // ), - // // Text( - // // (message?.followed ?? false) ? "已关注" : "回关", - // // style: TextStyle( - // // fontSize: 12.sp, - // // fontWeight: MyFontWeight.medium, - // // color:(message?.followed ?? false) - // // ? Color(0xFF808080) - // // : Colors.white, - // // ), - // // ), - // // ], - // // ), - // // ) - // ) + ) ], - ), - ); + ),); } Widget dynamicList() { return Container( - color: Color(0xFFFFFFFF), child: (articles == null || articles.length == 0)? NoDataView( src: "assets/image/dong_tai.png", isShowBtn: false, diff --git a/pubspec.lock b/pubspec.lock index b3474fc4..23dc9aa5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -70,7 +70,7 @@ packages: name: chewie url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.2" chewie_audio: dependency: "direct main" description: @@ -134,6 +134,20 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" + extended_image: + dependency: transitive + description: + name: extended_image + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.6.0" + extended_image_library: + dependency: transitive + description: + name: extended_image_library + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.1" fake_async: dependency: transitive description: @@ -215,7 +229,7 @@ packages: name: flutter_html url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.1" + version: "2.1.5" flutter_layout_grid: dependency: transitive description: @@ -234,7 +248,7 @@ packages: name: flutter_math_fork url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.2+2" + version: "0.3.3+1" flutter_page_indicator: dependency: transitive description: @@ -336,6 +350,20 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.15.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.12.2" + http_client_helper: + dependency: transitive + description: + name: http_client_helper + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.1" http_parser: dependency: transitive description: @@ -483,6 +511,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.11.1" permission_handler: dependency: "direct main" description: @@ -504,6 +539,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" + photo_manager: + dependency: transitive + description: + name: photo_manager + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.10" photo_view: dependency: "direct main" description: @@ -538,7 +580,7 @@ packages: name: provider url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.2" + version: "5.0.0" pull_to_refresh: dependency: "direct main" description: @@ -847,6 +889,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.13" + wechat_assets_picker: + dependency: "direct main" + description: + name: wechat_assets_picker + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.0.0-nullsafety.5" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 6f6affec..49d60b47 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,8 @@ dependencies: #多图, 裁剪 image_pickers: ^2.0.0 + wechat_assets_picker: any + # flutter_scankit: ^1.2.0 # qrscan: ^0.3.1 scan: ^1.5.0 From e6a11a6bb041be676c6b4de6e3a95347b2cdd84e Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 7 Mar 2022 15:16:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/address/edit_address_page.dart | 4 +- lib/community/release_dynamic.dart | 2 + lib/home/home_page.dart | 40 ++++++++++ lib/main.dart | 1 + lib/retrofit/data/activity_pos.dart | 50 ++++++++++++ lib/retrofit/retrofit_api.dart | 6 +- lib/retrofit/retrofit_api.g.dart | 22 ++++++ lib/view_widget/activity_poster.dart | 113 +++++++++++++++++++++++++++ lib/view_widget/mine_vip_view.dart | 8 +- pubspec.lock | 57 +------------- pubspec.yaml | 2 - 11 files changed, 243 insertions(+), 62 deletions(-) create mode 100644 lib/retrofit/data/activity_pos.dart create mode 100644 lib/view_widget/activity_poster.dart diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index ab40d4ee..fde97953 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -82,7 +82,7 @@ class _EditAddressPage extends State { bottomRight: Radius.circular(8), ), ), - child: Expanded(flex: 1,child: Column( + child:Column( children: [ editItem( S.of(context).xingming, @@ -114,7 +114,7 @@ class _EditAddressPage extends State { houseNumberController, false), ], - ),), + ), ), InkWell( diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 1b3833a7..6360522b 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -446,6 +446,8 @@ class _ReleaseDynamic extends State { ); } + + ///动态输入框 Widget buildEdit() { return Container( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 52e69705..0c1e8ebe 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -16,6 +16,7 @@ import 'package:huixiang/home/home_view/sign_view.dart'; import 'package:huixiang/home/points_mall_view/points_goods_title.dart'; import 'package:huixiang/home/points_mall_view/points_goods_view.dart'; import 'package:huixiang/main.dart'; +import 'package:huixiang/retrofit/data/activity_pos.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -30,6 +31,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/activity_coupons.dart'; +import 'package:huixiang/view_widget/activity_poster.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/invite_success_dialog.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -71,6 +73,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { } }); queryMsgStats(); + queryActivity(); if ((widget.invite ?? "") != "" || widget.interviewCouponList != null && @@ -78,6 +81,8 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) showNew = true; + + } ///邀请成功弹窗 @@ -102,6 +107,22 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ); } + ///活动海报弹窗 + posterShowAlertDialog(ActivityPos activityPos) { + SharedPreferences.getInstance().then((value) { + if((value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) + return; + value.setString("ActivityPosCode", "${(value.getString("ActivityPosCode")??"")}${activityPos.code}_${value.getString("userId")};"); + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return ActivityPoster(activityPos); + }, + ); + }); + } + final SwiperController controller = SwiperController(); String categoryId; @@ -273,6 +294,25 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { EasyLoading.dismiss(); } + ///活动弹窗 + queryActivity() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = + await apiService.appPopup().catchError((onError) { + }); + if (baseData != null && baseData.isSuccess) { + if(baseData.data?.enabled ?? true) + posterShowAlertDialog(baseData.data); + } + } + ///核销用户优惠券 queryWiped(memberCouponId) async { if (apiService == null) { diff --git a/lib/main.dart b/lib/main.dart index 351fc260..c51e7055 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -56,6 +56,7 @@ import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/test_page.dart'; import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; +import 'package:huixiang/view_widget/activity_poster.dart'; import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/union/union_details_page.dart'; diff --git a/lib/retrofit/data/activity_pos.dart b/lib/retrofit/data/activity_pos.dart new file mode 100644 index 00000000..2578591b --- /dev/null +++ b/lib/retrofit/data/activity_pos.dart @@ -0,0 +1,50 @@ +/// enabled : true +/// code : "1111" +/// showImage : "https://pos.upload.gznl.top/0000/2022/03/4ca95160-aa19-46e5-ad07-8a16ca11c697.jpg" +/// jumpType : 1 +/// jumpUrl : "1417675188681572352" + +class ActivityPos { + ActivityPos({ + bool enabled, + String code, + String showImage, + int jumpType, + String jumpUrl,}){ + _enabled = enabled; + _code = code; + _showImage = showImage; + _jumpType = jumpType; + _jumpUrl = jumpUrl; +} + + ActivityPos.fromJson(dynamic json) { + _enabled = json['enabled']; + _code = json['code']; + _showImage = json['showImage']; + _jumpType = json['jumpType']; + _jumpUrl = json['jumpUrl']; + } + bool _enabled; + String _code; + String _showImage; + int _jumpType; + String _jumpUrl; + + bool get enabled => _enabled; + String get code => _code; + String get showImage => _showImage; + int get jumpType => _jumpType; + String get jumpUrl => _jumpUrl; + + Map toJson() { + final map = {}; + map['enabled'] = _enabled; + map['code'] = _code; + map['showImage'] = _showImage; + map['jumpType'] = _jumpType; + map['jumpUrl'] = _jumpUrl; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 287592f9..bf919926 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -19,6 +19,7 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; import 'data/achievement_detail_list.dart'; +import 'data/activity_pos.dart'; import 'data/address.dart'; import 'data/banner.dart'; import 'data/brand_data.dart'; @@ -53,7 +54,6 @@ import 'data/vip_badges_list.dart'; import 'data/vip_benefit_list.dart'; import 'data/vip_card.dart'; import 'data/vip_rule_details.dart'; -import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; @@ -504,4 +504,8 @@ abstract class ApiService { @GET("/member/detail/{id}") Future> memberDetail(@Path("id") String id); + ///活动弹窗 + @GET("/home/appPopup") + Future> appPopup(); + } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 205b7a37..7b2bc2e6 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -1872,4 +1872,26 @@ class _ApiService implements ApiService { ); return value; } + + + @override + Future> appPopup() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/home/appPopup', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ActivityPos.fromJson(json), + ); + return value; + } } diff --git a/lib/view_widget/activity_poster.dart b/lib/view_widget/activity_poster.dart new file mode 100644 index 00000000..c4baf746 --- /dev/null +++ b/lib/view_widget/activity_poster.dart @@ -0,0 +1,113 @@ + + +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/data/activity_pos.dart'; + +import 'custom_image.dart'; + +class ActivityPoster extends StatefulWidget { + final ActivityPos activityPos; + + ActivityPoster(this.activityPos); + + @override + State createState() { + return _ActivityPoster(); + } +} + +class _ActivityPoster extends State { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: 289, + alignment: Alignment.center, + margin: EdgeInsets.only( + left:37, + right:37, + ), + child: Stack( + children: [ + GestureDetector( + onTap: (){ + jumpClick(widget.activityPos); + }, + child: + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + ), + child:MImage( + widget?.activityPos?.showImage ?? "", + width: double.infinity, + height: MediaQuery.of(context).size.height / 2, + fit: BoxFit.cover, + radius: BorderRadius.all(Radius.circular(12)), + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ),), + ), + Container( + padding: EdgeInsets.only(top: 8,right: 8,bottom:8), + child:GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pop(); + }, + child: Row(children: [ + Spacer(), + Image.asset( + "assets/image/cancel.png", + width: 24, + height: 24, + color: Colors.white, + ) + ],) + ) ) + ], + ), + ); + } + + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + jumpClick(ActivityPos activityPos) async { + switch (activityPos.jumpType) { + case 1: + Navigator.of(context).pushNamed('/router/integral_store_page', + arguments: {"goodsId": widget.activityPos.jumpUrl}); + break; + case 2: + Navigator.of(context) + .pushNamed('/router/web_page', arguments: { + "activityId": widget.activityPos.jumpUrl, + }); + break; + case 3: + Navigator.of(context) + .pushNamed('/router/web_page', arguments: { + "articleId": widget.activityPos.jumpUrl, + }); + break; + case 4: + String router = widget.activityPos.jumpUrl; + if (router.contains("?")) { + String params = router.substring(router.indexOf("?")); + params = params.replaceAll("?", ""); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(router, arguments: map); + } else { + Navigator.of(context).pushNamed(router); + } + break; + case 5: + Navigator.of(context) + .pushNamed('/router/class_details', arguments: { + "id": widget.activityPos.jumpUrl, + }); + break; + } + } +} diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index 6766255e..7cc2e01b 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -183,7 +183,7 @@ class MineVipView extends StatelessWidget { style: TextStyle( color: textColor, fontWeight: MyFontWeight.semi_bold, - fontSize: 23.sp, + fontSize:22.sp, ), ), ), @@ -228,7 +228,7 @@ class MineVipView extends StatelessWidget { style: TextStyle( color: textColor, fontWeight: MyFontWeight.regular, - fontSize: 14.sp, + fontSize: 12.sp, ), ), flex: 1, @@ -239,7 +239,7 @@ class MineVipView extends StatelessWidget { TextSpan( text: !(showRank??true)?(vipLevel == 3?"":rankMax.toString()):((vipLevel < curLevel)?rankMax.toString():rank.toString()), style: TextStyle( - fontSize: 26.sp, + fontSize: 20.sp, fontWeight: MyFontWeight.semi_bold, color: textColor, ), @@ -257,7 +257,7 @@ class MineVipView extends StatelessWidget { TextSpan( text: rankMax > 0 ? "/$rankMax" : "/0", style: TextStyle( - fontSize: 14.sp, + fontSize: 12.sp, fontWeight: MyFontWeight.regular, color: textColor, ), diff --git a/pubspec.lock b/pubspec.lock index 23dc9aa5..b3474fc4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -70,7 +70,7 @@ packages: name: chewie url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.2" + version: "1.1.0" chewie_audio: dependency: "direct main" description: @@ -134,20 +134,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" - extended_image: - dependency: transitive - description: - name: extended_image - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.6.0" - extended_image_library: - dependency: transitive - description: - name: extended_image_library - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.3.1" fake_async: dependency: transitive description: @@ -229,7 +215,7 @@ packages: name: flutter_html url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.5" + version: "2.2.1" flutter_layout_grid: dependency: transitive description: @@ -248,7 +234,7 @@ packages: name: flutter_math_fork url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.3+1" + version: "0.4.2+2" flutter_page_indicator: dependency: transitive description: @@ -350,20 +336,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.15.0" - http: - dependency: transitive - description: - name: http - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.12.2" - http_client_helper: - dependency: transitive - description: - name: http_client_helper - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.2.1" http_parser: dependency: transitive description: @@ -511,13 +483,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.11.1" permission_handler: dependency: "direct main" description: @@ -539,13 +504,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" - photo_manager: - dependency: transitive - description: - name: photo_manager - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.10" photo_view: dependency: "direct main" description: @@ -580,7 +538,7 @@ packages: name: provider url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.0" + version: "6.0.2" pull_to_refresh: dependency: "direct main" description: @@ -889,13 +847,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.13" - wechat_assets_picker: - dependency: "direct main" - description: - name: wechat_assets_picker - url: "https://pub.flutter-io.cn" - source: hosted - version: "5.0.0-nullsafety.5" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 49d60b47..6f6affec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,8 +60,6 @@ dependencies: #多图, 裁剪 image_pickers: ^2.0.0 - wechat_assets_picker: any - # flutter_scankit: ^1.2.0 # qrscan: ^0.3.1 scan: ^1.5.0