Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8eceaf8a
authored
Jul 05, 2024
by
pierce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交部分下载逻辑。实现md5去重
parent
330c3447
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
258 additions
and
87 deletions
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation.h
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSDownloadOperation.m
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSDownloadTaskModel.h
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSDownloadTaskModel.m
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSResourceDownloader.h
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSResourceDownloader.m
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSResourceModel.h
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Http/FUSHttpHelper.m
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Http/FUSHttpManager.h
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Http/FUSHttpManager.m
FuSiLive/AppDelegate.m
FuSiLive/Classes/BaoFang/OpenScreenPush/Other/FUSOpenScreenPushHelp.m
FuSiLive/Classes/Foundation/DataShare/FUSCacheDataShare.h
FuSiLive/Classes/Foundation/DataShare/FUSCacheDataShare.m
FuSiLive/Classes/Foundation/DataStores/FUSUserDefaultsStore.h
FuSiLive/Classes/Foundation/Http/FUSURLDictionary.h
FuSiLive/Classes/GiftDataCenter/FUSGiftDataCenter.h
FuSiLive/Classes/GiftDataCenter/FUSGiftDataCenter.m
FuSiLive/Classes/NewLive/Main/Controller/FUSLiveMainViewController.m
FuSiLive/Classes/NewLive/Main/Other/FUSLiveHelper.m
FuSiLive/Classes/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveBottomToolSubView.m
FuSiLive/Classes/NewLive/Main/View/FunctionView/FUSGiftCenter/FUSGiftAnimation/FUSWEBPGiftAnimation.m
FuSiLive/Classes/NewLive/Main/View/FunctionView/GiftView/FUSLiveGiftView.m
FuSiLive/Classes/NewLive/Main/View/FunctionView/Other/FUSMotorWEBPView.m
FuSiLive/Classes/NewsFeed/Controller/FUSNewsFeedDetailViewController.m
FuSiLive/Classes/NewsFeed/Other/FUSNewsFeedDataHelper.m
FuSiLive/Classes/Payment/Controller/FUSAccountRecordViewController.m
FuSiLive/Classes/Payment/Controller/FUSDewWebViewcontroller.m
FuSiLive/Classes/Payment/Controller/FUSProceedsViewController.m
FuSiLive/Classes/Zone/Controller/FireFlyMyZone/FUSZoneViewController.m
FuSiLive/FUSAPPConfigs/FUSFuSiWebViewEventHelper.m
Pods/Pods.xcodeproj/project.pbxproj
Pods/Target Support Files/FUSFoundation/FUSFoundation-umbrella.h
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation.h
View file @
8eceaf8a
...
@@ -95,7 +95,6 @@ FOUNDATION_EXPORT const unsigned char FUSFoundationVersionString[];
...
@@ -95,7 +95,6 @@ FOUNDATION_EXPORT const unsigned char FUSFoundationVersionString[];
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadTaskModel.h"
#import "FUSDownloadTaskModel.h"
#import "FUSResourceDownloader.h"
#import "FUSResourceDownloader.h"
#import "FUSResourceModel.h"
#import "FUSEventTrack.h"
#import "FUSEventTrack.h"
#import "FUSTalkingData.h"
#import "FUSTalkingData.h"
#import "FUSLog.h"
#import "FUSLog.h"
...
...
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSDownloadOperation.m
View file @
8eceaf8a
...
@@ -239,5 +239,4 @@
...
@@ -239,5 +239,4 @@
}
}
}
}
@end
@end
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSDownloadTaskModel.h
View file @
8eceaf8a
...
@@ -35,7 +35,10 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -35,7 +35,10 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
fus_addDownloadResourceModel
:(
FUSDownloadResourceModel
*
)
downloadModel
;
-
(
void
)
fus_addDownloadResourceModel
:(
FUSDownloadResourceModel
*
)
downloadModel
;
// 执行完的回调
// 执行完的回调
@property
(
nonatomic
,
copy
)
void
(
^
finishTaskHandler
)(
BOOL
succeed
,
FUSDownloadTaskModel
*
task
);
@property
(
nonatomic
,
copy
)
void
(
^
finishTaskHandler
)(
BOOL
succeed
,
FUSDownloadTaskModel
*
task
,
NSString
*
filePath
);
// 下载进度回调
@property
(
nonatomic
,
copy
)
void
(
^
downloadProgressHandler
)(
BOOL
succeed
,
FUSDownloadTaskModel
*
task
,
NSString
*
filePath
);
// 执行成功回调
// 执行成功回调
-
(
void
)
fus_executeDownloadSucceedHandlerWithFilePath
:(
NSString
*
)
filePath
;
-
(
void
)
fus_executeDownloadSucceedHandlerWithFilePath
:(
NSString
*
)
filePath
;
...
...
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSDownloadTaskModel.m
View file @
8eceaf8a
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
}
}
if
(
self
.
finishTaskHandler
)
{
if
(
self
.
finishTaskHandler
)
{
self
.
finishTaskHandler
(
YES
,
self
);
self
.
finishTaskHandler
(
YES
,
self
,
filePath
);
}
}
}
}
FUSLogInfo
(
@"pierce:%s"
,
__func__
);
FUSLogInfo
(
@"pierce:%s"
,
__func__
);
...
...
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSResourceDownloader.h
View file @
8eceaf8a
...
@@ -11,10 +11,20 @@
...
@@ -11,10 +11,20 @@
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadTaskModel.h"
#import "FUSDownloadTaskModel.h"
/// 下载限速
typedef
NS_ENUM
(
NSInteger
,
FUSResourceDownloaderBitrateLimited
)
{
FUSResourceDownloaderBitrateLimitedNoLimit
=
0
,
FUSResourceDownloaderBitrateLimitedLow
=
1
,
FUSResourceDownloaderBitrateLimitedNormal
=
2
,
};
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
@interface
FUSResourceDownloader
:
NSObject
@interface
FUSResourceDownloader
:
NSObject
/// 下载限速,默认为:FUSResourceDownloaderBitrateLimitedNoLimit
@property
(
nonatomic
,
assign
)
FUSResourceDownloaderBitrateLimited
bitrateLimit
;
/**
/**
* 获得单列
* 获得单列
*
*
...
...
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSResourceDownloader.m
View file @
8eceaf8a
...
@@ -12,9 +12,13 @@
...
@@ -12,9 +12,13 @@
#import "FUSDownloadOperation.h"
#import "FUSDownloadOperation.h"
#import "FUSToolSet.h"
#import "FUSToolSet.h"
#import <AFNetworking/AFNetworking.h>
// 列表读写锁的信号量
// 列表读写锁的信号量
static
dispatch_semaphore_t
semaphore
;
static
dispatch_semaphore_t
semaphore
;
static
NSString
const
*
FUSDownloadMd5ToLocalPathDictUDKey
=
@"DownloadMd5ToLocalPathDictUDKey"
;
// 下载操作的线程队列
// 下载操作的线程队列
static
dispatch_queue_t
downloadOperationQueue
;
static
dispatch_queue_t
downloadOperationQueue
;
static
dispatch_queue_t
get_downloadOperationQueue
(){
static
dispatch_queue_t
get_downloadOperationQueue
(){
...
@@ -29,12 +33,36 @@ static dispatch_queue_t get_downloadOperationQueue(){
...
@@ -29,12 +33,36 @@ static dispatch_queue_t get_downloadOperationQueue(){
// 当前所有的任务
// 当前所有的任务
@property
(
nonatomic
,
strong
)
NSMutableDictionary
<
NSString
*
,
FUSDownloadTaskModel
*>
*
taskDict
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
<
NSString
*
,
FUSDownloadTaskModel
*>
*
taskDict
;
// md5对应的本地地址
@property
(
nonatomic
,
strong
)
NSMutableDictionary
<
NSString
*
,
NSString
*>
*
md5ToLocalPathDict
;
// 下载任务执行队列
// 下载任务执行队列
@property
(
nonatomic
,
strong
)
NSOperationQueue
*
downloadQueue
;
@property
(
nonatomic
,
strong
)
NSOperationQueue
*
downloadQueue
;
// 信号量
// 信号量
@property
(
nonatomic
,
assign
)
NSInteger
semaphoreCount
;
@property
(
nonatomic
,
assign
)
NSInteger
semaphoreCount
;
/// 最大的并行
@property
(
nonatomic
,
assign
)
NSInteger
maxConcurrentOperationCount
;
/// 是否下载限速,配合单线程使用效果更佳
@property
(
nonatomic
,
assign
)
BOOL
needLimitBitRate
;
/// 最大每秒可以下载多少文件大小
@property
(
nonatomic
,
assign
)
NSInteger
maxDownloadBitRate
;
/// 上一次更新的时间
@property
(
nonatomic
,
assign
)
NSTimeInterval
lastUpdateTime
;
/// 上一秒更新的文件大小
@property
(
nonatomic
,
assign
)
NSInteger
lastSecondSize
;
@end
@interface
FUSResourceDownloader
(
FUSDownloadLimit
)
-
(
void
)
fus_bindDownloadLiscener
;
@end
@end
@implementation
FUSResourceDownloader
@implementation
FUSResourceDownloader
...
@@ -60,7 +88,19 @@ static dispatch_queue_t get_downloadOperationQueue(){
...
@@ -60,7 +88,19 @@ static dispatch_queue_t get_downloadOperationQueue(){
{
{
self
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
if
(
self
)
{
self
.
maxConcurrentOperationCount
=
3
;
self
.
maxDownloadBitRate
=
1
*
1024
*
1024
;
self
.
needLimitBitRate
=
NO
;
self
.
bitrateLimit
=
FUSResourceDownloaderBitrateLimitedNoLimit
;
self
.
taskDict
=
[
NSMutableDictionary
dictionary
];
self
.
taskDict
=
[
NSMutableDictionary
dictionary
];
self
.
md5ToLocalPathDict
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
FUSDownloadMd5ToLocalPathDictUDKey
]
mutableCopy
];
if
([
NSDictionary
isNull
:
self
.
md5ToLocalPathDict
])
{
self
.
md5ToLocalPathDict
=
[
NSMutableDictionary
dictionary
];
}
[
self
fus_bindDownloadLiscener
];
}
}
return
self
;
return
self
;
}
}
...
@@ -73,17 +113,33 @@ static dispatch_queue_t get_downloadOperationQueue(){
...
@@ -73,17 +113,33 @@ static dispatch_queue_t get_downloadOperationQueue(){
@autoreleasepool
{
@autoreleasepool
{
[
self
fus_addDataLock
];
[
self
fus_addDataLock
];
FUSDownloadTaskModel
*
task
=
self
.
taskDict
[
resource
.
resourceUrl
];
/// 因为线上存在很多同个md5但是不同资源地址的文件。
/// 所以这里记录md5 -> 本地地址的映射,
/// 如果文件md5对应的本地地址存在,那么就直接返回这个资源下载成功
NSString
*
taskKey
=
[
self
fus_taskKeyWithDownloadUrl
:
resource
.
resourceUrl
md5
:
resource
.
md5
];
NSString
*
filePath
=
self
.
md5ToLocalPathDict
[
taskKey
];
if
(
!
[
NSString
isNull
:
filePath
])
{
/// 如果当前的资源已经有了本地文件了,那么直接返回下载成功
if
(
resource
.
succeedHandler
)
{
resource
.
succeedHandler
(
filePath
);
}
FUSLogInfo
(
@"pierce:%s exist taskKey = %@;res = %@; local = %@"
,
__func__
,
taskKey
,
resource
.
resourceUrl
,
filePath
);
[
self
fus_removeDataLock
];
return
;
}
FUSDownloadTaskModel
*
task
=
self
.
taskDict
[
taskKey
];
[
self
fus_removeDataLock
];
[
self
fus_removeDataLock
];
BOOL
isNewTask
=
NO
;
BOOL
isNewTask
=
NO
;
if
(
!
task
)
{
if
(
!
task
)
{
task
=
[[
FUSDownloadTaskModel
alloc
]
init
];
task
=
[[
FUSDownloadTaskModel
alloc
]
init
];
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
self
)
weakSelf
=
self
;
task
.
finishTaskHandler
=
^
(
BOOL
succeed
,
FUSDownloadTaskModel
*
_Nonnull
task
)
{
task
.
finishTaskHandler
=
^
(
BOOL
succeed
,
FUSDownloadTaskModel
*
_Nonnull
task
,
NSString
*
_Nonnull
filePath
)
{
[
weakSelf
fus_removeTask
:
task
];
[
weakSelf
fus_removeTask
:
task
filePath
:
filePath
];
};
};
isNewTask
=
YES
;
isNewTask
=
YES
;
FUSLogInfo
(
@"pierce:%s isNewTask
%@"
,
__func__
,
resource
.
resourceUrl
);
FUSLogInfo
(
@"pierce:%s isNewTask
taskKey = %@; res = %@"
,
__func__
,
taskKey
,
resource
.
resourceUrl
);
}
}
[
task
fus_addDownloadResourceModel
:
resource
];
[
task
fus_addDownloadResourceModel
:
resource
];
...
@@ -98,25 +154,37 @@ static dispatch_queue_t get_downloadOperationQueue(){
...
@@ -98,25 +154,37 @@ static dispatch_queue_t get_downloadOperationQueue(){
operation
.
queuePriority
=
task
.
downloadPriority
;
operation
.
queuePriority
=
task
.
downloadPriority
;
[
self
.
downloadQueue
addOperation
:
operation
];
[
self
.
downloadQueue
addOperation
:
operation
];
}
else
{
}
else
{
FUSLogInfo
(
@"pierce:%s not NewTask
"
,
__func__
);
FUSLogInfo
(
@"pierce:%s not NewTask
taskKey = %@; res = %@"
,
__func__
,
taskKey
,
resource
.
resourceUrl
);
task
.
opertaion
.
queuePriority
=
task
.
downloadPriority
;
task
.
opertaion
.
queuePriority
=
task
.
downloadPriority
;
}
}
}
}
});
});
}
}
-
(
void
)
fus_removeTask
:
(
FUSDownloadTaskModel
*
)
task
{
-
(
void
)
fus_removeTask
:
(
FUSDownloadTaskModel
*
)
task
filePath
:
(
NSString
*
_Nonnull
)
filePath
{
[
self
fus_addDataLock
];
[
self
fus_addDataLock
];
[
self
.
taskDict
removeObjectForKey
:
task
.
downloadUrl
];
NSString
*
taskKey
=
[
self
fus_taskKeyWithDownloadUrl
:
task
.
downloadUrl
md5
:
task
.
downloadMd5
];
[
self
.
taskDict
removeObjectForKey
:
taskKey
];
self
.
md5ToLocalPathDict
[
taskKey
]
=
filePath
;
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
self
.
md5ToLocalPathDict
forKey
:
FUSDownloadMd5ToLocalPathDictUDKey
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[
self
fus_removeDataLock
];
[
self
fus_removeDataLock
];
}
}
-
(
NSString
*
)
fus_taskKeyWithDownloadUrl
:
(
NSString
*
)
downloadUrl
md5
:
(
NSString
*
)
md5
{
if
([
NSString
isNull
:
md5
])
{
return
downloadUrl
;
}
return
md5
;
}
-
(
NSOperationQueue
*
)
downloadQueue
{
-
(
NSOperationQueue
*
)
downloadQueue
{
if
(
!
_downloadQueue
)
{
if
(
!
_downloadQueue
)
{
_downloadQueue
=
[[
NSOperationQueue
alloc
]
init
];
_downloadQueue
=
[[
NSOperationQueue
alloc
]
init
];
_downloadQueue
.
maxConcurrentOperationCount
=
3
;
_downloadQueue
.
maxConcurrentOperationCount
=
self
.
maxConcurrentOperationCount
;
}
}
return
_downloadQueue
;
return
_downloadQueue
;
}
}
...
@@ -146,3 +214,75 @@ static dispatch_queue_t get_downloadOperationQueue(){
...
@@ -146,3 +214,75 @@ static dispatch_queue_t get_downloadOperationQueue(){
}
}
@end
@end
@implementation
FUSResourceDownloader
(
FUSDownloadLimit
)
-
(
void
)
fus_bindDownloadLiscener
{
__weak
typeof
(
self
)
weakSelf
=
self
;
/// 下载限速
[
FUSHttpManager
setDownloadTaskDidWriteDataBlock
:
^
(
NSURLSession
*
session
,
NSURLSessionDownloadTask
*
downloadTask
,
int64_t
bytesWritten
,
int64_t
totalBytesWritten
,
int64_t
totalBytesExpectedToWrite
)
{
if
(
weakSelf
.
needLimitBitRate
==
NO
)
{
return
;
}
if
(
bytesWritten
>
weakSelf
.
maxDownloadBitRate
)
{
NSTimeInterval
waitTime
=
bytesWritten
/
weakSelf
.
maxDownloadBitRate
;
[
weakSelf
fus_suspendTask
:
downloadTask
waitTime
:
waitTime
];
return
;
}
NSTimeInterval
time
=
[
NSDate
date
].
timeIntervalSince1970
;
if
(
time
-
weakSelf
.
lastUpdateTime
>
1
)
{
/// 如果大于1s,则更新时间
weakSelf
.
lastSecondSize
=
0
;
weakSelf
.
lastUpdateTime
=
time
;
return
;
}
weakSelf
.
lastSecondSize
+=
bytesWritten
;
if
(
weakSelf
.
lastSecondSize
>
weakSelf
.
maxDownloadBitRate
)
{
NSTimeInterval
waitTime
=
1
-
(
time
-
weakSelf
.
lastUpdateTime
);
[
weakSelf
fus_suspendTask
:
downloadTask
waitTime
:
waitTime
];
}
}];
}
-
(
void
)
setBitrateLimit
:
(
FUSResourceDownloaderBitrateLimited
)
bitrateLimit
{
_bitrateLimit
=
bitrateLimit
;
switch
(
bitrateLimit
)
{
case
FUSResourceDownloaderBitrateLimitedLow
:
self
.
needLimitBitRate
=
YES
;
self
.
maxDownloadBitRate
=
1
*
500
*
1024
;
break
;
case
FUSResourceDownloaderBitrateLimitedNormal
:
self
.
needLimitBitRate
=
YES
;
self
.
maxDownloadBitRate
=
2
*
1024
*
1024
;
break
;
case
FUSResourceDownloaderBitrateLimitedNoLimit
:
self
.
needLimitBitRate
=
NO
;
break
;
}
}
-
(
void
)
fus_suspendTask
:
(
NSURLSessionDownloadTask
*
)
task
waitTime
:
(
NSTimeInterval
)
waitTime
{
if
(
waitTime
<=
0
)
{
return
;
}
[
task
suspend
];
__weak
typeof
(
self
)
weakSelf
=
self
;
NSTimer
*
timer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
waitTime
repeats
:
NO
block
:^
(
NSTimer
*
_Nonnull
timer
)
{
[
task
resume
];
weakSelf
.
lastSecondSize
=
0
;
weakSelf
.
lastUpdateTime
=
[
NSDate
date
].
timeIntervalSince1970
;
}];
[[
NSRunLoop
currentRunLoop
]
addTimer
:
timer
forMode
:
NSRunLoopCommonModes
];
}
@end
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Download/FUSResourceModel.h
deleted
100644 → 0
View file @
330c3447
//
// FUSResourceDownloadModel.h
// FusiLive
//
// Created by pierce on 2021/1/4.
// Copyright © 2024年 FuSiLive. All rights reserved.
//
#import "FUSBaseModel.h"
//typedef <#existing#> <#new#>;
NS_ASSUME_NONNULL_BEGIN
@interface
FUSResourceDownloadModel
:
FUSBaseModel
// 资源id
@property
(
nonatomic
,
copy
)
NSString
*
resourceId
;
// 资源路径
@property
(
nonatomic
,
copy
)
NSString
*
resourceUrl
;
// md5
@property
(
nonatomic
,
copy
)
NSString
*
md5
;
@end
NS_ASSUME_NONNULL_END
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Http/FUSHttpHelper.m
View file @
8eceaf8a
...
@@ -1206,7 +1206,7 @@
...
@@ -1206,7 +1206,7 @@
}
}
// 拼接下载地址及下载存储路径
// 拼接下载地址及下载存储路径
NSString
*
downPath
=
[
FUSConfig
.
sharedInstanced
.
pathConfigs
.
downloadPathDocument
stringByAppendingPathComponent
:
relativePath
];
NSString
*
downPath
=
[
FUSConfig
.
sharedInstanced
.
pathConfigs
.
downloadPathDocument
stringByAppendingPathComponent
:
relativePath
];
NSString
*
cachePath
=
[
DOWNLOAD_PATH_CACHES
stringByAppendingPathComponent
:
relativePath
];
NSString
*
cachePath
=
[
DOWNLOAD_PATH_CACHES
stringByAppendingPathComponent
:
relativePath
];
NSString
*
downUrl
=
[
NSString
stringWithString
:
dnsUrl
];
NSString
*
downUrl
=
[
NSString
stringWithString
:
dnsUrl
];
if
([
downUrl
rangeOfString
:
relativePath
].
location
==
NSNotFound
)
{
if
([
downUrl
rangeOfString
:
relativePath
].
location
==
NSNotFound
)
{
...
...
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Http/FUSHttpManager.h
View file @
8eceaf8a
...
@@ -508,5 +508,7 @@ typedef enum : NSUInteger {
...
@@ -508,5 +508,7 @@ typedef enum : NSUInteger {
*/
*/
+
(
NSString
*
_Nonnull
)
fus_getHttUrl
:(
NSString
*
_Nonnull
)
url
params
:(
NSDictionary
*
_Nullable
)
params
;
+
(
NSString
*
_Nonnull
)
fus_getHttUrl
:(
NSString
*
_Nonnull
)
url
params
:(
NSDictionary
*
_Nullable
)
params
;
/// 下载回调,用于整体限速
+
(
void
)
setDownloadTaskDidWriteDataBlock
:(
nullable
void
(
^
)(
NSURLSession
*
session
,
NSURLSessionDownloadTask
*
downloadTask
,
int64_t
bytesWritten
,
int64_t
totalBytesWritten
,
int64_t
totalBytesExpectedToWrite
))
block
;
@end
@end
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/Http/FUSHttpManager.m
View file @
8eceaf8a
...
@@ -38,8 +38,29 @@
...
@@ -38,8 +38,29 @@
#import "UIKit+AFNetworking.h"
#import "UIKit+AFNetworking.h"
#import "FUSToolSet.h"
#import "FUSToolSet.h"
@interface
FUSHttpManager
()
/// 下载回调
@property
(
nonatomic
,
copy
)
void
(
^
downloadTaskDidWriteDataBlock
)(
NSURLSession
*
session
,
NSURLSessionDownloadTask
*
downloadTask
,
int64_t
bytesWritten
,
int64_t
totalBytesWritten
,
int64_t
totalBytesExpectedToWrite
);
@end
@implementation
FUSHttpManager
@implementation
FUSHttpManager
+
(
instancetype
)
sharedInstance
{
static
id
shared
=
nil
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
shared
=
[[
super
alloc
]
init
];
});
return
shared
;
}
+
(
void
)
setDownloadTaskDidWriteDataBlock
:
(
nullable
void
(
^
)(
NSURLSession
*
session
,
NSURLSessionDownloadTask
*
downloadTask
,
int64_t
bytesWritten
,
int64_t
totalBytesWritten
,
int64_t
totalBytesExpectedToWrite
))
block
{
FUSHttpManager
.
sharedInstance
.
downloadTaskDidWriteDataBlock
=
block
;
}
#pragma mark -- 监测网络工作状态
#pragma mark -- 监测网络工作状态
...
@@ -742,6 +763,8 @@
...
@@ -742,6 +763,8 @@
NSArray
*
contentTypes
=
[
NSArray
arrayWithObjects
:
@"application/json"
,
@"text/json"
,
@"text/plain"
,
@"text/html"
,
nil
];
NSArray
*
contentTypes
=
[
NSArray
arrayWithObjects
:
@"application/json"
,
@"text/json"
,
@"text/plain"
,
@"text/html"
,
nil
];
AFHTTPSessionManager
*
manager
=
[
self
creatHttpManagerWithRequestType
:
HTTPRequestType
responseType
:
HTTPResponseType
contentTypes
:
contentTypes
timeout
:
0
];
AFHTTPSessionManager
*
manager
=
[
self
creatHttpManagerWithRequestType
:
HTTPRequestType
responseType
:
HTTPResponseType
contentTypes
:
contentTypes
timeout
:
0
];
[
manager
setDownloadTaskDidWriteDataBlock
:
FUSHttpManager
.
sharedInstance
.
downloadTaskDidWriteDataBlock
];
__block
NSURLSessionDownloadTask
*
task
=
[
manager
downloadTaskWithRequest
:
request
progress
:
^
(
NSProgress
*
_Nonnull
downloadProgress
)
{
__block
NSURLSessionDownloadTask
*
task
=
[
manager
downloadTaskWithRequest
:
request
progress
:
^
(
NSProgress
*
_Nonnull
downloadProgress
)
{
if
(
progress
)
{
if
(
progress
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
FuSiLive/AppDelegate.m
View file @
8eceaf8a
...
@@ -599,6 +599,7 @@ static dispatch_queue_t get_status_queue() {
...
@@ -599,6 +599,7 @@ static dispatch_queue_t get_status_queue() {
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
0
)
forKey
:
TABBAR_ITEM_SOUND
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
0
)
forKey
:
TABBAR_ITEM_SOUND
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
YES
)
forKey
:
SHOULD_REMOTE_NOTIFICATION_TIP
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
YES
)
forKey
:
SHOULD_REMOTE_NOTIFICATION_TIP
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
URL_WEB_BAOFANG_ACTIVE_URL
forKey
:
UDKEY_BAOFANG_ACTIVE_PAGE_WEB_URL
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
URL_WEB_BAOFANG_ACTIVE_URL
forKey
:
UDKEY_BAOFANG_ACTIVE_PAGE_WEB_URL
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
([
NSDate
date
].
timeIntervalSince1970
)
forKey
:
FirstLaunchTimeUDKey
];
}
}
//第一次记录到的时间(目前只比较是不是第二天,不管有没有够24h)
//第一次记录到的时间(目前只比较是不是第二天,不管有没有够24h)
...
...
FuSiLive/Classes/BaoFang/OpenScreenPush/Other/FUSOpenScreenPushHelp.m
View file @
8eceaf8a
...
@@ -110,7 +110,7 @@ typedef NS_ENUM(NSUInteger,JumpType) {
...
@@ -110,7 +110,7 @@ typedef NS_ENUM(NSUInteger,JumpType) {
case
JTExchangeDew
:
case
JTExchangeDew
:
{
{
FUSWKWebViewController
*
exchangeDewVC
=
[[
FUSWKWebViewController
alloc
]
init
];
FUSWKWebViewController
*
exchangeDewVC
=
[[
FUSWKWebViewController
alloc
]
init
];
exchangeDewVC
.
webUrlString
=
URL_WEB_DEW_EXCHANGE_DEW
;
exchangeDewVC
.
webUrlString
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewFullfAddress
;
exchangeDewVC
.
shouldIncludeIdentifyInfo
=
YES
;
exchangeDewVC
.
shouldIncludeIdentifyInfo
=
YES
;
[
currentController
.
navigationController
pushViewController
:
exchangeDewVC
animated
:
YES
];
[
currentController
.
navigationController
pushViewController
:
exchangeDewVC
animated
:
YES
];
}
}
...
...
FuSiLive/Classes/Foundation/DataShare/FUSCacheDataShare.h
View file @
8eceaf8a
...
@@ -121,6 +121,9 @@
...
@@ -121,6 +121,9 @@
// 是否已经加载
// 是否已经加载
@property
(
nonatomic
,
assign
)
BOOL
isLoadedLaunch
;
@property
(
nonatomic
,
assign
)
BOOL
isLoadedLaunch
;
/// 用户下载至今的时间
@property
(
nonatomic
,
assign
,
readonly
)
NSTimeInterval
downloadTime
;
// 创建单例
// 创建单例
+
(
FUSCacheDataShare
*
)
shareStore
;
+
(
FUSCacheDataShare
*
)
shareStore
;
...
...
FuSiLive/Classes/Foundation/DataShare/FUSCacheDataShare.m
View file @
8eceaf8a
...
@@ -25,6 +25,18 @@
...
@@ -25,6 +25,18 @@
return
instance
;
return
instance
;
}
}
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
if
(
self
.
downloadTime
<=
3
*
60
*
60
*
24
)
{
FUSResourceDownloader
.
shareInstance
.
bitrateLimit
=
FUSResourceDownloaderBitrateLimitedNormal
;
}
else
{
FUSResourceDownloader
.
shareInstance
.
bitrateLimit
=
FUSResourceDownloaderBitrateLimitedNoLimit
;
}
}
return
self
;
}
// 是否审核状态
// 是否审核状态
+
(
BOOL
)
fus_isCheckStatus
{
+
(
BOOL
)
fus_isCheckStatus
{
if
([[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"CHECK_STATUS"
]
integerValue
]){
if
([[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"CHECK_STATUS"
]
integerValue
]){
...
@@ -178,4 +190,14 @@
...
@@ -178,4 +190,14 @@
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUS_USER_TRADE_REMIND_CHANGE_NOTIFICATION
object
:
userTradeRemindModel
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUS_USER_TRADE_REMIND_CHANGE_NOTIFICATION
object
:
userTradeRemindModel
];
}
}
-
(
NSTimeInterval
)
downloadTime
{
NSTimeInterval
downloadDate
=
[[
NSUserDefaults
standardUserDefaults
]
floatForKey
:
FirstLaunchTimeUDKey
];
if
(
downloadDate
<=
0
)
{
downloadDate
=
[
NSDate
date
].
timeIntervalSince1970
;
[[
NSUserDefaults
standardUserDefaults
]
setFloat
:
downloadDate
forKey
:
FirstLaunchTimeUDKey
];
}
return
[
NSDate
date
].
timeIntervalSince1970
-
downloadDate
;
}
@end
@end
FuSiLive/Classes/Foundation/DataStores/FUSUserDefaultsStore.h
View file @
8eceaf8a
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
#define kFUSConfigTalkingDataUDKey @"openStatswith"
#define kFUSConfigTalkingDataUDKey @"openStatswith"
// 标记非第一次启动
// 标记非第一次启动
#define NOT_FIRST_LAUNCH_BOOL @"NotFirstLaunchBool"
#define NOT_FIRST_LAUNCH_BOOL @"NotFirstLaunchBool"
// 第一次启动时间
#define FirstLaunchTimeUDKey @"FirstLaunchTimeUDKey"
// 第一次允许联网
// 第一次允许联网
#define FIRST_LAUNCH_NETWORK_ALLOW @"FirstLaunchNetworkAllow"
#define FIRST_LAUNCH_NETWORK_ALLOW @"FirstLaunchNetworkAllow"
// 自动登录标记
// 自动登录标记
...
...
FuSiLive/Classes/Foundation/Http/FUSURLDictionary.h
View file @
8eceaf8a
...
@@ -1071,29 +1071,9 @@
...
@@ -1071,29 +1071,9 @@
//消费记录
//消费记录
#define URL_WEB_CONSUME_RECORD DNS_WEB(@"/Nesting/recording/consum.html")
#define URL_WEB_CONSUME_RECORD DNS_WEB(@"/Nesting/recording/consum.html")
// 宝石记录
#define URL_WEB_DIAMOND_RECORD DNS_WEB(@"/Nesting/recording/gem.html")
// 露水记录
#define URL_WEB_DEW_RECORD DNS_WEB(@"/Nesting/recording/dew.html")
// 可提现萤火
#define URL_WEB_FIREFLY_WITHDRAW DNS_WEB(@"/Nesting/fireflyRmb/canFireFly.html")
// 兑换露水页面
#define URL_WEB_DEW_EXCHANGE_DEW DNS_WEB(@"/Nesting/dew/exchangeDew.html")
// 兑换露水半屏网页
#define URL_WEB_DEW_EXCHANGE_DEW_HALF DNS_WEB(@"/Nesting/dew/exchangeDewRoom.html")
// 可提现萤火
// 可提现萤火
#define URL_WEB_FIREFLY_WITHDRAW DNS_WEB(@"/Nesting/fireflyRmb/canFireFly.html")
#define URL_WEB_FIREFLY_WITHDRAW DNS_WEB(@"/Nesting/fireflyRmb/canFireFly.html")
// 累计萤火
#define URL_WEB_TOTAL_FIREFLY DNS_WEB(@"/Nesting/fireflyRmb/index.html")
// 露水消费记录
#define URL_WEB_DEW_CONSUM DNS_WEB(@"/Nesting/dew/dewConsum.html")
// 露水获得记录
// 露水获得记录
#define URL_WEB_DEW_MONEY DNS_WEB(@"/Nesting/dew/devMoney.html")
#define URL_WEB_DEW_MONEY DNS_WEB(@"/Nesting/dew/devMoney.html")
...
...
FuSiLive/Classes/GiftDataCenter/FUSGiftDataCenter.h
View file @
8eceaf8a
...
@@ -187,6 +187,7 @@ extern NSString * const kEneterRoomGiftCenterDownloadFinishNotification;
...
@@ -187,6 +187,7 @@ extern NSString * const kEneterRoomGiftCenterDownloadFinishNotification;
@param completion 成功回调
@param completion 成功回调
*/
*/
-
(
void
)
fus_fetchWebpResourceWithResourceUrl
:(
NSString
*
)
resourceUrl
-
(
void
)
fus_fetchWebpResourceWithResourceUrl
:(
NSString
*
)
resourceUrl
resourceMd5
:(
NSString
*
)
resourceMd5
completion
:(
void
(
^
)(
YYImage
*
yyImage
))
completion
;
completion
:(
void
(
^
)(
YYImage
*
yyImage
))
completion
;
/**
/**
...
...
FuSiLive/Classes/GiftDataCenter/FUSGiftDataCenter.m
View file @
8eceaf8a
...
@@ -1420,21 +1420,21 @@ NSString * const kMD5GiftResourceKey = @"kMD5GiftResourceKey";
...
@@ -1420,21 +1420,21 @@ NSString * const kMD5GiftResourceKey = @"kMD5GiftResourceKey";
@param completion 成功回调
@param completion 成功回调
*/
*/
-
(
void
)
fus_fetchWebpResourceWithResourceUrl
:
(
NSString
*
)
resourceUrl
-
(
void
)
fus_fetchWebpResourceWithResourceUrl
:
(
NSString
*
)
resourceUrl
resourceMd5
:
(
NSString
*
)
resourceMd5
completion
:
(
void
(
^
)(
YYImage
*
yyImage
))
completion
completion
:
(
void
(
^
)(
YYImage
*
yyImage
))
completion
{
{
NSString
*
filePath
=
[
NSString
stringWithFormat
:
@"%@%@"
,
FUSConfig
.
sharedInstanced
.
pathConfigs
.
downloadPathDocument
,
resourceUrl
];
NSString
*
filePath
=
[
NSString
stringWithFormat
:
@"%@%@"
,
FUSConfig
.
sharedInstanced
.
pathConfigs
.
downloadPathDocument
,
resourceUrl
];
if
(
!
[
FUSFileHelper
fus_isExistFileAtPath
:
filePath
])
{
if
(
!
[
FUSFileHelper
fus_isExistFileAtPath
:
filePath
])
{
// 如果文件不存在
if
(
completion
)
{
completion
(
nil
);
}
// 重新下载
// 重新下载
[
self
checkResourceDownloadWithResourceUrl
:
resourceUrl
resourceMd5
:
nil
gid
:
nil
success
:^
{
[
self
checkResourceDownloadWithResourceUrl
:
resourceUrl
resourceMd5
:
resourceMd5
gid
:
nil
success
:^
{
[
self
fus_fetchWebpResourceWithResourceUrl
:
resourceUrl
resourceMd5
:
resourceMd5
completion
:
completion
];
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
// 如果文件不存在
if
(
completion
)
{
completion
(
nil
);
}
}];
}];
return
;
return
;
...
...
FuSiLive/Classes/NewLive/Main/Controller/FUSLiveMainViewController.m
View file @
8eceaf8a
...
@@ -179,6 +179,12 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -179,6 +179,12 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 刷新 liveFunctionView 数据
// 刷新 liveFunctionView 数据
[
self
.
liveFunctionView
fus_refreshFunctionView
];
[
self
.
liveFunctionView
fus_refreshFunctionView
];
self
.
hiddenNavigationBar
=
YES
;
self
.
hiddenNavigationBar
=
YES
;
if
(
FUSCacheDataShare
.
shareStore
.
downloadTime
<=
3
*
60
*
60
*
24
)
{
FUSResourceDownloader
.
shareInstance
.
bitrateLimit
=
FUSResourceDownloaderBitrateLimitedLow
;
}
else
{
FUSResourceDownloader
.
shareInstance
.
bitrateLimit
=
FUSResourceDownloaderBitrateLimitedNoLimit
;
}
}
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
...
...
FuSiLive/Classes/NewLive/Main/Other/FUSLiveHelper.m
View file @
8eceaf8a
...
@@ -780,6 +780,12 @@
...
@@ -780,6 +780,12 @@
// [FUSLiveHelper shareInstance].pushStreamSwitchTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:[FUSLiveHelper shareInstance] selector:@selector(onPushStreamTimeOutTimer:) userInfo:nil repeats:NO];
// [FUSLiveHelper shareInstance].pushStreamSwitchTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:[FUSLiveHelper shareInstance] selector:@selector(onPushStreamTimeOutTimer:) userInfo:nil repeats:NO];
[[
FUSLiveHelper
shareInstance
]
performSelector
:
@selector
(
onPushStreamTimeOutTimer
:)
withObject
:
nil
afterDelay
:
1
];
[[
FUSLiveHelper
shareInstance
]
performSelector
:
@selector
(
onPushStreamTimeOutTimer
:)
withObject
:
nil
afterDelay
:
1
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
QUICK_LIVE_ROOM
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
QUICK_LIVE_ROOM
object
:
nil
];
if
(
FUSCacheDataShare
.
shareStore
.
downloadTime
<=
3
*
60
*
60
*
24
)
{
FUSResourceDownloader
.
shareInstance
.
bitrateLimit
=
FUSResourceDownloaderBitrateLimitedNormal
;
}
else
{
FUSResourceDownloader
.
shareInstance
.
bitrateLimit
=
FUSResourceDownloaderBitrateLimitedNoLimit
;
}
}
}
/**
/**
...
...
FuSiLive/Classes/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveBottomToolSubView.m
View file @
8eceaf8a
...
@@ -207,7 +207,7 @@
...
@@ -207,7 +207,7 @@
{
{
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
url
=
URL_WEB_DEW_EXCHANGE_DEW_HALF
;
halfWebModel
.
url
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewHalfAddress
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
...
...
FuSiLive/Classes/NewLive/Main/View/FunctionView/FUSGiftCenter/FUSGiftAnimation/FUSWEBPGiftAnimation.m
View file @
8eceaf8a
...
@@ -75,9 +75,9 @@
...
@@ -75,9 +75,9 @@
[
self
bringSubviewToFront
:
self
.
bgImageView
];
[
self
bringSubviewToFront
:
self
.
bgImageView
];
if
([
NSString
isNull
:
self
.
animationModel
.
giftModel
.
darkRes
])
{
if
([
NSString
isNull
:
self
.
animationModel
.
giftModel
.
darkRes
])
{
[
self
fus_loadWebpImageWithURL
:
self
.
animationModel
.
resource
];
[
self
fus_loadWebpImageWithURL
:
self
.
animationModel
.
resource
resourceMd5
:
nil
];
}
else
{
}
else
{
[
self
fus_loadWebpImageWithURL
:
self
.
animationModel
.
giftModel
.
darkRes
];
[
self
fus_loadWebpImageWithURL
:
self
.
animationModel
.
giftModel
.
darkRes
resourceMd5
:
self
.
animationModel
.
giftModel
.
darkMd5
];
}
}
}
}
...
@@ -87,11 +87,13 @@
...
@@ -87,11 +87,13 @@
@param resourceUrl 资源地址
@param resourceUrl 资源地址
*/
*/
-
(
void
)
fus_loadWebpImageWithURL
:
(
NSString
*
)
resourceUrl
-
(
void
)
fus_loadWebpImageWithURL
:
(
NSString
*
)
resourceUrl
resourceMd5
:
(
NSString
*
)
resourceMd5
{
{
// 使用 YYIMage 来显示 WEBP 图片
// 使用 YYIMage 来显示 WEBP 图片
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
self
)
weakSelf
=
self
;
[[
FUSGiftDataCenter
sharedCenter
]
fus_fetchWebpResourceWithResourceUrl
:
resourceUrl
completion
:
^
(
YYImage
*
yyImage
)
{
[[
FUSGiftDataCenter
sharedCenter
]
fus_fetchWebpResourceWithResourceUrl
:
resourceUrl
resourceMd5
:
resourceMd5
completion
:^
(
YYImage
*
yyImage
)
{
if
(
!
yyImage
)
{
if
(
!
yyImage
)
{
return
;
return
;
...
...
FuSiLive/Classes/NewLive/Main/View/FunctionView/GiftView/FUSLiveGiftView.m
View file @
8eceaf8a
...
@@ -2667,7 +2667,7 @@ static FUSLiveGiftView *giftView = nil;
...
@@ -2667,7 +2667,7 @@ static FUSLiveGiftView *giftView = nil;
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
url
=
URL_WEB_DEW_EXCHANGE_DEW_HALF
;
halfWebModel
.
url
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewHalfAddress
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
...
@@ -2730,7 +2730,7 @@ static FUSLiveGiftView *giftView = nil;
...
@@ -2730,7 +2730,7 @@ static FUSLiveGiftView *giftView = nil;
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
url
=
URL_WEB_DEW_EXCHANGE_DEW_HALF
;
halfWebModel
.
url
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewHalfAddress
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
...
...
FuSiLive/Classes/NewLive/Main/View/FunctionView/Other/FUSMotorWEBPView.m
View file @
8eceaf8a
...
@@ -334,7 +334,8 @@
...
@@ -334,7 +334,8 @@
self
.
webpMotorImageView
.
alpha
=
0
;
self
.
webpMotorImageView
.
alpha
=
0
;
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
self
)
weakSelf
=
self
;
[[
YYWebImageManager
sharedManager
]
requestImageWithURL
:[
NSURL
URLWithString
:[
FUSConfig
.
sharedInstanced
.
pathConfigs
downloadPath
:
motorModel
.
darkRes
]]
options
:
0
progress
:
nil
transform
:
nil
completion
:^
(
UIImage
*
_Nullable
image
,
NSURL
*
_Nonnull
url
,
YYWebImageFromType
from
,
YYWebImageStage
stage
,
NSError
*
_Nullable
error
)
{
NSString
*
filePath
=
[[
FUSGiftDataCenter
sharedCenter
]
fus_fetchWebpResourceWithResourceUrl
:
motorModel
.
darkRes
resourceMd5
:
motorModel
.
darkMd5
completion
:^
(
YYImage
*
yyImage
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
...
...
FuSiLive/Classes/NewsFeed/Controller/FUSNewsFeedDetailViewController.m
View file @
8eceaf8a
...
@@ -329,7 +329,7 @@
...
@@ -329,7 +329,7 @@
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
url
=
URL_WEB_DEW_EXCHANGE_DEW_HALF
;
halfWebModel
.
url
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewHalfAddress
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
...
...
FuSiLive/Classes/NewsFeed/Other/FUSNewsFeedDataHelper.m
View file @
8eceaf8a
...
@@ -353,7 +353,7 @@
...
@@ -353,7 +353,7 @@
if
(
buttonIndex
==
0
)
{
if
(
buttonIndex
==
0
)
{
FUSWKWebViewController
*
exchangeDewVC
=
[[
FUSWKWebViewController
alloc
]
init
];
FUSWKWebViewController
*
exchangeDewVC
=
[[
FUSWKWebViewController
alloc
]
init
];
exchangeDewVC
.
webUrlString
=
URL_WEB_DEW_EXCHANGE_DEW
;
exchangeDewVC
.
webUrlString
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewFullfAddress
;
exchangeDewVC
.
needShowReload
=
YES
;
exchangeDewVC
.
needShowReload
=
YES
;
exchangeDewVC
.
shouldIncludeIdentifyInfo
=
YES
;
exchangeDewVC
.
shouldIncludeIdentifyInfo
=
YES
;
[[
UIViewController
fus_topViewController
].
navigationController
pushViewController
:
exchangeDewVC
animated
:
YES
];
[[
UIViewController
fus_topViewController
].
navigationController
pushViewController
:
exchangeDewVC
animated
:
YES
];
...
...
FuSiLive/Classes/Payment/Controller/FUSAccountRecordViewController.m
View file @
8eceaf8a
...
@@ -89,11 +89,11 @@
...
@@ -89,11 +89,11 @@
rechargeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&method=%@&lang=%@"
,
URL_WEB_RECHARGE
,
uid
,
token
,
lang
];
rechargeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&method=%@&lang=%@"
,
URL_WEB_RECHARGE
,
uid
,
token
,
lang
];
}
else
if
(
_recordType
==
FUSRecordTypeDew
)
{
}
else
if
(
_recordType
==
FUSRecordTypeDew
)
{
[
FUSTalkingData
fus_trackEvent
:
EVENT_ME_DEW_CONSUMERECORD
];
[
FUSTalkingData
fus_trackEvent
:
EVENT_ME_DEW_CONSUMERECORD
];
consumeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&token=%@&lang=%@"
,
URL_WEB_DEW_CONSUM
,
uid
,
token
,
lang
];
consumeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&token=%@&lang=%@"
,
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
chipTradeAddress
,
uid
,
token
,
lang
];
rechargeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&token=%@&lang=%@"
,
URL_WEB_DEW_MONEY
,
uid
,
token
,
lang
];
rechargeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&token=%@&lang=%@"
,
URL_WEB_DEW_MONEY
,
uid
,
token
,
lang
];
}
else
if
(
_recordType
==
FUSRecordTypeJewelAndDew
)
{
}
else
if
(
_recordType
==
FUSRecordTypeJewelAndDew
)
{
consumeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&method=%@&lang=%@"
,
URL_WEB_DIAMOND_RECORD
,
uid
,
token
,
lang
];
consumeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&method=%@&lang=%@"
,
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
gemTradeAddress
,
uid
,
token
,
lang
];
rechargeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&method=%@&lang=%@"
,
URL_WEB_DEW_RECORD
,
uid
,
token
,
lang
];
rechargeVc
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?uid=%@&method=%@&lang=%@"
,
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
chipTradeAddress
,
uid
,
token
,
lang
];
}
}
...
...
FuSiLive/Classes/Payment/Controller/FUSDewWebViewcontroller.m
View file @
8eceaf8a
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
-
(
instancetype
)
init
{
-
(
instancetype
)
init
{
self
=
[
super
init
];
self
=
[
super
init
];
if
(
self
)
{
if
(
self
)
{
self
.
webUrlString
=
URL_WEB_DEW_EXCHANGE_DEW
;
self
.
webUrlString
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewFullfAddress
;
self
.
needShowReload
=
YES
;
self
.
needShowReload
=
YES
;
self
.
shouldIncludeIdentifyInfo
=
YES
;
self
.
shouldIncludeIdentifyInfo
=
YES
;
}
}
...
...
FuSiLive/Classes/Payment/Controller/FUSProceedsViewController.m
View file @
8eceaf8a
...
@@ -247,7 +247,7 @@
...
@@ -247,7 +247,7 @@
{
{
//talkingdata埋点
//talkingdata埋点
[
FUSTalkingData
fus_trackEvent
:
EVENT_ME_CASH_TOTAL
];
[
FUSTalkingData
fus_trackEvent
:
EVENT_ME_CASH_TOTAL
];
[
self
loadWebControllerWithUrl
:
URL_WEB_TOTAL_FIREFLY
];
[
self
loadWebControllerWithUrl
:
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
accumulateAddress
];
}
}
/**
/**
...
...
FuSiLive/Classes/Zone/Controller/FireFlyMyZone/FUSZoneViewController.m
View file @
8eceaf8a
...
@@ -313,7 +313,7 @@
...
@@ -313,7 +313,7 @@
// _dewAccountItem.itemClick = ^(FUSCustomSettingItem *item) {
// _dewAccountItem.itemClick = ^(FUSCustomSettingItem *item) {
// [FUSTalkingData fus_trackEvent:EVENT_ME_DEW];
// [FUSTalkingData fus_trackEvent:EVENT_ME_DEW];
//// FUSWKWebViewController *exchangeDewVC = [[FUSWKWebViewController alloc] init];
//// FUSWKWebViewController *exchangeDewVC = [[FUSWKWebViewController alloc] init];
//// exchangeDewVC.webUrlString =
URL_WEB_DEW_EXCHANGE_DEW
;
//// exchangeDewVC.webUrlString =
FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewFullfAddress
;
//// exchangeDewVC.needShowReload = YES;
//// exchangeDewVC.needShowReload = YES;
//// exchangeDewVC.shouldIncludeIdentifyInfo = YES;
//// exchangeDewVC.shouldIncludeIdentifyInfo = YES;
////
////
...
...
FuSiLive/FUSAPPConfigs/FUSFuSiWebViewEventHelper.m
View file @
8eceaf8a
...
@@ -1038,14 +1038,14 @@ static NSString *FUSWebRightBtnExtraInfoKey = @"FUSWebRightBtnExtraInfoKey";
...
@@ -1038,14 +1038,14 @@ static NSString *FUSWebRightBtnExtraInfoKey = @"FUSWebRightBtnExtraInfoKey";
if
(
FUSConfig
.
sharedInstanced
.
liveConfigs
.
isInRoom
)
{
if
(
FUSConfig
.
sharedInstanced
.
liveConfigs
.
isInRoom
)
{
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
FUSHalfWebViewModel
*
halfWebModel
=
[[
FUSHalfWebViewModel
alloc
]
init
];
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
popupType
=
FUSHalfWebViewPopupTypeHalfWeb
;
halfWebModel
.
url
=
URL_WEB_DEW_EXCHANGE_DEW_HALF
;
halfWebModel
.
url
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewHalfAddress
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
clickBlank
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
transparency
=
YES
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
halfWebModel
.
heightR
=
@
(
82
).
stringValue
;
[
FUSLiveHelper
.
shareInstance
.
currentFunctionView
fus_showHalfWebView
:
halfWebModel
];
[
FUSLiveHelper
.
shareInstance
.
currentFunctionView
fus_showHalfWebView
:
halfWebModel
];
}
else
{
}
else
{
FUSWKWebViewController
*
exchangeDewVC
=
[[
FUSWKWebViewController
alloc
]
init
];
FUSWKWebViewController
*
exchangeDewVC
=
[[
FUSWKWebViewController
alloc
]
init
];
exchangeDewVC
.
webUrlString
=
URL_WEB_DEW_EXCHANGE_DEW
;
exchangeDewVC
.
webUrlString
=
FUSCacheDataShare
.
shareStore
.
settingInitDataModel
.
fusiConfig
.
dewFullfAddress
;
exchangeDewVC
.
needShowReload
=
YES
;
exchangeDewVC
.
needShowReload
=
YES
;
exchangeDewVC
.
shouldIncludeIdentifyInfo
=
YES
;
exchangeDewVC
.
shouldIncludeIdentifyInfo
=
YES
;
...
...
Pods/Pods.xcodeproj/project.pbxproj
View file @
8eceaf8a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Pods/Target Support Files/FUSFoundation/FUSFoundation-umbrella.h
View file @
8eceaf8a
...
@@ -88,7 +88,6 @@
...
@@ -88,7 +88,6 @@
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadTaskModel.h"
#import "FUSDownloadTaskModel.h"
#import "FUSResourceDownloader.h"
#import "FUSResourceDownloader.h"
#import "FUSResourceModel.h"
#import "FUSEventTrack.h"
#import "FUSEventTrack.h"
#import "FUSTalkingData.h"
#import "FUSTalkingData.h"
#import "FUSLog.h"
#import "FUSLog.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment