Commit 808ed382 authored by Steven杜宇's avatar Steven杜宇

// 匹配动画优化

parent 25d01332
...@@ -35,6 +35,8 @@ class YHMatchUserViewController: YHBaseViewController { ...@@ -35,6 +35,8 @@ class YHMatchUserViewController: YHBaseViewController {
return btn return btn
}() }()
var isBottomBtnEnabled = true
lazy var headLottieView: LottieAnimationView = { lazy var headLottieView: LottieAnimationView = {
let view = LottieAnimationView(name: "people_head") let view = LottieAnimationView(name: "people_head")
view.loopMode = .loop view.loopMode = .loop
...@@ -226,6 +228,12 @@ extension YHMatchUserViewController: JXSegmentedListContainerViewListDelegate { ...@@ -226,6 +228,12 @@ extension YHMatchUserViewController: JXSegmentedListContainerViewListDelegate {
extension YHMatchUserViewController: YHMatchProtocol { extension YHMatchUserViewController: YHMatchProtocol {
func startMatchUsers() { func startMatchUsers() {
if !self.isBottomBtnEnabled {
return
}
self.isBottomBtnEnabled = false
self.headLottieView.isHidden = true self.headLottieView.isHidden = true
self.launchLottieView.isHidden = false self.launchLottieView.isHidden = false
self.launchLottieView.loopMode = .playOnce self.launchLottieView.loopMode = .playOnce
...@@ -236,7 +244,9 @@ extension YHMatchUserViewController: YHMatchProtocol { ...@@ -236,7 +244,9 @@ extension YHMatchUserViewController: YHMatchProtocol {
self.rotateLottieView.isHidden = false self.rotateLottieView.isHidden = false
self.rotateLottieView.loopMode = .loop self.rotateLottieView.loopMode = .loop
self.rotateLottieView.play() self.rotateLottieView.play()
self.requestMatchUserList() DispatchQueue.global().asyncAfter(deadline: .now()+2.0, execute: {
self.requestMatchUserList()
})
} }
} }
} }
...@@ -245,7 +255,7 @@ extension YHMatchUserViewController { ...@@ -245,7 +255,7 @@ extension YHMatchUserViewController {
func requestMatchUserList() { func requestMatchUserList() {
self.viewModel.getMatchUserlist { self.viewModel.getMatchUserlist {
success, error in success, error in
self.isBottomBtnEnabled = true
if success, self.viewModel.matchUserArr.count > 0 { if success, self.viewModel.matchUserArr.count > 0 {
let vc = YHMatchResultListViewController() let vc = YHMatchResultListViewController()
vc.delegate = self vc.delegate = self
......
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 to comment