Browse Source

社群更改

master
w-R 3 years ago
parent
commit
4aa4d7f512
  1. 6
      lib/community/community_child_page.dart
  2. 4
      lib/community/community_details.dart
  3. 2
      lib/community/community_view/community_comment.dart
  4. 15
      lib/community/community_view/community_dynamic.dart
  5. 34
      lib/mine/mine_view/community_follow.dart
  6. 6
      lib/mine/release_page.dart

6
lib/community/community_child_page.dart

@ -24,7 +24,7 @@ class CommunityChildPage extends StatefulWidget {
class _CommunityChildPage extends State<CommunityChildPage> { class _CommunityChildPage extends State<CommunityChildPage> {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
ApiService apiService; ApiService apiService;
int pageNum = 1; int pageNum = 0;
List<ComunityComment> comments = []; List<ComunityComment> comments = [];
@ -36,7 +36,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
} }
_onRefresh() async { _onRefresh() async {
pageNum = 1; pageNum = 0;
setState(() {}); setState(() {});
} }
@ -50,7 +50,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
token: value.getString("token"), token: value.getString("token"),
); );
} }
pageNum += 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"onlyFollow": widget.typeStr == "关注" ? true:false, "onlyFollow": widget.typeStr == "关注" ? true:false,
"onlyMe": false, "onlyMe": false,

4
lib/community/community_details.dart

@ -199,8 +199,7 @@ class _CommunityDetails extends State<CommunityDetails>
body: Container( body: Container(
height: MediaQuery.of(context).size.height - height: MediaQuery.of(context).size.height -
MediaQuery.of(context).padding.top + MediaQuery.of(context).padding.top +
kToolbarHeight - kToolbarHeight - 68,
68,
margin: EdgeInsets.only(top: 50 + kToolbarHeight), margin: EdgeInsets.only(top: 50 + kToolbarHeight),
child: Column( child: Column(
children: [ children: [
@ -231,6 +230,7 @@ class _CommunityDetails extends State<CommunityDetails>
Container( Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 20),
padding: EdgeInsets.all(22.h), padding: EdgeInsets.all(22.h),
child: Text( child: Text(
S.of(context).zanwupinglun, S.of(context).zanwupinglun,

2
lib/community/community_view/community_comment.dart

@ -206,7 +206,7 @@ class _CommunityComment extends State<CommunityComment> {
], ],
), ),
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
padding: EdgeInsets.only(top: 22.h), padding: EdgeInsets.only(top: 22.h,bottom: 22),
child: Text( child: Text(
S.of(context).yixiansquanbupinglun, S.of(context).yixiansquanbupinglun,
style: TextStyle( style: TextStyle(

15
lib/community/community_view/community_dynamic.dart

@ -106,9 +106,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Row( child: Row(
children: [ children: [
MImage( MImage(
widget.comment != null widget?.comment?.memberInfo?.avatar??"",
? widget.comment.memberInfo.avatar
: "",
width: 44, width: 44,
height: 44, height: 44,
isCircle: true, isCircle: true,
@ -124,9 +122,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
widget.comment != null widget?.comment?.memberInfo?.nickname??"",
? widget.comment.memberInfo.nickname
: "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -134,9 +130,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
), ),
Text( Text(
widget.comment != null widget?.comment?.createTime??"",
? widget.comment.createTime
: "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -199,7 +193,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ),
Text( Text(
widget.comment.subject ?? "", widget.comment.subject ?? "",
// maxLines: 5, maxLines: 5,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
@ -221,7 +215,6 @@ class _CommunityDynamic extends State<CommunityDynamic> {
(widget.comment != null) (widget.comment != null)
? "${widget.comment.viewers}" ? "${widget.comment.viewers}"
: "", : "",
// "${widget.comment.viewers ?? 0}",
space: 4.w, space: 4.w,
leftImage: "assets/svg/liulanliang.svg", leftImage: "assets/svg/liulanliang.svg",
iconSize: 16, iconSize: 16,

34
lib/mine/mine_view/community_follow.dart

@ -1,10 +1,16 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/mine/follow_page.dart'; import 'package:huixiang/mine/follow_page.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/social_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/my_tab.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../fans_page.dart'; import '../fans_page.dart';
@ -18,14 +24,34 @@ class CommunityFollow extends StatefulWidget {
class _CommunityFollow extends State<CommunityFollow> class _CommunityFollow extends State<CommunityFollow>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
ApiService apiService;
SocialInfo infoNumber;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
querySocialInfo();
} }
///(/)
querySocialInfo() async {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
BaseData<SocialInfo> baseData =
await apiService.socialInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
infoNumber = baseData.data;
});
}
EasyLoading.dismiss();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -56,8 +82,8 @@ class _CommunityFollow extends State<CommunityFollow>
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
// //
tabs: <Widget>[ tabs: <Widget>[
MyTab(text:"关注(0)",), MyTab(text:"关注(${infoNumber?.follow??"0"})",),
MyTab(text: "粉丝(0)"), MyTab(text: "粉丝(${infoNumber?.fans??"0"})"),
], ],
), ),
), ),

6
lib/mine/release_page.dart

@ -23,7 +23,7 @@ class ReleasePage extends StatefulWidget {
class _ReleasePage extends State<ReleasePage> { class _ReleasePage extends State<ReleasePage> {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
ApiService apiService; ApiService apiService;
int pageNum = 1; int pageNum = 0;
List<ComunityComment> comments = []; List<ComunityComment> comments = [];
@ -35,7 +35,7 @@ class _ReleasePage extends State<ReleasePage> {
} }
_onRefresh() async { _onRefresh() async {
pageNum = 1; pageNum = 0;
setState(() {}); setState(() {});
} }
@ -48,7 +48,7 @@ class _ReleasePage extends State<ReleasePage> {
token: value.getString("token"), token: value.getString("token"),
); );
} }
pageNum += 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"onlyFollow": false, "onlyFollow": false,
"onlyMe": true, "onlyMe": true,

Loading…
Cancel
Save