Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
iOSTeam
/
Majiabao
/
TealiveModule
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
532c3614
authored
Apr 17, 2024
by
pierce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bugs
parent
63b82f6e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
37 deletions
LocalPodSpec/GDToolBox/GDToolBox/Classes/Base/Base/BaseModel.swift
LocalPodSpec/GDToolBox/GDToolBox/Classes/GDConfiguration.swift
LocalPodSpec/GDToolBox/GDToolBox/Classes/Tool/VideoTransformer/GDVideoTransformer.swift
Module/GDBaseBussiness/GDBaseBussiness/Application.swift
Module/GDChatMessage/GDChatMessage/Features/FakeMessage/GDFakeMessageCenter.swift
Module/GDPayment/GDPayment/Feature/RechargeView/GDRechargeView.swift
LocalPodSpec/GDToolBox/GDToolBox/Classes/Base/Base/BaseModel.swift
View file @
532c3614
...
...
@@ -12,7 +12,9 @@ import SwiftyJSON
import
RxSwift
import
RxCocoa
@objcMembers
open
class
BaseModel
:
NSObject
,
YYModel
,
NSCoding
{
@objcMembers
open
class
BaseModel
:
NSObject
,
YYModel
,
NSSecureCoding
{
public
static
var
supportsSecureCoding
:
Bool
=
true
open
func
encode
(
with
coder
:
NSCoder
)
{
self
.
modelInit
(
with
:
coder
)
...
...
LocalPodSpec/GDToolBox/GDToolBox/Classes/GDConfiguration.swift
View file @
532c3614
...
...
@@ -89,9 +89,9 @@ public struct DevConfig {
case
.
release
:
return
false
case
.
testing
:
return
tru
e
return
fals
e
case
.
developing
:
return
tru
e
return
fals
e
}
}
...
...
LocalPodSpec/GDToolBox/GDToolBox/Classes/Tool/VideoTransformer/GDVideoTransformer.swift
View file @
532c3614
...
...
@@ -67,6 +67,7 @@ public class GDVideoTransformer: BaseViewModel {
exportSession
.
outputURL
=
mp4Url
exportSession
.
shouldOptimizeForNetworkUse
=
true
exportSession
.
outputFileType
=
.
mp4
exportSession
.
videoComposition
=
self
.
getVideoComposition
(
asset
:
avAsset
)
exportSession
.
exportAsynchronously
{
...
...
@@ -104,4 +105,41 @@ public class GDVideoTransformer: BaseViewModel {
}
public
static
func
getVideoComposition
(
asset
:
AVAsset
)
->
AVMutableVideoComposition
?
{
guard
let
videoTrack
=
asset
.
tracks
(
withMediaType
:
.
video
)
.
first
else
{
return
nil
}
let
composition
=
AVMutableComposition
()
let
videoComposition
=
AVMutableVideoComposition
()
var
videoSize
=
videoTrack
.
naturalSize
let
tracks
=
asset
.
tracks
(
withMediaType
:
.
video
)
if
tracks
.
count
>
0
{
let
videoTrack
=
tracks
[
0
]
let
t
=
videoTrack
.
preferredTransform
if
t
.
a
==
0
&&
t
.
b
==
1.0
&&
t
.
c
==
-
1.0
&&
t
.
d
==
0
{
videoSize
=
CGSize
(
width
:
videoSize
.
height
,
height
:
videoSize
.
width
)
}
}
composition
.
naturalSize
=
videoSize
videoComposition
.
renderSize
=
videoSize
videoComposition
.
frameDuration
=
CMTimeMakeWithSeconds
(
1
/
Double
(
videoTrack
.
nominalFrameRate
),
preferredTimescale
:
600
)
let
compositionVideoTrack
=
composition
.
addMutableTrack
(
withMediaType
:
.
video
,
preferredTrackID
:
kCMPersistentTrackID_Invalid
)
try
?
compositionVideoTrack
?
.
insertTimeRange
(
CMTimeRangeMake
(
start
:
.
zero
,
duration
:
asset
.
duration
),
of
:
videoTrack
,
at
:
.
zero
)
let
layerInst
=
AVMutableVideoCompositionLayerInstruction
(
assetTrack
:
videoTrack
)
layerInst
.
setTransform
(
videoTrack
.
preferredTransform
,
at
:
.
zero
)
let
inst
=
AVMutableVideoCompositionInstruction
()
inst
.
timeRange
=
CMTimeRangeMake
(
start
:
.
zero
,
duration
:
asset
.
duration
)
inst
.
layerInstructions
=
[
layerInst
]
videoComposition
.
instructions
=
[
inst
]
return
videoComposition
}
}
Module/GDBaseBussiness/GDBaseBussiness/Application.swift
View file @
532c3614
...
...
@@ -32,7 +32,7 @@ class Application: NSObject {
private
override
init
()
{
super
.
init
()
let
isVerified
=
(
UserDefaults
.
standard
.
object
(
forKey
:
GDBaseBussinessUDKey
.
isCurrentVersionVerified
)
as?
Bool
)
??
fals
e
let
isVerified
=
(
UserDefaults
.
standard
.
object
(
forKey
:
GDBaseBussinessUDKey
.
isCurrentVersionVerified
)
as?
Bool
)
??
tru
e
isCurrentVersionVerified
.
accept
(
isVerified
)
isCurrentVersionVerified
.
distinctUntilChanged
()
.
subscribe
(
onNext
:
{
isVerified
in
...
...
Module/GDChatMessage/GDChatMessage/Features/FakeMessage/GDFakeMessageCenter.swift
View file @
532c3614
...
...
@@ -81,7 +81,7 @@ class GDFakeMessageCenter: BaseViewModel {
guard
let
self
=
self
else
{
return
}
if
model
.
roomlist
.
count
==
0
{
// 没有数据
// self.clean()
// self.clean()
return
}
...
...
@@ -190,8 +190,8 @@ class GDFakeMessageCenter: BaseViewModel {
guard
user
.
launchTime
>
0
else
{
// 时间无效
// userDict.removeValue(forKey: user.uid)
// fakeFriendList.accept(userDict.keys.map({ $0 }))
// userDict.removeValue(forKey: user.uid)
// fakeFriendList.accept(userDict.keys.map({ $0 }))
continue
}
...
...
@@ -257,10 +257,10 @@ class GDFakeMessageCenter: BaseViewModel {
UserDefaults
.
standard
.
set
(
date
,
forKey
:
GDChatMessageUDKeys
.
fakeMsgLastDate
+
currentUid
)
}
let
listData
=
try
?
NSKeyedArchiver
.
archivedData
(
withRootObject
:
userList
,
requiringSecureCoding
:
tru
e
)
let
listData
=
try
?
NSKeyedArchiver
.
archivedData
(
withRootObject
:
userList
,
requiringSecureCoding
:
fals
e
)
UserDefaults
.
standard
.
set
(
listData
,
forKey
:
GDChatMessageUDKeys
.
fakeMsgUserList
+
currentUid
)
let
data
=
try
?
NSKeyedArchiver
.
archivedData
(
withRootObject
:
userDict
,
requiringSecureCoding
:
tru
e
)
let
data
=
try
?
NSKeyedArchiver
.
archivedData
(
withRootObject
:
userDict
,
requiringSecureCoding
:
fals
e
)
UserDefaults
.
standard
.
set
(
data
,
forKey
:
GDChatMessageUDKeys
.
fakeMsgContent
+
currentUid
)
UserDefaults
.
standard
.
set
(
timeNode
,
forKey
:
GDChatMessageUDKeys
.
fakeMsgTimeNode
+
currentUid
)
...
...
@@ -281,11 +281,11 @@ class GDFakeMessageCenter: BaseViewModel {
if
let
userListDict
=
NSKeyedUnarchiver
.
unarchiveObject
(
with
:
userListData
)
as?
[
String
:
GDFakeMessageModel
]
{
for
(
index
,
user
)
in
userListDict
.
enumerated
()
{
// if index == 0 {
// user.value.launchTime = Date().timeStamp.intValue
// } else {
// if index == 0 {
// user.value.launchTime = Date().timeStamp.intValue
// } else {
user
.
value
.
launchTime
=
0
// }
// }
}
self
.
userDict
=
userListDict
...
...
Module/GDPayment/GDPayment/Feature/RechargeView/GDRechargeView.swift
View file @
532c3614
...
...
@@ -10,6 +10,7 @@ import UIKit
import
RxSwift
import
RxCocoa
import
GDToolBox
import
GDRouter
class
GDRechargeView
:
BaseView
{
...
...
@@ -178,30 +179,27 @@ class GDRechargeView: BaseView {
override
func
bindViewModel
()
{
super
.
bindViewModel
()
//TODO:Live: added By Pidan
// viewModel.viewController = GDLiveHelper.shared.liveVC
//
// let confirmAction = confirmBtn.rx.tap
// let selection = collectionView.rx.modelSelected(GDStoreModel.self).map { $0.rid }.asDriver(onErrorJustReturn: nil)
//
// let output = viewModel.transform(input: .init(confirmAction: confirmAction, selection: selection))
//
// // 钻石数量
// output.diamondNum.drive(diamondNumBtn.rx.title()).disposed(by: disposeBag)
//
// // 充值点数据
// output.rechargeData.drive(collectionView.rx.items(cellIdentifier: reuseIdentifier, cellType: GDRechargeViewCell.self)) { index, element, cell in
// cell.setup(element)
// output.selectRid.bind(to: cell.selectRid).disposed(by: cell.cellDisposeBag ?? self.disposeBag)
// }.disposed(by: disposeBag)
//
// // 客服按钮点击
// serviceBtn.rx.tap.subscribe(onNext: {[weak self] (_) in
// self?.viewModel.viewController?.navigationController?.pushViewController(GDServiceController(), animated: true)
// if GDLiveHelper.shared.liveState.value == .none {
// self?.dismiss()
// }
// }).disposed(by: disposeBag)
viewModel
.
viewController
=
UIViewController
.
topViewController
()
let
confirmAction
=
confirmBtn
.
rx
.
tap
let
selection
=
collectionView
.
rx
.
modelSelected
(
GDStoreModel
.
self
)
.
map
{
$0
.
rid
}
.
asDriver
(
onErrorJustReturn
:
nil
)
let
output
=
viewModel
.
transform
(
input
:
.
init
(
confirmAction
:
confirmAction
,
selection
:
selection
))
// 钻石数量
output
.
diamondNum
?
.
drive
(
diamondNumBtn
.
rx
.
title
())
.
disposed
(
by
:
disposeBag
)
// 充值点数据
output
.
rechargeData
?
.
drive
(
collectionView
.
rx
.
items
(
cellIdentifier
:
reuseIdentifier
,
cellType
:
GDRechargeViewCell
.
self
))
{
index
,
element
,
cell
in
cell
.
setup
(
element
)
output
.
selectRid
?
.
bind
(
to
:
cell
.
selectRid
)
.
disposed
(
by
:
cell
.
cellDisposeBag
??
self
.
disposeBag
)
}
.
disposed
(
by
:
disposeBag
)
// 客服按钮点击
serviceBtn
.
rx
.
tap
.
subscribe
(
onNext
:
{
(
_
)
in
GDRouter
.
ChatRoom
?
.
showServiceCharRoom
()
})
.
disposed
(
by
:
disposeBag
)
}
// MARK: Method
...
...
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