|
@@ -44,9 +44,9 @@ class JDHomeHeaderView: BaseView {
|
|
}()
|
|
}()
|
|
|
|
|
|
lazy var pageView:FSPageControl = {
|
|
lazy var pageView:FSPageControl = {
|
|
- let width = SCREEN_WIDTH
|
|
|
|
- let height = 489 * width / 864
|
|
|
|
- let view:FSPageControl = FSPageControl.init(frame: CGRect.init(x: 0, y: height-20, width: SCREEN_WIDTH, height: 20))
|
|
|
|
|
|
+ let width = SCREEN_WIDTH - 20
|
|
|
|
+ let height = 160 * width / 375
|
|
|
|
+ let view:FSPageControl = FSPageControl.init(frame: CGRect.init(x: 0, y: height-20, width: width, height: 20))
|
|
view.contentHorizontalAlignment = .center
|
|
view.contentHorizontalAlignment = .center
|
|
view.contentInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
|
|
view.contentInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
|
|
view.hidesForSinglePage = true
|
|
view.hidesForSinglePage = true
|
|
@@ -55,9 +55,9 @@ class JDHomeHeaderView: BaseView {
|
|
}()
|
|
}()
|
|
|
|
|
|
lazy var pageFlowView:PageFlowView = {
|
|
lazy var pageFlowView:PageFlowView = {
|
|
- let width = SCREEN_WIDTH
|
|
|
|
- let height = 489 * width / 864
|
|
|
|
- let pageFlowView = PageFlowView.init(frame: CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH, height: height))
|
|
|
|
|
|
+ let width = SCREEN_WIDTH - 20
|
|
|
|
+ let height = 160 * width / 375
|
|
|
|
+ let pageFlowView = PageFlowView.init(frame: CGRect.init(x: 0, y: 0, width: width, height: height))
|
|
pageFlowView.backgroundColor = .clear
|
|
pageFlowView.backgroundColor = .clear
|
|
|
|
|
|
pageFlowView.delegate = self
|
|
pageFlowView.delegate = self
|
|
@@ -98,36 +98,37 @@ class JDHomeHeaderView: BaseView {
|
|
|
|
|
|
override init(frame: CGRect) {
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
super.init(frame: frame)
|
|
-
|
|
|
|
|
|
+ bannerBgView.setViewLayerBorderColor(myColor: .clear, borderWidth: 0, maskBounds: 8)
|
|
self.addSubview(bannerBgView)
|
|
self.addSubview(bannerBgView)
|
|
bannerBgView.snp.makeConstraints { make in
|
|
bannerBgView.snp.makeConstraints { make in
|
|
- make.top.left.right.equalTo(self)
|
|
|
|
-
|
|
|
|
- make.height.equalTo(489 * SCREEN_WIDTH / 864)
|
|
|
|
|
|
+ make.top.equalTo(self)
|
|
|
|
+ make.left.equalTo(10)
|
|
|
|
+ make.right.equalTo(-10)
|
|
|
|
+ make.height.equalTo(160 * (SCREEN_WIDTH - 20) / 375)
|
|
}
|
|
}
|
|
|
|
|
|
self.bannerBgView.addSubview(pageFlowView)
|
|
self.bannerBgView.addSubview(pageFlowView)
|
|
|
|
|
|
|
|
|
|
- self.addSubview(noticeBgView)
|
|
|
|
- noticeBgView.snp.makeConstraints { make in
|
|
|
|
- make.left.equalTo(self.snp.left).offset(18)
|
|
|
|
- make.right.equalTo(self.snp.right).offset(-16)
|
|
|
|
- make.height.equalTo(30)
|
|
|
|
- make.bottom.equalTo(self.snp.bottom)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- self.noticeBgView.addSubview(noticeIv)
|
|
|
|
- noticeIv.snp.makeConstraints { make in
|
|
|
|
- make.left.equalTo(self.noticeBgView.snp.left).offset(7)
|
|
|
|
- make.centerY.equalTo(self.noticeBgView)
|
|
|
|
- make.size.equalTo(CGSizeMake(16, 16))
|
|
|
|
- }
|
|
|
|
- self.noticeBgView.addSubview(tipsCycle)
|
|
|
|
- tipsCycle.snp.makeConstraints { make in
|
|
|
|
- make.left.equalTo(noticeIv.snp.right).offset(4)
|
|
|
|
- make.top.bottom.right.equalTo(self.noticeBgView)
|
|
|
|
- }
|
|
|
|
|
|
+// self.addSubview(noticeBgView)
|
|
|
|
+// noticeBgView.snp.makeConstraints { make in
|
|
|
|
+// make.left.equalTo(self.snp.left).offset(18)
|
|
|
|
+// make.right.equalTo(self.snp.right).offset(-16)
|
|
|
|
+// make.height.equalTo(30)
|
|
|
|
+// make.bottom.equalTo(self.snp.bottom)
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// self.noticeBgView.addSubview(noticeIv)
|
|
|
|
+// noticeIv.snp.makeConstraints { make in
|
|
|
|
+// make.left.equalTo(self.noticeBgView.snp.left).offset(7)
|
|
|
|
+// make.centerY.equalTo(self.noticeBgView)
|
|
|
|
+// make.size.equalTo(CGSizeMake(16, 16))
|
|
|
|
+// }
|
|
|
|
+// self.noticeBgView.addSubview(tipsCycle)
|
|
|
|
+// tipsCycle.snp.makeConstraints { make in
|
|
|
|
+// make.left.equalTo(noticeIv.snp.right).offset(4)
|
|
|
|
+// make.top.bottom.right.equalTo(self.noticeBgView)
|
|
|
|
+// }
|
|
// headerView = loadFromNib()
|
|
// headerView = loadFromNib()
|
|
// addSubview(headerView)
|
|
// addSubview(headerView)
|
|
// headerView.snp.makeConstraints { (make) in
|
|
// headerView.snp.makeConstraints { (make) in
|
|
@@ -210,8 +211,8 @@ extension JDHomeHeaderView:PageFlowViewDelegate,PageFlowViewDataSource {
|
|
|
|
|
|
|
|
|
|
func sizeForPageInFlowView(flowView: PageFlowView) -> CGSize {
|
|
func sizeForPageInFlowView(flowView: PageFlowView) -> CGSize {
|
|
- let w = SCREEN_WIDTH
|
|
|
|
- let h = 489 * w / 864
|
|
|
|
|
|
+ let w = SCREEN_WIDTH - 20
|
|
|
|
+ let h = 160 * w / 375
|
|
return CGSize.init(width:w, height: h)
|
|
return CGSize.init(width:w, height: h)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -231,8 +232,8 @@ extension JDHomeHeaderView:PageFlowViewDelegate,PageFlowViewDataSource {
|
|
var bannerView = flowView.dequeueReusableCell()
|
|
var bannerView = flowView.dequeueReusableCell()
|
|
|
|
|
|
if bannerView == nil {
|
|
if bannerView == nil {
|
|
- let w = SCREEN_WIDTH
|
|
|
|
- let h = 489 * w / 864
|
|
|
|
|
|
+ let w = SCREEN_WIDTH - 20
|
|
|
|
+ let h = 160 * w / 375
|
|
|
|
|
|
bannerView = IndexBannerSubiew.init(frame: CGRect.init(x: 0, y: 0, width: w, height: h))
|
|
bannerView = IndexBannerSubiew.init(frame: CGRect.init(x: 0, y: 0, width: w, height: h))
|
|
bannerView?.tag = index
|
|
bannerView?.tag = index
|