v1.3版本
This commit is contained in:
parent
f5c7278a92
commit
af1d9644a7
@ -1005,7 +1005,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.2;
|
||||
MARKETING_VERSION = 1.3;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.nsk.tdvideo;
|
||||
@ -1057,7 +1057,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.2;
|
||||
MARKETING_VERSION = 1.3;
|
||||
OTHER_CFLAGS = "";
|
||||
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.nsk.tdvideo;
|
||||
|
||||
Binary file not shown.
@ -14,8 +14,8 @@
|
||||
filePath = "SwiftProject/Project/Controller/CCHomeController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "525"
|
||||
endingLineNumber = "525"
|
||||
startingLineNumber = "547"
|
||||
endingLineNumber = "547"
|
||||
landmarkName = "imagePickerController(_:didFinishPickingMediaWithInfo:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
@ -30,8 +30,8 @@
|
||||
filePath = "SwiftProject/Project/Controller/CCHomeController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "517"
|
||||
endingLineNumber = "517"
|
||||
startingLineNumber = "539"
|
||||
endingLineNumber = "539"
|
||||
landmarkName = "CCHomeController"
|
||||
landmarkType = "21">
|
||||
</BreakpointContent>
|
||||
@ -94,8 +94,8 @@
|
||||
filePath = "SwiftProject/Project/Controller/CCHomeController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "481"
|
||||
endingLineNumber = "481"
|
||||
startingLineNumber = "503"
|
||||
endingLineNumber = "503"
|
||||
landmarkName = "gotoVideoTransformVC(url:asset:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
@ -387,8 +387,8 @@
|
||||
filePath = "SwiftProject/Project/Controller/RecordingVideo/CCSpatialShootController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "1156"
|
||||
endingLineNumber = "1156"
|
||||
startingLineNumber = "1166"
|
||||
endingLineNumber = "1166"
|
||||
landmarkName = "compositeSpatialPhoto()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
@ -649,5 +649,53 @@
|
||||
</Locations>
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "A75FADE4-2597-4B33-9B75-E45F1621CEBA"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "SwiftProject/CCKit/SKUPay/SKUPay.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "182"
|
||||
endingLineNumber = "182"
|
||||
landmarkName = "paymentQueueRestoreCompletedTransactionsFinished(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "93862009-B264-419C-BC59-393559A7F11A"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "SwiftProject/CCKit/SKUPay/SKUPay.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "149"
|
||||
endingLineNumber = "149"
|
||||
landmarkName = "paymentQueue(_:updatedTransactions:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "E345D42C-5AC2-4E3C-8244-EF0708B3645F"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "SwiftProject/Project/View/Album/CCSpaceAlbumFliterPopView/CCSpaceAlbumFilterPopView2.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "458"
|
||||
endingLineNumber = "458"
|
||||
landmarkName = "collectionView(_:cellForItemAt:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
||||
@ -46,9 +46,13 @@ class BaseVirtualController: UIViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(userVipStateChangeNotification(noti:)), name: Notification.Name(rawValue: "kUserVipStateChangeNotification"), object: nil)
|
||||
}
|
||||
|
||||
//用户vip身份改变
|
||||
@objc func userVipStateChangeNotification(noti:Notification) {
|
||||
print("父类收到的vip通知...")
|
||||
}
|
||||
|
||||
//=========================================
|
||||
//设置导航栏部分
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
import StoreKit
|
||||
|
||||
import SVProgressHUD
|
||||
//MARK: - 将货币信息格式化为本地信息
|
||||
extension SKProduct {
|
||||
var regularPrice: String? {
|
||||
@ -43,10 +43,15 @@ class SKUPay:NSObject, SKRequestDelegate,SKProductsRequestDelegate,SKPaymentTran
|
||||
|
||||
UserDefaults.standard.setValue(arr, forKey: "kHistoryTransaction")
|
||||
UserDefaults.standard.synchronize()
|
||||
setUpUserInfo()
|
||||
}
|
||||
|
||||
//此处初始化用户信息
|
||||
func setUpUserInfo() {
|
||||
//test ----
|
||||
// UserDefaults.standard.setValue(nil, forKey: "kHistoryTransaction")
|
||||
// UserDefaults.standard.synchronize()
|
||||
//test+++++
|
||||
let arr:[Any]? = UserDefaults.standard.value(forKey: "kHistoryTransaction") as? [Any] ?? nil
|
||||
guard let arr else {
|
||||
return
|
||||
@ -92,6 +97,7 @@ class SKUPay:NSObject, SKRequestDelegate,SKProductsRequestDelegate,SKPaymentTran
|
||||
if let pd = product {
|
||||
let payment = SKPayment(product: pd)
|
||||
SKPaymentQueue.default().add(payment)
|
||||
showToast(value: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -99,7 +105,17 @@ class SKUPay:NSObject, SKRequestDelegate,SKProductsRequestDelegate,SKPaymentTran
|
||||
//MARK: - 恢复购买
|
||||
func restoreProducts() {
|
||||
SKPaymentQueue.default().restoreCompletedTransactions()
|
||||
|
||||
showToast(value: true)
|
||||
}
|
||||
|
||||
//是否显示加载信息...
|
||||
func showToast(value:Bool) {
|
||||
if value {
|
||||
SVProgressHUD.show(withStatus: NSLocalizedString("支付中...", comment: ""))
|
||||
}
|
||||
else {
|
||||
SVProgressHUD.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -135,9 +151,14 @@ class SKUPay:NSObject, SKRequestDelegate,SKProductsRequestDelegate,SKPaymentTran
|
||||
self.setTransactionDic(transactions: transactions)
|
||||
|
||||
transactions.forEach { spt in
|
||||
|
||||
if spt.transactionState == .purchased || spt.transactionState == .restored {
|
||||
queue.finishTransaction(spt)
|
||||
}
|
||||
print("updatedTransactions ..\(spt)")
|
||||
}
|
||||
}
|
||||
|
||||
print("updatedTransactions ..")
|
||||
}
|
||||
|
||||
|
||||
@ -149,30 +170,33 @@ class SKUPay:NSObject, SKRequestDelegate,SKProductsRequestDelegate,SKPaymentTran
|
||||
|
||||
// Sent when an error is encountered while adding transactions from the user's purchase history back to the queue.
|
||||
func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error){
|
||||
|
||||
print("restoreCompletedTransactionsFailedWithError...")
|
||||
showToast(value: false)
|
||||
}
|
||||
|
||||
|
||||
// Sent when all transactions from the user's purchase history have successfully been added back to the queue.
|
||||
func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue){
|
||||
// queue.transactions
|
||||
print("paymentQueueRestoreCompletedTransactionsFinished...")
|
||||
showToast(value: false)
|
||||
}
|
||||
|
||||
// Sent when a user initiates an IAP buy from the App Store
|
||||
func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool{
|
||||
return true
|
||||
}
|
||||
// func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool{
|
||||
// return true
|
||||
// }
|
||||
|
||||
|
||||
func paymentQueueDidChangeStorefront(_ queue: SKPaymentQueue){
|
||||
|
||||
print("paymentQueueDidChangeStorefront..")
|
||||
}
|
||||
|
||||
|
||||
// Sent when entitlements for a user have changed and access to the specified IAPs has been revoked.
|
||||
|
||||
func paymentQueue(_ queue: SKPaymentQueue, didRevokeEntitlementsForProductIdentifiers productIdentifiers: [String]){
|
||||
|
||||
print("didRevokeEntitlementsForProductIdentifiers..")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,7 +8,11 @@
|
||||
import Foundation
|
||||
class UserInfo: NSObject {
|
||||
static let sharedInstance = UserInfo()
|
||||
var paymentState:Bool = false
|
||||
var paymentState:Bool = false {
|
||||
didSet{
|
||||
NotificationCenter.default.post(name: Notification.Name(rawValue: "kUserVipStateChangeNotification"), object: self, userInfo:nil)
|
||||
}
|
||||
}
|
||||
var paymentProductIdentifier:String? //表示已购买的产品id
|
||||
var isMemberShip:Bool {
|
||||
get {
|
||||
|
||||
@ -346,6 +346,17 @@ class CCHomeController: BaseController, LLCycleScrollViewDelegate,MFMailComposeV
|
||||
}
|
||||
//选择视频
|
||||
view.selectedVideoHandler = {[weak self] url,asset in
|
||||
if (asset.duration > 60 ) {
|
||||
if !UserInfo.sharedInstance.isMemberShip {
|
||||
let vc:MembershipVC = MembershipVC()
|
||||
let nav = UINavigationController(rootViewController: vc)
|
||||
nav.modalTransitionStyle = UIModalTransitionStyle.coverVertical
|
||||
nav.modalPresentationStyle = .fullScreen
|
||||
self?.present(nav, animated: true)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let vc = CCSpatialVideoDisplayController()
|
||||
vc.sourceVideoURL = url
|
||||
vc.videoOriginalPHAsset = asset
|
||||
@ -460,8 +471,19 @@ extension CCHomeController: TZImagePickerControllerDelegate,UINavigationControll
|
||||
gotoPhotoTransformVC(data: data, url: nil,asset: asset)
|
||||
}
|
||||
//选择视频
|
||||
spaceAlbumPopView.selectedVideoHandler = { [self] url,asset in
|
||||
gotoVideoTransformVC(url: url,asset: asset)
|
||||
spaceAlbumPopView.selectedVideoHandler = { [weak self] url,asset in
|
||||
if (asset.duration > 60 ) {
|
||||
if !UserInfo.sharedInstance.isMemberShip {
|
||||
let vc:MembershipVC = MembershipVC()
|
||||
let nav = UINavigationController(rootViewController: vc)
|
||||
nav.modalTransitionStyle = UIModalTransitionStyle.coverVertical
|
||||
nav.modalPresentationStyle = .fullScreen
|
||||
self?.present(nav, animated: true)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
self?.gotoVideoTransformVC(url: url,asset: asset)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,8 @@ import Foundation
|
||||
import UIKit
|
||||
class MembershipVC: BaseController {
|
||||
var pvView:MembershipProductView?
|
||||
var pcenterView:UIView?
|
||||
var psubscribeBtn:UIButton?
|
||||
var selectedItem:MemberShipModelItem?
|
||||
lazy var mTopImgView:UIImageView = {
|
||||
//393*236
|
||||
@ -24,7 +26,24 @@ class MembershipVC: BaseController {
|
||||
self.configureData()
|
||||
}
|
||||
|
||||
|
||||
//用户vip身份改变
|
||||
@objc override func userVipStateChangeNotification(noti:Notification) {
|
||||
print("子类收到通知收到的vip通知...")
|
||||
if UserInfo.sharedInstance.isMemberShip {
|
||||
if let h = pcenterView?.isHidden, h == false {
|
||||
pcenterView?.snp.updateConstraints({ make in
|
||||
make.height.equalTo(0)
|
||||
})
|
||||
pcenterView?.superview?.layoutIfNeeded()
|
||||
pcenterView?.isHidden = true
|
||||
rightBtn1?.isHidden = true
|
||||
psubscribeBtn?.setBackgroundImage(UIImage(named: NSLocalizedString("vip_alreadybuybtn", comment: "")), for: .normal)
|
||||
psubscribeBtn?.isEnabled = false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
|
||||
@ -16,16 +16,30 @@ extension MembershipVC {
|
||||
self.setLeftOneBtnImg(imgStr: "membership_close")
|
||||
self.leftBtn1?.addTarget(self, action: #selector(dismissVC(sender: )), for: .touchUpInside)
|
||||
// self.setRightOneBtnImg(imgStr: "Icon_PopUp_Icon_Folder")
|
||||
self.rightBtn1?.addTarget(self, action: #selector(rebuyMembership(sender: )), for: .touchUpInside)
|
||||
// self.rightBtn1?.addTarget(self, action: #selector(rebuyMembership(sender: )), for: .touchUpInside)
|
||||
self.setRightOneBtnTitle(string: NSLocalizedString("restorevip", comment: "") as NSString)
|
||||
self.rightBtn1?.isHidden = UserInfo.sharedInstance.isMemberShip
|
||||
// self.rightBtn1?.isHidden = UserInfo.sharedInstance.isMemberShip
|
||||
// self.rightBtn1?.isEnabled = true
|
||||
|
||||
rightBtn1 = UIButton.init(type: UIButton.ButtonType.custom)
|
||||
rightBtn1?.isHidden = UserInfo.sharedInstance.isMemberShip
|
||||
navtionBar?.addSubview(rightBtn1!)
|
||||
rightBtn1?.tag = 10
|
||||
rightBtn1?.isSelected = false
|
||||
rightBtn1?.addTarget(self, action: #selector(rebuyMembership(sender: )), for: .touchUpInside)
|
||||
rightBtn1?.setTitle(NSLocalizedString("restorevip", comment: ""), for: .normal)
|
||||
rightBtn1?.frame = CGRect(x: 2, y: 10, width: 76, height: 56)
|
||||
rightBtn1!.centerY = StatuBar_Height + NavBar_Height * 0.5
|
||||
rightBtn1!.right = SCREEN_Width - 6
|
||||
|
||||
|
||||
self.view.addSubview(mTopImgView)
|
||||
|
||||
let topView = self.topView()
|
||||
self.view.addSubview(topView)
|
||||
topView.snp.makeConstraints { make in
|
||||
make.left.right.equalTo(0)
|
||||
make.top.equalToSuperview().offset(80)
|
||||
make.top.equalToSuperview().offset(120)
|
||||
make.height.equalTo(254)
|
||||
}
|
||||
|
||||
@ -57,6 +71,8 @@ extension MembershipVC {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@objc func dismissVC(sender:UIButton) {
|
||||
self.dismiss(animated: true)
|
||||
|
||||
@ -69,7 +85,8 @@ extension MembershipVC {
|
||||
|
||||
//恢复购买
|
||||
@objc func rebuyMembership(sender:UIButton) {
|
||||
|
||||
print("......click 恢复购买")
|
||||
SKUPay.sharedInstance.restoreProducts()
|
||||
}
|
||||
|
||||
func topView() -> UIView {
|
||||
@ -161,6 +178,7 @@ extension MembershipVC {
|
||||
|
||||
func centerView() -> UIView {
|
||||
let bgView = UIView()
|
||||
pcenterView = bgView
|
||||
bgView.backgroundColor = .clear
|
||||
pvView = MembershipProductView(frame: .zero)
|
||||
bgView.addSubview(pvView!)
|
||||
@ -207,6 +225,7 @@ extension MembershipVC {
|
||||
bgView.backgroundColor = .clear
|
||||
|
||||
let subscribeBtn = UIButton()
|
||||
psubscribeBtn = subscribeBtn
|
||||
bgView.addSubview(subscribeBtn)
|
||||
subscribeBtn.addTarget(self, action: #selector(subscribeAction(sender: )), for: .touchUpInside)
|
||||
subscribeBtn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16)
|
||||
|
||||
@ -565,6 +565,16 @@ class CCSpatialShootController: BaseController {
|
||||
}
|
||||
//选择视频
|
||||
spaceAlbumPopView.selectedVideoHandler = { url,asset in
|
||||
if (asset.duration > 60 ) {
|
||||
if !UserInfo.sharedInstance.isMemberShip {
|
||||
let vc:MembershipVC = MembershipVC()
|
||||
let nav = UINavigationController(rootViewController: vc)
|
||||
nav.modalTransitionStyle = UIModalTransitionStyle.coverVertical
|
||||
nav.modalPresentationStyle = .fullScreen
|
||||
self.present(nav, animated: true)
|
||||
return
|
||||
}
|
||||
}
|
||||
let vc = CCSpatialVideoDisplayController()
|
||||
vc.sourceVideoURL = url
|
||||
vc.videoOriginalPHAsset = asset
|
||||
|
||||
@ -104,4 +104,4 @@
|
||||
"用户协议" = "Terms of Service";
|
||||
"Membership activated" = "Membership activated";
|
||||
"restorevip" = "Restore";
|
||||
|
||||
"支付中..." = "Paying...";
|
||||
|
||||
@ -104,4 +104,4 @@
|
||||
"用户协议" = "用户协议";
|
||||
"Membership activated" = "Membership activated";
|
||||
"restorevip" = "恢复购买";
|
||||
|
||||
"支付中..." = "支付中...";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user