Browse Source

【代码优化】1、新增app挂后台超过5分钟,再次进入app重新加载广告;2、微聊、视频通话使用权限判断是否开放;3、优化广告后启动图不消失bug。

master
公司电脑 1 year ago
parent
commit
ba6df9c970
  1. 12
      tongxin.xcodeproj/project.pbxproj
  2. 2
      tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme
  3. BIN
      tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  4. 60
      tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  5. 2
      tongxin/AppDelegate.h
  6. 118
      tongxin/AppDelegate.m
  7. 21
      tongxin/Assets.xcassets/通用/comm_report_select_no.imageset/Contents.json
  8. BIN
      tongxin/Assets.xcassets/通用/comm_report_select_no.imageset/comm_report_select_no@2x.png
  9. 21
      tongxin/Assets.xcassets/通用/comm_report_select_yes.imageset/Contents.json
  10. BIN
      tongxin/Assets.xcassets/通用/comm_report_select_yes.imageset/comm_report_select_yes@2x.png
  11. 2
      tongxin/Helpers/myHttp/NetHeader.h
  12. 4
      tongxin/Info.plist
  13. 4
      tongxin/MyTabBarViewController.m
  14. 4
      tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Common/XHConfigurationHelper.m
  15. 1
      tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Models/XHMessage.h
  16. 9
      tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Models/XHMessage.m
  17. 25
      tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m
  18. 11
      tongxin/VC/DeviceTab/DeviceTabViewController.m
  19. 23
      tongxin/VC/Discover/CommonPopView.h
  20. 235
      tongxin/VC/Discover/CommonPopView.m
  21. 32
      tongxin/VC/Discover/DiscoverViewController.m
  22. 19
      tongxin/VC/Discover/ReportTableViewCell.h
  23. 72
      tongxin/VC/Discover/ReportTableViewCell.m
  24. 2
      tongxin/VC/Login/LoginViewController.m
  25. 2
      tongxin/VC/Login/PhoneLoginViewController.m
  26. 33
      tongxin/VC/Map/MapViewController.m
  27. 16
      tongxin/VC/WatchHome/Chat/ChatViewController.m

12
tongxin.xcodeproj/project.pbxproj

