Commit d7d21314 authored by 乔金柱's avatar 乔金柱

Merge branch 'jz/master' into 'master'

Jz/master

See merge request !64
parents c024e582 a9554016
......@@ -262,8 +262,8 @@ static dispatch_semaphore_t _phobos_semaphore;
- (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page {
if (![PhobosUtil isNonEmpty:page.pageName] || !page.needLogPV) {
if (!page.isFirst) {
page.isFirst = YES;
if (!page.isFirstEntry) {
page.isFirstEntry = YES;
}
return;
}
......@@ -288,9 +288,9 @@ static dispatch_semaphore_t _phobos_semaphore;
[dict setObject:PhobosSafeString(page.inTimeMillis) forKey:@"in_time_millis"];
[dict setObject:PhobosSafeString([PhobosUtil currentMMTime]) forKey:@"out_time_millis"];
//首次进来为1,再次进入的时候都为0
[dict setObject:page.isFirst ? @(0):@(1) forKey:@"is_first"];
if (!page.isFirst) {
page.isFirst = YES;
[dict setObject:page.isFirstEntry ? @(0):@(1) forKey:@"is_first"];
if (!page.isFirstEntry) {
page.isFirstEntry = YES;
}
if (page.inTime.length > 0) {
// 页面显示时间为空时不记录页面pv事件
......
......@@ -340,8 +340,8 @@ static OldPhobos *sharedClient = nil;
- (void)onPVEnd:(UIResponder<PhobosPVProtocol> *)page {
if (![PhobosUtil isNonEmpty:page.pageName] || !page.needLogPV) {
if (!page.isFirst) {
page.isFirst = YES;
if (!page.isFirstEntry) {
page.isFirstEntry = YES;
}
return;
}
......@@ -366,9 +366,9 @@ static OldPhobos *sharedClient = nil;
[dict setObject:PhobosSafeString(page.inTimeMillis) forKey:@"in_time_millis"];
[dict setObject:PhobosSafeString([PhobosUtil currentMMTime]) forKey:@"out_time_millis"];
//首次进来为1,再次进入的时候都为0
[dict setObject:page.isFirst ? @(0):@(1) forKey:@"is_first"];
if (!page.isFirst) {
page.isFirst = YES;
[dict setObject:page.isFirstEntry ? @(0):@(1) forKey:@"is_first"];
if (!page.isFirstEntry) {
page.isFirstEntry = YES;
}
if (page.inTime.length > 0) {
// 页面显示时间为空时不记录页面pv事件
......
......@@ -91,9 +91,9 @@ typedef void(^PhobosUpdatePVBlock)(void);
@property (nonatomic, strong) NSArray *referrerLink;
/**
是否是第一次来到这个页面,在viewDidLoad赋值为1
在即将消失的方法赋值为0
在即将消失的方法赋值为0 (是否是首次上报)
*/
@property (nonatomic, assign) BOOL isFirst;
@property (nonatomic, assign) BOOL isFirstEntry;
/// 业务层更新PVStart信息
@property (nonatomic, copy) PhobosUpdatePVBlock updatePVStartBlock;
......
......@@ -254,11 +254,11 @@
objc_setAssociatedObject(self, @selector(updatePVStartBlock), updatePVStartBlock, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
- (void)setIsFirst:(BOOL)isFirst {
objc_setAssociatedObject(self, @selector(isFirst), @(isFirst), OBJC_ASSOCIATION_ASSIGN);
- (void)setIsFirstEntry:(BOOL)isFirstEntry {
objc_setAssociatedObject(self, @selector(isFirstEntry), @(isFirstEntry), OBJC_ASSOCIATION_ASSIGN);
}
- (BOOL)isFirst {
-(BOOL)isFirstEntry {
NSNumber *num = objc_getAssociatedObject(self, _cmd);
return [num boolValue];
}
......
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