71 lines
2.1 KiB
Swift
71 lines
2.1 KiB
Swift
//
|
||
// AboutVC.swift
|
||
// QuickLocation
|
||
//
|
||
|
||
import UIKit
|
||
import RxSwift
|
||
import RxCocoa
|
||
|
||
final class AboutVC: BaseViewController {
|
||
|
||
private var rootView: AboutView!
|
||
|
||
override func loadView() {
|
||
rootView = AboutView(frame: UIScreen.main.bounds)
|
||
view = rootView
|
||
}
|
||
|
||
override func viewDidLoad() {
|
||
super.viewDidLoad()
|
||
bind()
|
||
}
|
||
|
||
private func bind() {
|
||
rootView.navView.onBackTapped = { [weak self] in
|
||
self?.navigationController?.popViewController(animated: true)
|
||
}
|
||
|
||
rootView.feedbackBtn.rx.controlEvent(.touchUpInside)
|
||
.subscribe(onNext: { _ in
|
||
DLToast.show(text: "敬请期待")
|
||
})
|
||
.disposed(by: disposeBag)
|
||
|
||
rootView.rateBtn.rx.controlEvent(.touchUpInside)
|
||
.subscribe(onNext: { _ in
|
||
Self.openAppStoreReview()
|
||
})
|
||
.disposed(by: disposeBag)
|
||
|
||
rootView.agreementBtn.rx.controlEvent(.touchUpInside)
|
||
.subscribe(onNext: { _ in
|
||
AppRouter.push(Route.web, userInfo: ["url": URLManager.shared.userAgreementUrl])
|
||
})
|
||
.disposed(by: disposeBag)
|
||
|
||
rootView.privacyBtn.rx.controlEvent(.touchUpInside)
|
||
.subscribe(onNext: { _ in
|
||
AppRouter.push(Route.web, userInfo: ["url": URLManager.shared.privacyPolicyUrl])
|
||
})
|
||
.disposed(by: disposeBag)
|
||
|
||
rootView.kidsPrivacyBtn.rx.controlEvent(.touchUpInside)
|
||
.subscribe(onNext: { _ in
|
||
AppRouter.push(Route.web, userInfo: ["url": URLManager.shared.kidsPrivacyUrl])
|
||
})
|
||
.disposed(by: disposeBag)
|
||
}
|
||
|
||
private static func openAppStoreReview() {
|
||
// Bundle 未配置 appId 时给提示;有则跳转写评价页
|
||
let appId = AppSettings.shared.appId
|
||
guard !appId.isEmpty,
|
||
let url = URL(string: "itms-apps://itunes.apple.com/app/id\(appId)?action=write-review") else {
|
||
DLToast.show(text: "暂无法打开评价")
|
||
return
|
||
}
|
||
UIApplication.shared.open(url)
|
||
}
|
||
}
|