Browse Source

no message

南鑫林 5 years ago
parent
commit
42286494ba

+ 40 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -301,6 +301,8 @@
 		A784F2B623505D3F00E49140 /* CardTitleHTMLTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2B523505D3F00E49140 /* CardTitleHTMLTableViewCell.swift */; };
 		A784F2B823505E3700E49140 /* CardContentPicHTMLTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2B723505E3700E49140 /* CardContentPicHTMLTableViewCell.swift */; };
 		A784F2BD2350730C00E49140 /* PublishNewPopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2BC2350730C00E49140 /* PublishNewPopView.swift */; };
+		A784F2C623544B4A00E49140 /* CircleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2C523544B4A00E49140 /* CircleViewController.swift */; };
+		A784F2C923544CA500E49140 /* CircleRouterModuleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A784F2C823544CA500E49140 /* CircleRouterModuleType.swift */; };
 		A78A5F7622FAA03800DD1764 /* share_iSpt.gif in Resources */ = {isa = PBXBuildFile; fileRef = A78A5F7522FAA03800DD1764 /* share_iSpt.gif */; };
 		A78A5F7822FAC7F000DD1764 /* SetGenderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A78A5F7722FAC7F000DD1764 /* SetGenderModel.swift */; };
 		A78CEE0A22E0864100C512A4 /* BaseLottieAnimateContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A78CEE0922E0864100C512A4 /* BaseLottieAnimateContentView.swift */; };
@@ -990,6 +992,8 @@
 		A784F2B523505D3F00E49140 /* CardTitleHTMLTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardTitleHTMLTableViewCell.swift; sourceTree = "<group>"; };
 		A784F2B723505E3700E49140 /* CardContentPicHTMLTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardContentPicHTMLTableViewCell.swift; sourceTree = "<group>"; };
 		A784F2BC2350730C00E49140 /* PublishNewPopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishNewPopView.swift; sourceTree = "<group>"; };
+		A784F2C523544B4A00E49140 /* CircleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleViewController.swift; sourceTree = "<group>"; };
+		A784F2C823544CA500E49140 /* CircleRouterModuleType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleRouterModuleType.swift; sourceTree = "<group>"; };
 		A78A5F7522FAA03800DD1764 /* share_iSpt.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = share_iSpt.gif; sourceTree = "<group>"; };
 		A78A5F7722FAC7F000DD1764 /* SetGenderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetGenderModel.swift; sourceTree = "<group>"; };
 		A78CEE0922E0864100C512A4 /* BaseLottieAnimateContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseLottieAnimateContentView.swift; sourceTree = "<group>"; };
@@ -2943,6 +2947,7 @@
 		A77F2CA22232010F001BD3F6 /* Modules */ = {
 			isa = PBXGroup;
 			children = (
+				A784F2C223544B0800E49140 /* CircleModule */,
 				A7464B732338AD6E003CE3A0 /* RedemptionAreaModule */,
 				A719EE6622AF4374001AAC98 /* CommunityModule */,
 				A7464B6E233894B9003CE3A0 /* BackyardModule */,
@@ -3302,6 +3307,38 @@
 			path = PublishNewPopView;
 			sourceTree = "<group>";
 		};
+		A784F2C223544B0800E49140 /* CircleModule */ = {
+			isa = PBXGroup;
+			children = (
+				A784F2C323544B1B00E49140 /* Circle */,
+			);
+			path = CircleModule;
+			sourceTree = "<group>";
+		};
+		A784F2C323544B1B00E49140 /* Circle */ = {
+			isa = PBXGroup;
+			children = (
+				A784F2CA23544F0100E49140 /* View */,
+				A784F2C423544B2600E49140 /* ViewController */,
+			);
+			path = Circle;
+			sourceTree = "<group>";
+		};
+		A784F2C423544B2600E49140 /* ViewController */ = {
+			isa = PBXGroup;
+			children = (
+				A784F2C523544B4A00E49140 /* CircleViewController.swift */,
+			);
+			path = ViewController;
+			sourceTree = "<group>";
+		};
+		A784F2CA23544F0100E49140 /* View */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		A78A5F7422FAA01F00DD1764 /* Gif */ = {
 			isa = PBXGroup;
 			children = (
@@ -3510,6 +3547,7 @@
 				A7F3069322E16A5B00DC7917 /* MineRouterModuleType.swift */,
 				A76068E622E48DC5008DF18F /* BrowsePictureRouterModuleType.swift */,
 				A76893A9233B38AA00819EC3 /* MessageRouterModuleType.swift */,
+				A784F2C823544CA500E49140 /* CircleRouterModuleType.swift */,
 			);
 			path = Router;
 			sourceTree = "<group>";
@@ -5754,6 +5792,7 @@
 				A71CAB3722C9A40A00D908A8 /* TotalBeanModel.swift in Sources */,
 				A78168E42341EDB300033496 /* PublishNewRecorderPreview.swift in Sources */,
 				A743229B22B8C1510017C367 /* AppStoreManager.swift in Sources */,
+				A784F2C923544CA500E49140 /* CircleRouterModuleType.swift in Sources */,
 				A77BB45B2329EDEF00DCAE32 /* NXLPermissionPhotoLibrary.swift in Sources */,
 				A7EE6E1223055A5A00628D39 /* MemoryManager.swift in Sources */,
 				BD61225422C355C800D3F513 /* AliyunMagicCameraViewController.m in Sources */,
@@ -5881,6 +5920,7 @@
 				BD108C9422A60C2100837DAB /* HGImageCollectionViewController.swift in Sources */,
 				A72A72AA22321DE000B21995 /* Log.swift in Sources */,
 				A7464B6C23386521003CE3A0 /* PushConfigModel.swift in Sources */,
+				A784F2C623544B4A00E49140 /* CircleViewController.swift in Sources */,
 				BD61226A22C3595B00D3F513 /* AlivcEditUIConfig.m in Sources */,
 				A7D77DF122DDE6600048D5F6 /* UserMemberTotalBeanViewModel.swift in Sources */,
 				A7AA9F6522C63DCD0086498B /* CommunityFollowFeedModel.swift in Sources */,

+ 2 - 0
RainbowPlanet/RainbowPlanet/Macro/EnumMacro.swift

@@ -193,6 +193,7 @@ enum CommunityType {
 /// - activity: 活动
 /// - topic: 话题
 /// - offlineDetail: 线下活动详情
+/// - circle: 圈子
 enum CommunityBannerType : Int {
     case none = 0
     case content = 1
@@ -200,6 +201,7 @@ enum CommunityBannerType : Int {
     case activity = 3
     case topic = 4
     case offlineDetail = 5
+    case circle = 6
 }
 
 

+ 2 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityFollowFeedModel.swift

@@ -115,6 +115,7 @@ class CommunityFollowRelateDataModel : NSObject, Mappable{
     var video : String?
     var willCollectBean : Int?
     var h5url : String?
+    var isFine : Int?
     
     
     class func newInstance(map: Map) -> Mappable?{
@@ -149,6 +150,7 @@ class CommunityFollowRelateDataModel : NSObject, Mappable{
         video <- map["video"]
         willCollectBean <- map["will_collect_bean"]
         h5url <- map["h5url"]
+        isFine <- map["is_fine"]
         
     }
 }

+ 2 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityRecommendFeedModel.swift

@@ -56,6 +56,7 @@ class CommunityRecommendDataModel : NSObject, Mappable{
     var video : String?
     var willCollectBean : Int?
     var h5url : String?
+    var isFine : Int?
     
     
     class func newInstance(map: Map) -> Mappable?{
@@ -93,6 +94,7 @@ class CommunityRecommendDataModel : NSObject, Mappable{
         video <- map["video"]
         willCollectBean <- map["will_collect_bean"]
         h5url <- map["h5url"]
+        isFine <- map["is_fine"]
         
     }
     

+ 25 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityTopicDetailModel.swift

@@ -13,6 +13,7 @@ class CommunityTopicDetailModel : NSObject, Mappable{
 	var img : String?
 	var isFollow : Int?
 	var name : String?
+    var circle : CommunityTopicDetailCircleModel?
 
 
 	class func newInstance(map: Map) -> Mappable?{
@@ -28,7 +29,31 @@ class CommunityTopicDetailModel : NSObject, Mappable{
 		img <- map["img"]
 		isFollow <- map["is_follow"]
 		name <- map["name"]
+        circle <- map["circle"]
 		
 	}
 
 }
+
+class CommunityTopicDetailCircleModel : NSObject, Mappable{
+    
+    var id : Int?
+    var name : String?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return CommunityTopicDetailCircleModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        id <- map["id"]
+        name <- map["name"]
+        
+    }
+    
+}
+
+

+ 109 - 0
RainbowPlanet/RainbowPlanet/Modules/CircleModule/Circle/ViewController/CircleViewController.swift

@@ -0,0 +1,109 @@
+//
+//  CircleViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import JXSegmentedView
+import JXPagingView
+import RxSwift
+import SwiftyMediator
+import Kingfisher
+
+class CircleViewController: BaseViewController {
+
+    deinit {
+        NXLLog("deinit")
+    }
+    
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        KingfisherManager.shared.cache.clearDiskCache()
+        KingfisherManager.shared.cache.clearMemoryCache()
+    }
+    
+    var circleId : Int?
+    let JXTableHeaderViewHeight: Int = Int(140 + kNavBarTotalHeight)
+    let JXHeightForHeaderInSection: Int = 44
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    override func setupViews() {
+        setnavigationBar()
+    }
+    
+    override func setupLayouts() {
+        navigationBgView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        avatarButton.snp.makeConstraints { (make) in
+            make.left.equalTo(navigationBar.leftButton.snp.right)
+            make.size.equalTo(20)
+            make.centerY.equalTo(navigationBar.rightButton)
+        }
+        nameButton.snp.makeConstraints { (make) in
+            make.centerY.equalTo(avatarButton)
+            make.left.equalTo(avatarButton.snp.right).offset(4)
+        }
+    }
+    
+    override func setupData() {
+        navigationBar.onClickRightButton = {
+            [weak self] in
+            
+        }
+    }
+    
+    
+    /// 设置navigationBar
+    func setnavigationBar() {
+        navigationBar.wr_setLeftButton(image: kImage(name: "navbar_back_white")!)
+        navigationBar.wr_setRightButton(image: kImage(name: "nav_share_white")!)
+        navigationBar.addSubview(navigationBgView)
+        navigationBar.addSubview(avatarButton)
+        navigationBar.addSubview(nameButton)
+        navigationBar.insertSubview(navigationBgView, aboveSubview: navigationBar.backgroundImageView)
+        navigationBar.backgroundImageView.frame = CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenWidth)
+        navigationBar.backgroundImageView.contentMode = .scaleAspectFill
+        navigationBar.layer.masksToBounds = true
+        // 设置导航栏显示图片
+        navigationBar.barBackgroundImage = UIImage(named: "default_pic")
+        // 设置初始导航栏透明度
+        navigationBar.wr_setBackgroundAlpha(alpha: 0)
+        // 设置状态栏style
+        statusBarStyle = .lightContent
+    }
+    
+    lazy var avatarButton: UIButton = {
+        let avatarButton = UIButton(type: UIButton.ButtonType.custom)
+        avatarButton.setImage(kImage(name: "default_avatar"), for: UIControl.State.normal)
+        avatarButton.cornerRadius = 10
+        avatarButton.masksToBounds = true
+        avatarButton.alpha = 0
+        return avatarButton
+    }()
+    
+    lazy var nameButton: UIButton = {
+        let nameButton = UIButton(type: UIButton.ButtonType.custom)
+        nameButton.setTitle("昵称", for: UIControl.State.normal)
+        nameButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        nameButton.titleLabel?.font = kBoldFont18
+        nameButton.alpha = 0
+        return nameButton
+    }()
+    
+    lazy var navigationBgView: UIView = {
+        let navigationBgView = UIView()
+        navigationBgView.backgroundColor = UIColor(hexString: "000000", alpha: 0.5)
+        navigationBgView.alpha = 0
+        return navigationBgView
+    }()
+}

+ 3 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/Banner/CommunityBannerTableViewCell.swift

@@ -153,6 +153,9 @@ extension CommunityBannerTableViewCell:FSPagerViewDataSource,FSPagerViewDelegate
         case .offlineDetail?: //线下活动详情
             Mediator.push(H5RouterModuleType.pushOfflineDetail(id: "\(communityRecommendTypeDataModel?.linkContentId ?? 0)"))
             break
+        case .circle?: //圈子
+            Mediator.push(CircleRouterModuleType.circle(circleId: "\(communityRecommendTypeDataModel?.linkContentId ?? 0)"))
+            break
         default:
             break
             

+ 18 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/User/CardContentUserTableViewCell.swift

@@ -97,6 +97,7 @@ class CardContentUserTableViewCell: UITableViewCell {
     private lazy var bgView: UIView = {
         let bgView = UIView(frame: self.frame)
         bgView.backgroundColor = UIColor(patternImage: kImage(name: "pic_select_bg")!)
+        bgView.isHidden = true
         return bgView
     }()
     
@@ -131,6 +132,7 @@ class CardContentUserTableViewCell: UITableViewCell {
     private lazy var featuredButton: UIButton = {
         let featuredButton = UIButton(type: UIButton.ButtonType.custom)
         featuredButton.setImage(kImage(name: "ico_select"), for: UIControl.State.normal)
+        featuredButton.isHidden = true
         return featuredButton
     }()
     
@@ -180,6 +182,13 @@ class CardContentUserTableViewCell: UITableViewCell {
     
     var communityRecommendDataModel: CommunityRecommendDataModel? {
         didSet {
+            if communityRecommendDataModel?.isFine == 0 {
+                bgView.isHidden = true
+                featuredButton.isHidden = true
+            }else if communityRecommendDataModel?.isFine == 1 {
+                bgView.isHidden = false
+                featuredButton.isHidden = false
+            }
             avatarButton.kf.setImage(with: kURLImage(name: communityRecommendDataModel?.avatar ?? ""), for: UIControl.State.normal , placeholder: kImage(name: "default_avatar"))
             titleButton.setTitle(communityRecommendDataModel?.username, for: UIControl.State.normal)
             timeLabel.text = communityRecommendDataModel?.createdAt
@@ -195,6 +204,15 @@ class CardContentUserTableViewCell: UITableViewCell {
     
     var communityFollowDataModel : CommunityFollowDataModel? {
         didSet {
+            
+            if communityFollowDataModel?.relateData?.isFine == 0 {
+                bgView.isHidden = true
+                featuredButton.isHidden = true
+            }else if communityFollowDataModel?.relateData?.isFine == 1 {
+                bgView.isHidden = false
+                featuredButton.isHidden = false
+            }
+            
             avatarButton.kf.setImage(with: kURLImage(name: communityFollowDataModel?.relateData?.avatar ?? ""), for: UIControl.State.normal , placeholder: kImage(name: "default_avatar"))
             
             titleButton.setTitle(communityFollowDataModel?.relateData?.username, for: UIControl.State.normal)

+ 33 - 0
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityFeaturedTopics/ViewController/CommunityFeaturedTopicsViewController.swift

@@ -52,6 +52,7 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
         view.addSubview(bgView)
         view.addSubview(tableView)
         view.insertSubview(navigationBar, aboveSubview: tableView)
+        view.addSubview(circleButton)
         setnavigationBar()
     }
     
@@ -97,6 +98,12 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
             make.width.equalTo(60)
             make.height.equalTo(28)
         }
+        circleButton.snp.makeConstraints { (make) in
+            make.centerX.equalToSuperview()
+            make.bottom.equalTo( -(kSafeTabBarHeight + 20))
+            make.height.equalTo(44)
+            make.width.greaterThanOrEqualTo(150)
+        }
     }
     
     private lazy var tableView: UITableView = {
@@ -170,6 +177,20 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
         return navigationBgView
     }()
     
+    lazy var circleButton: UIButton = {
+        let circleButton = UIButton(type: UIButton.ButtonType.custom)
+        circleButton.setTitleColor(k333333Color, for: UIControl.State.normal)
+        circleButton.titleLabel?.font = kMediumFont17
+        circleButton.backgroundColor = UIColor.white
+        circleButton.isHidden = true
+        circleButton.layer.shadowRadius = 10
+        circleButton.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor
+        circleButton.layer.shadowOffset = CGSize(width: 0, height: 3)
+        circleButton.layer.shadowOpacity = 1
+        circleButton.layer.cornerRadius = 22
+        return circleButton
+    }()
+    
     override func setupData() {
         //下拉刷新
         tableView.addFullScreenHeader(withBeginRefresh: true, animation: true) {
@@ -196,6 +217,10 @@ class CommunityFeaturedTopicsViewController: BaseViewController {
             self?.navigationController?.pushViewController(vc, animated: true)
         }
         
+        circleButton.rx.tap.subscribe(onNext: { [weak self] _ in
+            Mediator.push(CircleRouterModuleType.circle(circleId: "\(self?.communityTopicDetailModel?.circle?.id ?? 0)"))
+        }).disposed(by: disposeBag)
+        
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("followApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
             let followStatusModel = notification.object as? FollowStatusModel
             if !(self?.communityRecommendDataModels.isEmpty ?? true) {
@@ -331,6 +356,14 @@ extension CommunityFeaturedTopicsViewController {
             self?.navigationBar.barBackgroundImage = self?.bgImageView.image
             self?.communityFeaturedTopicsHeaderView.communityTopicDetailModel = self?.communityTopicDetailModel
             self?.tableView.tableHeaderView = self?.communityFeaturedTopicsHeaderView
+            
+//            if self?.communityTopicDetailModel?.circle != nil {
+                self?.circleButton.isHidden = false
+                self?.circleButton.setTitle("    \( self?.communityTopicDetailModel?.circle?.name ?? "")    ", for: UIControl.State.normal)
+//            } else {
+//                self?.circleButton.isHidden = true
+//            }
+        
         }
     }
     

+ 4 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityShareContent/CommunityShareContentViewController.swift

@@ -129,7 +129,10 @@ class CommunityShareContentViewController: BaseViewController {
         topicLabel.text = "#\(topicStr)#"
         titleLabel.text = titleStr
         nameLable.text = nameStr ?? ""
-        QRCodeImageView.image = QRCode.createQRForString(qrString: H5UrlStr, qrImageName: "")
+        DispatchQueue.main.async {
+            [weak self] in
+            self?.QRCodeImageView.image = QRCode.createQRForString(qrString: self?.H5UrlStr, qrImageName: "")
+        }
         scanLabel.text = "扫码查看内容  开启国风之旅"
         
         avatarImageView.kf.setImage(with: kURLImage(name: avatarStr ?? ""), placeholder:  kImage(name: "default_pic"), completionHandler: { [weak self] (result) in

+ 28 - 0
RainbowPlanet/RainbowPlanet/Router/CircleRouterModuleType.swift

@@ -0,0 +1,28 @@
+//
+//  CircleRouterModuleType.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import SwiftyMediator
+
+/// 圈子模块路由
+///
+/// - messageListFollow: 关注通知消息
+public enum CircleRouterModuleType: MediatorTargetType {
+    case circle(circleId:String)
+}
+
+extension CircleRouterModuleType: MediatorSourceType {
+    public var viewController: UIViewController? {
+        switch self {
+        case .circle(let circleId):
+            let vc = CircleViewController()
+            vc.circleId = Int(circleId)
+            return vc
+        }
+    }
+}