|
@@ -44,14 +44,6 @@ class CircleQuestionsAnswersViewController: BaseViewController {
|
|
}
|
|
}
|
|
|
|
|
|
override func setupLayouts() {
|
|
override func setupLayouts() {
|
|
- navigationBar.titleLabel.snp.remakeConstraints { (make) in
|
|
|
|
- make.top.equalTo(kSafeStatusBarHeight + 4)
|
|
|
|
- make.centerX.equalToSuperview()
|
|
|
|
- }
|
|
|
|
- subtitleLabel.snp.makeConstraints { (make) in
|
|
|
|
- make.top.equalTo(navigationBar.titleLabel.snp.bottom)
|
|
|
|
- make.centerX.equalToSuperview()
|
|
|
|
- }
|
|
|
|
submitButton.snp.makeConstraints { (make) in
|
|
submitButton.snp.makeConstraints { (make) in
|
|
make.bottom.equalTo(-(kSafeTabBarHeight + 16))
|
|
make.bottom.equalTo(-(kSafeTabBarHeight + 16))
|
|
make.left.equalTo(25)
|
|
make.left.equalTo(25)
|
|
@@ -71,7 +63,7 @@ class CircleQuestionsAnswersViewController: BaseViewController {
|
|
let subtitleLabel = UILabel()
|
|
let subtitleLabel = UILabel()
|
|
subtitleLabel.textColor = kbbbbbbColor
|
|
subtitleLabel.textColor = kbbbbbbColor
|
|
subtitleLabel.font = kRegularFont11
|
|
subtitleLabel.font = kRegularFont11
|
|
- subtitleLabel.text = "今日剩余 0 次答题机会"
|
|
|
|
|
|
+ subtitleLabel.isHidden = true
|
|
return subtitleLabel
|
|
return subtitleLabel
|
|
}()
|
|
}()
|
|
|
|
|
|
@@ -102,7 +94,26 @@ class CircleQuestionsAnswersViewController: BaseViewController {
|
|
SwiftMoyaNetWorkServiceCommunity.shared().communityCircleQuestionApi(circleId: circleId ?? 0, completion: {
|
|
SwiftMoyaNetWorkServiceCommunity.shared().communityCircleQuestionApi(circleId: circleId ?? 0, completion: {
|
|
[weak self] (communityCircleQuestionsAnswersModel) -> (Void) in
|
|
[weak self] (communityCircleQuestionsAnswersModel) -> (Void) in
|
|
self?.communityCircleQuestionsAnswersModel = communityCircleQuestionsAnswersModel as? CommunityCircleQuestionsAnswersModel
|
|
self?.communityCircleQuestionsAnswersModel = communityCircleQuestionsAnswersModel as? CommunityCircleQuestionsAnswersModel
|
|
- self?.subtitleLabel.text = "今日剩余 \( self?.communityCircleQuestionsAnswersModel?.answerCount ?? 0) 次答题机会"
|
|
|
|
|
|
+ if self?.communityCircleQuestionsAnswersModel?.answerCount == -1 {
|
|
|
|
+ self?.subtitleLabel.isHidden = true
|
|
|
|
+ self?.navigationBar.titleLabel.snp.remakeConstraints { (make) in
|
|
|
|
+ make.centerY.equalTo((self?.navigationBar.leftButton)!)
|
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+
|
|
|
|
+ self?.subtitleLabel.text = "今日剩余 \( self?.communityCircleQuestionsAnswersModel?.answerCount ?? 0) 次答题机会"
|
|
|
|
+ self?.navigationBar.titleLabel.snp.remakeConstraints { (make) in
|
|
|
|
+ make.top.equalTo(kSafeStatusBarHeight + 4)
|
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
|
+ }
|
|
|
|
+ self?.subtitleLabel.snp.makeConstraints { (make) in
|
|
|
|
+ make.top.equalTo((self?.navigationBar.titleLabel.snp.bottom)!)
|
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
|
+ }
|
|
|
|
+ self?.subtitleLabel.isHidden = false
|
|
|
|
+
|
|
|
|
+ }
|
|
self?.submitButton.isHidden = false
|
|
self?.submitButton.isHidden = false
|
|
self?.tableView.reloadData()
|
|
self?.tableView.reloadData()
|
|
}) { (loadingStatus) in
|
|
}) { (loadingStatus) in
|