Browse Source

Merge branches 'dev' and 'master' of https://git.lotus-wallet.com/fmk/huixiang_app

 Conflicts:
	lib/community/community_view/community_dynamic.dart
	lib/web/web_page.dart
master
fmk 3 years ago
parent
commit
0b9fd217e3
  1. 11
      lib/community/community_child_page.dart
  2. 8
      lib/community/community_details.dart
  3. 40
      lib/community/community_view/community_dynamic.dart
  4. 39
      lib/home/home_view/featured_acticvity.dart
  5. 5
      lib/mine/fans_page.dart
  6. 4
      lib/mine/mine_view/community_follow.dart
  7. 2
      lib/web/web_page.dart
  8. 2
      lib/web/web_view/comment_list.dart

11
lib/community/community_child_page.dart

@ -26,6 +26,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
ApiService apiService; ApiService apiService;
int pageNum = 0; int pageNum = 0;
String userId;
List<ComunityComment> comments = []; List<ComunityComment> comments = [];
@ -44,6 +45,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
queryCommunity() async { queryCommunity() async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
userId = value.getString('userId');
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
context: context, context: context,
@ -104,16 +106,17 @@ class _CommunityChildPage extends State<CommunityChildPage> {
child: CommunityDynamic( child: CommunityDynamic(
comments[position], comments[position],
0, 0,
userId: userId,
isList: true, isList: true,
exitFull: () { exitFull: (){setState(() {
setState(() {}); _onRefresh();
}, });},
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/community_details', '/router/community_details',
arguments: { arguments: {
"comment": comments[position], "comment": comments[position],"userId":userId,
}, },
); );
}, },

8
lib/community/community_details.dart

@ -1,20 +1,15 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/community/community_view/community_comment.dart';
import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/member_comment_list.dart'; import 'package:huixiang/retrofit/data/member_comment_list.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/comment_menu.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/comment_list.dart';
@ -125,6 +120,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
exitFull: () { exitFull: () {
setState(() {}); setState(() {});
}, },
userId:widget.arguments["userId"],
itemCount: 3, itemCount: 3,
isDetails: true, isDetails: true,
heightFun: (height) { heightFun: (height) {
@ -140,7 +136,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
), ),
CommentList( CommentList(
commentKey, commentKey,
"${comunity?.likes ?? comunity?.likes ?? "0"}", comunity?.likes ?? comunity?.likes.toString() ?? 0,
comunity.id, comunity.id,
isKeyBoardShow, isKeyBoardShow,
_reply, _reply,

40
lib/community/community_view/community_dynamic.dart

@ -19,7 +19,6 @@ import 'package:image_pickers/image_pickers.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
import 'package:thumbnails/thumbnails.dart';
class CommunityDynamic extends StatefulWidget { class CommunityDynamic extends StatefulWidget {
final int itemCount; final int itemCount;
@ -30,6 +29,7 @@ class CommunityDynamic extends StatefulWidget {
final Function exitFull; final Function exitFull;
final bool isList; final bool isList;
final ComunityComment comment; final ComunityComment comment;
final String userId;
CommunityDynamic( CommunityDynamic(
this.comment, this.comment,
@ -40,6 +40,7 @@ class CommunityDynamic extends StatefulWidget {
this.isDetails = false, this.isDetails = false,
this.removalDynamic, this.removalDynamic,
this.exitFull, this.exitFull,
this.userId,
this.isList = false, this.isList = false,
}) : super(key: key); }) : super(key: key);
@ -58,6 +59,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
ChewieController chewieAudioController; ChewieController chewieAudioController;
Chewie chewies; Chewie chewies;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -115,6 +117,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
_vipFollow(followId) async { _vipFollow(followId) async {
BaseData baseData = await apiService.follow(followId); BaseData baseData = await apiService.follow(followId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
widget.exitFull();
SmartDialog.showToast("关注成功", alignment: Alignment.center); SmartDialog.showToast("关注成功", alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
@ -184,15 +187,15 @@ class _CommunityDynamic extends State<CommunityDynamic> {
Text( Text(
widget?.comment?.memberInfo?.nickname ?? "", widget?.comment?.memberInfo?.nickname ?? "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
), ),
), ),
Text( Text(
widget?.comment?.createTime ?? "", widget?.comment?.createTime ?? "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 13.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
@ -202,6 +205,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
], ],
), ),
), ),
if(widget.comment.memberInfo.mid != widget.userId??"")
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -214,12 +218,17 @@ class _CommunityDynamic extends State<CommunityDynamic> {
} }
}); });
}, },
child: (widget.commentType == 0) child: (widget.commentType == 0
? RoundButton( )
padding: EdgeInsets.symmetric( ? Container(
horizontal: 8, width: 56.w,
vertical: 3, height: 21.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.w),
color: Color(0xFF32A060),
), ),
child: RoundButton(
backgroup: (widget.comment.selfFollow ?? false) backgroup: (widget.comment.selfFollow ?? false)
? Color(0xFFE6E6E6) ? Color(0xFFE6E6E6)
: Color(0xFF32A060), : Color(0xFF32A060),
@ -237,9 +246,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
color: (widget.comment.selfFollow ?? false) color: (widget.comment.selfFollow ?? false)
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
size: 14, size: 15,
), ),
) ))
: Icon( : Icon(
Icons.close, Icons.close,
color: Colors.black, color: Colors.black,
@ -258,7 +267,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
style: TextStyle( style: TextStyle(
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 14.sp, fontSize: 15.sp,
), ),
), ),
buildMedia(widget.comment.subjectInfo), buildMedia(widget.comment.subjectInfo),
@ -285,12 +294,17 @@ class _CommunityDynamic extends State<CommunityDynamic> {
leftImage: "assets/svg/pinglun.svg", leftImage: "assets/svg/pinglun.svg",
iconSize: 16, iconSize: 16,
), ),
IconText( GestureDetector(
onTap: (){
},
child: IconText(
"${widget.comment.likes ?? 0}", "${widget.comment.likes ?? 0}",
space: 4.w, space: 4.w,
leftImage: "assets/svg/xihuan.svg", leftImage: "assets/svg/xihuan.svg",
iconSize: 16, iconSize: 16,
), ),
),
], ],
), ),
], ],

