更新 YUMIHtmlUrl.h 和 YUMIHtmlUrl.m,新增首充相关的 URL 类型和路径;在 FeedBackViewController.h 和 FeedBackViewController.m 中,调整属性类型为强引用以增强内存管理;重构 FeedBackViewController 的视图设置逻辑,添加子视图的初始化方法以提高代码可读性;移除不再使用的 FeedBackViewController.xib 文件,优化项目结构;在 XPGiftBarView.h 和 XPGiftBarView.m 中,移除首充按钮相关代码,替换为新的首充视图逻辑;更新 XPWebViewController.h 和 XPWebViewController.m,调整 webview 属性为可写以支持动态更新;在 FirstRechargeManager.m 中,优化首充状态检查逻辑,确保在调试模式下始终显示首充信息。
This commit is contained in:
@@ -631,7 +631,6 @@
|
||||
547B30F92CB511700041E962 /* RoomBoomEntryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 547B30F82CB511700041E962 /* RoomBoomEntryView.m */; };
|
||||
5484E1FD2CA2897B008E8754 /* IAPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5484E1FC2CA2897B008E8754 /* IAPManager.m */; };
|
||||
548D54202CC208FD0084A2FF /* AlbumResourcePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 548D541F2CC208FD0084A2FF /* AlbumResourcePickerViewController.m */; };
|
||||
548E01C52C3F78360071C83D /* FeedBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 548E01C22C3F78360071C83D /* FeedBackViewController.xib */; };
|
||||
548E01C62C3F78360071C83D /* FeedBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01C42C3F78360071C83D /* FeedBackViewController.m */; };
|
||||
548E01C92C3F78600071C83D /* FeedBackConfigModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01C82C3F78600071C83D /* FeedBackConfigModel.m */; };
|
||||
548E01CC2C3FB1C70071C83D /* i18nGiftNameMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01CB2C3FB1C70071C83D /* i18nGiftNameMap.m */; };
|
||||
@@ -2907,7 +2906,6 @@
|
||||
5484E1FC2CA2897B008E8754 /* IAPManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IAPManager.m; sourceTree = "<group>"; };
|
||||
548D541E2CC208FD0084A2FF /* AlbumResourcePickerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AlbumResourcePickerViewController.h; sourceTree = "<group>"; };
|
||||
548D541F2CC208FD0084A2FF /* AlbumResourcePickerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AlbumResourcePickerViewController.m; sourceTree = "<group>"; };
|
||||
548E01C22C3F78360071C83D /* FeedBackViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FeedBackViewController.xib; sourceTree = "<group>"; };
|
||||
548E01C32C3F78360071C83D /* FeedBackViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeedBackViewController.h; sourceTree = "<group>"; };
|
||||
548E01C42C3F78360071C83D /* FeedBackViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FeedBackViewController.m; sourceTree = "<group>"; };
|
||||
548E01C72C3F78600071C83D /* FeedBackConfigModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeedBackConfigModel.h; sourceTree = "<group>"; };
|
||||
@@ -5410,7 +5408,6 @@
|
||||
children = (
|
||||
548E01C32C3F78360071C83D /* FeedBackViewController.h */,
|
||||
548E01C42C3F78360071C83D /* FeedBackViewController.m */,
|
||||
548E01C22C3F78360071C83D /* FeedBackViewController.xib */,
|
||||
14DCAD12299B9B0B00A7DD31 /* NewLogin */,
|
||||
E872308A26E89D5100B90D4F /* CustomView */,
|
||||
E8B825C926EA1231009E8E9F /* LoginVerifCodeViewController.h */,
|
||||
@@ -11827,7 +11824,6 @@
|
||||
E80EC83228ACD84000D133C5 /* emoji_00@2x.png in Resources */,
|
||||
E80EC89C28ACD84000D133C5 /* emoji_50@2x.png in Resources */,
|
||||
E80EC87A28ACD84000D133C5 /* emoji_113@2x.png in Resources */,
|
||||
548E01C52C3F78360071C83D /* FeedBackViewController.xib in Resources */,
|
||||
23FF25622ABAE6310064E904 /* pi_room_game_fine_love.svga in Resources */,
|
||||
23FF42672AA5CFBB0055733C /* home_sound_wave.gif in Resources */,
|
||||
4C1392A12D71675900A6DFB5 /* coincoin.mp4 in Resources */,
|
||||
|
@@ -117,7 +117,9 @@ typedef NS_ENUM(NSUInteger, URLType) {
|
||||
// 新排行榜
|
||||
kRankV2,
|
||||
kVIP,
|
||||
kTransfer
|
||||
kTransfer,
|
||||
kFirstChargeHomeIndex,
|
||||
kFirstChargeBanner,
|
||||
};
|
||||
|
||||
NSString * const URLWithType(URLType type);
|
||||
|
@@ -32,7 +32,9 @@ NSString * const URLWithType(URLType type) {
|
||||
@(kEventDetailPath) : @"modules/eventDetails/index.html?eventId=",
|
||||
@(kRankV2) : @"modules/newRank/index.html",
|
||||
@(kVIP) : @"modules/vip_Center/index.html",
|
||||
@(kTransfer) : @"modules/rechargeAgent/index.html#/myTransfer"
|
||||
@(kTransfer) : @"modules/rechargeAgent/index.html#/myTransfer",
|
||||
@(kFirstChargeBanner) : @"modules/firstRechargeBonus/First_Bonus.html",
|
||||
@(kFirstChargeHomeIndex) : @"modules/firstRechargeBonus/index.html",
|
||||
|
||||
};
|
||||
NSString * newUrl = [newDic objectForKey:@(type)];
|
||||
|
@@ -11,28 +11,28 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FeedBackViewController : MvpViewController
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIScrollView *scrollView;
|
||||
@property (nonatomic, strong) IBOutlet UIView *scrollContentView;
|
||||
@property (nonatomic, strong) UIScrollView *scrollView;
|
||||
@property (nonatomic, strong) UIView *scrollContentView;
|
||||
|
||||
@property (nonatomic, weak) IBOutlet UIButton *closeKeyboardButton;
|
||||
@property (nonatomic, strong) UIButton *closeKeyboardButton;
|
||||
|
||||
@property (nonatomic, weak) IBOutlet UILabel *title_1;
|
||||
@property (nonatomic, weak) IBOutlet UILabel *title_2;
|
||||
@property (nonatomic, weak) IBOutlet UILabel *title_3;
|
||||
@property (nonatomic, weak) IBOutlet UILabel *title_4;
|
||||
@property (nonatomic, strong) UILabel *title_1;
|
||||
@property (nonatomic, strong) UILabel *title_2;
|
||||
@property (nonatomic, strong) UILabel *title_3;
|
||||
@property (nonatomic, strong) UILabel *title_4;
|
||||
|
||||
@property (nonatomic, weak) IBOutlet UICollectionViewFlowLayout *typeCollectionLayout;
|
||||
@property (nonatomic, weak) IBOutlet UICollectionView *typeCollectionView;
|
||||
@property (nonatomic, strong) UICollectionViewFlowLayout *typeCollectionLayout;
|
||||
@property (nonatomic, strong) UICollectionView *typeCollectionView;
|
||||
|
||||
@property (nonatomic, weak) IBOutlet UITextView *feedbackTextView;
|
||||
@property (nonatomic, weak) IBOutlet UILabel *feedbackPlaceholderLabel;
|
||||
@property (nonatomic, weak) IBOutlet UILabel *feedbackCharCountLabel;
|
||||
@property (nonatomic, weak) IBOutlet UILabel *feedbackCharLimitLabel;
|
||||
@property (nonatomic, strong) UITextView *feedbackTextView;
|
||||
@property (nonatomic, strong) UILabel *feedbackPlaceholderLabel;
|
||||
@property (nonatomic, strong) UILabel *feedbackCharCountLabel;
|
||||
@property (nonatomic, strong) UILabel *feedbackCharLimitLabel;
|
||||
|
||||
@property (nonatomic, weak) IBOutlet UIButton *uploadImageButton;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *uploadImageView;
|
||||
@property (nonatomic, strong) UIButton *uploadImageButton;
|
||||
@property (nonatomic, strong) UIImageView *uploadImageView;
|
||||
|
||||
@property (nonatomic, weak) IBOutlet UITextField *contactTextField;
|
||||
@property (nonatomic, strong) UITextField *contactTextField;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -248,17 +248,10 @@
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
[self setupFakeTopBar];
|
||||
[self setupSubviews];
|
||||
|
||||
[self.closeKeyboardButton setTitle:@"" forState:UIControlStateNormal];
|
||||
|
||||
self.typeCollectionView.delegate = self;
|
||||
self.typeCollectionView.dataSource = self;
|
||||
self.typeCollectionView.allowsSelection = YES;
|
||||
[self.typeCollectionView registerClass:[TypeCollectionCell class] forCellWithReuseIdentifier:@"cell"];
|
||||
|
||||
self.feedbackTextView.delegate = self;
|
||||
self.feedbackTextView.textContainerInset = UIEdgeInsetsMake(8, 8, 20, 8);
|
||||
|
||||
self.title_1.textColor = [UIColor blackColor];
|
||||
self.title_2.textColor = [UIColor blackColor];
|
||||
self.title_3.textColor = [UIColor blackColor];
|
||||
@@ -295,11 +288,9 @@
|
||||
self.feedbackCharLimitLabel.text = @"/300";
|
||||
}
|
||||
|
||||
[self.uploadImageButton setTitle:@"" forState:UIControlStateNormal];
|
||||
|
||||
|
||||
UIColor *placeholderColor = UIColorFromRGB(0xacb0b7);
|
||||
self.contactTextField.layer.cornerRadius = 8;
|
||||
self.contactTextField.layer.masksToBounds = YES;
|
||||
self.contactTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"FeedBackViewController5")
|
||||
attributes:@{NSForegroundColorAttributeName: placeholderColor}];
|
||||
|
||||
@@ -320,6 +311,35 @@
|
||||
self.submitButton.enabled = NO;
|
||||
}
|
||||
|
||||
- (void)setupSubviews {
|
||||
// 添加主要的视图层次结构
|
||||
[self.view addSubview:self.scrollView];
|
||||
[self.scrollView addSubview:self.scrollContentView];
|
||||
[self.scrollContentView addSubview:self.closeKeyboardButton];
|
||||
|
||||
// 添加标题标签
|
||||
[self.scrollContentView addSubview:self.title_1];
|
||||
[self.scrollContentView addSubview:self.title_2];
|
||||
[self.scrollContentView addSubview:self.title_3];
|
||||
[self.scrollContentView addSubview:self.title_4];
|
||||
|
||||
// 添加类型选择集合视图
|
||||
[self.scrollContentView addSubview:self.typeCollectionView];
|
||||
|
||||
// 添加反馈文本视图和相关标签
|
||||
[self.scrollContentView addSubview:self.feedbackTextView];
|
||||
[self.scrollContentView addSubview:self.feedbackPlaceholderLabel];
|
||||
[self.scrollContentView addSubview:self.feedbackCharCountLabel];
|
||||
[self.scrollContentView addSubview:self.feedbackCharLimitLabel];
|
||||
|
||||
// 添加上传图片相关视图
|
||||
[self.scrollContentView addSubview:self.uploadImageButton];
|
||||
[self.scrollContentView addSubview:self.uploadImageView];
|
||||
|
||||
// 添加联系方式输入框
|
||||
[self.scrollContentView addSubview:self.contactTextField];
|
||||
}
|
||||
|
||||
- (void)setupFakeTopBar {
|
||||
UIView *fakeTopBar = [[UIView alloc] init];
|
||||
fakeTopBar.backgroundColor = UIColorFromRGB(0xebecf3);
|
||||
@@ -540,14 +560,15 @@
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)didTapUploadImageButton:(id)sender {
|
||||
- (void)didTapUploadImageButton:(id)sender {
|
||||
[self showPhotoSelectionSheet];
|
||||
}
|
||||
|
||||
- (IBAction)didTapSubmitButton:(id)sender {
|
||||
- (void)didTapSubmitButton:(id)sender {
|
||||
[self uploadAvatar];
|
||||
}
|
||||
- (IBAction)didTapCloseKeyboardButton:(id)sender {
|
||||
|
||||
- (void)didTapCloseKeyboardButton:(id)sender {
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
@@ -623,7 +644,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
- (IBAction)contactDidChange:(UITextField *)sender {
|
||||
- (void)contactDidChange:(UITextField *)sender {
|
||||
[self updateSubmitButtonStatus];
|
||||
}
|
||||
|
||||
@@ -749,77 +770,170 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
/*
|
||||
#pragma mark - Lazy Loading
|
||||
|
||||
- (UIScrollView *)scrollView {
|
||||
return nil;
|
||||
if (!_scrollView) {
|
||||
_scrollView = [[UIScrollView alloc] init];
|
||||
_scrollView.backgroundColor = [UIColor clearColor];
|
||||
_scrollView.showsVerticalScrollIndicator = NO;
|
||||
_scrollView.showsHorizontalScrollIndicator = NO;
|
||||
}
|
||||
return _scrollView;
|
||||
}
|
||||
|
||||
- (UIView *)scrollContentView {
|
||||
return nil;
|
||||
if (!_scrollContentView) {
|
||||
_scrollContentView = [[UIView alloc] init];
|
||||
_scrollContentView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return _scrollContentView;
|
||||
}
|
||||
|
||||
- (UIButton *)closeKeyboardButton {
|
||||
return nil;
|
||||
if (!_closeKeyboardButton) {
|
||||
_closeKeyboardButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_closeKeyboardButton.backgroundColor = [UIColor clearColor];
|
||||
[_closeKeyboardButton addTarget:self action:@selector(didTapCloseKeyboardButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _closeKeyboardButton;
|
||||
}
|
||||
|
||||
- (UILabel *)title_1 {
|
||||
return nil;
|
||||
if (!_title_1) {
|
||||
_title_1 = [UILabel labelInitWithText:@""
|
||||
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
|
||||
textColor:[UIColor blackColor]];
|
||||
}
|
||||
return _title_1;
|
||||
}
|
||||
|
||||
- (UILabel *)title_2 {
|
||||
return nil;
|
||||
if (!_title_2) {
|
||||
_title_2 = [UILabel labelInitWithText:@""
|
||||
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
|
||||
textColor:[UIColor blackColor]];
|
||||
}
|
||||
return _title_2;
|
||||
}
|
||||
|
||||
- (UILabel *)title_3 {
|
||||
return nil;
|
||||
if (!_title_3) {
|
||||
_title_3 = [UILabel labelInitWithText:@""
|
||||
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
|
||||
textColor:[UIColor blackColor]];
|
||||
}
|
||||
return _title_3;
|
||||
}
|
||||
|
||||
- (UILabel *)title_4 {
|
||||
return nil;
|
||||
if (!_title_4) {
|
||||
_title_4 = [UILabel labelInitWithText:@""
|
||||
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
|
||||
textColor:[UIColor blackColor]];
|
||||
}
|
||||
return _title_4;
|
||||
}
|
||||
|
||||
- (UICollectionViewFlowLayout *)typeCollectionLayout {
|
||||
return nil;
|
||||
if (!_typeCollectionLayout) {
|
||||
_typeCollectionLayout = [[UICollectionViewFlowLayout alloc] init];
|
||||
_typeCollectionLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
}
|
||||
return _typeCollectionLayout;
|
||||
}
|
||||
|
||||
- (UICollectionView *)typeCollectionView {
|
||||
if (!_typeCollectionView) {
|
||||
_typeCollectionView = [[UICollectionView alloc] init];
|
||||
self.typeCollectionView.delegate = self;
|
||||
self.typeCollectionView.dataSource = self;
|
||||
self.typeCollectionView.allowsSelection = YES;
|
||||
[self.typeCollectionView registerClass:[TypeCollectionCell class] forCellWithReuseIdentifier:@"cell"];
|
||||
_typeCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:self.typeCollectionLayout];
|
||||
_typeCollectionView.backgroundColor = [UIColor clearColor];
|
||||
_typeCollectionView.delegate = self;
|
||||
_typeCollectionView.dataSource = self;
|
||||
_typeCollectionView.allowsSelection = YES;
|
||||
[_typeCollectionView registerClass:[TypeCollectionCell class] forCellWithReuseIdentifier:@"cell"];
|
||||
}
|
||||
return nil;
|
||||
return _typeCollectionView;
|
||||
}
|
||||
|
||||
- (UITextView *)feedbackTextView {
|
||||
return nil;
|
||||
if (!_feedbackTextView) {
|
||||
_feedbackTextView = [[UITextView alloc] init];
|
||||
_feedbackTextView.backgroundColor = UIColorFromRGB(0xf3f5fa);
|
||||
_feedbackTextView.layer.cornerRadius = 8;
|
||||
_feedbackTextView.layer.masksToBounds = YES;
|
||||
_feedbackTextView.font = [UIFont systemFontOfSize:14];
|
||||
_feedbackTextView.textColor = UIColorFromRGB(0x333333);
|
||||
_feedbackTextView.delegate = self;
|
||||
_feedbackTextView.textContainerInset = UIEdgeInsetsMake(8, 8, 20, 8);
|
||||
}
|
||||
return _feedbackTextView;
|
||||
}
|
||||
|
||||
- (UILabel *)feedbackPlaceholderLabel {
|
||||
return nil;
|
||||
if (!_feedbackPlaceholderLabel) {
|
||||
_feedbackPlaceholderLabel = [UILabel labelInitWithText:@""
|
||||
font:[UIFont systemFontOfSize:14]
|
||||
textColor:UIColorFromRGB(0xacb0b7)];
|
||||
_feedbackPlaceholderLabel.numberOfLines = 0;
|
||||
}
|
||||
return _feedbackPlaceholderLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)feedbackCharCountLabel {
|
||||
return nil;
|
||||
if (!_feedbackCharCountLabel) {
|
||||
_feedbackCharCountLabel = [UILabel labelInitWithText:@"0"
|
||||
font:[UIFont systemFontOfSize:12]
|
||||
textColor:UIColorFromRGB(0xa7acb3)];
|
||||
}
|
||||
return _feedbackCharCountLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)feedbackCharLimitLabel {
|
||||
return nil;
|
||||
if (!_feedbackCharLimitLabel) {
|
||||
_feedbackCharLimitLabel = [UILabel labelInitWithText:@"/300"
|
||||
font:[UIFont systemFontOfSize:12]
|
||||
textColor:UIColorFromRGB(0xa7acb3)];
|
||||
}
|
||||
return _feedbackCharLimitLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)uploadImageButton {
|
||||
return nil;
|
||||
if (!_uploadImageButton) {
|
||||
_uploadImageButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
_uploadImageButton.backgroundColor = UIColorFromRGB(0xf3f5fa);
|
||||
_uploadImageButton.layer.cornerRadius = 8;
|
||||
_uploadImageButton.layer.masksToBounds = YES;
|
||||
[_uploadImageButton setImage:kImage(@"feedback_upload_image") forState:UIControlStateNormal];
|
||||
[_uploadImageButton addTarget:self action:@selector(didTapUploadImageButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _uploadImageButton;
|
||||
}
|
||||
|
||||
- (UIImageView *)uploadImageView {
|
||||
return nil;
|
||||
if (!_uploadImageView) {
|
||||
_uploadImageView = [[UIImageView alloc] init];
|
||||
_uploadImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_uploadImageView.layer.cornerRadius = 8;
|
||||
_uploadImageView.layer.masksToBounds = YES;
|
||||
_uploadImageView.hidden = YES;
|
||||
}
|
||||
return _uploadImageView;
|
||||
}
|
||||
|
||||
- (UITextField *)contactTextField {
|
||||
return nil;
|
||||
if (!_contactTextField) {
|
||||
_contactTextField = [[UITextField alloc] init];
|
||||
_contactTextField.backgroundColor = UIColorFromRGB(0xf3f5fa);
|
||||
_contactTextField.layer.cornerRadius = 8;
|
||||
_contactTextField.layer.masksToBounds = YES;
|
||||
_contactTextField.font = [UIFont systemFontOfSize:14];
|
||||
_contactTextField.textColor = UIColorFromRGB(0x333333);
|
||||
_contactTextField.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 16, 0)];
|
||||
_contactTextField.leftViewMode = UITextFieldViewModeAlways;
|
||||
_contactTextField.rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 16, 0)];
|
||||
_contactTextField.rightViewMode = UITextFieldViewModeAlways;
|
||||
[_contactTextField addTarget:self action:@selector(contactDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
}
|
||||
return _contactTextField;
|
||||
}
|
||||
*/
|
||||
@end
|
||||
|
@@ -1,185 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_0" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FeedBackViewController">
|
||||
<connections>
|
||||
<outlet property="closeKeyboardButton" destination="iJX-Jh-gxM" id="dDw-EH-2Hq"/>
|
||||
<outlet property="contactTextField" destination="CwH-vq-rQN" id="Fdw-OK-Cq6"/>
|
||||
<outlet property="feedbackCharCountLabel" destination="wIP-nU-aNV" id="v90-TN-xil"/>
|
||||
<outlet property="feedbackCharLimitLabel" destination="nWM-qE-tbI" id="1IP-2E-kph"/>
|
||||
<outlet property="feedbackPlaceholderLabel" destination="Z6i-tU-MrX" id="RCE-xw-MjT"/>
|
||||
<outlet property="feedbackTextView" destination="YGp-Kx-326" id="Xf1-Ua-ntM"/>
|
||||
<outlet property="scrollContentView" destination="TUB-kp-u7C" id="egi-HU-3QE"/>
|
||||
<outlet property="scrollView" destination="X79-6C-RwG" id="v1E-AO-hDK"/>
|
||||
<outlet property="title_1" destination="lZI-L0-Qej" id="VVs-Js-70L"/>
|
||||
<outlet property="title_2" destination="2Xf-Na-4Rp" id="4rH-8E-n8G"/>
|
||||
<outlet property="title_3" destination="uUv-rc-eS9" id="ec1-Wq-YPq"/>
|
||||
<outlet property="title_4" destination="coA-sV-qbQ" id="Jrj-zU-XsM"/>
|
||||
<outlet property="typeCollectionLayout" destination="oac-gt-EMe" id="3LS-K7-uCt"/>
|
||||
<outlet property="typeCollectionView" destination="dW4-hu-tVt" id="z0i-uB-f1O"/>
|
||||
<outlet property="uploadImageButton" destination="E5N-xB-GCN" id="du5-p5-kiN"/>
|
||||
<outlet property="uploadImageView" destination="c7Q-Mf-HYy" id="Wsm-eG-pCC"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="390" height="844"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" id="X79-6C-RwG">
|
||||
<rect key="frame" x="0.0" y="0.0" width="390" height="844"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" id="TUB-kp-u7C">
|
||||
<rect key="frame" x="0.0" y="-91" width="390" height="844"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iJX-Jh-gxM">
|
||||
<rect key="frame" x="183" y="415" width="24" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="plain"/>
|
||||
<connections>
|
||||
<action selector="didTapCloseKeyboardButton:" destination="-1" eventType="touchUpInside" id="bL1-HI-yzv"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="手机号或邮箱" textAlignment="natural" minimumFontSize="17" id="CwH-vq-rQN">
|
||||
<rect key="frame" x="14" y="405" width="361" height="34"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.95294117649999999" green="0.96078431369999995" blue="0.98039215690000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.13333333333333333" green="0.14509803921568626" blue="0.17254901960784313" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<connections>
|
||||
<action selector="contactDidChange:" destination="-1" eventType="editingChanged" id="6XT-6l-wBY"/>
|
||||
<action selector="contactDidChange:" destination="-1" eventType="valueChanged" id="xLq-5F-K3Y"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="问题描述" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2Xf-Na-4Rp">
|
||||
<rect key="frame" x="14" y="411" width="361" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="YGp-Kx-326">
|
||||
<rect key="frame" x="14" y="347" width="361" height="150"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.95294117647058818" green="0.96078431372549022" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="textColor" red="0.13333333333333333" green="0.14509803921568626" blue="0.17254901960784313" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="8"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="上传截图" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uUv-rc-eS9">
|
||||
<rect key="frame" x="162" y="411" width="65.333333333333314" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="联系方式" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="coA-sV-qbQ">
|
||||
<rect key="frame" x="162" y="411" width="66" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" clipsSubviews="YES" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E5N-xB-GCN">
|
||||
<rect key="frame" x="157" y="384" width="76" height="76"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.95294117647058818" green="0.96078431372549022" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="plain" image="login_feedback_add_photo"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="8"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="didTapUploadImageButton:" destination="-1" eventType="touchUpInside" id="IbE-Gs-4hv"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" insetsLayoutMarginsFromSafeArea="NO" text="选择问题类型" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="lZI-L0-Qej">
|
||||
<rect key="frame" x="14" y="411" width="361" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="请输入..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Z6i-tU-MrX">
|
||||
<rect key="frame" x="167" y="413" width="56" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<color key="textColor" red="0.67450980392156867" green="0.69019607843137254" blue="0.71764705882352942" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="0/300" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wIP-nU-aNV">
|
||||
<rect key="frame" x="175" y="413" width="40" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<color key="textColor" red="0.65490196078431373" green="0.67450980392156867" blue="0.70196078431372544" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="0/300" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nWM-qE-tbI">
|
||||
<rect key="frame" x="175" y="413" width="40" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<color key="textColor" red="0.65490196079999996" green="0.67450980390000004" blue="0.70196078429999997" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="c7Q-Mf-HYy">
|
||||
<rect key="frame" x="157" y="384" width="76" height="76"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="8"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" keyboardDismissMode="interactive" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="dW4-hu-tVt">
|
||||
<rect key="frame" x="14" y="379" width="361" height="85"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="14" minimumInteritemSpacing="24" id="oac-gt-EMe">
|
||||
<size key="itemSize" width="128" height="128"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="-1" id="oe9-lT-67h"/>
|
||||
<outlet property="delegate" destination="-1" id="Jtp-9s-WHI"/>
|
||||
</connections>
|
||||
</collectionView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="Ybz-OB-v6o"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="iUq-aP-DL2"/>
|
||||
<viewLayoutGuide key="contentLayoutGuide" id="4zX-dN-GkU"/>
|
||||
<viewLayoutGuide key="frameLayoutGuide" id="8LH-Ya-NsS"/>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<gestureRecognizers/>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
<point key="canvasLocation" x="-373.28244274809157" y="-64.08450704225352"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="login_feedback_add_photo" width="16" height="16"/>
|
||||
</resources>
|
||||
</document>
|
@@ -523,7 +523,7 @@
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisVertical;
|
||||
_stackView.spacing = 24;
|
||||
_stackView.distribution = UIStackViewDistributionFillProportionally;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
@@ -74,7 +74,9 @@
|
||||
}
|
||||
|
||||
- (void)handleTapFirstCharge {
|
||||
|
||||
XPWebViewController *webVC = [[XPWebViewController alloc] initWithRoomUID:@""];
|
||||
webVC.url = URLWithType(kFirstChargeBanner);
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
@@ -91,6 +93,7 @@
|
||||
FirstRechargeModel *model = [FirstRechargeManager.sharedManager loadCurrentModel];
|
||||
if (![NSString isEmpty:model.chargeBanner]) {
|
||||
NetImageView *imageView = [[NetImageView alloc] init];
|
||||
imageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[imageView setCornerRadius:12];
|
||||
imageView.imageUrl = model.chargeBanner;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapFirstCharge)];
|
||||
|
@@ -125,6 +125,7 @@
|
||||
|
||||
[self.levelIndicatorView setupWithMaxLevel:self.currentSeriesItemVO.medalLevel];
|
||||
[self.levelIndicatorView setSelectedLevel:1 animated:NO];
|
||||
[self.levelIndicatorView setSeriesItems:detailItemVo.medalSeries];
|
||||
|
||||
// 设置指示器类型为带图片
|
||||
self.levelIndicatorView.indicatorType = MedalsLevelIndicatorTypeWithImage;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class MedalSeriesItemVo;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSInteger, MedalsLevelIndicatorType) {
|
||||
@@ -18,6 +18,7 @@ typedef NS_ENUM(NSInteger, MedalsLevelIndicatorType) {
|
||||
|
||||
@property (nonatomic, copy) void (^levelSelectedBlock)(NSInteger level);
|
||||
@property (nonatomic, assign) MedalsLevelIndicatorType indicatorType;
|
||||
@property (nonatomic, copy) NSArray <MedalSeriesItemVo *> *seriesItems;
|
||||
|
||||
- (void)setupWithMaxLevel:(NSInteger)maxLevel;
|
||||
- (void)setSelectedLevel:(NSInteger)level animated:(BOOL)animated;
|
||||
@@ -29,6 +30,12 @@ typedef NS_ENUM(NSInteger, MedalsLevelIndicatorType) {
|
||||
*/
|
||||
- (void)setImageUrl:(NSString *)imageUrl forLevel:(NSInteger)level;
|
||||
|
||||
/**
|
||||
* 设置系列数据,用于处理 MP4 和 PNG 资源
|
||||
* @param seriesItems MedalSeriesItemVo 数组
|
||||
*/
|
||||
- (void)setSeriesItems:(NSArray <MedalSeriesItemVo *> *)seriesItems;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -7,6 +7,9 @@
|
||||
|
||||
#import "MedalsLevelIndicatorView.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "MedalsModel.h"
|
||||
#import <QGVAPWrapView.h>
|
||||
#import "XPRoomGiftAnimationParser.h"
|
||||
|
||||
// 等级指示器视图
|
||||
@interface LevelItemView : UIView
|
||||
@@ -14,17 +17,24 @@
|
||||
@property (nonatomic, strong) UILabel *levelLabel;
|
||||
@property (nonatomic, strong) UIView *dotView; // 圆点视图
|
||||
@property (nonatomic, strong) NetImageView *imageView; // 图片视图
|
||||
@property (nonatomic, strong) VAPView *mp4View; // MP4 视图
|
||||
@property (nonatomic, strong) XPRoomGiftAnimationParser *mp4Parser; // MP4 解析器
|
||||
@property (nonatomic, assign) BOOL isSelected;
|
||||
@property (nonatomic, assign) NSInteger level;
|
||||
@property (nonatomic, assign) BOOL hasImage;
|
||||
@property (nonatomic, assign) BOOL hasMP4;
|
||||
@property (nonatomic, strong) UIImage *originalImage; // 保存原始彩色图片
|
||||
@property (nonatomic, strong) UIImage *grayImage; // 保存灰度图片
|
||||
@property (nonatomic, copy) NSString *cachedImageUrl; // 缓存图片URL,用于延迟加载
|
||||
@property (nonatomic, copy) NSString *cachedMP4Url; // 缓存MP4 URL,用于延迟加载
|
||||
|
||||
- (instancetype)initWithLevel:(NSInteger)level;
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated;
|
||||
- (void)setImageUrl:(NSString *)imageUrl;
|
||||
- (void)setMP4Url:(NSString *)mp4Url;
|
||||
- (void)createImageViewIfNeeded;
|
||||
- (void)createMP4ViewIfNeeded;
|
||||
- (void)stopMP4Playback;
|
||||
|
||||
@end
|
||||
|
||||
@@ -36,6 +46,7 @@
|
||||
_level = level;
|
||||
_isSelected = NO;
|
||||
_hasImage = NO;
|
||||
_hasMP4 = NO;
|
||||
|
||||
// 创建圆点视图
|
||||
_dotView = [[UIView alloc] init];
|
||||
@@ -98,24 +109,73 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setImageUrl:(NSString *)imageUrl {
|
||||
_hasImage = YES;
|
||||
_cachedImageUrl = imageUrl;
|
||||
- (void)createMP4ViewIfNeeded {
|
||||
if (_mp4View) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果已经创建了imageView,直接加载图片
|
||||
// 创建 MP4 视图
|
||||
_mp4View = [[VAPView alloc] init];
|
||||
_mp4View.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_mp4View.clipsToBounds = YES;
|
||||
[self addSubview:_mp4View];
|
||||
|
||||
[_mp4View mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.bottom.mas_equalTo(_dotView.mas_top).offset(-4);
|
||||
make.width.height.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
// 调整圆点位置
|
||||
[_dotView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(_mp4View.mas_bottom).offset(4);
|
||||
make.width.height.mas_equalTo(6);
|
||||
}];
|
||||
|
||||
// 如果有缓存的 MP4 URL,加载 MP4
|
||||
if (_cachedMP4Url) {
|
||||
[self loadMP4WithUrl:_cachedMP4Url];
|
||||
_cachedMP4Url = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setImageUrl:(NSString *)imageUrl {
|
||||
// 判断是 MP4 还是图片
|
||||
if ([imageUrl.lowercaseString hasSuffix:@"mp4"]) {
|
||||
[self setMP4Url:imageUrl];
|
||||
} else {
|
||||
_hasImage = YES;
|
||||
_hasMP4 = NO;
|
||||
_cachedImageUrl = imageUrl;
|
||||
|
||||
// 停止 MP4 播放
|
||||
[self stopMP4Playback];
|
||||
|
||||
// 如果已经创建了imageView,直接加载图片
|
||||
if (_imageView) {
|
||||
[self loadImageWithUrl:imageUrl];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setMP4Url:(NSString *)mp4Url {
|
||||
_hasMP4 = YES;
|
||||
_hasImage = NO;
|
||||
_cachedMP4Url = mp4Url;
|
||||
|
||||
// 隐藏图片视图
|
||||
if (_imageView) {
|
||||
[self loadImageWithUrl:imageUrl];
|
||||
_imageView.hidden = YES;
|
||||
}
|
||||
|
||||
// 如果已经创建了mp4View,直接加载MP4
|
||||
if (_mp4View) {
|
||||
[self loadMP4WithUrl:mp4Url];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)loadImageWithUrl:(NSString *)imageUrl {
|
||||
// 调试时使用测试URL
|
||||
#ifdef DEBUG
|
||||
NSString *testUrl = @"https://img.toto.im/mw600/66b3de17ly1i2jopju47bj20xc1e0dx4.jpg.webp";
|
||||
imageUrl = testUrl;
|
||||
NSLog(@"调试模式: 使用测试图片URL: %@", testUrl);
|
||||
#endif
|
||||
|
||||
// 加载图片并处理灰度效果
|
||||
@kWeakify(self);
|
||||
[_imageView loadImageWithUrl:imageUrl completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
|
||||
@@ -129,18 +189,62 @@
|
||||
}];
|
||||
}
|
||||
|
||||
// 更新图片效果
|
||||
- (void)updateImageEffect {
|
||||
if (!_hasImage || !_imageView) {
|
||||
return;
|
||||
- (void)loadMP4WithUrl:(NSString *)mp4Url {
|
||||
if (!_mp4Parser) {
|
||||
_mp4Parser = [[XPRoomGiftAnimationParser alloc] init];
|
||||
}
|
||||
|
||||
if (_isSelected && _originalImage) {
|
||||
// 选中状态:显示彩色图片
|
||||
self.imageView.image = _originalImage;
|
||||
} else if (!_isSelected && _grayImage) {
|
||||
// 非选中状态:显示灰度图片
|
||||
self.imageView.image = _grayImage;
|
||||
@kWeakify(self);
|
||||
[_mp4Parser parseWithURL:mp4Url
|
||||
completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
@kStrongify(self);
|
||||
if (![NSString isEmpty:videoUrl]) {
|
||||
[self.mp4View setMute:YES];
|
||||
[self.mp4View playHWDMP4:videoUrl repeatCount:-1 delegate:nil];
|
||||
|
||||
// 显示 MP4 视图,隐藏图片视图
|
||||
self.mp4View.hidden = NO;
|
||||
if (self.imageView) {
|
||||
self.imageView.hidden = YES;
|
||||
}
|
||||
|
||||
// MP4 加载完成后,应用当前的选中状态效果
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self updateImageEffect];
|
||||
});
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
// MP4 加载失败时的处理
|
||||
NSLog(@"MP4 加载失败: %@", error);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)stopMP4Playback {
|
||||
if (_mp4View) {
|
||||
[_mp4View stopHWDMP4];
|
||||
_mp4View.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// 更新图片效果
|
||||
- (void)updateImageEffect {
|
||||
if (_hasImage && _imageView) {
|
||||
if (_isSelected && _originalImage) {
|
||||
// 选中状态:显示彩色图片
|
||||
self.imageView.image = _originalImage;
|
||||
} else if (!_isSelected && _grayImage) {
|
||||
// 非选中状态:显示灰度图片
|
||||
self.imageView.image = _grayImage;
|
||||
}
|
||||
}
|
||||
|
||||
// MP4 的选中效果处理 - 使用简单的 alpha 透明度
|
||||
if (_hasMP4 && _mp4View) {
|
||||
if (_isSelected) {
|
||||
_mp4View.alpha = 1.0; // 选中状态:完全不透明
|
||||
} else {
|
||||
_mp4View.alpha = 0.3; // 非选中状态:半透明
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,8 +260,8 @@
|
||||
self.levelLabel.textColor = color;
|
||||
self.dotView.backgroundColor = color;
|
||||
|
||||
// 如果有图片,更新图片效果
|
||||
if (self.hasImage) {
|
||||
// 如果有图片或MP4,更新效果
|
||||
if (self.hasImage || self.hasMP4) {
|
||||
[self updateImageEffect];
|
||||
}
|
||||
};
|
||||
@@ -385,10 +489,14 @@
|
||||
|
||||
// 如果已经创建了视图,需要根据类型进行调整
|
||||
if (_levelItems.count > 0) {
|
||||
// 如果是带图片类型,创建 imageView
|
||||
// 如果是带图片类型,创建相应的视图
|
||||
if (indicatorType == MedalsLevelIndicatorTypeWithImage) {
|
||||
for (LevelItemView *item in _levelItems) {
|
||||
[item createImageViewIfNeeded];
|
||||
if (item.hasMP4) {
|
||||
[item createMP4ViewIfNeeded];
|
||||
} else if (item.hasImage) {
|
||||
[item createImageViewIfNeeded];
|
||||
}
|
||||
}
|
||||
}
|
||||
[self updateImageVisibility];
|
||||
@@ -401,6 +509,9 @@
|
||||
if (item.imageView) {
|
||||
item.imageView.hidden = (_indicatorType == MedalsLevelIndicatorTypeNormal);
|
||||
}
|
||||
if (item.mp4View) {
|
||||
item.mp4View.hidden = (_indicatorType == MedalsLevelIndicatorTypeNormal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,16 +522,44 @@
|
||||
|
||||
LevelItemView *item = _levelItems[level - 1];
|
||||
|
||||
// 根据指示器类型决定是否创建和加载图片
|
||||
// 根据指示器类型决定是否创建和加载图片/MP4
|
||||
if (_indicatorType == MedalsLevelIndicatorTypeWithImage) {
|
||||
[item createImageViewIfNeeded]; // 确保创建了 imageView
|
||||
// 判断是 MP4 还是图片
|
||||
if ([imageUrl.lowercaseString hasSuffix:@"mp4"]) {
|
||||
[item createMP4ViewIfNeeded]; // 确保创建了 mp4View
|
||||
} else {
|
||||
[item createImageViewIfNeeded]; // 确保创建了 imageView
|
||||
}
|
||||
[item setImageUrl:imageUrl];
|
||||
} else {
|
||||
// 在普通模式下,只保存URL,不创建 imageView
|
||||
// 在普通模式下,只保存URL,不创建视图
|
||||
[item setImageUrl:imageUrl];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setSeriesItems:(NSArray <MedalSeriesItemVo *> *)seriesItems {
|
||||
_seriesItems = seriesItems;
|
||||
|
||||
// 如果没有系列数据或者等级指示器还没有创建,直接返回
|
||||
if (!seriesItems || seriesItems.count == 0 || _levelItems.count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取第一个系列项
|
||||
MedalSeriesItemVo *firstSeriesItem = [seriesItems xpSafeObjectAtIndex:0];
|
||||
if (!firstSeriesItem || !firstSeriesItem.medalVos) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 为每个等级设置对应的图片/MP4
|
||||
for (NSInteger i = 0; i < firstSeriesItem.medalVos.count && i < _levelItems.count; i++) {
|
||||
MedalVo *medalVo = [firstSeriesItem.medalVos xpSafeObjectAtIndex:i];
|
||||
if (medalVo && medalVo.picUrl) {
|
||||
[self setImageUrl:medalVo.picUrl forLevel:i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)handleTap:(UITapGestureRecognizer *)gesture {
|
||||
CGPoint location = [gesture locationInView:self];
|
||||
|
||||
|
@@ -518,11 +518,11 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
}
|
||||
///转赠钻石
|
||||
-(void)pushGiveDiamondVC{
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] initWithRoomUID:nil];
|
||||
webVC.url = URLWithType(kTransfer);
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
// XPMineGiveDiamondVC *giveDiamondVC = [[XPMineGiveDiamondVC alloc] initWithUserModel:self.userInfo];
|
||||
// [self.navigationController pushViewController:giveDiamondVC animated:YES];
|
||||
// XPWebViewController * webVC =[[XPWebViewController alloc] initWithRoomUID:nil];
|
||||
// webVC.url = URLWithType(kTransfer);
|
||||
// [self.navigationController pushViewController:webVC animated:YES];
|
||||
XPMineGiveDiamondVC *giveDiamondVC = [[XPMineGiveDiamondVC alloc] initWithUserModel:self.userInfo];
|
||||
[self.navigationController pushViewController:giveDiamondVC animated:YES];
|
||||
}
|
||||
///点击充值
|
||||
-(void)pushThirdPartyPayVC{
|
||||
|
@@ -13,7 +13,6 @@
|
||||
#import <JXCategoryView/JXCategoryView.h>
|
||||
#import <MJRefresh/MJRefresh.h>
|
||||
#import "SDWebImageManager.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
///Tool
|
||||
#import "Api+Home.h"
|
||||
@@ -402,9 +401,9 @@ FirstRechargeManagerDelegate>
|
||||
|
||||
// 注册首充管理器监听
|
||||
[FirstRechargeManager sharedManager].delegate = self;
|
||||
[[FirstRechargeManager sharedManager] startMonitoring];
|
||||
|
||||
// [self.presenter getUserFirstChargeStatus];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[[FirstRechargeManager sharedManager] startMonitoring];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,36 +817,86 @@ FirstRechargeManagerDelegate>
|
||||
// 如果已经有弹窗在显示,先移除它
|
||||
[self removeFirstChargePopup];
|
||||
|
||||
// 创建背景视图
|
||||
self.firstChargeBackgroundView = [[UIView alloc] initWithFrame:self.view.bounds];
|
||||
// 获取 keyWindow 以确保盖在 tabbar 上
|
||||
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
|
||||
if (!keyWindow) {
|
||||
keyWindow = [UIApplication sharedApplication].windows.firstObject;
|
||||
}
|
||||
|
||||
// 创建背景视图,使用 keyWindow 的 bounds
|
||||
self.firstChargeBackgroundView = [[UIView alloc] initWithFrame:keyWindow.bounds];
|
||||
self.firstChargeBackgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
|
||||
|
||||
// 添加点击手势
|
||||
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleBackgroundTap:)];
|
||||
[self.firstChargeBackgroundView addGestureRecognizer:tapGesture];
|
||||
|
||||
// 添加背景视图
|
||||
[self.view addSubview:self.firstChargeBackgroundView];
|
||||
// 添加到 keyWindow 上,确保盖在 tabbar 上
|
||||
[keyWindow addSubview:self.firstChargeBackgroundView];
|
||||
|
||||
// 创建并配置 web 视图
|
||||
self.firstChargeWebVC = [[XPWebViewController alloc] initWithRoomUID:@""];
|
||||
self.firstChargeWebVC.isPush = NO;
|
||||
self.firstChargeWebVC.url = @"https://jandan.net/pic";
|
||||
[self addChildViewController:self.firstChargeWebVC];
|
||||
self.firstChargeWebVC.url = URLWithType(kFirstChargeHomeIndex);
|
||||
|
||||
// 获取当前的根视图控制器来添加子控制器
|
||||
UIViewController *rootViewController = keyWindow.rootViewController;
|
||||
if ([rootViewController isKindOfClass:[UINavigationController class]]) {
|
||||
rootViewController = [(UINavigationController *)rootViewController topViewController];
|
||||
} else if ([rootViewController isKindOfClass:[UITabBarController class]]) {
|
||||
UITabBarController *tabBarController = (UITabBarController *)rootViewController;
|
||||
rootViewController = tabBarController.selectedViewController;
|
||||
if ([rootViewController isKindOfClass:[UINavigationController class]]) {
|
||||
rootViewController = [(UINavigationController *)rootViewController topViewController];
|
||||
}
|
||||
}
|
||||
|
||||
[rootViewController addChildViewController:self.firstChargeWebVC];
|
||||
[self.firstChargeBackgroundView addSubview:self.firstChargeWebVC.view];
|
||||
self.firstChargeWebVC.view.frame = CGRectMake(0, 0, KScreenWidth/2, KScreenHeight/2);
|
||||
[self.firstChargeWebVC didMoveToParentViewController:rootViewController];
|
||||
|
||||
self.firstChargeWebVC.view.backgroundColor = [UIColor clearColor];
|
||||
self.firstChargeWebVC.webview.backgroundColor = [UIColor clearColor];
|
||||
self.firstChargeWebVC.webview.opaque = NO;
|
||||
self.firstChargeWebVC.webview.scrollView.backgroundColor = [UIColor clearColor];
|
||||
self.firstChargeWebVC.view.frame = CGRectMake(0, 0, KScreenWidth - 40, KScreenHeight*2/3);
|
||||
self.firstChargeWebVC.view.center = self.firstChargeBackgroundView.center;
|
||||
|
||||
// 添加关闭按钮
|
||||
// UIButton *closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
// [closeButton setTitle:@"✕" forState:UIControlStateNormal];
|
||||
// [closeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
// closeButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
||||
// [closeButton addTarget:self action:@selector(removeFirstChargePopup) forControlEvents:UIControlEventTouchUpInside];
|
||||
// closeButton.frame = CGRectMake(0, 0, 30, 30);
|
||||
// closeButton.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
|
||||
// closeButton.layer.cornerRadius = 15;
|
||||
// [self.firstChargeBackgroundView addSubview:closeButton];
|
||||
//
|
||||
// // 设置关闭按钮位置(webView 右上角)
|
||||
// CGRect webViewFrame = self.firstChargeWebVC.view.frame;
|
||||
// closeButton.center = CGPointMake(CGRectGetMaxX(webViewFrame) - 15, CGRectGetMinY(webViewFrame) + 15);
|
||||
|
||||
// 3秒后自动移除
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self removeFirstChargePopup];
|
||||
});
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// [self removeFirstChargePopup];
|
||||
// });
|
||||
}
|
||||
|
||||
// 处理背景点击事件
|
||||
- (void)handleBackgroundTap:(UITapGestureRecognizer *)gesture {
|
||||
// 获取点击位置
|
||||
CGPoint location = [gesture locationInView:self.firstChargeBackgroundView];
|
||||
if (!CGRectContainsPoint(self.firstChargeWebVC.view.frame, location)) {
|
||||
|
||||
// 检查是否点击在 webView 区域外
|
||||
if (self.firstChargeWebVC && self.firstChargeWebVC.view) {
|
||||
CGRect webViewFrame = self.firstChargeWebVC.view.frame;
|
||||
if (!CGRectContainsPoint(webViewFrame, location)) {
|
||||
// 点击在 webView 外部,移除弹窗
|
||||
[self removeFirstChargePopup];
|
||||
}
|
||||
} else {
|
||||
// 如果 webView 不存在,直接移除弹窗
|
||||
[self removeFirstChargePopup];
|
||||
}
|
||||
}
|
||||
@@ -855,6 +904,7 @@ FirstRechargeManagerDelegate>
|
||||
// 修改移除弹窗的方法
|
||||
- (void)removeFirstChargePopup {
|
||||
if (self.firstChargeWebVC) {
|
||||
[self.firstChargeWebVC willMoveToParentViewController:nil];
|
||||
[self.firstChargeWebVC.view removeFromSuperview];
|
||||
[self.firstChargeWebVC removeFromParentViewController];
|
||||
self.firstChargeWebVC = nil;
|
||||
|
@@ -32,8 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong) XPGiftCountModel *giftCountModel;
|
||||
///钱包信息
|
||||
@property (nonatomic,strong) WalletInfoModel *walletInfoModel;
|
||||
///是否展示首充
|
||||
@property (nonatomic,assign) BOOL isShowFirstRecharge;
|
||||
|
||||
///是否可用
|
||||
@property (nonatomic,assign) BOOL sendButtonIsEnable;
|
||||
|
||||
|
@@ -18,6 +18,10 @@
|
||||
///View
|
||||
#import "XPGiftCountCollectionViewCell.h"
|
||||
#import "XPGiftCountView.h"
|
||||
|
||||
#import "MoliMoneyLabel.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
|
||||
@interface XPGiftBarView ()<UITextFieldDelegate, XPGiftCountViewDelegate>
|
||||
|
||||
///余额
|
||||
@@ -36,8 +40,7 @@
|
||||
@property (nonatomic,strong) UIButton *arrowButton;
|
||||
///赠送
|
||||
@property (nonatomic,strong) UIButton *sendGiftButton;
|
||||
///首充
|
||||
@property (nonatomic,strong) UIButton *firstRechargeButton;
|
||||
|
||||
///自定义个数
|
||||
@property (nonatomic,strong) UIView *customCountView;
|
||||
//输入框
|
||||
@@ -47,6 +50,9 @@
|
||||
///送礼物的个数
|
||||
@property (nonatomic,strong) XPGiftCountView *giftCountView;
|
||||
|
||||
@property (nonatomic, strong) UIView *firstChargeView;
|
||||
@property (nonatomic, strong) MoliMoneyLabel *moneyLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPGiftBarView
|
||||
@@ -113,18 +119,13 @@
|
||||
self.countLabel.text = countStr;
|
||||
}
|
||||
|
||||
- (void)firstRechargeButtonAction:(UIButton *)sender{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftBarViewDidClickFirstRecharge:)]) {
|
||||
[self.delegate xPGiftBarViewDidClickFirstRecharge:self];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor= [UIColor clearColor];
|
||||
[self addSubview:self.balanceLabel];
|
||||
[self addSubview:self.rechargeStackView];
|
||||
[self addSubview:self.firstRechargeButton];
|
||||
[self addSubview:self.firstChargeView];
|
||||
[self addSubview:self.sendOperationView];
|
||||
|
||||
[self.rechargeStackView addArrangedSubview:self.rechargeLabel];
|
||||
@@ -136,6 +137,14 @@
|
||||
|
||||
[self.customCountView addSubview:self.editTextFiled];
|
||||
[self.customCountView addSubview:self.sureButton];
|
||||
|
||||
FirstRechargeModel *model = [[FirstRechargeManager sharedManager] loadCurrentModel];
|
||||
if (model && model.chargeStatus == NO) {
|
||||
self.firstChargeView.hidden = NO;
|
||||
[self.moneyLabel updateContent:@"Bonus >"];
|
||||
} else {
|
||||
self.firstChargeView.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -154,9 +163,9 @@
|
||||
make.leading.mas_equalTo(self.balanceLabel.mas_trailing).offset(12);
|
||||
}];
|
||||
|
||||
[self.firstRechargeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(17, 8));
|
||||
make.leading.mas_equalTo(self.rechargeStackView.mas_trailing).offset(4);
|
||||
[self.firstChargeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(68, 23));
|
||||
make.leading.mas_equalTo(self.rechargeStackView.mas_leading);
|
||||
make.centerY.mas_equalTo(self.rechargeStackView);
|
||||
}];
|
||||
|
||||
@@ -171,7 +180,6 @@
|
||||
make.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
|
||||
[self.arrowButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(30, 30));
|
||||
}];
|
||||
@@ -180,7 +188,6 @@
|
||||
make.size.mas_equalTo(CGSizeMake(67, 30));
|
||||
}];
|
||||
|
||||
|
||||
[self.editTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.customCountView).offset(15);
|
||||
make.trailing.mas_equalTo(self.sureButton.mas_leading).offset(-10);
|
||||
@@ -306,11 +313,6 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setIsShowFirstRecharge:(BOOL)isShowFirstRecharge {
|
||||
// self.firstRechargeButton.hidden = !isShowFirstRecharge;
|
||||
self.firstRechargeButton.hidden = YES;
|
||||
}
|
||||
|
||||
- (void)setType:(GiftSegmentType)type {
|
||||
_type = type;
|
||||
if (!self.giftCountView.hidden) {
|
||||
@@ -532,14 +534,32 @@
|
||||
return _giftCountView;
|
||||
}
|
||||
|
||||
- (UIButton *)firstRechargeButton {
|
||||
if (!_firstRechargeButton) {
|
||||
_firstRechargeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_firstRechargeButton setImage:[UIImage imageNamed:@"pi_new_gift_first_recharge_bg"] forState:UIControlStateNormal];
|
||||
[_firstRechargeButton setImage:[UIImage imageNamed:@"pi_new_gift_first_recharge_bg"] forState:UIControlStateSelected];
|
||||
[_firstRechargeButton addTarget:self action:@selector(firstRechargeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _firstRechargeButton;
|
||||
- (UIView *)firstChargeView {
|
||||
if (!_firstChargeView) {
|
||||
_firstChargeView = [[UIView alloc] init];
|
||||
_firstChargeView.userInteractionEnabled = YES;
|
||||
[_firstChargeView addGradientBackgroundWithColors:@[
|
||||
UIColorFromRGB(0xFFE347),
|
||||
UIColorFromRGB(0xFF9a51),
|
||||
] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(1, 0.5) cornerRadius:23/2];
|
||||
[_firstChargeView setCornerRadius:23/2];
|
||||
|
||||
[_firstChargeView addSubview:self.moneyLabel];
|
||||
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(_firstChargeView).insets(UIEdgeInsetsMake(5, 5, 5, 5));
|
||||
}];
|
||||
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTagRecharge:)];
|
||||
[_firstChargeView addGestureRecognizer:tap];
|
||||
}
|
||||
return _firstChargeView;
|
||||
}
|
||||
|
||||
- (MoliMoneyLabel *)moneyLabel {
|
||||
if (!_moneyLabel) {
|
||||
_moneyLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0x582B00) font:kFontSemibold(10) moneyPostion:1 moneySize:CGSizeMake(15, 15)];
|
||||
}
|
||||
return _moneyLabel;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -964,7 +964,6 @@ UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
|
||||
#pragma mark - XPGiftProtocol
|
||||
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
self.headTypeView.isShowFirstRecharge = userInfo.isFirstCharge;
|
||||
self.giftBarView.isShowFirstRecharge = userInfo.isFirstCharge;
|
||||
self.giftInfoView.curUserNobleLevel = userInfo.userVipInfoVO.vipLevel;
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface XPWebViewController : BaseViewController
|
||||
///
|
||||
@property (nonatomic,weak) id<XPWebViewControllerDelegate> delegate;
|
||||
@property (strong, nonatomic,readonly) WKWebView *webview;
|
||||
@property (strong, nonatomic) WKWebView *webview;
|
||||
///跳转方式,如果push的直接pushViewController,不用dismissViewControllerAnimated后再pushViewController
|
||||
@property (nonatomic,assign) BOOL isPush;
|
||||
|
||||
|
@@ -81,7 +81,7 @@ typedef NS_ENUM(NSUInteger, RightNavigationPushType){
|
||||
|
||||
@interface XPWebViewController () <WKNavigationDelegate, WKScriptMessageHandler, XCShareViewDelegate,XPWebViewNavViewDelegate>
|
||||
@property (nonatomic,strong) WalletInfoModel *model ;
|
||||
@property (strong, nonatomic) WKWebView *webview;
|
||||
//@property (strong, nonatomic) WKWebView *webview;
|
||||
@property (strong, nonatomic) UIProgressView *progressView;
|
||||
@property (nonatomic, strong) WKUserContentController *pi_userContentController;
|
||||
///分享的内容
|
||||
@@ -881,65 +881,65 @@ NSString * const kJSShowShareCallBack = @"showShareAction";
|
||||
}
|
||||
|
||||
- (WKWebView *)webview {
|
||||
if (_webview == nil) {
|
||||
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc]init];
|
||||
if (_webview == nil) {
|
||||
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc]init];
|
||||
|
||||
if (@available(iOS 10.0, *)) {
|
||||
configuration.mediaTypesRequiringUserActionForPlayback = NO;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
if (@available(iOS 10.0, *)) {
|
||||
configuration.mediaTypesRequiringUserActionForPlayback = NO;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
|
||||
NSString *uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid];
|
||||
NSString *uid = [[AccountInfoStorage instance] getUid];
|
||||
NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid];
|
||||
|
||||
WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
|
||||
[self.pi_userContentController addUserScript:cookieScript];
|
||||
///禁止缩放
|
||||
NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1,user-scalable=no\">' );";
|
||||
WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
|
||||
[self.pi_userContentController addUserScript:scaleScript];
|
||||
WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
|
||||
[self.pi_userContentController addUserScript:cookieScript];
|
||||
///禁止缩放
|
||||
NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1,user-scalable=no\">' );";
|
||||
WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
|
||||
[self.pi_userContentController addUserScript:scaleScript];
|
||||
|
||||
//根据生成的WKUserScript对象,初始化WKWebViewConfiguration
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.preferences.minimumFontSize = 10;
|
||||
configuration.selectionGranularity = WKSelectionGranularityCharacter;
|
||||
configuration.userContentController = self.pi_userContentController;
|
||||
//根据生成的WKUserScript对象,初始化WKWebViewConfiguration
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.preferences.minimumFontSize = 10;
|
||||
configuration.selectionGranularity = WKSelectionGranularityCharacter;
|
||||
configuration.userContentController = self.pi_userContentController;
|
||||
|
||||
CGSize size = [UIScreen mainScreen].bounds.size;
|
||||
_webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration];
|
||||
CGSize size = [UIScreen mainScreen].bounds.size;
|
||||
_webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration];
|
||||
|
||||
_webview.navigationDelegate = self;
|
||||
//添加KVO,WKWebView有一个属性estimatedProgress,就是当前网页加载的进度,所以监听这个属性
|
||||
[_webview addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
|
||||
//添加KVO,监听title属性
|
||||
[_webview addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
|
||||
_webview.navigationDelegate = self;
|
||||
//添加KVO,WKWebView有一个属性estimatedProgress,就是当前网页加载的进度,所以监听这个属性
|
||||
[_webview addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
|
||||
//添加KVO,监听title属性
|
||||
[_webview addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
|
||||
|
||||
UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(backButtonClick)];
|
||||
[_webview addGestureRecognizer:swipeGesture];
|
||||
UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(backButtonClick)];
|
||||
[_webview addGestureRecognizer:swipeGesture];
|
||||
|
||||
[_webview.scrollView setShowsVerticalScrollIndicator:NO];
|
||||
[_webview.scrollView setShowsHorizontalScrollIndicator:NO];
|
||||
[_webview.scrollView setShowsVerticalScrollIndicator:NO];
|
||||
[_webview.scrollView setShowsHorizontalScrollIndicator:NO];
|
||||
|
||||
//set useragent
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[_webview evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
|
||||
NSString *userAgent = result;
|
||||
//set useragent
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[_webview evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
|
||||
NSString *userAgent = result;
|
||||
|
||||
if (![userAgent containsString:@"molistarAppIos erbanAppIos"]){
|
||||
NSString *newUserAgent = [userAgent stringByAppendingString:@" molistarAppIos erbanAppIos"];
|
||||
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:newUserAgent, @"UserAgent", nil];
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
[weakSelf.webview setCustomUserAgent:newUserAgent];
|
||||
}
|
||||
if (![userAgent containsString:@"molistarAppIos erbanAppIos"]){
|
||||
NSString *newUserAgent = [userAgent stringByAppendingString:@" molistarAppIos erbanAppIos"];
|
||||
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:newUserAgent, @"UserAgent", nil];
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
[weakSelf.webview setCustomUserAgent:newUserAgent];
|
||||
}
|
||||
|
||||
}];
|
||||
_webview.scrollView.bounces = NO;
|
||||
}
|
||||
return _webview;
|
||||
}];
|
||||
_webview.scrollView.bounces = NO;
|
||||
}
|
||||
return _webview;
|
||||
}
|
||||
- (UIProgressView *)progressView{
|
||||
if (!_progressView) {
|
||||
|
@@ -161,7 +161,9 @@ static NSString * const kTodayShownKey = @"FirstRechargeTodayShown";
|
||||
}
|
||||
|
||||
// 调用API获取首充信息
|
||||
@kWeakify(self);
|
||||
[Api firstchargeInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200 && data.data) {
|
||||
FirstRechargeModel *model = [FirstRechargeModel modelWithJSON:data.data];
|
||||
[self handleFirstRechargeResult:model];
|
||||
@@ -191,13 +193,14 @@ static NSString * const kTodayShownKey = @"FirstRechargeTodayShown";
|
||||
}
|
||||
|
||||
- (BOOL)shouldShowFirstRecharge:(FirstRechargeModel *)model {
|
||||
#if DEBUG
|
||||
return YES;
|
||||
#endif
|
||||
// 如果已经首充过,不展示
|
||||
if (model.chargeStatus) {
|
||||
return NO;
|
||||
}
|
||||
#if DEBUG
|
||||
return YES;
|
||||
#endif
|
||||
|
||||
// 检查今天是否已经展示过
|
||||
NSString *shownDate = [[NSUserDefaults standardUserDefaults] objectForKey:kTodayShownKey];
|
||||
NSString *today = [self getTodayString];
|
||||
@@ -206,7 +209,9 @@ static NSString * const kTodayShownKey = @"FirstRechargeTodayShown";
|
||||
}
|
||||
|
||||
- (void)notifyDelegatesWithModel:(FirstRechargeModel *)model shouldShow:(BOOL)shouldShow {
|
||||
@kWeakify(self);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@kStrongify(self);
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(firstRechargeManager:didCheckFirstRecharge:shouldShow:)]) {
|
||||
[self.delegate firstRechargeManager:self didCheckFirstRecharge:model shouldShow:shouldShow];
|
||||
}
|
||||
|
Reference in New Issue
Block a user