|
@@ -27,11 +27,11 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
|
|
|
|
|
self.updateServiceLabelText(showSubscribe: false)
|
|
self.updateServiceLabelText(showSubscribe: false)
|
|
|
|
|
|
|
|
- if(QSLBaseManager.shared.isLogin()){
|
|
|
|
|
- self.naviResumeBtn.isHidden = true
|
|
|
|
|
- }else{
|
|
|
|
|
- self.naviResumeBtn.isHidden = true
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if(QSLBaseManager.shared.isLogin()){
|
|
|
|
|
+// self.naviResumeBtn.isHidden = false
|
|
|
|
|
+// }else{
|
|
|
|
|
+// self.naviResumeBtn.isHidden = true
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@objc func privacyAction() {
|
|
@objc func privacyAction() {
|
|
@@ -59,7 +59,9 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@objc func payBtnAction() {
|
|
@objc func payBtnAction() {
|
|
|
-
|
|
|
|
|
|
|
+ if let curGood = self.selectGood {
|
|
|
|
|
+ QSLCountdownManager.shared.selectGood = curGood
|
|
|
|
|
+ }
|
|
|
switch self.selectGood?.level {
|
|
switch self.selectGood?.level {
|
|
|
case 100 :
|
|
case 100 :
|
|
|
gravityInstance?.track(QSLGravityConst.activity_vip_click, properties: ["package_type": "day"])
|
|
gravityInstance?.track(QSLGravityConst.activity_vip_click, properties: ["package_type": "day"])
|
|
@@ -92,14 +94,14 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if goodList.count > 0, let selectGood = self.selectGood {
|
|
if goodList.count > 0, let selectGood = self.selectGood {
|
|
|
- QSLLoading.show()
|
|
|
|
|
|
|
+ QSLLoading.showWithCancel()
|
|
|
QSLVipManager.shared.startPay(goods: selectGood) { [self] status, outTradeNo in
|
|
QSLVipManager.shared.startPay(goods: selectGood) { [self] status, outTradeNo in
|
|
|
QSLVipManager.shared.isPaying = false
|
|
QSLVipManager.shared.isPaying = false
|
|
|
if status == .success {
|
|
if status == .success {
|
|
|
QSLLoading.success(text: "支付成功")
|
|
QSLLoading.success(text: "支付成功")
|
|
|
|
|
|
|
|
//弹出是否好评的弹窗
|
|
//弹出是否好评的弹窗
|
|
|
- QSLGuideusersToCommentManager.commentShare.manageWhetherTriggerPopUpWindow(QSLGuideusersToCommentType.member)
|
|
|
|
|
|
|
+ //QSLGuideusersToCommentManager.commentShare.manageWhetherTriggerPopUpWindow(QSLGuideusersToCommentType.member)
|
|
|
|
|
|
|
|
// 引力传递支付事件
|
|
// 引力传递支付事件
|
|
|
if let selectGood = self.selectGood {
|
|
if let selectGood = self.selectGood {
|
|
@@ -117,6 +119,10 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
|
|
self.navigationController?.popViewController(animated: true)
|
|
self.navigationController?.popViewController(animated: true)
|
|
|
NotificationCenter.default.post(name: QSLNotification.QSLRefreshMember, object: nil)
|
|
NotificationCenter.default.post(name: QSLNotification.QSLRefreshMember, object: nil)
|
|
|
|
|
+
|
|
|
|
|
+ if(!QSLBaseManager.shared.isLogin()){
|
|
|
|
|
+ QSLJumpManager.shared.pushToLogin(type: .member)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} else if status == .cancel {
|
|
} else if status == .cancel {
|
|
@@ -130,8 +136,6 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
QSLLoading.error(text: "支付失败")
|
|
QSLLoading.error(text: "支付失败")
|
|
|
// payFailAlertTip()
|
|
// payFailAlertTip()
|
|
|
self.isCancel = true
|
|
self.isCancel = true
|
|
|
- } else if status == .searchFail {
|
|
|
|
|
- QSLLoading.error(text: "查询订单失败,请稍后重试")
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -174,12 +178,11 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
height = Int(134.rpx + CGFloat(remainingRows) * 124.rpx)
|
|
height = Int(134.rpx + CGFloat(remainingRows) * 124.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- self.vipItemView.snp.updateConstraints { make in
|
|
|
|
|
|
|
+ self.goodsCollectionView.snp.updateConstraints { make in
|
|
|
make.height.equalTo(height)
|
|
make.height.equalTo(height)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- self.view.layoutIfNeeded()
|
|
|
|
|
- self.scrollView.contentSize = CGSize(width: 0.0, height: self.vipItemView.qsl_y+CGFloat(height)+100+QSLConst.qsl_kTabbarBottom/2+12)
|
|
|
|
|
|
|
+ self.scrollView.contentSize = CGSize(width: 0.0, height: self.goodsCollectionView.qsl_y+CGFloat(height)+100+QSLConst.qsl_kTabbarBottom/2+12)
|
|
|
|
|
|
|
|
QSLCountdownManager.shared.selectGood = self.goodList[0]
|
|
QSLCountdownManager.shared.selectGood = self.goodList[0]
|
|
|
|
|
|
|
@@ -371,11 +374,6 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
return button
|
|
return button
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
- lazy var vipBg: UIView = {
|
|
|
|
|
- let imageView = UIView()
|
|
|
|
|
- return imageView
|
|
|
|
|
- }()
|
|
|
|
|
-
|
|
|
|
|
lazy var vipTopBg: UIImageView = {
|
|
lazy var vipTopBg: UIImageView = {
|
|
|
let imageView = UIImageView()
|
|
let imageView = UIImageView()
|
|
|
imageView.image = UIImage(named: "vip_activity_top_bg")
|
|
imageView.image = UIImage(named: "vip_activity_top_bg")
|
|
@@ -465,11 +463,6 @@ class QSLActivityVipVC: QSLBaseController {
|
|
|
return pageControl
|
|
return pageControl
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
- lazy var vipItemView: UIView = {
|
|
|
|
|
- let item = UIView()
|
|
|
|
|
- return item
|
|
|
|
|
- }()
|
|
|
|
|
-
|
|
|
|
|
lazy var goodsCollectionView: UICollectionView = {
|
|
lazy var goodsCollectionView: UICollectionView = {
|
|
|
|
|
|
|
|
let layout = UICollectionViewFlowLayout()
|
|
let layout = UICollectionViewFlowLayout()
|
|
@@ -533,7 +526,9 @@ extension QSLActivityVipVC{
|
|
|
|
|
|
|
|
self.view.addSubview(scrollView)
|
|
self.view.addSubview(scrollView)
|
|
|
scrollView.snp.makeConstraints { make in
|
|
scrollView.snp.makeConstraints { make in
|
|
|
- make.bottom.top.left.right.equalTo(0)
|
|
|
|
|
|
|
+ make.top.left.equalTo(0)
|
|
|
|
|
+ make.width.equalTo(QSLConst.qsl_kScreenW)
|
|
|
|
|
+ make.height.equalTo(QSLConst.qsl_kScreenH)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
self.view.addSubview(vipNaviView)
|
|
self.view.addSubview(vipNaviView)
|
|
@@ -565,15 +560,10 @@ extension QSLActivityVipVC{
|
|
|
make.centerY.equalTo(backButton.snp.centerY)
|
|
make.centerY.equalTo(backButton.snp.centerY)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- self.scrollView.addSubview(vipBg)
|
|
|
|
|
- vipBg.snp.makeConstraints { make in
|
|
|
|
|
- make.top.bottom.left.equalTo(0)
|
|
|
|
|
- make.width.equalTo(QSLConst.qsl_kScreenW)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- vipBg.addSubview(vipTopBg)
|
|
|
|
|
|
|
+ self.scrollView.addSubview(vipTopBg)
|
|
|
vipTopBg.snp.makeConstraints { make in
|
|
vipTopBg.snp.makeConstraints { make in
|
|
|
- make.left.top.right.equalTo(0)
|
|
|
|
|
|
|
+ make.left.top.equalTo(0)
|
|
|
|
|
+ make.width.equalTo(QSLConst.qsl_kScreenW)
|
|
|
make.height.equalTo(185.rpx)
|
|
make.height.equalTo(185.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -593,11 +583,12 @@ extension QSLActivityVipVC{
|
|
|
make.width.equalTo(105.rpx)
|
|
make.width.equalTo(105.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- vipBg.addSubview(vipContentView)
|
|
|
|
|
|
|
+ self.scrollView.addSubview(vipContentView)
|
|
|
vipContentView.snp.makeConstraints { make in
|
|
vipContentView.snp.makeConstraints { make in
|
|
|
make.top.equalTo(185.rpx)
|
|
make.top.equalTo(185.rpx)
|
|
|
- make.left.right.equalTo(0.rpx)
|
|
|
|
|
- make.height.equalTo(QSLConst.qsl_kScreenH)
|
|
|
|
|
|
|
+ make.left.equalTo(0)
|
|
|
|
|
+ make.width.equalTo(QSLConst.qsl_kScreenW)
|
|
|
|
|
+ make.height.equalTo(230.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
vipContentView.addSubview(addTitleIconBg)
|
|
vipContentView.addSubview(addTitleIconBg)
|
|
@@ -628,24 +619,14 @@ extension QSLActivityVipVC{
|
|
|
make.top.equalTo(cycleScrollView.snp.bottom).offset(17.rpx)
|
|
make.top.equalTo(cycleScrollView.snp.bottom).offset(17.rpx)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- vipContentView.snp.remakeConstraints { make in
|
|
|
|
|
- make.top.equalTo(185.rpx)
|
|
|
|
|
- make.left.right.equalTo(0.rpx)
|
|
|
|
|
- make.bottom.equalTo(pageControl.snp.bottom).offset(10.rpx) // 这里只约束到 pageControl 的底部
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- vipBg.addSubview(vipItemView)
|
|
|
|
|
- vipItemView.snp.makeConstraints { make in
|
|
|
|
|
- make.left.right.equalTo(0)
|
|
|
|
|
|
|
+ self.scrollView.addSubview(goodsCollectionView)
|
|
|
|
|
+ goodsCollectionView.snp.makeConstraints { make in
|
|
|
|
|
+ make.left.equalTo(0)
|
|
|
make.height.equalTo(150.rpx)
|
|
make.height.equalTo(150.rpx)
|
|
|
|
|
+ make.width.equalTo(QSLConst.qsl_kScreenW)
|
|
|
make.top.equalTo(vipContentView.snp.bottom).offset(0)
|
|
make.top.equalTo(vipContentView.snp.bottom).offset(0)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- vipItemView.addSubview(goodsCollectionView)
|
|
|
|
|
- goodsCollectionView.snp.makeConstraints { make in
|
|
|
|
|
- make.left.right.top.bottom.equalTo(0)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
self.view.addSubview(bottomView)
|
|
self.view.addSubview(bottomView)
|
|
|
bottomView.snp.makeConstraints { make in
|
|
bottomView.snp.makeConstraints { make in
|
|
|
make.right.equalTo(-12.rpx)
|
|
make.right.equalTo(-12.rpx)
|