Commit 843fe315 authored by Steven杜宇's avatar Steven杜宇

// 匹配动画

parent 959025f4
...@@ -34,6 +34,7 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -34,6 +34,7 @@ class YHPeopleViewController: YHBaseViewController {
lazy var headLottieView: LottieAnimationView = { lazy var headLottieView: LottieAnimationView = {
let view = LottieAnimationView(name: "people_head") let view = LottieAnimationView(name: "people_head")
view.loopMode = .loop
return view return view
}() }()
...@@ -92,6 +93,7 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -92,6 +93,7 @@ class YHPeopleViewController: YHBaseViewController {
self.view.addSubview(launchLottieView) self.view.addSubview(launchLottieView)
self.view.addSubview(rotateLottieView) self.view.addSubview(rotateLottieView)
self.view.addSubview(headLottieView) self.view.addSubview(headLottieView)
self.headLottieView.play()
launchLottieView.snp.makeConstraints { make in launchLottieView.snp.makeConstraints { make in
make.width.height.equalTo(KScreenWidth) make.width.height.equalTo(KScreenWidth)
...@@ -147,13 +149,8 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -147,13 +149,8 @@ class YHPeopleViewController: YHBaseViewController {
@objc func didMatchBtnClicked() { @objc func didMatchBtnClicked() {
if true { if true {
self.headLottieView.loopMode = .playOnce
self.headLottieView.play {
[weak self] completed in
guard let self = self else { return }
self.headLottieView.isHidden = true self.headLottieView.isHidden = true
self.launchLottieView.loopMode = .playOnce self.launchLottieView.loopMode = .playOnce
self.launchLottieView.play { self.launchLottieView.play {
[weak self] completed in [weak self] completed in
guard let self = self else { return } guard let self = self else { return }
...@@ -165,24 +162,15 @@ class YHPeopleViewController: YHBaseViewController { ...@@ -165,24 +162,15 @@ class YHPeopleViewController: YHBaseViewController {
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
} }
}
return return
} }
let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight)) let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let window = UIApplication.shared.yhKeyWindow() let window = UIApplication.shared.yhKeyWindow()
window?.addSubview(view) window?.addSubview(view)
//
// let view = YHNameCardInfoView.createCardView()
// view.show()
// let vc = YHMyGoodFriendsVC()
// self.navigationController?.pushViewController(vc)
} }
func resetAnimation() { func resetAnimation() {
self.headLottieView.stop()
self.launchLottieView.stop() self.launchLottieView.stop()
self.rotateLottieView.stop() self.rotateLottieView.stop()
self.headLottieView.isHidden = false self.headLottieView.isHidden = false
......
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