@ -882,6 +882,8 @@ @@ -882,6 +882,8 @@
61D46EE325BAD0E200539110 /* AnyChatCoreSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61D46EE225BAD0E200539110 /* AnyChatCoreSDK.framework */; };
61D46EE925BAFA0200539110 /* CheckCodeTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 61D46EE725BAFA0200539110 /* CheckCodeTableViewCell.m */; };
61D46EEA25BAFA0200539110 /* CheckCodeTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61D46EE825BAFA0200539110 /* CheckCodeTableViewCell.xib */; };
61DF3BCC2AA9C56700E69AE9 /* CommonPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61DF3BCA2AA9C56700E69AE9 /* CommonPopView.m */; };
61DF3BCF2AA9C59B00E69AE9 /* ReportTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 61DF3BCE2AA9C59B00E69AE9 /* ReportTableViewCell.m */; };
61F206B225650D5B00FF2247 /* BRManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F206B125650D5B00FF2247 /* BRManager.m */; };
61F206B52565427500FF2247 /* BairuiModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F206B42565427500FF2247 /* BairuiModel.m */; };
61F206B92565494F00FF2247 /* VideoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61F206B62565494B00FF2247 /* VideoViewController.xib */; };
@ -2441,6 +2443,10 @@ @@ -2441,6 +2443,10 @@
61D46EE625BAFA0200539110 /* CheckCodeTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CheckCodeTableViewCell.h; sourceTree = "<group>"; };
61D46EE725BAFA0200539110 /* CheckCodeTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CheckCodeTableViewCell.m; sourceTree = "<group>"; };
61D46EE825BAFA0200539110 /* CheckCodeTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CheckCodeTableViewCell.xib; sourceTree = "<group>"; };
61DF3BCA2AA9C56700E69AE9 /* CommonPopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonPopView.m; sourceTree = "<group>"; };
61DF3BCB2AA9C56700E69AE9 /* CommonPopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonPopView.h; sourceTree = "<group>"; };
61DF3BCD2AA9C59B00E69AE9 /* ReportTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReportTableViewCell.h; sourceTree = "<group>"; };
61DF3BCE2AA9C59B00E69AE9 /* ReportTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReportTableViewCell.m; sourceTree = "<group>"; };
61F206B025650D5B00FF2247 /* BRManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRManager.h; sourceTree = "<group>"; };
61F206B125650D5B00FF2247 /* BRManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BRManager.m; sourceTree = "<group>"; };
61F206B32565427500FF2247 /* BairuiModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BairuiModel.h; sourceTree = "<group>"; };
@ -4903,8 +4909,12 @@ @@ -4903,8 +4909,12 @@
61263DA32A5FABEF005D1694 /* Discover */ = {
isa = PBXGroup;
children = (
61DF3BCB2AA9C56700E69AE9 /* CommonPopView.h */,
61DF3BCA2AA9C56700E69AE9 /* CommonPopView.m */,
61263DA42A5FABEF005D1694 /* DiscoverViewController.h */,
61263DA52A5FABEF005D1694 /* DiscoverViewController.m */,
61DF3BCD2AA9C59B00E69AE9 /* ReportTableViewCell.h */,
61DF3BCE2AA9C59B00E69AE9 /* ReportTableViewCell.m */,
61263DA62A5FABEF005D1694 /* View */,
);
path = Discover;
@ -6454,6 +6464,7 @@ @@ -6454,6 +6464,7 @@
396990551F0B384F0050D916 /* QRCodeGenerator.m in Sources */,
3C9DBEEE20EB222E005699F0 /* UserAnnotationView.m in Sources */,
61B030BD2A4139940018CBDB /* NSObject+YYAddForKVO.m in Sources */,
61DF3BCF2AA9C59B00E69AE9 /* ReportTableViewCell.m in Sources */,
3C14F8A21FB010C8006E3D89 /* CustomAnnotationView.m in Sources */,
1870D2182323AA6100FA55E4 /* JuPhoonCallViewController.m in Sources */,
61B030B92A4139940018CBDB /* NSDate+YYAdd.m in Sources */,
@ -6911,6 +6922,7 @@ @@ -6911,6 +6922,7 @@
61BACC4E2A5E7B6A00ED4D2C /* SmSModel.m in Sources */,
61F206BE25654A1700FF2247 /* MZTimerLabel.m in Sources */,
612F37DA28055DC9004B9A95 /* TihuVideoCallViewController.m in Sources */,
61DF3BCC2AA9C56700E69AE9 /* CommonPopView.m in Sources */,
61B030B22A4139940018CBDB /* NSBundle+YYAdd.m in Sources */,
3999D95C1F0A354100508F2B /* Locate.m in Sources */,
397877151F15FF3500F0D282 /* SELinkText.m in Sources */,

2
tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme

@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

BIN
tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

60
tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -254,8 +254,8 @@ @@ -254,8 +254,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "246"
endingLineNumber = "246"
startingLineNumber = "259"
endingLineNumber = "259"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
@ -270,8 +270,8 @@ @@ -270,8 +270,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "224"
endingLineNumber = "224"
startingLineNumber = "237"
endingLineNumber = "237"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
@ -471,22 +471,6 @@ @@ -471,22 +471,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "3C4C229A-1441-4F10-BED3-EAE2F0B293F3"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "160"
endingLineNumber = "160"
landmarkName = "-showRootViewController"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "05FC7343-F0A0-4A7C-9984-3492157A0D5D"
shouldBeEnabled = "No"
ignoreCount = "0"
@ -519,22 +503,6 @@ @@ -519,22 +503,6 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "CCE081D8-DCF9-422E-BD7D-835903599AC3"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "tongxin/MyTabBarViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "129"
endingLineNumber = "129"
landmarkName = "-tabbarClickButton:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "136DD943-8CB8-46BD-B134-057F7B8161D8"
shouldBeEnabled = "Yes"
ignoreCount = "0"
@ -558,8 +526,8 @@ @@ -558,8 +526,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "563"
endingLineNumber = "563"
startingLineNumber = "576"
endingLineNumber = "576"
landmarkName = "-handlePushMsg:"
landmarkType = "7">
</BreakpointContent>
@ -596,5 +564,21 @@ @@ -596,5 +564,21 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "F794B3D5-ED8F-4DA9-B02D-5427D789922B"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "807"
endingLineNumber = "807"
landmarkName = "-applicationWillEnterForeground:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

2
tongxin/AppDelegate.h

@ -87,6 +87,6 @@ @@ -87,6 +87,6 @@
/// 注册远程通知
- (void)registerForRemoteNotification;
- (void)showRootViewController;
- (void)showRootViewController:(NSInteger)type;
@end

118
tongxin/AppDelegate.m

@ -56,9 +56,15 @@ @@ -56,9 +56,15 @@
@property (nonatomic, strong) BUSplashAd *splashAd;
@property (nonatomic, strong) CLLocationManager *locationManager;
/// 广告需要,增加一张启动图
@property (nonatomic ,strong) UIImageView *LaunchImage;
/// 广告提示【互动广告】
@property (nonatomic ,weak) UILabel *splashLabel;
/// 进入后台计时器开启
@property (nonatomic ,assign) NSInteger timeout;
@end
@implementation AppDelegate
@ -69,7 +75,7 @@ @@ -69,7 +75,7 @@
NSUserDefaults* userDefault = [[NSUserDefaults alloc] initWithSuiteName:@"group.tongxin"];
[userDefault setValue:@"童信APP活着的状态" forKey:@"APPStatus"];
[User loadFormFile];
[self showRootViewController];
[self showRootViewController:1];
[self requestIDFATracking];
[self getadSwitch];
self.window.backgroundColor = [UIColor whiteColor];
@ -145,6 +151,11 @@ @@ -145,6 +151,11 @@
// [Bluetooth.shareInstance connectPeripheralWithUUID];
// }
NSError *setCategoryErr = nil;
NSError *activationErr = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryErr];
[[AVAudioSession sharedInstance] setActive: YES error: &activationErr];
[self.window makeKeyAndVisible];
return YES;
}
@ -155,13 +166,15 @@ @@ -155,13 +166,15 @@
return _tabbarView;
}
- (void)showRootViewController
- (void)showRootViewController:(NSInteger)type
{
NSLog(@"登录信息==%@",cUser);
if (cUser)
{
self.window.rootViewController = self.tabbarView;
self.tabbarView.selectedIndex = 0;
if (type == 1)
[self.tabbarView.view addSubview:self.LaunchImage];
}
else
{
@ -758,6 +771,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -758,6 +771,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
[self startTimer];
}
@ -766,6 +780,25 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -766,6 +780,25 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
UIApplication *app = [UIApplication sharedApplication];
__block UIBackgroundTaskIdentifier bgTask;
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
dispatch_async(dispatch_get_main_queue(), ^{
if (bgTask != UIBackgroundTaskInvalid)
{
bgTask = UIBackgroundTaskInvalid;
}
});
}];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
if (bgTask != UIBackgroundTaskInvalid)
{
bgTask = UIBackgroundTaskInvalid;
}
});
});
}
//MARK: APP将要从后台返回
@ -783,6 +816,10 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -783,6 +816,10 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[self setNotificationData:self.backgroudMsg.userInfo];
self.backgroudMsg = nil;
}
[self resetTimer];
if (self.timeout > 300)
[self setupBUAdSDK];
// [self getadSwitch];
}
@ -811,6 +848,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -811,6 +848,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
NSUserDefaults* userDefault = [[NSUserDefaults alloc] initWithSuiteName:@"group.tongxin"];
// [userDefault setValue:@(NO) forKey:@"APPStatus"];
[userDefault removeObjectForKey:@"APPStatus"];
[self resetTimer];
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<UIUserActivityRestoring>> * __nullable restorableObjects))restorationHandler
@ -866,10 +904,13 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -866,10 +904,13 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
else
{
[self disYulan];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
} failure:^(id faiObject) {
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}];
}
@ -949,7 +990,10 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -949,7 +990,10 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
}
///当材料加载成功时调用此方法
- (void)splashAdLoadSuccess:(nonnull BUSplashAd *)splashAd {
- (void)splashAdLoadSuccess:(nonnull BUSplashAd *)splashAd
{
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
UIWindow *keyWindow = self.window;
[splashAd showSplashViewInRootViewController:keyWindow.rootViewController];
@ -966,6 +1010,8 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -966,6 +1010,8 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
- (void)splashAdLoadFail:(nonnull BUSplashAd *)splashAd error:(BUAdError * _Nullable)error {
[self disYulan];
[self pbu_logWithSEL:_cmd msg:@""];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
///当闪屏视图渲染失败时调用此方法
@ -973,26 +1019,36 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -973,26 +1019,36 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[self disYulan];
[self pbu_logWithSEL:_cmd msg:@""];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
///当渲染成功时调用这个方法
- (void)splashAdRenderSuccess:(nonnull BUSplashAd *)splashAd {
[self pbu_logWithSEL:_cmd msg:@""];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
///这个方法将在显示splash视图时调用
- (void)splashAdWillShow:(nonnull BUSplashAd *)splashAd {
[self pbu_logWithSEL:_cmd msg:@""];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
///这个方法在弹出视图显示时被调用
- (void)splashAdDidShow:(nonnull BUSplashAd *)splashAd {
[self disYulan];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
///这个方法在点击splash视图时被调用
- (void)splashAdDidClick:(nonnull BUSplashAd *)splashAd {
[self pbu_logWithSEL:_cmd msg:@""];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
/// 广告加载关闭是调用
@ -1002,6 +1058,8 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -1002,6 +1058,8 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[self disYulan];
self.splashLabel.hidden = YES;
[self.splashLabel removeFromSuperview];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
- (void)splashAdDidClose:(BUSplashAd *)splashAd closeType:(BUSplashAdCloseType)closeType
@ -1010,6 +1068,18 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -1010,6 +1068,18 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[self disYulan];
self.splashLabel.hidden = YES;
[self.splashLabel removeFromSuperview];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
/// 当视频广告播放完成或发生错误时调用此方法。
- (void)splashVideoAdDidPlayFinish:(BUSplashAd *)splashAd didFailWithError:(NSError *)error
{
[self disYulan];
self.splashLabel.hidden = YES;
[self.splashLabel removeFromSuperview];
if (self.LaunchImage)
[self.LaunchImage removeFromSuperview];
}
- (void)disYulan
@ -1024,6 +1094,21 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -1024,6 +1094,21 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
}
- (UIImageView *)LaunchImage
{
if (!_LaunchImage)
{
_LaunchImage = [UIImageView new];
_LaunchImage.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
if(ScreenHeight >= 812)
_LaunchImage.image = ImageName_(@"启动图X");
else
_LaunchImage.image = ImageName_(@"启动图");
}
return _LaunchImage;
}
- (void)upding
{
//定位一次自身的位置
@ -1046,6 +1131,31 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -1046,6 +1131,31 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
}
static dispatch_source_t _timer;
- (void)startTimer
{
[self resetTimer];
WEAKSELF
self.timeout = 0; //倒计时时间
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue);
dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行
dispatch_source_set_event_handler(_timer, ^{
self.timeout++;
NSLog(@"%ld",self.timeout);
});
dispatch_resume(_timer);
}
- (void)resetTimer
{
if (_timer)
{
dispatch_source_cancel(_timer);
_timer = nil;
}
}
@end

21
tongxin/Assets.xcassets/通用/comm_report_select_no.imageset/Contents.json vendored

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "comm_report_select_no@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

BIN
tongxin/Assets.xcassets/通用/comm_report_select_no.imageset/comm_report_select_no@2x.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

21
tongxin/Assets.xcassets/通用/comm_report_select_yes.imageset/Contents.json vendored

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "comm_report_select_yes@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

BIN
tongxin/Assets.xcassets/通用/comm_report_select_yes.imageset/comm_report_select_yes@2x.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

2
tongxin/Helpers/myHttp/NetHeader.h

@ -85,7 +85,7 @@ typedef NS_ENUM(NSInteger, HTTP_CODE) @@ -85,7 +85,7 @@ typedef NS_ENUM(NSInteger, HTTP_CODE)
#define HTTP_CHATGROUPS__MESSAGE @"getway/chatGroups/[groupid]/message"
#define HTTP_REPORT__MESSAGE @"getway/accounts/[openid]/report"
#define HTTP_REPORT__MESSAGE @"getway/accounts/[openid]/report2"
#define HTTP_POST_ACCOUNTS_LOGIN @"getway/accounts/login"//用户登录

4
tongxin/Info.plist

@ -203,5 +203,9 @@ @@ -203,5 +203,9 @@
<string>Light</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>WKBackgroundModes</key>
<array>
<string>App plays audio</string>
</array>
</dict>
</plist>

4
tongxin/MyTabBarViewController.m

@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@
//MARK: 有时会在首页显示之后再显示广告, 就是闪现首页,所以这里加个 View 做下过渡 会在首页加载完成数据后删除
_TransitionImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
_TransitionImageView.image = [UIImage imageNamed:LaunchImageName];
[self.view addSubview: _TransitionImageView];
//[self.view addSubview: _TransitionImageView];
}
@ -227,7 +227,7 @@ @@ -227,7 +227,7 @@
![[self getCurrentVC] isKindOfClass:[RegisteredViewController class]])
{
AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;
[app showRootViewController];
[app showRootViewController:0];
}
// UINavigationController *vc = [addDeviceSB instantiateViewControllerWithIdentifier:@"LoginNav"];

4
tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Common/XHConfigurationHelper.m

@ -64,8 +64,8 @@ NSString *kXHMessageTableCustomLoadAvatarNetworImageKey = @"com.HUAJIE.MDK.XHMes @@ -64,8 +64,8 @@ NSString *kXHMessageTableCustomLoadAvatarNetworImageKey = @"com.HUAJIE.MDK.XHMes
self = [super init];
if (self) {
self.popMenuTitles = @[NSLocalizedStringFromTable(@"copy", @"MessageDisplayKitString", @"复制文本消息"),
NSLocalizedStringFromTable(@"transpond", @"MessageDisplayKitString", @"转发"),
NSLocalizedStringFromTable(@"favorites", @"MessageDisplayKitString", @"收藏"),
// NSLocalizedStringFromTable(@"transpond", @"MessageDisplayKitString", @"转发"),
// NSLocalizedStringFromTable(@"favorites", @"MessageDisplayKitString", @"收藏"),
NSLocalizedStringFromTable(@"report", @"MessageDisplayKitString", @"举报"),];
}
return self;

1
tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Models/XHMessage.h

@ -55,6 +55,7 @@ @@ -55,6 +55,7 @@
@property (nonatomic, copy) NSNumber *senderType;
@property (nonatomic, copy) NSNumber *type;
@property (nonatomic, copy) NSString *online;
@property (nonatomic, copy) NSString *Id;
@property (nonatomic, assign) BOOL hide;

9
tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Models/XHMessage.m

@ -15,6 +15,13 @@ @@ -15,6 +15,13 @@
@synthesize timestamp = _timestamp;
@synthesize avator = _avator;
+ (NSDictionary<NSString *, id> *)modelCustomPropertyMapper
{
return @{
@"Id":@"id",
};
}
- (void)setType:(NSNumber *)type{
_type = type;
if ([type isEqualToNumber:@(10005)]) {
@ -250,6 +257,7 @@ @@ -250,6 +257,7 @@
_avatar = [aDecoder decodeObjectForKey:@"avatar"];
_avator = [aDecoder decodeObjectForKey:@"avator"];
_Id = [aDecoder decodeObjectForKey:@"Id"];
_senderID = [aDecoder decodeObjectForKey:@"senderID"];
_timestamp = [aDecoder decodeObjectForKey:@"timestamp"];
@ -285,6 +293,7 @@ @@ -285,6 +293,7 @@
[aCoder encodeObject:self.avator forKey:@"avator"];
[aCoder encodeObject:self.Id forKey:@"Id"];
[aCoder encodeObject:self.senderID forKey:@"senderID"];
[aCoder encodeObject:self.timestamp forKey:@"timestamp"];

25
tongxin/ThirdPartyLib/MessageDisplayKit/Classes/Views/MessageContentViews/XHMessageTableViewCell.m

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
#import "XHMessageTableViewCell.h"
#import "Circle.h"
#import "JSToastDialogs.h"
#import "CommonPopView.h"
static const CGFloat kXHLabelPadding = 5.0f;
static const CGFloat kXHTimeStampLabelHeight = 20.0f;
@ -130,6 +131,14 @@ static const CGFloat kXHUserNameLabelHeight = 20; @@ -130,6 +131,14 @@ static const CGFloat kXHUserNameLabelHeight = 20;
- (void)transpond:(id)sender {
DLog(@"Cell was transpond");
// 举报
NSLog(@"消息id--%@",self.messageBubbleView.message.Id);
if (self.messageBubbleView.message.content && self.messageBubbleView.message.senderID) {
CommonPopView *popview = [CommonPopView new];
[popview reportPopView:self.messageBubbleView.message.senderID];
}
}
- (void)favorites:(id)sender {
@ -139,21 +148,7 @@ static const CGFloat kXHUserNameLabelHeight = 20; @@ -139,21 +148,7 @@ static const CGFloat kXHUserNameLabelHeight = 20;
- (void)more:(id)sender {
DLog(@"Cell was more");
if (self.messageBubbleView.message.content && self.messageBubbleView.message.senderID) {
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
[parameters setObject:self.messageBubbleView.message.content forKey:@"content"];
[parameters setObject:self.messageBubbleView.message.senderID forKey:@"reportID"];
Circle *circle = [[Circle alloc] init];
[circle reportCircleMessageWithParameters:parameters
success:^(id responseObject) {
DLog(@"Report success");
[[JSToastDialogs shareInstance] makeToast:@"举报发送成功" duration:3];
} failure:^{
DLog(@"Report failure");
}];
}
}

11
tongxin/VC/DeviceTab/DeviceTabViewController.m

@ -326,14 +326,14 @@ @@ -326,14 +326,14 @@
[menuTitleArr1 addObject:cUser.cDevice.support_whiteList.intValue == 0 ? @"电话本" : @"管理员"];
[menuImageArr1 addObject:@"icon_phonebook"];
}
// if(cUser.cDevice.support_video.intValue == 4 || cUser.cDevice.support_video.intValue == 5 || cUser.cDevice.support_video.intValue == 1)
if(cUser.cDevice.support_video.intValue == 4 || cUser.cDevice.support_video.intValue == 5 || cUser.cDevice.support_video.intValue == 1)
if(cUser.cDevice.support_video)
{
[menuTitleArr1 addObject:@"视频通话"];
[menuImageArr1 addObject:@"icon_home_video_call"];
}
//if (cUser.cDevice.support_chat && cUser.cDevice.support_chat.intValue == 0)
if (cUser.cDevice.support_chat && cUser.cDevice.support_chat.intValue == 0)
{
[menuTitleArr1 addObject:@"微聊"];
[menuImageArr1 addObject:@"icon_small_talk"];
@ -376,11 +376,18 @@ @@ -376,11 +376,18 @@
[menuTitleArr2 addObject:@"课程表"];
[menuImageArr2 addObject:@"icon_fun_schedule"];
}
if(cUser.cDevice.support_family && cUser.cDevice.support_family.intValue == 1)
{
[menuTitleArr2 addObject:@"亲情号"];
[menuImageArr2 addObject:@"icon_family"];
}
// 学生卡
if(cUser.cDevice.deviceType && cUser.cDevice.deviceType.intValue == 2) {
[menuTitleArr2 addObject:@"亲情号"];
[menuImageArr2 addObject:@"icon_family"];
}
if(cUser.cDevice.support_ppFriend && cUser.cDevice.support_ppFriend.intValue == 1)
{
[menuTitleArr2 addObject:@"好友列表"];

23
tongxin/VC/Discover/CommonPopView.h

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
//
// CommonPopView.h
// tongxin
//
// Created by ecell on 2023/5/26.
// Copyright © 2023 xTT. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface CommonPopView : UIView
+ (instancetype)sharedManager;
#pragma mark 举报弹窗
/// 举报弹窗
- (void)reportPopView:(NSString *)reportID;
@end
NS_ASSUME_NONNULL_END

235
tongxin/VC/Discover/CommonPopView.m

@ -0,0 +1,235 @@ @@ -0,0 +1,235 @@
//
// CommonPopView.m
// tongxin
//
// Created by ecell on 2023/5/26.
// Copyright © 2023 xTT. All rights reserved.
//
#import "CommonPopView.h"
#import "User.h"
#import "ReportTableViewCell.h"
#import "Circle.h"
@interface CommonPopView ()<UITableViewDelegate,UITableViewDataSource>
/// 背景
@property (nonatomic ,weak) UIView *bgView;
@property (nonatomic ,strong) NSArray *titleArr;
@property (nonatomic ,strong) NSMutableArray *selectTitleArr;
@end
@implementation CommonPopView
+ (instancetype)sharedManager{
static dispatch_once_t onceToken;
static CommonPopView *instance;
dispatch_once(&onceToken, ^{
instance = [[CommonPopView alloc] init];
});
return instance;
}
-(instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
self.frame = [UIScreen mainScreen].bounds;
self.backgroundColor = RGBA(0, 0, 0, 0.4);
}
return self;
}
#pragma mark 举报弹窗
/// 举报弹窗
- (void)reportPopView:(NSString *)reportID
{
WEAKSELF
UIView *bgView = [UICommon ui_view:CGRectZero backgroundColor:KKWhiteColorColor cornerRadius:18 borderWidth:0 borderColor:KKWhiteColorColor];
self.bgView = bgView;
[self addSubview:bgView];
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.centerY.equalTo(self);
make.size.mas_equalTo(CGSizeMake(331, 520));
}];
UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontBold_(20) textColor:KKTextColor text:@"举报" Radius:0];
[bgView addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(bgView);
make.top.equalTo(bgView).offset(24);
}];
UILabel *textsLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontBold_(16) textColor:KKTextColor text:@"举报原因" Radius:0];
[bgView addSubview:textsLabel];
[textsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(bgView).offset(20);
make.top.equalTo(titleLabel.mas_bottom).offset(18);
}];
UIButton *escBtn = [UICommon ui_buttonSimple:CGRectZero font:Font_(16) normalColor:KKTextColor normalText:@"取消" click:^(id x) {
[self dismiss];
}];
escBtn.layer.borderWidth = 1;
escBtn.layer.borderColor = RGB(240, 239, 237).CGColor;
escBtn.layer.cornerRadius = 24;
//view.layer.masksToBounds = YES;
[bgView addSubview:escBtn];
[escBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(bgView.mas_bottom).inset(28);
make.left.equalTo(bgView).offset(24);
make.size.mas_equalTo(CGSizeMake(125, 48));
}];
UIButton *okBtn = [UICommon ui_buttonSimple:CGRectZero font:Font_(16) normalColor:KKWhiteColorColor normalText:@"确定" click:^(id x) {
if (self.selectTitleArr.count <= 0)
{
[SVProgressHUD showErrorWithStatus:@"请选择举报原因"];
AfterDispatch(1.5, ^{
[SVProgressHUD dismiss];
});
return;
}
[self setReport:reportID];
}];
okBtn.backgroundColor = mainColor;
okBtn.layer.cornerRadius = 24;
okBtn.layer.masksToBounds = YES;
[bgView addSubview:okBtn];
[okBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(escBtn);
make.right.equalTo(bgView.mas_right).inset(24);
make.size.mas_equalTo(CGSizeMake(125, 48));
}];
self.titleArr = @[@"谣言",@"有害信息",@"违法信息",@"色情低俗",@"人身攻击",@"垃圾营销",@"政治敏感",@"其他"];
UITableView *tableView = [UITableView new];
tableView.delegate = self;
tableView.dataSource = self;
tableView.rowHeight = 40;
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[tableView registerClass:ReportTableViewCell.class forCellReuseIdentifier:NSStringFromClass(ReportTableViewCell.class)];
tableView.showsVerticalScrollIndicator = NO;
tableView.allowsMultipleSelection = YES; //CollectionView支持多选
tableView.scrollEnabled = NO;
[bgView addSubview:tableView];
[tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(bgView).inset(20);
make.top.equalTo(textsLabel.mas_bottom).offset(5);
make.bottom.equalTo(escBtn.mas_top).inset(15);
}];
[self showPopView];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ReportTableViewCell *cell = [ReportTableViewCell cellWithTableView:tableView indexPath:indexPath];
cell.cellText = self.titleArr[indexPath.row];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"选择-%@",self.titleArr[indexPath.row]);
NSString *title = self.titleArr[indexPath.row];
[self.selectTitleArr addObject:title];
}
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"取消选择-%@",self.titleArr[indexPath.row]);
NSString *title = self.titleArr[indexPath.row];
[self.selectTitleArr removeObject:title];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.titleArr.count;
}
- (void)setReport:(NSString *)reportID
{
[SVProgressHUD showInfoWithStatus:@"举报中"];
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
[parameters setObject:[self.selectTitleArr componentsJoinedByString:@"@"] forKey:@"content"];
[parameters setObject:reportID forKey:@"reportID"];
[parameters setValue:cUser.accesstoken forKey:@"accesstoken"];
Circle *circle = [[Circle alloc] init];
[circle reportCircleMessageWithParameters:parameters
success:^(id responseObject) {
[self dismiss];
[SVProgressHUD dismiss];
[SVProgressHUD showSuccessWithStatus:@"举报发送成功"];
} failure:^{
[SVProgressHUD showErrorWithStatus:@"举报失败"];
}];
}
- (void)showPopView
{
[self showWithAlert:self.bgView];
[[UIApplication sharedApplication].delegate.window addSubview:self];;
}
/**
添加Alert入场动画
@param alert 添加动画的View
*/
- (void)showWithAlert:(UIView*)alert
{
CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
animation.duration = 0.6;
NSMutableArray *values = [NSMutableArray array];
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)]];
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.1, 1.1, 1.0)]];
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];
[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];
animation.values = values;
[alert.layer addAnimation:animation forKey:nil];
}
- (void)dismiss
{
[UICommon resignKeyboard];
[UIView animateWithDuration:0.6f animations:^{
self.backgroundColor = [UIColor clearColor];
self.alpha = 0;
}completion:^(BOOL finished) {
[self removeFromSuperview];
} ];
}
- (NSMutableArray *)selectTitleArr
{
if (!_selectTitleArr) _selectTitleArr = [NSMutableArray new];
return _selectTitleArr;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end

32
tongxin/VC/Discover/DiscoverViewController.m

@ -40,22 +40,22 @@ @@ -40,22 +40,22 @@
UIImage *img = ImageName_(@"Discover_banner");
// UIButton *ximaBtn = [UICommon ui_buttonSimple:CGRectZero font:Font_(0) normalColor:KKWhiteColorColor normalText:@"" click:^(id x) {
// ActivityWebViewController *vc = [[ActivityWebViewController alloc] init];
// vc.zx_navTitle = @"喜马拉雅";
// vc.url = @"https://m.ximalaya.com/kidiot-service-app?appKey=6b267bcd4f91494aa182bb4a89b95a0b&channelId=72e7cc893dd049dc83d62e277080fdbd";
// [self.navigationController pushViewController:vc animated:YES];
// }];
// ximaBtn.layer.cornerRadius = 10;
// ximaBtn.layer.masksToBounds = YES;
// [ximaBtn setBackgroundImage:img forState:0];
// [self.view addSubview:ximaBtn];
// [ximaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.right.equalTo(self.view).inset(15);
// make.height.mas_equalTo(img.size.height);
//// make.top.equalTo(searchBar.mas_bottom).offset(15);
// make.top.equalTo(self.disTableView.mas_bottom).offset(15);
// }];
UIButton *ximaBtn = [UICommon ui_buttonSimple:CGRectZero font:Font_(0) normalColor:KKWhiteColorColor normalText:@"" click:^(id x) {
ActivityWebViewController *vc = [[ActivityWebViewController alloc] init];
vc.zx_navTitle = @"喜马拉雅";
vc.url = @"https://m.ximalaya.com/kidiot-service-app?appKey=6b267bcd4f91494aa182bb4a89b95a0b&channelId=72e7cc893dd049dc83d62e277080fdbd";
[self.navigationController pushViewController:vc animated:YES];
}];
ximaBtn.layer.cornerRadius = 10;
ximaBtn.layer.masksToBounds = YES;
[ximaBtn setBackgroundImage:img forState:0];
[self.view addSubview:ximaBtn];
[ximaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view).inset(15);
make.height.mas_equalTo(img.size.height);
// make.top.equalTo(searchBar.mas_bottom).offset(15);
make.top.equalTo(self.disTableView.mas_bottom).offset(15);
}];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

