vip页面绘制

This commit is contained in:
bluesea 2024-04-03 16:37:58 +08:00
parent 37040f6f98
commit 2aadc632ea
85 changed files with 697 additions and 149 deletions

View File

@ -39,7 +39,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// self.window?.makeKeyAndVisible() // self.window?.makeKeyAndVisible()
Analytics.logEvent("user_launch", parameters: ["type":"new"]) Analytics.logEvent("user_launch", parameters: ["type":"new"])
SKUPay.sharedInstance.requestProducts(productsIdentifiers: ["VPC00001","VPC00002","VPC00003"]) SKUPay.sharedInstance.requestProducts(productsIdentifiers: MemberShipModelItem.getProductsIDs())
return true return true
} }

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Btn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Btn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Btn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Btn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320234.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320234@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320234@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320234.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320234@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320234@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320234.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320234@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320234@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320234.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320234@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320234@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "A_WEEK.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "A_WEEK@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "A_WEEK@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "A_WEEK.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "A_WEEK@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "A_WEEK@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "A_WEEK.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "A_WEEK@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "A_WEEK@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "A_WEEK.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "A_WEEK@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "A_WEEK@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320209.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320209@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320209@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320209.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320209@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320209@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320209.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320209@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320209@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320209.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320209@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320209@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320236.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320236@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320236@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group_427320236.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_427320236@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_427320236@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "498e9265564f52e8b79a8b8d03182a2e06496ad618efa-nU74kP_fw1200_1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "498e9265564f52e8b79a8b8d03182a2e06496ad618efa-nU74kP_fw1200_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "498e9265564f52e8b79a8b8d03182a2e06496ad618efa-nU74kP_fw1200_1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -14,6 +14,24 @@ class MemberShipModelItem: NSObject {
var desc:String? var desc:String?
var rightDesc:String? var rightDesc:String?
var isSelected:Bool = false var isSelected:Bool = false
var imageName_selected:String?
var imageName_unSelected:String?
var productIdentifier:String?//id
init(title: String? = nil, desc: String? = nil, rightDesc: String? = nil, isSelected: Bool, imageName_selected: String? = nil, imageName_unSelected: String? = nil, productIdentifier: String? = nil) {
self.title = title
self.desc = desc
self.rightDesc = rightDesc
self.isSelected = isSelected
self.imageName_selected = imageName_selected
self.imageName_unSelected = imageName_unSelected
self.productIdentifier = productIdentifier
}
//3
class func getProductsIDs()->[String] {
return ["VPC00001","VPC00002","VPC00003"]
}
} }
//MARK: - MembershipProductView //MARK: - MembershipProductView
@ -88,7 +106,7 @@ class MembershipProductView: UIView ,UITableViewDataSource,UITableViewDelegate{
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 66 return 80
} }
} }
@ -100,65 +118,72 @@ class MembershipViewCell: UITableViewCell {
var rightDescBtn:UIButton? var rightDescBtn:UIButton?
var leftTitleLabel:UILabel? var leftTitleLabel:UILabel?
var leftDescLabel:UILabel? var leftDescLabel:UILabel?
var bgImgView:UIImageView?
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier) super.init(style: style, reuseIdentifier: reuseIdentifier)
bgView = UIView() bgView = UIView()
bgView?.backgroundColor = UIColor(r: 20, g: 20, b: 20, a: 1)
self.contentView.addSubview(bgView!) self.contentView.addSubview(bgView!)
bgView?.layer.cornerRadius = 10 bgView?.layer.cornerRadius = 12
bgView?.layer.masksToBounds = true bgView?.layer.masksToBounds = true
bgView?.layer.borderWidth = 2
bgView?.snp.makeConstraints { make in bgView?.snp.makeConstraints { make in
make.left.equalToSuperview().offset(4) make.left.equalToSuperview().offset(4)
make.top.equalToSuperview().offset(2) make.top.equalToSuperview().offset(7)
make.bottom.equalToSuperview().offset(-2) make.bottom.equalToSuperview().offset(-7)
make.right.equalToSuperview().offset(-4) make.right.equalToSuperview().offset(-4)
} }
leftTitleLabel = UILabel() bgImgView = UIImageView()
bgView?.addSubview(leftTitleLabel!) bgView?.addSubview(bgImgView!)
leftTitleLabel?.textColor = .black bgImgView?.snp.makeConstraints { make in
leftTitleLabel?.font = UIFont.systemFont(ofSize: 16) make.left.top.right.bottom.equalToSuperview()
leftTitleLabel?.snp.makeConstraints { make in
make.left.equalToSuperview().offset(6)
make.top.equalToSuperview().offset(6)
}
leftDescLabel = UILabel()
bgView?.addSubview(leftDescLabel!)
leftDescLabel?.textColor = .gray
leftDescLabel?.font = UIFont.systemFont(ofSize: 12)
leftDescLabel?.snp.makeConstraints {[weak self] make in
make.left.equalToSuperview().offset(6)
make.top.equalTo(self!.leftTitleLabel!.snp.bottom).offset(6)
}
rightDescBtn = UIButton()
rightDescBtn?.isUserInteractionEnabled = false
self.contentView.addSubview(rightDescBtn!)
// rightDescBtn?.setBackgroundImage(UIImage(named: "BG_Top"), for: .normal)
rightDescBtn?.layer.cornerRadius = 8
rightDescBtn?.layer.masksToBounds = true
rightDescBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 12)
rightDescBtn?.setTitleColor(.black, for: .normal)
rightDescBtn?.snp.makeConstraints { make in
make.right.equalToSuperview().offset(0)
make.top.equalToSuperview().offset(0)
make.height.equalTo(30)
make.width.equalTo(120)
} }
bgView?.backgroundColor = .clear
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
//
// leftTitleLabel = UILabel()//label
// bgView?.addSubview(leftTitleLabel!)
// leftTitleLabel?.textColor = .black
// leftTitleLabel?.font = UIFont.systemFont(ofSize: 16)
// leftTitleLabel?.snp.makeConstraints { make in
// make.left.equalToSuperview().offset(6)
// make.top.equalToSuperview().offset(6)
// }
//
// leftDescLabel = UILabel()
// bgView?.addSubview(leftDescLabel!)
// leftDescLabel?.textColor = .gray
// leftDescLabel?.font = UIFont.systemFont(ofSize: 12)
// leftDescLabel?.snp.makeConstraints {[weak self] make in
// make.left.equalToSuperview().offset(6)
// make.top.equalTo(self!.leftTitleLabel!.snp.bottom).offset(6)
// }
//
// rightDescBtn = UIButton()
// rightDescBtn?.isUserInteractionEnabled = false
// self.contentView.addSubview(rightDescBtn!)
// rightDescBtn?.layer.cornerRadius = 8
// rightDescBtn?.layer.masksToBounds = true
//
// rightDescBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 12)
// rightDescBtn?.setTitleColor(.black, for: .normal)
// rightDescBtn?.snp.makeConstraints { make in
// make.right.equalToSuperview().offset(0)
// make.top.equalToSuperview().offset(0)
// make.height.equalTo(30)
// make.width.equalTo(120)
// }
} }
func setItemData(_ item:MemberShipModelItem?) { func setItemData(_ item:MemberShipModelItem?) {
self.item = item self.item = item
self.item?.addObserver(self, forKeyPath: "isSelected", context: nil) self.item?.addObserver(self, forKeyPath: "isSelected", context: nil)
rightDescBtn?.setTitle(item?.rightDesc, for: .normal) // rightDescBtn?.setTitle(item?.rightDesc, for: .normal)
leftTitleLabel?.text = item?.title // leftTitleLabel?.text = item?.title
leftDescLabel?.text = item?.desc // leftDescLabel?.text = item?.desc
updateCellUI() updateCellUI()
} }
@ -168,13 +193,14 @@ class MembershipViewCell: UITableViewCell {
return return
} }
if it.isSelected == true{ if it.isSelected == true{
// bgView?.backgroundColor = .gray // bgView?.backgroundColor = UIColor(r: 20, g: 20, b: 20, a: 1)
bgView?.backgroundColor = UIColor(r: 20, g: 20, b: 20, a: 1) // bgView?.layer.borderColor = UIColor.black.cgColor
bgView?.layer.borderColor = UIColor.black.cgColor bgImgView?.image = UIImage(named: it.imageName_selected!)
} }
else{ else{
bgView?.backgroundColor = .lightGray // bgView?.backgroundColor = .lightGray
bgView?.layer.borderColor = UIColor.gray.cgColor // bgView?.layer.borderColor = UIColor.gray.cgColor
bgImgView?.image = UIImage(named: it.imageName_unSelected!)
} }
} }

View File

@ -12,9 +12,9 @@ class MembershipVC: BaseController {
var selectedItem:MemberShipModelItem? var selectedItem:MemberShipModelItem?
lazy var mTopImgView:UIImageView = { lazy var mTopImgView:UIImageView = {
//393*236 //393*236
let view = UIImageView(frame: CGRect(x: 0, y: 0, width: SCREEN_Width, height: SCREEN_Height * 236/393)) // let view = UIImageView(frame: CGRect(x: 0, y: 0, width: SCREEN_Width, height: SCREEN_Height * 236/393))
let view = UIImageView(frame: CGRect(x: 0, y: 0, width: SCREEN_Width, height: SCREEN_Height))
view.image = UIImage.init(named: "BG_Top") view.image = UIImage.init(named: "vippage_bg")
return view return view
}() }()

View File

@ -19,15 +19,17 @@ extension MembershipVC {
self.rightBtn1?.addTarget(self, action: #selector(buyMembership(sender: )), for: .touchUpInside) self.rightBtn1?.addTarget(self, action: #selector(buyMembership(sender: )), for: .touchUpInside)
self.setRightOneBtnTitle(string: NSLocalizedString("restorevip", comment: "") as NSString) self.setRightOneBtnTitle(string: NSLocalizedString("restorevip", comment: "") as NSString)
self.rightBtn1?.isHidden = false self.rightBtn1?.isHidden = false
self.view.addSubview(mTopImgView)
let topView = self.topView() let topView = self.topView()
self.view.addSubview(topView) self.view.addSubview(topView)
topView.snp.makeConstraints { make in topView.snp.makeConstraints { make in
make.left.right.equalTo(0) make.left.right.equalTo(0)
make.top.equalToSuperview().offset(120) make.top.equalToSuperview().offset(80)
make.height.equalTo(150) make.height.equalTo(254)
} }
self.view.addSubview(mTopImgView)
self.view.bringSubviewToFront(self.navtionBar!) self.view.bringSubviewToFront(self.navtionBar!)
self.setNavgationBarColorImg(color: .clear) self.setNavgationBarColorImg(color: .clear)
var acView = topView var acView = topView
@ -38,7 +40,7 @@ extension MembershipVC {
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-20)
make.top.equalTo(topView.snp.bottom).offset(20) make.top.equalTo(topView.snp.bottom).offset(20)
make.height.equalTo(210) make.height.equalTo(268)
} }
acView = centerView acView = centerView
} }
@ -66,58 +68,64 @@ extension MembershipVC {
} }
func topView() -> UIView { func topView() -> UIView {
let bgView = UIView() let bgView = UIView()
bgView.backgroundColor = .white let imgView = UIImageView()
let imgView_1 = UIImageView(image: UIImage(named: "logo")) imgView.image = UIImage(named: NSLocalizedString("vip_topImg", comment: ""))
bgView.addSubview(imgView_1) bgView.addSubview(imgView)
imgView_1.snp.makeConstraints { make in imgView.snp.makeConstraints { make in
make.height.width.equalTo(30) make.top.right.bottom.top.equalToSuperview()
}
let titleLabel = UILabel()
bgView.addSubview(titleLabel)
titleLabel.text = NSLocalizedString("VPcamera", comment: "")
titleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(8)
make.centerY.equalTo(imgView_1.snp.centerY)
make.left.equalTo(imgView_1.snp.right).offset(4)
}
let imgView_2 = UIImageView(image: UIImage(named: "logo"))
bgView.addSubview(imgView_2)
imgView_2.snp.makeConstraints { make in
make.centerY.equalTo(titleLabel.snp.centerY)
make.height.width.equalTo(30)
make.left.equalTo(titleLabel.snp.right).offset(4)
}
let siView_1 = shipItemView("logo", NSLocalizedString("membershipdesc_1", comment: ""))
bgView.addSubview(siView_1)
let siView_2 = shipItemView("logo", NSLocalizedString("membershipdesc_2", comment: ""))
bgView.addSubview(siView_2)
let siView_3 = shipItemView("logo", NSLocalizedString("membershipdesc_3", comment: ""))
bgView.addSubview(siView_3)
let siView_4 = shipItemView("logo", NSLocalizedString("membershipdesc_4", comment: ""))
bgView.addSubview(siView_4)
siView_1.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(titleLabel.snp.bottom).offset(20)
}
siView_2.snp.makeConstraints { make in
make.left.equalTo(siView_1.snp.left)
make.top.equalTo(siView_1.snp.bottom).offset(4)
}
siView_3.snp.makeConstraints { make in
make.left.equalTo(siView_2.snp.left)
make.top.equalTo(siView_2.snp.bottom).offset(4)
}
siView_4.snp.makeConstraints { make in
make.left.equalTo(siView_3.snp.left)
make.top.equalTo(siView_3.snp.bottom).offset(4)
} }
// bgView.backgroundColor = .white
// let imgView_1 = UIImageView(image: UIImage(named: "logo"))
// bgView.addSubview(imgView_1)
// imgView_1.snp.makeConstraints { make in
// make.height.width.equalTo(30)
// }
//
// let titleLabel = UILabel()
// bgView.addSubview(titleLabel)
// titleLabel.text = NSLocalizedString("VPcamera", comment: "")
// titleLabel.snp.makeConstraints { make in
// make.centerX.equalToSuperview()
// make.top.equalToSuperview().offset(8)
// make.centerY.equalTo(imgView_1.snp.centerY)
// make.left.equalTo(imgView_1.snp.right).offset(4)
// }
//
// let imgView_2 = UIImageView(image: UIImage(named: "logo"))
// bgView.addSubview(imgView_2)
// imgView_2.snp.makeConstraints { make in
// make.centerY.equalTo(titleLabel.snp.centerY)
// make.height.width.equalTo(30)
// make.left.equalTo(titleLabel.snp.right).offset(4)
// }
//
// let siView_1 = shipItemView("logo", NSLocalizedString("membershipdesc_1", comment: ""))
// bgView.addSubview(siView_1)
// let siView_2 = shipItemView("logo", NSLocalizedString("membershipdesc_2", comment: ""))
// bgView.addSubview(siView_2)
// let siView_3 = shipItemView("logo", NSLocalizedString("membershipdesc_3", comment: ""))
// bgView.addSubview(siView_3)
// let siView_4 = shipItemView("logo", NSLocalizedString("membershipdesc_4", comment: ""))
// bgView.addSubview(siView_4)
//
// siView_1.snp.makeConstraints { make in
// make.centerX.equalToSuperview()
// make.top.equalTo(titleLabel.snp.bottom).offset(20)
// }
// siView_2.snp.makeConstraints { make in
// make.left.equalTo(siView_1.snp.left)
// make.top.equalTo(siView_1.snp.bottom).offset(4)
// }
//
// siView_3.snp.makeConstraints { make in
// make.left.equalTo(siView_2.snp.left)
// make.top.equalTo(siView_2.snp.bottom).offset(4)
// }
//
// siView_4.snp.makeConstraints { make in
// make.left.equalTo(siView_3.snp.left)
// make.top.equalTo(siView_3.snp.bottom).offset(4)
// }
return bgView return bgView
} }
@ -163,14 +171,25 @@ extension MembershipVC {
// //
func configureData(){ func configureData(){
var arr:[MemberShipModelItem] = [] var arr:[MemberShipModelItem] = []
for i in 0 ..< 3 { let item1 = MemberShipModelItem(title: "$0.99/周", desc: "一周", rightDesc: "", isSelected: false, imageName_selected: NSLocalizedString("vip_product_week", comment: ""), imageName_unSelected: NSLocalizedString("vip_product_unselect_week", comment: ""), productIdentifier: MemberShipModelItem.getProductsIDs()[0])
let item = MemberShipModelItem() arr.append(item1)
item.title = "$9.9/周"
item.desc = "低至$0.14/天" let item2 = MemberShipModelItem(title: "$1.99/周", desc: "一月", rightDesc: "90%的人选择", isSelected: false, imageName_selected: NSLocalizedString("vip_product_month", comment: ""), imageName_unSelected: NSLocalizedString("vip_product_unselect_month", comment: ""), productIdentifier: MemberShipModelItem.getProductsIDs()[1])
item.rightDesc = "90%人选择" arr.append(item2)
item.isSelected = false
arr.append(item) let item3 = MemberShipModelItem(title: "$9.99/年", desc: "一年", rightDesc: "50%的人选择", isSelected: false, imageName_selected: NSLocalizedString("vip_product_year", comment: ""), imageName_unSelected: NSLocalizedString("vip_product_unselect_year", comment: ""), productIdentifier: MemberShipModelItem.getProductsIDs()[1])
} arr.append(item3)
// for i in 0 ..< 3 {
// let item = MemberShipModelItem()
// item.title = "$9.9/"
// item.desc = "$0.14/"
// item.rightDesc = "90%"
// item.isSelected = false
// item.imageName_selected = ""
// item.imageName_unSelected = ""
// arr.append(item)
// }
let item = arr[1] let item = arr[1]
item.isSelected = true item.isSelected = true
selectedItem = item selectedItem = item
@ -179,29 +198,56 @@ extension MembershipVC {
func bottomView()->UIView { func bottomView()->UIView {
let bgView = UIView() let bgView = UIView()
bgView.backgroundColor = .white bgView.backgroundColor = .clear
let subscribeBtn = UIButton()
bgView.addSubview(subscribeBtn)
subscribeBtn.addTarget(self, action: #selector(subscribeAction(sender: )), for: .touchUpInside)
subscribeBtn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16)
subscribeBtn.setTitleColor(.white, for: .normal)
// subscribeBtn.setTitle(UserInfo.sharedInstance.isMemberShip ?NSLocalizedString("Membership activated", comment: "") : NSLocalizedString("Free Trail 3 Days", comment: ""), for: .normal)
if UserInfo.sharedInstance.isMemberShip {
subscribeBtn.setBackgroundImage(UIImage(named: NSLocalizedString("vip_alreadybuybtn", comment: "")), for: .normal)
}
else {
subscribeBtn.setBackgroundImage(UIImage(named: NSLocalizedString("vip_buybtn", comment: "")), for: .normal)
}
subscribeBtn.backgroundColor = UserInfo.sharedInstance.isMemberShip ? .lightGray : .darkText
subscribeBtn.layer.masksToBounds = true
subscribeBtn.layer.cornerRadius = 16
subscribeBtn.isEnabled = !UserInfo.sharedInstance.isMemberShip
subscribeBtn.snp.makeConstraints { make in
make.top.equalToSuperview()
make.centerX.equalToSuperview()
make.height.equalTo(54)
make.left.equalToSuperview().offset(4)
make.right.equalToSuperview().offset(-4)
}
let btn_privateBtn = UIButton() let btn_privateBtn = UIButton()
bgView.addSubview(btn_privateBtn) bgView.addSubview(btn_privateBtn)
btn_privateBtn.addTarget(self, action: #selector(goWeb(sender: )), for: .touchUpInside) btn_privateBtn.addTarget(self, action: #selector(goWeb(sender: )), for: .touchUpInside)
btn_privateBtn.setTitle(NSLocalizedString("隐私政策", comment: ""), for: .normal) btn_privateBtn.setTitle(NSLocalizedString("隐私政策", comment: ""), for: .normal)
btn_privateBtn.titleLabel?.font = UIFont.systemFont(ofSize: 12) btn_privateBtn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
btn_privateBtn.setTitleColor(.gray, for: .normal) btn_privateBtn.setTitleColor(.white, for: .normal)
btn_privateBtn.tag = 1 btn_privateBtn.tag = 1
btn_privateBtn.snp.makeConstraints { make in btn_privateBtn.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalTo(subscribeBtn.snp.bottom).offset(16)
} }
let line = UIView() let line = UIView()
bgView.addSubview(line) bgView.addSubview(line)
line.backgroundColor = .gray line.backgroundColor = .white
line.snp.makeConstraints { make in line.snp.makeConstraints { make in
make.width.equalTo(1) make.width.equalTo(1)
make.height.equalTo(10) make.height.equalTo(10)
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.centerY.equalTo(btn_privateBtn.snp.centerY) make.centerY.equalTo(btn_privateBtn.snp.centerY)
make.left.equalTo(btn_privateBtn.snp.right).offset(30) make.left.equalTo(btn_privateBtn.snp.right).offset(19)
} }
let btn_userBtn = UIButton() let btn_userBtn = UIButton()
@ -209,43 +255,45 @@ extension MembershipVC {
btn_userBtn.addTarget(self, action: #selector(goWeb(sender: )), for: .touchUpInside) btn_userBtn.addTarget(self, action: #selector(goWeb(sender: )), for: .touchUpInside)
btn_userBtn.setTitle(NSLocalizedString("用户协议", comment: ""), for: .normal) btn_userBtn.setTitle(NSLocalizedString("用户协议", comment: ""), for: .normal)
btn_userBtn.titleLabel?.font = UIFont.systemFont(ofSize: 12) btn_userBtn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
btn_userBtn.setTitleColor(.gray, for: .normal) btn_userBtn.setTitleColor(.white, for: .normal)
btn_userBtn.tag = 2 btn_userBtn.tag = 2
btn_userBtn.snp.makeConstraints { make in btn_userBtn.snp.makeConstraints { make in
make.top.equalToSuperview() make.centerY.equalTo(btn_privateBtn.snp.centerY)
make.left.equalTo(line.snp.right).offset(30) make.left.equalTo(line.snp.right).offset(19)
} }
let subscribeBtn = UIButton()
bgView.addSubview(subscribeBtn)
subscribeBtn.addTarget(self, action: #selector(subscribeAction(sender: )), for: .touchUpInside)
subscribeBtn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16)
subscribeBtn.setTitleColor(.white, for: .normal)
subscribeBtn.setTitle(UserInfo.sharedInstance.isMemberShip ?NSLocalizedString("Membership activated", comment: "") : NSLocalizedString("Free Trail 3 Days", comment: ""), for: .normal)
subscribeBtn.backgroundColor = UserInfo.sharedInstance.isMemberShip ? .lightGray : .darkText
subscribeBtn.layer.masksToBounds = true
subscribeBtn.layer.cornerRadius = 16
subscribeBtn.isEnabled = !UserInfo.sharedInstance.isMemberShip
subscribeBtn.snp.makeConstraints { make in
make.top.equalTo(btn_privateBtn.snp.bottom).offset(20)
make.centerX.equalToSuperview()
make.height.equalTo(60)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
}
let descLabel = UILabel() let descLabel = UILabel()
bgView.addSubview(descLabel) bgView.addSubview(descLabel)
descLabel.numberOfLines = 0 descLabel.numberOfLines = 0
descLabel.font = UIFont.systemFont(ofSize: 12) // descLabel.font = UIFont.systemFont(ofSize: 10)
descLabel.textColor = .lightGray // descLabel.textColor = UIColor(r: 205, g: 205, b: 205, a: 1)
descLabel.text = NSLocalizedString("subscribDesc", comment: "") // descLabel.text = NSLocalizedString("subscribDesc", comment: "")
descLabel.textAlignment = .center
descLabel.snp.makeConstraints { make in descLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(4)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-4)
make.top.equalTo(subscribeBtn.snp.bottom).offset(20) make.top.equalTo(btn_userBtn.snp.bottom).offset(12)
} }
descLabel.textColor = UIColor(red: 0.804, green: 0.804, blue: 0.804, alpha: 1)
descLabel.font = UIFont(name: "PingFangSC-Regular", size: 10)
descLabel.lineBreakMode = .byWordWrapping
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.4
paragraphStyle.alignment = .center
descLabel.attributedText = NSMutableAttributedString(string: NSLocalizedString("subscribDesc", comment: ""), attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
return bgView return bgView
} }

View File

@ -80,15 +80,28 @@
"userSiteUrl" = "https://sapphire-mango-hvwxmh.mystrikingly.com";
"vip_topImg" = "vip_topbg_en";
"vip_buybtn" = "buybtn_en";
"vip_alreadybuybtn" = "alreadybuybtn_en";
"vip_product_week" = "product_week_en";
"vip_product_unselect_week" = "product_week_unselect_en";
"vip_product_month" = "product_month_en";
"vip_product_unselect_month" = "product_month_unselect_en";
"vip_product_year" = "product_year_en";
"vip_product_unselect_year" = "product_year_unselect_en";
"VPcamera" = "VPcamera"; "VPcamera" = "VPcamera";
"membershipdesc_1" = "Preview larger spatial videos"; "membershipdesc_1" = "Preview larger spatial videos";
"membershipdesc_2" = "Capture spatial photo"; "membershipdesc_2" = "Capture spatial photo";
"membershipdesc_3" = "Export Higher Quality"; "membershipdesc_3" = "Export Higher Quality";
"membershipdesc_4" = "No Ads"; "membershipdesc_4" = "No Ads";
"Free Trail 3 Days" = "Free Trail 3 Days"; "Free Trail 3 Days" = "Free Trail 3 Days";
"subscribDesc" = "免费试用3天,试用结束后,按照图示费用进行续费,您可以随时在Tunes Store中取消订阅.若已订阅过或已付费成功却未显示,可使用相同AppleID恢复会员.确认购买后将从iTunes账户扣款,自动续订会在到期前24小时内扣款,可前往AppleID管理页面关闭订阅."; "subscribDesc" = "Free trial for 3 days. After the trial ends, renew according to the fee shown in the picture. You can unsubscribe at any time in the Apple Store. If subscribed or successfully paid but not displayed, the same ApplelD can be used to restore membership. After confirming the purchase, the payment will be deducted from your account. Automatic renewal will be deducted before the expiration date. You can go to the ApplelD management page to close the subscription.";
"用户协议" = "用户协议"; "用户协议" = "用户协议";
"userSiteUrl" = "https://sapphire-mango-hvwxmh.mystrikingly.com";
"Membership activated" = "Membership activated"; "Membership activated" = "Membership activated";
"restorevip" = "Restore"; "restorevip" = "Restore";

View File

@ -82,14 +82,26 @@
"userSiteUrl" = "https://cyan-camel-1d1v3n.mysxl.cn/";
"vip_topImg" = "vip_topbg_zh";
"vip_buybtn" = "buybtn_zh";
"vip_alreadybuybtn" = "alreadybuybtn_zh";
"vip_product_week" = "product_week_zh";
"vip_product_unselect_week" = "product_week_unselect_zh";
"vip_product_month" = "product_month_zh";
"vip_product_unselect_month" = "product_month_unselect_zh";
"vip_product_year" = "product_year_zh";
"vip_product_unselect_year" = "product_year_unselect_zh";
"VPcamera" = "VPcamera"; "VPcamera" = "VPcamera";
"membershipdesc_1" = "Preview larger spatial videos"; "membershipdesc_1" = "Preview larger spatial videos";
"membershipdesc_2" = "Capture spatial photo"; "membershipdesc_2" = "Capture spatial photo";
"membershipdesc_3" = "Export Higher Quality"; "membershipdesc_3" = "Export Higher Quality";
"membershipdesc_4" = "No Ads"; "membershipdesc_4" = "No Ads";
"Free Trail 3 Days" = "Free Trail 3 Days"; "Free Trail 3 Days" = "Free Trail 3 Days";
"subscribDesc" = "免费试用3天,试用结束后,按照图示费用进行续费,您可以随时在Tunes Store中取消订阅.若已订阅过或已付费成功却未显示,可使用相同AppleID恢复会员.确认购买后将从iTunes账户扣款,自动续订会在到期前24小时内扣款,可前往AppleID管理页面关闭订阅."; "subscribDesc" = "免费试用3天试用结束后按照图示费用进行续费您可以随时在Apple Store中取消订阅。若已订阅过或已付款成功却未显示可使用相同ApplelD恢复会员。确认购买后将从您的账户扣款自动续订会在到期前扣款可前往ApplelD管理页面关闭订阅。";
"用户协议" = "用户协议"; "用户协议" = "用户协议";
"userSiteUrl" = "https://cyan-camel-1d1v3n.mysxl.cn/";
"Membership activated" = "Membership activated"; "Membership activated" = "Membership activated";
"restorevip" = "恢复购买"; "restorevip" = "恢复购买";