pull/1/head
张萌 2 years ago
commit 354759fc8b

@ -104,7 +104,10 @@ class _User {
class _Login { class _Login {
///app退 ///app退
String get logOut => '/app/user/quit'; String get quit => '/app/user/quit';
///app
String get logOut =>'/app/user/logout';
/// ///
String get allCommunity => '/app/login/findAllCommunity'; String get allCommunity => '/app/login/findAllCommunity';

@ -110,44 +110,46 @@ class _HomePageState extends State<HomePage>
right: 32.w, right: 32.w,
left: 32.w, left: 32.w,
bottom: 20.w), bottom: 20.w),
child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ child: Row(
// if (appProvider.location != null) crossAxisAlignment: CrossAxisAlignment.center,
Image.asset( children: [
Assets.home.icLocation.path, // if (appProvider.location != null)
width: 48.w, Image.asset(
height: 48.w, Assets.home.icLocation.path,
), width: 48.w,
16.wb, height: 48.w,
Text(
'${UserTool.userProvider.userInfoModel?.communityName ?? ""}',
// appProvider.location?['city'] == null
// ? ''
// : appProvider.location?['city'] as String? ?? '',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 28.sp,
color: Color(0xff333333),
), ),
textAlign: TextAlign.center, 16.wb,
), Text(
// Text( '${UserTool.userProvider.userInfoModel?.communityName ?? ""}',
// '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)', // appProvider.location?['city'] == null
// style: TextStyle( // ? ''
// fontSize: 28.sp, // : appProvider.location?['city'] as String? ?? '',
// color: Color(0xff999999), style: TextStyle(
// ), fontWeight: FontWeight.w600,
// textAlign: TextAlign.center, fontSize: 28.sp,
// ), color: Color(0xff333333),
Spacer(), ),
// GestureDetector( textAlign: TextAlign.center,
// onTap: () { ),
// Get.to(() => BeeSearch()); // Text(
// }, // '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)',
// child: // style: TextStyle(
// Image.asset(Assets.home.icSearch.path, height: 48.w, width: 48.w), // fontSize: 28.sp,
// ), // color: Color(0xff999999),
20.wb, // ),
Badge( // textAlign: TextAlign.center,
// ),
Spacer(),
// GestureDetector(
// onTap: () {
// Get.to(() => BeeSearch());
// },
// child:
// Image.asset(Assets.home.icSearch.path, height: 48.w, width: 48.w),
// ),
20.wb,
Badge(
elevation: 0, elevation: 0,
badgeColor: Color(0xFFCF2525), badgeColor: Color(0xFFCF2525),
padding: sum > 9 ? EdgeInsets.all(2.w) : EdgeInsets.all(5.w), padding: sum > 9 ? EdgeInsets.all(2.w) : EdgeInsets.all(5.w),
@ -168,8 +170,10 @@ class _HomePageState extends State<HomePage>
}, },
child: Image.asset(Assets.home.icMessage.path, child: Image.asset(Assets.home.icMessage.path,
height: 48.w, width: 48.w), height: 48.w, width: 48.w),
)), ),
]), ),
],
),
); );
return AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.dark, value: SystemUiOverlayStyle.dark,
@ -359,7 +363,8 @@ class _HomePageState extends State<HomePage>
), ),
), ),
onTap: () async { onTap: () async {
Get.to(AdvicePage(type: AdviceType.SUGGESTION)); Get.to(AdvicePage(
type: AdviceType.SUGGESTION));
}, },
), ),
) )

@ -1,3 +1,4 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -7,6 +8,9 @@ import 'package:velocity_x/velocity_x.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/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
import '../../utils/network/base_model.dart';
import '../../utils/network/net_util.dart';
class AccountManagerPage extends StatefulWidget { class AccountManagerPage extends StatefulWidget {
AccountManagerPage({Key? key}) : super(key: key); AccountManagerPage({Key? key}) : super(key: key);
@ -37,9 +41,12 @@ class _AccountManagerPageState extends State<AccountManagerPage> {
color: Colors.red.withOpacity(0.7), color: Colors.red.withOpacity(0.7),
), ),
), ),
onPressed: () { onPressed: () async {
// BaseModel baseModel =
Get.offAll(() => OtherLoginPage()); await NetUtil().post(SAASAPI.login.logOut);
if (baseModel.success) {
Get.offAll(() => OtherLoginPage());
}
}, },
), ),
], ],

