pull/1/head
章文轩 3 years ago
commit b7a99411fc

@ -1,5 +1,4 @@
import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/const/resource.dart';
import 'package:aku_new_community/pages/property/property_page.dart';
import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; import 'package:aku_new_community/pages/sign/login/other_login_page.dart';
import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/ui/community/community_views/community_page.dart'; import 'package:aku_new_community/ui/community/community_views/community_page.dart';
@ -47,7 +46,7 @@ class _TabNavigatorState extends State<TabNavigator>
_pages = [ _pages = [
HomePage(), HomePage(),
MarketPage(), MarketPage(),
PropertyPage(), // PropertyPage(),
CommunityPage(), CommunityPage(),
PersonalIndex() PersonalIndex()
]; ];
@ -91,11 +90,11 @@ class _TabNavigatorState extends State<TabNavigator>
R.ASSETS_ICONS_TABBAR_MARKET_NO_PNG, R.ASSETS_ICONS_TABBAR_MARKET_NO_PNG,
R.ASSETS_ICONS_TABBAR_MARKET_PNG, R.ASSETS_ICONS_TABBAR_MARKET_PNG,
), ),
_buildBottomBar( // _buildBottomBar(
'物业', // '物业',
R.ASSETS_ICONS_TABBAR_HOUSE_NO_PNG, // R.ASSETS_ICONS_TABBAR_HOUSE_NO_PNG,
R.ASSETS_ICONS_TABBAR_HOUSE_PNG, // R.ASSETS_ICONS_TABBAR_HOUSE_PNG,
), // ),
_buildBottomBar( _buildBottomBar(
'社区', '社区',
R.ASSETS_ICONS_TABBAR_MESSAGE_NO_PNG, R.ASSETS_ICONS_TABBAR_MESSAGE_NO_PNG,

@ -118,8 +118,8 @@ class ActivityCard extends StatelessWidget {
// Spacer(), // Spacer(),
ActivityFunc.dateCheck(model!.end) ActivityFunc.dateCheck(model!.end)
.text .text
.size(28.sp) .size(24.sp)
.color(Colors.black.withOpacity(0.45)) .black
.make(), .make(),
].row().pSymmetric(h: 24.w), ].row().pSymmetric(h: 24.w),
20.hb, 20.hb,

@ -48,6 +48,7 @@ class _ChatCardState extends State<ChatCard> {
} }
late bool _isLiked; late bool _isLiked;
late int _likeNum;
_renderImage() { _renderImage() {
if (widget.model.dynamicList.isEmpty) return SizedBox(); if (widget.model.dynamicList.isEmpty) return SizedBox();
@ -106,6 +107,13 @@ class _ChatCardState extends State<ChatCard> {
params: {'dynamicId': widget.model.id}); params: {'dynamicId': widget.model.id});
if (res.success) { if (res.success) {
_isLiked = !_isLiked; _isLiked = !_isLiked;
if (_isLiked) {
_likeNum += 1;
} else {
_likeNum -= 1;
}
BotToast.showText(text: _isLiked ? '点赞成功' : '取消点赞成功');
setState(() {}); setState(() {});
} else { } else {
BotToast.showText(text: res.msg); BotToast.showText(text: res.msg);
@ -162,6 +170,7 @@ class _ChatCardState extends State<ChatCard> {
@override @override
void initState() { void initState() {
_isLiked = widget.model.isLike; _isLiked = widget.model.isLike;
_likeNum = widget.model.likes;
super.initState(); super.initState();
} }

@ -7,8 +7,10 @@ import 'package:aku_new_community/provider/user_provider.dart';
import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart'; import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart';
import 'package:aku_new_community/utils/bee_date_util.dart'; import 'package:aku_new_community/utils/bee_date_util.dart';
import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/picker/bee_image_preview.dart'; import 'package:aku_new_community/widget/picker/bee_image_preview.dart';
import 'package:aku_new_community/widget/views/bee_grid_image_view.dart'; import 'package:aku_new_community/widget/views/bee_grid_image_view.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -43,6 +45,16 @@ class _ChatCardDetailState extends State<ChatCardDetail> {
return (userProvider.userInfoModel?.id ?? -1) == widget.model.createId; return (userProvider.userInfoModel?.id ?? -1) == widget.model.createId;
} }
late bool _isLiked;
late int _likeNum;
@override
void initState() {
_isLiked = widget.model.isLike;
_likeNum = widget.model.likes;
super.initState();
}
_renderImage() { _renderImage() {
if (widget.model.dynamicImgList.isEmpty) return SizedBox(); if (widget.model.dynamicImgList.isEmpty) return SizedBox();
if (widget.model.dynamicImgList.length == 1) if (widget.model.dynamicImgList.length == 1)
@ -140,11 +152,32 @@ class _ChatCardDetailState extends State<ChatCardDetail> {
Spacer(), Spacer(),
LikeButton( LikeButton(
size: 40.w, size: 40.w,
isLiked: _isLiked,
onTap: (isLiked) async {
var res = await NetUtil().get(SAASAPI.community.dynamicLike,
params: {'dynamicId': widget.model.id});
if (res.success) {
_isLiked = !_isLiked;
if (_isLiked) {
_likeNum += 1;
} else {
_likeNum -= 1;
}
BotToast.showText(text: _isLiked ? '点赞成功' : '取消点赞成功');
setState(() {});
} else {
BotToast.showText(text: res.msg);
}
},
likeBuilder: (bool isLiked) { likeBuilder: (bool isLiked) {
return Image.asset( return Image.asset(
isLiked ? Assets.icons.communityLikeIs.path : Assets.icons.communityLike.path,); isLiked
? Assets.icons.communityLikeIs.path
: Assets.icons.communityLike.path,
);
}, },
likeCount:widget.model.likes, likeCount: _likeNum,
), ),
// Image.asset( // Image.asset(
// Assets.icons.communityLikeIs.path, // Assets.icons.communityLikeIs.path,
@ -201,7 +234,6 @@ class _ChatCardDetailState extends State<ChatCardDetail> {
]).paddingOnly(bottom: 16.w); ]).paddingOnly(bottom: 16.w);
} }
// _renderLikeAndComment() { // _renderLikeAndComment() {
// if (widget.model!.likeNames!.isEmpty && // if (widget.model!.likeNames!.isEmpty &&
// widget.model!.gambitThemeCommentVoList!.isEmpty) return SizedBox(); // widget.model!.gambitThemeCommentVoList!.isEmpty) return SizedBox();

@ -40,7 +40,7 @@ class _ApplyRecordPageState extends State<ApplyRecordPage> {
} }
}, },
onLoad: () async {}, onLoad: () async {},
child: !_models.isEmpty child: _models.isEmpty
? Container() ? Container()
: ListView( : ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),

@ -1,9 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
@ -16,6 +10,10 @@ import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/dialog/certification_dialog.dart'; import 'package:aku_new_community/widget/dialog/certification_dialog.dart';
import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:aku_new_community/widget/tag/bee_tag.dart'; import 'package:aku_new_community/widget/tag/bee_tag.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class MyHousePage extends StatefulWidget { class MyHousePage extends StatefulWidget {
const MyHousePage({Key? key}) : super(key: key); const MyHousePage({Key? key}) : super(key: key);
@ -25,6 +23,15 @@ class MyHousePage extends StatefulWidget {
} }
class _MyHousePageState extends State<MyHousePage> { class _MyHousePageState extends State<MyHousePage> {
@override
void initState() {
Future.delayed(Duration(milliseconds: 0), () async {
await UserTool.userProvider.updateMyHouseInfo();
setState(() {});
});
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save