Commit adf6c57423383ea9c3852ea6984c882c52c85919
1 parent
a8fed67e
主页宽度调小 , 上下滑地址取反
Showing
4 changed files
with
12 additions
and
9 deletions
metaCode/Classes/Main/HomePage/Controller/CNMetaCodeHomePageController.swift
| @@ -12,6 +12,9 @@ import CNLiveRequestBastKit | @@ -12,6 +12,9 @@ import CNLiveRequestBastKit | ||
| 12 | 12 | ||
| 13 | let Width: CGFloat = UIScreen.main.bounds.size.width | 13 | let Width: CGFloat = UIScreen.main.bounds.size.width |
| 14 | let Height: CGFloat = UIScreen.main.bounds.size.height | 14 | let Height: CGFloat = UIScreen.main.bounds.size.height |
| 15 | +///主窗口宽度 | ||
| 16 | +let MainViewW: CGFloat = Width-100 | ||
| 17 | + | ||
| 15 | 18 | ||
| 16 | ///存储是否第一次显示首页上滑引导 | 19 | ///存储是否第一次显示首页上滑引导 |
| 17 | let CNKeyIsFirstAppearUpSlideHomeGuide: String = "isFirstAppearUpSlideHomeGuideKey" | 20 | let CNKeyIsFirstAppearUpSlideHomeGuide: String = "isFirstAppearUpSlideHomeGuideKey" |
| @@ -71,7 +74,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -71,7 +74,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 71 | 74 | ||
| 72 | ///无网.接口失败View | 75 | ///无网.接口失败View |
| 73 | lazy var notNetworkView: UIView = { | 76 | lazy var notNetworkView: UIView = { |
| 74 | - let W = Width-50 | 77 | + let W = MainViewW |
| 75 | let H = W*1.5 | 78 | let H = W*1.5 |
| 76 | let notNetworkView = UIView.init(frame: CGRect(x: 25, y: KSreenHeight*0.16, width: W, height: H )) | 79 | let notNetworkView = UIView.init(frame: CGRect(x: 25, y: KSreenHeight*0.16, width: W, height: H )) |
| 77 | notNetworkView.backgroundColor = UIColor.white | 80 | notNetworkView.backgroundColor = UIColor.white |
| @@ -368,7 +371,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -368,7 +371,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 368 | var bannerView:CNCustomIndexView? = flowView.dequeueReusableCell() as? CNCustomIndexView | 371 | var bannerView:CNCustomIndexView? = flowView.dequeueReusableCell() as? CNCustomIndexView |
| 369 | 372 | ||
| 370 | if (bannerView == nil) { | 373 | if (bannerView == nil) { |
| 371 | - bannerView = CNCustomIndexView.init(frame: CGRectMake(0, 0, Width-50, Height)) | 374 | + bannerView = CNCustomIndexView.init(frame: CGRectMake(0, 0, MainViewW, Height)) |
| 372 | bannerView?.tag = index + 100 | 375 | bannerView?.tag = index + 100 |
| 373 | bannerView?.layer.cornerRadius = 4 | 376 | bannerView?.layer.cornerRadius = 4 |
| 374 | bannerView?.layer.masksToBounds = false | 377 | bannerView?.layer.masksToBounds = false |
| @@ -384,7 +387,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -384,7 +387,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 384 | } | 387 | } |
| 385 | 388 | ||
| 386 | func sizeForPage(in flowView: NewPagedFlowView!) -> CGSize { | 389 | func sizeForPage(in flowView: NewPagedFlowView!) -> CGSize { |
| 387 | - return CGSize(width: Width-50, height: Height) | 390 | + return CGSize(width: MainViewW, height: Height) |
| 388 | } | 391 | } |
| 389 | 392 | ||
| 390 | ///NewPagedFlowView 开始滑动 | 393 | ///NewPagedFlowView 开始滑动 |
| @@ -436,7 +439,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -436,7 +439,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 436 | 439 | ||
| 437 | scrollView.isScrollEnabled = true | 440 | scrollView.isScrollEnabled = true |
| 438 | 441 | ||
| 439 | - let toIndex:Int = Int(scrollView.contentOffset.x/(Width-50)) | 442 | + let toIndex:Int = Int(scrollView.contentOffset.x/(MainViewW)) |
| 440 | 443 | ||
| 441 | if toIndex == self.backgroupView.currentApearViewIndex{ | 444 | if toIndex == self.backgroupView.currentApearViewIndex{ |
| 442 | return | 445 | return |
metaCode/Classes/Main/HomePage/View/CNCustomIndexView.swift
| @@ -118,8 +118,8 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | @@ -118,8 +118,8 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | ||
| 118 | set{ | 118 | set{ |
| 119 | self.mainView.idModel = newValue! | 119 | self.mainView.idModel = newValue! |
| 120 | _idModel = newValue | 120 | _idModel = newValue |
| 121 | - self.upSlideView.url = _idModel?.upPath | ||
| 122 | - self.downSlideView.url = _idModel?.downPath | 121 | + self.upSlideView.url = _idModel?.downPath |
| 122 | + self.downSlideView.url = _idModel?.upPath | ||
| 123 | self.topNavView.setTitleString(title:(_idModel?.name)!) | 123 | self.topNavView.setTitleString(title:(_idModel?.name)!) |
| 124 | } | 124 | } |
| 125 | 125 |
metaCode/Classes/Main/HomePage/View/CNMainView.swift
| @@ -334,7 +334,7 @@ class CNMainView : UIView{ | @@ -334,7 +334,7 @@ class CNMainView : UIView{ | ||
| 334 | 334 | ||
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | - // MARK: - <##><##>设置前置视图容器 | 337 | + // MARK: -设置前置视图容器 |
| 338 | func isHiddenMainFrontContentView(isHidden:Bool){ | 338 | func isHiddenMainFrontContentView(isHidden:Bool){ |
| 339 | self.frontView.frontTotolContentView.isHidden = isHidden | 339 | self.frontView.frontTotolContentView.isHidden = isHidden |
| 340 | } | 340 | } |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
| @@ -148,8 +148,8 @@ final class StandListModel: BaseModel, TableCodable { | @@ -148,8 +148,8 @@ final class StandListModel: BaseModel, TableCodable { | ||
| 148 | var descBackgroundImg: String = ""//首页文字背景图 | 148 | var descBackgroundImg: String = ""//首页文字背景图 |
| 149 | var cardImg: String = ""//卡片背景图 | 149 | var cardImg: String = ""//卡片背景图 |
| 150 | var cardBackgroundImg: String = ""//首页卡片背景图 | 150 | var cardBackgroundImg: String = ""//首页卡片背景图 |
| 151 | - var upPath: String = ""//上滑h5 | ||
| 152 | - var downPath: String = ""//下滑h5 | 151 | + var upPath: String = ""//顶部h5 |
| 152 | + var downPath: String = ""//底部h5 | ||
| 153 | var auth: Bool = false//身份是否验证 | 153 | var auth: Bool = false//身份是否验证 |
| 154 | 154 | ||
| 155 | var createTimeString: String = "" | 155 | var createTimeString: String = "" |