Commit 4e76bf15 authored by 朱璇's avatar 朱璇

面诊客户端链路日志

parent 85a34884
...@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface GMBasicInfoCardView : GMPopupBgView @interface GMBasicInfoCardView : GMPopupBgView
@property (nonatomic, copy) NSString *doctorId; @property (nonatomic, copy) NSString *doctorId;
//@property (nonatomic, copy) NSString *refferer; //@property (nonatomic, copy) NSString *referer;
//派单 //派单
@property (nonatomic, assign) BOOL isDispatch; @property (nonatomic, assign) BOOL isDispatch;
@property (nonatomic, copy) NSString *counsellorId; @property (nonatomic, copy) NSString *counsellorId;
......
...@@ -188,6 +188,8 @@ ...@@ -188,6 +188,8 @@
if (self.isDispatch && [self showAlertIfNotAllowed]) { if (self.isDispatch && [self showAlertIfNotAllowed]) {
return; return;
} }
// 埋点
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.LaunchButtion.Click" status:@"success" extraParam:@{@"counsellor_id": self.counsellorId, @"referer": SafeString(self.referer)}];
[self payMoney]; [self payMoney];
} }
...@@ -225,12 +227,13 @@ ...@@ -225,12 +227,13 @@
NSError *error = [[NSError alloc] init]; NSError *error = [[NSError alloc] init];
GMToFacePayPrepareModel *model = [[GMToFacePayPrepareModel alloc] initWithDictionary:responseObject.data error:&error]; GMToFacePayPrepareModel *model = [[GMToFacePayPrepareModel alloc] initWithDictionary:responseObject.data error:&error];
weakSelf.orderNo = model.orderNo; weakSelf.orderNo = model.orderNo;
// 埋点
[weakSelf consultation_traceWithStatus:@"success"];
NSNumber *fee; NSNumber *fee;
if (weakSelf.isDispatch) { if (weakSelf.isDispatch) {
//派单的付款金额字段 //派单的付款金额字段
fee = weakSelf.dict[@"consultation_type_fee"]; fee = weakSelf.dict[@"consultation_type_fee"];
}else { } else {
//1v1的付款金额字段 //1v1的付款金额字段
fee = weakSelf.dict[@"service_fee"]; fee = weakSelf.dict[@"service_fee"];
} }
...@@ -244,10 +247,17 @@ ...@@ -244,10 +247,17 @@
[self needPay:model]; [self needPay:model];
} }
}else { }else {
[weakSelf consultation_traceWithStatus:@"failed"];
[GMHudModule toast:responseObject.message]; [GMHudModule toast:responseObject.message];
} }
}]; }];
} }
- (void)consultation_traceWithStatus:(NSString *)status {
// 埋点
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.CreateOrder" status:status extraParam:@{@"counsellor_id": SafeString(self.counsellorId), @"order_no": SafeString(self.orderNo), @"referer": SafeString(self.referer)}];
}
#pragma mark - 需要付款,先付款、后面诊 #pragma mark - 需要付款,先付款、后面诊
- (void)needPay:(GMToFacePayPrepareModel *)model { - (void)needPay:(GMToFacePayPrepareModel *)model {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
...@@ -320,14 +330,17 @@ ...@@ -320,14 +330,17 @@
}; };
[GMNetworking requestOCWithApi:API_LAUNCH_DISPATCH method:GMHTTPMethodPost parameters:param completion:^(GMResponseOC * _Nonnull response) { [GMNetworking requestOCWithApi:API_LAUNCH_DISPATCH method:GMHTTPMethodPost parameters:param completion:^(GMResponseOC * _Nonnull response) {
if (response.isSuccess) { if (response.isSuccess) {
[GMVideoPhobos consultation_traceWithActionStep:@"" status:@"" extraParam:@{}];
[GMVideoPhobos video_monitoringWithActionStep:@"进入正在匹配页" consultId:nil traceId:weakSelf.traceId]; [GMVideoPhobos video_monitoringWithActionStep:@"进入正在匹配页" consultId:nil traceId:weakSelf.traceId];
weakSelf.waitingView.currentTime = [response.data[@"countdown"] intValue]; weakSelf.waitingView.currentTime = [response.data[@"countdown"] intValue];
weakSelf.waitingView.orderNo = weakSelf.orderNo;
dispatch_main_async_safe(^{ dispatch_main_async_safe(^{
[weakSelf.waitingView addCountDownTimer]; [weakSelf.waitingView addCountDownTimer];
// weakSelf.alpha = 0.f; // weakSelf.alpha = 0.f;
[weakSelf hide]; [weakSelf hide];
}); });
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"" status:@"" extraParam:@{}];
[[GMBaseTool getCurrentViewController] toast:response.message]; [[GMBaseTool getCurrentViewController] toast:response.message];
} }
}]; }];
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#import "GMToFaceNetworking.h" #import "GMToFaceNetworking.h"
#import "GMLibraryHeader.h" #import "GMLibraryHeader.h"
#import "UIResponder+transmission.h" #import "UIResponder+transmission.h"
#import "GMVideoPhobos.h"
@interface GMToFaceContainerViewController ()<GMInfinitelViewDelegate, UIScrollViewDelegate> @interface GMToFaceContainerViewController ()<GMInfinitelViewDelegate, UIScrollViewDelegate>
/** 头部视图 */ /** 头部视图 */
...@@ -252,8 +253,11 @@ ...@@ -252,8 +253,11 @@
#pragma mark - 立即视频面诊 #pragma mark - 立即视频面诊
- (void)bottomBtnClick { - (void)bottomBtnClick {
[Phobos track:@"on_click_button" attributes:@{@"page_name":self.pageName,@"button_name":@"video_interview_now"}]; [Phobos track:@"on_click_button" attributes:@{@"page_name":self.pageName,@"button_name":@"video_interview_now"}];
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.LaunchButtion.Click" status:@"success" extraParam:@{}];
__weak __typeof(self)weakSelf = self; __weak __typeof(self)weakSelf = self;
[[GMToFaceNetworking shareInstance] excuteToFaceBlockInfoSuccessBlock:^(id response) { [[GMToFaceNetworking shareInstance] excuteToFaceBlockInfoSuccessBlock:^(id response) {
NSDictionary *dict = response[@"block_info"]; NSDictionary *dict = response[@"block_info"];
NSString *alert = dict[@"alert"]; NSString *alert = dict[@"alert"];
if (![alert isNonEmpty]) { if (![alert isNonEmpty]) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#import "GMToFaceNetworking.h" #import "GMToFaceNetworking.h"
#import "GMLibraryHeader.h" #import "GMLibraryHeader.h"
#import <GMBase/GMBaseTool.h> #import <GMBase/GMBaseTool.h>
#import "GMVideoPhobos.h"
@interface GMToFaceDoctorListController ()<UICollectionViewDelegate, UICollectionViewDataSource, GMToFaceCommonEmptyViewDelegate> @interface GMToFaceDoctorListController ()<UICollectionViewDelegate, UICollectionViewDataSource, GMToFaceCommonEmptyViewDelegate>
@property (nonatomic, strong) UICollectionViewFlowLayout *layout; @property (nonatomic, strong) UICollectionViewFlowLayout *layout;
...@@ -177,6 +177,9 @@ ...@@ -177,6 +177,9 @@
[GMNetworking requestOCWithApi:API_CONSULTATION__COUNSEL_CONSULTANT method:GMHTTPMethodGet parameters:@{@"counsellor_id": SafeString(model.counsellorId)} completion:^(GMResponseOC * response) { [GMNetworking requestOCWithApi:API_CONSULTATION__COUNSEL_CONSULTANT method:GMHTTPMethodGet parameters:@{@"counsellor_id": SafeString(model.counsellorId)} completion:^(GMResponseOC * response) {
weakSelf.indexPath = nil; weakSelf.indexPath = nil;
if (response.isSuccess) { if (response.isSuccess) {
// 埋点
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.ConsultantCard.Click" status:@"success" extraParam:@{@"counsellor_id": model.counsellorId, @"status": @(model.status - 1)}];
GMConsultantInfoModel *model = [[GMConsultantInfoModel alloc] initWithDictionary:response.data error:NULL]; GMConsultantInfoModel *model = [[GMConsultantInfoModel alloc] initWithDictionary:response.data error:NULL];
GMDoctorInfoPopupView *popupView = [[GMDoctorInfoPopupView alloc] init]; GMDoctorInfoPopupView *popupView = [[GMDoctorInfoPopupView alloc] init];
popupView.tabName = self.viewModel.tabName; popupView.tabName = self.viewModel.tabName;
...@@ -188,6 +191,7 @@ ...@@ -188,6 +191,7 @@
popupView.model = model; popupView.model = model;
[[GMBaseTool getCurrentViewController].view addSubview:popupView]; [[GMBaseTool getCurrentViewController].view addSubview:popupView];
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.ConsultantCard.Click" status:@"failed" extraParam:@{@"counsellor_id": model.counsellorId, @"status": @(model.status - 1)}];
[[GMBaseTool getCurrentViewController] toast:response.message]; [[GMBaseTool getCurrentViewController] toast:response.message];
} }
weakSelf.collectView.userInteractionEnabled = YES; weakSelf.collectView.userInteractionEnabled = YES;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#import "RequestHeader.h" #import "RequestHeader.h"
#import "GMLibraryHeader.h" #import "GMLibraryHeader.h"
#import <GMBase/GMBaseTool.h> #import <GMBase/GMBaseTool.h>
#import "GMVideoPhobos.h"
/*** @brief 订单支付部分*/ /*** @brief 订单支付部分*/
#define ORDER_PAY_SUCCESS @"order_pay_success" #define ORDER_PAY_SUCCESS @"order_pay_success"
...@@ -81,7 +82,10 @@ ...@@ -81,7 +82,10 @@
}else { }else {
successBlock(responseObject); successBlock(responseObject);
} }
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.OrderPaid" status:@"success" extraParam:@{@"order_no": SafeString(weakSelf.orderNo), @"amount": @(weakSelf.paymentAmount),@"status": @([status integerValue])}];
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.OrderPaid" status:@"failed" extraParam:@{@"order_no": SafeString(weakSelf.orderNo), @"amount": @(weakSelf.paymentAmount)}];
failBlock(responseObject.message); failBlock(responseObject.message);
} }
}]; }];
......
...@@ -88,8 +88,12 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -88,8 +88,12 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
_joinChannelRetryMs = _videoModel.joinChannelRetryMs; _joinChannelRetryMs = _videoModel.joinChannelRetryMs;
_joinChannelRetryCount = _videoModel.joinChannelRetryCount; _joinChannelRetryCount = _videoModel.joinChannelRetryCount;
[self showTelephoneView:_videoModel]; [self showTelephoneView:_videoModel];
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.GetRecordInfo" status:@"success" extraParam:@{@"consultation_record_id": SafeString(messageDict[@"consultation_record_id"]), @"referer": SafeString(extentsionDict[@"referer"])}];
} }
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.GetRecordInfo" status:@"failed" extraParam:@{@"consultation_record_id": SafeString(messageDict[@"consultation_record_id"]), @"referer": SafeString(extentsionDict[@"referer"])}];
TTManager.telephoneStatus = TelephoneVideoStatus_rest; TTManager.telephoneStatus = TelephoneVideoStatus_rest;
[GMHudModule showWarning:errorMessage]; [GMHudModule showWarning:errorMessage];
} }
...@@ -147,6 +151,8 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -147,6 +151,8 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
BOOL swapWH = UIInterfaceOrientationIsPortrait(UIApplication.sharedApplication.statusBarOrientation); BOOL swapWH = UIInterfaceOrientationIsPortrait(UIApplication.sharedApplication.statusBarOrientation);
[rtcEngine setVideoProfile:TTTRtc_VideoProfile_720P swapWidthAndHeight:swapWH]; [rtcEngine setVideoProfile:TTTRtc_VideoProfile_720P swapWidthAndHeight:swapWH];
[rtcEngine joinChannelByKey:nil channelName:_channelId uid:_uid joinSuccess:nil]; [rtcEngine joinChannelByKey:nil channelName:_channelId uid:_uid joinSuccess:nil];
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Santi.Join" status:@"success" extraParam:@{@"order_no": @"", @"consultation_record_id": SafeString(model.consultationRecordId), @"channel_id": SafeString(_channelId)}];
} }
#pragma mark - 医生端展示电话页面 #pragma mark - 医生端展示电话页面
...@@ -164,26 +170,42 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -164,26 +170,42 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
NSString *statusStr = status == 1 ? @"点击接听按钮":@"点击挂断按钮"; NSString *statusStr = status == 1 ? @"点击接听按钮":@"点击挂断按钮";
[GMVideoPhobos video_monitoringWithActionStep:statusStr consultId:model.consultationRecordId traceId:nil]; [GMVideoPhobos video_monitoringWithActionStep:statusStr consultId:model.consultationRecordId traceId:nil];
if (status) { if (status) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Accept.Click" status:@"success" extraParam:@{@"consultation_record_id": SafeString(model.consultationRecordId)}];
if ([GMAppCameraAndMicrophone getAppCameraAction] == NO || [GMAppCameraAndMicrophone getAppMicrophoneAction] == NO) { if ([GMAppCameraAndMicrophone getAppCameraAction] == NO || [GMAppCameraAndMicrophone getAppMicrophoneAction] == NO) {
//如果相机或是麦克风权限必须获取才能视频通话 //如果相机或是麦克风权限必须获取才能视频通话
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.NoRight" status:@"success" extraParam:@{@"consultation_record_id": SafeString(model.consultationRecordId)}];
return; return;
} }
[self killCurrentView]; [self killCurrentView];
[GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_jieTing consultationRecordId:model.consultationRecordId finishBlock:^(BOOL success, NSDictionary *message) { [GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_jieTing consultationRecordId:model.consultationRecordId finishBlock:^(BOOL success, NSDictionary *message) {
if (success) { if (success) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Accept" status:@"success" extraParam:@{@"consultation_record_id": SafeString(model.consultationRecordId)}];
[self doctorLoginVideoRoomModel:model]; [self doctorLoginVideoRoomModel:model];
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Accept" status:@"failed" extraParam:@{@"consultation_record_id": SafeString(model.consultationRecordId)}];
[GMHudModule showWarning:message[@"message"]]; [GMHudModule showWarning:message[@"message"]];
TTManager.telephoneStatus = TelephoneVideoStatus_rest; TTManager.telephoneStatus = TelephoneVideoStatus_rest;
} }
}]; }];
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Reject.Click" status:@"success" extraParam:@{@"consultation_record_id": SafeString(model.consultationRecordId)}];
[self killCurrentView]; [self killCurrentView];
TTManager.telephoneStatus = TelephoneVideoStatus_rest; TTManager.telephoneStatus = TelephoneVideoStatus_rest;
[GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_juJue consultationRecordId:model.consultationRecordId finishBlock:nil]; [GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_juJue consultationRecordId:model.consultationRecordId finishBlock:^(BOOL success, NSDictionary *message) {
if (success) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Reject.Click" status:@"success" extraParam:@{@"consultation_record_id": SafeString(model.consultationRecordId)}];
} else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Reject.Click" status:@"failed" extraParam:@{@"consultation_record_id": SafeString(model.consultationRecordId)}];
}
}];
//医生点击取消挂断按钮 //医生点击取消挂断按钮
[[NSNotificationCenter defaultCenter] postNotificationName:@"doctor_finshed_video" object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"doctor_finshed_video" object:nil];
[GMHudModule showWarning:@"已拒绝对方"]; [GMHudModule showWarning:@"已拒绝对方"];
...@@ -217,6 +239,8 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -217,6 +239,8 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
_window.delgate = self; _window.delgate = self;
[[UIApplication sharedApplication].keyWindow addSubview:_window]; [[UIApplication sharedApplication].keyWindow addSubview:_window];
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.EvokeRecordPageSuceess" status:@"success" extraParam:@{@"consultation_record_id": SafeString(_videoModel.consultationRecordId)}];
} }
#pragma mark - TTTRtcEngineDelegate初始化成功 #pragma mark - TTTRtcEngineDelegate初始化成功
...@@ -225,9 +249,12 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -225,9 +249,12 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
if (_neteaseModel && [_neteaseModel.toAccountId isNonEmpty] && [_neteaseModel.channelId isNonEmpty]) { if (_neteaseModel && [_neteaseModel.toAccountId isNonEmpty] && [_neteaseModel.channelId isNonEmpty]) {
[[GMNimChannelManager shareInstance] doJoinAndInviteJoinChannelWithChannelId:_neteaseModel.channelId accountId:_neteaseModel.toAccountId customInfo:_neteaseModel.inviteExt resultBlock:^(BOOL isSuccess) { [[GMNimChannelManager shareInstance] doJoinAndInviteJoinChannelWithChannelId:_neteaseModel.channelId accountId:_neteaseModel.toAccountId customInfo:_neteaseModel.inviteExt resultBlock:^(BOOL isSuccess) {
if (!isSuccess) { if (!isSuccess) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.NeteaseIM.ReadySend" status:@"failed" extraParam:@{@"consultation_record_id": SafeString(TTManager.consultationRecordId), @"channel_id": SafeString(_channelId), @"user_id": SafeString(_neteaseModel.toAccountId)}];
#ifdef DEBUG #ifdef DEBUG
[[GMBaseTool getCurrentViewController] toast:@"doJoinAndInviteJoinChannelWithChannelId失败"]; [[GMBaseTool getCurrentViewController] toast:@"doJoinAndInviteJoinChannelWithChannelId失败"];
#endif #endif
} else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.NeteaseIM.ReadySend" status:@"success" extraParam:@{@"consultation_record_id": SafeString(TTManager.consultationRecordId), @"channel_id": SafeString(_channelId), @"user_id": SafeString(_neteaseModel.toAccountId)}];
} }
}]; }];
} }
...@@ -260,7 +287,6 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -260,7 +287,6 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
errorInfo = @"未知错误"; errorInfo = @"未知错误";
break; break;
} }
TTManager.telephoneStatus = TelephoneVideoStatus_rest;
[self tryAgainIfFailedWithErrorInfo:errorInfo errorCode:errorCode]; [self tryAgainIfFailedWithErrorInfo:errorInfo errorCode:errorCode];
} }
...@@ -271,11 +297,13 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil; ...@@ -271,11 +297,13 @@ static GMDoctorVideoTelephoneLogin *loginManager = nil;
_joinChannelRetryCount--; _joinChannelRetryCount--;
}); });
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Santi.OnJoinError" status:@"failed" extraParam:@{@"consultation_record_id": SafeString(TTManager.consultationRecordId), @"channel_id": SafeString(_channelId), @"error_code": @(errorCode)}];
[self uploadFailedRecordWithErrorInfo:errorInfo]; [self uploadFailedRecordWithErrorInfo:errorInfo];
} }
} }
- (void)uploadFailedRecordWithErrorInfo:(NSString *)errorInfo { - (void)uploadFailedRecordWithErrorInfo:(NSString *)errorInfo {
TTManager.telephoneStatus = TelephoneVideoStatus_rest;
[GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_addFail consultationRecordId:TTManager.consultationRecordId finishBlock:nil]; [GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_addFail consultationRecordId:TTManager.consultationRecordId finishBlock:nil];
[GMHudModule showWarning:errorInfo]; [GMHudModule showWarning:errorInfo];
if (_telephoneView) {//关闭医生端接电话图层 if (_telephoneView) {//关闭医生端接电话图层
......
...@@ -93,8 +93,12 @@ static GMUserVideoTelephoneLogin *loginManager = nil; ...@@ -93,8 +93,12 @@ static GMUserVideoTelephoneLogin *loginManager = nil;
weakSelf.logoHud.hidden = YES; weakSelf.logoHud.hidden = YES;
if (success) { if (success) {
GMVideoTelephoneModel *model = modelDict[@"model"]; GMVideoTelephoneModel *model = modelDict[@"model"];
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Launch" status:@"success" extraParam:@{@"order_no": SafeString(messageDict[@"order_no"]), @"consultation_record_id": SafeString(model.consultationRecordId)}];
[self userLoginVideoRoomModel:model]; [self userLoginVideoRoomModel:model];
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.One2One.Launch" status:@"failed" extraParam:@{@"order_no": SafeString(messageDict[@"order_no"]), @"consultation_record_id": SafeString(messageDict[@"consultation_record_id"])}];
[GMHudModule showWarning:errorMessage]; [GMHudModule showWarning:errorMessage];
} }
...@@ -158,11 +162,14 @@ static GMUserVideoTelephoneLogin *loginManager = nil; ...@@ -158,11 +162,14 @@ static GMUserVideoTelephoneLogin *loginManager = nil;
BOOL swapWH = UIInterfaceOrientationIsPortrait(UIApplication.sharedApplication.statusBarOrientation); BOOL swapWH = UIInterfaceOrientationIsPortrait(UIApplication.sharedApplication.statusBarOrientation);
[rtcEngine setVideoProfile:TTTRtc_VideoProfile_720P swapWidthAndHeight:swapWH]; [rtcEngine setVideoProfile:TTTRtc_VideoProfile_720P swapWidthAndHeight:swapWH];
[rtcEngine joinChannelByKey:nil channelName:_channelId uid:_uid joinSuccess:nil]; [rtcEngine joinChannelByKey:nil channelName:_channelId uid:_uid joinSuccess:nil];
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Santi.Join" status:@"success" extraParam:@{@"order_no": SafeString(_messageDict[@"order_no"]), @"consultation_record_id": SafeString(_messageDict[@"consultation_record_id"]), @"channel_id": SafeString(_channelId)}];
} }
#pragma mark - TTTRtcEngineDelegate初始化成功 #pragma mark - TTTRtcEngineDelegate初始化成功
-(void)rtcEngine:(TTTRtcEngineKit *)engine didJoinChannel:(NSString *)channel withUid:(int64_t)uid elapsed:(NSInteger)elapsed { -(void)rtcEngine:(TTTRtcEngineKit *)engine didJoinChannel:(NSString *)channel withUid:(int64_t)uid elapsed:(NSInteger)elapsed {
[[NSNotificationCenter defaultCenter] postNotificationName:@"gm_push_remove_waiting_success" object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"gm_push_remove_waiting_success" object:nil];
// 加入房间并邀请 // 加入房间并邀请
if (_neteaseModel && [_neteaseModel.toAccountId isNonEmpty] && [_neteaseModel.channelId isNonEmpty]) { if (_neteaseModel && [_neteaseModel.toAccountId isNonEmpty] && [_neteaseModel.channelId isNonEmpty]) {
...@@ -202,7 +209,6 @@ static GMUserVideoTelephoneLogin *loginManager = nil; ...@@ -202,7 +209,6 @@ static GMUserVideoTelephoneLogin *loginManager = nil;
errorInfo = @"未知错误"; errorInfo = @"未知错误";
break; break;
} }
TTManager.telephoneStatus = TelephoneVideoStatus_rest;
// 增加失败重试功能(当我是复播的时候) // 增加失败重试功能(当我是复播的时候)
[self tryAgainIfFailedWithErrorInfo:errorInfo errorCode:errorCode]; [self tryAgainIfFailedWithErrorInfo:errorInfo errorCode:errorCode];
} }
...@@ -217,6 +223,7 @@ static GMUserVideoTelephoneLogin *loginManager = nil; ...@@ -217,6 +223,7 @@ static GMUserVideoTelephoneLogin *loginManager = nil;
_joinChannelRetryCount--; _joinChannelRetryCount--;
}); });
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Santi.OnJoinError" status:@"failed" extraParam:@{@"order_no": SafeString(_messageDict[@"order_no"]), @"consultation_record_id": SafeString(_messageDict[@"consultation_record_id"]), @"channel_id": SafeString(_channelId), @"error_code": @(errorCode)}];
[self uploadFailedRecordWithErrorInfo:errorInfo]; [self uploadFailedRecordWithErrorInfo:errorInfo];
} }
} }
...@@ -224,6 +231,7 @@ static GMUserVideoTelephoneLogin *loginManager = nil; ...@@ -224,6 +231,7 @@ static GMUserVideoTelephoneLogin *loginManager = nil;
/// 上传状态到服务器 /// 上传状态到服务器
/// @param errorInfo 错误信息 /// @param errorInfo 错误信息
- (void)uploadFailedRecordWithErrorInfo:(NSString *)errorInfo { - (void)uploadFailedRecordWithErrorInfo:(NSString *)errorInfo {
TTManager.telephoneStatus = TelephoneVideoStatus_rest;
[[NSNotificationCenter defaultCenter] postNotificationName:@"gm_push_remove_waiting_success" object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"gm_push_remove_waiting_success" object:nil];
[GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_addFail consultationRecordId:TTManager.consultationRecordId finishBlock:nil]; [GMVideoTelephoneRequestTool telephoneMessageEventType:GMEventType_addFail consultationRecordId:TTManager.consultationRecordId finishBlock:nil];
if (TTManager.totalTime <= 0) { if (TTManager.totalTime <= 0) {
......
...@@ -46,4 +46,16 @@ ...@@ -46,4 +46,16 @@
channel:(NSInteger)channel channel:(NSInteger)channel
channelId:(NSString *)channelId channelId:(NSString *)channelId
serviceType:(NSInteger)serviceType; serviceType:(NSInteger)serviceType;
/**
* @brief 面诊客户端链路日志
*
* @param actionStep : 操作
* @param status : 成功失败
* @param extraParam : 抢单id
*/
+ (void)consultation_traceWithActionStep:(NSString *)actionStep
status:(NSString *)status
extraParam:(NSDictionary *)extraParam;
@end @end
...@@ -77,4 +77,11 @@ ...@@ -77,4 +77,11 @@
NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)([datenow timeIntervalSince1970]*1000)]; NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)([datenow timeIntervalSince1970]*1000)];
return timeSp; return timeSp;
} }
+ (void)consultation_traceWithActionStep:(NSString *)actionStep status:(NSString *)status extraParam:(NSDictionary *)extraParam {
[Phobos track:@"consultation_trace" attributes:@{@"status":SafeString(status),
@"action":SafeString(actionStep),
@"extra_param":SafeValue(extraParam)}];
}
@end @end
...@@ -267,6 +267,7 @@ ...@@ -267,6 +267,7 @@
[_TTManager setTelephoneVideoCompositingLayout:self.windowStatu userId:uid doctorId:_TTManager.me.uid]; [_TTManager setTelephoneVideoCompositingLayout:self.windowStatu userId:uid doctorId:_TTManager.me.uid];
[_functionView startTime]; [_functionView startTime];
} else if (clientRole == TTTRtc_ClientRole_Broadcaster) {//副播进入 } else if (clientRole == TTTRtc_ClientRole_Broadcaster) {//副播进入
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.Santi.OnUserJoined" status:@"success" extraParam:@{@"user_id":@(uid), @"consultation_record_id": SafeString(_TTManager.consultationRecordId)}];
if (_TTManager.me.clientRole == TTTRtc_ClientRole_Anchor) { if (_TTManager.me.clientRole == TTTRtc_ClientRole_Anchor) {
[self switchVideoWindow:YES]; [self switchVideoWindow:YES];
} }
...@@ -311,7 +312,8 @@ ...@@ -311,7 +312,8 @@
#pragma mark - 主播退出房间(自己是副播的时候调用) #pragma mark - 主播退出房间(自己是副播的时候调用)
- (void)rtcEngine:(TTTRtcEngineKit *)engine didKickedOutOfUid:(int64_t)uid reason:(TTTRtcKickedOutReason)reason { - (void)rtcEngine:(TTTRtcEngineKit *)engine didKickedOutOfUid:(int64_t)uid reason:(TTTRtcKickedOutReason)reason {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Santi.OnUserKicked" status:@"success" extraParam:@{@"error_type": @(reason), @"consultation_record_id": SafeString(_TTManager.consultationRecordId)}];
if (reason == TTTRtc_KickedOut_MasterExit) { if (reason == TTTRtc_KickedOut_MasterExit) {
//主播退出房间 //主播退出房间
[GMHudModule showWarning:@"通话结束"]; [GMHudModule showWarning:@"通话结束"];
......
...@@ -395,6 +395,8 @@ ...@@ -395,6 +395,8 @@
[self.doctorVideoView configureRegion:doctorUser]; [self.doctorVideoView configureRegion:doctorUser];
[_TTManager setTelephoneVideoCompositingLayout:self.windowStatu userId:_TTManager.me.uid doctorId:uid]; [_TTManager setTelephoneVideoCompositingLayout:self.windowStatu userId:_TTManager.me.uid doctorId:uid];
} else if (clientRole == TTTRtc_ClientRole_Broadcaster) { } else if (clientRole == TTTRtc_ClientRole_Broadcaster) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Santi.OnUserJoined" status:@"success" extraParam:@{@"user_id": @(uid), @"consultation_record_id": SafeString(_TTManager.consultationRecordId)}];
[self.doctorVideoView configureRegion:doctorUser]; [self.doctorVideoView configureRegion:doctorUser];
if (_TTManager.me.clientRole == TTTRtc_ClientRole_Anchor) { if (_TTManager.me.clientRole == TTTRtc_ClientRole_Anchor) {
[self switchVideoWindow:NO]; [self switchVideoWindow:NO];
...@@ -411,7 +413,7 @@ ...@@ -411,7 +413,7 @@
#pragma mark - 主播退出房间(自己是副播的时候掉用) #pragma mark - 主播退出房间(自己是副播的时候掉用)
- (void)rtcEngine:(TTTRtcEngineKit *)engine didKickedOutOfUid:(int64_t)uid reason:(TTTRtcKickedOutReason)reason { - (void)rtcEngine:(TTTRtcEngineKit *)engine didKickedOutOfUid:(int64_t)uid reason:(TTTRtcKickedOutReason)reason {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Santi.OnUserKicked" status:@"success" extraParam:@{@"error_type": @(reason), @"consultation_record_id": SafeString(_TTManager.consultationRecordId)}];
if (reason == TTTRtc_KickedOut_MasterExit) { if (reason == TTTRtc_KickedOut_MasterExit) {
//主播退出房间 //主播退出房间
[GMHudModule showWarning:@"通话结束"]; [GMHudModule showWarning:@"通话结束"];
......
...@@ -9,12 +9,22 @@ ...@@ -9,12 +9,22 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, GMDispatch){
GMPushTypeDefault = 1,
GMPushTypeMsg = 2,
GMPushTypeCtrl = 3,
GMTelePoneVideoMsg = 5, //视频电话推送消息
};
@interface GMVideoWaitingView : GMPopupBgView @interface GMVideoWaitingView : GMPopupBgView
@property (nonatomic, assign) int currentTime; @property (nonatomic, assign) int currentTime;
/** 1:医生,2:面诊师 */ /** 1:医生,2:面诊师 */
@property (nonatomic, assign) NSInteger counsellorType; @property (nonatomic, assign) NSInteger counsellorType;
/** 面类类型 */ /** 面类类型 */
@property (nonatomic, assign) NSInteger consultationType; @property (nonatomic, assign) NSInteger consultationType;
@property (nonatomic, copy) NSString *orderNo;
/// 倒计时结束 /// 倒计时结束
@property (nonatomic, copy) void (^timerOverBlock)(void); @property (nonatomic, copy) void (^timerOverBlock)(void);
/// 点击右上角的× /// 点击右上角的×
......
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
self.bottomLabel.text = [NSString stringWithFormat:@"%ds", self.currentTime]; self.bottomLabel.text = [NSString stringWithFormat:@"%ds", self.currentTime];
self.currentTime --; self.currentTime --;
if (self.currentTime % 5 == 0) { if (self.currentTime % 5 == 0) {
[self fetchCurrentDispatchInfo]; [self fetchCurrentDispatchInfoWithIsNotify:NO];
} }
// 1s请求一次 // 1s请求一次
[self pingCurrentDispatch]; [self pingCurrentDispatch];
...@@ -202,19 +202,23 @@ ...@@ -202,19 +202,23 @@
} }
} }
- (void)fetchCurrentDispatchInfo { - (void)fetchCurrentDispatchInfoWithIsNotify:(BOOL)isNotify {
if (self.isCanceling) { if (self.isCanceling) {
return; return;
} }
__weak __typeof(self)weakSelf = self; __weak __typeof(self)weakSelf = self;
[GMNetworking requestOCWithApi:@"/api/consultation_counsel/get_current_dispatch_info" method:GMHTTPMethodGet parameters:nil completion:^(GMResponseOC * _Nonnull response) { [GMNetworking requestOCWithApi:@"/api/consultation_counsel/get_current_dispatch_info" method:GMHTTPMethodGet parameters:nil completion:^(GMResponseOC * _Nonnull response) {
if (response.data[@"notice_info"]) { if (response.data[@"notice_info"]) {
[weakSelf showSuccessView]; [weakSelf showSuccessView];
weakSelf.successView.object = [[GMNoticeInfoObject alloc] initWithDictionary:response.data[@"notice_info"] error:nil]; weakSelf.successView.object = [[GMNoticeInfoObject alloc] initWithDictionary:response.data[@"notice_info"] error:nil];
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:response.data[@"consultation_record_info"]]; NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:response.data[@"consultation_record_info"]];
[dict setValue:@(weakSelf.counsellorType) forKey:@"counsellor_type"]; [dict setValue:@(weakSelf.counsellorType) forKey:@"counsellor_type"];
[dict setValue:@(weakSelf.consultationType) forKey:@"consultation_type"]; [dict setValue:@(weakSelf.consultationType) forKey:@"consultation_type"];
weakSelf.successView.info = dict; weakSelf.successView.info = dict;
if (!isNotify) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.PollDispatch" status:@"success" extraParam:@{@"consultation_record_id": SafeString(dict[@"consultation_record_id"])}];
}
[GMVideoPhobos video_monitoringWithActionStep:@"用户客户端收到匹配成功回执" consultId:weakSelf.successView.info[@"consultation_record_id"] traceId:nil]; [GMVideoPhobos video_monitoringWithActionStep:@"用户客户端收到匹配成功回执" consultId:weakSelf.successView.info[@"consultation_record_id"] traceId:nil];
} }
}]; }];
...@@ -229,7 +233,7 @@ ...@@ -229,7 +233,7 @@
if (self.isCanceling) { if (self.isCanceling) {
return; return;
} }
[self fetchCurrentDispatchInfo]; [self fetchCurrentDispatchInfoWithIsNotify:YES];
[self pingCurrentDispatch]; [self pingCurrentDispatch];
} }
...@@ -238,10 +242,13 @@ ...@@ -238,10 +242,13 @@
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
[GMNetworking requestOCWithApi:@"/api/consultation_counsel/cancel_dispatch" method:GMHTTPMethodPost parameters:nil completion:^(GMResponseOC * _Nonnull response) { [GMNetworking requestOCWithApi:@"/api/consultation_counsel/cancel_dispatch" method:GMHTTPMethodPost parameters:nil completion:^(GMResponseOC * _Nonnull response) {
if (response.isSuccess) { if (response.isSuccess) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.CancelButton.Click" status:@"success" extraParam:@{@"order_no": SafeString(weakSelf.orderNo)}];
if (weakSelf.isCanceling) { if (weakSelf.isCanceling) {
[weakSelf waitViewHide]; [weakSelf waitViewHide];
} }
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.CancelButton.Click" status:@"failed" extraParam:@{@"order_no": SafeString(weakSelf.orderNo)}];
weakSelf.isCanceling = NO; weakSelf.isCanceling = NO;
[weakSelf fetchAndPingCurrentDispatch]; [weakSelf fetchAndPingCurrentDispatch];
} }
......
...@@ -94,11 +94,13 @@ ...@@ -94,11 +94,13 @@
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
[self.viewModel fetchWaitingListData:^(APIStatusCode apiStatus, NSString *message) { [self.viewModel fetchWaitingListData:^(APIStatusCode apiStatus, NSString *message) {
if (APIStatusCodeFailed == apiStatus) { // 失败 if (APIStatusCodeFailed == apiStatus) { // 失败
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.PollDispatch" status:@"failed" extraParam:@{@"consultation_record_id": @""}];
[weakSelf showEmptyView:GMEmptyViewTypeException]; [weakSelf showEmptyView:GMEmptyViewTypeException];
if ([message isNonEmpty]) { if ([message isNonEmpty]) {
[weakSelf toast:message]; [weakSelf toast:message];
} }
} else { } else {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.PollDispatch" status:@"success" extraParam:@{@"consultation_record_id": @""}];
if (apiStatus == APIStatusCodeEmpty) { // 空 if (apiStatus == APIStatusCodeEmpty) { // 空
[weakSelf showEmptyView:GMEmptyViewTypeEmpty]; [weakSelf showEmptyView:GMEmptyViewTypeEmpty];
} else { } else {
...@@ -196,8 +198,9 @@ ...@@ -196,8 +198,9 @@
[weakSelf.loadingView showLoading:NO]; [weakSelf.loadingView showLoading:NO];
[weakCell updateGrabBtnStatusWithCanClicked:NO]; [weakCell updateGrabBtnStatusWithCanClicked:NO];
[GMVideoPhobos video_monitoringWithActionStep:@"收到抢单成功回执" consultId:weakSelf.recordInfo[@"consultation_record_id"] traceId:nil]; [GMVideoPhobos video_monitoringWithActionStep:@"收到抢单成功回执" consultId:weakSelf.recordInfo[@"consultation_record_id"] traceId:nil];
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.JoinButton.Click" status:@"success" extraParam:@{@"dispatch_id": @"", @"consultation_record_id": SafeString(weakSelf.recordInfo[@"consultation_record_id"])}];
} failBlock:^(NSString *message) { } failBlock:^(NSString *message) {
[GMVideoPhobos consultation_traceWithActionStep:@"Consultation.Dispatch.JoinButton.Click" status:@"failed" extraParam:@{@"dispatch_id": @"", @"consultation_record_id": @""}];
// 2.抢单失败后关闭「抢单loading」页,并toast提示,按钮置灰 // 2.抢单失败后关闭「抢单loading」页,并toast提示,按钮置灰
[weakSelf toast:message]; [weakSelf toast:message];
[weakSelf.loadingView hide]; [weakSelf.loadingView hide];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment