Merge branches 'master' and 'master' of https://git.oa00.com/bee/aku_community

hmxc
张萌 3 years ago
commit a49c394648

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -91,6 +91,10 @@ class R {
static const String ASSETS_APPLICATIONS_TOY_PNG =
'assets/applications/toy.png';
/// ![preview](file:///Users/akufe/Documents/aku_community/assets/applications/transfer.png)
static const String ASSETS_APPLICATIONS_TRANSFER_PNG =
'assets/applications/transfer.png';
/// ![preview](file:///Users/akufe/Documents/aku_community/assets/applications/visitor_invite.png)
static const String ASSETS_APPLICATIONS_VISITOR_INVITE_PNG =
'assets/applications/visitor_invite.png';

@ -56,8 +56,8 @@ class AO extends Equatable {
///
List<AO> appObjects = [
if (false) AO('一键开门', R.ASSETS_APPLICATIONS_OEPN_DOOR_PNG, () => Scaffold()),
if (false)
AO('开门码', R.ASSETS_APPLICATIONS_DOOR_CODE_PNG, () => OpeningCodePage()),
AO('开门码', R.ASSETS_APPLICATIONS_DOOR_CODE_PNG, () => OpeningCodePage()),
AO('访客邀请', R.ASSETS_APPLICATIONS_VISITOR_INVITE_PNG,
() => VisitorAccessPage()),
AO('报事报修', R.ASSETS_APPLICATIONS_FIX_PNG, () => FixedSubmitPage()),
@ -76,7 +76,7 @@ List<AO> appObjects = [
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_IMAGES_PLACEHOLDER_WEBP, () => ExpressPackagePage()),
AO('快递包裹', R.ASSETS_APPLICATIONS_TRANSFER_PNG, () => ExpressPackagePage()),
// AO(
// '小区教育',
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
@ -135,7 +135,7 @@ List<AO> get recommendApp => _recommendApp.map((e) => AO.fromRaw(e)).toList();
/// original value
List<String> _smartManagerApp = [
'一键开门',
if (false) '一键开门',
'开门码',
'访客邀请',
'报事报修',

@ -1,5 +1,6 @@
import 'dart:io';
import 'package:aku_community/provider/app_provider.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@ -8,12 +9,14 @@ import 'package:flutter/services.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:fluwx/fluwx.dart';
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:power_logger/power_logger.dart';
import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/constants/config.dart';
import 'package:aku_community/utils/message_parser.dart';
import 'package:provider/provider.dart';
class MainInitialize {
///firebase
@ -52,6 +55,9 @@ class MainInitialize {
onReceiveNotification: (message) async {
LoggerData.addData(message, tag: 'onReceiveNotification');
await MessageParser(message).shot();
final appProvider =
Provider.of<AppProvider>(Get.context!, listen: false);
appProvider.getMessageCenter();
},
onOpenNotification: jPushLogger('onOpenNotification'),
onReceiveMessage: jPushLogger('onReceiveMessage'),

@ -69,8 +69,12 @@ class _HomePageState extends State<HomePage>
actions: [
Badge(
elevation: 0,
showBadge: appProvider.messageCenterModel.sysCount == 0,
position: BadgePosition.topEnd(),
showBadge: appProvider.messageCenterModel.commentCount != 0 ||
appProvider.messageCenterModel.sysCount != 0,
position: BadgePosition.topEnd(
top: 8,
end: 8,
),
child: ColumnActionButton(
onPressed: () {
if (LoginUtil.isNotLogin) return;
@ -79,7 +83,7 @@ class _HomePageState extends State<HomePage>
title: '消息',
path: R.ASSETS_ICONS_ALARM_PNG,
),
)
),
],
),
body: EasyRefresh(

@ -21,16 +21,11 @@ class MessageCenterPage extends StatefulWidget {
}
class _MessageCenterPageState extends State<MessageCenterPage> {
EasyRefreshController? _refreshController;
@override
void initState() {
super.initState();
_refreshController = EasyRefreshController();
}
EasyRefreshController _refreshController = EasyRefreshController();
@override
void dispose() {
_refreshController?.dispose();
_refreshController.dispose();
super.dispose();
}
@ -80,7 +75,7 @@ class _MessageCenterPageState extends State<MessageCenterPage> {
MaterialButton(
onPressed: () async {
await NetUtil().dio!.get(API.message.allRead);
_refreshController!.callRefresh();
_refreshController.callRefresh();
setState(() {});
},
child: '全部已读'.text.size(28.sp).black.make(),
@ -90,6 +85,7 @@ class _MessageCenterPageState extends State<MessageCenterPage> {
body: EasyRefresh(
header: MaterialHeader(),
firstRefresh: true,
controller: _refreshController,
onRefresh: () async {
appProvider.getMessageCenter();
},
@ -100,7 +96,12 @@ class _MessageCenterPageState extends State<MessageCenterPage> {
title: '系统通知',
content: appProvider.messageCenterModel.sysTitle ?? '无系统通知消息',
count: appProvider.messageCenterModel.sysCount ?? 0,
onTap: () => Get.to(() => SystemMessagePage()),
onTap: () async {
await NetUtil().dio!.get(API.message.allReadComment);
await Get.to(() => SystemMessagePage());
_refreshController.callRefresh();
setState(() {});
},
),
_buildCard(
path: R.ASSETS_ICONS_COMMENT_NOTICE_PNG,
@ -110,7 +111,8 @@ class _MessageCenterPageState extends State<MessageCenterPage> {
count: appProvider.messageCenterModel.commentCount ?? 0,
onTap: () async {
await NetUtil().dio!.get(API.message.allReadComment);
Get.to(() => CommentMessagePage());
await Get.to(() => CommentMessagePage());
_refreshController.callRefresh();
setState(() {});
},
),

@ -1,3 +1,4 @@
import 'package:aku_community/constants/api.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -255,8 +256,7 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
tel: tel,
);
if (result != null)
Share.share(
'http://test.akuhotel.com:8804/static/dist/index.html#/visitor?$result');
Share.share('${API.host}/static/dist/index.html#/visitor?$result');
},
minWidth: double.infinity,
height: 96.w,

@ -139,12 +139,15 @@ class AppProvider extends ChangeNotifier {
}
}
Map<String, Object>? _location;
Map<String, Object>? get location => _location;
Map<String, dynamic>? _location;
Map<String, dynamic>? get location => _location;
late AMapFlutterLocation _aMapFlutterLocation;
startLocation() {
if (kIsWeb || Platform.isMacOS) return;
if (kIsWeb || Platform.isMacOS) {
getWeather();
return;
}
_aMapFlutterLocation = AMapFlutterLocation();
_aMapFlutterLocation.onLocationChanged().listen((event) {
_location = event;
@ -164,11 +167,19 @@ class AppProvider extends ChangeNotifier {
_aMapFlutterLocation.destroy();
}
// Location _location;
// Location get location => _location;
getWeather() async {
late num longitude;
late num latitude;
if (kIsWeb || Platform.isMacOS) {
longitude = 116.46;
latitude = 39.92;
} else {
longitude = _location!['longitude'];
latitude = _location!['latitude'];
}
Response response = await Dio().get(
'https://api.caiyunapp.com/v2.5/${AppConfig.caiYunAPI}/${_location!['longitude']},${_location!['latitude']}/realtime.json',
'https://api.caiyunapp.com/v2.5/${AppConfig.caiYunAPI}/$longitude,$latitude/realtime.json',
);
LoggerData.addData(response);
_weatherModel = RealTimeWeatherModel.fromJson(response.data);

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart';
import 'package:get/get.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:provider/provider.dart';
import 'package:aku_community/constants/api.dart';
@ -31,6 +32,7 @@ class UserProvider extends ChangeNotifier {
}
logout() {
JPush().deleteAlias();
final appProvider = Provider.of<AppProvider>(Get.context!, listen: false);
appProvider.setCurrentHouse(null);
_isLogin = false;
@ -46,6 +48,9 @@ class UserProvider extends ChangeNotifier {
Future updateProfile() async {
_userInfoModel = await SignFunc.getUserInfo();
if (_userInfoModel != null) {
await JPush().setAlias(_userInfoModel!.id.toString());
}
notifyListeners();
}

@ -1,3 +1,5 @@
import 'package:aku_community/provider/app_provider.dart';
import 'package:badges/badges.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@ -53,16 +55,26 @@ class _CommunityPageState extends State<CommunityPage>
Widget build(BuildContext context) {
super.build(context);
final userProvider = Provider.of<UserProvider>(context);
final appProvider = Provider.of<AppProvider>(context);
return BeeScaffold(
title: '社区',
actions: [
ColumnActionButton(
onPressed: () {
if (LoginUtil.isNotLogin) return;
Get.to(() => MessageCenterPage());
},
title: '消息',
path: R.ASSETS_ICONS_ALARM_PNG,
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,
),
),
],
fab: FloatingActionButton(

@ -1,7 +1,8 @@
import 'package:aku_community/base/base_style.dart';
// import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/market/goods_item.dart';
import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
import 'package:aku_community/ui/market/goods/goods_card.dart';
// import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:flutter/cupertino.dart';
@ -18,7 +19,8 @@ import 'package:aku_community/ui/market/category/category_page.dart';
import 'package:aku_community/ui/market/search/search_goods_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
// import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart';
class MarketPage extends StatefulWidget {
MarketPage({Key? key}) : super(key: key);
@ -28,8 +30,7 @@ class MarketPage extends StatefulWidget {
}
class _MarketPageState extends State<MarketPage>
with AutomaticKeepAliveClientMixin, TickerProviderStateMixin {
late TabController _tabController;
with AutomaticKeepAliveClientMixin {
List<MarketCategoryModel> _marketModels = [];
List<GoodsItem> _hotItems = [];
@ -45,7 +46,6 @@ class _MarketPageState extends State<MarketPage>
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
updateMarketInfo().then((_) {
setState(() {});
});
@ -111,8 +111,11 @@ class _MarketPageState extends State<MarketPage>
//AppBar top Widget height
//bottom height: 48
// flexibleSpace ( - )/4*2 + + bottom + top
expandedHeight:
(mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48 + 68.w,
// *
//expandedHeight:
//(mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48 + 68.w,
//
expandedHeight: (mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2,
backgroundColor: Colors.transparent,
elevation: 0,
flexibleSpace: FlexibleSpaceBar(
@ -122,55 +125,55 @@ class _MarketPageState extends State<MarketPage>
top: 16.w,
left: 32.w,
right: 32.w,
bottom: 16.w + 48, //bottom
bottom: 16.w, //bottom
),
child: Column(
children: [
SizedBox(
height: 58.w,
child: Row(
children: [
Text(
'热搜:',
style: TextStyle(
fontSize: 20.sp,
),
),
20.wb,
ListView.separated(
scrollDirection: Axis.horizontal,
separatorBuilder: (_, __) => 20.wb,
itemBuilder: (context, index) {
final item = _hotItems[index];
return MaterialButton(
padding:
EdgeInsets.symmetric(horizontal: 40.w),
minWidth: 0,
shape: StadiumBorder(
side: BorderSide(
color: ktextSubColor,
width: 1,
),
),
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
onPressed: () {
Get.to(() => GoodsDetailPage(id: item.id));
},
child: Text(
item.title,
style: TextStyle(
color: ktextSubColor,
),
),
);
},
itemCount: _hotItems.length,
).expand(),
],
),
),
10.hb,
// SizedBox(
// height: 58.w,
// child: Row(
// children: [
// Text(
// '热搜:',
// style: TextStyle(
// fontSize: 20.sp,
// ),
// ),
// 20.wb,
// ListView.separated(
// scrollDirection: Axis.horizontal,
// separatorBuilder: (_, __) => 20.wb,
// itemBuilder: (context, index) {
// final item = _hotItems[index];
// return MaterialButton(
// padding:
// EdgeInsets.symmetric(horizontal: 40.w),
// minWidth: 0,
// shape: StadiumBorder(
// side: BorderSide(
// color: ktextSubColor,
// width: 1,
// ),
// ),
// materialTapTargetSize:
// MaterialTapTargetSize.shrinkWrap,
// onPressed: () {
// Get.to(() => GoodsDetailPage(id: item.id));
// },
// child: Text(
// item.title,
// style: TextStyle(
// color: ktextSubColor,
// ),
// ),
// );
// },
// itemCount: _hotItems.length,
// ).expand(),
// ],
// ),
// ),
// 10.hb,
gridItems.expand(),
],
),
@ -178,29 +181,35 @@ class _MarketPageState extends State<MarketPage>
),
pinned: true,
toolbarHeight: 0,
bottom: PreferredSize(
child: Material(
color: Color(0xFFF9F9F9),
child: Align(
alignment: Alignment.centerLeft,
child: BeeTabBar(
scrollable: true,
controller: _tabController,
tabs: ['社区商城', '二手市场'],
),
),
),
preferredSize: Size.fromHeight(48),
),
// bottom: PreferredSize(
// child: Material(
// color: Color(0xFFF9F9F9),
// child: Align(
// alignment: Alignment.centerLeft,
// child: BeeTabBar(
// scrollable: true,
// controller: _tabController,
// tabs: ['社区商城', '二手市场'],
// ),
// ),
// ),
// preferredSize: Size.fromHeight(48),
// ),
),
];
},
body: TabBarView(
children: [
SizedBox(),
SizedBox(),
],
controller: _tabController,
body: WaterfallFlow.builder(
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
),
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
final item = _hotItems[index];
return GoodsCard(item: item);
},
itemCount: _hotItems.length,
),
),
);

Loading…
Cancel
Save