39
lib/home/home_view/featured_acticvity.dart

@ -39,13 +39,12 @@ class _FeaturedActivity extends State<FeaturedActivity> {
"searchKey": "", "searchKey": "",
"type": 1, "type": 1,
"state": 1 "state": 1
}).catchError((error) { }).catchError((error) {});
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
activityList = baseData.data.list; activityList = baseData.data.list;
if(activityList != null && activityList.length == 1) if (activityList != null && activityList.length == 1)
activityList.add(activityList[0]); activityList.add(activityList[0]);
if(activityList != null && activityList.length == 2) if (activityList != null && activityList.length == 2)
activityList.add(activityList[1]); activityList.add(activityList[1]);
} }
} }
@ -69,9 +68,9 @@ class _FeaturedActivity extends State<FeaturedActivity> {
margin: EdgeInsets.symmetric(horizontal: 9.w), margin: EdgeInsets.symmetric(horizontal: 9.w),
child: Row( child: Row(
children: [ children: [
if(activityList != null && activityList.length > 0) if (activityList != null && activityList.length > 0)
Container( Container(
child: stackItem(18.sp,activityList[0]), child: stackItem(18.sp, activityList[0]),
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2, width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h, height: 190.h,
@ -86,13 +85,13 @@ class _FeaturedActivity extends State<FeaturedActivity> {
), ),
), ),
), ),
if(activityList != null && activityList.length > 1) if (activityList != null && activityList.length > 1)
Container( Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Container( Container(
child: stackItem(12.sp,activityList[1]), child: stackItem(12.sp, activityList[1]),
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2, width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2, height: 190.h / 2,
@ -101,15 +100,17 @@ class _FeaturedActivity extends State<FeaturedActivity> {
color: Colors.green, color: Colors.green,
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(
activityList[1].coverImg, activityList[2].coverImg,
), ),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
), ),
SizedBox(height: 5,), SizedBox(
height: 5,
),
Container( Container(
child: stackItem(12.sp,activityList[2]), child: stackItem(12.sp, activityList[2]),
margin: EdgeInsets.symmetric(horizontal: 5.w), margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2, width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2, height: 190.h / 2,
@ -123,7 +124,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
), )
], ],
), ),
), ),
@ -137,7 +138,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
); );
} }
Widget stackItem(double textSize,Activity activity) { Widget stackItem(double textSize, Activity activity) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -149,6 +150,8 @@ class _FeaturedActivity extends State<FeaturedActivity> {
children: [ children: [
Text( Text(
activity.mainTitle, activity.mainTitle,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: textSize, fontSize: textSize,
@ -181,7 +184,13 @@ class _FeaturedActivity extends State<FeaturedActivity> {
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Row( child:
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activity.id});
},
child:Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -199,7 +208,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
size: 12, size: 12,
), ),
], ],
), )),
), ),
], ],
); );

5
lib/mine/fans_page.dart

@ -167,6 +167,7 @@ class _FansPage extends State<FansPage> {
Container( Container(
width: 56.w, width: 56.w,
height: 21.h, height: 21.h,
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11.w), borderRadius: BorderRadius.circular(11.w),
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -178,10 +179,6 @@ class _FansPage extends State<FansPage> {
}); });
}, },
child: RoundButton( child: RoundButton(
padding: EdgeInsets.symmetric(
horizontal: 8,
vertical: 3,
),
backgroup: (list?.isFollow ?? false) backgroup: (list?.isFollow ?? false)
? Color(0xFFE6E6E6) ? Color(0xFFE6E6E6)
: Color(0xFF32A060), : Color(0xFF32A060),

4
lib/mine/mine_view/community_follow.dart

@ -84,8 +84,8 @@ class _CommunityFollow extends State<CommunityFollow>
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
// //
tabs: <Widget>[ tabs: <Widget>[
MyTab(text:"关注(${infoNumber?.follow??"0"})",), MyTab(text:"关注${infoNumber?.follow??"0"}",),
MyTab(text: "粉丝(${infoNumber?.fans??"0"})"), MyTab(text: "粉丝${infoNumber?.fans??"0"}"),
], ],
), ),
), ),

2
lib/web/web_page.dart

@ -271,7 +271,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
/// ///
CommentList( CommentList(
commentKey, commentKey,
article?.likes ?? "${activity?.likes}" ?? "0", article?.likes ?? activity?.likes ?? 0,
article?.id ?? activity?.id, article?.id ?? activity?.id,
isKeyBoardShow, isKeyBoardShow,
_reply, _reply,

2
lib/web/web_view/comment_list.dart

@ -22,7 +22,7 @@ class CommentList extends StatefulWidget {
final Function delCommentTips; final Function delCommentTips;
final double fontSize; final double fontSize;
final String relationalId; final String relationalId;
final String like; final int like;
CommentList(Key key, this.like, this.relationalId, CommentList(Key key, this.like, this.relationalId,
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize) this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize)

Loading…
Cancel
Save