diff --git a/lib/pages/community/widget/trend_card.dart b/lib/pages/community/widget/trend_card.dart index 659eeb23..7d7bd933 100644 --- a/lib/pages/community/widget/trend_card.dart +++ b/lib/pages/community/widget/trend_card.dart @@ -39,50 +39,6 @@ class _TrendCardState extends State { _isLike = widget.isLike ?? false; } - // void _showDialog(String url) { - // showCupertinoDialog( - // context: context, - // builder: (context) { - // return CupertinoAlertDialog( - // title: Text( - // '是否$url\?', - // style: TextStyle( - // fontSize: 34.sp, - // color: Color(0xff030303), - // ), - // ), - // actions: [ - // 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: () { - // Get.back(); - // }, - // ), - // ], - // ); - // }, - // ); - // } - TextStyle _textStyleName() { return TextStyle( fontSize: 36.sp, diff --git a/lib/pages/convenient_phone/convenient_phone_page.dart b/lib/pages/convenient_phone/convenient_phone_page.dart index 1f22ffae..511c0ac6 100644 --- a/lib/pages/convenient_phone/convenient_phone_page.dart +++ b/lib/pages/convenient_phone/convenient_phone_page.dart @@ -6,6 +6,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:velocity_x/velocity_x.dart'; import 'package:akuCommunity/const/resource.dart'; @@ -50,12 +52,28 @@ class _ConvenientPhonePageState extends State { ], ).expand(), IconButton( - icon: Image.asset( - R.ASSETS_ICONS_PHONE_PNG, - width: 40.w, - height: 40.w, - ), - onPressed: () {}) + icon: Image.asset( + R.ASSETS_ICONS_PHONE_PNG, + width: 40.w, + height: 40.w, + ), + onPressed: () async { + bool result = await Get.dialog(CupertinoAlertDialog( + title: model.tel.text.isIntrinsic.make(), + actions: [ + CupertinoDialogAction( + child: '取消'.text.isIntrinsic.make(), + onPressed: () => Get.back(), + ), + CupertinoDialogAction( + child: '确定'.text.isIntrinsic.make(), + onPressed: () => Get.back(result: true), + ), + ], + )); + if (result == true) launch('tel:${model.tel}'); + }, + ) ], ), ], @@ -63,20 +81,6 @@ class _ConvenientPhonePageState extends State { ); } - // Widget _buildCard(String title, List tableList) { - // return Material( - // child: Padding( - // padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 40.w), - // child: Column( - // children: [ - // title.text.black.size(32.sp).make(), - // 45.w.heightBox, - // ], - // ), - // ), - // ); - // } - @override Widget build(BuildContext context) { return BeeScaffold( @@ -138,7 +142,7 @@ class _ConvenientPhonePageState extends State { padding: EdgeInsets.symmetric(vertical: 20.w), child: Divider( thickness: 1.w, - height: 0, + height: 1.w, color: Color(0xFFD8D8D8), ), ); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 3f5e5052..0451a9bb 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -166,9 +166,9 @@ class _HomePageState extends State crossCount: 4, ), ), - SingleAdSpace( - imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG, - ), + // SingleAdSpace( + // imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG, + // ), HomeTagBar( title: '物业收费标准请查收~', tag: '公告', diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 4a3725df..c6249b47 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -286,11 +286,11 @@ class _PersonalIndexState extends State // ), // ), // ), - SliverToBoxAdapter( - child: SingleAdSpace( - imagePath: 'assets/example/guanggao7.png', - ), - ), + // SliverToBoxAdapter( + // child: SingleAdSpace( + // imagePath: 'assets/example/guanggao7.png', + // ), + // ), SliverToBoxAdapter( child: Container( decoration: BoxDecoration( diff --git a/lib/pages/visitor_access_page/visitor_access_page.dart b/lib/pages/visitor_access_page/visitor_access_page.dart index 2817f2de..cf5b5ed1 100644 --- a/lib/pages/visitor_access_page/visitor_access_page.dart +++ b/lib/pages/visitor_access_page/visitor_access_page.dart @@ -1,5 +1,5 @@ import 'package:akuCommunity/pages/manager_func.dart'; -import 'package:akuCommunity/pages/visitor_access_page/visitor_record_page.dart'; +import 'package:akuCommunity/ui/manager/visitor/visitor_record_page.dart'; import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/visitor_access_page/visitor_record_page.dart b/lib/pages/visitor_access_page/visitor_record_page.dart deleted file mode 100644 index cffdd411..00000000 --- a/lib/pages/visitor_access_page/visitor_record_page.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:akuCommunity/widget/common_app_bar.dart'; -import 'widget/record_list.dart'; - -class VisitorRecordPage extends StatefulWidget { - VisitorRecordPage({Key key}) : super(key: key); - - @override - _VisitorRecordPageState createState() => _VisitorRecordPageState(); -} - -class _VisitorRecordPageState extends State - with TickerProviderStateMixin { - TabController _controller; - - //导航标签 - List> treeList = [ - {'name': '未到访客'}, - {'name': '已到访客'}, - ]; - @override - void initState() { - _controller = TabController(length: treeList.length, vsync: this); - super.initState(); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - Widget build(BuildContext context) { - return DefaultTabController( - length: treeList.length, - child: Scaffold( - appBar: PreferredSize( - child: CommonAppBar( - title: '访客记录', - tabController: _controller, - treeList: treeList, - ), - preferredSize: Size.fromHeight(kToolbarHeight * 1.8), - ), - body: TabBarView( - controller: _controller, - children: List.generate( - treeList.length, - (index) => RecordList(), - ), - ), - ), - ); - } -} diff --git a/lib/ui/manager/visitor/visitor_record_page.dart b/lib/ui/manager/visitor/visitor_record_page.dart new file mode 100644 index 00000000..e5018c09 --- /dev/null +++ b/lib/ui/manager/visitor/visitor_record_page.dart @@ -0,0 +1,48 @@ +import 'package:akuCommunity/widget/bee_scaffold.dart'; +import 'package:akuCommunity/widget/tab_bar/bee_tab_bar.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import '../../../pages/visitor_access_page/widget/record_list.dart'; + +class VisitorRecordPage extends StatefulWidget { + VisitorRecordPage({Key key}) : super(key: key); + + @override + _VisitorRecordPageState createState() => _VisitorRecordPageState(); +} + +class _VisitorRecordPageState extends State + with TickerProviderStateMixin { + TabController _controller; + + //导航标签 + List _tabs = ['未到访客', '已到访客']; + @override + void initState() { + _controller = TabController(length: _tabs.length, vsync: this); + super.initState(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + Widget build(BuildContext context) { + return BeeScaffold( + title: '访客记录', + appBarBottom: BeeTabBar( + controller: _controller, + tabs: _tabs, + ), + body: TabBarView( + controller: _controller, + children: List.generate( + _tabs.length, + (index) => RecordList(), + ), + ), + ); + } +} diff --git a/lib/widget/common_app_bar.dart b/lib/widget/common_app_bar.dart deleted file mode 100644 index add237b8..00000000 --- a/lib/widget/common_app_bar.dart +++ /dev/null @@ -1,169 +0,0 @@ -import 'package:akuCommunity/pages/address_page/address_edit_page.dart'; -import 'package:akuCommunity/pages/goods_manage_page/mine_goods_page/mine_goods_page.dart'; -import 'package:akuCommunity/pages/life_pay/life_pay_record_page/life_pay_record_page.dart'; -import 'package:akuCommunity/pages/things_page/things_evaluate_page/things_evaluate_page.dart'; -import 'package:akuCommunity/pages/visitor_access_page/visitor_record_page.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_beautiful_popup/main.dart'; -import 'package:flutter_icons/flutter_icons.dart'; -import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:akuCommunity/pages/one_alarm/widget/explain_template.dart'; -import 'package:get/get.dart'; - -//TODO CLEAN BOTTOM CODES. -@Deprecated("sh*t common_app_bar need to be cleaned.") -class CommonAppBar extends StatelessWidget { - final String title, subtitle; - final List> treeList; - final TabController tabController; - const CommonAppBar({ - Key key, - @required this.title, - this.subtitle, - this.treeList, - this.tabController, - }) : super(key: key); - - void showExplain(BuildContext context) { - final popup = BeautifulPopup.customize( - context: context, - build: (options) => ExplainTemplate(options), - ); - popup.show( - title: Text( - '功能说明', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 32.sp, - color: Color(0xff15c0ec), - ), - ), - content: Text( - '点击“呼叫110”后,您可以直接拨打本地110。页面中提供了您当前所在位置,以便您与警方沟通。(GPS信号弱时,位置可能存在偏移)', - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff666666), - ), - ), - actions: [ - MaterialButton( - color: Color(0xff15c0ec), - textColor: Colors.white, - shape: RoundedRectangleBorder( - side: BorderSide.none, - borderRadius: BorderRadius.all(Radius.circular(50))), - child: Text('关闭'), - onPressed: Navigator.of(context).pop, - ) - ], - close: SizedBox()); - } - - @override - Widget build(BuildContext context) { - return Container( - child: AppBar( - elevation: 0, - backgroundColor: (title == '访客通行证' || title == '出户二维码') - ? Color(0xff333333) - : Colors.white, - leading: InkWell( - onTap: () => Get.back(), - child: Icon( - AntDesign.left, - size: 45.sp, - color: (title == '访客通行证' || title == '出户二维码') - ? Colors.white - : Color(0xff333333), - ), - ), - centerTitle: true, - title: Text( - title, - style: TextStyle( - color: (title == '访客通行证' || title == '出户二维码') - ? Colors.white - : Color(0xff333333), - fontSize: 32.sp, - fontWeight: FontWeight.w600, - ), - ), - actions: [ - subtitle != null - ? InkWell( - onTap: () { - switch (subtitle) { - case '访客记录': - VisitorRecordPage().to; - break; - case '缴费记录': - LifePayRecordPage().to; - break; - case '我的借还物品': - MineGoodsPage().to; - break; - case '添加新地址': - AddressEditPage( - bundle: Bundle() - ..putMap('details', - {'title': '添加新地址', 'isDelete': false}), - ).to; - break; - case '功能说明': - showExplain(context); - break; - case '评价': - ThingsEvaluatePage( - bundle: Bundle() - ..putMap( - 'details', {'title': '评价', 'isShow': true}), - ).to; - break; - default: - } - }, - child: Container( - height: kToolbarHeight, - alignment: Alignment.center, - margin: EdgeInsets.only(right: 32.w), - child: Text( - subtitle, - style: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333), - ), - ), - ), - ) - : SizedBox(), - ], - bottom: treeList != null - ? TabBar( - unselectedLabelStyle: TextStyle( - fontSize: 28.sp, - ), - labelStyle: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 28.sp, - ), - labelPadding: EdgeInsets.symmetric(horizontal: 131.5.w), - indicatorColor: Color(0xffffc40c), - indicatorSize: TabBarIndicatorSize.label, - indicatorPadding: EdgeInsets.symmetric(horizontal: 21.w), - isScrollable: true, - controller: tabController, - tabs: List.generate( - treeList.length, - (index) => Tab(text: treeList[index]['name']), - ), - ) - : PreferredSize( - child: SizedBox(), - preferredSize: Size.fromHeight(0), - ), - ), - ); - } -} diff --git a/lib/widget/round_check_box.dart b/lib/widget/round_check_box.dart index adc7a41d..f75ed026 100644 --- a/lib/widget/round_check_box.dart +++ b/lib/widget/round_check_box.dart @@ -2,7 +2,8 @@ import 'package:flutter/material.dart'; import 'package:akuCommunity/utils/headers.dart'; //TODO one day we need to remove those.😕 -// ignore: must_be_immutable +//TODO CLEAN BOTTOM CODES. +@Deprecated("sh*t round_check_box need to be cleaned.") class RoundCheckBox extends StatefulWidget { var value = false;