提交
@@ -24,6 +24,7 @@
|
|||||||
95C3EFF42E49F44A004B2D82 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FE2DEF0AB20031E710 /* SystemConfiguration.framework */; };
|
95C3EFF42E49F44A004B2D82 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FE2DEF0AB20031E710 /* SystemConfiguration.framework */; };
|
||||||
95C3EFF52E49F44A004B2D82 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FC2DEF0AAC0031E710 /* libiconv.tbd */; };
|
95C3EFF52E49F44A004B2D82 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FC2DEF0AAC0031E710 /* libiconv.tbd */; };
|
||||||
95C3EFF62E49F44A004B2D82 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FA2DEF0AA10031E710 /* Security.framework */; };
|
95C3EFF62E49F44A004B2D82 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FA2DEF0AA10031E710 /* Security.framework */; };
|
||||||
|
95EEB7902EFBCE35000BB488 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95EEB78F2EFBCE35000BB488 /* StoreKit.framework */; };
|
||||||
95F204FB2DEF0AA10031E710 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FA2DEF0AA10031E710 /* Security.framework */; };
|
95F204FB2DEF0AA10031E710 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FA2DEF0AA10031E710 /* Security.framework */; };
|
||||||
95F204FD2DEF0AAC0031E710 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FC2DEF0AAC0031E710 /* libiconv.tbd */; };
|
95F204FD2DEF0AAC0031E710 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FC2DEF0AAC0031E710 /* libiconv.tbd */; };
|
||||||
95F204FF2DEF0AB20031E710 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FE2DEF0AB20031E710 /* SystemConfiguration.framework */; };
|
95F204FF2DEF0AB20031E710 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95F204FE2DEF0AB20031E710 /* SystemConfiguration.framework */; };
|
||||||
@@ -112,6 +113,7 @@
|
|||||||
95C3274A2E4C4068004B2D82 /* QXLiveScreenDev.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = QXLiveScreenDev.appex; sourceTree = BUILT_PRODUCTS_DIR; };
|
95C3274A2E4C4068004B2D82 /* QXLiveScreenDev.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = QXLiveScreenDev.appex; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
95C3274C2E4C4068004B2D82 /* QXLiveScreen copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "QXLiveScreen copy-Info.plist"; path = "/Users/qixing/Desktop/项目/羽声/featherVoice/QXLiveScreen copy-Info.plist"; sourceTree = "<absolute>"; };
|
95C3274C2E4C4068004B2D82 /* QXLiveScreen copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "QXLiveScreen copy-Info.plist"; path = "/Users/qixing/Desktop/项目/羽声/featherVoice/QXLiveScreen copy-Info.plist"; sourceTree = "<absolute>"; };
|
||||||
95C3F0022E49F44A004B2D82 /* QXLiveDev.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QXLiveDev.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
95C3F0022E49F44A004B2D82 /* QXLiveDev.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QXLiveDev.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
95EEB78F2EFBCE35000BB488 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
|
||||||
95F204FA2DEF0AA10031E710 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
95F204FA2DEF0AA10031E710 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||||
95F204FC2DEF0AAC0031E710 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
|
95F204FC2DEF0AAC0031E710 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
|
||||||
95F204FE2DEF0AB20031E710 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
95F204FE2DEF0AB20031E710 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||||
@@ -201,6 +203,7 @@
|
|||||||
95F205012DEF0AB70031E710 /* CoreGraphics.framework in Frameworks */,
|
95F205012DEF0AB70031E710 /* CoreGraphics.framework in Frameworks */,
|
||||||
95F204FF2DEF0AB20031E710 /* SystemConfiguration.framework in Frameworks */,
|
95F204FF2DEF0AB20031E710 /* SystemConfiguration.framework in Frameworks */,
|
||||||
95F204FD2DEF0AAC0031E710 /* libiconv.tbd in Frameworks */,
|
95F204FD2DEF0AAC0031E710 /* libiconv.tbd in Frameworks */,
|
||||||
|
95EEB7902EFBCE35000BB488 /* StoreKit.framework in Frameworks */,
|
||||||
95F204FB2DEF0AA10031E710 /* Security.framework in Frameworks */,
|
95F204FB2DEF0AA10031E710 /* Security.framework in Frameworks */,
|
||||||
BB879DD0574F50799C6C43C6 /* Pods_QXLive.framework in Frameworks */,
|
BB879DD0574F50799C6C43C6 /* Pods_QXLive.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
@@ -271,6 +274,7 @@
|
|||||||
4B6F40DB8328A2B2BB1BF79D /* Frameworks */ = {
|
4B6F40DB8328A2B2BB1BF79D /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
95EEB78F2EFBCE35000BB488 /* StoreKit.framework */,
|
||||||
9599C76A2E97631E008D19F6 /* libswiftCoreAudio.tbd */,
|
9599C76A2E97631E008D19F6 /* libswiftCoreAudio.tbd */,
|
||||||
953714712E56B59B00569E1E /* CoreAudioKit.framework */,
|
953714712E56B59B00569E1E /* CoreAudioKit.framework */,
|
||||||
9537146F2E56B59100569E1E /* CoreAudio.framework */,
|
9537146F2E56B59100569E1E /* CoreAudio.framework */,
|
||||||
@@ -748,7 +752,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
|
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 3;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = 8798G5VMH9;
|
DEVELOPMENT_TEAM = 8798G5VMH9;
|
||||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
@@ -787,7 +791,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(SDKROOT)/usr/lib/swift",
|
"$(SDKROOT)/usr/lib/swift",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.2.0;
|
MARKETING_VERSION = 1.1.13;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
|
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -814,7 +818,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
|
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 3;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = 8798G5VMH9;
|
DEVELOPMENT_TEAM = 8798G5VMH9;
|
||||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
@@ -853,7 +857,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(SDKROOT)/usr/lib/swift",
|
"$(SDKROOT)/usr/lib/swift",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.2.0;
|
MARKETING_VERSION = 1.1.13;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
|
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -1207,7 +1211,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(SDKROOT)/usr/lib/swift",
|
"$(SDKROOT)/usr/lib/swift",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.0;
|
MARKETING_VERSION = 1.0.2;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test;
|
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
@@ -1271,7 +1275,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(SDKROOT)/usr/lib/swift",
|
"$(SDKROOT)/usr/lib/swift",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.0;
|
MARKETING_VERSION = 1.0.2;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test;
|
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface QXHomeViewController : QXBaseViewController
|
@interface QXHomeViewController : QXBaseViewController
|
||||||
-(void)popFirstRechargeView;
|
-(void)popFirstRechargeViewOnlyRecharge:(BOOL)onlyRecharge;
|
||||||
-(void)giftScrollViewShowWithModel:(QXGiftScrollModel*)model;
|
-(void)giftScrollViewShowWithModel:(QXGiftScrollModel*)model;
|
||||||
-(void)giftScrollViewShowWithModelList:(NSArray<QXGiftScrollModel*>*)list;
|
-(void)giftScrollViewShowWithModelList:(NSArray<QXGiftScrollModel*>*)list;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -327,7 +327,7 @@
|
|||||||
|
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
-(void)popFirstRechargeView{
|
-(void)popFirstRechargeViewOnlyRecharge:(BOOL)onlyRecharge{
|
||||||
if ([QXGlobal shareGlobal].isAppStore) {
|
if ([QXGlobal shareGlobal].isAppStore) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -336,6 +336,9 @@
|
|||||||
QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init];
|
QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init];
|
||||||
view.closeActionBlock = ^{
|
view.closeActionBlock = ^{
|
||||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||||
|
if (onlyRecharge) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
QXLOG(@"页面关闭");
|
QXLOG(@"页面关闭");
|
||||||
if (weakSelf.signStatus.intValue == 1) {
|
if (weakSelf.signStatus.intValue == 1) {
|
||||||
[weakSelf popRecommendRoom];
|
[weakSelf popRecommendRoom];
|
||||||
@@ -539,7 +542,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (md.type == 3) {
|
if (md.type == 3) {
|
||||||
[self popFirstRechargeView];
|
[self popFirstRechargeViewOnlyRecharge:YES];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -107,10 +107,18 @@ static NSInteger maxCount = 5;
|
|||||||
}
|
}
|
||||||
- (void)setModel:(QXGiftScrollModel *)model{
|
- (void)setModel:(QXGiftScrollModel *)model{
|
||||||
_model = model;
|
_model = model;
|
||||||
NSString *giftInfo = [NSString stringWithFormat:@"%@%@%@ %@X%@",model.fromUserName,QXText(@"送给了"),model.toUserName,model.giftName,model.number];
|
if ([model.toUserName isExist]) {
|
||||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:giftInfo];
|
NSString *giftInfo = [NSString stringWithFormat:@"%@%@%@ %@X%@",model.fromUserName,QXText(@"送给了"),model.toUserName,model.giftName,model.number];
|
||||||
[attr yy_setColor:RGB16A(0x9FFFED, 0.84) range:[giftInfo rangeOfString:QXText(@"送给了")]];
|
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:giftInfo];
|
||||||
self.titleLabel.attributedText = attr;
|
[attr yy_setColor:RGB16A(0x9FFFED, 0.84) range:[giftInfo rangeOfString:QXText(@"送给了")]];
|
||||||
|
self.titleLabel.attributedText = attr;
|
||||||
|
}else{
|
||||||
|
NSString *giftInfo = model.text;
|
||||||
|
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:giftInfo];
|
||||||
|
[attr yy_setColor:RGB16A(0x9FFFED, 0.84) range:[giftInfo rangeOfString:QXText(@"送给了")]];
|
||||||
|
self.titleLabel.attributedText = attr;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
-(void)initSubViews{
|
-(void)initSubViews{
|
||||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_gift_bg"]];
|
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_gift_bg"]];
|
||||||
|
|||||||
37
QXLive/Manager/QXIAPManager.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
//
|
||||||
|
// QXIAPManager.h
|
||||||
|
// QXLive
|
||||||
|
//
|
||||||
|
// Created by 启星 on 2025/12/24.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface QXIAPManager : NSObject
|
||||||
|
|
||||||
|
|
||||||
|
typedef void(^SubscriptionSuccessCompletionHandler)(void);//订阅成功的回调
|
||||||
|
typedef void(^SubscriptionFailurreCompletionHandler)(void);//订阅失败的回调
|
||||||
|
typedef void(^RestoreSuccessCompletionHandler)(void);//恢复成功的回调
|
||||||
|
typedef void(^RestoreFailurreCompletionHandler)(void);//恢复失败的回调
|
||||||
|
|
||||||
|
// 添加回调属性
|
||||||
|
@property (nonatomic, copy) SubscriptionSuccessCompletionHandler subscriptionSuccessCompletionHandler;
|
||||||
|
@property (nonatomic, copy) SubscriptionFailurreCompletionHandler subscriptionFailurreCompletionHandler;
|
||||||
|
@property (nonatomic, copy) RestoreSuccessCompletionHandler restoreSuccessCompletionHandler;
|
||||||
|
@property (nonatomic, copy) RestoreFailurreCompletionHandler restoreFailurreCompletionHandler;
|
||||||
|
|
||||||
|
+ (instancetype)sharedInstance;
|
||||||
|
|
||||||
|
-(void)butGoodsWithId:(NSString*)productId;
|
||||||
|
- (void)getReceiptState:(void (^)(BOOL success))completion;
|
||||||
|
//恢复内购
|
||||||
|
- (void)resumeInAppPurchase;
|
||||||
|
//
|
||||||
|
- (Boolean)getWhetherSubscrid;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
286
QXLive/Manager/QXIAPManager.m
Normal file
@@ -0,0 +1,286 @@
|
|||||||
|
//
|
||||||
|
// QXIAPManager.m
|
||||||
|
// QXLive
|
||||||
|
//
|
||||||
|
// Created by 启星 on 2025/12/24.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#import "QXIAPManager.h"
|
||||||
|
#import <StoreKit/StoreKit.h>
|
||||||
|
#import <AppTrackingTransparency/AppTrackingTransparency.h>
|
||||||
|
#import <AdSupport/AdSupport.h>
|
||||||
|
#import <AFNetworking/AFNetworking.h>
|
||||||
|
|
||||||
|
|
||||||
|
@interface QXIAPManager()<SKPaymentTransactionObserver,SKProductsRequestDelegate,SKRequestDelegate>
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation QXIAPManager
|
||||||
|
|
||||||
|
+ (instancetype)sharedInstance{
|
||||||
|
static dispatch_once_t pred;
|
||||||
|
static QXIAPManager *manager = nil;
|
||||||
|
dispatch_once(&pred, ^{
|
||||||
|
manager = [[self alloc] init];
|
||||||
|
});
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
购买
|
||||||
|
*/
|
||||||
|
-(void)butGoodsWithId:(NSString*)productId{
|
||||||
|
//productId要跟服务端的关键字对应
|
||||||
|
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
|
||||||
|
|
||||||
|
if ([SKPaymentQueue canMakePayments]) { //用户允许app内购
|
||||||
|
if (productId.length) {
|
||||||
|
NSLog(@"%@商品正在请求中...",productId);
|
||||||
|
NSArray *product = [[NSArray alloc] initWithObjects:productId, nil];
|
||||||
|
NSSet *set = [NSSet setWithArray:product];
|
||||||
|
SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:set];
|
||||||
|
productsRequest.delegate = self;
|
||||||
|
[productsRequest start];
|
||||||
|
}
|
||||||
|
} else { //没有权限
|
||||||
|
NSLog(@"没有购买权限");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
恢复购买
|
||||||
|
*/
|
||||||
|
- (void)resumeInAppPurchase {
|
||||||
|
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
|
||||||
|
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark SKProductsRequestDelegate 查询成功后的回调
|
||||||
|
- (void)productsRequest:(nonnull SKProductsRequest *)request didReceiveResponse:(nonnull SKProductsResponse *)response {
|
||||||
|
NSArray *product = response.products;
|
||||||
|
if (response.invalidProductIdentifiers.count) {
|
||||||
|
NSLog(@"商品请求错误,error:%@", response.invalidProductIdentifiers);
|
||||||
|
if (self.subscriptionFailurreCompletionHandler) {
|
||||||
|
self.subscriptionFailurreCompletionHandler();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
SKPayment *payment = [SKPayment paymentWithProduct:product[0]];
|
||||||
|
[[SKPaymentQueue defaultQueue] addPayment:payment];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)paymentQueue:(nonnull SKPaymentQueue *)queue updatedTransactions:(nonnull NSArray<SKPaymentTransaction *> *)transactions {
|
||||||
|
// NSInteger i = 0;
|
||||||
|
for (SKPaymentTransaction *tran in transactions) {
|
||||||
|
// if(i != transactions.count - 1){
|
||||||
|
// i++;
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
switch (tran.transactionState) {
|
||||||
|
case SKPaymentTransactionStatePurchasing://正在交易
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SKPaymentTransactionStatePurchased://交易完成
|
||||||
|
{
|
||||||
|
[[SKPaymentQueue defaultQueue] finishTransaction:tran];
|
||||||
|
|
||||||
|
if (tran.originalTransaction) {
|
||||||
|
// 如果是自动续费的订单,originalTransaction会有内容
|
||||||
|
if (tran.originalTransaction.transactionIdentifier) {
|
||||||
|
[self saveOrderId:tran.originalTransaction.transactionIdentifier];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 第一次购买自动订阅
|
||||||
|
if (tran.transactionIdentifier) {
|
||||||
|
[self saveOrderId:tran.transactionIdentifier];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[self vertifyReceipt:^(BOOL success) {
|
||||||
|
if(success){
|
||||||
|
self.subscriptionSuccessCompletionHandler();
|
||||||
|
}else{
|
||||||
|
self.subscriptionFailurreCompletionHandler();
|
||||||
|
}
|
||||||
|
}]; //获取交易成功后的购买凭证
|
||||||
|
NSLog(@"交易完成,正在校验凭证....");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SKPaymentTransactionStateFailed://交易失败
|
||||||
|
[[SKPaymentQueue defaultQueue] finishTransaction:tran];
|
||||||
|
|
||||||
|
self.subscriptionFailurreCompletionHandler();
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SKPaymentTransactionStateRestored://已经购买过该商品
|
||||||
|
NSLog(@"已经购买过该商品");
|
||||||
|
[[SKPaymentQueue defaultQueue] finishTransaction:tran];
|
||||||
|
|
||||||
|
if (tran.originalTransaction) {
|
||||||
|
if (tran.originalTransaction.transactionIdentifier) {
|
||||||
|
[self saveOrderId:tran.originalTransaction.transactionIdentifier];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (tran.transactionIdentifier) {
|
||||||
|
[self saveOrderId:tran.transactionIdentifier];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.subscriptionFailurreCompletionHandler();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 恢复购买成功后的回调
|
||||||
|
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
|
||||||
|
if (queue.transactions.count > 0) {
|
||||||
|
for (SKPaymentTransaction *tran in queue.transactions) {
|
||||||
|
NSString *originalTransactionID = tran.originalTransaction.transactionIdentifier;
|
||||||
|
if (originalTransactionID) {
|
||||||
|
[self saveOrderId:originalTransactionID];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[self getReceiptState:^(BOOL success) {
|
||||||
|
if(success){
|
||||||
|
self.restoreSuccessCompletionHandler();
|
||||||
|
}else{
|
||||||
|
self.restoreFailurreCompletionHandler();
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
self.restoreFailurreCompletionHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 恢复购买失败后的回调
|
||||||
|
- (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error {
|
||||||
|
self.restoreFailurreCompletionHandler();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
保存订单编号到本地
|
||||||
|
*/
|
||||||
|
- (void)saveOrderId:(NSString*)orderId{
|
||||||
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
[defaults setObject:orderId forKey:@"orderId"];
|
||||||
|
[defaults synchronize];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (Boolean)getWhetherSubscrid{
|
||||||
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
NSString *orderId = [defaults objectForKey:@"orderId"];
|
||||||
|
return orderId != nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
获取订单凭证
|
||||||
|
*/
|
||||||
|
- (NSString *)getReceipt {
|
||||||
|
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
|
||||||
|
|
||||||
|
if ([[NSFileManager defaultManager] fileExistsAtPath:[receiptURL path]]){
|
||||||
|
NSData *receiptData = [NSData dataWithContentsOfURL:receiptURL];
|
||||||
|
NSString *encodeReceiptStr = [receiptData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
|
||||||
|
return encodeReceiptStr;
|
||||||
|
} else {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
校验订单
|
||||||
|
*/
|
||||||
|
- (void)vertifyReceipt:(void (^)(BOOL success))completion {
|
||||||
|
NSLog(@"~~~正在检验。。。");
|
||||||
|
NSString *receipt = [self getReceipt];
|
||||||
|
NSString *password = @"秘钥";
|
||||||
|
|
||||||
|
NSString *urlString = [NSString stringWithFormat:@"https://校验地址"];
|
||||||
|
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
|
||||||
|
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
|
||||||
|
|
||||||
|
NSDictionary *parameters = @{
|
||||||
|
@"apple_receipt": receipt,
|
||||||
|
@"password": password
|
||||||
|
};
|
||||||
|
|
||||||
|
[manager POST:urlString parameters:parameters headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
|
// 请求成功,处理返回的数据
|
||||||
|
NSLog(@"弹窗提示用户请求成功");
|
||||||
|
if (responseObject) {
|
||||||
|
NSString *string = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
|
||||||
|
if ([string isEqualToString:@"success"] || [string isEqualToString:@"订单已存在"]) {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
completion(YES);
|
||||||
|
});
|
||||||
|
}else if ([string isEqualToString:@"failure"] || [string isEqualToString:@"fail"]){
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
completion(NO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
|
// 请求失败,处理错误信息
|
||||||
|
NSLog(@"请求失败:%@", error.localizedDescription);
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
completion(NO);
|
||||||
|
});
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)getReceiptState:(void (^)(BOOL success))completion {
|
||||||
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
NSString *order_id = [defaults objectForKey:@"orderId"];
|
||||||
|
if(!order_id){
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
completion(NO);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NSString *urlString = [NSString stringWithFormat:@"https://订单状态地址"];
|
||||||
|
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
|
||||||
|
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
|
||||||
|
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
|
||||||
|
|
||||||
|
NSDictionary *parameters = @{
|
||||||
|
@"bundle_id": bundleID,
|
||||||
|
@"order_id": order_id
|
||||||
|
};
|
||||||
|
|
||||||
|
[manager GET:urlString parameters:parameters headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
||||||
|
NSLog(@"订单状态获取");
|
||||||
|
if (responseObject) {
|
||||||
|
NSError *error = nil;
|
||||||
|
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:&error];
|
||||||
|
if([dictionary[@"status"] boolValue]){
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
completion(YES);
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
completion(NO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||||
|
// 请求失败,处理错误信息
|
||||||
|
NSLog(@"请求失败:%@", error.localizedDescription);
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
completion(NO);
|
||||||
|
});
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -146,10 +146,11 @@
|
|||||||
/// 收到礼物
|
/// 收到礼物
|
||||||
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
|
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
|
||||||
model.messageType = QXRoomChatMessageTypeGift;
|
model.messageType = QXRoomChatMessageTypeGift;
|
||||||
NSArray *arr = [model.GiftInfo.play_image componentsSeparatedByString:@","];
|
if ([model.GiftInfo.play_image isExist]) {
|
||||||
[[QXGiftPlayerManager shareManager] displayFullEffectViewWithMorePlayImages:arr];
|
NSArray *arr = [model.GiftInfo.play_image componentsSeparatedByString:@","];
|
||||||
|
[[QXGiftPlayerManager shareManager] displayFullEffectViewWithMorePlayImages:arr];
|
||||||
|
}
|
||||||
[[QXGiftDisplayManager sharedManager] receiveGift:model];
|
[[QXGiftDisplayManager sharedManager] receiveGift:model];
|
||||||
|
|
||||||
if (model.ToUserInfos.count>0) {
|
if (model.ToUserInfos.count>0) {
|
||||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didRecieveGiftWithWithUserInfos:)]) {
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didRecieveGiftWithWithUserInfos:)]) {
|
||||||
[self.delegate didRecieveGiftWithWithUserInfos:model.ToUserInfos];
|
[self.delegate didRecieveGiftWithWithUserInfos:model.ToUserInfos];
|
||||||
|
|||||||
@@ -74,10 +74,11 @@
|
|||||||
if (list.count == 0) {
|
if (list.count == 0) {
|
||||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||||
}else{
|
}else{
|
||||||
[weakSelf.tableView.mj_header endRefreshing];
|
[weakSelf.tableView.mj_footer endRefreshing];
|
||||||
}
|
}
|
||||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||||
|
[weakSelf.tableView.mj_header endRefreshing];
|
||||||
|
[weakSelf.tableView.mj_footer endRefreshing];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
-(void)helpAction{
|
-(void)helpAction{
|
||||||
@@ -105,7 +106,7 @@
|
|||||||
weakSelf.page = 1;
|
weakSelf.page = 1;
|
||||||
[weakSelf getSongList];
|
[weakSelf getSongList];
|
||||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||||
showToast(@"添加失败");
|
showToast(msg);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
-(void)qx_mineAddSongViewDidRemove{
|
-(void)qx_mineAddSongViewDidRemove{
|
||||||
@@ -119,7 +120,7 @@
|
|||||||
weakSelf.page = 1;
|
weakSelf.page = 1;
|
||||||
[weakSelf getSongList];
|
[weakSelf getSongList];
|
||||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||||
showToast(@"修改失败");
|
showToast(msg);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
-(void)addAction{
|
-(void)addAction{
|
||||||
|
|||||||
@@ -295,8 +295,8 @@
|
|||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||||
QXDayTaskTypeModel *model = self.model.tasks[indexPath.section];
|
// QXDayTaskTypeModel *model = self.model.tasks[indexPath.section];
|
||||||
QXDayTaskListModel *taskModel = model.task_list[indexPath.row];
|
QXDayTaskListModel *taskModel = self.typeModel.task_list[indexPath.row];
|
||||||
if ([taskModel.task_id isEqualToString:@"1"]) {
|
if ([taskModel.task_id isEqualToString:@"1"]) {
|
||||||
QXSignInAppView *signView = [[QXSignInAppView alloc] init];
|
QXSignInAppView *signView = [[QXSignInAppView alloc] init];
|
||||||
[signView showInView:self.view];
|
[signView showInView:self.view];
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
NSString *money = [NSString stringWithFormat:@"%.4f",model.today_profit.doubleValue];
|
NSString *money = [NSString stringWithFormat:@"%.4f",model.today_profit.doubleValue];
|
||||||
self.moneyLabel.text = [NSString stringWithFormat:@"%@",money];
|
self.moneyLabel.text = [NSString stringWithFormat:@"%@",money];
|
||||||
[self.typeImageView sd_setImageWithURL:[NSURL URLWithString:model.label_icon] placeholderImage:nil];
|
[self.typeImageView sd_setImageWithURL:[NSURL URLWithString:model.label_icon] placeholderImage:nil];
|
||||||
self.luckyWaterLabel.text = model.lucky_water;
|
self.luckyWaterLabel.text = [NSString stringWithFormat:@"幸运值总流水:%@",model.lucky_water];
|
||||||
if (model.apply_status.intValue == 1) {
|
if (model.apply_status.intValue == 1) {
|
||||||
self.roomWaitImageView.hidden = NO;
|
self.roomWaitImageView.hidden = NO;
|
||||||
self.luckyWaterLabel.hidden = YES;
|
self.luckyWaterLabel.hidden = YES;
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
self.progressView = [[QXProgressView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(70))/2, self.openBtn.top-4-13, ScaleWidth(70), 13)];
|
self.progressView = [[QXProgressView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(70))/2, self.openBtn.top-4-13, ScaleWidth(70), 13)];
|
||||||
self.progressView.bgColor = RGB16(0xFFB8CD);
|
self.progressView.bgColor = RGB16(0xFFB8CD);
|
||||||
self.progressView.progressColor = RGB16(0xE24272);
|
self.progressView.progressColor = RGB16(0xE24272);
|
||||||
self.progressView.progressTitleColor = RGB16(0xE24272);
|
self.progressView.progressTitleColor = RGB16(0xFFEDF2);
|
||||||
[self addSubview:self.progressView];
|
[self addSubview:self.progressView];
|
||||||
|
|
||||||
// self.titleLabel.text = @"初级礼盒";
|
// self.titleLabel.text = @"初级礼盒";
|
||||||
@@ -194,14 +194,14 @@
|
|||||||
self.iconImageView.image = [UIImage imageNamed:@"day_task_left"];
|
self.iconImageView.image = [UIImage imageNamed:@"day_task_left"];
|
||||||
self.progressView.bgColor = RGB16(0xFFB8CD);
|
self.progressView.bgColor = RGB16(0xFFB8CD);
|
||||||
self.progressView.progressColor = RGB16(0xE24272);
|
self.progressView.progressColor = RGB16(0xE24272);
|
||||||
self.progressView.progressTitleColor = RGB16(0xE24272);
|
self.progressView.progressTitleColor = RGB16(0xFFEDF2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QXDayTaskTopSubViewTypeRight:{
|
case QXDayTaskTopSubViewTypeRight:{
|
||||||
self.iconImageView.image = [UIImage imageNamed:@"day_task_right"];
|
self.iconImageView.image = [UIImage imageNamed:@"day_task_right"];
|
||||||
self.progressView.bgColor = RGB16(0xFFCFB3);
|
self.progressView.bgColor = RGB16(0xFFCFB3);
|
||||||
self.progressView.progressColor = RGB16(0xF35F07);
|
self.progressView.progressColor = RGB16(0xF35F07);
|
||||||
self.progressView.progressTitleColor = RGB16(0xF35F07);
|
self.progressView.progressTitleColor = RGB16(0xFFEDF2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
[self.progressView addRoundedCornersWithRadius:self.height/2];
|
[self.progressView addRoundedCornersWithRadius:self.height/2];
|
||||||
|
|
||||||
self.progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width-30, 0, 30, self.height)];
|
self.progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width-30, 0, 30, self.height)];
|
||||||
self.progressLabel.textColor = RGB16(0xE24171);
|
self.progressLabel.textColor = RGB16(0xFFEDF2);
|
||||||
self.progressLabel.font = [UIFont systemFontOfSize:10];
|
self.progressLabel.font = [UIFont systemFontOfSize:10];
|
||||||
[self addSubview:self.progressLabel];
|
[self addSubview:self.progressLabel];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,10 +364,11 @@
|
|||||||
//配置广告数据
|
//配置广告数据
|
||||||
XHLaunchVideoAdConfiguration *videoAdconfiguration = [XHLaunchVideoAdConfiguration defaultConfiguration];
|
XHLaunchVideoAdConfiguration *videoAdconfiguration = [XHLaunchVideoAdConfiguration defaultConfiguration];
|
||||||
// NSString *path = [[NSBundle mainBundle] pathForResource:@"app_start" ofType:@"mp4"];
|
// NSString *path = [[NSBundle mainBundle] pathForResource:@"app_start" ofType:@"mp4"];
|
||||||
videoAdconfiguration.videoNameOrURLString = @"app_start.mp4";
|
videoAdconfiguration.videoNameOrURLString = @"app_start2.mp4";
|
||||||
videoAdconfiguration.duration = 2;
|
videoAdconfiguration.duration = 7;
|
||||||
videoAdconfiguration.skipButtonType = SkipTypeNone;
|
videoAdconfiguration.skipButtonType = SkipTypeNone;
|
||||||
[XHLaunchAd videoAdWithVideoAdConfiguration:videoAdconfiguration];
|
videoAdconfiguration.videoCycleOnce = YES;
|
||||||
|
[XHLaunchAd videoAdWithVideoAdConfiguration:videoAdconfiguration delegate:self];
|
||||||
//广告图片URLString/或本地图片名(.jpg/.gif请带上后缀)
|
//广告图片URLString/或本地图片名(.jpg/.gif请带上后缀)
|
||||||
// imageAdconfiguration. = model.img;
|
// imageAdconfiguration. = model.img;
|
||||||
// //广告点击打开页面参数(openModel可为NSString,模型,字典等任意类型)
|
// //广告点击打开页面参数(openModel可为NSString,模型,字典等任意类型)
|
||||||
@@ -375,4 +376,8 @@
|
|||||||
// //显示开屏广告
|
// //显示开屏广告
|
||||||
// [XHLaunchAd imageAdWithImageAdConfiguration:imageAdconfiguration delegate:self];
|
// [XHLaunchAd imageAdWithImageAdConfiguration:imageAdconfiguration delegate:self];
|
||||||
}
|
}
|
||||||
|
- (BOOL)xhLaunchAd:(XHLaunchAd *)launchAd clickAtOpenModel:(id)openModel clickPoint:(CGPoint)clickPoint{
|
||||||
|
[XHLaunchAd removeAndAnimated:YES];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|||||||
BIN
QXLive/Other/Resource/app_start2.mp4
Normal file
|
Before Width: | Height: | Size: 433 KiB After Width: | Height: | Size: 433 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 1.5 MiB |
@@ -1794,7 +1794,8 @@ QXRoomUserInfoViewDelegate
|
|||||||
MJWeakSelf
|
MJWeakSelf
|
||||||
_sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull giftCount, NSString * _Nonnull userId, NSString * _Nonnull optionId) {
|
_sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull giftCount, NSString * _Nonnull userId, NSString * _Nonnull optionId) {
|
||||||
// if (self->_continuousView == nil) {
|
// if (self->_continuousView == nil) {
|
||||||
[weakSelf.view addSubview:weakSelf.continuousView];
|
[weakSelf.view addSubview:weakSelf.continuousView];
|
||||||
|
[weakSelf.view bringSubviewToFront:weakSelf.continuousView];
|
||||||
// }
|
// }
|
||||||
weakSelf.continuousView.giftModel = giftModel;
|
weakSelf.continuousView.giftModel = giftModel;
|
||||||
weakSelf.continuousView.sendType = sendType;
|
weakSelf.continuousView.sendType = sendType;
|
||||||
|
|||||||
@@ -217,20 +217,20 @@ NSInteger maxMessageCount = 20;
|
|||||||
// [self.synthesizer speakUtterance:utterance];
|
// [self.synthesizer speakUtterance:utterance];
|
||||||
// }
|
// }
|
||||||
#else
|
#else
|
||||||
if (QXGlobal.shareGlobal.isAppStore) {
|
// if (QXGlobal.shareGlobal.isAppStore) {
|
||||||
NSString *text = @"";
|
// NSString *text = @"";
|
||||||
if (model.messageType == QXRoomChatMessageTypeGift || model.messageType == QXRoomChatMessageTypeSystem) {
|
// if (model.messageType == QXRoomChatMessageTypeGift || model.messageType == QXRoomChatMessageTypeSystem) {
|
||||||
text = model.text;
|
// text = model.text;
|
||||||
}else{
|
// }else{
|
||||||
text = [NSString stringWithFormat:@"%@说:%@",model.FromUserInfo.nickname,model.text];
|
// text = [NSString stringWithFormat:@"%@说:%@",model.FromUserInfo.nickname,model.text];
|
||||||
}
|
// }
|
||||||
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:text];
|
// AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:text];
|
||||||
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"];
|
// utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"];
|
||||||
utterance.rate = 0.5 ;
|
// utterance.rate = 0.5 ;
|
||||||
utterance.pitchMultiplier = 1.0 ;
|
// utterance.pitchMultiplier = 1.0 ;
|
||||||
utterance.volume = 1.0 ;
|
// utterance.volume = 1.0 ;
|
||||||
[self.synthesizer speakUtterance:utterance];
|
// [self.synthesizer speakUtterance:utterance];
|
||||||
}
|
// }
|
||||||
#endif
|
#endif
|
||||||
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:self.dataArray.count - 1 inSection:0];
|
NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:self.dataArray.count - 1 inSection:0];
|
||||||
[self.tableView beginUpdates];
|
[self.tableView beginUpdates];
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
}
|
}
|
||||||
[weakSelf hide];
|
[weakSelf hide];
|
||||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||||
|
showToast(msg);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
}
|
}
|
||||||
-(void)setRoomId:(NSString *)roomId{
|
-(void)setRoomId:(NSString *)roomId{
|
||||||
_roomId = roomId;
|
_roomId = roomId;
|
||||||
|
self.alreadySongView.roomId = roomId;
|
||||||
[self getSongListCount];
|
[self getSongListCount];
|
||||||
}
|
}
|
||||||
-(void)getSongListCount{
|
-(void)getSongListCount{
|
||||||
@@ -99,6 +100,7 @@
|
|||||||
[self.titles replaceObjectAtIndex:1 withObject:self.alreadySongTitle];
|
[self.titles replaceObjectAtIndex:1 withObject:self.alreadySongTitle];
|
||||||
self.categoryView.titles = self.titles;
|
self.categoryView.titles = self.titles;
|
||||||
[self.categoryView reloadDataWithoutListContainer];
|
[self.categoryView reloadDataWithoutListContainer];
|
||||||
|
self.alreadySongView.roomId = self.roomId;
|
||||||
[self.alreadySongView updateSongList];
|
[self.alreadySongView updateSongList];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +158,7 @@
|
|||||||
-(void)showInView:(UIView *)view pitArray:(nonnull NSArray *)pitArray isCompere:(BOOL)isCompere{
|
-(void)showInView:(UIView *)view pitArray:(nonnull NSArray *)pitArray isCompere:(BOOL)isCompere{
|
||||||
self.requestSongView.pitArray = pitArray;
|
self.requestSongView.pitArray = pitArray;
|
||||||
self.alreadySongView.isCompere = isCompere;
|
self.alreadySongView.isCompere = isCompere;
|
||||||
|
self.alreadySongView.roomId = self.roomId;
|
||||||
self.bgView.y = SCREEN_HEIGHT;
|
self.bgView.y = SCREEN_HEIGHT;
|
||||||
[view addSubview:self];
|
[view addSubview:self];
|
||||||
[UIView animateWithDuration:0.3 animations:^{
|
[UIView animateWithDuration:0.3 animations:^{
|
||||||
|
|||||||
@@ -696,7 +696,7 @@
|
|||||||
_redBagSound.icon = @"room_redbag_sound_off";
|
_redBagSound.icon = @"room_redbag_sound_off";
|
||||||
_redBagSound.selIcon = @"room_redbag_sound_on";
|
_redBagSound.selIcon = @"room_redbag_sound_on";
|
||||||
_redBagSound.name = QXText(@"红包音效");
|
_redBagSound.name = QXText(@"红包音效");
|
||||||
_drifPop.selName = QXText(@"红包音效");
|
_redBagSound.selName = QXText(@"红包音效");
|
||||||
_redBagSound.type = QXRoomSettingTypeRedBagSound;
|
_redBagSound.type = QXRoomSettingTypeRedBagSound;
|
||||||
}
|
}
|
||||||
return _redBagSound;
|
return _redBagSound;
|
||||||
|
|||||||
@@ -217,6 +217,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
QXLOG(@"在线状态%@",QXGlobal.shareGlobal.offLineDict);
|
QXLOG(@"在线状态%@",QXGlobal.shareGlobal.offLineDict);
|
||||||
|
NSInteger is_offline = [[[QXGlobal shareGlobal].offLineDict objectForKey:self.pitModel.user_id?self.pitModel.user_id:@"0"] integerValue];
|
||||||
|
if (is_offline==1) {
|
||||||
|
self.offlineImageView.hidden = YES;
|
||||||
|
}else if(is_offline == 2){
|
||||||
|
if (self.noOffLine) {
|
||||||
|
self.offlineImageView.hidden = YES;
|
||||||
|
}else{
|
||||||
|
self.offlineImageView.hidden = NO;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
self.offlineImageView.hidden = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
-(void)speakInfo:(NSNotification*)notice{
|
-(void)speakInfo:(NSNotification*)notice{
|
||||||
if (self.noMicCycle) {
|
if (self.noMicCycle) {
|
||||||
|
|||||||
@@ -942,25 +942,28 @@
|
|||||||
if (self.myPitNumber == 9) {
|
if (self.myPitNumber == 9) {
|
||||||
// 排麦模式 弹出上麦
|
// 排麦模式 弹出上麦
|
||||||
if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
|
if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
|
||||||
MJWeakSelf
|
// MJWeakSelf
|
||||||
/// 自己在9号麦 管理麦位
|
// /// 自己在9号麦 管理麦位
|
||||||
QXRoomPitModel *pitModel = seatView.pitModel;
|
// QXRoomPitModel *pitModel = seatView.pitModel;
|
||||||
self.settingView.roomId = self.roomModel.room_info.room_id;
|
// self.settingView.roomId = self.roomModel.room_info.room_id;
|
||||||
self.settingView.isNoHaveLockMic = YES;
|
// self.settingView.isNoHaveLockMic = YES;
|
||||||
self.settingView.pitModel = pitModel;
|
// self.settingView.pitModel = pitModel;
|
||||||
self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
seatView.pitModel = pitModel;
|
// seatView.pitModel = pitModel;
|
||||||
// if (self.isPKMyRoom || self.isPKOtherRoom) {
|
// // if (self.isPKMyRoom || self.isPKOtherRoom) {
|
||||||
// [seatView hideCharm];
|
// // [seatView hideCharm];
|
||||||
// }
|
// // }
|
||||||
};
|
// };
|
||||||
self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
// [weakSelf showOnlineListWithPitNumber:pitModel.pit_number];
|
// // [weakSelf showOnlineListWithPitNumber:pitModel.pit_number];
|
||||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
// if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
[weakSelf.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
// [weakSelf.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
[self.settingView showInView:self.viewController.view];
|
// [self.settingView showInView:self.viewController.view];
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
|
[self.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if (self.roomModel.room_info.room_up_pit_type.intValue == 2) {
|
if (self.roomModel.room_info.room_up_pit_type.intValue == 2) {
|
||||||
@@ -974,25 +977,28 @@
|
|||||||
/// 排麦模式
|
/// 排麦模式
|
||||||
// 排麦模式 弹出上麦
|
// 排麦模式 弹出上麦
|
||||||
if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
|
if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
|
||||||
MJWeakSelf
|
// MJWeakSelf
|
||||||
/// 自己在9号麦 管理麦位
|
// /// 自己在9号麦 管理麦位
|
||||||
QXRoomPitModel *pitModel = seatView.pitModel;
|
// QXRoomPitModel *pitModel = seatView.pitModel;
|
||||||
self.settingView.roomId = self.roomModel.room_info.room_id;
|
// self.settingView.roomId = self.roomModel.room_info.room_id;
|
||||||
self.settingView.isNoHaveLockMic = YES;
|
// self.settingView.isNoHaveLockMic = YES;
|
||||||
self.settingView.pitModel = pitModel;
|
// self.settingView.pitModel = pitModel;
|
||||||
self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
seatView.pitModel = pitModel;
|
// seatView.pitModel = pitModel;
|
||||||
// if (self.isPKMyRoom || self.isPKOtherRoom) {
|
// // if (self.isPKMyRoom || self.isPKOtherRoom) {
|
||||||
// [seatView hideCharm];
|
// // [seatView hideCharm];
|
||||||
// }
|
// // }
|
||||||
};
|
// };
|
||||||
self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
// [weakSelf showOnlineListWithPitNumber:pitModel.pit_number];
|
// // [weakSelf showOnlineListWithPitNumber:pitModel.pit_number];
|
||||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
// if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
[weakSelf.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
// [weakSelf.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
[self.settingView showInView:self.viewController.view];
|
// [self.settingView showInView:self.viewController.view];
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
|
[self.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,24 +130,26 @@ static NSInteger maxSeat = 8;
|
|||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
if (self.myPitNumber == 9) {
|
if (self.myPitNumber == 9) {
|
||||||
MJWeakSelf
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
|
[self.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
|
}
|
||||||
|
// MJWeakSelf
|
||||||
/// 自己在9号麦 管理麦位
|
/// 自己在9号麦 管理麦位
|
||||||
QXRoomPitModel *pitModel = seatView.pitModel;
|
// QXRoomPitModel *pitModel = seatView.pitModel;
|
||||||
self.settingView.roomId = self.roomModel.room_info.room_id;
|
// self.settingView.roomId = self.roomModel.room_info.room_id;
|
||||||
self.settingView.pitModel = pitModel;
|
// self.settingView.pitModel = pitModel;
|
||||||
self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
seatView.pitModel = pitModel;
|
// seatView.pitModel = pitModel;
|
||||||
// if (self.isPKMyRoom || self.isPKOtherRoom) {
|
//// if (self.isPKMyRoom || self.isPKOtherRoom) {
|
||||||
// [seatView hideCharm];
|
//// [seatView hideCharm];
|
||||||
|
//// }
|
||||||
|
// };
|
||||||
|
// self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
|
// if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
|
// [self.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
// }
|
// }
|
||||||
};
|
// };
|
||||||
self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// [self.settingView showInView:self.viewController.view];
|
||||||
// [weakSelf showOnlineListWithPitNumber:pitModel.pit_number];
|
|
||||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
|
||||||
[weakSelf.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
[self.settingView showInView:self.viewController.view];
|
|
||||||
}else{
|
}else{
|
||||||
if (self.roomModel.room_info.room_up_pit_type.intValue == 2) {
|
if (self.roomModel.room_info.room_up_pit_type.intValue == 2) {
|
||||||
/// 自由麦请求
|
/// 自由麦请求
|
||||||
@@ -159,24 +161,27 @@ static NSInteger maxSeat = 8;
|
|||||||
}else{
|
}else{
|
||||||
// 排麦模式 弹出上麦
|
// 排麦模式 弹出上麦
|
||||||
if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
|
if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1) {
|
||||||
MJWeakSelf
|
// MJWeakSelf
|
||||||
/// 自己在9号麦 管理麦位
|
// /// 自己在9号麦 管理麦位
|
||||||
QXRoomPitModel *pitModel = seatView.pitModel;
|
// QXRoomPitModel *pitModel = seatView.pitModel;
|
||||||
self.settingView.roomId = self.roomModel.room_info.room_id;
|
// self.settingView.roomId = self.roomModel.room_info.room_id;
|
||||||
self.settingView.pitModel = pitModel;
|
// self.settingView.pitModel = pitModel;
|
||||||
self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// self.settingView.setSuccessBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
seatView.pitModel = pitModel;
|
// seatView.pitModel = pitModel;
|
||||||
// if (self.isPKMyRoom || self.isPKOtherRoom) {
|
// // if (self.isPKMyRoom || self.isPKOtherRoom) {
|
||||||
// [seatView hideCharm];
|
// // [seatView hideCharm];
|
||||||
// }
|
// // }
|
||||||
};
|
// };
|
||||||
self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
// self.settingView.clickHugBlock = ^(QXRoomPitModel * _Nonnull pitModel) {
|
||||||
// [weakSelf showOnlineListWithPitNumber:pitModel.pit_number];
|
// // [weakSelf showOnlineListWithPitNumber:pitModel.pit_number];
|
||||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
// if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
[weakSelf.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
// [weakSelf.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
[self.settingView showInView:self.viewController.view];
|
// [self.settingView showInView:self.viewController.view];
|
||||||
|
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
|
||||||
|
[self.delegate didHugSeatWithPitNumber:pitModel.pit_number];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||||
QXLOG(@"页面关闭");
|
QXLOG(@"页面关闭");
|
||||||
// [weakSelf popNiceGiftView];
|
// [weakSelf popNiceGiftView];
|
||||||
[weakSelf.homeVC popFirstRechargeView];
|
[weakSelf.homeVC popFirstRechargeViewOnlyRecharge:NO];
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
view.gotoActionBlock = ^{
|
view.gotoActionBlock = ^{
|
||||||
|
|||||||
@@ -80,7 +80,10 @@
|
|||||||
}
|
}
|
||||||
-(void)setModel:(QXAppVersionModel *)model{
|
-(void)setModel:(QXAppVersionModel *)model{
|
||||||
_model = model;
|
_model = model;
|
||||||
self.messageLabel.text = model.content;
|
NSData *data = [model.content dataUsingEncoding:NSUnicodeStringEncoding];
|
||||||
|
NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType};
|
||||||
|
NSAttributedString *html = [[NSAttributedString alloc]initWithData:data options:options documentAttributes:nil error:nil];
|
||||||
|
self.messageLabel.attributedText = html;
|
||||||
// self.messageLabel.text = @"动环监控撒谎大健康撒谎科技打撒好看到货时间阿克汉登记卡撒大花洒科技活动极客飒户djsakljdk电视剧啊快回家读书卡多撒u一还有第四u啊个ID撒个hi打撒低功耗设计啊开工大吉萨嘎合计打撒好多个健身卡刚回到家撒合计扩大活动时间卡号大健康撒谎登记卡到货时间啊客户端健身卡核打静待花开撒会尽快的撒回到家凯撒会尽快的撒回到家凯撒会尽快的撒大花洒客户端手机卡击凯撒籍卡打撒";
|
// self.messageLabel.text = @"动环监控撒谎大健康撒谎科技打撒好看到货时间阿克汉登记卡撒大花洒科技活动极客飒户djsakljdk电视剧啊快回家读书卡多撒u一还有第四u啊个ID撒个hi打撒低功耗设计啊开工大吉萨嘎合计打撒好多个健身卡刚回到家撒合计扩大活动时间卡号大健康撒谎登记卡到货时间啊客户端健身卡核打静待花开撒会尽快的撒回到家凯撒会尽快的撒回到家凯撒会尽快的撒大花洒客户端手机卡击凯撒籍卡打撒";
|
||||||
[self.messageLabel sizeToFit];
|
[self.messageLabel sizeToFit];
|
||||||
self.scrollView.contentSize = CGSizeMake(self.bgView.width-26, self.messageLabel.height);
|
self.scrollView.contentSize = CGSizeMake(self.bgView.width-26, self.messageLabel.height);
|
||||||
|
|||||||
@@ -40,25 +40,29 @@
|
|||||||
self.bgImageView.frame = self.bounds;
|
self.bgImageView.frame = self.bounds;
|
||||||
[self addSubview:self.bgImageView];
|
[self addSubview:self.bgImageView];
|
||||||
|
|
||||||
self.titleLabel = [[UILabel alloc] init];
|
|
||||||
self.titleLabel.font = [UIFont systemFontOfSize:14];
|
|
||||||
self.titleLabel.textColor = UIColor.whiteColor;
|
|
||||||
[self addSubview:self.titleLabel];
|
|
||||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.centerX.equalTo(self).offset(-ScaleWidth(30));
|
|
||||||
make.height.mas_equalTo(30);
|
|
||||||
make.centerY.equalTo(self).offset(2);
|
|
||||||
}];
|
|
||||||
|
|
||||||
self.giftImageView = [[UIImageView alloc] init];
|
self.giftImageView = [[UIImageView alloc] init];
|
||||||
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
|
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
[self addSubview:self.giftImageView];
|
[self addSubview:self.giftImageView];
|
||||||
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.titleLabel.mas_right).offset(5);
|
make.right.equalTo(self.bgImageView).offset(-55);
|
||||||
make.height.width.mas_equalTo(20);
|
make.height.width.mas_equalTo(20);
|
||||||
make.centerY.equalTo(self).offset(2);
|
make.centerY.equalTo(self).offset(2);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
self.titleLabel = [[UILabel alloc] init];
|
||||||
|
self.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||||
|
self.titleLabel.textColor = UIColor.whiteColor;
|
||||||
|
self.titleLabel.numberOfLines = 2;
|
||||||
|
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||||
|
[self addSubview:self.titleLabel];
|
||||||
|
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.equalTo(self.bgImageView).offset(15);
|
||||||
|
make.right.equalTo(self.giftImageView.mas_left);
|
||||||
|
make.centerY.equalTo(self).offset(2);
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.countLabel = [[UILabel alloc] init];
|
self.countLabel = [[UILabel alloc] init];
|
||||||
self.countLabel.font = [UIFont systemFontOfSize:14];
|
self.countLabel.font = [UIFont systemFontOfSize:14];
|
||||||
self.countLabel.textColor = UIColor.whiteColor;
|
self.countLabel.textColor = UIColor.whiteColor;
|
||||||
|
|||||||
@@ -466,8 +466,8 @@
|
|||||||
}
|
}
|
||||||
-(void)configData{
|
-(void)configData{
|
||||||
[self.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",self.model.box_price] forState:(UIControlStateNormal)];
|
[self.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",self.model.box_price] forState:(UIControlStateNormal)];
|
||||||
[self.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",self.model.box_price.integerValue*10] forState:(UIControlStateNormal)];
|
[self.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",self.model.box_price.integerValue*5] forState:(UIControlStateNormal)];
|
||||||
[self.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",self.model.box_price.integerValue*100] forState:(UIControlStateNormal)];
|
[self.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",self.model.box_price.integerValue*8] forState:(UIControlStateNormal)];
|
||||||
self.oneBtn.hidden = NO;
|
self.oneBtn.hidden = NO;
|
||||||
self.tenBtn.hidden = NO;
|
self.tenBtn.hidden = NO;
|
||||||
self.hundredBtn.hidden = NO;
|
self.hundredBtn.hidden = NO;
|
||||||
@@ -781,14 +781,14 @@
|
|||||||
break;
|
break;
|
||||||
case QXMeetDrawBtnTypeTen:
|
case QXMeetDrawBtnTypeTen:
|
||||||
{
|
{
|
||||||
self.titleLabel.text = @"抽十次";
|
self.titleLabel.text = @"抽五次";
|
||||||
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
|
[self.giftCoin setTitle:@"50币一次" forState:(UIControlStateNormal)];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QXMeetDrawBtnTypeHundred:
|
case QXMeetDrawBtnTypeHundred:
|
||||||
{
|
{
|
||||||
self.titleLabel.text = @"抽百次";
|
self.titleLabel.text = @"抽八次";
|
||||||
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
|
[self.giftCoin setTitle:@"80币一次" forState:(UIControlStateNormal)];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||