|
@@ -42,6 +42,7 @@ class UserPersonalCenterViewController: BaseViewController {
|
|
|
view.addSubview(pagingView)
|
|
|
view.insertSubview(navigationBar, aboveSubview: pagingView)
|
|
|
setnavigationBar()
|
|
|
+ view.addSubview(iconImageView)
|
|
|
}
|
|
|
|
|
|
/// 设置navigationBar
|
|
@@ -88,6 +89,10 @@ class UserPersonalCenterViewController: BaseViewController {
|
|
|
make.right.equalTo(navigationBar.rightButton.snp_left)
|
|
|
make.size.equalTo(34)
|
|
|
}
|
|
|
+ iconImageView.snp.makeConstraints { (make) in
|
|
|
+ make.bottom.equalToSuperview()
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -129,7 +134,8 @@ class UserPersonalCenterViewController: BaseViewController {
|
|
|
})
|
|
|
|
|
|
observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("communityDeletePostApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
|
|
|
- self?.cmsTemplateTitles = ["发布 \((Int(self?.userDetailModel?.postCount ?? "0") ?? 1) - 1)","收藏 \(self?.userDetailModel?.collectCount ?? "0")","分享 \(self?.userDetailModel?.shareCount ?? "0")"]
|
|
|
+ self?.userDetailModel?.postCount = "\((Int(self?.userDetailModel?.postCount ?? "0") ?? 1) - 1)"
|
|
|
+ self?.cmsTemplateTitles = ["发布 \(self?.userDetailModel?.postCount ?? "0")","收藏 \(self?.userDetailModel?.collectCount ?? "0")","分享 \(self?.userDetailModel?.shareCount ?? "0")"]
|
|
|
self?.reloadData()
|
|
|
}
|
|
|
|
|
@@ -155,6 +161,12 @@ class UserPersonalCenterViewController: BaseViewController {
|
|
|
self.segmentedView.defaultSelectedIndex = userPersonalCenterVCType
|
|
|
self.segmentedView.reloadData()
|
|
|
self.pagingView.reloadData()
|
|
|
+
|
|
|
+ if userPersonalCenterVCType == 0 && self.userDetailModel?.postCount == "0" {
|
|
|
+ iconImageViewAlpha(alpha: 1)
|
|
|
+ }else {
|
|
|
+ iconImageViewAlpha(alpha: 0)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// 编辑
|
|
@@ -201,6 +213,20 @@ class UserPersonalCenterViewController: BaseViewController {
|
|
|
return navigationBgView
|
|
|
}()
|
|
|
|
|
|
+ lazy var iconImageView: UIImageView = {
|
|
|
+ let iconImageView = UIImageView()
|
|
|
+ iconImageView.image = kImage(name: "def_page_pic_pecenter")
|
|
|
+ iconImageView.alpha = 0
|
|
|
+ return iconImageView
|
|
|
+ }()
|
|
|
+
|
|
|
+ func iconImageViewAlpha(alpha:CGFloat) {
|
|
|
+ UIView.animate(withDuration: 1) {
|
|
|
+ [weak self] in
|
|
|
+ self?.iconImageView.alpha = alpha
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//1.初始化JXSegmentedView
|
|
|
lazy var segmentedView: JXSegmentedView = {
|
|
|
let segmentedView = JXSegmentedView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: CGFloat(JXheightForHeaderInSection)))
|
|
@@ -282,6 +308,11 @@ extension UserPersonalCenterViewController : JXSegmentedViewDelegate {
|
|
|
//点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
|
|
|
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
|
|
|
self.userPersonalCenterVCType = index
|
|
|
+ if index == 0 && self.userDetailModel?.postCount == "0" {
|
|
|
+ iconImageViewAlpha(alpha: 1)
|
|
|
+ }else {
|
|
|
+ iconImageViewAlpha(alpha: 0)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 点击选中的情况才会调用该方法
|