|
@@ -165,19 +165,21 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
self.goodList[0].isSelect = true
|
|
self.goodList[0].isSelect = true
|
|
|
self.selectGood = self.goodList[0]
|
|
self.selectGood = self.goodList[0]
|
|
|
|
|
|
|
|
- var height = 200.rpx
|
|
|
|
|
- if(self.goodList.count > 2){
|
|
|
|
|
- let row = (self.goodList.count-1)/2 + 1
|
|
|
|
|
- height = 124.rpx + row*124.rpx
|
|
|
|
|
|
|
+ var height = 140.rpx
|
|
|
|
|
+ if self.goodList.count == 2 {
|
|
|
|
|
+ height = 200.rpx
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let remainingItems = self.goodList.count - 1
|
|
|
|
|
+ let remainingRows = (remainingItems + 1) / 2
|
|
|
|
|
+ height = Int(134.rpx + CGFloat(remainingRows) * 124.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
self.vipItemView.snp.updateConstraints { make in
|
|
self.vipItemView.snp.updateConstraints { make in
|
|
|
make.height.equalTo(height)
|
|
make.height.equalTo(height)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- self.scrollView.snp.makeConstraints { make in
|
|
|
|
|
- make.bottom.equalTo(self.vipItemView).offset(0)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ self.view.layoutIfNeeded()
|
|
|
|
|
+ self.scrollView.contentSize = CGSize(width: 0.0, height: self.vipItemView.qsl_y+CGFloat(height)+100+QSLConst.qsl_kTabbarBottom/2+12)
|
|
|
|
|
|
|
|
QSLCountdownManager.shared.selectGood = self.goodList[0]
|
|
QSLCountdownManager.shared.selectGood = self.goodList[0]
|
|
|
|
|
|
|
@@ -329,6 +331,7 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
let scrollView = UIScrollView()
|
|
let scrollView = UIScrollView()
|
|
|
// scrollView.delegate = self
|
|
// scrollView.delegate = self
|
|
|
scrollView.bounces = false
|
|
scrollView.bounces = false
|
|
|
|
|
+ scrollView.backgroundColor = UIColor.white
|
|
|
scrollView.showsVerticalScrollIndicator = false
|
|
scrollView.showsVerticalScrollIndicator = false
|
|
|
scrollView.contentInsetAdjustmentBehavior = .never
|
|
scrollView.contentInsetAdjustmentBehavior = .never
|
|
|
return scrollView
|
|
return scrollView
|
|
@@ -346,6 +349,7 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
label.text("超值优惠")
|
|
label.text("超值优惠")
|
|
|
label.textColor = .white
|
|
label.textColor = .white
|
|
|
label.mediumFont(17)
|
|
label.mediumFont(17)
|
|
|
|
|
+ label.textAlignment = .center
|
|
|
return label
|
|
return label
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
@@ -473,7 +477,7 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
layout.scrollDirection = .vertical
|
|
layout.scrollDirection = .vertical
|
|
|
|
|
|
|
|
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
|
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
|
|
|
- collectionView.backgroundColor = .clear
|
|
|
|
|
|
|
+ collectionView.backgroundColor = .white
|
|
|
|
|
|
|
|
collectionView.dataSource = self
|
|
collectionView.dataSource = self
|
|
|
collectionView.delegate = self
|
|
collectionView.delegate = self
|
|
@@ -549,7 +553,7 @@ extension QSLActivityVipVC{
|
|
|
vipNaviView.addSubview(naviTitleIcon)
|
|
vipNaviView.addSubview(naviTitleIcon)
|
|
|
naviTitleIcon.snp.makeConstraints { make in
|
|
naviTitleIcon.snp.makeConstraints { make in
|
|
|
make.centerX.equalToSuperview()
|
|
make.centerX.equalToSuperview()
|
|
|
- make.width.equalTo(70.rpx)
|
|
|
|
|
|
|
+ make.width.equalTo(100.rpx)
|
|
|
make.height.equalTo(20.rpx)
|
|
make.height.equalTo(20.rpx)
|
|
|
make.centerY.equalTo(backButton.snp.centerY)
|
|
make.centerY.equalTo(backButton.snp.centerY)
|
|
|
}
|
|
}
|
|
@@ -624,11 +628,17 @@ extension QSLActivityVipVC{
|
|
|
make.top.equalTo(cycleScrollView.snp.bottom).offset(17.rpx)
|
|
make.top.equalTo(cycleScrollView.snp.bottom).offset(17.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- vipContentView.addSubview(vipItemView)
|
|
|
|
|
|
|
+ vipContentView.snp.remakeConstraints { make in
|
|
|
|
|
+ make.top.equalTo(185.rpx)
|
|
|
|
|
+ make.left.right.equalTo(0.rpx)
|
|
|
|
|
+ make.bottom.equalTo(pageControl.snp.bottom).offset(10.rpx) // 这里只约束到 pageControl 的底部
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ vipBg.addSubview(vipItemView)
|
|
|
vipItemView.snp.makeConstraints { make in
|
|
vipItemView.snp.makeConstraints { make in
|
|
|
make.left.right.equalTo(0)
|
|
make.left.right.equalTo(0)
|
|
|
make.height.equalTo(150.rpx)
|
|
make.height.equalTo(150.rpx)
|
|
|
- make.top.equalTo(pageControl.snp.bottom).offset(16.rpx)
|
|
|
|
|
|
|
+ make.top.equalTo(vipContentView.snp.bottom).offset(0)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
vipItemView.addSubview(goodsCollectionView)
|
|
vipItemView.addSubview(goodsCollectionView)
|