Commit daf5a83d authored by yqz's avatar yqz

内购界面

parent 995dccba
...@@ -306,7 +306,7 @@ extension HomeNoAdsViewController : UIScrollViewDelegate { ...@@ -306,7 +306,7 @@ extension HomeNoAdsViewController : UIScrollViewDelegate {
guard let self else {return} guard let self else {return}
sender.isSelected = !sender.isSelected sender.isSelected = !sender.isSelected
let strs:NSString = sender.isSelected ? "We offer 1-year and lifetime subscriptions. The price is clearly displayed within the application.\n\n·After the purchase confirmation, your iTunes account will be charged.\n·Unless the automatic update is turned off at least 24 hours before the end of the current cycle, the subscription will be automatically updated.\n·Your account will be renewed within 24 hours before the end of the current cycle cost.\n·You can go to the \"Account Settings\" in the iTunes store to manage your subscriptions and turn off auto renewal.\n·If provided, if you choose to use our free trial version, any unused portion during the free trial period will become invalid when you purchase a publication subscription, if applicable.\n·If you choose not to purchase the AI PhoneManager Pro version, you can continue to use it for free and enjoy PhoneManager.\n\nYour personal data is securely stored in PhoneManager, please make sure to read our \nprivacy policy and terms of use." : "" let strs:NSString = sender.isSelected ? "We offer 1-year and lifetime subscriptions. The price is clearly displayed within the application.\n\n·After the purchase confirmation, your iTunes account will be charged.\n\n·Unless the automatic update is turned off at least 24 hours before the end of the current cycle, the subscription will be automatically updated.\n\n·Your account will be renewed within 24 hours before the end of the current cycle cost.\n\n·You can go to the \"Account Settings\" in the iTunes store to manage your subscriptions and turn off auto renewal.\n\n·If provided, if you choose to use our free trial version, any unused portion during the free trial period will become invalid when you purchase a publication subscription, if applicable.\n\n·If you choose not to purchase the AI PhoneManager Pro version, you can continue to use it for free and enjoy PhoneManager.\n\nYour personal data is securely stored in PhoneManager, please make sure to read our \nprivacy policy and terms of use." : ""
let attribtit = NSMutableAttributedString(string:strs as String , attributes: [:]) let attribtit = NSMutableAttributedString(string:strs as String , attributes: [:])
if strs.length > 3 { if strs.length > 3 {
...@@ -321,11 +321,12 @@ extension HomeNoAdsViewController : UIScrollViewDelegate { ...@@ -321,11 +321,12 @@ extension HomeNoAdsViewController : UIScrollViewDelegate {
DispatchQueue.main.async { DispatchQueue.main.async {
let height = CGRectGetMaxY(self.privavye_Label.frame) let height = CGRectGetMaxY(self.privavye_Label.frame)
self.contentScroll.contentSize = CGSize(width: 0, height: height + 30) self.contentScroll.contentSize = CGSize(width: 0, height: height + 30)
if self.privavye_Label.attributedText?.length ?? 0 > 10 {
UIView.animate(withDuration: 0.1) {
self.contentScroll.contentOffset = CGPoint(x: 0, y: self.contentScroll.contentSize.height - self.contentScroll.height)
}
}
} }
// let vc:TermOfUseWebViewController = TermOfUseWebViewController()
// vc.hidesBottomBarWhenPushed = true
// self.navigationController?.pushViewController(vc, animated: true)
} }
} }
...@@ -456,7 +457,7 @@ extension HomeNoAdsViewController : UIScrollViewDelegate { ...@@ -456,7 +457,7 @@ extension HomeNoAdsViewController : UIScrollViewDelegate {
buybut.snp.makeConstraints { make in buybut.snp.makeConstraints { make in
make.left.right.equalTo(stack) make.left.right.equalTo(stack)
make.top.equalTo(forever.snp.bottom).offset(20) make.top.equalTo(forever.snp.bottom).offset(20)
make.height.equalTo(46) make.height.equalTo(65)
} }
ppBtn.snp.makeConstraints { make in ppBtn.snp.makeConstraints { make in
make.top.equalTo(buybut.snp.bottom).offset(10) make.top.equalTo(buybut.snp.bottom).offset(10)
......
...@@ -311,18 +311,16 @@ class HomePayView:UIView { ...@@ -311,18 +311,16 @@ class HomePayView:UIView {
contentView2?.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC") contentView2?.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC")
self.addSubview(contentView2!) self.addSubview(contentView2!)
contentView2?.snp.makeConstraints({ make in contentView2?.snp.makeConstraints({ make in
// make.bottom.equalTo(payButton!.snp.top).offset(-12) make.top.equalTo(forever.snp.bottom).offset(20)
make.top.equalTo(forever.snp.bottom).offset(12)
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.width.equalToSuperview().offset(-30) make.width.equalToSuperview().offset(-30)
make.height.equalTo(60) make.height.equalTo(60)
}) })
payButton?.snp.makeConstraints({ make in payButton?.snp.makeConstraints({ make in
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
// make.bottom.equalTo(appleLabel!.snp.top).offset(-20) make.top.equalTo(contentView2!.snp.bottom).offset(20)
make.top.equalTo(contentView2!.snp.bottom).offset(12)
make.width.equalToSuperview().offset(-30) make.width.equalToSuperview().offset(-30)
make.height.equalTo(46) make.height.equalTo(69)
}) })
contentView2?.layer.cornerRadius = 12 contentView2?.layer.cornerRadius = 12
contentView2?.layer.masksToBounds = true contentView2?.layer.masksToBounds = true
...@@ -349,19 +347,19 @@ class HomePayView:UIView { ...@@ -349,19 +347,19 @@ class HomePayView:UIView {
contentView2Switch?.snp.makeConstraints { make in contentView2Switch?.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.width.equalTo(46) make.width.equalTo(69)
make.height.equalTo(28) make.height.equalTo(28)
} }
contentView2Switch?.addTarget(self, action: #selector(switchValueChanged(_:)), for: .valueChanged) contentView2Switch?.addTarget(self, action: #selector(switchValueChanged(_:)), for: .valueChanged)
forever.snp.makeConstraints { make in forever.snp.makeConstraints { make in
make.left.right.equalTo(self.contentView2!) make.left.right.equalTo(self.contentView2!)
make.top.equalTo(yearNorBtn.snp.bottom).offset(12) make.top.equalTo(yearNorBtn.snp.bottom).offset(20)
make.height.equalTo(69) make.height.equalTo(69)
} }
yearNorBtn.snp.makeConstraints { make in yearNorBtn.snp.makeConstraints { make in
make.left.right.equalTo(self.contentView2!) make.left.right.equalTo(self.contentView2!)
make.top.equalTo(animationLabel!.snp.bottom).offset(52) make.top.equalTo(animationLabel!.snp.bottom).offset(75)
make.height.equalTo(69) make.height.equalTo(69)
} }
privavye_Label.snp.makeConstraints { make in privavye_Label.snp.makeConstraints { make in
...@@ -371,7 +369,9 @@ class HomePayView:UIView { ...@@ -371,7 +369,9 @@ class HomePayView:UIView {
} }
self.layoutIfNeeded() self.layoutIfNeeded()
setIsSelect() setIsSelect()
callBack(CommonPush.change) DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
self.callBack(CommonPush.change)
}
} }
func playAnimationWithDelay() { func playAnimationWithDelay() {
...@@ -386,7 +386,7 @@ class HomePayView:UIView { ...@@ -386,7 +386,7 @@ class HomePayView:UIView {
} }
} }
private lazy var privavye_Label: UILabel = { lazy var privavye_Label: UILabel = {
let priva = UILabel() let priva = UILabel()
priva.font = UIFont.systemFont(ofSize: 14) priva.font = UIFont.systemFont(ofSize: 14)
priva.textColor = .gray priva.textColor = .gray
...@@ -400,6 +400,7 @@ class HomePayView:UIView { ...@@ -400,6 +400,7 @@ class HomePayView:UIView {
return priva return priva
}() }()
@objc private func labelTapped(_ gesture: UITapGestureRecognizer) { @objc private func labelTapped(_ gesture: UITapGestureRecognizer) {
let location = gesture.location(in: privavye_Label) let location = gesture.location(in: privavye_Label)
let strs:NSString = "privacy policy" let strs:NSString = "privacy policy"
...@@ -408,16 +409,10 @@ class HomePayView:UIView { ...@@ -408,16 +409,10 @@ class HomePayView:UIView {
let frame2 = CGRectMake(CGRectGetWidth(frssss)+20, privavye_Label.height-25, 90, 25) let frame2 = CGRectMake(CGRectGetWidth(frssss)+20, privavye_Label.height-25, 90, 25)
if frame1.contains(location) { if frame1.contains(location) {
Print("点击了隐私") Print("点击了隐私")
// let vc:PrivacyPolicyWebViewController = PrivacyPolicyWebViewController()
// vc.hidesBottomBarWhenPushed = true
// self.navigationController?.pushViewController(vc, animated: true)
callBack(CommonPush.pp) callBack(CommonPush.pp)
}else if frame2.contains(location){ }else if frame2.contains(location){
Print("点击了terms") Print("点击了terms")
callBack(CommonPush.tou) callBack(CommonPush.tou)
// let vc:TermOfUseWebViewController = TermOfUseWebViewController()
// vc.hidesBottomBarWhenPushed = true
// self.navigationController?.pushViewController(vc, animated: true)
} }
} }
...@@ -425,7 +420,7 @@ class HomePayView:UIView { ...@@ -425,7 +420,7 @@ class HomePayView:UIView {
var product : SKProduct? { var product : SKProduct? {
didSet{ didSet{
guard let prod = product else { return } guard let prod = product else { return }
yearNorBtn.setTitles(["Then \(prod.localizedPrice) per year","3 days free trial"]) yearNorBtn.setTitles(["\(prod.localizedPrice) per year","3 days free trial"])
} }
} }
...@@ -457,7 +452,7 @@ class HomePayView:UIView { ...@@ -457,7 +452,7 @@ class HomePayView:UIView {
@objc func ppBtnClick(btn:UIButton) { @objc func ppBtnClick(btn:UIButton) {
btn.isSelected = !btn.isSelected btn.isSelected = !btn.isSelected
let strs:NSString = btn.isSelected ? "We offer 1-year and lifetime subscriptions. The price is clearly displayed within the application.\n\n·After the purchase confirmation, your iTunes account will be charged.\n·Unless the automatic update is turned off at least 24 hours before the end of the current cycle, the subscription will be automatically updated.\n·Your account will be renewed within 24 hours before the end of the current cycle cost.\n·You can go to the \"Account Settings\" in the iTunes store to manage your subscriptions and turn off auto renewal.\n·If provided, if you choose to use our free trial version, any unused portion during the free trial period will become invalid when you purchase a publication subscription, if applicable.\n·If you choose not to purchase the AI PhoneManager Pro version, you can continue to use it for free and enjoy PhoneManager.\n\nYour personal data is securely stored in PhoneManager, please make sure to read our \nprivacy policy and terms of use." : "" let strs:NSString = btn.isSelected ? "We offer 1-year and lifetime subscriptions. The price is clearly displayed within the application.\n\n·After the purchase confirmation, your iTunes account will be charged.\n\n·Unless the automatic update is turned off at least 24 hours before the end of the current cycle, the subscription will be automatically updated.\n\n·Your account will be renewed within 24 hours before the end of the current cycle cost.\n\n·You can go to the \"Account Settings\" in the iTunes store to manage your subscriptions and turn off auto renewal.\n\n·If provided, if you choose to use our free trial version, any unused portion during the free trial period will become invalid when you purchase a publication subscription, if applicable.\n\n·If you choose not to purchase the AI PhoneManager Pro version, you can continue to use it for free and enjoy PhoneManager.\n\nYour personal data is securely stored in PhoneManager, please make sure to read our \nprivacy policy and terms of use." : ""
let attribtit = NSMutableAttributedString(string:strs as String , attributes: [:]) let attribtit = NSMutableAttributedString(string:strs as String , attributes: [:])
if strs.length > 3 { if strs.length > 3 {
......
...@@ -87,7 +87,12 @@ class HomePayViewController:UIViewController { ...@@ -87,7 +87,12 @@ class HomePayViewController:UIViewController {
case .change: case .change:
DispatchQueue.main.async { DispatchQueue.main.async {
let contentSize = CGRectGetHeight(self.homePayView?.frame ?? CGRect()) let contentSize = CGRectGetHeight(self.homePayView?.frame ?? CGRect())
self.scroll.contentSize = CGSizeMake(0, contentSize) self.scroll.contentSize = CGSizeMake(0, contentSize + (cWindow?.safeAreaInsets.bottom ?? 20) + 5)
if self.homePayView?.privavye_Label.attributedText?.length ?? 0 > 10 {
UIView.animate(withDuration: 0.1) {
self.scroll.contentOffset = CGPoint(x: 0, y: self.scroll.contentSize.height - self.scroll.height)
}
}
} }
break break
} }
......
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 to comment