Browse Source

社群更改

master
w-R 3 years ago
parent
commit
42372efa8e
  1. 2
      lib/community/community_child_page.dart
  2. 5
      lib/community/community_details.dart
  3. 10
      lib/community/community_page.dart
  4. 6
      lib/community/community_view/community_dynamic.dart
  5. 1
      lib/community/release_dynamic.dart

2
lib/community/community_child_page.dart

@ -31,7 +31,6 @@ class _CommunityChildPage extends State<CommunityChildPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_onRefresh(); _onRefresh();
} }
@ -69,6 +68,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
comments.clear(); comments.clear();
} }
comments.addAll(baseData.data.list); comments.addAll(baseData.data.list);
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime));
print("comments: ${comments.length}"); print("comments: ${comments.length}");
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { if (int.tryParse(baseData.data.total) < (pageNum * 10)) {
refreshController.loadNoData(); refreshController.loadNoData();

5
lib/community/community_details.dart

@ -16,7 +16,6 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/comment_menu.dart'; import 'package:huixiang/view_widget/comment_menu.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.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/input_comment.dart'; import 'package:huixiang/web/web_view/input_comment.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -150,7 +149,7 @@ class _CommunityDetails extends State<CommunityDetails>
this.height = height + this.height = height +
MediaQuery.of(context).padding.top + MediaQuery.of(context).padding.top +
kToolbarHeight + kToolbarHeight +
68; 24;
setState(() {}); setState(() {});
}, },
), ),
@ -230,7 +229,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), margin: EdgeInsets.only(top:40),
padding: EdgeInsets.all(22.h), padding: EdgeInsets.all(22.h),
child: Text( child: Text(
S.of(context).zanwupinglun, S.of(context).zanwupinglun,

10
lib/community/community_page.dart

@ -36,10 +36,14 @@ class _CommunityPage extends State<CommunityPage>
} }
_toRelease() async { _toRelease() async {
int tmpIndex = tabcontroller.index;
setState(() {
tabcontroller.index = (tabcontroller.index == lables.length -1)?0:tabcontroller.index+1;
});
var result = await Navigator.of(context).pushNamed('/router/release_dynamic'); var result = await Navigator.of(context).pushNamed('/router/release_dynamic');
if (result != null && result) { setState(() {
setState(() {}); tabcontroller.index = tmpIndex;
} });
} }
@override @override

6
lib/community/community_view/community_dynamic.dart

@ -257,7 +257,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
subjectInfo.images[0], subjectInfo.images[0],
fit: BoxFit.cover, fit: BoxFit.cover,
width: MediaQuery.of(context).size.width / 2, width: MediaQuery.of(context).size.width / 2,
height: MediaQuery.of(context).size.width / 2, height: MediaQuery.of(context).size.width /1,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",
), ),
@ -279,7 +279,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
itemBuilder: (context, position) { itemBuilder: (context, position) {
return Container( return Container(
child: MImage( child: MImage(
subjectInfo.images[0], subjectInfo.images[position],
fit: BoxFit.cover, fit: BoxFit.cover,
aspectRatio: 1, aspectRatio: 1,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
@ -295,7 +295,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
subjectInfo.video != "") { subjectInfo.video != "") {
widget = Container( widget = Container(
width: MediaQuery.of(context).size.width - 32, width: MediaQuery.of(context).size.width - 32,
height: MediaQuery.of(context).size.width / 2, height: MediaQuery.of(context).size.width /2,
color: Colors.blue.withAlpha(123), color: Colors.blue.withAlpha(123),
); );
} }

1
lib/community/release_dynamic.dart

@ -155,6 +155,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
if (baseData.isSuccess) { if (baseData.isSuccess) {
SmartDialog.showToast("发布成功!"); SmartDialog.showToast("发布成功!");
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
}); });
} }

Loading…
Cancel
Save