Commit 97e6a434 by pierce

fixed bugs

parent 87e65467
......@@ -167,7 +167,7 @@ class GDMomentPlazaController: BaseViewController {
self.scrollView.backgroundColor = .clear
let y = self.isNavigationBarCleanColor ? (GDScreen.SafeArea.top + 44) : 0
self.scrollView.frame = .init(x: 0, y: y, width: self.view.width, height: self.scrollView.height - y)
self.scrollView.frame = .init(x: 0, y: y, width: self.view.width, height: self.view.height - y)
self.scrollView.contentSize = .init(width: self.view.width * 2, height: self.scrollView.height)
self.scrollView.showsVerticalScrollIndicator = false
self.scrollView.showsHorizontalScrollIndicator = false
......@@ -190,7 +190,7 @@ class GDMomentPlazaController: BaseViewController {
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let y = self.isNavigationBarCleanColor ? (GDScreen.SafeArea.top + 44) : 0
self.scrollView.frame = .init(x: 0, y: y, width: self.view.width, height: self.scrollView.height - y)
self.scrollView.frame = .init(x: 0, y: y, width: self.view.width, height: self.view.height - y)
self.scrollView.contentSize = .init(width: self.scrollView.width * 2, height: self.scrollView.height)
self.momentPlazaView.frame = self.scrollView.bounds
self.momentPlazaView.x = 0
......
......@@ -150,7 +150,7 @@ class GDDiamondRechargeController: BaseViewController {
self.view.addSubview(collectionView)
collectionView.snp.makeConstraints { (make) in
make.top.equalTo(titleBgImageView.snp.bottom).offset(16)
make.top.equalTo(titleBgImageView.snp.bottom).offset(8)
make.left.equalTo(16)
make.right.equalTo(-16)
make.height.equalTo(180)
......@@ -167,7 +167,7 @@ class GDDiamondRechargeController: BaseViewController {
rechargeBtn.snp.makeConstraints { (make) in
make.left.equalTo(32)
make.right.equalTo(-32)
make.top.equalTo(collectionView.snp.bottom).offset(32)
make.top.equalTo(collectionView.snp.bottom).offset(20)
make.height.equalTo(50)
}
}
......@@ -258,6 +258,22 @@ class GDDiamondRechargeController: BaseViewController {
// 钻石数
output.diamondNum?.drive(diamondNumLabel.rx.text).disposed(by: disposeBag)
GDRouter.DataRouter?.rechargeDatas.map({ $0.count }).subscribe(onNext: { [weak self] count in
guard let self = self else { return }
self.collectionView.snp.remakeConstraints({ make in
make.top.equalTo(self.titleBgImageView.snp.bottom).offset(8)
make.left.equalTo(16)
make.right.equalTo(-16)
var height = (count / 3 + 1) * 90
if height < 180 {
height = 180
}
make.height.equalTo(height)
})
}).disposed(by: disposeBag)
// 充值点数据
output.rechargeData?.drive(collectionView.rx.items(cellIdentifier: reuseIdentifier, cellType: GDDiamondRechargeCell.self)) { index, element, cell in
cell.setup(element)
......
......@@ -57,9 +57,9 @@ class GDDailySignResultCell: BaseCollectionViewCell {
iconImageView.cancelDownload()
iconImageView.image = nil
iconImageView.setWebImage(model.icon)
numberLabel.text = "x\(String(describing: model.num))"
if let num = model.num {
numberLabel.text = "x\(num)"
}
}
}
......@@ -103,7 +103,10 @@ class GDDailySingAwardCell: BaseCollectionViewCell {
numLabel.font = .gd_signFont(10)
numLabel.textColor = .hexColor("EF3874")
numLabel.strokeColor = .white
numLabel.text = "x\(String(describing: content.num))"
if let num = content.num {
numLabel.text = "x\(num)"
}
numLabel.sizeToFit()
iconImageView.addSubview(numLabel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment