南鑫林 5 éve
szülő
commit
a02baf4692

+ 20 - 0
RainbowPlanet/RainbowPlanet/Macro/Common.swift

@@ -310,6 +310,26 @@ func getImageHeight(imgStr:String) -> CGFloat {
     return heightFloat/2
 }
 
+func getImageUrlStr(imgStr:String,width:CGFloat,height:CGFloat) -> String {
+    if imgStr.contains("*") {
+        let imgStr1 = imgStr + "?x-oss-process=image/resize,m_fill,w_\(Int(width*2)),h_\(Int(height*2))"
+        NXLLog(imgStr1)
+        return String(imgStr1)
+    }else {
+        if imgStr.contains("?") {
+            var imgStr1 = imgStr.prefix(upTo:(imgStr.lastIndex(of: "?"))!)
+            imgStr1 = imgStr1 + "?x-oss-process=image/resize,m_fill,w_\(Int(width*2)),h_\(Int(height*2))"
+            NXLLog(imgStr1)
+
+            return String(imgStr1)
+        }else {
+            let imgStr1 = imgStr + "?x-oss-process=image/resize,m_fill,w_\(Int(560 * kScaleWidth)),h_\(Int(560 * 280 * kScaleWidth))"
+            NXLLog(imgStr1)
+            return String(imgStr1)
+        }
+    }
+}
+
 /// url字符串转字典
 ///
 /// - Parameter urlString: urlString字符串

+ 0 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoCollectionViewCell.swift

@@ -76,7 +76,6 @@ class CardContentPicVideoCollectionViewCell: UICollectionViewCell {
                 pauseImageView.isHidden = false
             }else {
                 pauseImageView.isHidden = true
-
             }
         }
     }

+ 14 - 8
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/View/Cell/CardContent/PicVideo/CardContentPicVideoTableViewCell.swift

@@ -182,30 +182,36 @@ extension CardContentPicVideoTableViewCell: UICollectionViewDelegateFlowLayout,U
                     if communityRecommendDataModel?.img == "" || communityRecommendDataModel?.img == nil {
                         
                     }else {
-                        cell.imgStr = communityRecommendDataModel?.img
+                        let imgStr = getImageUrlStr(imgStr: communityRecommendDataModel?.img ?? "", width: cell.width, height: cell.height)
+                        cell.imgStr = imgStr
                         
                     }
                 }else {
-                    cell.imgStr = communityRecommendDataModel?.imgs?[indexPath.row]
+                    let imgStr = getImageUrlStr(imgStr: communityRecommendDataModel?.imgs?[indexPath.row] ?? "", width: cell.width, height: cell.height)
+                    cell.imgStr =  imgStr
                 }
             }else {
-                cell.imgStr = communityRecommendDataModel?.img
+                let imgStr = getImageUrlStr(imgStr: communityRecommendDataModel?.img ?? "", width: cell.width, height: cell.height)
+                cell.imgStr = imgStr
             }
             cell.communityRecommendDataModel = communityRecommendDataModel
         } else if type == .follow {
             if (PostType(rawValue: (communityFollowDataModel?.relateData?.type)!) ?? .video) != .video {
                 if communityFollowDataModel?.relateData?.imgs?.isEmpty ?? true {
                     if communityFollowDataModel?.relateData?.img == "" || communityFollowDataModel?.relateData?.img == nil {
-                        
                     }else {
-                        cell.imgStr = communityFollowDataModel?.relateData?.img
-                        
+                        let imgStr = getImageUrlStr(imgStr: communityFollowDataModel?.relateData?.img ?? "", width: cell.width, height: cell.height)
+                        cell.imgStr = imgStr
                     }
                 }else {
-                    cell.imgStr = communityFollowDataModel?.relateData?.imgs?[indexPath.row]
+                    
+                    let imgStr = getImageUrlStr(imgStr: communityFollowDataModel?.relateData?.imgs?[indexPath.row] ?? "", width: cell.width, height: cell.height)
+                    cell.imgStr = imgStr
+                    
                 }
             }else {
-                cell.imgStr = communityFollowDataModel?.relateData?.img
+                let imgStr = getImageUrlStr(imgStr: communityFollowDataModel?.relateData?.img ?? "", width: cell.width, height: cell.height)
+                cell.imgStr = imgStr
             }
             cell.communityFollowDataModel = communityFollowDataModel
         }

+ 5 - 3
RainbowPlanet/RainbowPlanet/Modules/MineModule/Set/ViewController/SetViewController.swift

@@ -51,14 +51,16 @@ class SetViewController: BaseViewController {
                 switch indexPath.row {
                 // 用户协议
                 case 0:
-                    let vc = H5CommonViewController()
-                    vc.URLString = kH5ContentId6Url
-                    self?.navigationController?.pushViewController(vc, animated: true)
+                    Mediator.push(H5RouterModuleType.pushContentId6)
                     break
                 // AppStore
                 case 1:
                     AppStoreManager.shared.appStore()
                     break
+                // 投诉与建议
+                case 2:
+                    Mediator.push(H5RouterModuleType.pushFeedback)
+                    break
                 // 分享彩虹星球app
                 case 3:
                     ShareCommunityView.inviteGoodFriends()

+ 6 - 0
RainbowPlanet/RainbowPlanet/Router/H5RouterModuleType.swift

@@ -19,6 +19,7 @@ import SwiftyMediator
 /// - pushContentId7: 内容协议
 /// - pushBeanRecord:  赚豆明细
 /// - pushOrder:  我的订单
+/// - pushFeedback: 反馈页面
 /// - pushSubject: 兑换商品专题页面
 /// - pushDetail: 兑换商品详情页面
 /// - pushActivityId: 兑换活动
@@ -31,6 +32,7 @@ public enum H5RouterModuleType: MediatorTargetType {
     case pushContentId7
     case pushBeanRecord
     case pushOrder
+    case pushFeedback
     case pushSubject(id:String)
     case pushDetail(id:String)
     case pushActivityId(id:String)
@@ -79,6 +81,10 @@ extension H5RouterModuleType: MediatorSourceType {
             let vc = H5CommonViewController()
             vc.URLString = kH5ActivityIdUrl + id
             return vc
+        case .pushFeedback: //反馈页面
+            let vc = H5CommonViewController()
+            vc.URLString = kH5FeedbackUrl
+            return vc
         }
     }
 }

+ 3 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkH5Manager.swift

@@ -41,6 +41,9 @@ let kH5ActivityUrl = kApiH5Prefix() + "/activity?"
 /// 分享内容详情
 let kH5ArticleUrl = kApiH5Prefix() + "/article?"
 
+/// 反馈页面
+let kH5FeedbackUrl = kApiH5Prefix() + "/feedback"
+
 /// 邀请页面
 let kH5InviteUrl = kApiH5Prefix() + "/invite?invite_code="