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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

@ -114,6 +114,12 @@ class _Message {
}
class _Community {
///
String get deleteComment => '/app/user/community/comment/delete';
///
String get deleteDynamic => '/app/user/community/dynamic/delete';
///
String get singleComment => '/app/user/community/comment/findById';
@ -158,12 +164,6 @@ class _Community {
///
String get dynamicAddViewNum => '/app/user/community/dynamic/addViewNum';
///
String get deleteDynamic => '/app/user/community/dynamic/delete';
}
class _Task {

File diff suppressed because it is too large Load Diff

@ -12,7 +12,7 @@ class MyHouseModel {
final String unitName;
final String manageEstateTypeName;
final int identity;
final String name;
final String? name;
final String tel;
final int isDefault;
factory MyHouseModel.fromJson(Map<String, dynamic> json) =>
@ -27,7 +27,7 @@ class MyHouseModel {
required this.unitName,
required this.manageEstateTypeName,
required this.identity,
required this.name,
this.name,
required this.tel,
required this.isDefault,
});

@ -15,7 +15,7 @@ MyHouseModel _$MyHouseModelFromJson(Map<String, dynamic> json) => MyHouseModel(
unitName: json['unitName'] as String,
manageEstateTypeName: json['manageEstateTypeName'] as String,
identity: json['identity'] as int,
name: json['name'] as String,
name: json['name'] as String?,
tel: json['tel'] as String,
isDefault: json['isDefault'] as int,
);

@ -566,7 +566,7 @@ class _HomePageState extends State<HomePage>
child: GestureDetector(
onTap: () {
if (LoginUtil.isNotLogin) return;
// if (!LoginUtil.haveRoom(ao.title)) return;
if (ao.title != '全部应用' && !LoginUtil.haveRealName(ao.title)) return;
if (ao.callback == null) {
BotToast.showText(
text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));

@ -19,11 +19,8 @@ class ReplyCard extends StatelessWidget {
onTap: () async {
await MessageFunc.readMessage(model.id);
Get.to(() => EventDetailPage(
dynamicId: model.jumpId,
onDelete: (){
},
));
dynamicId: model.jumpId,
));
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w),

@ -1,13 +1,11 @@
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/pages/services/old_age/submit_equipment_code_page.dart';
import 'package:aku_new_community/widget/bee_back_button.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';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/pages/services/old_age/submit_equipment_code_page.dart';
import 'package:aku_new_community/widget/bee_back_button.dart';
class AddEquipmentPage extends StatefulWidget {
const AddEquipmentPage({Key? key}) : super(key: key);

@ -30,7 +30,7 @@ class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
@override
void initState() {
var cancel = BotToast.showLoading();
getData();
// getData();
cancel();
super.initState();
}

@ -1,4 +1,3 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/good/market_swiper_model.dart';
import 'package:aku_new_community/models/community/dynamic_my_list_body.dart';
@ -47,20 +46,6 @@ class CommunityFunc {
return model.rows.map((e) => InformationListModel.fromJson(e)).toList();
}
///
static Future<bool> deleteDynamicAddViews(int dynamicId) async {
BaseModel model = await NetUtil().get(SAASAPI.community.deleteDynamic,
params: {'dynamicId': dynamicId}, showMessage: false);
if (model.success) {
BotToast.showText(text: '删除成功');
return true;
} else {
BotToast.showText(text: '删除失败');
return false;
}
}
///
static Future<String> addViews(int newsId) async {
BaseModel model = await NetUtil().get(
@ -85,7 +70,6 @@ class CommunityFunc {
return model.msg;
}
///
static Future<MarketStatisticsModel?> getMarketStatistics() async {
BaseModel model = await NetUtil().get(
@ -174,4 +158,22 @@ class CommunityFunc {
.map((e) => HomeSwiperModel.fromJson(e))
.toList();
}
///
static Future deleteDynamic(int id) async {
var base = await NetUtil()
.get(SAASAPI.community.deleteDynamic, showMessage: true, params: {
'dynamicId': id,
});
return base.success;
}
///
static Future deleteComment(int id) async {
var base = await NetUtil()
.get(SAASAPI.community.deleteComment, showMessage: true, params: {
'commentId': id,
});
return base.success;
}
}

@ -32,8 +32,6 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'event_detail_page.dart';
class CommunityPage extends StatefulWidget {
CommunityPage({Key? key}) : super(key: key);
@ -172,16 +170,10 @@ class _CommunityPageState extends State<CommunityPage>
..._newItems
.map((e) => ChatCard(
model: e,
onDelete: () {
refresh: () {
_easyRefreshController.callRefresh();
setState(() {});
},
onBack: (){
_easyRefreshController.callRefresh();
setState(() {});
},
))
}))
.toList()
],
),

@ -6,6 +6,7 @@ import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/models/community/comment_list_model.dart';
import 'package:aku_new_community/models/community/dynamic_detail_model.dart';
import 'package:aku_new_community/provider/user_provider.dart';
import 'package:aku_new_community/ui/community/community_func.dart';
import 'package:aku_new_community/ui/community/community_views/widgets/chat_card.dart';
import 'package:aku_new_community/ui/community/community_views/widgets/chat_card_detail.dart';
import 'package:aku_new_community/utils/bee_date_util.dart';
@ -25,12 +26,12 @@ import 'package:provider/provider.dart';
class EventDetailPage extends StatefulWidget {
final int dynamicId;
final VoidCallback? onDelete;
final VoidCallback? refresh;
EventDetailPage({
Key? key,
required this.dynamicId,
this.onDelete,
this.refresh,
}) : super(key: key);
@override
@ -43,7 +44,7 @@ class _EventDetailPageState extends State<EventDetailPage> {
bool get _isMyself {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return (userProvider.userInfoModel?.id ?? -1) == widget.dynamicId;
return (userProvider.userInfoModel?.id ?? -1) == _model?.createId;
}
TextEditingController _textEditingController = TextEditingController();
@ -142,10 +143,9 @@ class _EventDetailPageState extends State<EventDetailPage> {
));
if (result == true) {
if (widget.onDelete != null) {
widget.onDelete!();
Get.back();
}
await CommunityFunc.deleteDynamic(widget.dynamicId);
Get.back();
widget.refresh!();
}
}
},
@ -197,6 +197,8 @@ class _EventDetailPageState extends State<EventDetailPage> {
_likes.add(element.isLike);
_likeNums.add(element.likes);
});
} else {
_refreshController.finishLoadCallBack!(noMore: true);
}
setState(() {});
},
@ -349,7 +351,14 @@ class _EventDetailPageState extends State<EventDetailPage> {
],
),
Spacer(),
CommunityPopButton(isMyself: false, onSelect: (value) {})
CommunityPopButton(
isMyself: _isMyself,
onSelect: (value) async {
if (_isMyself) {
await CommunityFunc.deleteComment(model.id);
_refreshController.callRefresh();
}
})
].row(),
40.hb,
model.content.text.size(28.sp).color(ktextSubColor).make(),
@ -620,7 +629,7 @@ class _EventDetailPageState extends State<EventDetailPage> {
if (_textEditingController.text.trim().isEmptyOrNull) {
BotToast.showText(text: '请填写内容');
return;
}else{
} else {
var res = await NetUtil()
.post(SAASAPI.community.commentInsert, params: params);
if (res.success) {

@ -1,11 +1,7 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/model/community/my_event_item_model.dart';
import 'package:aku_new_community/models/community/dynamic_my_list_body.dart';
import 'package:aku_new_community/models/community/dynamic_my_list_head.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_new_community/ui/community/community_views/widgets/my_event_card.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/login_util.dart';
import 'package:aku_new_community/utils/network/base_list_model.dart';
@ -182,7 +178,6 @@ class MyCommunityViewState extends State<MyCommunityView>
],
),
);
}
Widget _getMoments(DynamicMyListBody item) {
@ -273,11 +268,11 @@ class MyCommunityViewState extends State<MyCommunityView>
));
if (result == true) {
var result = await CommunityFunc.deleteDynamicAddViews(item.id);
if(result){
refresh();
}
var result =
await CommunityFunc.deleteDynamic(item.id);
if (result) {
refresh();
}
}
},
child: Container(

@ -41,7 +41,7 @@ class NewCommunityViewState extends State<NewCommunityView>
final item = items[index] as AllDynamicListModel;
return ChatCard(
model: item,
onDelete: () {
refresh: () {
_refreshController.callRefresh();
},
);

@ -75,7 +75,7 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
'pageNum': _page,
'size': 4,
'topicId': widget.topicId,
'type': _currentIndex
'type': _currentIndex + 1
});
_dynamicList = baseList.rows
.map((e) => AllDynamicListModel.fromJson(e))
@ -137,7 +137,7 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
padding: EdgeInsets.only(top: 20.w),
child: ChatCard(
model: _dynamicList[index],
onDelete: () {
refresh: () {
_refreshController.callRefresh();
},
),

@ -1,7 +1,6 @@
import 'dart:math';
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/models/community/all_dynamic_list_model.dart';
@ -25,17 +24,17 @@ import 'package:velocity_x/velocity_x.dart';
class ChatCard extends StatefulWidget {
final AllDynamicListModel model;
final VoidCallback? onDelete;
final VoidCallback? onBack;
final VoidCallback refresh;
final bool hideLine;
final bool canTap;
ChatCard({
Key? key,
required this.model,
this.onDelete,
required this.refresh,
this.hideLine = false,
this.canTap = true, this.onBack,
this.canTap = true,
}) : super(key: key);
@override
@ -143,21 +142,24 @@ class _ChatCardState extends State<ChatCard> {
),
),
20.wb,
Material(
color: Colors.transparent,
child: Row(
children: [
Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
width: 32.w,
height: 32.w,
color: Colors.black.withOpacity(0.45)),
5.wb,
'${widget.model.commentNum}'
.text
.size(24.sp)
.color(Color(0xFF999999))
.make(),
],
GestureDetector(
onTap: () => Get.to(EventDetailPage(dynamicId: widget.model.id)),
child: Material(
color: Colors.transparent,
child: Row(
children: [
Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
width: 32.w,
height: 32.w,
color: Colors.black.withOpacity(0.45)),
5.wb,
'${widget.model.commentNum}'
.text
.size(24.sp)
.color(Color(0xFF999999))
.make(),
],
),
),
)
],
@ -174,7 +176,6 @@ class _ChatCardState extends State<ChatCard> {
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
color: Colors.white,
@ -183,19 +184,11 @@ class _ChatCardState extends State<ChatCard> {
padding: EdgeInsets.zero,
onPressed: widget.canTap
? () async {
var result =
await Get.to(() => EventDetailPage(
await Get.to(() => EventDetailPage(
dynamicId: widget.model.id,
onDelete: widget.onDelete,
refresh: widget.refresh,
));
CommunityFunc.dynamicAddViews(widget.model.id);
if (result != null && result) {
widget.onBack!();
}
widget.refresh();
}
: null,
child: Column(
@ -272,9 +265,8 @@ class _ChatCardState extends State<ChatCard> {
));
if (result == true) {
await CommunityFunc.deleteDynamicAddViews(widget.model.id);
if (widget.onDelete != null) widget.onDelete!();
await CommunityFunc.deleteDynamic(widget.model.id);
widget.refresh();
}
}
},
@ -339,7 +331,7 @@ class CommunityPopButton extends StatelessWidget {
)
: PopupMenuItem(
child: '举报'.text.isIntrinsic.make(),
value: 0,
value: 1,
),
];
},

