diff --git a/assets/icons/func_bmdh.png b/assets/icons/func_bmdh.png new file mode 100644 index 00000000..8604d9d3 Binary files /dev/null and b/assets/icons/func_bmdh.png differ diff --git a/assets/icons/func_bsbx.png b/assets/icons/func_bsbx.png new file mode 100644 index 00000000..cd6e1e1a Binary files /dev/null and b/assets/icons/func_bsbx.png differ diff --git a/assets/icons/func_dlxx.png b/assets/icons/func_dlxx.png new file mode 100644 index 00000000..626fbdd0 Binary files /dev/null and b/assets/icons/func_dlxx.png differ diff --git a/assets/icons/func_dzsw.png b/assets/icons/func_dzsw.png new file mode 100644 index 00000000..b5274078 Binary files /dev/null and b/assets/icons/func_dzsw.png differ diff --git a/assets/icons/func_fkyq.png b/assets/icons/func_fkyq.png new file mode 100644 index 00000000..15d14b34 Binary files /dev/null and b/assets/icons/func_fkyq.png differ diff --git a/assets/icons/func_fwll.png b/assets/icons/func_fwll.png new file mode 100644 index 00000000..22916811 Binary files /dev/null and b/assets/icons/func_fwll.png differ diff --git a/assets/icons/func_gife.png b/assets/icons/func_gife.png new file mode 100644 index 00000000..d1c862f3 Binary files /dev/null and b/assets/icons/func_gife.png differ diff --git a/assets/icons/func_hdtp.png b/assets/icons/func_hdtp.png new file mode 100644 index 00000000..d272c86e Binary files /dev/null and b/assets/icons/func_hdtp.png differ diff --git a/assets/icons/func_jhgl.png b/assets/icons/func_jhgl.png new file mode 100644 index 00000000..3772e273 Binary files /dev/null and b/assets/icons/func_jhgl.png differ diff --git a/assets/icons/func_jyzx.png b/assets/icons/func_jyzx.png new file mode 100644 index 00000000..54c426d0 Binary files /dev/null and b/assets/icons/func_jyzx.png differ diff --git a/assets/icons/func_jzfw.png b/assets/icons/func_jzfw.png new file mode 100644 index 00000000..04ad270a Binary files /dev/null and b/assets/icons/func_jzfw.png differ diff --git a/assets/icons/func_kdbg.png b/assets/icons/func_kdbg.png new file mode 100644 index 00000000..5153e283 Binary files /dev/null and b/assets/icons/func_kdbg.png differ diff --git a/assets/icons/func_kmm.png b/assets/icons/func_kmm.png new file mode 100644 index 00000000..787d5504 Binary files /dev/null and b/assets/icons/func_kmm.png differ diff --git a/assets/icons/func_shjf.png b/assets/icons/func_shjf.png new file mode 100644 index 00000000..374686a0 Binary files /dev/null and b/assets/icons/func_shjf.png differ diff --git a/assets/icons/func_sqjs.png b/assets/icons/func_sqjs.png new file mode 100644 index 00000000..bcc7401c Binary files /dev/null and b/assets/icons/func_sqjs.png differ diff --git a/assets/icons/func_ssyy.png b/assets/icons/func_ssyy.png new file mode 100644 index 00000000..6f86aea3 Binary files /dev/null and b/assets/icons/func_ssyy.png differ diff --git a/assets/icons/func_tsby.png b/assets/icons/func_tsby.png new file mode 100644 index 00000000..e4cb4a29 Binary files /dev/null and b/assets/icons/func_tsby.png differ diff --git a/assets/icons/func_wjdc.png b/assets/icons/func_wjdc.png new file mode 100644 index 00000000..a7ecd87c Binary files /dev/null and b/assets/icons/func_wjdc.png differ diff --git a/assets/icons/func_wpch.png b/assets/icons/func_wpch.png new file mode 100644 index 00000000..d656a887 Binary files /dev/null and b/assets/icons/func_wpch.png differ diff --git a/assets/icons/func_yjbj.png b/assets/icons/func_yjbj.png new file mode 100644 index 00000000..f505b4aa Binary files /dev/null and b/assets/icons/func_yjbj.png differ diff --git a/assets/icons/func_ywh.png b/assets/icons/func_ywh.png new file mode 100644 index 00000000..210cfb79 Binary files /dev/null and b/assets/icons/func_ywh.png differ diff --git a/assets/icons/func_zbqy.png b/assets/icons/func_zbqy.png new file mode 100644 index 00000000..efd9f49f Binary files /dev/null and b/assets/icons/func_zbqy.png differ diff --git a/assets/icons/func_zfsm.png b/assets/icons/func_zfsm.png new file mode 100644 index 00000000..635c3e6d Binary files /dev/null and b/assets/icons/func_zfsm.png differ diff --git a/assets/icons/func_zxgl.png b/assets/icons/func_zxgl.png new file mode 100644 index 00000000..fdb71a52 Binary files /dev/null and b/assets/icons/func_zxgl.png differ diff --git a/assets/icons/icon_community_push.png b/assets/icons/icon_community_push.png new file mode 100644 index 00000000..0afcea4d Binary files /dev/null and b/assets/icons/icon_community_push.png differ diff --git a/assets/icons/icon_my_car.png b/assets/icons/icon_my_car.png new file mode 100644 index 00000000..5f373e2a Binary files /dev/null and b/assets/icons/icon_my_car.png differ diff --git a/assets/icons/icon_my_carSeat.png b/assets/icons/icon_my_carSeat.png new file mode 100644 index 00000000..5a6f0350 Binary files /dev/null and b/assets/icons/icon_my_carSeat.png differ diff --git a/assets/icons/icon_my_house.png b/assets/icons/icon_my_house.png new file mode 100644 index 00000000..ecac72f4 Binary files /dev/null and b/assets/icons/icon_my_house.png differ diff --git a/assets/icons/icon_my_location.png b/assets/icons/icon_my_location.png new file mode 100644 index 00000000..60b86e52 Binary files /dev/null and b/assets/icons/icon_my_location.png differ diff --git a/assets/icons/icon_my_setting.png b/assets/icons/icon_my_setting.png new file mode 100644 index 00000000..aef63598 Binary files /dev/null and b/assets/icons/icon_my_setting.png differ diff --git a/assets/icons/icon_my_visitor.png b/assets/icons/icon_my_visitor.png new file mode 100644 index 00000000..826aa399 Binary files /dev/null and b/assets/icons/icon_my_visitor.png differ diff --git a/assets/icons/icon_property_location.png b/assets/icons/icon_property_location.png new file mode 100644 index 00000000..8bf3439f Binary files /dev/null and b/assets/icons/icon_property_location.png differ diff --git a/assets/icons/icon_property_message.png b/assets/icons/icon_property_message.png new file mode 100644 index 00000000..7c16346d Binary files /dev/null and b/assets/icons/icon_property_message.png differ diff --git a/assets/icons/icon_property_search.png b/assets/icons/icon_property_search.png new file mode 100644 index 00000000..46ef861a Binary files /dev/null and b/assets/icons/icon_property_search.png differ diff --git a/lib/const/resource.dart b/lib/const/resource.dart index bdfe4ac1..6f80dcd0 100644 --- a/lib/const/resource.dart +++ b/lib/const/resource.dart @@ -221,6 +221,78 @@ class R { static const String ASSETS_ICONS_FIRE_ALARM_PNG = 'assets/icons/fire_alarm.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_bmdh.png) + static const String ASSETS_ICONS_FUNC_BMDH_PNG = 'assets/icons/func_bmdh.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_bsbx.png) + static const String ASSETS_ICONS_FUNC_BSBX_PNG = 'assets/icons/func_bsbx.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_dlxx.png) + static const String ASSETS_ICONS_FUNC_DLXX_PNG = 'assets/icons/func_dlxx.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_dzsw.png) + static const String ASSETS_ICONS_FUNC_DZSW_PNG = 'assets/icons/func_dzsw.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_fkyq.png) + static const String ASSETS_ICONS_FUNC_FKYQ_PNG = 'assets/icons/func_fkyq.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_fwll.png) + static const String ASSETS_ICONS_FUNC_FWLL_PNG = 'assets/icons/func_fwll.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_gife.png) + static const String ASSETS_ICONS_FUNC_GIFE_PNG = 'assets/icons/func_gife.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_hdtp.png) + static const String ASSETS_ICONS_FUNC_HDTP_PNG = 'assets/icons/func_hdtp.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_jhgl.png) + static const String ASSETS_ICONS_FUNC_JHGL_PNG = 'assets/icons/func_jhgl.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_jyzx.png) + static const String ASSETS_ICONS_FUNC_JYZX_PNG = 'assets/icons/func_jyzx.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_jzfw.png) + static const String ASSETS_ICONS_FUNC_JZFW_PNG = 'assets/icons/func_jzfw.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_kdbg.png) + static const String ASSETS_ICONS_FUNC_KDBG_PNG = 'assets/icons/func_kdbg.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_kmm.png) + static const String ASSETS_ICONS_FUNC_KMM_PNG = 'assets/icons/func_kmm.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_shjf.png) + static const String ASSETS_ICONS_FUNC_SHJF_PNG = 'assets/icons/func_shjf.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_sqjs.png) + static const String ASSETS_ICONS_FUNC_SQJS_PNG = 'assets/icons/func_sqjs.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_ssyy.png) + static const String ASSETS_ICONS_FUNC_SSYY_PNG = 'assets/icons/func_ssyy.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_tsby.png) + static const String ASSETS_ICONS_FUNC_TSBY_PNG = 'assets/icons/func_tsby.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_wjdc.png) + static const String ASSETS_ICONS_FUNC_WJDC_PNG = 'assets/icons/func_wjdc.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_wpch.png) + static const String ASSETS_ICONS_FUNC_WPCH_PNG = 'assets/icons/func_wpch.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_yjbj.png) + static const String ASSETS_ICONS_FUNC_YJBJ_PNG = 'assets/icons/func_yjbj.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_ywh.png) + static const String ASSETS_ICONS_FUNC_YWH_PNG = 'assets/icons/func_ywh.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_zbqy.png) + static const String ASSETS_ICONS_FUNC_ZBQY_PNG = 'assets/icons/func_zbqy.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_zfsm.png) + static const String ASSETS_ICONS_FUNC_ZFSM_PNG = 'assets/icons/func_zfsm.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/func_zxgl.png) + static const String ASSETS_ICONS_FUNC_ZXGL_PNG = 'assets/icons/func_zxgl.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/goods_borrow.png) static const String ASSETS_ICONS_GOODS_BORROW_PNG = 'assets/icons/goods_borrow.png'; @@ -251,6 +323,10 @@ class R { static const String ASSETS_ICONS_ICON_CHANGE_LIST_PNG = 'assets/icons/icon_change_list.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_community_push.png) + static const String ASSETS_ICONS_ICON_COMMUNITY_PUSH_PNG = + 'assets/icons/icon_community_push.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_favor_choose.png) static const String ASSETS_ICONS_ICON_FAVOR_CHOOSE_PNG = 'assets/icons/icon_favor_choose.png'; @@ -302,6 +378,30 @@ class R { /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_more.png) static const String ASSETS_ICONS_ICON_MORE_PNG = 'assets/icons/icon_more.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_my_car.png) + static const String ASSETS_ICONS_ICON_MY_CAR_PNG = + 'assets/icons/icon_my_car.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_my_carSeat.png) + static const String ASSETS_ICONS_ICON_MY_CARSEAT_PNG = + 'assets/icons/icon_my_carSeat.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_my_house.png) + static const String ASSETS_ICONS_ICON_MY_HOUSE_PNG = + 'assets/icons/icon_my_house.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_my_location.png) + static const String ASSETS_ICONS_ICON_MY_LOCATION_PNG = + 'assets/icons/icon_my_location.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_my_setting.png) + static const String ASSETS_ICONS_ICON_MY_SETTING_PNG = + 'assets/icons/icon_my_setting.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_my_visitor.png) + static const String ASSETS_ICONS_ICON_MY_VISITOR_PNG = + 'assets/icons/icon_my_visitor.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_notification.png) static const String ASSETS_ICONS_ICON_NOTIFICATION_PNG = 'assets/icons/icon_notification.png'; @@ -310,6 +410,18 @@ class R { static const String ASSETS_ICONS_ICON_PRICE_PNG = 'assets/icons/icon_price.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_property_location.png) + static const String ASSETS_ICONS_ICON_PROPERTY_LOCATION_PNG = + 'assets/icons/icon_property_location.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_property_message.png) + static const String ASSETS_ICONS_ICON_PROPERTY_MESSAGE_PNG = + 'assets/icons/icon_property_message.png'; + + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_property_search.png) + static const String ASSETS_ICONS_ICON_PROPERTY_SEARCH_PNG = + 'assets/icons/icon_property_search.png'; + /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_setting.png) static const String ASSETS_ICONS_ICON_SETTING_PNG = 'assets/icons/icon_setting.png'; diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 24125f10..2ab624e6 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -325,6 +325,10 @@ class _Manager { String get surroundingEnterprises => '/user/surroundingEnterprises/list'; + ///生活缴费:查询未缴金额(日常缴费+公摊费) + String get findUnpaidAmount => + '/user/dailyPayment/findUnpaidAmount'; + } class _Community { @@ -376,6 +380,27 @@ class _Community { ///资讯轮播图 String get getSwiper => '/user/news/findNewsRotation'; + + ///查询热门资讯 + String get findHotNews => '/user/news/findHotNews'; + + ///资讯增加浏览量 + String get addViews => '/user/news/addViews'; + + ///查询最新的所有主题信息 + String get getGambitList => '/user/gambit/list'; + + ///查询最新的所有主题信息 详情 + String get gambitThemeDetail => '/user/gambit/GambitThemeDetail'; + + ///查询所有的话题(按热度排序) + String get listGambit => '/user/gambit/listGambit'; + + ///查询当前话题下,所有的主题信息 + String get listByGambitId => '/user/gambit/listByGambitId'; + + + } class _Market { diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index fbbf76d0..4b588991 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -70,34 +70,34 @@ class AO { List appObjects = [ // if (false) AO('一键开门', R.ASSETS_APPLICATIONS_OEPN_DOOR_PNG, () => Scaffold()), - AO('开门码', R.ASSETS_APPLICATIONS_DOOR_CODE_PNG, () => OpeningCodePage()), - AO('访客邀请', R.ASSETS_APPLICATIONS_VISITOR_INVITE_PNG, + AO('开门码', R.ASSETS_ICONS_FUNC_KMM_PNG, () => OpeningCodePage()), + AO('访客邀请', R.ASSETS_ICONS_FUNC_FKYQ_PNG, () => VisitorAccessPage()), - AO('报事报修', R.ASSETS_APPLICATIONS_FIX_PNG, () => FixedSubmitPage()), - AO('生活缴费', R.ASSETS_APPLICATIONS_PAYMENT_PNG, () => LifePayChoosePage()), - AO('业委会', R.ASSETS_APPLICATIONS_COMMITTEE_PNG, () => IndustryCommitteePage()), - AO('建议咨询', R.ASSETS_APPLICATIONS_ADVICE_PNG, + AO('报事报修', R.ASSETS_ICONS_FUNC_BSBX_PNG, () => FixedSubmitPage()), + AO('生活缴费', R.ASSETS_ICONS_FUNC_SHJF_PNG, () => LifePayChoosePage()), + AO('业委会', R.ASSETS_ICONS_FUNC_YWH_PNG, () => IndustryCommitteePage()), + AO('建议咨询', R.ASSETS_ICONS_FUNC_JYZX_PNG, () => AdvicePage(type: AdviceType.SUGGESTION)), - AO('便民电话', R.ASSETS_APPLICATIONS_COMMUNITY_PHONE_PNG, + AO('便民电话', R.ASSETS_ICONS_FUNC_BMDH_PNG, () => ConvenientPhonePage()), - AO('活动投票', R.ASSETS_APPLICATIONS_VOTE_PNG, () => EventVotingPage()), - AO('物品出门', R.ASSETS_APPLICATIONS_GOODS_OUT_PNG, () => GoodsDetoPage()), - AO('投诉表扬', R.ASSETS_APPLICATIONS_COMPLAINT_PNG, + AO('活动投票', R.ASSETS_ICONS_FUNC_HDTP_PNG, () => EventVotingPage()), + AO('物品出门', R.ASSETS_ICONS_FUNC_WPCH_PNG, () => GoodsDetoPage()), + AO('投诉表扬', R.ASSETS_ICONS_FUNC_TSBY_PNG, () => AdvicePage(type: AdviceType.COMPLAIN)), - AO('问卷调查', R.ASSETS_APPLICATIONS_QUESTION_PNG, () => QuestionnairePage()), - AO('装修管理', R.ASSETS_APPLICATIONS_DECORATION_PNG, () => NewRenovationPage()), - AO('借还管理', R.ASSETS_APPLICATIONS_BORROW_PNG, () => SelectBorrowReturnPage()), - AO('一键报警', R.ASSETS_APPLICATIONS_POLICE_PNG, () => AlarmPage()), - AO('设施预约', R.ASSETS_ICONS_TOOL_FACILITY_PNG, () => FacilityAppointmentPage()), - AO('快递包裹', R.ASSETS_APPLICATIONS_TRANSFER_PNG, () => ExpressPackagePage()), - AO('电子商务', R.ASSETS_ICONS_COMMERC_PNG, () => ElectronicCommercPage()), - AO('服务浏览', R.ASSETS_ICONS_SERVICE_PNG, () => ServiceBrowsePage()), - AO('社区介绍', R.ASSETS_ICONS_INTRODUCE_PNG, () => CommunityIntroducePage()), - AO('家政服务', R.ASSETS_ICONS_HOUSE_KEEPING_PNG, () => HouseKeepingPage()), - - AO('地理信息', R.ASSETS_ICONS_INTRODUCE_PNG, () => GeographicInformationPage()), - AO('周边企业', R.ASSETS_ICONS_HOUSE_KEEPING_PNG, () => SurroundingEnterprisesPage()), - AO('住房说明', R.ASSETS_ICONS_INTRODUCE_PNG, () => HouseIntroducePage()), + AO('问卷调查', R.ASSETS_ICONS_FUNC_WJDC_PNG, () => QuestionnairePage()), + AO('装修管理', R.ASSETS_ICONS_FUNC_ZXGL_PNG, () => NewRenovationPage()), + AO('借还管理', R.ASSETS_ICONS_FUNC_JHGL_PNG, () => SelectBorrowReturnPage()), + AO('一键报警', R.ASSETS_ICONS_FUNC_YJBJ_PNG, () => AlarmPage()), + AO('设施预约', R.ASSETS_ICONS_FUNC_SSYY_PNG, () => FacilityAppointmentPage()), + AO('快递包裹', R.ASSETS_ICONS_FUNC_KDBG_PNG, () => ExpressPackagePage()), + AO('电子商务', R.ASSETS_ICONS_FUNC_DZSW_PNG, () => ElectronicCommercPage()), + AO('服务浏览', R.ASSETS_ICONS_FUNC_FWLL_PNG, () => ServiceBrowsePage()), + AO('社区介绍', R.ASSETS_ICONS_FUNC_SQJS_PNG, () => CommunityIntroducePage()), + AO('家政服务', R.ASSETS_ICONS_FUNC_JZFW_PNG, () => HouseKeepingPage()), + + AO('地理信息', R.ASSETS_ICONS_FUNC_DLXX_PNG, () => GeographicInformationPage()), + AO('周边企业', R.ASSETS_ICONS_FUNC_ZBQY_PNG, () => SurroundingEnterprisesPage()), + AO('住房说明', R.ASSETS_ICONS_FUNC_ZFSM_PNG, () => HouseIntroducePage()), // AO( // '小区教育', @@ -235,11 +235,14 @@ List _residentLifeApp = [ '便民电话', '问卷调查', '建议咨询', - '活动投票', '设施预约', '借还管理', '业委会', '快递包裹', + '投诉表扬', + '活动投票', + '地理信息', + '周边企业', ]; ///居民生活 diff --git a/lib/model/community/gambit_model.dart b/lib/model/community/gambit_model.dart new file mode 100644 index 00000000..0d42b931 --- /dev/null +++ b/lib/model/community/gambit_model.dart @@ -0,0 +1,46 @@ +import 'package:aku_community/model/common/img_model.dart'; + +class GambitModel { + int? id; + String? title; + String? summary; + String? content; + List? imgUrl; + int? activityNum; + + GambitModel( + {this.id, + this.title, + this.summary, + this.content, + this.imgUrl, + this.activityNum}); + + GambitModel.fromJson(Map json) { + id = json['id']; + title = json['title']; + summary = json['summary']; + content = json['content']; + if (json['imgUrl'] != null) { + imgUrl = []; + json['imgUrl'].forEach((v) { + imgUrl!.add(new ImgModel.fromJson(v)); + }); + } else + imgUrl = []; + activityNum = json['activityNum']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['title'] = this.title; + data['summary'] = this.summary; + data['content'] = this.content; + if (this.imgUrl != null) { + data['imgUrl'] = this.imgUrl!.map((v) => v.toJson()).toList(); + } + data['activityNum'] = this.activityNum; + return data; + } +} \ No newline at end of file diff --git a/lib/model/community/hot_news_model.dart b/lib/model/community/hot_news_model.dart new file mode 100644 index 00000000..22479896 --- /dev/null +++ b/lib/model/community/hot_news_model.dart @@ -0,0 +1,38 @@ +import 'package:aku_community/model/common/img_model.dart'; + +class HotNewsModel { + int? id; + String? title; + String? createDate; + int? views; + List? imgList; + + HotNewsModel( + {this.id, this.title, this.createDate, this.views, this.imgList}); + + HotNewsModel.fromJson(Map json) { + id = json['id']; + title = json['title']; + createDate = json['createDate']; + views = json['views']; + if (json['imgList'] != null) { + imgList = []; + json['imgList'].forEach((v) { + imgList!.add(new ImgModel.fromJson(v)); + }); + } else + imgList = []; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['title'] = this.title; + data['createDate'] = this.createDate; + data['views'] = this.views; + if (this.imgList != null) { + data['imgList'] = this.imgList!.map((v) => v.toJson()).toList(); + } + return data; + } +} \ No newline at end of file diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index e40ce90b..41257453 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -51,12 +51,12 @@ class _PersonalIndexState extends State right: 0, bottom: 0, child: Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage(R.ASSETS_IMAGES_MINE_BG_PNG), - fit: BoxFit.cover, - ), - ), + // decoration: BoxDecoration( + // image: DecorationImage( + // image: AssetImage(R.ASSETS_ICONS_ICON_MY_SETTING_PNG), + // fit: BoxFit.cover, + // ), + // ), child: Column( children: [ Spacer(), @@ -403,10 +403,10 @@ class _PersonalIndexState extends State width: 72.w, height: 40.w, alignment: Alignment.center, - child: Image.asset(R.ASSETS_ICONS_ICON_SETTING_PNG,width: 40.w,height: 40.w), + child: Image.asset(R.ASSETS_ICONS_ICON_MY_SETTING_PNG,width: 40.w,height: 40.w), ), ), - // 32.wb, + 24.wb, ], ), @@ -586,15 +586,18 @@ class _PersonalIndexState extends State child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - _function('我的房屋', R.ASSETS_ICONS_USER_ICON_WDFW_PNG, () => HouseOwnersPage( + _function('我的房屋', R.ASSETS_ICONS_ICON_MY_HOUSE_PNG, () => HouseOwnersPage( identify: UserTool.userProvider.userDetailModel!.type ?? 4, - ),userProvider.userDetailModel!.estateNames?[0]??'',), + ),userProvider.userDetailModel!.estateNames!.isEmpty?'': userProvider.userDetailModel!.estateNames?[0]??'',), 36.hb, - _function('我的车位', R.ASSETS_ICONS_USER_ICON_WDCW_PNG, () => CarParkingPage(),'B区N392号'), + _function('我的车位', R.ASSETS_ICONS_ICON_MY_CARSEAT_PNG, () => CarParkingPage(),''), 36.hb, - _function('我的车', R.ASSETS_ICONS_USER_ICON_WDC_PNG, () => CarManagePage(),'浙999999'), + _function('我的车', R.ASSETS_ICONS_ICON_MY_CAR_PNG, () => CarManagePage(),''), 36.hb, - _myVisitor() + _function('我的访客', R.ASSETS_ICONS_ICON_MY_VISITOR_PNG, () => CarManagePage(),''), + 36.hb, + _function('收获地址设置', R.ASSETS_ICONS_ICON_MY_LOCATION_PNG, () => CarManagePage(),''), + // // ApplicationView.custom( // items: userAppObjects, @@ -641,142 +644,40 @@ class _PersonalIndexState extends State } _function( String title ,String path,dynamic page ,String msg,){ - return Row( - children: [ - Image.asset(path,width: 40.w,height: 40.w,fit:BoxFit.fitHeight,), - 16.wb, - Text( - title, - style: TextStyle( - fontSize: 28.sp, - color: Colors.black.withOpacity(0.85), + return GestureDetector( + onTap: (){ + Get.to(page); + }, + child: Row( + children: [ + Image.asset(path,width: 40.w,height: 40.w,fit:BoxFit.fitHeight,), + 16.wb, + Text( + title, + style: TextStyle( + fontSize: 28.sp, + color: Colors.black.withOpacity(0.85), + ), ), - ), - Spacer(), - Text( - msg, - style: TextStyle( - fontSize: 24.sp, - color: Colors.black.withOpacity(0.45), + Spacer(), + Text( + msg, + style: TextStyle( + fontSize: 24.sp, + color: Colors.black.withOpacity(0.45), + ), ), - ), - 24.wb, - Icon( - CupertinoIcons.chevron_forward, - size: 24.w, - color: Color(0xFF999999), - ), - ], - ); - } - _myVisitor(){ - final userProvider = Provider.of(context); - return Row( - children: [ - Text( - '我的访客', - style: TextStyle( - fontSize: 28.sp, - color: Colors.black.withOpacity(0.85), + 24.wb, + Icon( + CupertinoIcons.chevron_forward, + size: 24.w, + color: Color(0xFF999999), ), - ), - Spacer(), - Container( - width: 110.w, - height: 40.w, - child: Stack( - children: [ - Positioned( - - child: Hero( - tag: 'AVATAR4', - child: ClipOval( - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(userProvider - .userInfoModel!.imgUrls.isNotEmpty - ? userProvider - .userInfoModel!.imgUrls.first.url - : ''), - height: 40.w, - width: 40.w, - fit: BoxFit.cover, - imageErrorBuilder: (context, error, stackTrace) { - return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,height: 40.w, - width: 40.w,); - }, - ), - ), - ), - top: 0, - bottom: 0, - right: 0, - ), - Positioned( - - child: Hero( - tag: 'AVATAR5', - child: ClipOval( - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(userProvider - .userInfoModel!.imgUrls.isNotEmpty - ? userProvider - .userInfoModel!.imgUrls.first.url - : ''), - height: 40.w, - width: 40.w, - fit: BoxFit.cover, - imageErrorBuilder: (context, error, stackTrace) { - return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,height: 106.w, - width: 106.w,); - }, - ), - ), - ), - top: 0, - bottom: 0, - right: 15, - ), - Positioned( - - child: Hero( - tag: 'AVATAR6', - child: ClipOval( - child: FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: API.image(userProvider - .userInfoModel!.imgUrls.isNotEmpty - ? userProvider - .userInfoModel!.imgUrls.first.url - : ''), - height: 40.w, - width: 40.w, - fit: BoxFit.cover, - imageErrorBuilder: (context, error, stackTrace) { - return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP,height: 106.w, - width: 106.w,); - }, - ), - ), - ), - top: 0, - bottom: 0, - right: 30, - ), - ], - ) - ), - - 24.wb, - Icon( - CupertinoIcons.chevron_forward, - size: 24.w, - color: Color(0xFF999999), - ), - ], + ], + ), ); } + @override bool get wantKeepAlive => true; } diff --git a/lib/pages/property/property_func.dart b/lib/pages/property/property_func.dart new file mode 100644 index 00000000..458155a7 --- /dev/null +++ b/lib/pages/property/property_func.dart @@ -0,0 +1,40 @@ + +import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/models/market/goods_item.dart'; +import 'package:aku_community/models/market/order/order_detail_model.dart'; +import 'package:aku_community/models/search/search_goods_model.dart'; +import 'package:aku_community/utils/network/base_list_model.dart'; +import 'package:aku_community/utils/network/base_model.dart'; +import 'package:aku_community/utils/network/net_util.dart'; +import 'package:aku_community/utils/text_utils.dart'; +import 'package:aku_community/widget/others/user_tool.dart'; + +class PropertyFunc { + + ///根据房产id查询对应的预付款充值金额 + static Future getDailyPaymentPrePay() async { + BaseModel baseModel = + await NetUtil().get(API.manager.dailyPaymentPrePay, params: { + "estateId": UserTool.appProveider.selectedHouse!.estateId, + }); + if (baseModel.status ?? false) { + return (baseModel.data as num).toDouble(); + } else { + return 0; + } + } + + ///根据房产id查询对应的未缴费金额 + static Future getFindUnpaidAmount() async { + BaseModel baseModel = + await NetUtil().get(API.manager.findUnpaidAmount, params: { + "estateId": UserTool.appProveider.selectedHouse!.estateId, + }); + if (baseModel.status ?? false) { + return (baseModel.data as num).toDouble(); + } else { + return 0; + } + } + +} diff --git a/lib/pages/property/property_page.dart b/lib/pages/property/property_page.dart index 9c4db894..6ffe763c 100644 --- a/lib/pages/property/property_page.dart +++ b/lib/pages/property/property_page.dart @@ -1,18 +1,24 @@ import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/const/resource.dart'; import 'package:aku_community/constants/application_objects.dart'; +import 'package:aku_community/pages/life_pay/life_pay_choose_page.dart'; import 'package:aku_community/pages/message_center_page/message_center_page.dart'; import 'package:aku_community/pages/personal/user_profile_page.dart'; +import 'package:aku_community/pages/property/property_func.dart'; import 'package:aku_community/pages/sign/sign_in_page.dart'; import 'package:aku_community/painters/user_bottom_bar_painter.dart'; import 'package:aku_community/provider/app_provider.dart'; import 'package:aku_community/provider/user_provider.dart'; +import 'package:aku_community/ui/profile/house/add_house_page.dart'; +import 'package:aku_community/ui/profile/house/house_owners_page.dart'; import 'package:aku_community/ui/profile/order/order_page.dart'; import 'package:aku_community/ui/search/bee_search.dart'; import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/login_util.dart'; +import 'package:aku_community/widget/others/user_tool.dart'; import 'package:aku_community/widget/views/application_view.dart'; import 'package:badges/badges.dart'; +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; @@ -20,7 +26,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; - class PropertyPage extends StatefulWidget { final bool? isSign; @@ -35,15 +40,15 @@ class _PropertyPageState extends State int sum = 0; int commentCount = 0; int sysCount = 0; + num unpaid = 0; + num paid = 0; late TabController _tabController; @override void initState() { super.initState(); - - _tabController = TabController( - initialIndex: 0, length: 2, vsync: this); - + _getRefresh(); + _tabController = TabController(initialIndex: 0, length: 2, vsync: this); } @override @@ -52,6 +57,14 @@ class _PropertyPageState extends State super.dispose(); } + _getRefresh(){ + Future.delayed(Duration(milliseconds: 0), () async { + paid = await PropertyFunc.getDailyPaymentPrePay(); + unpaid = await PropertyFunc.getFindUnpaidAmount(); + setState(() {}); + }); + } + SliverAppBar _sliverAppBar(double height) { final userProvider = Provider.of(context); AppProvider appProvider = Provider.of(context); @@ -63,7 +76,7 @@ class _PropertyPageState extends State snap: false, //toolbarHeight: 0, elevation: 0, - collapsedHeight:420.w, + collapsedHeight: 420.w, titleSpacing: 10.0, floating: true, title: Row( @@ -72,19 +85,21 @@ class _PropertyPageState extends State children: [ if (appProvider.location != null) Padding( - padding: EdgeInsets.only(right: 5), + padding: EdgeInsets.only(right: 5), child: Image.asset( - R.ASSETS_ICONS_ICON_MAIN_LOCATION_PNG, - width: 32.w, - height: 32.w, + R.ASSETS_ICONS_ICON_PROPERTY_LOCATION_PNG, + width: 40.w, + height: 40.w, ), ), Text( - appProvider.location?['city']==null?'':appProvider.location?['city'] as String? ?? '', + appProvider.location?['city'] == null + ? '' + : appProvider.location?['city'] as String? ?? '', style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 24.sp, - color: Color(0xff333333), + fontWeight: FontWeight.w500, + fontSize: 32.sp, + color: Colors.white.withOpacity(0.85), ), textAlign: TextAlign.center, ), @@ -94,11 +109,11 @@ class _PropertyPageState extends State onTap: () { Get.to(() => BeeSearch()); }, - child: Image.asset(R.ASSETS_ICONS_ICON_MAIN_FIND_PNG, + child: Image.asset(R.ASSETS_ICONS_ICON_PROPERTY_SEARCH_PNG, height: 40.w, width: 40.w), ), Padding( - padding: EdgeInsets.only(right: 10.w, left: 12.w), + padding: EdgeInsets.only(right: 10.w, left: 12.w), child: Badge( elevation: 0, badgeColor: Color(0xFFCF2525), @@ -118,7 +133,7 @@ class _PropertyPageState extends State if (LoginUtil.isNotLogin) return; Get.to(() => MessageCenterPage()); }, - child: Image.asset(R.ASSETS_ICONS_ICON_MAIN_MESSAGE_PNG, + child: Image.asset(R.ASSETS_ICONS_ICON_PROPERTY_MESSAGE_PNG, height: 40.w, width: 40.w), )), ), @@ -128,84 +143,86 @@ class _PropertyPageState extends State flexibleSpace: Stack( children: [ Positioned( - child: Container( - color: Color(0xF9D57A59), - height: 503.w, + child: Image.asset( + R.ASSETS_IMAGES_PROPERTY_BG_PNG, width: double.infinity, + height: 503.w, + fit: BoxFit.cover, ), - // Image( - // fit: BoxFit.cover, - // image: NetworkImage( - // "https://images.pexels.com/photos/62389/pexels-photo-62389.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260", - // ), - // ), + + top: 0, left: 0, right: 0, bottom: 0), - // Positioned( - // child: Container( - // height: 30, - // decoration: BoxDecoration( - // color: Colors.white, - // borderRadius: BorderRadius.vertical( - // top: Radius.circular(50), - // ), - // ), - // ), - // bottom: -1, - // left: 0, - // right: 0, - // ), Positioned( - child: Container( - margin: EdgeInsets.only(left: 32.w,right: 32.w), - width: 686.w, - height: 74.w, - decoration: BoxDecoration( - color: Colors.black.withOpacity(0.25), - borderRadius: BorderRadius.all( - Radius.circular(8.w), - ), + child: Container( + margin: EdgeInsets.only(left: 32.w, right: 32.w), + width: 686.w, + height: 74.w, + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.25), + borderRadius: BorderRadius.all( + Radius.circular(8.w), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - 24.wb, - Text('当前绑定房屋',style: TextStyle(fontSize: 28.sp,color: Colors.white.withOpacity(0.85),height: 1.00),), - Spacer(), - Text('B栋2单元1803室',style: TextStyle(fontSize: 28.sp,color: Colors.white.withOpacity(0.85),height:1.00,fontWeight: FontWeight.bold),), - 32.wb, - GestureDetector( - onTap: (){ - - }, - child: Container( - alignment: Alignment.center, - width: 80.w, - height: 42.w, - child:Text('切换',style: TextStyle(fontSize: 24.sp,color: Colors.white.withOpacity(0.85)),), - decoration: BoxDecoration( - color: Color(0xFF3D8CE8), - borderRadius: BorderRadius.all( - Radius.circular(8.w), - ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + 24.wb, + Text( + '当前绑定房屋', + style: TextStyle( + fontSize: 28.sp, + color: Colors.white.withOpacity(0.85), + height: 1.00), + ), + Spacer(), + Text( + userProvider.userDetailModel!.estateNames!.isEmpty?'暂未绑定': userProvider.userDetailModel!.estateNames?[0]??'暂未绑定', + style: TextStyle( + fontSize: 28.sp, + color: Colors.white.withOpacity(0.85), + height: 1.00, + fontWeight: FontWeight.bold), + ), + 32.wb, + GestureDetector( + onTap: () { + Get.to(HouseOwnersPage( + identify: UserTool.userProvider.userDetailModel!.type ?? 4, + )); + + }, + child: Container( + alignment: Alignment.center, + width: 80.w, + height: 42.w, + child: Text( + '切换', + style: TextStyle( + fontSize: 24.sp, + color: Colors.white.withOpacity(0.85)), + ), + decoration: BoxDecoration( + color: Color(0xFF3D8CE8), + borderRadius: BorderRadius.all( + Radius.circular(8.w), ), ), ), - 24.wb, - - ], - ), + ), + 24.wb, + ], ), - top: kTextTabBarHeight+50.w, - left: 0, - right: 0, - ), - + ), + top: kTextTabBarHeight + 50.w, + left: 0, + right: 0, + ), Positioned( child: _goodsTitle(), - top: kTextTabBarHeight+50.w+94.w, + top: kTextTabBarHeight + 50.w + 94.w, left: 0, right: 0, ), @@ -213,28 +230,24 @@ class _PropertyPageState extends State child: Container( padding: EdgeInsets.only(top: 20.w), height: 150.w, - child: TabBarView( - children: [_payView(true),_payView(false)], + children: [_payView(true), _payView(false)], controller: _tabController, physics: NeverScrollableScrollPhysics(), ), ), - top: kTextTabBarHeight+50.w+94.w+60.w, + top: kTextTabBarHeight + 50.w + 94.w + 60.w, left: 0, right: 0, ), ], ), - - ); } - - _payView(bool pay){ + _payView(bool pay) { return Container( - padding: EdgeInsets.only(left: 36.w,right: 36.w), + padding: EdgeInsets.only(left: 36.w, right: 36.w), width: double.infinity, height: 150.w, child: Row( @@ -245,7 +258,7 @@ class _PropertyPageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - '1,944.00', + pay?paid.toStringAsFixed(2):unpaid.toStringAsFixed(2), style: TextStyle( color: Color(0xFFFFFFFF).withOpacity(0.85), fontSize: 40.sp, @@ -262,15 +275,34 @@ class _PropertyPageState extends State ], ), Spacer(), - Container( - alignment: Alignment.center, - width: 160.w, - height: 55.w, - child:Text(!pay?'一键缴费':'点击充值',style: TextStyle(fontSize: 24.sp,color: Colors.white.withOpacity(0.85)),), - decoration: BoxDecoration( - color: Color(0xFFFFB634), - borderRadius: BorderRadius.all( - Radius.circular(8.w), + GestureDetector( + onTap: () async{ + final appProvider = Provider.of(Get.context!, listen: false); + if (appProvider.selectedHouse == null) { + BotToast.showText(text: '请先添加房屋'); + Get.to(() => AddHousePage()); + + }else{ + bool? result = await Get.to(() => LifePayChoosePage()); + if (result == true) _getRefresh(); + } + + }, + child: Container( + alignment: Alignment.center, + width: 160.w, + height: 55.w, + child: Text( + !pay ? '缴纳账单' : '点击充值', + style: TextStyle( + fontSize: 24.sp, color: Colors.white.withOpacity(0.85)), + ), + decoration: BoxDecoration( + color: Color(0xFFFFC257), + + borderRadius: BorderRadius.all( + Radius.circular(8.w), + ), ), ), ), @@ -279,68 +311,64 @@ class _PropertyPageState extends State ); } - _goodsTitle(){ + _goodsTitle() { return Row( - children: [ - 24.wb, - Container( - height: 60.w, - child: Material( - color: Colors.transparent, - child: TabBar( - onTap: (index) { - // _presenter.fetchList(_category.id, 0, _sortType); - setState(() {}); - }, - isScrollable: true, - labelPadding: EdgeInsets.zero, - - controller: _tabController, - labelColor: Colors.white.withOpacity(0.85), - unselectedLabelColor: Colors.white.withOpacity(0.65), - - indicatorPadding: EdgeInsets.symmetric(horizontal: 40.w), - indicatorSize: TabBarIndicatorSize.label, - - labelStyle: TextStyle(color:Colors.white.withOpacity(0.85),), - - indicatorColor: Color(0xFFE8A93A), - tabs: _tabItems()), - ), - ), - Spacer(), - Container( + children: [ + 24.wb, + Container( + height: 60.w, + child: Material( color: Colors.transparent, - child: Row( - children: [ - Text( - '缴费记录', - style: TextStyle( - color: Colors.white.withOpacity(0.45), - fontSize: 24.sp, - ), + child: TabBar( + onTap: (index) { + // _presenter.fetchList(_category.id, 0, _sortType); + setState(() {}); + }, + isScrollable: true, + labelPadding: EdgeInsets.zero, + controller: _tabController, + labelColor: Colors.white.withOpacity(0.85), + unselectedLabelColor: Colors.white.withOpacity(0.65), + indicatorPadding: EdgeInsets.symmetric(horizontal: 40.w), + indicatorSize: TabBarIndicatorSize.label, + labelStyle: TextStyle( + color: Colors.white.withOpacity(0.85), ), - 10.wb, - Icon( - CupertinoIcons.chevron_forward, - size: 24.w, + indicatorColor: Color(0xFFE8A93A), + tabs: _tabItems()), + ), + ), + Spacer(), + Container( + color: Colors.transparent, + child: Row( + children: [ + Text( + '缴费记录', + style: TextStyle( color: Colors.white.withOpacity(0.45), + fontSize: 24.sp, ), - ], - ), + ), + 10.wb, + Icon( + CupertinoIcons.chevron_forward, + size: 24.w, + color: Colors.white.withOpacity(0.45), + ), + ], ), - - 36.wb, - ], - ); - + ), + 36.wb, + ], + ); } List _tabItems() { - return [_tabItem(0,'未缴账单'),_tabItem(1,'预缴金额')]; + return [_tabItem(0, '未缴账单'), _tabItem(1, '预缴金额')]; } - _tabItem(int index,String text) { + _tabItem(int index, String text) { bool isChoose = index == _tabController.index; // Color textColor = index == _tabController.index // ? getCurrentThemeColor() @@ -359,9 +387,11 @@ class _PropertyPageState extends State Text( text, style: TextStyle( - fontWeight: isChoose?FontWeight.bold:FontWeight.normal, - fontSize: isChoose?32.sp:28.sp, - color: isChoose?Colors.white.withOpacity(0.85):Colors.white.withOpacity(0.65)), + fontWeight: isChoose ? FontWeight.bold : FontWeight.normal, + fontSize: isChoose ? 32.sp : 28.sp, + color: isChoose + ? Colors.white.withOpacity(0.85) + : Colors.white.withOpacity(0.65)), ), ], ), @@ -456,7 +486,6 @@ class _PropertyPageState extends State ), ); return Scaffold( - body: EasyRefresh( header: MaterialHeader(), onRefresh: () async { @@ -469,16 +498,19 @@ class _PropertyPageState extends State // orderWidget, SliverToBoxAdapter( - child: _getFunctionView(getOutApp,'出行安全',Color(0xFFFAC058)), + child: _getFunctionView(getOutApp, '出行安全', Color(0xFFFAC058)), ), SliverToBoxAdapter( - child: _getFunctionView(propertyServicesApp,'物业服务',Color(0xFF58FA8F)), + child: _getFunctionView( + propertyServicesApp, '物业服务', Color(0xFF58FA8F)), ), SliverToBoxAdapter( - child: _getFunctionView(residentLifeApp,'居民生活',Color(0xFF58C0FA)), + child: + _getFunctionView(residentLifeApp, '居民生活', Color(0xFF58C0FA)), ), SliverToBoxAdapter( - child: _getFunctionView(aboutCommunityApp,'关于社区',Color(0xFFFA5858)), + child: _getFunctionView( + aboutCommunityApp, '关于社区', Color(0xFFFA5858)), ), ], ), @@ -486,9 +518,9 @@ class _PropertyPageState extends State ); } - _getFunctionView(List item,String title,Color color){ + _getFunctionView(List item, String title, Color color) { return Container( - margin: EdgeInsets.only(left: 32.w,right: 32.w,top: 32.w), + margin: EdgeInsets.only(left: 32.w, right: 32.w, top: 32.w), decoration: BoxDecoration( color: Color(0xffffffff), borderRadius: BorderRadius.all(Radius.circular(8)), @@ -500,7 +532,7 @@ class _PropertyPageState extends State ], ), //margin: EdgeInsets.all(20.w), - padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 24.w), + padding: EdgeInsets.only(left: 32.w, right: 32.w, top: 24.w), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -511,7 +543,6 @@ class _PropertyPageState extends State Row( //crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( margin: EdgeInsets.only(top: 6.w), width: 4.w, @@ -529,26 +560,22 @@ class _PropertyPageState extends State ], ), ) - - ], ), ); } - _getTitle(String title){ - return Text( - title, + _getTitle(String title) { + return Text( + title, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 28.sp, color: ktextPrimary, - ), ); } @override bool get wantKeepAlive => true; - } diff --git a/lib/ui/community/community_func.dart b/lib/ui/community/community_func.dart index 8f7566b2..b83f7ac5 100644 --- a/lib/ui/community/community_func.dart +++ b/lib/ui/community/community_func.dart @@ -1,6 +1,8 @@ import 'package:aku_community/constants/api.dart'; import 'package:aku_community/model/community/activity_item_model.dart'; import 'package:aku_community/model/community/board_model.dart'; +import 'package:aku_community/model/community/gambit_model.dart'; +import 'package:aku_community/model/community/hot_news_model.dart'; import 'package:aku_community/model/community/swiper_model.dart'; import 'package:aku_community/models/market/goods_classification.dart'; import 'package:aku_community/models/market/goods_popular_model.dart'; @@ -11,6 +13,41 @@ import 'package:aku_community/utils/network/net_util.dart'; class CommunityFunc { + + ///查询热门话题 + static Future> getListGambit() async { + BaseListModel model = await NetUtil().getList( + API.community.listGambit, + params: {'pageNum': 1, 'size': 6}, + ); + if (model.tableList!.length == 0) return []; + return model.tableList!.map((e) => GambitModel.fromJson(e)).toList(); + } + + ///查询热门资讯 + static Future> getHotNews() async { + BaseListModel model = await NetUtil().getList( + API.community.findHotNews, + params: {'pageNum': 1, 'size': 4}, + ); + if (model.tableList!.length == 0) return []; + return model.tableList!.map((e) => HotNewsModel.fromJson(e)).toList(); + } + + ///给单个资讯增加浏览量 + static Future addViews(int newsId) async { + BaseModel model = await NetUtil().get( + API.community.addViews, + params: {'newsId': newsId,}, + showMessage: true, + ); + if (model.message == null) + return ''; + return (model.message as String).toString(); + } + + + ///查询当天上架的商品数量 static Future getNewProductsTodayNum() async { BaseModel model = await NetUtil().get( diff --git a/lib/ui/community/community_views/community_page.dart b/lib/ui/community/community_views/community_page.dart index de503e04..8dbea77b 100644 --- a/lib/ui/community/community_views/community_page.dart +++ b/lib/ui/community/community_views/community_page.dart @@ -1,7 +1,11 @@ import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/model/common/img_model.dart'; import 'package:aku_community/model/community/event_item_model.dart'; +import 'package:aku_community/model/community/gambit_model.dart'; +import 'package:aku_community/model/community/hot_news_model.dart'; import 'package:aku_community/ui/community/activity/activity_list_page.dart'; +import 'package:aku_community/ui/community/community_func.dart'; import 'package:aku_community/ui/community/community_views/widgets/chat_card.dart'; import 'package:aku_community/ui/home/home_title.dart'; import 'package:aku_community/ui/market/search/search_goods_page.dart'; @@ -25,6 +29,7 @@ import 'package:aku_community/ui/community/community_views/new_community_view.da import 'package:aku_community/ui/community/community_views/topic/topic_community_view.dart'; import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/login_util.dart'; +import 'dart:math'; import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/buttons/column_action_button.dart'; import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart'; @@ -48,6 +53,8 @@ class _CommunityPageState extends State List _newItems = []; + List _gambitModels = []; + List _hotNewsModels = []; int _pageNum = 1; int _size = 4; @@ -83,19 +90,8 @@ class _CommunityPageState extends State appBar: AppBar( titleSpacing: 10.0, title: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ - if (appProvider.location != null) - Padding( - padding: const EdgeInsets.only(right: 5), - child: Image.asset( - R.ASSETS_ICONS_ICON_MAIN_LOCATION_PNG, - width: 32.w, - height: 32.w, - ), - ), Text( - appProvider.location?['city'] == null - ? '' - : appProvider.location?['city'] as String? ?? '', + '附近社区', style: TextStyle( fontWeight: FontWeight.w600, fontSize: 24.sp, @@ -103,34 +99,17 @@ class _CommunityPageState extends State ), textAlign: TextAlign.center, ), - Text( - '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)', - style: TextStyle( - fontSize: 24.sp, - color: Color(0xff999999), - ), - textAlign: TextAlign.center, - ), + ]), backgroundColor: Colors.white, actions: [ - Badge( - elevation: 0, - showBadge: appProvider.messageCenterModel.commentCount != 0 || - appProvider.messageCenterModel.sysCount != 0, - position: BadgePosition.topEnd( - top: 8, - end: 8, - ), - child: ColumnActionButton( - onPressed: () { - if (LoginUtil.isNotLogin) return; - Get.to(() => MessageCenterPage()); - }, - title: '消息', - path: R.ASSETS_ICONS_ALARM_PNG, - ), - ), + GestureDetector( + onTap: () { + + }, + child: Image.asset(R.ASSETS_ICONS_ICON_COMMUNITY_PUSH_PNG, + height: 40.w, width: 40.w), + ) ], bottom: PreferredSize( preferredSize: Size.fromHeight(90.w), child: _geSearch()), @@ -165,6 +144,8 @@ class _CommunityPageState extends State controller: _easyRefreshController, onRefresh: () async { await (getNewInfo()); + _gambitModels = await CommunityFunc.getListGambit(); + _hotNewsModels = await CommunityFunc.getHotNews(); _onload = false; setState(() {}); }, @@ -173,7 +154,7 @@ class _CommunityPageState extends State : ListView( children: [ 2.hb, - _getInfo(), + _hotNewsModels.isEmpty?SizedBox():_getInfo(), 16.hb, _getNews(), 16.hb, @@ -262,12 +243,12 @@ class _CommunityPageState extends State width: 396.w, child: Builder( builder: (context) { - return _infoCard(); + return _infoCard(_hotNewsModels[index]); }, ), ); }, - itemCount: 3, + itemCount: _hotNewsModels.length, ), ), ], @@ -299,58 +280,108 @@ class _CommunityPageState extends State ); } - _infoCard() { - return Container( - width: 396.w, - height: 204.w, - padding: - EdgeInsets.only(top: 32.w, left: 40.w, right: 40.w, bottom: 32.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.horizontal( - right: Radius.circular(12), - left: Radius.circular(16), - ), - color: Colors.black38, - ), - child: Column( + + _next(int min, int max) { + var rng = new Random(); +//将 参数min + 取随机数(最大值范围:参数max - 参数min)的结果 赋值给变量 result; + var result = min + rng.nextInt(max - min); +//返回变量 result 的值; + return result; + } + + _infoCard(HotNewsModel item) { + + return GestureDetector( + onTap: (){ + + }, + child: Stack( children: [ Container( - width: 316.w, - alignment: Alignment.center, - child: Text( - '肖生克的救赎到底在讲人性的还是在激励人在困...', - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.white.withOpacity(0.85), - fontSize: 28.sp, - fontWeight: FontWeight.bold), - ) - ), - 24.hb, - Row( - children: [ - Text( - '271.8w浏览', - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.white.withOpacity(0.85), - fontSize: 24.sp, - ), + width: 396.w, + height: 204.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.horizontal( + right: Radius.circular(12), + left: Radius.circular(16), ), - Spacer(), - Text( - '01-03', - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Colors.white.withOpacity(0.85), - fontSize: 24.sp, + image: DecorationImage( + image: NetworkImage( + API.image(ImgModel.first(item.imgList)), ), - ) - ], - ) + fit: BoxFit.cover, + ), + //color: Colors.black38, + ), + + + ), + Positioned( + top: 0, + bottom: 0, + left: 0, + right: 0, + child: Container( + alignment: Alignment.center, + width: 396.w, + height: 204.w, + padding: + EdgeInsets.only(top: 32.w, left: 40.w, right: 40.w, bottom: 32.w), + decoration: BoxDecoration( + color: Colors.black.withOpacity(0.5), + borderRadius: BorderRadius.horizontal( + right: Radius.circular(12), + left: Radius.circular(16), + ), //color: Colors.black38, + ), + child: + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 316.w, + alignment: Alignment.center, + child: Text( + item.title??'', + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.white.withOpacity(0.85), + fontSize: 28.sp, + fontWeight: FontWeight.bold), + ) + ), + 24.hb, + Row( + children: [ + Text( + '${item.views??0}浏览', + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.white.withOpacity(0.85), + fontSize: 24.sp, + ), + ), + Spacer(), + Text( + item.createDate?.substring(0,10)??'', + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.white.withOpacity(0.85), + fontSize: 24.sp, + ), + ) + ], + ) + ], + + + + ), + ), + ), ], ), ); @@ -386,7 +417,7 @@ class _CommunityPageState extends State minWidth: double.infinity, color: Color(0xFFF3F3F3), onPressed: () { - Get.to(() => SearchGoodsPage()); + //Get.to(() => SearchGoodsPage()); }, child: Row( children: [ diff --git a/lib/widget/views/application_view.dart b/lib/widget/views/application_view.dart index c0503726..e946495f 100644 --- a/lib/widget/views/application_view.dart +++ b/lib/widget/views/application_view.dart @@ -43,7 +43,7 @@ class _ApplicationViewState extends State { width: 75.w, ), 8.hb, - object.title.text.size(24.sp).bold.make(), + object.title.text.size(24.sp).make(), ], ), );