Commit 0d0f2cfa by pierce

fixed bugs

parent e940266c
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_small_icon_apple@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_small_icon_qq@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_small_icon_wechat@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -120,11 +120,29 @@ class GDSettingItemBindCell: GDSettingItemBaseCell {
self.socialPlatImageView.isHidden = false
if model.plat == .apple {
self.socialPlatImageView.isHidden = true
faceImageView.snp.remakeConstraints({ make in
make.left.equalToSuperview()
make.size.equalTo(0)
make.centerY.equalToSuperview()
})
} else {
faceImageView.snp.remakeConstraints({ make in
make.left.equalToSuperview().offset(16)
make.size.equalTo(30)
make.centerY.equalToSuperview()
})
}
} else {
self.bindBtn.style = .circle
self.bindBtn.setTitle("绑定", for: .normal)
self.socialPlatImageView.isHidden = true
faceImageView.snp.remakeConstraints({ make in
make.left.equalToSuperview()
make.size.equalTo(0)
make.centerY.equalToSuperview()
})
}
}).disposed(by: disposeBag)
......
......@@ -55,6 +55,7 @@ public class GDURLVideoPlayView: BaseView {
if isValidString(self.videoUrl) == false {
return;
}
self.videoUrl = self.videoUrl.replacingOccurrences(of: "\t", with: "")
self.destroyEngine()
//使用默认配置
......@@ -81,7 +82,7 @@ public class GDURLVideoPlayView: BaseView {
self.player = IJKFFMoviePlayerController.init(contentURL: URL.init(string: self.videoUrl), with: options)
self.player?.setPauseInBackground(false)
//缩放模式
self.player?.scalingMode = .aspectFill
self.player?.scalingMode = .aspectFit
//设置自动播放模式
self.player?.shouldAutoplay = true
//准备播放
......
......@@ -20,8 +20,7 @@ class GDSettingAccountController: BaseViewController {
// 更新数据
GDRouter.UserRouter?.refreshUserInfo()
//
// getSocialPlatInfo()
getSocialPlatInfo()
}
// MARK: UI
......@@ -119,25 +118,25 @@ class GDSettingAccountController: BaseViewController {
}
}.bind(to: phone.subtitle).disposed(by: self.disposeBag)
// // QQ 按钮
// let qq = GDSettingItemModel(type: .bind)
// qq.plat = .qq
// qq.actionHandler = {[weak self] type in
// guard let self = self else { return }
// switch type {
// case .bind:
// if qq.platIsBind.value {
// GDStatistics.track(.settingAccountBindQQ, params: [.state: "解绑"])
// self.unbindPlat(plat: .qq)
// } else {
// GDStatistics.track(.settingAccountBindQQ, params: [.state: "绑定"])
// self.bindPlat(plat: .qq)
// }
// default: break
// }
// }
//
// // 微信按钮
// QQ 按钮
let qq = GDSettingItemModel(type: .bind)
qq.plat = .qq
qq.actionHandler = {[weak self] type in
guard let self = self else { return }
switch type {
case .bind:
if qq.platIsBind.value {
GDStatistics.track(.settingAccountBindQQ, params: [.state: "解绑"])
self.unbindPlat(plat: .qq)
} else {
GDStatistics.track(.settingAccountBindQQ, params: [.state: "绑定"])
self.bindPlat(plat: .qq)
}
default: break
}
}
// 微信按钮
// let wechat = GDSettingItemModel(type: .bind)
// wechat.plat = .wechat
// wechat.actionHandler = {[weak self] type in
......@@ -154,23 +153,23 @@ class GDSettingAccountController: BaseViewController {
// default: break
// }
// }
//
// let apple = GDSettingItemModel(type: .bind)
// apple.plat = .apple
// apple.actionHandler = {[weak self] type in
// guard let self = self else { return }
// switch type {
// case .bind:
// if apple.platIsBind.value {
// GDStatistics.track(.settingAccountBindApple, params: [.state: "解绑"])
// self.unbindPlat(plat: .apple)
// } else {
// GDStatistics.track(.settingAccountBindApple, params: [.state: "绑定"])
// self.bindPlat(plat: .apple)
// }
// default: break
// }
// }
let apple = GDSettingItemModel(type: .bind)
apple.plat = .apple
apple.actionHandler = {[weak self] type in
guard let self = self else { return }
switch type {
case .bind:
if apple.platIsBind.value {
GDStatistics.track(.settingAccountBindApple, params: [.state: "解绑"])
self.unbindPlat(plat: .apple)
} else {
GDStatistics.track(.settingAccountBindApple, params: [.state: "绑定"])
self.bindPlat(plat: .apple)
}
default: break
}
}
// 账号注销
let destroyAccount = GDSettingItemModel(type: .normal, title: "账号注销", userInteractor: true) {[weak self] (type) in
......@@ -201,141 +200,141 @@ class GDSettingAccountController: BaseViewController {
// 构建数据
let securityItem = GDSettingSectionModel(sectionTitle: nil, items: [security])
let accountSetting = GDSettingSectionModel(sectionTitle: "通过以下设置可提高安全等级", items: phoneArr, height: 30.0)
// let socialAccount = GDSettingSectionModel(sectionTitle: "账号绑定", items: [qq, wechat, apple], height: 30.0)
//let socialAccount = GDSettingSectionModel(sectionTitle: "账号绑定", items: [qq, wechat, apple], height: 30.0)*/
let socialAccount = GDSettingSectionModel(sectionTitle: "账号绑定", items: [qq, apple], height: 30.0)
let accountCancle = GDSettingSectionModel(sectionTitle: "", items: [destroyAccount], height: 8.0)
// socialAccount.identifier = self.socialAccountIdentifier
// self.tableView.items.accept([securityItem, accountSetting, socialAccount, accountCancle])
self.tableView.items.accept([securityItem, accountSetting, accountCancle])
socialAccount.identifier = self.socialAccountIdentifier
self.tableView.items.accept([securityItem, accountSetting, socialAccount, accountCancle])
}).disposed(by: disposeBag)
}
// MARK: Method
// func getSocialPlatInfo() {
// GDPersonalHttpHelper.shared.getSocialAccountInfo().subscribe(onSuccess: {[weak self] (socialArr) in
// guard let self = self else { return }
//
// let qq = GDSettingItemModel(type: .bind)
// qq.plat = .qq
//
// let wechat = GDSettingItemModel(type: .bind)
// wechat.plat = .wechat
//
// let apple = GDSettingItemModel(type: .bind)
// apple.plat = .apple
//
// for platInfo in socialArr {
// if platInfo.openType == "2" {
// // 微信
// wechat.platFace.accept(platInfo.facePath)
// wechat.platName.accept(platInfo.nickname)
// wechat.platIsBind.accept(true)
// } else if platInfo.openType == "1" {
// // QQ
// qq.platFace.accept(platInfo.facePath)
// qq.platName.accept(platInfo.nickname)
// qq.platIsBind.accept(true)
// } else if platInfo.openType == "4" {
// // 苹果登录
// apple.platFace.accept(platInfo.facePath)
// apple.platName.accept(platInfo.nickname)
// apple.platIsBind.accept(true)
// }
// }
//
// let items = self.tableView.items.value
//
// for sector in items {
// // 找到账号区
// if sector.identifier == self.socialAccountIdentifier {
// for platItem in sector.items {
// if platItem.plat == .qq {
// platItem.platFace.accept(qq.platFace.value)
// platItem.platName.accept(qq.platName.value)
// platItem.platIsBind.accept(qq.platIsBind.value)
// } else if platItem.plat == .wechat {
// platItem.platFace.accept(wechat.platFace.value)
// platItem.platName.accept(wechat.platName.value)
// platItem.platIsBind.accept(wechat.platIsBind.value)
// } else if platItem.plat == .apple {
// platItem.platFace.accept(apple.platFace.value)
// platItem.platName.accept(apple.platName.value)
// platItem.platIsBind.accept(apple.platIsBind.value)
// }
// }
// break
// }
// }
//
// }, onFailure: { (error) in
//
// }).disposed(by: disposeBag)
// }
func getSocialPlatInfo() {
GDPersonalHttpHelper.shared.getSocialAccountInfo().subscribe(onSuccess: {[weak self] (socialArr) in
guard let self = self else { return }
// /// 绑定第三方品台
// /// - Parameter plat: 平台
// private func bindPlat(plat: GDSocial.Plat) {
// // 未绑定进行绑定
// GDRouter.UserRouter?.bindSocialPlat(on: plat, currentVC: self).subscribe(onSuccess: {[weak self] (_) in
// FTIndicator.showToastMessage("绑定成功")
// guard let self = self else { return }
//// self.getSocialPlatInfo()
// }, onFailure: { (error) in
// guard let error = error as? GDMoyaError else { return }
// FTIndicator.showToastMessage(error.msg)
// }).disposed(by: disposeBag)
// }
//
// /// 解绑第三方平台
// /// - Parameter plat: 平台
// private func unbindPlat(plat: GDSocial.Plat) {
//
// var hadBind = false
// for section in tableView.items.value {
// if section.identifier == socialAccountIdentifier {
// for platItem in section.items {
// if platItem.plat != plat && platItem.platIsBind.value {
// hadBind = true
// break
// }
// }
// break
// }
// }
//
// // 已绑定进行解绑
// if GDRouter.UserRouter?.user.value.phone?.count ?? 0 <= 0 && !hadBind {
//
// _ = GDAlertView.showAlertView(title: "解绑失败", message: "您需要至少绑定一个社交账号或手机号,否则将无法登录\(GDAppConfig.gd_appName)\n立即绑定手机号?", confirmTitle: "确定", cancleTitle: "取消", confirmAction: {
//
// GDRouter.LoginRouter?.showUserBindPhoneVC(bindPhoneType: .bindPhone, canSkip: false)
// }, cancleAction: nil)
//
// return
// }
//
// _ = GDAlertView.showAlertView(viewController: self, title: nil, message: "解绑后将无法再使用此账号登录!\n仍然解绑?", confirmTitle: "解绑", cancleTitle: "取消", confirmAction: {
//
// GDRouter.UserRouter?.unbindSocialPlat(opentype: plat).subscribe(onSuccess: {[weak self] (_) in
// guard let self = self else { return }
//
// let phone = GDRouter.UserRouter?.user.value.phone ?? ""
// if phone.count > 0 && !hadBind {
//
// _ = GDAlertView.showAlertView(title: "解绑完成", message: "下次请使用手机号登录\(GDAppConfig.gd_appName)\n手机号:\(phone)", confirmTitle: "我知道了", cancleTitle: nil, confirmAction: nil, cancleAction: nil)
//
// } else {
// FTIndicator.showToastMessage("解绑成功")
// }
let qq = GDSettingItemModel(type: .bind)
qq.plat = .qq
let wechat = GDSettingItemModel(type: .bind)
wechat.plat = .wechat
let apple = GDSettingItemModel(type: .bind)
apple.plat = .apple
for platInfo in socialArr {
if platInfo.openType == "2" {
// 微信
wechat.platFace.accept(platInfo.facePath)
wechat.platName.accept(platInfo.nickname)
wechat.platIsBind.accept(true)
} else if platInfo.openType == "1" {
// QQ
qq.platFace.accept(platInfo.facePath)
qq.platName.accept(platInfo.nickname)
qq.platIsBind.accept(true)
} else if platInfo.openType == "4" {
// 苹果登录
apple.platFace.accept(platInfo.facePath)
apple.platName.accept(platInfo.nickname)
apple.platIsBind.accept(true)
}
}
let items = self.tableView.items.value
for sector in items {
// 找到账号区
if sector.identifier == self.socialAccountIdentifier {
for platItem in sector.items {
if platItem.plat == .qq {
platItem.platFace.accept(qq.platFace.value)
platItem.platName.accept(qq.platName.value)
platItem.platIsBind.accept(qq.platIsBind.value)
} else if platItem.plat == .wechat {
platItem.platFace.accept(wechat.platFace.value)
platItem.platName.accept(wechat.platName.value)
platItem.platIsBind.accept(wechat.platIsBind.value)
} else if platItem.plat == .apple {
platItem.platFace.accept(apple.platFace.value)
platItem.platName.accept(apple.platName.value)
platItem.platIsBind.accept(apple.platIsBind.value)
}
}
break
}
}
}, onFailure: { (error) in
}).disposed(by: disposeBag)
}
/// 绑定第三方品台
/// - Parameter plat: 平台
private func bindPlat(plat: GDSocial.Plat) {
// 未绑定进行绑定
GDRouter.UserRouter?.bindSocialPlat(on: plat, currentVC: self).subscribe(onSuccess: {[weak self] (_) in
FTIndicator.showToastMessage("绑定成功")
guard let self = self else { return }
// self.getSocialPlatInfo()
// }, onFailure: { (error) in
// guard let error = error as? GDMoyaError else { return }
// FTIndicator.showToastMessage(error.msg)
// }).disposed(by: self.disposeBag)
//
// }, cancleAction: nil)
//
// }
}, onFailure: { (error) in
guard let error = error as? GDMoyaError else { return }
FTIndicator.showToastMessage(error.msg)
}).disposed(by: disposeBag)
}
/// 解绑第三方平台
/// - Parameter plat: 平台
private func unbindPlat(plat: GDSocial.Plat) {
var hadBind = false
for section in tableView.items.value {
if section.identifier == socialAccountIdentifier {
for platItem in section.items {
if platItem.plat != plat && platItem.platIsBind.value {
hadBind = true
break
}
}
break
}
}
// 已绑定进行解绑
if GDRouter.UserRouter?.user.value.phone?.count ?? 0 <= 0 && !hadBind {
_ = GDAlertView.showAlertView(title: "解绑失败", message: "您需要至少绑定一个社交账号或手机号,否则将无法登录\(GDAppConfig.gd_appName)\n立即绑定手机号?", confirmTitle: "确定", cancleTitle: "取消", confirmAction: {
GDRouter.LoginRouter?.showUserBindPhoneVC(bindPhoneType: .bindPhone, canSkip: false)
}, cancleAction: nil)
return
}
_ = GDAlertView.showAlertView(viewController: self, title: nil, message: "解绑后将无法再使用此账号登录!\n仍然解绑?", confirmTitle: "解绑", cancleTitle: "取消", confirmAction: {
GDRouter.UserRouter?.unbindSocialPlat(opentype: plat).subscribe(onSuccess: {[weak self] (_) in
guard let self = self else { return }
let phone = GDRouter.UserRouter?.user.value.phone ?? ""
if phone.count > 0 && !hadBind {
_ = GDAlertView.showAlertView(title: "解绑完成", message: "下次请使用手机号登录\(GDAppConfig.gd_appName)\n手机号:\(phone)", confirmTitle: "我知道了", cancleTitle: nil, confirmAction: nil, cancleAction: nil)
} else {
FTIndicator.showToastMessage("解绑成功")
}
self.getSocialPlatInfo()
}, onFailure: { (error) in
guard let error = error as? GDMoyaError else { return }
FTIndicator.showToastMessage(error.msg)
}).disposed(by: self.disposeBag)
}, cancleAction: nil)
}
}
......@@ -68,8 +68,11 @@ class GDTeenagerPlayController: BaseViewController {
}
closeBtn.rx.tap
.bind(to: self.rx_dismissViewController)
.disposed(by: disposeBag)
.subscribe(onNext: { [weak self] _ in
self?.viewModel.leaveRoom()
self?.streamPlayView.destroyEngine()
self?.dismiss(animated: true)
}).disposed(by: disposeBag)
}
/// 流播放 View
......
......@@ -12,7 +12,8 @@ import RxCocoa
import GDToolBox
import GDRouter
let authArr: [GDPersonalAuthType] = [.phone, .idCard, .wechat]
//let authArr: [GDPersonalAuthType] = [.phone, .idCard, .wechat]
let authArr: [GDPersonalAuthType] = [.phone, .idCard]
class GDZoneInfoAuthCell: UITableViewCell {
......
......@@ -32,5 +32,28 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
Bifrost.checkAllModules(with: #selector(application(_:open:options:)), arguments: [app, url, options])
}
func applicationDidBecomeActive(_ application: UIApplication) {
Bifrost.checkAllModules(with: #selector(applicationDidBecomeActive(_:)), arguments: [application])
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Bifrost.checkAllModules(with: #selector(application(_:didRegisterForRemoteNotificationsWithDeviceToken:)), arguments: [application, deviceToken])
}
func applicationDidEnterBackground(_ application: UIApplication) {
Bifrost.checkAllModules(with: #selector(applicationDidEnterBackground(_:)), arguments: [application])
}
func applicationWillEnterForeground(_ application: UIApplication) {
Bifrost.checkAllModules(with: #selector(applicationWillEnterForeground(_:)), arguments: [application])
}
func applicationWillTerminate(_ application: UIApplication) {
Bifrost.checkAllModules(with: #selector(applicationWillTerminate(_:)), arguments: [application])
}
}
......@@ -2,6 +2,16 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>wtloginmqq2</string>
<string>mqqapi</string>
<string>mqqopensdkapiv2</string>
<string>mqqopensdkapiv3</string>
<string>mqq</string>
<string>mqqwpa</string>
<string>mqqopensdkssologin</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
......
......@@ -4,6 +4,10 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:xs.cxylive.top/xiusechat/</string>
......
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 sign in to comment