Commit d79fa331 by pierce

fixed bugs

parent f01a4061
Showing with 137 additions and 43 deletions
......@@ -16,7 +16,10 @@ import SwiftyJSON
}
public protocol GDBaseBussinessSwiftRouter: GDBaseBussinessRouter {
var isCurrentVersionVerified:BehaviorRelay<Bool> { get }
var tabbarList:BehaviorRelay<[String]?> { get }
var firstOpen:Bool { get set }
func statNewUserActivity(for type: GDNewUserActivityType) -> Single<JSON>
......
......@@ -66,7 +66,7 @@ public protocol GDChatRoomSwiftRouter: GDChatRoomRouter {
func showMessageListVC() -> UIViewController
func changeSDKKey(appKey: String)
func showChatRoom(uid: String, nickname:String?)
func showChatRoom(uid: String, nickname:String?, rootVC:UIViewController?)
func showServiceChatRoom()
func addSystemMessage(conversationId: String, type: GDChatMessageSystemType, paramDict: [String: String])
......
......@@ -25,6 +25,8 @@ class Application: NSObject {
/// 当前版本号是否验证完成
let isCurrentVersionVerified = BehaviorRelay<Bool>(value: false)
let tabbarList:BehaviorRelay<[String]?> = .init(value: nil)
var isOnBackground = false
var firstOpen = false
......@@ -38,6 +40,10 @@ class Application: NSObject {
isCurrentVersionVerified.distinctUntilChanged().subscribe(onNext: { isVerified in
UserDefaults.standard.setValue(isVerified, forKey: GDBaseBussinessUDKey.isCurrentVersionVerified)
}).disposed(by: disposeBag)
if let tablist = UserDefaults.standard.object(forKey: GDBaseBussinessPublicUDKeys.tabListUDKey) as? [String] {
tabbarList.accept(tablist)
}
}
/// 初始化配置
......@@ -169,6 +175,12 @@ class Application: NSObject {
} else {
GDBaseBussinessHttpHelper.shared.verifyVersionCode().subscribe(onSuccess: {[weak self] (json) in
guard let self = self else { return }
if let tabList = json["tabList"].arrayObject as? [String] {
UserDefaults.standard.set(tabList, forKey: GDBaseBussinessPublicUDKeys.tabListUDKey)
tabbarList.accept(tabList)
}
let version = json["version"].intValue
if version > GDAppConfig.gd_versionCode.intValue {
self.isCurrentVersionVerified.accept(false)
......@@ -176,10 +188,6 @@ class Application: NSObject {
self.isCurrentVersionVerified.accept(true)
}
if let tabList = json["tabList"].arrayObject as? [String] {
UserDefaults.standard.set(tabList, forKey: GDBaseBussinessPublicUDKeys.tabListUDKey)
}
}, onFailure: { (error) in
// 除了这个账号,其他不用默认成shzt
if GDRouter.UserRouter?.user.value.uid == ReviewInfo.gd_uid {
......
......@@ -13,6 +13,7 @@ import RxSwift
import UMCommon
@objc public class GDBaseBussinessModule: NSObject, GDBaseBussinessSwiftRouter {
public func statNewUserActivity(for type: GDNewUserActivityType) -> Single<JSON> {
GDBaseBussinessHttpHelper.shared.statNewUserActivity(for: type)
}
......@@ -39,6 +40,8 @@ import UMCommon
public var isCurrentVersionVerified: BehaviorRelay<Bool> { Application.shared.isCurrentVersionVerified }
public var tabbarList: BehaviorRelay<[String]?> { Application.shared.tabbarList }
public var firstOpen: Bool {
get {
Application.shared.firstOpen
......
......@@ -90,7 +90,7 @@ import HyphenateChat
}
}
public func showChatRoom(uid: String, nickname: String?) {
public func showChatRoom(uid: String, nickname: String?, rootVC:UIViewController?) {
// 是好友
let chatVC = GDSingleChatViewController(with: uid)
chatVC.hidesBottomBarWhenPushed = true
......@@ -104,7 +104,7 @@ import HyphenateChat
}
}
UIViewController.topViewController()?.navigationController?.pushViewController(chatVC, animated: true)
rootVC?.navigationController?.pushViewController(chatVC, animated: true)
}
public func showServiceChatRoom() {
......
......@@ -99,6 +99,7 @@ class GDFightTeamEnterShowView: GDPublicFightTeamEnterShowView {
teamInfoBgView.addSubview(messageBgImageView)
messageLabel.font = .gd_pingfang(14)
messageLabel.textAlignment = .center
messageLabel.textColor = .white
messageLabel.text = self.enterMsg
teamInfoBgView.addSubview(messageLabel)
......
......@@ -12,6 +12,14 @@ import GDRouter
class GDFightTeamCreateController: BaseViewController {
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: "GDFightTeamCreateController", bundle: GDFightTeamBundle.bundle())
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
var createFightTeamSuccessHandler: EmptyClosure?
// MARK: UI
......@@ -21,7 +29,7 @@ class GDFightTeamCreateController: BaseViewController {
self.title = "创建战队"
self.view.backgroundColor = .white
createBtn.style = .circle
createBtn?.style = .circle
nameInputTextField.commonTextMaxLength = 4
nameInputTextField.gd_delegate = self
......@@ -32,7 +40,7 @@ class GDFightTeamCreateController: BaseViewController {
@IBOutlet weak var faceBtn: UIButton!
@IBOutlet weak var nameInputTextField: GDTextField!
@IBOutlet weak var createBtn: GDGradientButton!
@IBOutlet weak var createBtn: GDGradientButton?
// MARK: Data
let viewModel = GDFightTeamCreateViewModel()
......
......@@ -2,7 +2,6 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
......@@ -48,7 +47,7 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入战队名称(4个中文以内)" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Rkn-Um-haP" customClass="GDTextField" customModule="GDFightTeamBundle" customModuleProvider="target">
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入战队名称(4个中文以内)" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Rkn-Um-haP" customClass="GDTextField" customModule="GDToolBox">
<rect key="frame" x="66" y="10" width="252" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="QVl-vd-Gq1"/>
......@@ -77,7 +76,7 @@
<constraint firstItem="Q4v-gn-f2Y" firstAttribute="leading" secondItem="27m-Bg-J42" secondAttribute="leading" id="whX-35-67M"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pDU-6Q-6zg" customClass="GDGradientButton" customModule="GDFightTeamBundle" customModuleProvider="target">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pDU-6Q-6zg" customClass="GDGradientButton" customModule="GDToolBox">
<rect key="frame" x="127" y="323" width="160" height="45"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="n9I-Au-ppo"/>
......
......@@ -90,7 +90,7 @@ class GDFightTeamZoneController: BaseViewController {
}
myEmptyTeamView?.createClickHandler = {[weak self] in
let createVC = GDFightTeamCreateController()
let createVC = GDFightTeamCreateController(nibName: "GDFightTeamCreateController", bundle: GDFightTeamBundle.bundle())
self?.navigationController?.pushViewController(createVC, animated: true)
// 创建成功后刷新数据
createVC.createFightTeamSuccessHandler = {[weak self] in
......
......@@ -69,7 +69,7 @@ class GDFightTeamCallAlertView: BaseView {
/// 搭建背景 View
private func makeBgView() {
bgView.layer.masksToBounds = true
bgView.backgroundColor = .clear
bgView.backgroundColor = .white
self.addSubview(bgView)
// 添加遮罩
......@@ -78,13 +78,13 @@ class GDFightTeamCallAlertView: BaseView {
maskLayer.path = bezierPath.cgPath
bgView.layer.mask = maskLayer
let bgImageView = UIImageView(image: GDFightTeamBundle.imageNamed("alert_bg")?.resizableImage(withCapInsets: .init(top: 48, left: 24, bottom: 24, right: 24), resizingMode: .stretch))
bgImageView.contentMode = .scaleToFill
bgView.addSubview(bgImageView)
// let bgImageView = UIImageView(image: GDFightTeamBundle.imageNamed("alert_bg")?.resizableImage(withCapInsets: .init(top: 48, left: 24, bottom: 24, right: 24), resizingMode: .stretch))
// bgImageView.contentMode = .scaleToFill
// bgView.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
// bgImageView.snp.makeConstraints { make in
// make.edges.equalToSuperview()
// }
}
......
......@@ -178,7 +178,7 @@ class GDLiveFightTeamChannelView: BaseView {
tableView.showsHorizontalScrollIndicator = false
tableView.allowsSelection = false
if isZoneUI == false {
tableView.contentInset = .init(top: kLiveFightTeamHeaderViewHeight + 8, left: 0, bottom: 8, right: 0)
tableView.contentInset = .init(top: kLiveFightTeamHeaderViewHeight - 2, left: 0, bottom: 8, right: 0)
}
tableView.rx.setDataSource(self).disposed(by: disposeBag)
tableView.rx.setDelegate(self).disposed(by: disposeBag)
......
......@@ -101,7 +101,7 @@ class GDLiveFightTeamView: GDPublicLiveFightTeamView {
}
emptyTeamView.createClickHandler = {[weak self] in
let createVC = GDFightTeamCreateController()
let createVC = GDFightTeamCreateController(nibName: "GDFightTeamCreateController", bundle: GDFightTeamBundle.bundle())
self?.viewController?.navigationController?.pushViewController(createVC, animated: true)
// 创建成功后刷新数据
createVC.createFightTeamSuccessHandler = {[weak self] in
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "真爱编辑.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon_.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "zone_right_more_black_icon.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -43,7 +43,7 @@ public class GDFightTeamRouterModule: NSObject, GDFightTeamSwiftRouter {
}
public func pushCreateFightTeamVC(rootVC:UIViewController?, createSuccessHandler:EmptyClosure?) {
let createVC = GDFightTeamCreateController()
let createVC = GDFightTeamCreateController(nibName: "GDFightTeamCreateController", bundle: GDFightTeamBundle.bundle())
rootVC?.navigationController?.pushViewController(createVC, animated: true)
// 创建成功后刷新数据
createVC.createFightTeamSuccessHandler = createSuccessHandler
......
......@@ -133,9 +133,9 @@ class GDFriendListController: BaseViewController {
self?.tableView.deselectRow(at: indexPath, animated: true)
}).disposed(by: disposeBag)
tableView.rx.modelSelected(GDFriendModel.self).subscribe(onNext: { model in
tableView.rx.modelSelected(GDFriendModel.self).subscribe(onNext: { [weak self] model in
if let fid = model.uid {
GDRouter.ChatRoom?.showChatRoom(uid: fid, nickname: "")
GDRouter.ChatRoom?.showChatRoom(uid: fid, nickname: "", rootVC: self)
}
}).disposed(by: disposeBag)
......
......@@ -92,7 +92,7 @@ class GDFriendsRequestController: BaseViewController {
cell.setup(with: element)
cell.agreeClickHandler = {[weak self] fid in
self?.viewModel.agreeFriendRequest(for: fid, success: {
GDRouter.ChatRoom?.showChatRoom(uid: fid, nickname: "")
GDRouter.ChatRoom?.showChatRoom(uid: fid, nickname: "", rootVC: self)
})
}
}.disposed(by: disposeBag)
......
......@@ -345,14 +345,7 @@ class GDLiveChatInputView: BaseView {
let liveButtons = config.livebutton
if self.role == .audience {
buttonArr = [.textInput, .close]
if GDRouter.BaseBusinessRouter?.isCurrentVersionVerified.value == false {
buttonArr.append(.audienceMore)
}
if config.showfans {
buttonArr.append(.fansGroup)
}
buttonArr = [.textInput, .close, .audienceMore]
if GDRouter.BaseBusinessRouter?.isCurrentVersionVerified.value == false {
for (index, btnModel) in liveButtons.reversed().enumerated() {
......@@ -362,14 +355,14 @@ class GDLiveChatInputView: BaseView {
}
}
if config.showfans {
buttonArr.append(.fansGroup)
}
buttonArr.append(.gift)
} else if self.role == .anchor {
buttonArr = [.textInput, .close]
if GDRouter.BaseBusinessRouter?.isCurrentVersionVerified.value == false {
buttonArr.append(.anchorMore)
}
buttonArr = [.textInput, .close, .anchorMore]
if config.showLivePk {
buttonArr.append(.pk)
......
......@@ -741,7 +741,9 @@ class GDUserInfoCardView: BaseView {
let fightTeamRole = GDRouter.FightTeamRouter?.role.value
if GDLiveHelper.shared.liveVC?.roomInfoModel.value.liveControl == "1" || fightTeamRole == .captain || fightTeamRole == .manager
if GDLiveHelper.shared.liveVC?.roomInfoModel.value.liveControl == "1"
|| fightTeamRole == .captain
|| fightTeamRole == .manager
{
// 是场控
hidemanManageBtn.isHidden = uid == GDLiveHelper.shared.roomid.value
......@@ -890,7 +892,7 @@ class GDUserInfoCardView: BaseView {
if GDRouter.BaseBusinessRouter?.isCurrentVersionVerified.value == true {
// 未经验证的版本号
manageBtn.isHidden = true
blackListBtn.isHidden = false
blackListBtn.isHidden = model.uid == GDRouter.UserRouter?.uid
} else {
blackListBtn.isHidden = true
}
......
......@@ -5,7 +5,7 @@
"scale" : "1x"
},
{
"filename" : "icon_战队.png",
"filename" : "icon_live_input_fightTeam@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
......
......@@ -152,6 +152,20 @@ extension GDTabbarModule: BifrostModuleProtocol {
}
}).disposed(by: disposeBag)
if let baseRouter = GDRouter.BaseBusinessRouter {
baseRouter.tabbarList.skip(1).distinctUntilChanged().subscribe(onNext: { _ in
if GDRouter.UserRouter?.isLogin.value == true {
if let currentVC = UIApplication.shared.keyWindow?.rootViewController {
currentVC.dismiss(animated: false, completion: nil)
currentVC.navigationController?.popToRootViewController(animated: false)
}
UIApplication.shared.keyWindow?.rootViewController = GDTabBarViewController()
}
}).disposed(by: disposeBag)
}
GDRouter.UserRouter?.isVisitor.distinctUntilChanged().skip(1).subscribe(onNext: { visitor in
......
......@@ -380,7 +380,7 @@ class GDZoneViewController: BaseViewController {
chatBtn.rx.tap.subscribe(onNext: {[weak self] _ in
guard let self = self else { return }
let nickname = (GDRouter.Friend?.isFriend(self.viewModel.uid) == true) ? nil : self.viewModel.zoneData.value.nickname
GDRouter.ChatRoom?.showChatRoom(uid: self.viewModel.uid, nickname: nickname)
GDRouter.ChatRoom?.showChatRoom(uid: self.viewModel.uid, nickname: nickname, rootVC: self)
}).disposed(by: disposeBag)
// 图片数据
......
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