更新 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:
edwinQQQ
2025-06-27 11:33:16 +08:00
parent 86094da26f
commit f52af5d620
19 changed files with 532 additions and 380 deletions

View File

@@ -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 */,

View File

@@ -117,7 +117,9 @@ typedef NS_ENUM(NSUInteger, URLType) {
// 新排行榜
kRankV2,
kVIP,
kTransfer
kTransfer,
kFirstChargeHomeIndex,
kFirstChargeBanner,
};
NSString * const URLWithType(URLType type);

View File

@@ -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)];

View File

@@ -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

View File

@@ -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

View File

@@ -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>

View File

@@ -523,7 +523,7 @@
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisVertical;
_stackView.spacing = 24;
_stackView.distribution = UIStackViewDistributionFillProportionally;
_stackView.distribution = UIStackViewDistributionFill;
}
return _stackView;
}

View File

@@ -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)];

View File

@@ -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;

View File

@@ -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

View File

@@ -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)createMP4ViewIfNeeded {
if (_mp4View) {
return;
}
// 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) {
_imageView.hidden = YES;
}
// mp4ViewMP4
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,12 +189,46 @@
}];
}
//
- (void)updateImageEffect {
if (!_hasImage || !_imageView) {
return;
- (void)loadMP4WithUrl:(NSString *)mp4Url {
if (!_mp4Parser) {
_mp4Parser = [[XPRoomGiftAnimationParser alloc] init];
}
@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;
@@ -144,6 +238,16 @@
}
}
// MP4 - 使 alpha
if (_hasMP4 && _mp4View) {
if (_isSelected) {
_mp4View.alpha = 1.0; //
} else {
_mp4View.alpha = 0.3; //
}
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
if (_isSelected == selected) {
return;
@@ -156,8 +260,8 @@
self.levelLabel.textColor = color;
self.dotView.backgroundColor = color;
//
if (self.hasImage) {
// MP4
if (self.hasImage || self.hasMP4) {
[self updateImageEffect];
}
};
@@ -385,12 +489,16 @@
//
if (_levelItems.count > 0) {
// imageView
//
if (indicatorType == MedalsLevelIndicatorTypeWithImage) {
for (LevelItemView *item in _levelItems) {
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) {
// 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];

View File

@@ -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{

View File

@@ -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;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[FirstRechargeManager sharedManager] startMonitoring];
// [self.presenter getUserFirstChargeStatus];
});
}
}
@@ -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;

View File

@@ -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;

View File

@@ -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];
- (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 _firstRechargeButton;
return _firstChargeView;
}
- (MoliMoneyLabel *)moneyLabel {
if (!_moneyLabel) {
_moneyLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0x582B00) font:kFontSemibold(10) moneyPostion:1 moneySize:CGSizeMake(15, 15)];
}
return _moneyLabel;
}
@end

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
///

View File

@@ -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];
}