@ -143,10 +143,10 @@ class _SettingsPageState extends State<SettingsPage> {
title: '意见反馈', title: '意见反馈',
onTap: () => Get.to(() => FeedBackPage()), onTap: () => Get.to(() => FeedBackPage()),
), ),
// _buildTile( _buildTile(
// title: '账号管理', title: '账号管理',
// onTap: () => Get.to(() => AccountManagerPage()), onTap: () => Get.to(() => AccountManagerPage()),
// ), ),
_buildTile( _buildTile(
title: '用户协议', title: '用户协议',
onTap: () => Get.to(() => AgreementPage()), onTap: () => Get.to(() => AgreementPage()),

@ -58,7 +58,7 @@ class UserProvider extends ChangeNotifier {
final appProvider = Provider.of<AppProvider>(Get.context!, listen: false); final appProvider = Provider.of<AppProvider>(Get.context!, listen: false);
appProvider.setCurrentHouse(null); appProvider.setCurrentHouse(null);
if (_isLogin) { if (_isLogin) {
NetUtil().post(SAASAPI.login.logOut, showMessage: true); NetUtil().post(SAASAPI.login.quit, showMessage: true);
NetUtil().dio!.options.headers.remove('app-login-token'); NetUtil().dio!.options.headers.remove('app-login-token');
_isLogin = false; _isLogin = false;
} }

@ -106,18 +106,15 @@ class _EventDetailPageState extends State<EventDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
leading: Navigator.canPop(context) leading: Navigator.canPop(context)
? IconButton( ? IconButton(
onPressed: () => Get.back(result: true), onPressed: () => Get.back(result: true),
icon: Icon( icon: Icon(
CupertinoIcons.chevron_back, CupertinoIcons.chevron_back,
color: Colors.black, color: Colors.black,
), ),
) )
: SizedBox(), : SizedBox(),
title: '详情', title: '详情',
bottomNavi: _bottomButton(), bottomNavi: _bottomButton(),
actions: [ actions: [
@ -303,8 +300,9 @@ class _EventDetailPageState extends State<EventDetailPage> {
); );
} }
Widget _commentWidget(CommentListModel model, int rootIndex) { Widget _commentWidget(CommentListModel model, int rootIndex){
return GestureDetector( final userProvider = Provider.of<UserProvider>(context);
return GestureDetector(
onTap: () { onTap: () {
_rootId = model.id; _rootId = model.id;
_parentId = model.id; _parentId = model.id;
@ -363,9 +361,9 @@ class _EventDetailPageState extends State<EventDetailPage> {
), ),
Spacer(), Spacer(),
CommunityPopButton( CommunityPopButton(
isMyself: _isMyself, isMyself: userProvider.userInfoModel?.id==model.createId,
onSelect: (value) async { onSelect: (value) async {
if (_isMyself) { if (userProvider.userInfoModel?.id==model.createId) {
await CommunityFunc.deleteComment(model.id); await CommunityFunc.deleteComment(model.id);
_refreshController.callRefresh(); _refreshController.callRefresh();
} }
@ -374,80 +372,68 @@ class _EventDetailPageState extends State<EventDetailPage> {
40.hb, 40.hb,
model.content.text.size(28.sp).color(ktextSubColor).make(), model.content.text.size(28.sp).color(ktextSubColor).make(),
30.hb, 30.hb,
GestureDetector( Row(
onTap: () async { children: [
var res = Spacer(),
await NetUtil().get(SAASAPI.community.commentLike, params: { GestureDetector(
'commentId': model.id, onTap: () async {
}); var base = await NetUtil().get(
if (res.success) { SAASAPI.community.commentLike,
_likes[rootIndex] = !_likes[rootIndex]; params: {'commentId': model.id});
setState(() {}); if (base.success) {
} _likes[rootIndex] = !_likes[rootIndex];
}, if (_likes[rootIndex]) {
child: Row( _likeNums[rootIndex] += 1;
children: [
Spacer(),
GestureDetector(
onTap: () async {
var base = await NetUtil().get(
SAASAPI.community.commentLike,
params: {'commentId': model.id});
if (base.success) {
_likes[rootIndex] = !_likes[rootIndex];
if (_likes[rootIndex]) {
_likeNums[rootIndex] += 1;
} else {
_likeNums[rootIndex] -= 1;
}
BotToast.showText(
text: _likes[rootIndex] ? '点赞成功' : '取消点赞成功');
} else { } else {
BotToast.showText(text: base.msg); _likeNums[rootIndex] -= 1;
} }
BotToast.showText(
text: _likes[rootIndex] ? '点赞成功' : '取消点赞成功');
} else {
BotToast.showText(text: base.msg);
}
setState(() {}); setState(() {});
}, },
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
child: Row( child: Row(
children: [ children: [
Image.asset( Image.asset(
R.ASSETS_ICONS_COMMUNITY_LIKE_PNG, R.ASSETS_ICONS_COMMUNITY_LIKE_PNG,
width: 32.w, width: 32.w,
height: 32.w, height: 32.w,
color: !_likes[rootIndex] color: !_likes[rootIndex]
? Colors.black.withOpacity(0.45) ? Colors.black.withOpacity(0.45)
: kPrimaryColor, : kPrimaryColor,
), ),
5.wb, 5.wb,
'${_likeNums[rootIndex]}' '${_likeNums[rootIndex]}'
.text .text
.size(24.sp) .size(24.sp)
.color(Color(0xFF999999)) .color(Color(0xFF999999))
.make(), .make(),
], ],
),
), ),
), ),
32.wb, ),
Row( 32.wb,
children: [ Row(
Image.asset( children: [
R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, Image.asset(
width: 40.w, R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
height: 40.w, width: 40.w,
), height: 40.w,
], ),
), ],
5.wb, ),
'${model.commentNum}' 5.wb,
.text '${model.commentNum}'
.size(24.sp) .text
.color(Color(0xFF999999)) .size(24.sp)
.make(), .color(Color(0xFF999999))
], .make(),
), ],
), ),
40.hb, 40.hb,
model.commentTwoList.isEmpty model.commentTwoList.isEmpty
@ -535,7 +521,7 @@ class _EventDetailPageState extends State<EventDetailPage> {
fontSize: 28.sp, fontSize: 28.sp,
), ),
children: [ children: [
if (model.createId ==widget.createId) if (model.createId == widget.createId)
WidgetSpan( WidgetSpan(
child: Container( child: Container(
width: 56.w, width: 56.w,
@ -584,7 +570,6 @@ class _EventDetailPageState extends State<EventDetailPage> {
} }
_bottomButton() { _bottomButton() {
final userProvider = Provider.of<UserProvider>(context);
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 100.w, height: 100.w,

@ -247,6 +247,7 @@ class _ChatCardState extends State<ChatCard> {
], ],
), ),
Spacer(), Spacer(),
CommunityPopButton( CommunityPopButton(
isMyself: _isMyself, isMyself: _isMyself,
onSelect: (dynamic _) async { onSelect: (dynamic _) async {

@ -62,6 +62,7 @@ class _WorkOrderPageState extends State<WorkOrderPage>
appBarBottom: BeeTabBar( appBarBottom: BeeTabBar(
tabs: _tabs, tabs: _tabs,
controller: _tabController, controller: _tabController,
scrollable: true,
), ),
body: TabBarView( body: TabBarView(
controller: _tabController, controller: _tabController,

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class BeeTabBar extends StatefulWidget with PreferredSizeWidget { class BeeTabBar extends StatefulWidget with PreferredSizeWidget {
final TabController? controller; final TabController? controller;

Loading…
Cancel
Save