|
|
@@ -14,6 +14,7 @@ enum QSLAddJumpType: Int {
|
|
|
case homesmall
|
|
|
case homebig
|
|
|
case friend
|
|
|
+ case homealert
|
|
|
}
|
|
|
|
|
|
class QSLAddController: QSLBaseController {
|
|
|
@@ -31,7 +32,7 @@ class QSLAddController: QSLBaseController {
|
|
|
|
|
|
let button = UIButton()
|
|
|
button.image(UIImage(named: "public_back_btn"))
|
|
|
- button.title("添加好友")
|
|
|
+ button.title("查找好友")
|
|
|
button.mediumFont(17)
|
|
|
button.textColor(QSLColor.Color_202020)
|
|
|
button.setImageTitleLayout(.imgLeft, spacing: 4.rpx)
|
|
|
@@ -47,11 +48,35 @@ class QSLAddController: QSLBaseController {
|
|
|
return view
|
|
|
}()
|
|
|
|
|
|
- lazy var addTitleIcon: UIImageView = {
|
|
|
-
|
|
|
- let imageView = UIImageView()
|
|
|
- imageView.image = UIImage(named: "add_title_icon")
|
|
|
- return imageView
|
|
|
+ lazy var addTitleIcon: UILabel = {
|
|
|
+ let label = UILabel()
|
|
|
+ label.text("查找好友的手机号码")
|
|
|
+ label.textColor = .hexStringColor(hexString: "#202020")
|
|
|
+ label.mediumFont(17)
|
|
|
+ return label
|
|
|
+ }()
|
|
|
+
|
|
|
+ lazy var addTitleIconBg: UIView = {
|
|
|
+ let view = UIView(frame: CGRectMake(0, 0, 82.rpx, 12.rpx))
|
|
|
+ view.addRadius(radius: 6.rpx)
|
|
|
+
|
|
|
+ // 创建渐变色层
|
|
|
+ let gradientLayer = CAGradientLayer()
|
|
|
+ gradientLayer.colors = [
|
|
|
+ UIColor.hexStringColor(hexString: "#00DDAA",alpha: 1).cgColor,
|
|
|
+ UIColor.hexStringColor(hexString: "#00DDAA",alpha: 0).cgColor
|
|
|
+ ]
|
|
|
+ gradientLayer.startPoint = CGPoint(x: 0, y: 0.4) // 左中
|
|
|
+ gradientLayer.endPoint = CGPoint(x: 1, y: 0.4) // 右中
|
|
|
+ gradientLayer.frame = view.bounds
|
|
|
+
|
|
|
+ // 确保在布局变化时更新frame
|
|
|
+ view.layer.insertSublayer(gradientLayer, at: 0)
|
|
|
+
|
|
|
+ // 添加布局变化的监听
|
|
|
+ view.layoutIfNeeded()
|
|
|
+ view.layoutSubviews()
|
|
|
+ return view
|
|
|
}()
|
|
|
|
|
|
lazy var addInputView: UIView = {
|
|
|
@@ -98,7 +123,7 @@ class QSLAddController: QSLBaseController {
|
|
|
let btn = UIButton()
|
|
|
btn.addRadius(radius: 22.rpx)
|
|
|
btn.gradientBackgroundColor(color1: .hexStringColor(hexString: "#15CBA1"), color2: .hexStringColor(hexString: "#1FE0BA"), width: QSLConst.qsl_kScreenW - 32.rpx, height: 44.rpx, direction: .horizontal)
|
|
|
- btn.title("添加")
|
|
|
+ btn.title("查找")
|
|
|
btn.mediumFont(16)
|
|
|
btn.textColor(.white)
|
|
|
btn.setImageTitleLayout(.imgLeft, spacing: 0)
|
|
|
@@ -106,14 +131,14 @@ class QSLAddController: QSLBaseController {
|
|
|
return btn
|
|
|
}()
|
|
|
|
|
|
- lazy var infoLabel: UILabel = {
|
|
|
-
|
|
|
- let label = UILabel()
|
|
|
- label.text("定位功能需要双方同意方可使用")
|
|
|
- label.textColor = .hexStringColor(hexString: "#A7A7A7")
|
|
|
- label.font(13)
|
|
|
- return label
|
|
|
- }()
|
|
|
+// lazy var infoLabel: UILabel = {
|
|
|
+//
|
|
|
+// let label = UILabel()
|
|
|
+// label.text("定位功能需要双方同意方可使用")
|
|
|
+// label.textColor = .hexStringColor(hexString: "#A7A7A7")
|
|
|
+// label.font(13)
|
|
|
+// return label
|
|
|
+// }()
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
|
@@ -128,6 +153,8 @@ class QSLAddController: QSLBaseController {
|
|
|
gravityInstance?.track(QSLGravityConst.add_show, properties: ["id": 1002])
|
|
|
case .friend:
|
|
|
gravityInstance?.track(QSLGravityConst.add_show, properties: ["id": 1003])
|
|
|
+ case .homealert:
|
|
|
+ gravityInstance?.track(QSLGravityConst.add_show, properties: ["id": 1004])
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -139,19 +166,22 @@ class QSLAddController: QSLBaseController {
|
|
|
|
|
|
gravityInstance?.track(QSLGravityConst.add_click)
|
|
|
|
|
|
- if !QSLBaseManager.shared.isLogin() {
|
|
|
-
|
|
|
- QSLAlertView.alert(view: self.view, title: "温馨提示", content: "登录之后才可以发送好友申请", oneBtnClosure: {
|
|
|
-
|
|
|
- QSLJumpManager.shared.pushToLogin(type: .add)
|
|
|
- })
|
|
|
-
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
+// if !QSLBaseManager.shared.isLogin() {
|
|
|
+//
|
|
|
+// QSLAlertView.alert(view: self.view, title: "温馨提示", content: "登录之后才可以发送好友申请", oneBtnClosure: {
|
|
|
+//
|
|
|
+// QSLJumpManager.shared.pushToLogin(type: .add)
|
|
|
+// })
|
|
|
+//
|
|
|
+// return
|
|
|
+// }
|
|
|
+//
|
|
|
if !QSLBaseManager.shared.isVip() {
|
|
|
-
|
|
|
- QSLJumpManager.shared.pushToVip(type: .add)
|
|
|
+ if let currentWindow = UIApplication.keyWindow {
|
|
|
+ QSLAddFriendSuccessAlertView.alert(view: currentWindow) {
|
|
|
+ QSLJumpManager.shared.pushToVip(type: .add)
|
|
|
+ }
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -306,6 +336,13 @@ extension QSLAddController {
|
|
|
make.height.equalTo(236.rpx)
|
|
|
}
|
|
|
|
|
|
+ addView.addSubview(addTitleIconBg)
|
|
|
+ addTitleIconBg.snp.makeConstraints { make in
|
|
|
+ make.size.equalTo(CGSize(width: 82.rpx, height: 12.rpx))
|
|
|
+ make.left.equalTo(24.rpx)
|
|
|
+ make.top.equalTo(38.rpx)
|
|
|
+ }
|
|
|
+
|
|
|
addView.addSubview(addTitleIcon)
|
|
|
addTitleIcon.snp.makeConstraints { make in
|
|
|
make.size.equalTo(CGSize(width: 157.rpx, height: 26.rpx))
|
|
|
@@ -349,10 +386,10 @@ extension QSLAddController {
|
|
|
make.bottom.equalTo(-30.rpx)
|
|
|
}
|
|
|
|
|
|
- self.view.addSubview(infoLabel)
|
|
|
- infoLabel.snp.makeConstraints { make in
|
|
|
- make.centerX.equalToSuperview()
|
|
|
- make.bottom.equalTo(-QSLConst.qsl_kTabbarBottom - 26.rpx)
|
|
|
- }
|
|
|
+// self.view.addSubview(infoLabel)
|
|
|
+// infoLabel.snp.makeConstraints { make in
|
|
|
+// make.centerX.equalToSuperview()
|
|
|
+// make.bottom.equalTo(-QSLConst.qsl_kTabbarBottom - 26.rpx)
|
|
|
+// }
|
|
|
}
|
|
|
}
|