@ -1,120 +0,0 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/model/community/my_event_item_model.dart';
import 'package:aku_new_community/models/community/dynamic_detail_model.dart';
import 'package:aku_new_community/provider/user_provider.dart';
import 'package:aku_new_community/ui/community/community_views/event_detail_page.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/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/picker/bee_image_preview.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
class MyEventCard extends StatelessWidget {
final MyEventItemModel model;
final MyEventItemModel? preModel;
const MyEventCard({
Key? key,
required this.model,
required this.preModel,
}) : super(key: key);
bool get isFirst => preModel == null;
bool get notSameYear => model.date!.year != (preModel?.date?.year ?? 0);
BeeDateUtil get beeDate => BeeDateUtil(model.date);
bool get sameDay =>
model.date!.year == (preModel?.date?.year ?? 0) &&
model.date!.month == (preModel?.date?.month ?? 0) &&
model.date!.day == (preModel?.date?.day ?? 0);
Widget title() {
if (beeDate.sameDay) return '今天'.text.size(52.sp).bold.make();
if (beeDate.isYesterday)
return '昨天'.text.size(52.sp).bold.make();
else
return Row(
mainAxisSize: MainAxisSize.min,
children: [
model.date!.day.toString().text.size(52.sp).bold.make(),
'${model.date!.month}'.text.size(36.sp).make(),
],
);
}
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
(notSameYear && model.date!.year != DateTime.now().year)
? '${model.date!.year}'
.text
.bold
.size(52.sp)
.make()
.paddingOnly(left: 32.w, top: isFirst ? 0 : 64.w, bottom: 32.w)
: SizedBox(),
MaterialButton(
onPressed: () async {
BaseModel models = await NetUtil().get(
SAASAPI.community.dynamicDetail,
params: {'dynamicId': model.id},
);
DynamicDetailModel eventItemModel =
DynamicDetailModel.fromJson(models.data);
Get.to(() => EventDetailPage(
dynamicId: model.id ?? 0,
));
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 200.w,
padding: EdgeInsets.only(left: 32.w),
alignment: Alignment.topLeft,
child: sameDay ? SizedBox() : title(),
),
model.imgUrl!.length == 0
? SizedBox(height: 152.w)
: GestureDetector(
onTap: () {
BeeImagePreview.toPath(
path: ImgModel.first(model.imgUrl),
tag: ImgModel.first(model.imgUrl),
);
},
child: Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
color: Colors.black12,
borderRadius: BorderRadius.circular(8.w),
),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: SAASAPI.image(ImgModel.first(model.imgUrl)),
width: 152.w,
height: 152.w,
fit: BoxFit.cover,
),
),
),
10.wb,
model.content!.text.make().expand(),
],
),
),
],
);
}
}

