From 915e5a687cc6f44e050c5850b5a6f92621834b93 Mon Sep 17 00:00:00 2001 From: WinUser01 Date: Mon, 13 Dec 2021 13:48:58 +0800 Subject: [PATCH] =?UTF-8?q?hyzp=5Fybqx-Commit005=EF=BC=9A=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E5=9C=A8=E2=80=9C=E6=88=91=E7=9A=84=E2=80=9D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E2=80=9C=E8=B4=A6=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E2=80=9D=E9=A1=B9=E7=9B=AE=EF=BC=8C=E5=87=86=E5=A4=87?= =?UTF-8?q?=E5=B0=86=E2=80=9C=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E2=80=9D?= =?UTF-8?q?=E3=80=81=E2=80=9C=E4=BA=BA=E8=84=B8=E6=B3=A8=E5=86=8C=E2=80=9D?= =?UTF-8?q?=E6=95=B4=E5=90=88=E5=88=B0=E2=80=9C=E8=B4=A6=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E2=80=9D=E9=A1=B9=E7=9B=AE=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/账户管理.png | Bin 0 -> 6892 bytes lib/pages/tabs/page4_myMsics_new-0.dart | 734 ++++++++++++++++++++++++ lib/pages/tabs/page4_myMsics_new.dart | 64 +-- lib/pages/tabs/page5_userManager.dart | 734 ++++++++++++++++++++++++ 4 files changed, 1485 insertions(+), 47 deletions(-) create mode 100644 assets/images/账户管理.png create mode 100644 lib/pages/tabs/page4_myMsics_new-0.dart create mode 100644 lib/pages/tabs/page5_userManager.dart diff --git a/assets/images/账户管理.png b/assets/images/账户管理.png new file mode 100644 index 0000000000000000000000000000000000000000..27e9dfc84f5f441d36b386245548e2bedacaecc6 GIT binary patch literal 6892 zcmai(cRUz8h2q!Vh!|n& z!H^+H6o+zs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qA84!ZC08?} z_$BFIX*{5$uF5~IwmI**ptW&6&b+QVX%h2Y{}=p>jCJ^CoN^fwA`TT`Y4GO%tDIbp zB6Lhk!Yzem=cbWpX2ssVDK+3Mwkk|z136{hD(My3i>-5=w&^mw`UVmX3Fc>cC%Ai? zstwt@EiPT){0AEsEiE>O&y9s`W~}0~(=LM==r_*)$U@kieBP_@R{K3oA#72}335`l z!E+u%!5p60XJ@=CGyC2$tcMwl7x{gxAtl@~-g@lU`5!rqmYai5L!DM{={NY_1p3ZJ zyBB`3(g!=F@k=uv3OmfcECDK~6zku)a6i7ib14;cw}c0K^Hbk!HJLT*xfgx{Nz)@T zZJwEx07_=@ptV%b6RU*c3B-i^{&?EN!ajJ?$?hqTu_cNbTOzLs-K6&o8 zpctYXYj~Ilo&(X+A!0pP-BX8P;V1j!lm8zzXTaj>K>( z!@)Rj$ga5vR%hF*U>MU0T1oNX7D)~`GUQgm67qn)T+SPzZs0y;wv;D#V?{P$zU~E`Mw`(AhPu7T=^6nmW^o _myFijkPanelWidgetBuilderStateKey = new GlobalKey(); + +class Page4_MyMsicsNew extends StatefulWidget { + Page4_MyMsicsNew({@required this.pageType, this.title, Key key}) : super(key: key); + + //该美工优化的页面 Page4_MyMsicsNew,是供多个页面共享的代码框架。不同的页面以 PageType 字段进行区分 + String pageType = ''; //'my_page' + String title = ''; + + @override + _Page4_MyMsicsNewState createState() => _Page4_MyMsicsNewState(); +} + +//class _Page1WorkState extends State with WidgetsBindingObserver, AutomaticKeepAliveClientMixin { +class _Page4_MyMsicsNewState extends State + with WidgetsBindingObserver, AutomaticKeepAliveClientMixin { + //Begin:底部导航栏,使用PageView方式,配置每页面的保持状态。必须添加继承:with AutomaticKeepAliveClientMixin + + //try_setState(); //避免异常报错 + try_setState() { + try { + setState(() {}); + } catch (e) { + print('setState(() {})异常:${e}'); + } + } + + @override + // TODO: implement wantKeepAlive + bool get wantKeepAlive => true; + + //End:底部导航栏,使用PageView方式,配置每页面的保持状态 + + // final FijkPlayer player = FijkPlayer(); + // bool bFirstPlay; + + @override + void initState() { + //监听 g_userInfo.userGroupIDlist 更新事件 + // eventBus.on().listen((event) async { + // print(event.str); + // getAdminItem(); + // }); + + getListView().then((value) { + Future.delayed(Duration(milliseconds: 500), () { + getAdminItem(); + }); + }); + + super.initState(); + } + + Future updateStatisData() async { + if (listZptjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日抓拍']) { + getAllSum('today', listZptjStatisAlone).then((value) { + mapStatisInfo['今日抓拍'] = value[1]; + try_setState(); + }); + } + + if (listShtjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日初审']) { + getAllSum('total', listShtjStatisAlone).then((value) { + mapStatisInfo['今日初审'] = value[1]; + mapStatisInfo['今日复审'] = value[1]; + try_setState(); + }); + getAllSum('sends', listShtjStatisAlone).then((value) { + mapStatisInfo['今日推送'] = value[1]; + try_setState(); + }); + } + + if (listClltjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日车流']) { + getAllSum('today', listClltjStatisAlone).then((value) { + mapStatisInfo['今日车流'] = value[1] ~/ 10000; + try_setState(); + }); + } + } + + Future sysPop() async { + await SystemChannels.platform.invokeMethod('SystemNavigator.pop'); + } + + _Page4_MyMsicsNewState(); + + @override + void dispose() { + super.dispose(); + } + + //自定义方法 + static onNullFun() {} + + Widget _getListTile(title, + {String leadPath = '', + Color leadColor, + onTapFun = onNullFun, + onLongPressFun = onNullFun, + size = 16.0, + bool bBadge = false}) { + return Column( + children: [ + ListTile( + leading: bBadge + ? Badge( + position: BadgePosition.topEnd(top: -7, end: -12), + badgeContent: null, + child: Image.asset( + leadPath, + height: ScreenUtil().setHeight(78), + fit: BoxFit.fitHeight, + ), + ) + : Image.asset( + leadPath, + height: ScreenUtil().setHeight(78), + fit: BoxFit.fitHeight, + ), + title: new Text(title, style: TextStyle(fontSize: size)), + trailing: new Icon(Icons.arrow_forward_ios), + contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0), + enabled: true, + onTap: onTapFun, + onLongPress: onLongPressFun, + ), + Divider( + height: 1.0, + ), + ], + ); + } + + List _listViewUser = []; + List _listViewUser_user = []; + + Color _greenColor = Color.fromRGBO(36, 206, 192, 1); //绿色 + Color _deepBlueColor = Color.fromRGBO(79, 118, 230, 1); //深蓝 + Color _deepGreyColor = Color.fromRGBO(116, 139, 161, 1); //深灰 + Color _ligthBlueColor = Color.fromRGBO(80, 159, 245, 1); //亮蓝 + + Future getListView() async { + _listViewUser_user.clear(); + // _listViewUser.add(_getListTile('个人资料', + // leadPath: 'assets/images/我的.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_personal_data)); + // _listViewUser.add(_getListTile('意见反馈', + // leadPath: 'assets/images/意见反馈.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_MyFeedback)); + // _listViewUser.add(_getListTile('版本更新', + // leadPath: 'assets/images/版本更新.png', leadColor: _greenColor, onTapFun: OnTap_MyUpdate)); + // _listViewUser.add(_getListTile('清除缓存', + // leadPath: 'assets/images/清除缓存.png', + // leadColor: _deepBlueColor, + // onTapFun: OnTap_ClearCache)); + // _listViewUser.add(_getListTile('关于', + // leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout)); + + _listViewUser_user = [ + _getListTile('清除缓存', + leadPath: 'assets/images/清除缓存.png', + leadColor: _deepBlueColor, + onTapFun: OnTap_ClearCache), + //用户资料修改、版本更新、意见反馈都需要后台支持才行,现在后台都没有提供支持,标书里面也没有要求,建议先去掉 + // _getListTile('个人资料', + // leadPath: 'assets/images/我的.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_personal_data), + // _getListTile('意见反馈', + // leadPath: 'assets/images/意见反馈.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_MyFeedback), + _getListTile('修改密码', + leadPath: 'assets/images/修改密码.png', + leadColor: _deepBlueColor, + onTapFun: OnTap_modify_password), + //bNewVer:是否发现新版本 + _getListTile('版本更新', + leadPath: 'assets/images/版本更新.png', + leadColor: _greenColor, + onTapFun: OnTap_MyUpdate, + bBadge: bNewVer), + + // _getListTile('关于', + // leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout), + // _getListTile('权限测试', + // leadPath: 'assets/images/权限.png', + // leadColor: _deepGreyColor, + // onTapFun: OnTap_UserAuthority), + ]; + } + + //已添加管理员记录的标志,0 未添加, 1 已添加 1 次 + //该标志也作为是否是管理员的标志,若为 0 便不是、只是当前还不是, 1 则是管理员 + //int alreadyFlag = 0; + + Future getAdminItem() async { + _listViewUser.addAll(_listViewUser_user); + for (int group_id in g_userInfo.userGroupIDlist) { + print('group_id = $group_id'); + if (26 == group_id || 31 == group_id) { + Widget _item = _getListTile('人脸注册', + leadPath: 'assets/images/人脸注册.png', + leadColor: _ligthBlueColor, + onTapFun: OnTap_FaceReg); + print('_listViewUser.length = ${_listViewUser.length}'); + _listViewUser.add(_item); + break; //添加后便跳出循环,避免重复添加 + } + } + + _listViewUser.add(_getListTile('关于', + leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout)); + print('_listViewUser.length = ${_listViewUser.length}'); + Future.delayed(Duration(milliseconds: 500), () { + try_setState(); + }); + } + + @override + Widget build(BuildContext context) { + return WillPopScope( + child: Container( + decoration: new BoxDecoration( + color: Color.fromRGBO(244, 244, 244, 1), //设置背景色 + ), + child: Column( + children: [ + Container( + height: ScreenUtil().setHeight(484), //530 - 46 + child: Stack( + children: [ + //1、第1行文字 + Positioned( + child: Container( + height: ScreenUtil().setHeight(324), //181 + alignment: Alignment.topCenter, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromRGBO(12, 186, 156, 1), + Color.fromRGBO(39, 127, 235, 1), + ], + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + //crossAxisAlignment: CrossAxisAlignment.start, //用的比较少 + children: [ + FlatButton( + child: Container( + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(top: ScreenUtil().setHeight(10)), + child: Text(""), + // child: Image.asset( + // 'assets/images/形状 2.png', + // height: ScreenUtil().setHeight(45), + // ), + ), + Text(" ", //" 客服热线", + style: TextStyle(fontSize: 16, color: Colors.white)), + ], + ), + ), + onPressed: () {} + // onPressed: () => launch("tel://18784678300"), + ), + SizedBox( + width: ScreenUtil().setWidth(45), + ), + Expanded( + child: Text(widget.title, + style: TextStyle(fontSize: 20.0, color: Colors.white)), + ), + ], + ), + ), + ), + //2、第2行装饰 + Align( + alignment: Alignment.bottomLeft, + child: Container( + alignment: Alignment(0, 1), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + //crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.only(bottom: ScreenUtil().setHeight(18)), + height: ScreenUtil().setHeight(310), + decoration: BoxDecoration( + color: Color.fromRGBO(62, 88, 231, 1), + borderRadius: BorderRadius.horizontal(right: Radius.circular(20)), + ), + //color: Colors.pinkAccent, + width: ScreenUtil().setWidth(34), + alignment: Alignment.centerRight, + ), + getImageWidget(), + // Container( + // alignment: Alignment(0, 0), + // height: ScreenUtil().setHeight(346), + // width: ScreenUtil().setWidth(942), + // child: Image.asset( + // 'assets/images/装饰图片10.png', + // fit: BoxFit.cover, + // ), + // ), + Container( + height: ScreenUtil().setHeight(310), + decoration: BoxDecoration( + color: Color.fromRGBO(113, 39, 203, 1), + borderRadius: BorderRadius.horizontal(left: Radius.circular(20)), + ), + //color: Colors.pinkAccent, + width: ScreenUtil().setWidth(34), + alignment: Alignment.centerRight, + ), + ], + ), + ), + ), + ], + ), + ), + //3、第3行统计信息 + SizedBox(height: ScreenUtil().setHeight(46)), + Expanded( + //Flutter Column套ListView不显示,可将ListView用Expanded包裹起来。 + //用 ListView.builder 不好区别处理响应函数的动态参数传递,所以使用基本 ListView + // child: ListView.builder( + // itemCount: listContacts.length, + // itemBuilder: this._getlistContacts), + child: _listViewUser.isEmpty + ? getMoreWidget(color: Colors.black26) + : ListView( + padding: EdgeInsets.all(10), + children: _listViewUser, + ), + ), + Divider( + height: 20.0, + indent: 0.0, + thickness: 1.0, + color: Color.fromRGBO(80, 159, 245, 1), + ), + // Center( + // child: RaisedButton( + // //padding: EdgeInsets.all(0), + // onPressed: () { + // Navigator.pushNamed(context, '/', arguments: 0); + // }, + // //color: Colors.transparent, + // child: Text('退出登录'), + // ), + // ), + JdButton( + height: 126, + //JdText中已经使用ScreenUtil().setHeight(126),此处不能传 ScreenUtil().setHeight(126) ,否则严重错位 + width: 350, + text: "退出登录", + color: Color.fromRGBO(80, 159, 245, 1), + onTop: () { + Navigator.pushNamed(context, '/', arguments: 0); + }, + ), + SizedBox( + height: 20.0, //防止误触,所以设大一些 + ), + ], + ), + ), + onWillPop: () { + sysPop(); + }, + ); + } + + OnTap_MyAbout() { + PackageInfo.fromPlatform().then((PackageInfo packageInfo) { + String appName = packageInfo.appName; + String packageName = packageInfo.packageName; + String version = packageInfo.version; + String buildNumber = packageInfo.buildNumber; + String buildDate = + '${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}'; + Navigator.of(context) + .push(MaterialPageRoute(builder: (context) => MyAbout(ver: version, date: buildDate))); + }); + } + + OnTap_MyUpdate() { + PackageInfo.fromPlatform().then((PackageInfo packageInfo) async { + String appName = packageInfo.appName; + String packageName = packageInfo.packageName; + String version = packageInfo.version; + String buildNumber = packageInfo.buildNumber; + String buildDate = + '${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}'; + + print('appName = $appName'); + print('packageName = $packageName'); + print('version = $version'); + print('buildNumber = $buildNumber'); + print('buildDate = $buildDate'); + // I/flutter (30820): appName = 宜宾市翠屏黑烟抓拍 + // I/flutter (30820): packageName = com.flutter.hyzp_ybqx + // I/flutter (30820): version = 1.3.1 + // I/flutter (30820): buildNumber = 20210508 + // I/flutter (30820): buildDate = 2021.05.08 + + //Fluttertoast.showToast(msg: '当前版本 v$version。暂无更新', gravity: ToastGravity.CENTER); + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => MyUpdated(ver: version, date: buildDate, theContext: context))); + + MyUpdatedNew m = await MyUpdatedNew( + ver: version, + date: buildDate, + theContext: context, + bStartUpdated: true, + bShowNoNewVersion: true); + }); + } + + Future _getTotalSizeOfFilesInDir(final FileSystemEntity file) async { + if (file is File) { + int length = await file.length(); + return double.parse(length.toString()); + } + if (file is Directory) { + final List children = file.listSync(); + double total = 0; + if (children != null) + for (final FileSystemEntity child in children) + total += await _getTotalSizeOfFilesInDir(child); + return total; + } + return 0; + } + + OnTap_FaceLogin() async { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceLogin())); + } + + OnTap_FaceReg() async { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceReg())); + } + + OnTap_modify_password() { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => ModifyPassword())); + } + + OnTap_personal_data() { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => PersonalData())); + } + + OnTap_MyFeedback() { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => MyFeedback())); + } + + OnTap_UserAuthority() async { + //1、根据用户ID获取用户所属角色(用户组) + //getUserAccess(user_id: 136); + + //2.2、获取后台用户全部角色分组数据 + //I/flutter (15540): g_userInfo.userGroupIDlist = [32, 33] + // g_userInfo.userRulesMap.clear(); + // //getUserGroup(group_id: 27); + // getUserGroupAll(user_id: 136); + // + // Future.delayed(const Duration(milliseconds: 3500), () { + // print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}'); + // }); + //I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 204 + // 1, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022], 33: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 201 + // 4, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2019, 202 + // 0, 2022]} + + // getUserGroup(group_id: g_userInfo.userGroupIDlist[0]); + // print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}'); + //I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, + // 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047, + // 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022]} + + // g_userInfo.userRulesMap.clear(); + // getUserGroupAll(); + // print('g_userInfo.userGroupIDlist = ${g_userInfo.userGroupIDlist}'); + // print('g_userInfo.userGroupIDlist[0] = ${g_userInfo.userGroupIDlist[0]}'); + // getUserGroup(group_id: g_userInfo.userGroupIDlist[0]); + //I/flutter (15540): g_userInfo.userGroupIDlist = [31, 27] + //getUserGroup(group_id: g_userInfo.userGroupIDlist[1]); + + ///3、获取后台全部 (All) 用户角色分组分页列表数据 + // getRecordList(api: ServicePath.getUserGroupListUrl).then((map) { + // mapUserGroupList = map; + // }); + //I/flutter ( 1422): http://125.64.218.67:9904/?s=App.User_User.GetGroupList + // I/flutter ( 1422): 开始处理登录请求... + // I/flutter ( 1422): response = {"ret":200,"data":{"items":[{"id":35,"jgid":2,"type":0,"title":"局领导","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":34,"jgid":2,"typ + // e":0,"title":"系统管理","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":33,"jgid":2,"type":1,"title":"参观者","level":0,"pid":0,"sort":4,"status":1,"rules":"1968,1972 + // ,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,200 + // 1,2019,2020,2022"},{"id":32,"jgid":2,"type":0,"title":"演示账户","level":0,"pid":0,"sort":3,"status":1,"rules":"1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,20 + // 29,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022"},{"id":31,"jgid":2,"type":0,"title":"监 + // 控室","level":0,"pid":0,"sort":2,"status":1,"rules":""},{"id":30,"jgid":2,"type":0,"title":"中心领导","level":0,"pid":0,"sort":1,"status":1,"rules":"196 + // I/flutter ( 1422): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 35, jgid: 2, type: 0, title: 局领导, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id + // : 34, jgid: 2, type: 0, title: 系统管理, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: 参观者, level: 0, pid: 0, sort: 4, status: 1, rules + // : 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,19 + // 93,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type: 0, title: 演示账户, level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015, + // 2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title + // : 监控室, level: 0, pid: 0, sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: 中心领导, level: 0, pid: 0, sort: 1, status: 1, rules: 1968 + // I/flutter ( 1422): mapRecordList['listRecordList'] = [] + // I/flutter ( 1422): _list1 = [{id: 35, jgid: 2, type: 0, title: 局领导, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, title: 系统管理, level: 0, p + // id: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: 参观者, level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014, + // 2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type + // : 0, title: 演示账户, level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,20 + // 42,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: 监控室, level: 0, pid: 0, sort: 2, status: 1, rule + // s: }, {id: 30, jgid: 2, type: 0, title: 中心领导, level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1976,1977,1978,1979,1970,1 + // I/flutter ( 1422): mapRecordList['listRecordList'] = [{id: 35, jgid: 2, type: 0, title: 局领导, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, tit + // le: 系统管理, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: 参观者, level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976, + // 1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022 + // }, {id: 32, jgid: 2, type: 0, title: 演示账户, level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,20 + // 55,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: 监控室, level: 0, pid: 0, + // sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: 中心领导, level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1 + // I/flutter ( 1422): map['page'] = 1 + // I/flutter ( 1422): _counter = 8 + // I/flutter ( 1422): _total = 8 + + ///5、获取后台功能分类分页列表数据 + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // }); + //I/flutter ( 3512): http://125.64.218.67:9904/?s=App.User_User.GetAuthList + // I/flutter ( 3512): 开始处理登录请求... + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2069,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/fenxi","title":"分析","type":1,"status":1 + // ,"condition":"","sort":9},{"id":2068,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2 + // 067,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicll","title":"车流量统计","type":1,"status":1,"condition":"","sort":7},{"id":2066,"jgid":2,"level":2,"pid":206 + // 4,"name":"blacksmoke2/b2tj/dwinfoview/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9},{"id":2065,"jgid":2,"level":2,"pid":2064,"name":"blacksmoke2/b2tj/dwi + // nfoview/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2064,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/dwinfoview","title":"监测点位状态 + // 详情","type":1,"status":1,"condition":"","sort":6},{"id":2063,"jgid":2,"level":2,"pid":2061,"name":"blacksmoke2/b2tj/dwinfo/fenxi","title":"分析","typ + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2069, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/fenxi, title: 分析, + // type: 1, status: 1, condition: , sort: 9}, {id: 2068, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/view, title: 查看, type: 1, status: 1, condition: , sort: + // 0}, {id: 2067, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicll, title: 车流量统计, type: 1, status: 1, condition: , sort: 7}, {id: 2066, jgid: 2, level: 2, pid: + // 2064, name: blacksmoke2/b2tj/dwinfoview/fenxi, title: 分析, type: 1, status: 1, condition: , sort: 9}, {id: 2065, jgid: 2, level: 2, pid: 2064, name: blacksmoke2/b2tj/dwinfo + // view/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 2064, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/dwinfoview, title: 监测点位状态详情, type: + // 1, status: 1, condition: , sort: 6}, {id: 2063, jgid: 2, level: 2, pid: 2061, name: blacksmoke2/b2tj/dwinfo/fenxi, title: 分析, type: 1, status: 1, c + // I/flutter ( 3512): map['page'] = 1 + // I/flutter ( 3512): _counter = 20 + // I/flutter ( 3512): _total = 78 + // I/flutter ( 3512): 第 1 次网络请求过程正常完成 + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2042,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicartime","title":"车辆轨迹查询","type":1,"sta + // tus":1,"condition":"","sort":3},{"id":2041,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9}, + // {"id":2037,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2036,"jgid":2,"level":1,"pi + // d":2029,"name":"blacksmoke2/b2tj/fenxicar","title":"车辆点位频率分析","type":1,"status":1,"condition":"","sort":2},{"id":2035,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke + // 2/b2tj/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9},{"id":2034,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/outxls","title":"导出","type":1,"s + // tatus":1,"condition":"","sort":7},{"id":2031,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/view","title":"查看","type":1,"status":1,"condit + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2042, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicartime, title: 车辆轨迹 + // 查询, type: 1, status: 1, condition: , sort: 3}, {id: 2041, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/fenxi, title: 分析, type: 1, status: 1, condition: , + // sort: 9}, {id: 2037, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 2036, jgid: 2, level: 1 + // , pid: 2029, name: blacksmoke2/b2tj/fenxicar, title: 车辆点位频率分析, type: 1, status: 1, condition: , sort: 2}, {id: 2035, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b + // 2tj/fenxi, title: 分析, type: 1, status: 1, condition: , sort: 9}, {id: 2034, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/outxls, title: 导出, type: 1, status: 1, co + // ndition: , sort: 7}, {id: 2031, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, { + // I/flutter ( 3512): map['page'] = 2 + // I/flutter ( 3512): _counter = 40 + // I/flutter ( 3512): _total = 78 + // I/flutter ( 3512): 第 2 次网络请求过程正常完成 + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2008,"jgid":2,"level":1,"pid":1969,"name":"blacksmoke2/b2yjfsls/index","title":"历史数据","type":1,"status":1, + // "condition":"","sort":2},{"id":2007,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/inxls","title":"导入","type":1,"status":1,"condition":"","sort":8},{"id":2006," + // jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/outxls","title":"导出","type":1,"status":1,"condition":"","sort":7},{"id":2005,"jgid":2,"level":2,"pid":2000,"name": + // "blacksmoke2/b2dwinfo/del","title":"删除","type":1,"status":1,"condition":"","sort":4},{"id":2004,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/lock","title":"锁 + // 定","type":1,"status":1,"condition":"","sort":3},{"id":2003,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/edit","title":"编辑","type":1,"status":1,"condition":"" + // ,"sort":2},{"id":2002,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":2001 + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2008, jgid: 2, level: 1, pid: 1969, name: blacksmoke2/b2yjfsls/index, title: 历史数据, t + // ype: 1, status: 1, condition: , sort: 2}, {id: 2007, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/inxls, title: 导入, type: 1, status: 1, condition: , sort: 8}, { + // id: 2006, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/outxls, title: 导出, type: 1, status: 1, condition: , sort: 7}, {id: 2005, jgid: 2, level: 2, pid: 2000, na + // me: blacksmoke2/b2dwinfo/del, title: 删除, type: 1, status: 1, condition: , sort: 4}, {id: 2004, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/lock, title: 锁定, t + // ype: 1, status: 1, condition: , sort: 3}, {id: 2003, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/edit, title: 编辑, type: 1, status: 1, condition: , sort: 2}, {i + // d: 2002, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/add, title: 新增, type: 1, status: 1, condition: , sort: 1}, {id: 2001, jgid: 2, level: 2, + // I/flutter ( 3512): map['page'] = 3 + // I/flutter ( 3512): _counter = 60 + // I/flutter ( 3512): _total = 78 + // I/flutter ( 3512): 第 3 次网络请求过程正常完成 + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":1988,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/lock","title":"锁定","type":1,"status":1,"condi + // tion":"","sort":3},{"id":1987,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/edit","title":"编辑","type":1,"status":1,"condition":"","sort":2},{"id":1986,"jgid":2, + // "level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":1985,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2 + // /b2ledxs/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":1984,"jgid":2,"level":1,"pid":1971,"name":"blacksmoke2/b2ledxs/index","title":"LED显示设置"," + // type":1,"status":1,"condition":"","sort":1},{"id":1983,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/shenhe","title":"审核","type":1,"status":1,"condition":"","sort" + // :5},{"id":1981,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":1980,"jgid":2, + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 1988, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/lock, title: 锁定, type: 1 + // , status: 1, condition: , sort: 3}, {id: 1987, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/edit, title: 编辑, type: 1, status: 1, condition: , sort: 2}, {id: 1986 + // , jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/add, title: 新增, type: 1, status: 1, condition: , sort: 1}, {id: 1985, jgid: 2, level: 2, pid: 1984, name: blacksmo + // ke2/b2ledxs/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 1984, jgid: 2, level: 1, pid: 1971, name: blacksmoke2/b2ledxs/index, title: LED显示设置, type: + // 1, status: 1, condition: , sort: 1}, {id: 1983, jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/shenhe, title: 审核, type: 1, status: 1, condition: , sort: 5}, {id: 1981 + // , jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 1980, jgid: 2, level: 1, pid: 1970 + // I/flutter ( 3512): map['page'] = 4 + // I/flutter ( 3512): _counter = 78 + // I/flutter ( 3512): _total = 78 + + ///6、获取后台功能分类分页列表数据,然后获取用户功能权限索引map,便于直观理解和处理 + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // getUserAuth(); + // }); + + ///7、获取后台功能分类分页列表数据,然后获取用户功能路径索引map,便于直观理解和处理 + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // getUserAuthMap(value: 'name'); + // }); + + ///8、测试新的视频地址 rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016 + // urlnew = 'rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016'; + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => PlayerPro( + // url: urlnew, + // title: '点位视频测试', + // ))); + + ///9、测试新的视频地址 rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016 + // urlnew = 'rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016'; + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => PlayerPro( + // url: urlnew, + // title: '点位视频测试', + // ))); + + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // // var _jsonStr = json.encode(getUserAuthMap(value: 'name')); + // // List _list = json.decode(_jsonStr); + // + // Map map1 = {"name": "AllenSu", "area": "郑州", "sex": "男", "age": 18}; + // String _jsonStr = json.encode(map1); + // //print('_jsonStr = $_jsonStr'); + // //List _list = json.decode(_jsonStr); + // // Unhandled Exception: type '_InternalLinkedHashMap' is not a subtype of type 'List' + // Map map2 = json.decode(_jsonStr); + // //print('_list = ${_list}'); + // + // String str = json_print(map2, 1); + // List list = ['test', 'dsaf', 'swer']; + // //segmentPrint(str); + // //print('_jsonStr = ${json_print(map2, 1)}'); + // + // print('str = ${str}'); + // my_segmentPrint(str); + // + // }); + } + + Future loadCache() async { + Directory tempDir = await getTemporaryDirectory(); + double value = await _getTotalSizeOfFilesInDir(tempDir); + print('临时目录大小: ' + value.toString()); + //清除缓存 + delDir(tempDir); + } + + //递归方式删除目录 + Future delDir(FileSystemEntity file) async { + if (file is Directory) { + final List children = file.listSync(); + for (final FileSystemEntity child in children) { + await delDir(child); + } + } + await file.delete(); + } + + OnTap_ClearCache() async { + Directory tempDir = await getTemporaryDirectory(); + print('tempDir: ' + tempDir.path); + double SizeOfFiles = await _getTotalSizeOfFilesInDir(tempDir) / 1000000; + print('临时目录大小: ${SizeOfFiles.toString()} MB'); + + bool ret = await showDialog( + context: context, + builder: (context) { + myController.text = ''; + return CustomDialogF( + title: "选择操作", + content: '缓存大小:${SizeOfFiles.toString()} MB,是否清除', + ); + }); + + print('ret: $ret'); + if (ret) { + print('清除缓存...'); + //清除内存 + PaintingBinding.instance.imageCache.clear(); + //清除缓存 + delDir(tempDir); + //清空SharedPreferences + Storage.clear(); + } + } +} diff --git a/lib/pages/tabs/page4_myMsics_new.dart b/lib/pages/tabs/page4_myMsics_new.dart index 21026f4..2d666ed 100644 --- a/lib/pages/tabs/page4_myMsics_new.dart +++ b/lib/pages/tabs/page4_myMsics_new.dart @@ -9,7 +9,6 @@ import 'package:hyzp_ybqx/components/commonFun.dart'; import 'package:hyzp_ybqx/pages/Login/FaceLogin.dart'; import 'package:hyzp_ybqx/pages/Login/FaceReg.dart'; import 'package:hyzp_ybqx/pages/MyMsics/05_updated/MyUpdatedNew.dart'; -import 'package:hyzp_ybqx/pages/Works/TJXX/tj_data.dart'; import 'package:hyzp_ybqx/widget/JdButton.dart'; import 'package:package_info/package_info.dart'; import 'package:path_provider/path_provider.dart'; @@ -73,43 +72,11 @@ class _Page4_MyMsicsNewState extends State // getAdminItem(); // }); - getListView().then((value) { - Future.delayed(Duration(milliseconds: 500), () { - getAdminItem(); - }); - }); + getListView(); super.initState(); } - Future updateStatisData() async { - if (listZptjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日抓拍']) { - getAllSum('today', listZptjStatisAlone).then((value) { - mapStatisInfo['今日抓拍'] = value[1]; - try_setState(); - }); - } - - if (listShtjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日初审']) { - getAllSum('total', listShtjStatisAlone).then((value) { - mapStatisInfo['今日初审'] = value[1]; - mapStatisInfo['今日复审'] = value[1]; - try_setState(); - }); - getAllSum('sends', listShtjStatisAlone).then((value) { - mapStatisInfo['今日推送'] = value[1]; - try_setState(); - }); - } - - if (listClltjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日车流']) { - getAllSum('today', listClltjStatisAlone).then((value) { - mapStatisInfo['今日车流'] = value[1] ~/ 10000; - try_setState(); - }); - } - } - Future sysPop() async { await SystemChannels.platform.invokeMethod('SystemNavigator.pop'); } @@ -164,15 +131,14 @@ class _Page4_MyMsicsNewState extends State } List _listViewUser = []; - List _listViewUser_user = []; Color _greenColor = Color.fromRGBO(36, 206, 192, 1); //绿色 Color _deepBlueColor = Color.fromRGBO(79, 118, 230, 1); //深蓝 Color _deepGreyColor = Color.fromRGBO(116, 139, 161, 1); //深灰 Color _ligthBlueColor = Color.fromRGBO(80, 159, 245, 1); //亮蓝 - Future getListView() async { - _listViewUser_user.clear(); + getListView() { + _listViewUser.clear(); // _listViewUser.add(_getListTile('个人资料', // leadPath: 'assets/images/我的.png', // leadColor: _ligthBlueColor, @@ -190,7 +156,7 @@ class _Page4_MyMsicsNewState extends State // _listViewUser.add(_getListTile('关于', // leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout)); - _listViewUser_user = [ + _listViewUser = [ _getListTile('清除缓存', leadPath: 'assets/images/清除缓存.png', leadColor: _deepBlueColor, @@ -204,8 +170,12 @@ class _Page4_MyMsicsNewState extends State // leadPath: 'assets/images/意见反馈.png', // leadColor: _ligthBlueColor, // onTapFun: OnTap_MyFeedback), - _getListTile('修改密码', - leadPath: 'assets/images/修改密码.png', + // _getListTile('修改密码', + // leadPath: 'assets/images/修改密码.png', + // leadColor: _deepBlueColor, + // onTapFun: OnTap_modify_password), + _getListTile('账户管理', + leadPath: 'assets/images/账户管理.png', leadColor: _deepBlueColor, onTapFun: OnTap_modify_password), //bNewVer:是否发现新版本 @@ -214,6 +184,8 @@ class _Page4_MyMsicsNewState extends State leadColor: _greenColor, onTapFun: OnTap_MyUpdate, bBadge: bNewVer), + _getListTile('关于', + leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout) // _getListTile('关于', // leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout), @@ -229,7 +201,7 @@ class _Page4_MyMsicsNewState extends State //int alreadyFlag = 0; Future getAdminItem() async { - _listViewUser.addAll(_listViewUser_user); + _listViewUser.addAll(_listViewUser); for (int group_id in g_userInfo.userGroupIDlist) { print('group_id = $group_id'); if (26 == group_id || 31 == group_id) { @@ -369,12 +341,10 @@ class _Page4_MyMsicsNewState extends State // child: ListView.builder( // itemCount: listContacts.length, // itemBuilder: this._getlistContacts), - child: _listViewUser.isEmpty - ? getMoreWidget(color: Colors.black26) - : ListView( - padding: EdgeInsets.all(10), - children: _listViewUser, - ), + child: ListView( + padding: EdgeInsets.all(10), + children: _listViewUser, + ), ), Divider( height: 20.0, diff --git a/lib/pages/tabs/page5_userManager.dart b/lib/pages/tabs/page5_userManager.dart new file mode 100644 index 0000000..21026f4 --- /dev/null +++ b/lib/pages/tabs/page5_userManager.dart @@ -0,0 +1,734 @@ +import 'dart:io'; + +import 'package:badges/badges.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:hyzp_ybqx/components/commonFun.dart'; +import 'package:hyzp_ybqx/pages/Login/FaceLogin.dart'; +import 'package:hyzp_ybqx/pages/Login/FaceReg.dart'; +import 'package:hyzp_ybqx/pages/MyMsics/05_updated/MyUpdatedNew.dart'; +import 'package:hyzp_ybqx/pages/Works/TJXX/tj_data.dart'; +import 'package:hyzp_ybqx/widget/JdButton.dart'; +import 'package:package_info/package_info.dart'; +import 'package:path_provider/path_provider.dart'; + +import '../../components/commonFun.dart'; +import '../../components/customDialogF.dart'; +import '../../services/Storage.dart'; +//import 'package:hyzp_ybqx/widget/player_pro.dart'; +import '../Login/ModifyPassword.dart'; +import '../MyMsics/03_personal/PersonalData.dart'; +import '../MyMsics/04_MyFeedback/MyFeedback.dart'; +import '../MyMsics/07_myAbout/MyAbout.dart'; + +///flutter中如何获取子类Widget并调用它的方法 萤火虫离别的礼物 2019.08.07 15:46:08 https://www.jianshu.com/p/b16f70dd692c +//在flutter中开发中,会发现当子类Widget是StatefulWidget类型的时候,想要获取它的State并调用State中的方法,感觉无从下手。 +// 不像是在iOS中,可以直接调用一个类的公开的方法,flutter可以通过key来实现。每个Widget都是唯一标识的。此唯一标识对应于可选的Key参数。 +// 如果省略,Flutter将为您生成一个。key主要分为四种:GlobalKey,LocalKey,UniqueKey或ObjectKey,GlobalKey确保key是在整个应用程序唯一的, +// 这次我们就要使用它来实现。我们需要给子Widget定义一个唯一的GlobalKey,然后根据这个key获取到这个Widget,进行相关的操作,下面是相关的代码: +//这里就是关键的代码,定义一个key +//GlobalKey _myFijkPanelWidgetBuilderStateKey = new GlobalKey(); + +class Page4_MyMsicsNew extends StatefulWidget { + Page4_MyMsicsNew({@required this.pageType, this.title, Key key}) : super(key: key); + + //该美工优化的页面 Page4_MyMsicsNew,是供多个页面共享的代码框架。不同的页面以 PageType 字段进行区分 + String pageType = ''; //'my_page' + String title = ''; + + @override + _Page4_MyMsicsNewState createState() => _Page4_MyMsicsNewState(); +} + +//class _Page1WorkState extends State with WidgetsBindingObserver, AutomaticKeepAliveClientMixin { +class _Page4_MyMsicsNewState extends State + with WidgetsBindingObserver, AutomaticKeepAliveClientMixin { + //Begin:底部导航栏,使用PageView方式,配置每页面的保持状态。必须添加继承:with AutomaticKeepAliveClientMixin + + //try_setState(); //避免异常报错 + try_setState() { + try { + setState(() {}); + } catch (e) { + print('setState(() {})异常:${e}'); + } + } + + @override + // TODO: implement wantKeepAlive + bool get wantKeepAlive => true; + + //End:底部导航栏,使用PageView方式,配置每页面的保持状态 + + // final FijkPlayer player = FijkPlayer(); + // bool bFirstPlay; + + @override + void initState() { + //监听 g_userInfo.userGroupIDlist 更新事件 + // eventBus.on().listen((event) async { + // print(event.str); + // getAdminItem(); + // }); + + getListView().then((value) { + Future.delayed(Duration(milliseconds: 500), () { + getAdminItem(); + }); + }); + + super.initState(); + } + + Future updateStatisData() async { + if (listZptjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日抓拍']) { + getAllSum('today', listZptjStatisAlone).then((value) { + mapStatisInfo['今日抓拍'] = value[1]; + try_setState(); + }); + } + + if (listShtjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日初审']) { + getAllSum('total', listShtjStatisAlone).then((value) { + mapStatisInfo['今日初审'] = value[1]; + mapStatisInfo['今日复审'] = value[1]; + try_setState(); + }); + getAllSum('sends', listShtjStatisAlone).then((value) { + mapStatisInfo['今日推送'] = value[1]; + try_setState(); + }); + } + + if (listClltjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日车流']) { + getAllSum('today', listClltjStatisAlone).then((value) { + mapStatisInfo['今日车流'] = value[1] ~/ 10000; + try_setState(); + }); + } + } + + Future sysPop() async { + await SystemChannels.platform.invokeMethod('SystemNavigator.pop'); + } + + _Page4_MyMsicsNewState(); + + @override + void dispose() { + super.dispose(); + } + + //自定义方法 + static onNullFun() {} + + Widget _getListTile(title, + {String leadPath = '', + Color leadColor, + onTapFun = onNullFun, + onLongPressFun = onNullFun, + size = 16.0, + bool bBadge = false}) { + return Column( + children: [ + ListTile( + leading: bBadge + ? Badge( + position: BadgePosition.topEnd(top: -7, end: -12), + badgeContent: null, + child: Image.asset( + leadPath, + height: ScreenUtil().setHeight(78), + fit: BoxFit.fitHeight, + ), + ) + : Image.asset( + leadPath, + height: ScreenUtil().setHeight(78), + fit: BoxFit.fitHeight, + ), + title: new Text(title, style: TextStyle(fontSize: size)), + trailing: new Icon(Icons.arrow_forward_ios), + contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0), + enabled: true, + onTap: onTapFun, + onLongPress: onLongPressFun, + ), + Divider( + height: 1.0, + ), + ], + ); + } + + List _listViewUser = []; + List _listViewUser_user = []; + + Color _greenColor = Color.fromRGBO(36, 206, 192, 1); //绿色 + Color _deepBlueColor = Color.fromRGBO(79, 118, 230, 1); //深蓝 + Color _deepGreyColor = Color.fromRGBO(116, 139, 161, 1); //深灰 + Color _ligthBlueColor = Color.fromRGBO(80, 159, 245, 1); //亮蓝 + + Future getListView() async { + _listViewUser_user.clear(); + // _listViewUser.add(_getListTile('个人资料', + // leadPath: 'assets/images/我的.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_personal_data)); + // _listViewUser.add(_getListTile('意见反馈', + // leadPath: 'assets/images/意见反馈.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_MyFeedback)); + // _listViewUser.add(_getListTile('版本更新', + // leadPath: 'assets/images/版本更新.png', leadColor: _greenColor, onTapFun: OnTap_MyUpdate)); + // _listViewUser.add(_getListTile('清除缓存', + // leadPath: 'assets/images/清除缓存.png', + // leadColor: _deepBlueColor, + // onTapFun: OnTap_ClearCache)); + // _listViewUser.add(_getListTile('关于', + // leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout)); + + _listViewUser_user = [ + _getListTile('清除缓存', + leadPath: 'assets/images/清除缓存.png', + leadColor: _deepBlueColor, + onTapFun: OnTap_ClearCache), + //用户资料修改、版本更新、意见反馈都需要后台支持才行,现在后台都没有提供支持,标书里面也没有要求,建议先去掉 + // _getListTile('个人资料', + // leadPath: 'assets/images/我的.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_personal_data), + // _getListTile('意见反馈', + // leadPath: 'assets/images/意见反馈.png', + // leadColor: _ligthBlueColor, + // onTapFun: OnTap_MyFeedback), + _getListTile('修改密码', + leadPath: 'assets/images/修改密码.png', + leadColor: _deepBlueColor, + onTapFun: OnTap_modify_password), + //bNewVer:是否发现新版本 + _getListTile('版本更新', + leadPath: 'assets/images/版本更新.png', + leadColor: _greenColor, + onTapFun: OnTap_MyUpdate, + bBadge: bNewVer), + + // _getListTile('关于', + // leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout), + // _getListTile('权限测试', + // leadPath: 'assets/images/权限.png', + // leadColor: _deepGreyColor, + // onTapFun: OnTap_UserAuthority), + ]; + } + + //已添加管理员记录的标志,0 未添加, 1 已添加 1 次 + //该标志也作为是否是管理员的标志,若为 0 便不是、只是当前还不是, 1 则是管理员 + //int alreadyFlag = 0; + + Future getAdminItem() async { + _listViewUser.addAll(_listViewUser_user); + for (int group_id in g_userInfo.userGroupIDlist) { + print('group_id = $group_id'); + if (26 == group_id || 31 == group_id) { + Widget _item = _getListTile('人脸注册', + leadPath: 'assets/images/人脸注册.png', + leadColor: _ligthBlueColor, + onTapFun: OnTap_FaceReg); + print('_listViewUser.length = ${_listViewUser.length}'); + _listViewUser.add(_item); + break; //添加后便跳出循环,避免重复添加 + } + } + + _listViewUser.add(_getListTile('关于', + leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout)); + print('_listViewUser.length = ${_listViewUser.length}'); + Future.delayed(Duration(milliseconds: 500), () { + try_setState(); + }); + } + + @override + Widget build(BuildContext context) { + return WillPopScope( + child: Container( + decoration: new BoxDecoration( + color: Color.fromRGBO(244, 244, 244, 1), //设置背景色 + ), + child: Column( + children: [ + Container( + height: ScreenUtil().setHeight(484), //530 - 46 + child: Stack( + children: [ + //1、第1行文字 + Positioned( + child: Container( + height: ScreenUtil().setHeight(324), //181 + alignment: Alignment.topCenter, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromRGBO(12, 186, 156, 1), + Color.fromRGBO(39, 127, 235, 1), + ], + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + //crossAxisAlignment: CrossAxisAlignment.start, //用的比较少 + children: [ + FlatButton( + child: Container( + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(top: ScreenUtil().setHeight(10)), + child: Text(""), + // child: Image.asset( + // 'assets/images/形状 2.png', + // height: ScreenUtil().setHeight(45), + // ), + ), + Text(" ", //" 客服热线", + style: TextStyle(fontSize: 16, color: Colors.white)), + ], + ), + ), + onPressed: () {} + // onPressed: () => launch("tel://18784678300"), + ), + SizedBox( + width: ScreenUtil().setWidth(45), + ), + Expanded( + child: Text(widget.title, + style: TextStyle(fontSize: 20.0, color: Colors.white)), + ), + ], + ), + ), + ), + //2、第2行装饰 + Align( + alignment: Alignment.bottomLeft, + child: Container( + alignment: Alignment(0, 1), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + //crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.only(bottom: ScreenUtil().setHeight(18)), + height: ScreenUtil().setHeight(310), + decoration: BoxDecoration( + color: Color.fromRGBO(62, 88, 231, 1), + borderRadius: BorderRadius.horizontal(right: Radius.circular(20)), + ), + //color: Colors.pinkAccent, + width: ScreenUtil().setWidth(34), + alignment: Alignment.centerRight, + ), + getImageWidget(), + // Container( + // alignment: Alignment(0, 0), + // height: ScreenUtil().setHeight(346), + // width: ScreenUtil().setWidth(942), + // child: Image.asset( + // 'assets/images/装饰图片10.png', + // fit: BoxFit.cover, + // ), + // ), + Container( + height: ScreenUtil().setHeight(310), + decoration: BoxDecoration( + color: Color.fromRGBO(113, 39, 203, 1), + borderRadius: BorderRadius.horizontal(left: Radius.circular(20)), + ), + //color: Colors.pinkAccent, + width: ScreenUtil().setWidth(34), + alignment: Alignment.centerRight, + ), + ], + ), + ), + ), + ], + ), + ), + //3、第3行统计信息 + SizedBox(height: ScreenUtil().setHeight(46)), + Expanded( + //Flutter Column套ListView不显示,可将ListView用Expanded包裹起来。 + //用 ListView.builder 不好区别处理响应函数的动态参数传递,所以使用基本 ListView + // child: ListView.builder( + // itemCount: listContacts.length, + // itemBuilder: this._getlistContacts), + child: _listViewUser.isEmpty + ? getMoreWidget(color: Colors.black26) + : ListView( + padding: EdgeInsets.all(10), + children: _listViewUser, + ), + ), + Divider( + height: 20.0, + indent: 0.0, + thickness: 1.0, + color: Color.fromRGBO(80, 159, 245, 1), + ), + // Center( + // child: RaisedButton( + // //padding: EdgeInsets.all(0), + // onPressed: () { + // Navigator.pushNamed(context, '/', arguments: 0); + // }, + // //color: Colors.transparent, + // child: Text('退出登录'), + // ), + // ), + JdButton( + height: 126, + //JdText中已经使用ScreenUtil().setHeight(126),此处不能传 ScreenUtil().setHeight(126) ,否则严重错位 + width: 350, + text: "退出登录", + color: Color.fromRGBO(80, 159, 245, 1), + onTop: () { + Navigator.pushNamed(context, '/', arguments: 0); + }, + ), + SizedBox( + height: 20.0, //防止误触,所以设大一些 + ), + ], + ), + ), + onWillPop: () { + sysPop(); + }, + ); + } + + OnTap_MyAbout() { + PackageInfo.fromPlatform().then((PackageInfo packageInfo) { + String appName = packageInfo.appName; + String packageName = packageInfo.packageName; + String version = packageInfo.version; + String buildNumber = packageInfo.buildNumber; + String buildDate = + '${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}'; + Navigator.of(context) + .push(MaterialPageRoute(builder: (context) => MyAbout(ver: version, date: buildDate))); + }); + } + + OnTap_MyUpdate() { + PackageInfo.fromPlatform().then((PackageInfo packageInfo) async { + String appName = packageInfo.appName; + String packageName = packageInfo.packageName; + String version = packageInfo.version; + String buildNumber = packageInfo.buildNumber; + String buildDate = + '${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}'; + + print('appName = $appName'); + print('packageName = $packageName'); + print('version = $version'); + print('buildNumber = $buildNumber'); + print('buildDate = $buildDate'); + // I/flutter (30820): appName = 宜宾市翠屏黑烟抓拍 + // I/flutter (30820): packageName = com.flutter.hyzp_ybqx + // I/flutter (30820): version = 1.3.1 + // I/flutter (30820): buildNumber = 20210508 + // I/flutter (30820): buildDate = 2021.05.08 + + //Fluttertoast.showToast(msg: '当前版本 v$version。暂无更新', gravity: ToastGravity.CENTER); + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => MyUpdated(ver: version, date: buildDate, theContext: context))); + + MyUpdatedNew m = await MyUpdatedNew( + ver: version, + date: buildDate, + theContext: context, + bStartUpdated: true, + bShowNoNewVersion: true); + }); + } + + Future _getTotalSizeOfFilesInDir(final FileSystemEntity file) async { + if (file is File) { + int length = await file.length(); + return double.parse(length.toString()); + } + if (file is Directory) { + final List children = file.listSync(); + double total = 0; + if (children != null) + for (final FileSystemEntity child in children) + total += await _getTotalSizeOfFilesInDir(child); + return total; + } + return 0; + } + + OnTap_FaceLogin() async { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceLogin())); + } + + OnTap_FaceReg() async { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceReg())); + } + + OnTap_modify_password() { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => ModifyPassword())); + } + + OnTap_personal_data() { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => PersonalData())); + } + + OnTap_MyFeedback() { + Navigator.of(context).push(MaterialPageRoute(builder: (context) => MyFeedback())); + } + + OnTap_UserAuthority() async { + //1、根据用户ID获取用户所属角色(用户组) + //getUserAccess(user_id: 136); + + //2.2、获取后台用户全部角色分组数据 + //I/flutter (15540): g_userInfo.userGroupIDlist = [32, 33] + // g_userInfo.userRulesMap.clear(); + // //getUserGroup(group_id: 27); + // getUserGroupAll(user_id: 136); + // + // Future.delayed(const Duration(milliseconds: 3500), () { + // print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}'); + // }); + //I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 204 + // 1, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022], 33: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 201 + // 4, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2019, 202 + // 0, 2022]} + + // getUserGroup(group_id: g_userInfo.userGroupIDlist[0]); + // print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}'); + //I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, + // 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047, + // 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022]} + + // g_userInfo.userRulesMap.clear(); + // getUserGroupAll(); + // print('g_userInfo.userGroupIDlist = ${g_userInfo.userGroupIDlist}'); + // print('g_userInfo.userGroupIDlist[0] = ${g_userInfo.userGroupIDlist[0]}'); + // getUserGroup(group_id: g_userInfo.userGroupIDlist[0]); + //I/flutter (15540): g_userInfo.userGroupIDlist = [31, 27] + //getUserGroup(group_id: g_userInfo.userGroupIDlist[1]); + + ///3、获取后台全部 (All) 用户角色分组分页列表数据 + // getRecordList(api: ServicePath.getUserGroupListUrl).then((map) { + // mapUserGroupList = map; + // }); + //I/flutter ( 1422): http://125.64.218.67:9904/?s=App.User_User.GetGroupList + // I/flutter ( 1422): 开始处理登录请求... + // I/flutter ( 1422): response = {"ret":200,"data":{"items":[{"id":35,"jgid":2,"type":0,"title":"局领导","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":34,"jgid":2,"typ + // e":0,"title":"系统管理","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":33,"jgid":2,"type":1,"title":"参观者","level":0,"pid":0,"sort":4,"status":1,"rules":"1968,1972 + // ,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,200 + // 1,2019,2020,2022"},{"id":32,"jgid":2,"type":0,"title":"演示账户","level":0,"pid":0,"sort":3,"status":1,"rules":"1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,20 + // 29,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022"},{"id":31,"jgid":2,"type":0,"title":"监 + // 控室","level":0,"pid":0,"sort":2,"status":1,"rules":""},{"id":30,"jgid":2,"type":0,"title":"中心领导","level":0,"pid":0,"sort":1,"status":1,"rules":"196 + // I/flutter ( 1422): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 35, jgid: 2, type: 0, title: 局领导, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id + // : 34, jgid: 2, type: 0, title: 系统管理, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: 参观者, level: 0, pid: 0, sort: 4, status: 1, rules + // : 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,19 + // 93,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type: 0, title: 演示账户, level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015, + // 2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title + // : 监控室, level: 0, pid: 0, sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: 中心领导, level: 0, pid: 0, sort: 1, status: 1, rules: 1968 + // I/flutter ( 1422): mapRecordList['listRecordList'] = [] + // I/flutter ( 1422): _list1 = [{id: 35, jgid: 2, type: 0, title: 局领导, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, title: 系统管理, level: 0, p + // id: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: 参观者, level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014, + // 2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type + // : 0, title: 演示账户, level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,20 + // 42,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: 监控室, level: 0, pid: 0, sort: 2, status: 1, rule + // s: }, {id: 30, jgid: 2, type: 0, title: 中心领导, level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1976,1977,1978,1979,1970,1 + // I/flutter ( 1422): mapRecordList['listRecordList'] = [{id: 35, jgid: 2, type: 0, title: 局领导, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, tit + // le: 系统管理, level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: 参观者, level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976, + // 1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022 + // }, {id: 32, jgid: 2, type: 0, title: 演示账户, level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,20 + // 55,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: 监控室, level: 0, pid: 0, + // sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: 中心领导, level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1 + // I/flutter ( 1422): map['page'] = 1 + // I/flutter ( 1422): _counter = 8 + // I/flutter ( 1422): _total = 8 + + ///5、获取后台功能分类分页列表数据 + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // }); + //I/flutter ( 3512): http://125.64.218.67:9904/?s=App.User_User.GetAuthList + // I/flutter ( 3512): 开始处理登录请求... + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2069,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/fenxi","title":"分析","type":1,"status":1 + // ,"condition":"","sort":9},{"id":2068,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2 + // 067,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicll","title":"车流量统计","type":1,"status":1,"condition":"","sort":7},{"id":2066,"jgid":2,"level":2,"pid":206 + // 4,"name":"blacksmoke2/b2tj/dwinfoview/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9},{"id":2065,"jgid":2,"level":2,"pid":2064,"name":"blacksmoke2/b2tj/dwi + // nfoview/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2064,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/dwinfoview","title":"监测点位状态 + // 详情","type":1,"status":1,"condition":"","sort":6},{"id":2063,"jgid":2,"level":2,"pid":2061,"name":"blacksmoke2/b2tj/dwinfo/fenxi","title":"分析","typ + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2069, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/fenxi, title: 分析, + // type: 1, status: 1, condition: , sort: 9}, {id: 2068, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/view, title: 查看, type: 1, status: 1, condition: , sort: + // 0}, {id: 2067, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicll, title: 车流量统计, type: 1, status: 1, condition: , sort: 7}, {id: 2066, jgid: 2, level: 2, pid: + // 2064, name: blacksmoke2/b2tj/dwinfoview/fenxi, title: 分析, type: 1, status: 1, condition: , sort: 9}, {id: 2065, jgid: 2, level: 2, pid: 2064, name: blacksmoke2/b2tj/dwinfo + // view/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 2064, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/dwinfoview, title: 监测点位状态详情, type: + // 1, status: 1, condition: , sort: 6}, {id: 2063, jgid: 2, level: 2, pid: 2061, name: blacksmoke2/b2tj/dwinfo/fenxi, title: 分析, type: 1, status: 1, c + // I/flutter ( 3512): map['page'] = 1 + // I/flutter ( 3512): _counter = 20 + // I/flutter ( 3512): _total = 78 + // I/flutter ( 3512): 第 1 次网络请求过程正常完成 + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2042,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicartime","title":"车辆轨迹查询","type":1,"sta + // tus":1,"condition":"","sort":3},{"id":2041,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9}, + // {"id":2037,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2036,"jgid":2,"level":1,"pi + // d":2029,"name":"blacksmoke2/b2tj/fenxicar","title":"车辆点位频率分析","type":1,"status":1,"condition":"","sort":2},{"id":2035,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke + // 2/b2tj/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9},{"id":2034,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/outxls","title":"导出","type":1,"s + // tatus":1,"condition":"","sort":7},{"id":2031,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/view","title":"查看","type":1,"status":1,"condit + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2042, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicartime, title: 车辆轨迹 + // 查询, type: 1, status: 1, condition: , sort: 3}, {id: 2041, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/fenxi, title: 分析, type: 1, status: 1, condition: , + // sort: 9}, {id: 2037, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 2036, jgid: 2, level: 1 + // , pid: 2029, name: blacksmoke2/b2tj/fenxicar, title: 车辆点位频率分析, type: 1, status: 1, condition: , sort: 2}, {id: 2035, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b + // 2tj/fenxi, title: 分析, type: 1, status: 1, condition: , sort: 9}, {id: 2034, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/outxls, title: 导出, type: 1, status: 1, co + // ndition: , sort: 7}, {id: 2031, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, { + // I/flutter ( 3512): map['page'] = 2 + // I/flutter ( 3512): _counter = 40 + // I/flutter ( 3512): _total = 78 + // I/flutter ( 3512): 第 2 次网络请求过程正常完成 + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2008,"jgid":2,"level":1,"pid":1969,"name":"blacksmoke2/b2yjfsls/index","title":"历史数据","type":1,"status":1, + // "condition":"","sort":2},{"id":2007,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/inxls","title":"导入","type":1,"status":1,"condition":"","sort":8},{"id":2006," + // jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/outxls","title":"导出","type":1,"status":1,"condition":"","sort":7},{"id":2005,"jgid":2,"level":2,"pid":2000,"name": + // "blacksmoke2/b2dwinfo/del","title":"删除","type":1,"status":1,"condition":"","sort":4},{"id":2004,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/lock","title":"锁 + // 定","type":1,"status":1,"condition":"","sort":3},{"id":2003,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/edit","title":"编辑","type":1,"status":1,"condition":"" + // ,"sort":2},{"id":2002,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":2001 + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2008, jgid: 2, level: 1, pid: 1969, name: blacksmoke2/b2yjfsls/index, title: 历史数据, t + // ype: 1, status: 1, condition: , sort: 2}, {id: 2007, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/inxls, title: 导入, type: 1, status: 1, condition: , sort: 8}, { + // id: 2006, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/outxls, title: 导出, type: 1, status: 1, condition: , sort: 7}, {id: 2005, jgid: 2, level: 2, pid: 2000, na + // me: blacksmoke2/b2dwinfo/del, title: 删除, type: 1, status: 1, condition: , sort: 4}, {id: 2004, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/lock, title: 锁定, t + // ype: 1, status: 1, condition: , sort: 3}, {id: 2003, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/edit, title: 编辑, type: 1, status: 1, condition: , sort: 2}, {i + // d: 2002, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/add, title: 新增, type: 1, status: 1, condition: , sort: 1}, {id: 2001, jgid: 2, level: 2, + // I/flutter ( 3512): map['page'] = 3 + // I/flutter ( 3512): _counter = 60 + // I/flutter ( 3512): _total = 78 + // I/flutter ( 3512): 第 3 次网络请求过程正常完成 + // I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":1988,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/lock","title":"锁定","type":1,"status":1,"condi + // tion":"","sort":3},{"id":1987,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/edit","title":"编辑","type":1,"status":1,"condition":"","sort":2},{"id":1986,"jgid":2, + // "level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":1985,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2 + // /b2ledxs/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":1984,"jgid":2,"level":1,"pid":1971,"name":"blacksmoke2/b2ledxs/index","title":"LED显示设置"," + // type":1,"status":1,"condition":"","sort":1},{"id":1983,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/shenhe","title":"审核","type":1,"status":1,"condition":"","sort" + // :5},{"id":1981,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":1980,"jgid":2, + // I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 1988, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/lock, title: 锁定, type: 1 + // , status: 1, condition: , sort: 3}, {id: 1987, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/edit, title: 编辑, type: 1, status: 1, condition: , sort: 2}, {id: 1986 + // , jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/add, title: 新增, type: 1, status: 1, condition: , sort: 1}, {id: 1985, jgid: 2, level: 2, pid: 1984, name: blacksmo + // ke2/b2ledxs/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 1984, jgid: 2, level: 1, pid: 1971, name: blacksmoke2/b2ledxs/index, title: LED显示设置, type: + // 1, status: 1, condition: , sort: 1}, {id: 1983, jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/shenhe, title: 审核, type: 1, status: 1, condition: , sort: 5}, {id: 1981 + // , jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/view, title: 查看, type: 1, status: 1, condition: , sort: 0}, {id: 1980, jgid: 2, level: 1, pid: 1970 + // I/flutter ( 3512): map['page'] = 4 + // I/flutter ( 3512): _counter = 78 + // I/flutter ( 3512): _total = 78 + + ///6、获取后台功能分类分页列表数据,然后获取用户功能权限索引map,便于直观理解和处理 + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // getUserAuth(); + // }); + + ///7、获取后台功能分类分页列表数据,然后获取用户功能路径索引map,便于直观理解和处理 + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // getUserAuthMap(value: 'name'); + // }); + + ///8、测试新的视频地址 rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016 + // urlnew = 'rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016'; + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => PlayerPro( + // url: urlnew, + // title: '点位视频测试', + // ))); + + ///9、测试新的视频地址 rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016 + // urlnew = 'rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016'; + // Navigator.of(context).push(MaterialPageRoute( + // builder: (context) => PlayerPro( + // url: urlnew, + // title: '点位视频测试', + // ))); + + // getRecordList(api: ServicePath.getUserAuthListUrl).then((map) { + // mapUserAuthList = map; + // // var _jsonStr = json.encode(getUserAuthMap(value: 'name')); + // // List _list = json.decode(_jsonStr); + // + // Map map1 = {"name": "AllenSu", "area": "郑州", "sex": "男", "age": 18}; + // String _jsonStr = json.encode(map1); + // //print('_jsonStr = $_jsonStr'); + // //List _list = json.decode(_jsonStr); + // // Unhandled Exception: type '_InternalLinkedHashMap' is not a subtype of type 'List' + // Map map2 = json.decode(_jsonStr); + // //print('_list = ${_list}'); + // + // String str = json_print(map2, 1); + // List list = ['test', 'dsaf', 'swer']; + // //segmentPrint(str); + // //print('_jsonStr = ${json_print(map2, 1)}'); + // + // print('str = ${str}'); + // my_segmentPrint(str); + // + // }); + } + + Future loadCache() async { + Directory tempDir = await getTemporaryDirectory(); + double value = await _getTotalSizeOfFilesInDir(tempDir); + print('临时目录大小: ' + value.toString()); + //清除缓存 + delDir(tempDir); + } + + //递归方式删除目录 + Future delDir(FileSystemEntity file) async { + if (file is Directory) { + final List children = file.listSync(); + for (final FileSystemEntity child in children) { + await delDir(child); + } + } + await file.delete(); + } + + OnTap_ClearCache() async { + Directory tempDir = await getTemporaryDirectory(); + print('tempDir: ' + tempDir.path); + double SizeOfFiles = await _getTotalSizeOfFilesInDir(tempDir) / 1000000; + print('临时目录大小: ${SizeOfFiles.toString()} MB'); + + bool ret = await showDialog( + context: context, + builder: (context) { + myController.text = ''; + return CustomDialogF( + title: "选择操作", + content: '缓存大小:${SizeOfFiles.toString()} MB,是否清除', + ); + }); + + print('ret: $ret'); + if (ret) { + print('清除缓存...'); + //清除内存 + PaintingBinding.instance.imageCache.clear(); + //清除缓存 + delDir(tempDir); + //清空SharedPreferences + Storage.clear(); + } + } +}