Commit 01a550b6 authored by Steven杜宇's avatar Steven杜宇

// 人脉

parent a408d40d
......@@ -17,6 +17,8 @@ class YHMatchResultListViewController: YHBaseViewController {
let viewModel = YHMatchUserViewModel()
let loginViewModel = YHLoginViewModel()
let secondCardColor = UIColor.init(hex: 0xE7EBF3)
let thirdCardColor = UIColor.init(hex: 0xC4CEE3)
var matchUsersArr:[YHMatchUserInfo?] = []
weak var delegate: YHMatchProtocol?
lazy var bgImgV:UIImageView = {
......@@ -284,11 +286,13 @@ class YHMatchResultListViewController: YHBaseViewController {
func animaiton() {
let gap = 8.0
let view3 = YHNameCardInfoView.createCardView()
view3.backgroundColor = UIColor.init(hex: 0xC4CEE3)
view3.backgroundColor = self.thirdCardColor
view3.y = -YHNameCardInfoView.height
view3.x = 36+10
view3.width = YHNameCardInfoView.width-5*4
view3.x = 36+gap*2
view3.width = YHNameCardInfoView.width-gap*4
view3.isHidden = self.matchUsersArr.count < 3
if self.matchUsersArr.count >= 3 {
if let user = self.matchUsersArr[2] {
......@@ -298,10 +302,10 @@ class YHMatchResultListViewController: YHBaseViewController {
self.view.addSubview(view3)
let view2 = YHNameCardInfoView.createCardView()
view2.backgroundColor = UIColor.init(hex: 0xE7EBF3)
view2.backgroundColor = self.secondCardColor
view2.y = -YHNameCardInfoView.height
view2.x = 36+5
view2.width = YHNameCardInfoView.width-5*2
view2.x = 36+gap
view2.width = YHNameCardInfoView.width-gap*2
view2.isHidden = self.matchUsersArr.count < 2
self.view.addSubview(view2)
if self.matchUsersArr.count >= 2 {
......@@ -373,6 +377,7 @@ extension YHMatchResultListViewController: DragCardDataSource {
public func dragCard(_ dragCard: DragCardContainer, viewForCard index: Int) -> DragCardView {
print("getTopCardAt: \(index)")
let cardView:YHNameCardInfoView = YHNameCardInfoView.createCardView()
cardView.allowedDirection = self.allowedDirection
cardView.tag = 1000+index
......@@ -384,10 +389,9 @@ extension YHMatchResultListViewController: DragCardDataSource {
guard let self = self else { return }
YHHUD.show(.progress(message: "加载中..."))
self.viewModel.addFriendWithText(text!, yhId: userModel.yhId) {
[weak self] success, error in
guard let self = self else { return }
success, error in
YHHUD.hide()
if success {
YHHUD.hide()
YHHUD.flash(message: "已发送好友申请")
cardView.bottomBtn.setTitle("已发送好友申请", for: .normal)
cardView.bottomBtn.backgroundColor = .brandMainColor30
......@@ -410,12 +414,11 @@ extension YHMatchResultListViewController: DragCardDelegate {
if cardView is YHNameCardInfoView {
let cardInfoView = cardView as! YHNameCardInfoView
cardInfoView.backgroundColor = .white
if let secondCardView = dragCard.viewWithTag(1000+index+1) as? YHNameCardInfoView {
secondCardView.backgroundColor = UIColor.init(hex: 0xE7EBF3)
secondCardView.backgroundColor = self.secondCardColor
}
if let thirdCardView = dragCard.viewWithTag(1000+index+2) as? YHNameCardInfoView {
thirdCardView.backgroundColor = UIColor.init(hex: 0xC4CEE3)
thirdCardView.backgroundColor = self.thirdCardColor
}
}
}
......
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