修改业委会电话和物业电话

hmxc
小赖 4 years ago
parent 40c2faa368
commit a9a59dcadd

@ -1,172 +0,0 @@
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:url_launcher/url_launcher.dart';
// Project imports:
import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/utils/headers.dart';
class PhoneList extends StatefulWidget {
PhoneList({Key key}) : super(key: key);
@override
_PhoneListState createState() => _PhoneListState();
}
class _PhoneListState extends State<PhoneList> {
List<Map<String, dynamic>> _phoneList = [
{'name': '绿化徐', 'phone': '18898097890'},
{'name': '废品回收', 'phone': '13890909090'},
{'name': '业委会电话', 'phone': '0574-88467897'},
{'name': '7-9幢管家', 'phone': '18989093454'},
{'name': '监控电话', 'phone': '0574-8812572'},
{'name': '百世快递', 'phone': '15890987687'},
];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
void _onRefresh() async {
await Future.delayed(Duration(milliseconds: 1500));
_refreshController.refreshCompleted();
}
void _onLoading() async {
if (mounted) setState(() {});
_refreshController.loadComplete();
}
Future<void> _phoneCall(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
void _showDialog(String url) {
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: Text(
url,
style: TextStyle(
fontSize: 34.sp,
color: Color(0xff030303),
),
),
actions: <Widget>[
CupertinoDialogAction(
child: Text(
'取消',
style: TextStyle(
fontSize: 34.sp,
color: Color(0xff333333),
),
),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
child: Text(
'呼叫',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 34.sp,
color: Color(0xffff8200),
),
),
onPressed: () {
_phoneCall('tel:$url');
Get.back();
},
),
],
);
},
);
}
Widget _phoneCard(String name, String phone) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 32.w),
padding: EdgeInsets.only(
top: 23.w,
bottom: 20.w,
),
decoration: BoxDecoration(
color: Color(0xffffffff),
border:
Border(bottom: BorderSide(color: Color(0xffd9d9d9), width: 0.5)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: TextStyle(
fontSize: 32.sp,
color: Color(0xff333333),
),
),
SizedBox(height: 12.w),
Text(
phone,
style: TextStyle(
fontSize: 28.sp,
color: Color(0xff999999),
),
),
],
),
InkWell(
onTap: () {
_showDialog(phone);
},
child: Image.asset(
AssetsImage.PHONE,
height: 60.w,
width: 60.w,
),
),
],
),
);
}
@override
Widget build(BuildContext context) {
return SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onRefresh: _onRefresh,
onLoading: _onLoading,
enablePullUp: true,
child: CustomScrollView(
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return _phoneCard(
_phoneList[index]['name'],
_phoneList[index]['phone'],
);
},
childCount: _phoneList.length,
),
),
],
),
);
}
}

@ -1,6 +1,7 @@
// Dart imports:
// Flutter imports:
import 'package:akuCommunity/utils/login_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -78,7 +79,7 @@ class _HomePageState extends State<HomePage>
position: BadgePosition.topEnd(),
child: ColumnActionButton(
onPressed: () {
if (LoginUtil.isNotLogin) return;
MessageCenterPage().to();
},
title: '消息',

@ -31,8 +31,7 @@ class _IndustryCommitteePageState extends State<IndustryCommitteePage> {
MaterialButton(
onPressed: () {
Get.dialog(CupertinoAlertDialog(
//TODO , for test only
title: '(0574) 8888 8888'.text.isIntrinsic.make(),
title: '0574-87760023'.text.isIntrinsic.make(),
actions: [
CupertinoDialogAction(
child: '取消'.text.isIntrinsic.make(),

@ -99,7 +99,7 @@ class PropertyCard extends StatelessWidget {
onTap: () {
switch (_listCard[index]['title']) {
case '电话物业':
_showDialog(context, '0574-88467897');
_showDialog(context, '0574-87760023');
break;
case '语音管家':
break;

@ -30,7 +30,7 @@ class CommunityPage extends StatefulWidget {
class _CommunityPageState extends State<CommunityPage>
with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {
TabController _tabController;
List<String> _tabs = ['最新', '话题', '我的'];
List<String> _tabs = [];
GlobalKey<TopicCommunityViewState> topicKey =
GlobalKey<TopicCommunityViewState>();
GlobalKey<MyCommunityViewState> myKey = GlobalKey<MyCommunityViewState>();
@ -39,20 +39,33 @@ class _CommunityPageState extends State<CommunityPage>
@override
void initState() {
super.initState();
final userProvider = Provider.of<UserProvider>(context, listen: false);
if (userProvider.isLogin) _tabs = ['最新', '话题', '我的'];
if (userProvider.isNotLogin) _tabs = ['最新', '话题'];
_tabController = TabController(
vsync: this,
length: _tabs.length,
);
}
@override
void dispose() {
_tabController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
final userProvider = Provider.of<UserProvider>(context);
return BeeScaffold(
title: '社区',
actions: [
ColumnActionButton(
onPressed: MessageCenter().to,
onPressed: () {
if (LoginUtil.isNotLogin) return;
MessageCenter().to();
},
title: '消息',
path: R.ASSETS_ICONS_ALARM_PNG,
),
@ -90,10 +103,15 @@ class _CommunityPageState extends State<CommunityPage>
),
),
body: TabBarView(
children: [
children: userProvider.isLogin
? [
NewCommunityView(key: newKey),
TopicCommunityView(key: topicKey),
MyCommunityView(key: myKey),
]
: [
NewCommunityView(key: newKey),
TopicCommunityView(key: topicKey),
],
controller: _tabController,
),

Loading…
Cancel
Save