Commit d99aca6e authored by Steven杜宇's avatar Steven杜宇

// 卡片点击逻辑

parent 5ec6348c
...@@ -338,6 +338,7 @@ ...@@ -338,6 +338,7 @@
04FA8B302C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */; }; 04FA8B302C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */; };
04FA8B332C0880A100ABE43F /* YHAppleLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B322C0880A100ABE43F /* YHAppleLoginViewModel.swift */; }; 04FA8B332C0880A100ABE43F /* YHAppleLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FA8B322C0880A100ABE43F /* YHAppleLoginViewModel.swift */; };
04FB01CE2C23DDBD0040115D /* YHPeopleMatchNoDataView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FB01CD2C23DDBD0040115D /* YHPeopleMatchNoDataView.swift */; }; 04FB01CE2C23DDBD0040115D /* YHPeopleMatchNoDataView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FB01CD2C23DDBD0040115D /* YHPeopleMatchNoDataView.swift */; };
04FB01D02C23FA420040115D /* YHPeopleCardModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FB01CF2C23FA420040115D /* YHPeopleCardModel.swift */; };
04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */; }; 04FD85662C2124AF00BEF9C5 /* YHMyNameCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */; };
04FD85682C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */; }; 04FD85682C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */; };
04FD856A2C21362300BEF9C5 /* YHMyIntroductionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */; }; 04FD856A2C21362300BEF9C5 /* YHMyIntroductionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */; };
...@@ -870,6 +871,7 @@ ...@@ -870,6 +871,7 @@
04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOneKeyLoginViewModel.swift; sourceTree = "<group>"; }; 04FA8B2F2C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOneKeyLoginViewModel.swift; sourceTree = "<group>"; };
04FA8B322C0880A100ABE43F /* YHAppleLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAppleLoginViewModel.swift; sourceTree = "<group>"; }; 04FA8B322C0880A100ABE43F /* YHAppleLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAppleLoginViewModel.swift; sourceTree = "<group>"; };
04FB01CD2C23DDBD0040115D /* YHPeopleMatchNoDataView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPeopleMatchNoDataView.swift; sourceTree = "<group>"; }; 04FB01CD2C23DDBD0040115D /* YHPeopleMatchNoDataView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPeopleMatchNoDataView.swift; sourceTree = "<group>"; };
04FB01CF2C23FA420040115D /* YHPeopleCardModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPeopleCardModel.swift; sourceTree = "<group>"; };
04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardViewController.swift; sourceTree = "<group>"; }; 04FD85652C2124AF00BEF9C5 /* YHMyNameCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardViewController.swift; sourceTree = "<group>"; };
04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardAvatarInfoCell.swift; sourceTree = "<group>"; }; 04FD85672C21277800BEF9C5 /* YHMyNameCardAvatarInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyNameCardAvatarInfoCell.swift; sourceTree = "<group>"; };
04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyIntroductionCell.swift; sourceTree = "<group>"; }; 04FD85692C21362300BEF9C5 /* YHMyIntroductionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyIntroductionCell.swift; sourceTree = "<group>"; };
...@@ -1211,6 +1213,7 @@ ...@@ -1211,6 +1213,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
044D0BFD2C21649A00C5CF5E /* YHUserInformationModel.swift */, 044D0BFD2C21649A00C5CF5E /* YHUserInformationModel.swift */,
04FB01CF2C23FA420040115D /* YHPeopleCardModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3134,6 +3137,7 @@ ...@@ -3134,6 +3137,7 @@
045EEED92B9F171A0022A143 /* YHEducationDetailVC.swift in Sources */, 045EEED92B9F171A0022A143 /* YHEducationDetailVC.swift in Sources */,
045EEF1A2B9F171A0022A143 /* YHAddressViewController.swift in Sources */, 045EEF1A2B9F171A0022A143 /* YHAddressViewController.swift in Sources */,
A5C382CA2B5E1F4C00C5E65C /* YHLoginTipsView.swift in Sources */, A5C382CA2B5E1F4C00C5E65C /* YHLoginTipsView.swift in Sources */,
04FB01D02C23FA420040115D /* YHPeopleCardModel.swift in Sources */,
045EEEE92B9F171A0022A143 /* YHFamilyRequestViewModel.swift in Sources */, 045EEEE92B9F171A0022A143 /* YHFamilyRequestViewModel.swift in Sources */,
04F957472C203033003C631C /* YHMyGoodFriendsVC.swift in Sources */, 04F957472C203033003C631C /* YHMyGoodFriendsVC.swift in Sources */,
044867B42BA1953B00DFAD4A /* YHCertificateFilterView.swift in Sources */, 044867B42BA1953B00DFAD4A /* YHCertificateFilterView.swift in Sources */,
......
...@@ -11,7 +11,7 @@ import DragCardContainer ...@@ -11,7 +11,7 @@ import DragCardContainer
class YHMatchPeopleViewController: YHBaseViewController { class YHMatchPeopleViewController: YHBaseViewController {
var matchCardsArr:[String] = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""] var matchCardsArr:[YHPeopleCardModel] = [YHPeopleCardModel(), YHPeopleCardModel(), YHPeopleCardModel(), YHPeopleCardModel(), YHPeopleCardModel()]
lazy var bgImgV:UIImageView = { lazy var bgImgV:UIImageView = {
let bg = UIImageView(image: UIImage(named: "people_match_result_bg")) let bg = UIImageView(image: UIImage(named: "people_match_result_bg"))
...@@ -66,9 +66,29 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -66,9 +66,29 @@ class YHMatchPeopleViewController: YHBaseViewController {
return btn return btn
}() }()
lazy var rematchBtn:UIButton = {
let btn = UIButton()
btn.isHidden = true
btn.setTitle("再次智能匹配", for: .normal)
btn.backgroundColor = .brandMainColor
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 15)
btn.layer.cornerRadius = 3
btn.addTarget(self, action: #selector(didRematchBtnClicked), for: .touchUpInside)
return btn
}()
lazy var noDataView:YHPeopleMatchNoDataView = { lazy var noDataView:YHPeopleMatchNoDataView = {
let view = YHPeopleMatchNoDataView.createView() let view = YHPeopleMatchNoDataView.createView()
view.isHidden = true view.isHidden = true
view.relookBlock = {
[weak self] in
guard let self = self else { return }
self.rematchBtn.isHidden = true
self.changeBtn.isHidden = false
self.myCardBtn.isHidden = false
self.cardContainer.reloadData(forceReset: true)
}
return view return view
}() }()
...@@ -125,6 +145,10 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -125,6 +145,10 @@ class YHMatchPeopleViewController: YHBaseViewController {
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
@objc func didRematchBtnClicked() {
}
func createUI() { func createUI() {
gk_navigationBar.isHidden = true gk_navigationBar.isHidden = true
...@@ -147,6 +171,7 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -147,6 +171,7 @@ class YHMatchPeopleViewController: YHBaseViewController {
self.view.addSubview(self.cardActionView) self.view.addSubview(self.cardActionView)
self.cardActionView.addSubview(cardContainer) self.cardActionView.addSubview(cardContainer)
self.view.addSubview(self.noDataView) self.view.addSubview(self.noDataView)
self.view.addSubview(self.rematchBtn)
self.bgImgV.snp.makeConstraints { make in self.bgImgV.snp.makeConstraints { make in
make.edges.equalToSuperview() make.edges.equalToSuperview()
...@@ -211,6 +236,13 @@ class YHMatchPeopleViewController: YHBaseViewController { ...@@ -211,6 +236,13 @@ class YHMatchPeopleViewController: YHBaseViewController {
make.top.equalTo(self.topLabel.snp.bottom).offset(120) make.top.equalTo(self.topLabel.snp.bottom).offset(120)
make.height.equalTo(YHPeopleMatchNoDataView.height) make.height.equalTo(YHPeopleMatchNoDataView.height)
} }
self.rematchBtn.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.height.equalTo(48)
make.bottom.equalTo(-135)
}
animaiton() animaiton()
} }
...@@ -266,6 +298,13 @@ extension YHMatchPeopleViewController: DragCardDataSource { ...@@ -266,6 +298,13 @@ extension YHMatchPeopleViewController: DragCardDataSource {
let cardView:YHNameCardInfoView = YHNameCardInfoView.createCardView() let cardView:YHNameCardInfoView = YHNameCardInfoView.createCardView()
cardView.allowedDirection = self.allowedDirection cardView.allowedDirection = self.allowedDirection
cardView.tag = 1000+index cardView.tag = 1000+index
if 0 <= index && index < self.matchCardsArr.count {
let cardModel = self.matchCardsArr[index]
cardView.cardModel = cardModel
cardView.sendBlock = {
cardModel.isSend = true
}
}
return cardView return cardView
} }
} }
...@@ -294,7 +333,12 @@ extension YHMatchPeopleViewController: DragCardDelegate { ...@@ -294,7 +333,12 @@ extension YHMatchPeopleViewController: DragCardDelegate {
public func dragCard(_ dragCard: DragCardContainer, didRemovedLast cardView: DragCardView) { public func dragCard(_ dragCard: DragCardContainer, didRemovedLast cardView: DragCardView) {
print("didRemovedLast") print("didRemovedLast")
DispatchQueue.main.asyncAfter(deadline: .now()+0.5, execute: {
self.noDataView.isHidden = false self.noDataView.isHidden = false
self.rematchBtn.isHidden = false
self.changeBtn.isHidden = true
self.myCardBtn.isHidden = true
})
} }
public func dragCard(_ dragCard: DragCardContainer, didSelectTopCardAt index: Int, with cardView: DragCardView) { public func dragCard(_ dragCard: DragCardContainer, didSelectTopCardAt index: Int, with cardView: DragCardView) {
......
//
// YHPeopleCardModel.swift
// galaxy
//
// Created by edy on 2024/6/20.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPeopleCardModel: NSObject {
var isSend:Bool = false
}
...@@ -13,6 +13,21 @@ class YHNameCardInfoView: DragCardView { ...@@ -13,6 +13,21 @@ class YHNameCardInfoView: DragCardView {
static let height = 456.0 static let height = 456.0
static let width = KScreenWidth-36.0*2 static let width = KScreenWidth-36.0*2
var sendBlock:(()->())?
var cardModel:YHPeopleCardModel = YHPeopleCardModel() {
didSet {
if self.cardModel.isSend {
self.bottomBtn.setTitle("已发送好友申请", for: .normal)
self.bottomBtn.backgroundColor = .brandMainColor30
self.bottomBtn.isUserInteractionEnabled = false
} else {
self.bottomBtn.setTitle("交换名片", for: .normal)
self.bottomBtn.backgroundColor = .brandMainColor
self.bottomBtn.isUserInteractionEnabled = true
}
}
}
lazy var bgImgV:UIImageView = { lazy var bgImgV:UIImageView = {
let view = UIImageView() let view = UIImageView()
...@@ -97,6 +112,7 @@ class YHNameCardInfoView: DragCardView { ...@@ -97,6 +112,7 @@ class YHNameCardInfoView: DragCardView {
self.bottomBtn.setTitle("已发送好友申请", for: .normal) self.bottomBtn.setTitle("已发送好友申请", for: .normal)
self.bottomBtn.backgroundColor = .brandMainColor30 self.bottomBtn.backgroundColor = .brandMainColor30
self.bottomBtn.isUserInteractionEnabled = false self.bottomBtn.isUserInteractionEnabled = false
self.sendBlock?()
} }
view.show() view.show()
} }
......
...@@ -12,6 +12,8 @@ class YHPeopleMatchNoDataView: UIView { ...@@ -12,6 +12,8 @@ class YHPeopleMatchNoDataView: UIView {
static let height = 198.0 static let height = 198.0
var relookBlock:(()->())?
lazy var bgImgView:UIImageView = { lazy var bgImgView:UIImageView = {
let view = UIImageView(image: UIImage(named: "people_match_no_data_bg")) let view = UIImageView(image: UIImage(named: "people_match_no_data_bg"))
return view return view
...@@ -26,17 +28,6 @@ class YHPeopleMatchNoDataView: UIView { ...@@ -26,17 +28,6 @@ class YHPeopleMatchNoDataView: UIView {
return label return label
}() }()
lazy var rematchBtn:UIButton = {
let btn = UIButton()
btn.setTitle("再次智能匹配", for: .normal)
btn.backgroundColor = .brandMainColor
btn.setTitleColor(.white, for: .normal)
btn.titleLabel?.font = .PFSC_M(ofSize: 15)
btn.layer.cornerRadius = 3
btn.addTarget(self, action: #selector(didRematchBtnClicked), for: .touchUpInside)
return btn
}()
lazy var relookBtn:UIButton = { lazy var relookBtn:UIButton = {
let btn = UIButton() let btn = UIButton()
btn.setTitle("重新查看", for: .normal) btn.setTitle("重新查看", for: .normal)
...@@ -50,12 +41,10 @@ class YHPeopleMatchNoDataView: UIView { ...@@ -50,12 +41,10 @@ class YHPeopleMatchNoDataView: UIView {
return btn return btn
}() }()
@objc func didRematchBtnClicked() {
}
@objc func didRelookBtnClicked() { @objc func didRelookBtnClicked() {
self.isHidden = true
self.relookBlock?()
} }
static func createView() -> YHPeopleMatchNoDataView { static func createView() -> YHPeopleMatchNoDataView {
......
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