Showing
1 changed file
with
85 additions
and
88 deletions
| @@ -3932,99 +3932,100 @@ class InvicationPageState extends State<InvicationPage> | @@ -3932,99 +3932,100 @@ class InvicationPageState extends State<InvicationPage> | ||
| 3932 | _getCallLog() async { | 3932 | _getCallLog() async { |
| 3933 | try { | 3933 | try { |
| 3934 | Iterable<CallLogEntry> result = await CallLog.query(); | 3934 | Iterable<CallLogEntry> result = await CallLog.query(); |
| 3935 | - List<Picker.PickerItem<dynamic>> data = []; | 3935 | + List<Picker.PickerItem<dynamic>> data = []; |
| 3936 | 3936 | ||
| 3937 | - List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); | 3937 | + List<CallLogEntry> object = Utils.removeDuplicates(result.toList()); |
| 3938 | 3938 | ||
| 3939 | - print(object); | 3939 | + print(object); |
| 3940 | 3940 | ||
| 3941 | - _baseIndoProvider.userHistorys = []; | ||
| 3942 | - showPhoneHistory = false; | ||
| 3943 | - // setState(() {}); | ||
| 3944 | - | ||
| 3945 | - object.forEach((element) { | ||
| 3946 | - _baseIndoProvider.userHistorys.add(UserHistoryEntity( | ||
| 3947 | - '', '', element.name ?? '', '1', element.number, '', '', '')); | ||
| 3948 | - | ||
| 3949 | - String title = ''; | ||
| 3950 | - title += ' ${element.number ?? ''}'; | ||
| 3951 | - if (element.name != null && element.name != '') { | ||
| 3952 | - title += ' ${element.name}'; | ||
| 3953 | - } | ||
| 3954 | - | ||
| 3955 | - String stateStr = ''; //状态 | ||
| 3956 | - | ||
| 3957 | - if (element.callType.name == 'incoming' || | ||
| 3958 | - element.callType.name == 'wifiIncoming' || | ||
| 3959 | - element.callType.name == 'answeredExternally') { | ||
| 3960 | - stateStr = ' 呼入'; | ||
| 3961 | - } else if (element.callType.name == 'outgoing' || | ||
| 3962 | - element.callType.name == 'wifiOutgoing' || | ||
| 3963 | - element.callType.name == 'voiceMail') { | ||
| 3964 | - stateStr = ' 呼出'; | ||
| 3965 | - } else if (element.callType.name == 'missed') { | ||
| 3966 | - stateStr = ' 未接'; | ||
| 3967 | - } else if (element.callType.name == 'rejected') { | ||
| 3968 | - stateStr = ' 拒接'; | ||
| 3969 | - } else if (element.callType.name == 'blocked') { | ||
| 3970 | - stateStr = ' 拦截'; | ||
| 3971 | - } | ||
| 3972 | - | ||
| 3973 | - String sunString = | ||
| 3974 | - Utils.formatCallLogFromMill(element.timestamp.toString()); | ||
| 3975 | - | ||
| 3976 | - data.add(Picker.PickerItem( | ||
| 3977 | - text: Row( | ||
| 3978 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 3979 | - children: [ | ||
| 3980 | - Expanded( | ||
| 3981 | - child: Row( | ||
| 3982 | - children: [ | ||
| 3983 | - HEmptyView(30), | ||
| 3984 | - Text(title ?? '', | ||
| 3985 | - style: TextStyle( | ||
| 3986 | - fontSize: font(16), color: MyColours.color_515151)), | ||
| 3987 | - Expanded( | ||
| 3988 | - child: Text(stateStr ?? '', | ||
| 3989 | - style: TextStyle( | ||
| 3990 | - fontSize: font(16), | ||
| 3991 | - color: MyColours.color_26000000))), | ||
| 3992 | - ], | ||
| 3993 | - )), | ||
| 3994 | - Container( | ||
| 3995 | - margin: EdgeInsets.only(right: w(15)), | ||
| 3996 | - child: Text(sunString ?? '', | ||
| 3997 | - style: TextStyle( | ||
| 3998 | - fontSize: font(16), color: MyColours.color_515151))) | ||
| 3999 | - ], | ||
| 4000 | - ))); | ||
| 4001 | - }); | ||
| 4002 | - if (data.length > 0) { | ||
| 4003 | - //有记录,底部弹窗展示 | ||
| 4004 | - // showPhoneHistory = true; | 3941 | + _baseIndoProvider.userHistorys = []; |
| 3942 | + showPhoneHistory = false; | ||
| 4005 | // setState(() {}); | 3943 | // setState(() {}); |
| 4006 | - DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 4007 | - if (value != null) { | ||
| 4008 | - UserHistoryEntity userHistoryEntity = | ||
| 4009 | - _baseIndoProvider.userHistorys[value[0]]; | ||
| 4010 | 3944 | ||
| 4011 | - sexStr = userHistoryEntity.sexStr; | 3945 | + object.forEach((element) { |
| 3946 | + _baseIndoProvider.userHistorys.add(UserHistoryEntity( | ||
| 3947 | + '', '', element.name ?? '', '1', element.number, '', '', '')); | ||
| 4012 | 3948 | ||
| 4013 | - sexSelectIndex = sexList.indexOf(sexStr); | 3949 | + String title = ''; |
| 3950 | + title += ' ${element.number ?? ''}'; | ||
| 3951 | + if (element.name != null && element.name != '') { | ||
| 3952 | + title += ' ${element.name}'; | ||
| 3953 | + } | ||
| 4014 | 3954 | ||
| 4015 | - _getIsMemberByPhone(userHistoryEntity.phone); | ||
| 4016 | - needHistory = true; | ||
| 4017 | - _showConfirmWidget(needHistory: true, index: value[0]); | 3955 | + String stateStr = ''; //状态 |
| 3956 | + | ||
| 3957 | + if (element.callType.name == 'incoming' || | ||
| 3958 | + element.callType.name == 'wifiIncoming' || | ||
| 3959 | + element.callType.name == 'answeredExternally') { | ||
| 3960 | + stateStr = ' 呼入'; | ||
| 3961 | + } else if (element.callType.name == 'outgoing' || | ||
| 3962 | + element.callType.name == 'wifiOutgoing' || | ||
| 3963 | + element.callType.name == 'voiceMail') { | ||
| 3964 | + stateStr = ' 呼出'; | ||
| 3965 | + } else if (element.callType.name == 'missed') { | ||
| 3966 | + stateStr = ' 未接'; | ||
| 3967 | + } else if (element.callType.name == 'rejected') { | ||
| 3968 | + stateStr = ' 拒接'; | ||
| 3969 | + } else if (element.callType.name == 'blocked') { | ||
| 3970 | + stateStr = ' 拦截'; | ||
| 4018 | } | 3971 | } |
| 4019 | - }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 4020 | - // _getFirSelected(hourAndMinute, data), | ||
| 4021 | - // _getSecSelected(hourAndMinute) | ||
| 4022 | - ]).then((value) { | ||
| 4023 | - print(value); | 3972 | + |
| 3973 | + String sunString = | ||
| 3974 | + Utils.formatCallLogFromMill(element.timestamp.toString()); | ||
| 3975 | + | ||
| 3976 | + data.add(Picker.PickerItem( | ||
| 3977 | + text: Row( | ||
| 3978 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 3979 | + children: [ | ||
| 3980 | + Expanded( | ||
| 3981 | + child: Row( | ||
| 3982 | + children: [ | ||
| 3983 | + HEmptyView(30), | ||
| 3984 | + Text(title ?? '', | ||
| 3985 | + style: TextStyle( | ||
| 3986 | + fontSize: font(16), color: MyColours.color_515151)), | ||
| 3987 | + Expanded( | ||
| 3988 | + child: Text(stateStr ?? '', | ||
| 3989 | + style: TextStyle( | ||
| 3990 | + fontSize: font(16), | ||
| 3991 | + color: MyColours.color_26000000))), | ||
| 3992 | + ], | ||
| 3993 | + )), | ||
| 3994 | + Container( | ||
| 3995 | + margin: EdgeInsets.only(right: w(15)), | ||
| 3996 | + child: Text(sunString ?? '', | ||
| 3997 | + style: TextStyle( | ||
| 3998 | + fontSize: font(16), color: MyColours.color_515151))) | ||
| 3999 | + ], | ||
| 4000 | + ))); | ||
| 4024 | }); | 4001 | }); |
| 4025 | - } else { | ||
| 4026 | - Utils.showToast('暂无通话记录!'); | ||
| 4027 | - } | 4002 | + if (data.length > 0) { |
| 4003 | + //有记录,底部弹窗展示 | ||
| 4004 | + // showPhoneHistory = true; | ||
| 4005 | + // setState(() {}); | ||
| 4006 | + DialogUtil.showSelectCusmanWidgetDialog(context, data, (value) { | ||
| 4007 | + if (value != null) { | ||
| 4008 | + UserHistoryEntity userHistoryEntity = | ||
| 4009 | + _baseIndoProvider.userHistorys[value[0]]; | ||
| 4010 | + | ||
| 4011 | + sexStr = userHistoryEntity.sexStr; | ||
| 4012 | + | ||
| 4013 | + sexSelectIndex = sexList.indexOf(sexStr); | ||
| 4014 | + | ||
| 4015 | + _getIsMemberByPhone(userHistoryEntity.phone); | ||
| 4016 | + needHistory = true; | ||
| 4017 | + _showConfirmWidget(needHistory: true, index: value[0]); | ||
| 4018 | + } | ||
| 4019 | + }, title: '从通话记录选择客人电话', selecteds: [ | ||
| 4020 | + // _getFirSelected(hourAndMinute, data), | ||
| 4021 | + // _getSecSelected(hourAndMinute) | ||
| 4022 | + ]).then((value) { | ||
| 4023 | + print(value); | ||
| 4024 | + }); | ||
| 4025 | + } else { | ||
| 4026 | + Utils.showToast('暂无通话记录!'); | ||
| 4027 | + } | ||
| 4028 | + } catch (e) {} | ||
| 4028 | } | 4029 | } |
| 4029 | 4030 | ||
| 4030 | _openAddressBook() async { | 4031 | _openAddressBook() async { |
| @@ -4057,10 +4058,6 @@ class InvicationPageState extends State<InvicationPage> | @@ -4057,10 +4058,6 @@ class InvicationPageState extends State<InvicationPage> | ||
| 4057 | } else { | 4058 | } else { |
| 4058 | _getContactData(); | 4059 | _getContactData(); |
| 4059 | } | 4060 | } |
| 4060 | - | ||
| 4061 | - } catch (e) { | ||
| 4062 | - } | ||
| 4063 | - | ||
| 4064 | } | 4061 | } |
| 4065 | 4062 | ||
| 4066 | _getContactData() async { | 4063 | _getContactData() async { |
-
Please register or login to post a comment