@ -130,10 +130,11 @@ class _PublishTaskPageState extends State<PublishTaskPage> {
BotToast.showText(text: base.msg);
}
} catch (e) {
print(22222);
print(e.toString());
}
}
var imgs;
var imgs = <String>[];
if (_photos.isNotEmpty) {
try {
imgs = await NetUtil()

@ -38,7 +38,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
? null
: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return;
if (!LoginUtil.haveRealName(object.title)) return;
if (object.callback == null || !online) {
BotToast.showText(
text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5));

@ -77,7 +77,7 @@ class _BeeSearchState extends State<BeeSearch> {
return MaterialButton(
onPressed: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(e.title)) return;
if (!LoginUtil.haveRealName(e.title)) return;
if (e.callback == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {

@ -30,15 +30,21 @@ class LoginUtil {
///
static bool get isNotLogin => !isLogin;
static bool haveRoom(String name) {
if (!name.contains(RegExp('访客邀请|报事报修|建议咨询|生活缴费|物品出门|投诉表扬|我的访客|我的报修|我的缴费')))
return true;
static bool haveRealName(String name) {
// if (!name.contains(RegExp('访客邀请|报事报修|建议咨询|生活缴费|物品出门|投诉表扬|我的访客|我的报修|我的缴费')))
// return true;
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
if (userProvider.userInfoModel!.name == null) {
BotToast.showText(text: '请先实名认证');
Get.dialog(CertificationDialog());
return false;
}
return true;
}
static bool haveRoom(String name) {
// if (!name.contains(RegExp('访客邀请|报事报修|建议咨询|生活缴费|物品出门|投诉表扬|我的访客|我的报修|我的缴费')))
// return true;
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
if (userProvider.defaultHouse == null) {
BotToast.showText(text: '请先选择默认房屋');
Get.to(() => MyHousePage());

@ -9,14 +9,14 @@ class StackAvatar extends StatelessWidget {
double get offset => 35.w;
int get length => avatars.length;
int get length => avatars.length > 3 ? 3 : avatars.length;
@override
Widget build(BuildContext context) {
return Stack(
children: [
SizedBox(
width: 44.w * 2 + 26.w,
width: 44.w * length + 26.w,
height: 44.w + 6.w,
),
...List.generate(length, (index) {

@ -34,7 +34,7 @@ class _ApplicationViewState extends State<ApplicationView> {
padding: EdgeInsets.zero,
onPressed: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return;
if (!LoginUtil.haveRealName(object.title)) return;
if (object.callback == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {

Loading…
Cancel
Save