19
tongxin/VC/Discover/ReportTableViewCell.h

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
//
// ReportTableViewCell.h
// tongxin
//
// Created by ecell on 2023/9/7.
// Copyright © 2023 xTT. All rights reserved.
//
#import "ZZTableViewCell.h"
NS_ASSUME_NONNULL_BEGIN
@interface ReportTableViewCell : ZZTableViewCell
@property (nonatomic ,strong) NSString *cellText;
@end
NS_ASSUME_NONNULL_END

72
tongxin/VC/Discover/ReportTableViewCell.m

@ -0,0 +1,72 @@ @@ -0,0 +1,72 @@
//
// ReportTableViewCell.m
// tongxin
//
// Created by ecell on 2023/9/7.
// Copyright © 2023 xTT. All rights reserved.
//
#import "ReportTableViewCell.h"
@interface ReportTableViewCell ()
@property (nonatomic ,weak) UIImageView *leftImg;
@property (nonatomic ,weak) UILabel *textsLabel;
@end
@implementation ReportTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self)
{
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = KKClearColor;
[self subCellView];
}
return self;
}
- (void)setCellText:(NSString *)cellText
{
_cellText = cellText;
self.textsLabel.text = cellText;
}
- (void)subCellView
{
UIImageView *leftImg = [UICommon ui_imageView:CGRectZero fileName:@"comm_report_select_no"];
self.leftImg = leftImg;
[self.contentView addSubview:leftImg];
[leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView);
make.centerY.equalTo(self.contentView);
make.size.mas_equalTo(leftImg.image.size);
}];
UILabel *textsLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontBold_(16) textColor:KKTextColor text:@"" Radius:0];
self.textsLabel = textsLabel;
[self.contentView addSubview:textsLabel];
[textsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(leftImg.mas_right).offset(15);
make.centerY.equalTo(self.contentView);
}];
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
self.leftImg.image = selected ? ImageName_(@"comm_report_select_yes") : ImageName_(@"comm_report_select_no");
// Configure the view for the selected state
}
@end

