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

4
lib/community/community_details.dart

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

2
lib/community/community_view/community_comment.dart

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

15
lib/community/community_view/community_dynamic.dart

@ -106,9 +106,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
child: Row(
children: [
MImage(
widget.comment != null
? widget.comment.memberInfo.avatar
: "",
widget?.comment?.memberInfo?.avatar??"",
width: 44,
height: 44,
isCircle: true,
@ -124,9 +122,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.comment != null
? widget.comment.memberInfo.nickname
: "",
widget?.comment?.memberInfo?.nickname??"",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
@ -134,9 +130,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
),
Text(
widget.comment != null
? widget.comment.createTime
: "",
widget?.comment?.createTime??"",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -199,7 +193,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
),
Text(
widget.comment.subject ?? "",
// maxLines: 5,
maxLines: 5,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF1A1A1A),
@ -221,7 +215,6 @@ class _CommunityDynamic extends State<CommunityDynamic> {
(widget.comment != null)
? "${widget.comment.viewers}"
: "",
// "${widget.comment.viewers ?? 0}",
space: 4.w,
leftImage: "assets/svg/liulanliang.svg",
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/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.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/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_tab.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../fans_page.dart';
@ -18,14 +24,34 @@ class CommunityFollow extends StatefulWidget {
class _CommunityFollow extends State<CommunityFollow>
with SingleTickerProviderStateMixin {
ApiService apiService;
SocialInfo infoNumber;
@override
void 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
Widget build(BuildContext context) {
@ -56,8 +82,8 @@ class _CommunityFollow extends State<CommunityFollow>
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text:"关注(0)",),
MyTab(text: "粉丝(0)"),
MyTab(text:"关注(${infoNumber?.follow??"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> {
RefreshController refreshController = RefreshController();
ApiService apiService;
int pageNum = 1;
int pageNum = 0;
List<ComunityComment> comments = [];
@ -35,7 +35,7 @@ class _ReleasePage extends State<ReleasePage> {
}
_onRefresh() async {
pageNum = 1;
pageNum = 0;
setState(() {});
}
@ -48,7 +48,7 @@ class _ReleasePage extends State<ReleasePage> {
token: value.getString("token"),
);
}
pageNum += 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"onlyFollow": false,
"onlyMe": true,

Loading…
Cancel
Save