1
This commit is contained in:
parent
318a4d9b7e
commit
dac985f177
@ -215,6 +215,8 @@
|
||||
F39855A32E38D25900E2D28D /* BRWaitRestoreModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39855A22E38D25900E2D28D /* BRWaitRestoreModel.swift */; };
|
||||
F39855A52E38D2A800E2D28D /* BRIAP.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39855A42E38D2A800E2D28D /* BRIAP.swift */; };
|
||||
F39855A72E38EE9800E2D28D /* BRRechargeRecordModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39855A62E38EE9800E2D28D /* BRRechargeRecordModel.swift */; };
|
||||
F39855A92E39AD7300E2D28D /* BRConsumptionRecordsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39855A82E39AD7300E2D28D /* BRConsumptionRecordsModel.swift */; };
|
||||
F39855AB2E39ADEF00E2D28D /* BRRewardCoinRecordModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39855AA2E39ADEF00E2D28D /* BRRewardCoinRecordModel.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -441,6 +443,8 @@
|
||||
F39855A22E38D25900E2D28D /* BRWaitRestoreModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRWaitRestoreModel.swift; sourceTree = "<group>"; };
|
||||
F39855A42E38D2A800E2D28D /* BRIAP.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRIAP.swift; sourceTree = "<group>"; };
|
||||
F39855A62E38EE9800E2D28D /* BRRechargeRecordModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRRechargeRecordModel.swift; sourceTree = "<group>"; };
|
||||
F39855A82E39AD7300E2D28D /* BRConsumptionRecordsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRConsumptionRecordsModel.swift; sourceTree = "<group>"; };
|
||||
F39855AA2E39ADEF00E2D28D /* BRRewardCoinRecordModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRRewardCoinRecordModel.swift; sourceTree = "<group>"; };
|
||||
F70FA1F4169364C4C53534CE /* Pods-BeeReel.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BeeReel.release.xcconfig"; path = "Target Support Files/Pods-BeeReel/Pods-BeeReel.release.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
@ -1200,6 +1204,8 @@
|
||||
F398553D2E336D3000E2D28D /* BRPayDateModel.swift */,
|
||||
F39855532E34A49500E2D28D /* BRPayDataRequest.swift */,
|
||||
F39855A62E38EE9800E2D28D /* BRRechargeRecordModel.swift */,
|
||||
F39855A82E39AD7300E2D28D /* BRConsumptionRecordsModel.swift */,
|
||||
F39855AA2E39ADEF00E2D28D /* BRRewardCoinRecordModel.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@ -1428,6 +1434,7 @@
|
||||
F398554A2E33929C00E2D28D /* BRStoreCoinCell.swift in Sources */,
|
||||
F39855842E37705700E2D28D /* AppDelegate+Thirdparty.swift in Sources */,
|
||||
BF3A568C2E30EBA2009E5CF9 /* BRHomePlayRecordButton.swift in Sources */,
|
||||
F39855A92E39AD7300E2D28D /* BRConsumptionRecordsModel.swift in Sources */,
|
||||
BF692B162E0A7CD600A5C2DA /* BRHUD.swift in Sources */,
|
||||
BF3338F72E16176900B10F76 /* BRDetailPlayerCell.swift in Sources */,
|
||||
BF3338EA2E152B8100B10F76 /* BRPlayerCache.swift in Sources */,
|
||||
@ -1447,6 +1454,7 @@
|
||||
BF692AEC2E0A475D00A5C2DA /* SceneDelegate.swift in Sources */,
|
||||
BF692B492E0A9D0E00A5C2DA /* UIView+BRAdd.swift in Sources */,
|
||||
BF02B7F82E2F211A00172177 /* BRHomeCategoriesMainCell.swift in Sources */,
|
||||
F39855AB2E39ADEF00E2D28D /* BRRewardCoinRecordModel.swift in Sources */,
|
||||
F398559C2E38CF9700E2D28D /* JXIAPManager.swift in Sources */,
|
||||
BF02B8192E2F8B1100172177 /* BRMineCell.swift in Sources */,
|
||||
BFC676812E122733006659E5 /* BRPlayerProtocol.swift in Sources */,
|
||||
@ -1595,6 +1603,7 @@
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
|
||||
INFOPLIST_KEY_UIMainStoryboardFile = "";
|
||||
INFOPLIST_KEY_UIRequiredDeviceCapabilities = arm64;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
@ -1635,6 +1644,7 @@
|
||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
|
||||
INFOPLIST_KEY_UIMainStoryboardFile = "";
|
||||
INFOPLIST_KEY_UIRequiredDeviceCapabilities = arm64;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
|
||||
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
|
@ -90,4 +90,31 @@ class BRStoreAPI {
|
||||
completer?(response.data)
|
||||
}
|
||||
}
|
||||
|
||||
///消费记录
|
||||
static func requestConsumptionRecords(page: Int, completer: ((_ listModel: BRListModel<BRConsumptionRecordsModel>?) -> Void)?) {
|
||||
var param = BRNetworkParameters(path: "/getCustomerBuyRecords")
|
||||
param.method = .get
|
||||
param.parameters = [
|
||||
"page_size" : 20,
|
||||
"current_page" : page,
|
||||
]
|
||||
|
||||
BRNetwork.request(parameters: param) { (response: BRNetworkResponse<BRListModel<BRConsumptionRecordsModel>>) in
|
||||
completer?(response.data)
|
||||
}
|
||||
}
|
||||
|
||||
///赠币记录
|
||||
static func reuqestGiveCoinRecords(page: Int, completer: ((_ listModel: BRListModel<BRRewardCoinRecordModel>?) -> Void)?) {
|
||||
|
||||
var param = BRNetworkParameters(path: "/sendCoinList")
|
||||
param.parameters = [
|
||||
"page_size" : 20,
|
||||
"current_page" : page
|
||||
]
|
||||
BRNetwork.request(parameters: param) { (response: BRNetworkResponse<BRListModel<BRRewardCoinRecordModel>>) in
|
||||
completer?(response.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,11 @@
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.associated-domains</key>
|
||||
<array/>
|
||||
<array>
|
||||
<string>applinks:beereel.go.link</string>
|
||||
<string>applinks:www.breeltv.com</string>
|
||||
<string>applinks:jyev.adj.st</string>
|
||||
</array>
|
||||
<key>keychain-access-groups</key>
|
||||
<array/>
|
||||
</dict>
|
||||
|
@ -26,6 +26,7 @@ class BRCoinOrderRecordViewController: BRViewController, WMZPageProtocol {
|
||||
collectionView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0)
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
collectionView.ly_emptyView = BREmpty.br_normalEmptyView()
|
||||
collectionView.br_addRefreshBackFooter(insetBottom: collectionView.contentInset.bottom) { [weak self] in
|
||||
self?.handleFooterRefresh(nil)
|
||||
}
|
||||
|
@ -9,6 +9,11 @@ import UIKit
|
||||
|
||||
class BRConsumptionRecordViewController: BRViewController, WMZPageProtocol {
|
||||
|
||||
|
||||
private lazy var listArr: [BRConsumptionRecordsModel] = []
|
||||
private lazy var page = 1
|
||||
|
||||
|
||||
private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
|
||||
let layout = UICollectionViewFlowLayout()
|
||||
layout.itemSize = .init(width: UIScreen.width - 30, height: 80)
|
||||
@ -22,6 +27,7 @@ class BRConsumptionRecordViewController: BRViewController, WMZPageProtocol {
|
||||
collectionView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0)
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
collectionView.ly_emptyView = BREmpty.br_normalEmptyView()
|
||||
collectionView.br_addRefreshBackFooter(insetBottom: collectionView.contentInset.bottom) { [weak self] in
|
||||
self?.handleFooterRefresh(nil)
|
||||
}
|
||||
@ -34,6 +40,8 @@ class BRConsumptionRecordViewController: BRViewController, WMZPageProtocol {
|
||||
self.view.backgroundColor = .colorFFFFFF()
|
||||
|
||||
br_setupUI()
|
||||
|
||||
requestDataList(page: 1, completer: nil)
|
||||
}
|
||||
|
||||
func getMyScrollView() -> UIScrollView {
|
||||
@ -41,11 +49,15 @@ class BRConsumptionRecordViewController: BRViewController, WMZPageProtocol {
|
||||
}
|
||||
|
||||
override func handleHeaderRefresh(_ completer: (() -> Void)?) {
|
||||
completer?()
|
||||
self.requestDataList(page: 1) {
|
||||
completer?()
|
||||
}
|
||||
}
|
||||
|
||||
override func handleFooterRefresh(_ completer: (() -> Void)?) {
|
||||
self.collectionView.br_endFooterRefreshing()
|
||||
self.requestDataList(page: self.page + 1) { [weak self] in
|
||||
self?.collectionView.br_endFooterRefreshing()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,10 +77,31 @@ extension BRConsumptionRecordViewController {
|
||||
extension BRConsumptionRecordViewController: UICollectionViewDelegate, UICollectionViewDataSource {
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! BRConsumptionRecordCell
|
||||
cell.model = self.listArr[indexPath.row]
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return 10
|
||||
return self.listArr.count
|
||||
}
|
||||
}
|
||||
|
||||
extension BRConsumptionRecordViewController {
|
||||
|
||||
private func requestDataList(page: Int, completer: (() -> Void)?) {
|
||||
BRStoreAPI.requestConsumptionRecords(page: page) { [weak self] listModel in
|
||||
guard let self = self else { return }
|
||||
|
||||
if let list = listModel?.list {
|
||||
if page == 1 {
|
||||
self.listArr.removeAll()
|
||||
}
|
||||
self.listArr += list
|
||||
self.page = page
|
||||
self.collectionView.reloadData()
|
||||
}
|
||||
completer?()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ import UIKit
|
||||
|
||||
class BRRewardCoinsRecordViewController: BRViewController, WMZPageProtocol {
|
||||
|
||||
private lazy var listArr: [BRRewardCoinRecordModel] = []
|
||||
private lazy var page = 1
|
||||
|
||||
private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
|
||||
let layout = UICollectionViewFlowLayout()
|
||||
layout.itemSize = .init(width: UIScreen.width - 30, height: 80)
|
||||
@ -22,6 +25,7 @@ class BRRewardCoinsRecordViewController: BRViewController, WMZPageProtocol {
|
||||
collectionView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0)
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
collectionView.ly_emptyView = BREmpty.br_normalEmptyView()
|
||||
collectionView.br_addRefreshBackFooter(insetBottom: collectionView.contentInset.bottom) { [weak self] in
|
||||
self?.handleFooterRefresh(nil)
|
||||
}
|
||||
@ -34,6 +38,8 @@ class BRRewardCoinsRecordViewController: BRViewController, WMZPageProtocol {
|
||||
self.view.backgroundColor = .colorFFFFFF()
|
||||
|
||||
br_setupUI()
|
||||
|
||||
requestDataList(page: 1, completer: nil)
|
||||
}
|
||||
|
||||
func getMyScrollView() -> UIScrollView {
|
||||
@ -41,13 +47,16 @@ class BRRewardCoinsRecordViewController: BRViewController, WMZPageProtocol {
|
||||
}
|
||||
|
||||
override func handleHeaderRefresh(_ completer: (() -> Void)?) {
|
||||
completer?()
|
||||
self.requestDataList(page: 1) {
|
||||
completer?()
|
||||
}
|
||||
}
|
||||
|
||||
override func handleFooterRefresh(_ completer: (() -> Void)?) {
|
||||
self.collectionView.br_endFooterRefreshing()
|
||||
self.requestDataList(page: self.page + 1) { [weak self] in
|
||||
self?.collectionView.br_endFooterRefreshing()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension BRRewardCoinsRecordViewController {
|
||||
@ -66,10 +75,31 @@ extension BRRewardCoinsRecordViewController {
|
||||
extension BRRewardCoinsRecordViewController: UICollectionViewDelegate, UICollectionViewDataSource {
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! BRRewardCoinsRecordCell
|
||||
cell.model = listArr[indexPath.row]
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return 10
|
||||
return self.listArr.count
|
||||
}
|
||||
}
|
||||
|
||||
extension BRRewardCoinsRecordViewController {
|
||||
|
||||
private func requestDataList(page: Int, completer: (() -> Void)?) {
|
||||
BRStoreAPI.reuqestGiveCoinRecords(page: page) { [weak self] listModel in
|
||||
guard let self = self else { return }
|
||||
|
||||
if let list = listModel?.list {
|
||||
if page == 1 {
|
||||
self.listArr.removeAll()
|
||||
}
|
||||
self.listArr += list
|
||||
self.page = page
|
||||
self.collectionView.reloadData()
|
||||
}
|
||||
completer?()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,8 @@ import UIKit
|
||||
|
||||
class BRVipOrderRecordViewController: BRViewController, WMZPageProtocol {
|
||||
|
||||
|
||||
private lazy var listArr: [BRRechargeRecordModel] = []
|
||||
private lazy var page = 1
|
||||
|
||||
private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
|
||||
let layout = UICollectionViewFlowLayout()
|
||||
@ -24,6 +25,7 @@ class BRVipOrderRecordViewController: BRViewController, WMZPageProtocol {
|
||||
collectionView.contentInset = .init(top: 0, left: 0, bottom: UIScreen.tabbarSafeBottomMargin + 10, right: 0)
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
collectionView.ly_emptyView = BREmpty.br_normalEmptyView()
|
||||
collectionView.br_addRefreshBackFooter(insetBottom: collectionView.contentInset.bottom) { [weak self] in
|
||||
self?.handleFooterRefresh(nil)
|
||||
}
|
||||
@ -36,6 +38,8 @@ class BRVipOrderRecordViewController: BRViewController, WMZPageProtocol {
|
||||
self.view.backgroundColor = .colorFFFFFF()
|
||||
|
||||
br_setupUI()
|
||||
|
||||
requestDataList(page: 1, completer: nil)
|
||||
}
|
||||
|
||||
func getMyScrollView() -> UIScrollView {
|
||||
@ -43,11 +47,15 @@ class BRVipOrderRecordViewController: BRViewController, WMZPageProtocol {
|
||||
}
|
||||
|
||||
override func handleHeaderRefresh(_ completer: (() -> Void)?) {
|
||||
completer?()
|
||||
self.requestDataList(page: 1) {
|
||||
completer?()
|
||||
}
|
||||
}
|
||||
|
||||
override func handleFooterRefresh(_ completer: (() -> Void)?) {
|
||||
self.collectionView.br_endFooterRefreshing()
|
||||
self.requestDataList(page: self.page + 1) { [weak self] in
|
||||
self?.collectionView.br_endFooterRefreshing()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,12 +77,34 @@ extension BRVipOrderRecordViewController: UICollectionViewDelegate, UICollection
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! BRVipOrderRecordCell
|
||||
cell.model = self.listArr[indexPath.row]
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return 10
|
||||
return self.listArr.count
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension BRVipOrderRecordViewController {
|
||||
|
||||
private func requestDataList(page: Int, completer: (() -> Void)?) {
|
||||
BRStoreAPI.requestRechargeRecord(buyType: .subVip, page: page) { [weak self] listModel in
|
||||
guard let self = self else { return }
|
||||
|
||||
if let list = listModel?.list {
|
||||
if page == 1 {
|
||||
self.listArr.removeAll()
|
||||
}
|
||||
self.listArr += list
|
||||
self.page = page
|
||||
self.collectionView.reloadData()
|
||||
}
|
||||
completer?()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
22
BeeReel/Class/Store/Model/BRConsumptionRecordsModel.swift
Normal file
22
BeeReel/Class/Store/Model/BRConsumptionRecordsModel.swift
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// BRConsumptionRecordsModel.swift
|
||||
// BeeReel
|
||||
//
|
||||
// Created by 长沙鸿瑶 on 2025/7/30.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SmartCodable
|
||||
|
||||
class BRConsumptionRecordsModel: BRModel, SmartCodable {
|
||||
|
||||
var created_at: String?
|
||||
var short_play_id: String?
|
||||
var coins: Int?
|
||||
var image_url: String?
|
||||
var name: String?
|
||||
var coin_type: Int?
|
||||
var short_play_video_id: String?
|
||||
var episode: String?
|
||||
|
||||
}
|
@ -27,88 +27,79 @@ class BRPayDataRequest: NSObject {
|
||||
BRHUD.show()
|
||||
}
|
||||
|
||||
BRStoreAPI.requestPayTemplate { [weak self] model in
|
||||
BRStoreAPI.requestPayTemplate(isToast: isToast) { [weak self] model in
|
||||
guard let self = self else { return }
|
||||
if isLoding {
|
||||
BRHUD.dismiss()
|
||||
guard let model = model else {
|
||||
if isLoding {
|
||||
BRHUD.dismiss()
|
||||
}
|
||||
self.completerBlock?(nil)
|
||||
return
|
||||
}
|
||||
completer?(model)
|
||||
self.oldTemplateModel = model
|
||||
|
||||
var productIdArr: [String] = []
|
||||
model.list_sub_vip?.forEach { item in
|
||||
productIdArr.append(BRIAP.manager.getProductId(templateId: item.ios_template_id) ?? "")
|
||||
}
|
||||
model.list_coins?.forEach { item in
|
||||
productIdArr.append(BRIAP.manager.getProductId(templateId: item.ios_template_id) ?? "")
|
||||
}
|
||||
|
||||
let set = Set(productIdArr)
|
||||
let productsRequest = SKProductsRequest(productIdentifiers: set)
|
||||
productsRequest.delegate = self
|
||||
productsRequest.start()
|
||||
|
||||
}
|
||||
|
||||
// BRStoreAPI.requestPayTemplate(isToast: isToast) { [weak self] model in
|
||||
// guard let self = self else { return }
|
||||
// guard let model = model else {
|
||||
// if isLoding {
|
||||
// VPHUD.dismiss()
|
||||
// }
|
||||
// self.completerBlock?(nil)
|
||||
// return
|
||||
// }
|
||||
// self.oldTemplateModel = model
|
||||
//
|
||||
// var productIdArr: [String] = []
|
||||
// model.list_sub_vip?.forEach { item in
|
||||
// productIdArr.append(VPIAPManager.manager.getProductId(templateId: item.ios_template_id) ?? "")
|
||||
// }
|
||||
// model.list_coins?.forEach { item in
|
||||
// productIdArr.append(VPIAPManager.manager.getProductId(templateId: item.ios_template_id) ?? "")
|
||||
// }
|
||||
//
|
||||
// let set = Set(productIdArr)
|
||||
// let productsRequest = SKProductsRequest(productIdentifiers: set)
|
||||
// productsRequest.delegate = self
|
||||
// productsRequest.start()
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
//MARK: -------------- SKProductsRequestDelegate --------------
|
||||
extension BRPayDataRequest: SKProductsRequestDelegate {
|
||||
|
||||
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
|
||||
if isLoding {
|
||||
VPHUD.dismiss()
|
||||
}
|
||||
|
||||
guard let templateModel = self.oldTemplateModel else { return }
|
||||
let products = response.products
|
||||
|
||||
var newCoinList: [VPPayTemplateItem] = []
|
||||
var newVipList: [VPPayTemplateItem] = []
|
||||
|
||||
templateModel.list_coins?.forEach { item in
|
||||
let productId = VPIAPManager.manager.getProductId(templateId: item.ios_template_id) ?? ""
|
||||
for product in products {
|
||||
if productId == product.productIdentifier {
|
||||
item.price = product.price.stringValue
|
||||
item.currency = product.priceLocale.currencySymbol
|
||||
newCoinList.append(item)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
templateModel.list_sub_vip?.forEach { item in
|
||||
let productId = VPIAPManager.manager.getProductId(templateId: item.ios_template_id) ?? ""
|
||||
for product in products {
|
||||
if productId == product.productIdentifier {
|
||||
item.price = product.price.stringValue
|
||||
item.currency = product.priceLocale.currencySymbol
|
||||
newVipList.append(item)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
templateModel.list_coins = newCoinList
|
||||
templateModel.list_sub_vip = newVipList
|
||||
|
||||
DispatchQueue.main.async {
|
||||
self.completerBlock?(templateModel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
//MARK: -------------- SKProductsRequestDelegate --------------
|
||||
extension BRPayDataRequest: SKProductsRequestDelegate {
|
||||
|
||||
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
|
||||
if isLoding {
|
||||
BRHUD.dismiss()
|
||||
}
|
||||
|
||||
guard let templateModel = self.oldTemplateModel else { return }
|
||||
let products = response.products
|
||||
|
||||
var newCoinList: [BRPayItem] = []
|
||||
var newVipList: [BRPayItem] = []
|
||||
|
||||
templateModel.list_coins?.forEach { item in
|
||||
let productId = BRIAP.manager.getProductId(templateId: item.ios_template_id) ?? ""
|
||||
for product in products {
|
||||
if productId == product.productIdentifier {
|
||||
item.price = product.price.stringValue
|
||||
item.currency = product.priceLocale.currencySymbol
|
||||
newCoinList.append(item)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
templateModel.list_sub_vip?.forEach { item in
|
||||
let productId = BRIAP.manager.getProductId(templateId: item.ios_template_id) ?? ""
|
||||
for product in products {
|
||||
if productId == product.productIdentifier {
|
||||
item.price = product.price.stringValue
|
||||
item.currency = product.priceLocale.currencySymbol
|
||||
newVipList.append(item)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
templateModel.list_coins = newCoinList
|
||||
templateModel.list_sub_vip = newVipList
|
||||
|
||||
DispatchQueue.main.async {
|
||||
self.completerBlock?(templateModel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
21
BeeReel/Class/Store/Model/BRRewardCoinRecordModel.swift
Normal file
21
BeeReel/Class/Store/Model/BRRewardCoinRecordModel.swift
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// BRRewardCoinRecordModel.swift
|
||||
// BeeReel
|
||||
//
|
||||
// Created by 长沙鸿瑶 on 2025/7/30.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import SmartCodable
|
||||
|
||||
class BRRewardCoinRecordModel: BRModel, SmartCodable {
|
||||
|
||||
var id: String?
|
||||
var type: String?
|
||||
var coins: Int?
|
||||
var left_coins: String?
|
||||
var created_at: String?
|
||||
var diff_datetime: String?
|
||||
var expired_time: TimeInterval?
|
||||
|
||||
}
|
@ -11,7 +11,9 @@ class BRCoinOrderRecordCell: BRCollectionViewCell {
|
||||
|
||||
var model: BRRechargeRecordModel? {
|
||||
didSet {
|
||||
|
||||
titleLabel.text = model?.type
|
||||
timeLabel.text = model?.created_at
|
||||
coinView.setNeedsUpdateConfiguration()
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +37,7 @@ class BRCoinOrderRecordCell: BRCollectionViewCell {
|
||||
button.configurationUpdateHandler = { [weak self] button in
|
||||
guard let self = self else { return }
|
||||
|
||||
button.configuration?.attributedTitle = AttributedString.br_createAttributedString(string: "+60", color: .color7ECD5E(), font: .fontMedium(ofSize: 15))
|
||||
button.configuration?.attributedTitle = AttributedString.br_createAttributedString(string: "+\(model?.value ?? "0")", color: .color7ECD5E(), font: .fontMedium(ofSize: 15))
|
||||
}
|
||||
return button
|
||||
}()
|
||||
|
@ -9,12 +9,21 @@ import UIKit
|
||||
|
||||
class BRConsumptionRecordCell: BRCollectionViewCell {
|
||||
|
||||
var model: BRConsumptionRecordsModel? {
|
||||
didSet {
|
||||
timeLabel.text = model?.created_at
|
||||
let episode = "EP.##".localizedReplace(text: "\(model?.episode ?? "0")") + "\(model?.name ?? "")"
|
||||
contentLabel.text = episode
|
||||
|
||||
coinView.setNeedsUpdateConfiguration()
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .fontRegular(ofSize: 14)
|
||||
label.textColor = .color1C1C1C()
|
||||
label.text = "Purchase Single Episode"
|
||||
label.text = "Purchase Single Episode".localized
|
||||
return label
|
||||
}()
|
||||
|
||||
@ -48,7 +57,7 @@ class BRConsumptionRecordCell: BRCollectionViewCell {
|
||||
button.configurationUpdateHandler = { [weak self] button in
|
||||
guard let self = self else { return }
|
||||
|
||||
button.configuration?.attributedTitle = AttributedString.br_createAttributedString(string: "-60", color: .color7ECD5E(), font: .fontMedium(ofSize: 15))
|
||||
button.configuration?.attributedTitle = AttributedString.br_createAttributedString(string: "-\(model?.coins ?? 0)", color: .color7ECD5E(), font: .fontMedium(ofSize: 15))
|
||||
}
|
||||
return button
|
||||
}()
|
||||
|
@ -9,11 +9,28 @@ import UIKit
|
||||
|
||||
class BRRewardCoinsRecordCell: BRCollectionViewCell {
|
||||
|
||||
var model: BRRewardCoinRecordModel? {
|
||||
didSet {
|
||||
titleLabel.text = model?.type
|
||||
timeLabel.text = model?.created_at
|
||||
coinView.setNeedsUpdateConfiguration()
|
||||
|
||||
let expireDate = Date(timeIntervalSince1970: model?.expired_time ?? 0)
|
||||
let nowDate = Date()
|
||||
let days = nowDate.differenceDay(date: expireDate)
|
||||
|
||||
if days > 0 {
|
||||
contentLabel.text = "Expires in ## days".localizedReplace(text: "\(days)")
|
||||
} else {
|
||||
contentLabel.text = "Expired".localized
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .fontRegular(ofSize: 14)
|
||||
label.textColor = .color1C1C1C()
|
||||
label.text = "Check in"
|
||||
return label
|
||||
}()
|
||||
|
||||
@ -21,7 +38,6 @@ class BRRewardCoinsRecordCell: BRCollectionViewCell {
|
||||
let label = UILabel()
|
||||
label.font = .fontRegular(ofSize: 12)
|
||||
label.textColor = .colorC2C2C2()
|
||||
label.text = "Expires in 30 days"
|
||||
return label
|
||||
}()
|
||||
|
||||
@ -29,7 +45,6 @@ class BRRewardCoinsRecordCell: BRCollectionViewCell {
|
||||
let label = UILabel()
|
||||
label.font = .fontRegular(ofSize: 11)
|
||||
label.textColor = .colorC2C2C2()
|
||||
label.text = "2025-04-17 06:19:13"
|
||||
label.setContentHuggingPriority(.required, for: .horizontal)
|
||||
label.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
return label
|
||||
@ -47,7 +62,7 @@ class BRRewardCoinsRecordCell: BRCollectionViewCell {
|
||||
button.configurationUpdateHandler = { [weak self] button in
|
||||
guard let self = self else { return }
|
||||
|
||||
button.configuration?.attributedTitle = AttributedString.br_createAttributedString(string: "+60", color: .color7ECD5E(), font: .fontMedium(ofSize: 15))
|
||||
button.configuration?.attributedTitle = AttributedString.br_createAttributedString(string: "+\(self.model?.coins ?? 0)", color: .color7ECD5E(), font: .fontMedium(ofSize: 15))
|
||||
}
|
||||
return button
|
||||
}()
|
||||
|
@ -8,6 +8,15 @@
|
||||
import UIKit
|
||||
|
||||
class BRVipOrderRecordCell: BRCollectionViewCell {
|
||||
|
||||
var model: BRRechargeRecordModel? {
|
||||
didSet {
|
||||
durationLabel.text = model?.value
|
||||
timeLabel.text = model?.created_at
|
||||
titleLabel.text = model?.type
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = .fontRegular(ofSize: 14)
|
||||
|
@ -5,6 +5,8 @@
|
||||
// Created by 长沙鸿瑶 on 2025/7/28.
|
||||
//
|
||||
|
||||
import FirebaseMessaging
|
||||
|
||||
extension AppDelegate {
|
||||
///是否展示过通知提示
|
||||
static var haveBeenShownAPNS = false
|
||||
@ -56,7 +58,7 @@ extension AppDelegate {
|
||||
//MARK: -------------- UNUserNotificationCenterDelegate --------------
|
||||
extension AppDelegate: UNUserNotificationCenterDelegate {
|
||||
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
||||
// Messaging.messaging().apnsToken = deviceToken
|
||||
Messaging.messaging().apnsToken = deviceToken
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: any Error) {
|
||||
@ -85,23 +87,19 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
|
||||
completionHandler()
|
||||
return
|
||||
}
|
||||
// VPStatAPI.requestStatApns(messageId: model.message_id ?? "", title: response.notification.request.content.title)
|
||||
//
|
||||
//
|
||||
// if model.path == .videoDetail, let shortPlayId = model.short_play_id {
|
||||
// let vc = VPDetailPlayerViewController()
|
||||
// vc.shortPlayId = shortPlayId
|
||||
// VPAppTool.topViewController?.navigationController?.pushViewController(vc, animated: true)
|
||||
//
|
||||
// } else if model.path == .promotion {
|
||||
// let vc = VPRewardsViewController()
|
||||
// VPAppTool.topViewController?.navigationController?.pushViewController(vc, animated: true)
|
||||
//
|
||||
// } else if model.path == .feedback {
|
||||
// let vc = VPCampaignWebViewController()
|
||||
// vc.urlStr = kVPFeedBackListWebUrl
|
||||
// VPAppTool.topViewController?.navigationController?.pushViewController(vc, animated: true)
|
||||
// }
|
||||
BRStatAPI.requestStatApns(messageId: model.message_id ?? "", title: response.notification.request.content.title)
|
||||
|
||||
|
||||
if model.path == .videoDetail, let shortPlayId = model.short_play_id {
|
||||
let vc = BRVideoDetailViewController()
|
||||
vc.shortPlayId = shortPlayId
|
||||
BRAppTool.topViewController?.navigationController?.pushViewController(vc, animated: true)
|
||||
|
||||
} else if model.path == .feedback {
|
||||
let vc = BRAppWebViewController()
|
||||
vc.webUrl = kBRFeedBackListWebUrl
|
||||
BRAppTool.topViewController?.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
completionHandler()
|
||||
}
|
||||
|
@ -25,8 +25,8 @@ extension AppDelegate {
|
||||
Adjust.initSdk(config)
|
||||
|
||||
|
||||
// FirebaseApp.configure()
|
||||
// Messaging.messaging().delegate = self
|
||||
FirebaseApp.configure()
|
||||
Messaging.messaging().delegate = self
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ extension SceneDelegate {
|
||||
Self.isNeedRetry = false
|
||||
SceneDelegate.webpageURL = nil
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
||||
self._handleOpenAppMessage(webpageURL: webpageURL)
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ extension SceneDelegate {
|
||||
var data: [String : Any]? = webpageURL?.query?.br_urlQuryToDictionary()
|
||||
|
||||
|
||||
if statUrlStr == nil, let pasteStr = UIPasteboard.general.string, pasteStr.contains("veloriaapp") {
|
||||
if statUrlStr == nil, let pasteStr = UIPasteboard.general.string, pasteStr.contains("beereel") {
|
||||
let tempArr = pasteStr.components(separatedBy: "?")
|
||||
let query = tempArr.last
|
||||
|
||||
|
@ -10,7 +10,7 @@ import UIKit
|
||||
class BRIAP {
|
||||
typealias CompletionHandler = ((_ finish: Bool) -> Void)
|
||||
///内购模版前缀
|
||||
static let IAPPrefix = "veloria."
|
||||
static let IAPPrefix = "beereel."
|
||||
|
||||
|
||||
static let manager = BRIAP()
|
||||
|
@ -293,6 +293,28 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Expired" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Expired"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Expires in ## days" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Expires in ## days"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Explicit List of Personal Information Collection" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
@ -667,6 +689,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Purchase Single Episode" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Purchase Single Episode"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"quarter" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
|
Loading…
x
Reference in New Issue
Block a user