|
@@ -17,22 +17,26 @@ class TSGenmojiGennerateCell : TSBaseCollectionCell{
|
|
|
return textPicker
|
|
|
}()
|
|
|
|
|
|
+ lazy var textBgView: UIView = {
|
|
|
+ let textBgView = UIView()
|
|
|
+ textBgView.backgroundColor = "#333333".uiColor
|
|
|
+ textBgView.cornerRadius = 12
|
|
|
+ return textBgView
|
|
|
+ }()
|
|
|
+
|
|
|
lazy var customTextView: TSCustomTextView = {
|
|
|
let customTextView = TSCustomTextView(
|
|
|
placeholder: "Type your idea here.",
|
|
|
text: "",
|
|
|
font: .font(size: 14),
|
|
|
textColor: .white,
|
|
|
- backgroundColor: "#333333".uiColor,
|
|
|
- textInsets: UIEdgeInsets(top: 21, left: 16, bottom: 21, right: 16)
|
|
|
+ backgroundColor: "#333333".uiColor
|
|
|
)
|
|
|
customTextView.delegate = self
|
|
|
- customTextView.layer.cornerRadius = 12
|
|
|
customTextView.returnKeyType = .send
|
|
|
return customTextView
|
|
|
}()
|
|
|
|
|
|
-
|
|
|
lazy var submitBtn: UIButton = {
|
|
|
let submitBtn = kCreateNormalSubmitBtn(title: "Generate".localized) { [weak self] in
|
|
|
guard let self = self else { return }
|
|
@@ -72,29 +76,69 @@ class TSGenmojiGennerateCell : TSBaseCollectionCell{
|
|
|
make.width.height.equalTo(82)
|
|
|
}
|
|
|
|
|
|
- contentView.addSubview(customTextView)
|
|
|
- customTextView.snp.makeConstraints { make in
|
|
|
+ contentView.addSubview(textBgView)
|
|
|
+ textBgView.snp.makeConstraints { make in
|
|
|
make.top.equalTo(57)
|
|
|
make.leading.equalTo(0)
|
|
|
make.trailing.equalTo(0)
|
|
|
make.height.equalTo(182.0*kDesignScale)
|
|
|
}
|
|
|
+
|
|
|
+ textBgView.addSubview(customTextView)
|
|
|
+ customTextView.snp.makeConstraints { make in
|
|
|
+ make.top.equalTo(21)
|
|
|
+ make.leading.equalTo(16)
|
|
|
+ make.trailing.equalTo(-16)
|
|
|
+ make.bottom.equalTo(-21)
|
|
|
+ }
|
|
|
|
|
|
- contentView.addSubview(inspirationBtn)
|
|
|
+ textBgView.addSubview(inspirationBtn)
|
|
|
inspirationBtn.snp.makeConstraints { make in
|
|
|
make.height.equalTo(28)
|
|
|
- make.bottom.equalTo(customTextView.snp.bottom).offset(-8)
|
|
|
- make.trailing.equalTo(customTextView.snp.trailing).offset(-8)
|
|
|
+ make.bottom.equalTo(-16)
|
|
|
+ make.trailing.equalTo(-16)
|
|
|
}
|
|
|
|
|
|
contentView.addSubview(submitBtn)
|
|
|
submitBtn.snp.makeConstraints { make in
|
|
|
- make.top.equalTo(customTextView.snp.bottom).offset(16)
|
|
|
+ make.top.equalTo(textBgView.snp.bottom).offset(16)
|
|
|
make.leading.equalTo(0)
|
|
|
make.trailing.equalTo(0)
|
|
|
make.height.equalTo(48)
|
|
|
}
|
|
|
}
|
|
|
+// override func creatUI() {
|
|
|
+//
|
|
|
+// contentView.addSubview(robotImageView)
|
|
|
+// robotImageView.snp.makeConstraints { make in
|
|
|
+// make.top.equalTo(0)
|
|
|
+// make.leading.equalTo(0)
|
|
|
+// make.width.height.equalTo(82)
|
|
|
+// }
|
|
|
+//
|
|
|
+// contentView.addSubview(customTextView)
|
|
|
+// customTextView.snp.makeConstraints { make in
|
|
|
+// make.top.equalTo(57)
|
|
|
+// make.leading.equalTo(0)
|
|
|
+// make.trailing.equalTo(0)
|
|
|
+// make.height.equalTo(182.0*kDesignScale)
|
|
|
+// }
|
|
|
+//
|
|
|
+// contentView.addSubview(inspirationBtn)
|
|
|
+// inspirationBtn.snp.makeConstraints { make in
|
|
|
+// make.height.equalTo(28)
|
|
|
+// make.bottom.equalTo(customTextView.snp.bottom).offset(-8)
|
|
|
+// make.trailing.equalTo(customTextView.snp.trailing).offset(-8)
|
|
|
+// }
|
|
|
+//
|
|
|
+// contentView.addSubview(submitBtn)
|
|
|
+// submitBtn.snp.makeConstraints { make in
|
|
|
+// make.top.equalTo(customTextView.snp.bottom).offset(16)
|
|
|
+// make.leading.equalTo(0)
|
|
|
+// make.trailing.equalTo(0)
|
|
|
+// make.height.equalTo(48)
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
func getVipText()->String{
|
|
@@ -112,9 +156,16 @@ class TSGenmojiGennerateCell : TSBaseCollectionCell{
|
|
|
if itemModel.style == .generate{
|
|
|
title = "Generate (\(kPurchaseDefault.freeNum(type: .generatePic)))"
|
|
|
inspirationBtn.isHidden = true
|
|
|
+ customTextView.snp.updateConstraints { make in
|
|
|
+ make.bottom.equalTo(-21)
|
|
|
+ }
|
|
|
}else if itemModel.style == .textPicGenerate{
|
|
|
title = "Generate (\(kPurchaseDefault.freeNum(type: .textGeneratePic)))"
|
|
|
inspirationBtn.isHidden = false
|
|
|
+ customTextView.snp.updateConstraints { make in
|
|
|
+ make.bottom.equalTo(-50)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|