2
tongxin/VC/Login/LoginViewController.m

@ -272,7 +272,7 @@ @@ -272,7 +272,7 @@
[[NSNotificationCenter defaultCenter] postNotificationName:@"LoginComplete" object:nil];
}];
[app showRootViewController];
[app showRootViewController:0];
[app.tabbarView removeTransitionImageView];
} failure:^(id faiObject) {

2
tongxin/VC/Login/PhoneLoginViewController.m

@ -209,7 +209,7 @@ @@ -209,7 +209,7 @@
[UserDefaults synchronize];
[weakSelf getUserDevices:weakSelf.pwdTextField.text];
AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;
[app showRootViewController];
[app showRootViewController:0];
[app.tabbarView removeTransitionImageView];
} failure:^(id faiObject) {
[weakSelf setBtnBadRoGoodFlag:YES WithBtn:weakSelf.loginBtn];

33
tongxin/VC/Map/MapViewController.m

@ -704,17 +704,7 @@ @@ -704,17 +704,7 @@
NSLog(@"%@",cUser.cDevice.lastLocation.address);
NSString *dateStr = [myHelper distanceTimeWithBeforeTime:[self.curLocate.timestamp doubleValue]];
self.locationTimeLabel.text = dateStr;
if (self.curLocate.address.length < 1 && cUser.cDevice.lastLocation.address.length < 1)
{
[cUser.cDevice getDeviceInfoSuccess:^(id responseObject) {
NSDictionary *dic = responseObject[@"lastLocation"];
self.locationAddressLabel.text = dic[@"address"];
} failure:^(id faiObject) {
}];
}
else
self.locationAddressLabel.text = self.curLocate.address.length > 0 ? self.curLocate.address : cUser.cDevice.lastLocation.address;
self.locationAddressLabel.text = self.curLocate.address.length > 0 ? self.curLocate.address : cUser.cDevice.lastLocation.address.length > 0 ? cUser.cDevice.lastLocation.address : @"当前位置未知,请确保设备开机且能够联网,再点击定位按钮进行定位";
}
self.regeo.location = [AMapGeoPoint locationWithLatitude:[self.curLocate.lat floatValue] longitude:[self.curLocate.lon floatValue]];
@ -781,14 +771,33 @@ @@ -781,14 +771,33 @@
return nil;
}
#pragma mark ====高德地图位置解析回调====
#pragma mark ====高德地图位置解析错误回调====
- (void)AMapSearchRequest:(id)request didFailWithError:(NSError *)error
{
[cUser.cDevice getDeviceInfoSuccess:^(id responseObject) {
NSDictionary *dic = responseObject[@"lastLocation"];
self.locationAddressLabel.text = dic[@"address"];
} failure:^(id faiObject) {
}];
}
#pragma mark ====高德地图位置解析回调====
-(void)onReGeocodeSearchDone:(AMapReGeocodeSearchRequest *)request response:(AMapReGeocodeSearchResponse *)response{
if (response.regeocode != nil)
{
NSString *name = response.regeocode.formattedAddress;
self.locationAddressLabel.text = name;
}
else
{
[cUser.cDevice getDeviceInfoSuccess:^(id responseObject) {
NSDictionary *dic = responseObject[@"lastLocation"];
self.locationAddressLabel.text = dic[@"address"];
} failure:^(id faiObject) {
}];
}
}

16
tongxin/VC/WatchHome/Chat/ChatViewController.m

@ -630,7 +630,7 @@ @@ -630,7 +630,7 @@
[self.infoCircle sendCircleMessageWithParameters:parameters
success:^(id responseObject) {
[weakSelf setLastShowTimetampWithMessage:message];
message.id = responseObject[@"id"];
message.Id = responseObject[@"id"];
[weakSelf addMessage:message];
self->presenter.isSended = YES;
} failure:^{
@ -646,7 +646,7 @@ @@ -646,7 +646,7 @@
[parameters setValue:cUser.accesstoken forKey:@"token"];
[self.infoCircle sendCircleMessageWithImei:self.imei Parameters:parameters success:^(id responseObject) {
[weakSelf setLastShowTimetampWithMessage:message];
message.id = responseObject[@"id"];
message.Id = responseObject[@"id"];
[weakSelf addMessage:message];
self->presenter.isSended = YES;
} failure:^{
@ -679,7 +679,7 @@ @@ -679,7 +679,7 @@
@"content":UIImageJPEGRepresentation(photo, 0.1)}];
[self.infoCircle sendCircleMessageWithParameters:parameters
success:^(id responseObject) {
message.id = responseObject[@"id"];
message.Id = responseObject[@"id"];
[weakSelf setLastShowTimetampWithMessage:message];
[weakSelf addMessage:message];
[weakSelf finishSendMessageWithBubbleMessageType:XHBubbleMessageMediaTypePhoto];
@ -693,7 +693,7 @@ @@ -693,7 +693,7 @@
[parameters setValue:cUser.openid forKey:@"openid"];
[parameters setValue:cUser.accesstoken forKey:@"token"];
[self.infoCircle sendCircleMessageWithImei:self.imei Parameters:parameters success:^(id responseObject) {
message.id = responseObject[@"id"];
message.Id = responseObject[@"id"];
[weakSelf setLastShowTimetampWithMessage:message];
[weakSelf addMessage:message];
[weakSelf finishSendMessageWithBubbleMessageType:XHBubbleMessageMediaTypePhoto];
@ -754,7 +754,7 @@ @@ -754,7 +754,7 @@
NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithDictionary:@{@"type":@(3), @"content":data,@"duration":voiceDuration}];
[self.infoCircle sendCircleMessageWithParameters:parameters
success:^(id responseObject) {
message.id = responseObject[@"id"];
message.Id = responseObject[@"id"];
[weakSelf setLastShowTimetampWithMessage:message];
NSString *fileName = [NSString stringWithFormat:@"%@.wav",responseObject[@"id"]];
NSString *wavPath = [CJFileUtility documentsPathSubDir:@"msg_audio" andFile:fileName];
@ -777,7 +777,7 @@ @@ -777,7 +777,7 @@
[parameters setValue:cUser.accesstoken forKey:@"token"];
[self.infoCircle sendCircleMessageWithImei:self.imei Parameters:parameters success:^(id responseObject) {
message.id = responseObject[@"id"];
message.Id = responseObject[@"id"];
[weakSelf setLastShowTimetampWithMessage:message];
NSString *fileName = [NSString stringWithFormat:@"%@.wav",responseObject[@"id"]];
NSString *wavPath = [CJFileUtility documentsPathSubDir:@"msg_audio" andFile:fileName];
@ -814,7 +814,7 @@ @@ -814,7 +814,7 @@
[self.infoCircle sendCircleMessageWithParameters:parameters
success:^(id responseObject) {
[weakSelf setLastShowTimetampWithMessage:emotionMessage];
emotionMessage.id = responseObject[@"id"];
emotionMessage.Id = responseObject[@"id"];
[weakSelf addMessage:emotionMessage];
self->presenter.isSended = YES;
[weakSelf finishSendMessageWithBubbleMessageType:XHBubbleMessageMediaTypeEmotion];
@ -831,7 +831,7 @@ @@ -831,7 +831,7 @@
[parameters setValue:cUser.accesstoken forKey:@"token"];
[self.infoCircle sendCircleMessageWithImei:self.imei Parameters:parameters success:^(id responseObject) {
[weakSelf setLastShowTimetampWithMessage:emotionMessage];
emotionMessage.id = responseObject[@"id"];
emotionMessage.Id = responseObject[@"id"];
[weakSelf addMessage:emotionMessage];
self->presenter.isSended = YES;
[weakSelf finishSendMessageWithBubbleMessageType:XHBubbleMessageMediaTypeEmotion];

Loading…
Cancel
Save