|
@@ -199,13 +199,6 @@ class QSLVipController: QSLBaseController {
|
|
|
|
|
|
|
|
attr.append(blankAttr)
|
|
attr.append(blankAttr)
|
|
|
|
|
|
|
|
- let andAttr = NSMutableAttributedString(string: "和")
|
|
|
|
|
- andAttr.font(12)
|
|
|
|
|
- andAttr.color(.hexStringColor(hexString: "#A7A7A7"))
|
|
|
|
|
- attr.append(andAttr)
|
|
|
|
|
-
|
|
|
|
|
- attr.append(blankAttr)
|
|
|
|
|
-
|
|
|
|
|
let serviceHL = YYTextHighlight()
|
|
let serviceHL = YYTextHighlight()
|
|
|
var serviceStr = "《用户协议》"
|
|
var serviceStr = "《用户协议》"
|
|
|
|
|
|
|
@@ -218,6 +211,28 @@ class QSLVipController: QSLBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
attr.append(serviceText)
|
|
attr.append(serviceText)
|
|
|
|
|
+
|
|
|
|
|
+ attr.append(blankAttr)
|
|
|
|
|
+
|
|
|
|
|
+ let andAttr = NSMutableAttributedString(string: "和")
|
|
|
|
|
+ andAttr.font(12)
|
|
|
|
|
+ andAttr.color(.hexStringColor(hexString: "#A7A7A7"))
|
|
|
|
|
+ attr.append(andAttr)
|
|
|
|
|
+
|
|
|
|
|
+ attr.append(blankAttr)
|
|
|
|
|
+
|
|
|
|
|
+ let subcribeHL = YYTextHighlight()
|
|
|
|
|
+ var subcribeStr = "《续订说明》"
|
|
|
|
|
+
|
|
|
|
|
+ let subcribeText = NSMutableAttributedString(string: subcribeStr)
|
|
|
|
|
+ subcribeText.font(12)
|
|
|
|
|
+ subcribeText.color(.hexStringColor(hexString: "#E7B983"))
|
|
|
|
|
+ subcribeText.yy_setTextHighlight(subcribeHL, range: NSRange(location: 0, length: subcribeStr.count))
|
|
|
|
|
+ subcribeHL.tapAction = { [weak self] containerView, text, range, rect in
|
|
|
|
|
+ self?.subscibeAction()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ attr.append(subcribeText)
|
|
|
|
|
|
|
|
label.attributedText = attr
|
|
label.attributedText = attr
|
|
|
|
|
|
|
@@ -259,6 +274,26 @@ class QSLVipController: QSLBaseController {
|
|
|
return view
|
|
return view
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
|
|
+ lazy var tipTitleLabel: UILabel = {
|
|
|
|
|
+
|
|
|
|
|
+ let label = UILabel()
|
|
|
|
|
+ label.text("温馨提示")
|
|
|
|
|
+ label.font(12)
|
|
|
|
|
+ label.textColor = .hexStringColor(hexString: "#000000").withAlphaComponent(0.8)
|
|
|
|
|
+ return label
|
|
|
|
|
+ }()
|
|
|
|
|
+
|
|
|
|
|
+ lazy var tipContentLabel: UILabel = {
|
|
|
|
|
+
|
|
|
|
|
+ let label = UILabel()
|
|
|
|
|
+ label.numberOfLines = 0
|
|
|
|
|
+ label.text("1 订阅后会从您的iTunes账户中扣除相关费用。如需取消续订,请在当前订阅周期结束前,至少24小时内通过手机“账户设置”的订阅管理关闭自动续费功能。\n2 未成年人请在监护者的陪同下进行购买\n3 购买后不支持退款,请仔细审阅《隐私权政策》《用户协议》和《续订说明》")
|
|
|
|
|
+ label.font(10)
|
|
|
|
|
+ label.textColor = .hexStringColor(hexString: "#000000").withAlphaComponent(0.6)
|
|
|
|
|
+ label.changeLineSpace(space: 5)
|
|
|
|
|
+ return label
|
|
|
|
|
+ }()
|
|
|
|
|
+
|
|
|
lazy var bottomView: UIView = {
|
|
lazy var bottomView: UIView = {
|
|
|
|
|
|
|
|
let view = UIView()
|
|
let view = UIView()
|
|
@@ -300,11 +335,21 @@ class QSLVipController: QSLBaseController {
|
|
|
lazy var goodTypeLabel: UILabel = {
|
|
lazy var goodTypeLabel: UILabel = {
|
|
|
|
|
|
|
|
let label = UILabel()
|
|
let label = UILabel()
|
|
|
- label.text("/ 永久会员")
|
|
|
|
|
|
|
+ label.text("/")
|
|
|
label.textColor = .hexStringColor(hexString: "#FFF8EF")
|
|
label.textColor = .hexStringColor(hexString: "#FFF8EF")
|
|
|
label.font(12)
|
|
label.font(12)
|
|
|
return label
|
|
return label
|
|
|
}()
|
|
}()
|
|
|
|
|
+
|
|
|
|
|
+ lazy var goodOriginalPriceLabel: UILabel = {
|
|
|
|
|
+
|
|
|
|
|
+ let label = UILabel()
|
|
|
|
|
+ label.text("原价228")
|
|
|
|
|
+ label.textColor = .hexStringColor(hexString: "#FFF8EF")
|
|
|
|
|
+ label.font(12)
|
|
|
|
|
+ label.centerLineText(lineValue: 1, underlineColor: .hexStringColor(hexString: "#FFF8EF"))
|
|
|
|
|
+ return label
|
|
|
|
|
+ }()
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
super.viewDidLoad()
|
|
@@ -352,6 +397,14 @@ extension QSLVipController {
|
|
|
self.navigationController?.pushViewController(vc, animated: true)
|
|
self.navigationController?.pushViewController(vc, animated: true)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @objc func subscibeAction() {
|
|
|
|
|
+
|
|
|
|
|
+ let vc = QSLWebViewController()
|
|
|
|
|
+ vc.webUrl = QSLConfig.AppSubscibeAgreementLink
|
|
|
|
|
+ vc.title = "续订说明"
|
|
|
|
|
+ self.navigationController?.pushViewController(vc, animated: true)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@objc func selectBtnAction() {
|
|
@objc func selectBtnAction() {
|
|
|
|
|
|
|
|
selectBtn.isSelected = !selectBtn.isSelected
|
|
selectBtn.isSelected = !selectBtn.isSelected
|
|
@@ -643,15 +696,23 @@ extension QSLVipController {
|
|
|
|
|
|
|
|
func updateSelectGoodUI() {
|
|
func updateSelectGoodUI() {
|
|
|
var priceText = ""
|
|
var priceText = ""
|
|
|
|
|
+ var originalPriceText = ""
|
|
|
if let selectGood = self.selectGood {
|
|
if let selectGood = self.selectGood {
|
|
|
if selectGood.amount.truncatingRemainder(dividingBy: 100) == 0 {
|
|
if selectGood.amount.truncatingRemainder(dividingBy: 100) == 0 {
|
|
|
priceText = "\(Int(selectGood.amount / 100))"
|
|
priceText = "\(Int(selectGood.amount / 100))"
|
|
|
} else {
|
|
} else {
|
|
|
priceText = String(format: "%.2lf", selectGood.amount / 100 )
|
|
priceText = String(format: "%.2lf", selectGood.amount / 100 )
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if selectGood.originalAmount.truncatingRemainder(dividingBy: 100) == 0 {
|
|
|
|
|
+ originalPriceText = "\(Int(selectGood.originalAmount / 100))"
|
|
|
|
|
+ } else {
|
|
|
|
|
+ originalPriceText = String(format: "%.2lf", selectGood.originalAmount / 100 )
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
self.priceLabel.text(priceText)
|
|
self.priceLabel.text(priceText)
|
|
|
- self.goodTypeLabel.text("/ \(self.selectGood?.name ?? "")")
|
|
|
|
|
|
|
+// self.goodTypeLabel.text("/ \(self.selectGood?.name ?? "")")
|
|
|
|
|
+ self.goodOriginalPriceLabel.text("原价\(originalPriceText)")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func initializeView() {
|
|
func initializeView() {
|
|
@@ -722,7 +783,7 @@ extension QSLVipController {
|
|
|
make.left.right.bottom.equalTo(0)
|
|
make.left.right.bottom.equalTo(0)
|
|
|
make.top.equalTo(funcBannerImageView.snp.bottom).offset(-24.rpx)
|
|
make.top.equalTo(funcBannerImageView.snp.bottom).offset(-24.rpx)
|
|
|
make.width.equalTo(QSLConst.qsl_kScreenW)
|
|
make.width.equalTo(QSLConst.qsl_kScreenW)
|
|
|
- make.height.equalTo(700.rpx)
|
|
|
|
|
|
|
+ make.height.equalTo(800.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
mainView.addSubview(goodsBgView)
|
|
mainView.addSubview(goodsBgView)
|
|
@@ -805,6 +866,19 @@ extension QSLVipController {
|
|
|
make.height.equalTo(commentHeight3)
|
|
make.height.equalTo(commentHeight3)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ commentView.addSubview(tipTitleLabel)
|
|
|
|
|
+ commentView.addSubview(tipContentLabel)
|
|
|
|
|
+ tipTitleLabel.snp.makeConstraints { make in
|
|
|
|
|
+ make.left.equalTo(16)
|
|
|
|
|
+ make.top.equalTo(comment3.snp.bottom).offset(28)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tipContentLabel.snp.makeConstraints { make in
|
|
|
|
|
+ make.left.equalTo(16)
|
|
|
|
|
+ make.right.equalTo(-16)
|
|
|
|
|
+ make.top.equalTo(tipTitleLabel.snp.bottom).offset(11)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
scrollView.snp.makeConstraints { make in
|
|
scrollView.snp.makeConstraints { make in
|
|
|
make.bottom.equalTo(mainView)
|
|
make.bottom.equalTo(mainView)
|
|
|
}
|
|
}
|
|
@@ -840,6 +914,12 @@ extension QSLVipController {
|
|
|
make.left.equalTo(priceLabel.snp.right).offset(2.rpx)
|
|
make.left.equalTo(priceLabel.snp.right).offset(2.rpx)
|
|
|
make.bottom.equalTo(-14.rpx)
|
|
make.bottom.equalTo(-14.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ bottomView.addSubview(goodOriginalPriceLabel)
|
|
|
|
|
+ goodOriginalPriceLabel.snp.makeConstraints { make in
|
|
|
|
|
+ make.left.equalTo(goodTypeLabel.snp.right).offset(2.rpx)
|
|
|
|
|
+ make.centerY.equalTo(goodTypeLabel.snp.centerY)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|