Browse Source

增加社群分享举报,分享h5需要兼容动态,暂没时间兼容,暂保留

remove_uniapp
w-R 3 years ago
parent
commit
b209f5bcc6
  1. BIN
      assets/image/2x/ju_bao.png
  2. BIN
      assets/image/3x/ju_bao.png
  3. BIN
      assets/image/ju_bao.png
  4. 1
      assets/svg/ju_b.svg
  5. 2
      lib/address/edit_address_page.dart
  6. 373
      lib/community/community_view/community_dynamic.dart
  7. 98
      lib/community/report/report_notice.dart
  8. 195
      lib/community/report/report_page.dart
  9. 51
      lib/community/report/report_success.dart
  10. 9
      lib/main.dart
  11. 753
      lib/mine/personal_page.dart
  12. 57
      pubspec.lock
  13. 2
      pubspec.yaml

BIN
assets/image/2x/ju_bao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
assets/image/3x/ju_bao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
assets/image/ju_bao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

1
assets/svg/ju_b.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1646216602750" class="icon" viewBox="0 0 1127 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5637" xmlns:xlink="http://www.w3.org/1999/xlink" width="220.1171875" height="200"><defs><style type="text/css"></style></defs><path d="M1108.468296 824.890547C1159.055032 910.219597 1097.227863 1024 990.429373 1024L130.432879 1024C29.258031 1024-32.574625 910.219597 18.012112 824.890547L450.825613 68.266574C473.306472 22.754136 518.276424 0 563.240888 0 608.209469 0 653.173934 22.754136 675.660283 68.266574L1108.468296 824.890547 1108.468296 824.890547 1108.468296 824.890547 1108.468296 824.890547ZM1020.384123 877.110641 1019.583053 875.735153 586.77504 119.111177 583.854223 113.62523C580.333998 106.500274 573.244216 102.4 563.240888 102.4 553.240806 102.4 546.151071 106.500212 542.636068 113.61633L539.710577 119.111663 106.096287 877.110641C95.301134 895.319767 109.937021 921.6 130.432879 921.6L990.429373 921.6C1016.30634 921.6 1031.298263 895.520476 1020.384123 877.110641L1020.384123 877.110641 1020.384123 877.110641 1020.384123 877.110641ZM558.08319 307.2C532.482248 307.2 512 322.819385 512 342.344809L512 579.251379C512 598.776801 532.482248 614.4 558.08319 614.4L568.321812 614.4C593.922749 614.4 614.4 598.776801 614.4 579.251379L614.4 342.344809C614.4 322.819385 593.922749 307.2 568.321812 307.2L558.08319 307.2 558.08319 307.2 558.08319 307.2 558.08319 307.2ZM512 766.885176C512 780.001705 517.522432 793.032632 526.999818 802.305669 536.477199 811.577487 549.797038 816.975247 563.200625 816.975247 576.602962 816.975247 589.927798 811.577487 599.405184 802.305669 608.882565 793.032632 614.4 780.001705 614.4 766.885176 614.4 753.772319 608.882565 740.741391 599.405184 731.469573 589.927798 722.19776 576.602962 716.8 563.200625 716.8 549.797038 716.8 536.477199 722.19776 526.999818 731.469573 517.522432 740.741391 512 753.772319 512 766.885176L512 766.885176 512 766.885176 512 766.885176Z" p-id="5638" fill="#515151"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

2
lib/address/edit_address_page.dart

@ -82,7 +82,7 @@ class _EditAddressPage extends State<EditAddressPage> {
bottomRight: Radius.circular(8),
),
),
child: Expanded(child:Column(
child: Expanded(flex: 1,child: Column(
children: [
editItem(
S.of(context).xingming,

373
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<CommunityDynamic> {
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<CommunityDynamic> {
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<CommunityDynamic> {
),
),
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<CommunityDynamic> {
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<CommunityDynamic> {
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<CommunityDynamic> {
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<CommunityDynamic> {
);
}
///
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)

98
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<StatefulWidget> createState() {
return _ReportNotice();
}
}
class _ReportNotice extends State<ReportNotice> {
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,
),
],
),
),
);
}
}

195
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<String, dynamic> arguments;
ReportPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _ReportPage();
}
}
class _ReportPage extends State<ReportPage> {
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),
))
],
));
}
}

51
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<StatefulWidget> createState() {
return _ReportSuccess();
}
}
class _ReportSuccess extends State<ReportSuccess> {
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: [
],
),
),
);
}
}

9
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<String, WidgetBuilder> routers = <String, WidgetBuilder>{
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(),
};

753
lib/mine/personal_page.dart

@ -61,18 +61,14 @@ class _PersonalPage extends State<PersonalPage> 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<PersonalPage> with WidgetsBindingObserver {
pageNum += 1;
isLoadMore = false;
}
else pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"mid":memberId == "0" ? userId : memberId,
"onlyFollow": false,
@ -125,10 +122,9 @@ class _PersonalPage extends State<PersonalPage> 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<PersonalPage> 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<PersonalPage> 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,

57
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:

2
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

Loading…
Cancel
Save