Commit 1b677bd2 by ludi

完成首冲和老玩家回归充值相关

parent 7f627108
Showing with 779 additions and 21 deletions
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "zone_account_large_diamond@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "zone_account_large_diamond@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -26,4 +26,6 @@ typedef NS_ENUM(NSInteger,FUSRechargePageFrom) { ...@@ -26,4 +26,6 @@ typedef NS_ENUM(NSInteger,FUSRechargePageFrom) {
+ (void)fus_showRechargeViewControllerForRootVC:(UIViewController *)rootVC from:(FUSFrom)from rechargePageFrom:(FUSRechargePageFrom)rechargePageFrom backHandler:(void(^)(void))backHandler; + (void)fus_showRechargeViewControllerForRootVC:(UIViewController *)rootVC from:(FUSFrom)from rechargePageFrom:(FUSRechargePageFrom)rechargePageFrom backHandler:(void(^)(void))backHandler;
+ (FUSRechargeViewController *)fus_getAndShowRechargeViewControllerForRootVC:(UIViewController *)rootVC from:(FUSFrom)from rechargePageFrom:(FUSRechargePageFrom)rechargePageFrom backHandler:(void(^)(void))backHandler; + (FUSRechargeViewController *)fus_getAndShowRechargeViewControllerForRootVC:(UIViewController *)rootVC from:(FUSFrom)from rechargePageFrom:(FUSRechargePageFrom)rechargePageFrom backHandler:(void(^)(void))backHandler;
-(void)fus_showRecallPacketIfIneed;
@end @end
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <FirebaseAnalytics/FirebaseAnalytics.h> #import <FirebaseAnalytics/FirebaseAnalytics.h>
#import "FUSLivePublicDefine.h" #import "FUSLivePublicDefine.h"
#import <FUSCommon/FUSCommon-Swift.h>
#import <FUSFoundation/FUSFoundation-Swift.h>
NSString * const kFUSRechargeTableViewCellID = @"FUSRechargeTableViewCell"; NSString * const kFUSRechargeTableViewCellID = @"FUSRechargeTableViewCell";
// 官方储值页 // 官方储值页
...@@ -61,7 +63,12 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur ...@@ -61,7 +63,12 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur
@property (weak, nonatomic) IBOutlet UIView *topBgImageView; @property (weak, nonatomic) IBOutlet UIView *topBgImageView;
/// 首冲的banner
@property (weak, nonatomic) IBOutlet UIButton *firstChargeBtn;
@property (nonatomic, assign) NSInteger checkingSelectedIndex; @property (nonatomic, assign) NSInteger checkingSelectedIndex;
/// tableview 距离宝石数量面板的距离
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *tableViewTopConstraint;
// 从哪个页面来 // 从哪个页面来
@property (nonatomic, assign) FUSFrom from; @property (nonatomic, assign) FUSFrom from;
...@@ -278,12 +285,28 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur ...@@ -278,12 +285,28 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur
headerBgLayerView.layer.shadowOpacity = 0.3; headerBgLayerView.layer.shadowOpacity = 0.3;
headerBgLayerView.layer.shadowOffset = CGSizeMake(0, 2); headerBgLayerView.layer.shadowOffset = CGSizeMake(0, 2);
// headerBgLayerView.layer.shadowRadius = 12; // headerBgLayerView.layer.shadowRadius = 12;
self.diamondImageView.image = UIImage.fus_diamonIcon; // self.diamondImageView.image = UIImage.fus_diamonIcon;
[self.topBgImageView insertSubview:headerBgLayerView atIndex:0]; [self.topBgImageView insertSubview:headerBgLayerView atIndex:0];
[headerBgLayerView mas_makeConstraints:^(MASConstraintMaker *make) { [headerBgLayerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.inset(18); make.left.right.inset(18);
make.top.bottom.inset(10); make.top.bottom.inset(10);
}]; }];
// 首冲相关
self.tableViewTopConstraint.constant = 10;
self.firstChargeBtn.hidden = YES;
NSDictionary *firstChargeDict = [FUSSwiftCacheDataShare share].oc_userFirstChargeAlertInfo[@"firstCharge"];
BOOL isQualifications = [firstChargeDict[@"isQualifications"] boolValue];
NSString *firstChargeIcon = [firstChargeDict[@"icon"] stringValue];
BOOL checkVersionStatus = [FUSConfig sharedInstanced].devConfigs.appStatus;
if (isQualifications == YES && checkVersionStatus == NO) {
// 有资格
self.firstChargeBtn.hidden = NO;
self.tableViewTopConstraint.constant = (UIView.fus_screenW - 18*2)/657.0*184.0 + 10;
[self.firstChargeBtn setWebBackgroundImageWithSubURLString:firstChargeIcon];
}
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
...@@ -353,6 +376,29 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur ...@@ -353,6 +376,29 @@ NSString * const kEVENT_RECHARGE_OFFICIAL_PAGE_RETURN = @"officialrecharge_retur
} }
#pragma mark 跳转到储值记录界面 #pragma mark 跳转到储值记录界面
/// 首冲
- (IBAction)onClickFirstChargeAction:(UIButton *)sender {
NSMutableDictionary *firstChargeDict = [[NSMutableDictionary alloc] initWithDictionary:[FUSSwiftCacheDataShare share].oc_userFirstChargeAlertInfo[@"firstCharge"]];
NSDictionary *popupStyle = firstChargeDict[@"popupStyle"];
NSString *receiveUrl = [firstChargeDict[@"receiveUrl"] stringValue];
NSInteger popupType = [popupStyle[@"popupType"] integerValue];
if (popupType == 1) {
FUSWKWebViewController *webVC = [[FUSWKWebViewController alloc] init];
webVC.shouldIncludeIdentifyInfo = YES;
webVC.webUrlString = receiveUrl;
[self.navigationController pushViewController:webVC animated:YES];
}
else {
if (firstChargeDict[@"width"] == nil) {
firstChargeDict[@"width"] = firstChargeDict[@"wide"];
firstChargeDict[@"height"] = firstChargeDict[@"high"];
}
[[FUSRouter userRouter] fus_showInviteRewardHalfWebAlertView:firstChargeDict rootView:[UIWindow fus_keyWindow]];
}
}
/** /**
记录按钮点击(储值记录/消费记录) 记录按钮点击(储值记录/消费记录)
*/ */
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="portrait" appearance="light"/> <device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
...@@ -15,8 +15,10 @@ ...@@ -15,8 +15,10 @@
<outlet property="exchangeArrowImageView" destination="Ty8-Sa-7oO" id="USg-8o-KWL"/> <outlet property="exchangeArrowImageView" destination="Ty8-Sa-7oO" id="USg-8o-KWL"/>
<outlet property="exchangeBackView" destination="duE-Jr-NIV" id="pVy-mN-mXD"/> <outlet property="exchangeBackView" destination="duE-Jr-NIV" id="pVy-mN-mXD"/>
<outlet property="exchangeBtn" destination="Iv0-XU-obm" id="lUY-6K-pEX"/> <outlet property="exchangeBtn" destination="Iv0-XU-obm" id="lUY-6K-pEX"/>
<outlet property="firstChargeBtn" destination="kEE-Ee-qGu" id="Hgb-zk-OmO"/>
<outlet property="normalView" destination="i5M-Pr-FkT" id="FqY-Xl-mlg"/> <outlet property="normalView" destination="i5M-Pr-FkT" id="FqY-Xl-mlg"/>
<outlet property="tableView" destination="o3j-Et-9JY" id="dY5-9P-0P5"/> <outlet property="tableView" destination="o3j-Et-9JY" id="dY5-9P-0P5"/>
<outlet property="tableViewTopConstraint" destination="2fe-qZ-Dzv" id="gpV-Le-O5o"/>
<outlet property="topBgImageView" destination="Tax-eY-knd" id="GZU-bQ-RW1"/> <outlet property="topBgImageView" destination="Tax-eY-knd" id="GZU-bQ-RW1"/>
<outlet property="view" destination="zXO-Sr-vIN" id="9Wb-3r-dQ5"/> <outlet property="view" destination="zXO-Sr-vIN" id="9Wb-3r-dQ5"/>
</connections> </connections>
...@@ -29,7 +31,7 @@ ...@@ -29,7 +31,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/> <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tax-eY-knd"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tax-eY-knd">
<rect key="frame" x="0.0" y="50" width="375" height="140"/> <rect key="frame" x="0.0" y="100" width="375" height="140"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="zone_account_large_diamond" translatesAutoresizingMaskIntoConstraints="NO" id="aaY-22-EGN"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="zone_account_large_diamond" translatesAutoresizingMaskIntoConstraints="NO" id="aaY-22-EGN">
<rect key="frame" x="167.66666666666666" y="34" width="40" height="40"/> <rect key="frame" x="167.66666666666666" y="34" width="40" height="40"/>
...@@ -51,11 +53,11 @@ ...@@ -51,11 +53,11 @@
</constraints> </constraints>
</view> </view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="o3j-Et-9JY"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsVerticalScrollIndicator="NO" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="o3j-Et-9JY">
<rect key="frame" x="0.0" y="190" width="375" height="508"/> <rect key="frame" x="0.0" y="340" width="375" height="324"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</tableView> </tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="duE-Jr-NIV"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="duE-Jr-NIV">
<rect key="frame" x="0.0" y="732" width="375" height="40"/> <rect key="frame" x="0.0" y="698" width="375" height="40"/>
<subviews> <subviews>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iv0-XU-obm"> <button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Iv0-XU-obm">
<rect key="frame" x="20" y="8" width="300" height="24"/> <rect key="frame" x="20" y="8" width="300" height="24"/>
...@@ -81,11 +83,22 @@ ...@@ -81,11 +83,22 @@
<constraint firstItem="Iv0-XU-obm" firstAttribute="leading" secondItem="duE-Jr-NIV" secondAttribute="leading" constant="20" id="eaI-I6-YY1"/> <constraint firstItem="Iv0-XU-obm" firstAttribute="leading" secondItem="duE-Jr-NIV" secondAttribute="leading" constant="20" id="eaI-I6-YY1"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kEE-Ee-qGu">
<rect key="frame" x="18" y="240" width="339" height="95"/>
<constraints>
<constraint firstAttribute="width" secondItem="kEE-Ee-qGu" secondAttribute="height" multiplier="657:184" id="1Jj-TY-WKR"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<connections>
<action selector="onClickFirstChargeAction:" destination="-1" eventType="touchUpInside" id="FkZ-M1-4n6"/>
</connections>
</button>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="qZr-Ol-i12"/> <viewLayoutGuide key="safeArea" id="qZr-Ol-i12"/>
<color key="backgroundColor" red="0.039215686274509803" green="0.039215686274509803" blue="0.039215686274509803" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.039215686274509803" green="0.039215686274509803" blue="0.039215686274509803" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstItem="o3j-Et-9JY" firstAttribute="top" secondItem="Tax-eY-knd" secondAttribute="bottom" id="2fe-qZ-Dzv"/> <constraint firstItem="o3j-Et-9JY" firstAttribute="top" secondItem="Tax-eY-knd" secondAttribute="bottom" constant="100" id="2fe-qZ-Dzv"/>
<constraint firstItem="kEE-Ee-qGu" firstAttribute="leading" secondItem="qZr-Ol-i12" secondAttribute="leading" constant="18" id="4D9-rf-87b"/>
<constraint firstItem="o3j-Et-9JY" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="5aw-tZ-LTh"/> <constraint firstItem="o3j-Et-9JY" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="5aw-tZ-LTh"/>
<constraint firstItem="duE-Jr-NIV" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="6Ac-w6-j00"/> <constraint firstItem="duE-Jr-NIV" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="6Ac-w6-j00"/>
<constraint firstAttribute="trailing" secondItem="o3j-Et-9JY" secondAttribute="trailing" id="6Xx-89-gkB"/> <constraint firstAttribute="trailing" secondItem="o3j-Et-9JY" secondAttribute="trailing" id="6Xx-89-gkB"/>
...@@ -94,7 +107,9 @@ ...@@ -94,7 +107,9 @@
<constraint firstAttribute="trailing" secondItem="duE-Jr-NIV" secondAttribute="trailing" id="Kil-d7-etb"/> <constraint firstAttribute="trailing" secondItem="duE-Jr-NIV" secondAttribute="trailing" id="Kil-d7-etb"/>
<constraint firstItem="duE-Jr-NIV" firstAttribute="bottom" secondItem="qZr-Ol-i12" secondAttribute="bottom" constant="-6" id="SBt-Tl-ydZ"/> <constraint firstItem="duE-Jr-NIV" firstAttribute="bottom" secondItem="qZr-Ol-i12" secondAttribute="bottom" constant="-6" id="SBt-Tl-ydZ"/>
<constraint firstItem="qZr-Ol-i12" firstAttribute="bottom" secondItem="o3j-Et-9JY" secondAttribute="bottom" constant="80" id="Z3v-8v-75t"/> <constraint firstItem="qZr-Ol-i12" firstAttribute="bottom" secondItem="o3j-Et-9JY" secondAttribute="bottom" constant="80" id="Z3v-8v-75t"/>
<constraint firstItem="qZr-Ol-i12" firstAttribute="trailing" secondItem="kEE-Ee-qGu" secondAttribute="trailing" constant="18" id="kjF-f4-9WX"/>
<constraint firstAttribute="trailing" secondItem="Tax-eY-knd" secondAttribute="trailing" id="my4-l1-P4V"/> <constraint firstAttribute="trailing" secondItem="Tax-eY-knd" secondAttribute="trailing" id="my4-l1-P4V"/>
<constraint firstItem="kEE-Ee-qGu" firstAttribute="top" secondItem="Tax-eY-knd" secondAttribute="bottom" id="pbc-oU-CHb"/>
</constraints> </constraints>
</view> </view>
</subviews> </subviews>
......
...@@ -81,6 +81,12 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -81,6 +81,12 @@ NS_ASSUME_NONNULL_BEGIN
allowScroll:(BOOL)allowScroll allowScroll:(BOOL)allowScroll
userInteractionEnabled:(BOOL)userInteractionEnabled; userInteractionEnabled:(BOOL)userInteractionEnabled;
-(void)fus_showConfigHalfWebView:(NSDictionary *)configDict
needMouted:(BOOL)needMouted
allowScroll:(BOOL)allowScroll
userInteractionEnabled:(BOOL)userInteractionEnabled
dismissHandle:(void(^)(void))dismissHandle;
- (void)fus_logSuccess; - (void)fus_logSuccess;
- (void)fus_logOut; - (void)fus_logOut;
...@@ -129,6 +135,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -129,6 +135,9 @@ NS_ASSUME_NONNULL_BEGIN
/// - Parameter turnTo: 需要显示哪一天的日期的时间戳,负数则不跳 /// - Parameter turnTo: 需要显示哪一天的日期的时间戳,负数则不跳
-(void)fus_showLiveRecordsControllerWithTurnToTimeInterval:(NSTimeInterval)turnTo; -(void)fus_showLiveRecordsControllerWithTurnToTimeInterval:(NSTimeInterval)turnTo;
/// 重新加载首冲信息
-(void)fus_reloadFirstChargeAlertInfo;
@end @end
/// 直播间礼物面板的分页类型,区分打开背包后默认跳转到哪一个分页 /// 直播间礼物面板的分页类型,区分打开背包后默认跳转到哪一个分页
......
...@@ -317,6 +317,12 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -317,6 +317,12 @@ NS_ASSUME_NONNULL_BEGIN
/// @param segmentTypeStr 跳转默认显示的页面 /// @param segmentTypeStr 跳转默认显示的页面
-(void)fus_pushToInviteRewardWithSegmentTypeStr:(NSString *)segmentTypeStr; -(void)fus_pushToInviteRewardWithSegmentTypeStr:(NSString *)segmentTypeStr;
/// 显示邀请有奖相关半屏网页,仅兼容了邀请有奖相关的,其他有需要去补充
/// @param configDict 要素
/// @param rootView 显示在哪
-(UIView *)fus_showInviteRewardHalfWebAlertView:(NSDictionary *)configDict
rootView:(UIView *)rootView;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -6,9 +6,34 @@ ...@@ -6,9 +6,34 @@
// //
import UIKit import UIKit
import MBProgressHUD
public extension UIView { public extension UIView {
@objc public var maxY : CGFloat { self.y + self.height } @objc public var maxY : CGFloat { self.y + self.height }
@objc public var maxX : CGFloat { self.x + self.width } @objc public var maxX : CGFloat { self.x + self.width }
@objc public func fus_showLoading(message: String?) {
let hudView = MBProgressHUD.showAdded(to: self, animated: true)
hudView.bezelView.style = .solidColor
hudView.bezelView.backgroundColor = .clear
hudView.mode = .customView
hudView.activityIndicatorColor = .white
hudView.label.font = .systemFont(ofSize: 16, weight: .light)
hudView.label.textColor = .white
if let message = message {
hudView.label.text = message
}
let animateImageView = UIImageView(frame: hudView.bezelView.bounds)
animateImageView.image = .animatedImage(with: UIImage.fus_animationImages("fusi_loading_animate_", mainBundle: false, needCache: true), duration: 1.5)
animateImageView.contentMode = .scaleAspectFit
hudView.customView = animateImageView
animateImageView.startAnimating()
}
@objc public func fus_hideLoading(){
DispatchQueue.main.async(execute: {
MBProgressHUD.hide(for: self, animated: true)
})
}
} }
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>FUSChatCenterBundle.xcscheme_^#shared#^_</key> <key>FUSChatCenterBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>80</integer> <integer>83</integer>
</dict> </dict>
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key> <key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>83</integer> <integer>79</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -272,6 +272,8 @@ ...@@ -272,6 +272,8 @@
if (messageModel.cid == CID_RECHARGE_SUCCESS) { // 宝石充值成功的命令号 if (messageModel.cid == CID_RECHARGE_SUCCESS) { // 宝石充值成功的命令号
[[FUSRouter liveRouter] fus_reloadFirstChargeAlertInfo];
NSDictionary *diamondDict = [messageModel fus_getJsonDict][@"cv"]; NSDictionary *diamondDict = [messageModel fus_getJsonDict][@"cv"];
if (![NSDictionary isNull:diamondDict]) { if (![NSDictionary isNull:diamondDict]) {
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>FUSShowRoomBundle.xcscheme_^#shared#^_</key> <key>FUSShowRoomBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>82</integer> <integer>80</integer>
</dict> </dict>
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key> <key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>79</integer> <integer>82</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -231,6 +231,13 @@ ...@@ -231,6 +231,13 @@
//拉取包裹礼物 //拉取包裹礼物
[FUSLiveHttpHelper fus_requestParcelGiftDatasuccess:nil failure:nil]; [FUSLiveHttpHelper fus_requestParcelGiftDatasuccess:nil failure:nil];
// 拉取首冲信息
[FUSLiveHttpHelper fus_requestLiveFirstCharge:0 success:^(BOOL isQualifications, NSDictionary * _Nonnull dataDict) {
} failure:^(NSString * _Nonnull msg, int code) {
}];
// 是否是推送,需要打开包房 // 是否是推送,需要打开包房
if (![NSString isNull:[FUSLiveHelper shareInstance].pushUID]) { if (![NSString isNull:[FUSLiveHelper shareInstance].pushUID]) {
FUSRoomInfoModel *model = [[FUSRoomInfoModel alloc] init]; FUSRoomInfoModel *model = [[FUSRoomInfoModel alloc] init];
...@@ -375,6 +382,29 @@ ...@@ -375,6 +382,29 @@
[halfWebView fus_webviewSetLiveRoomAllowScroll:allowScroll]; [halfWebView fus_webviewSetLiveRoomAllowScroll:allowScroll];
} }
- (void)fus_showConfigHalfWebView:(NSDictionary *)configDict
needMouted:(BOOL)needMouted
allowScroll:(BOOL)allowScroll
userInteractionEnabled:(BOOL)userInteractionEnabled
dismissHandle:(void (^)(void))dismissHandle{
FUSHalfWebViewModel *webModel = [FUSHalfWebViewModel modelWithDictionary:configDict];
webModel.popupType = 2;
webModel.widthR = @"100";
webModel.heightR = [NSString stringWithFormat:@"%f",[configDict[@"height"] floatValue]/[configDict[@"width"] floatValue]*100.0];
webModel.clickBlank = YES;
FUSHalfWebView *halfWebView = nil;
if (needMouted == 1) {
halfWebView = [FUSLiveHelper.shareInstance.currentFunctionView fus_showMoutedHalfWebView:webModel];
} else {
halfWebView = [FUSLiveHelper.shareInstance.currentFunctionView fus_showHalfWebView:webModel];
}
halfWebView.userInteractionEnabled = userInteractionEnabled;
halfWebView.dismissFromSuperViewHandler = dismissHandle;
[halfWebView fus_webviewSetLiveRoomAllowScroll:allowScroll];
}
- (void)fus_showGiftFlyImageAnimation:(UIImage *)giftImage - (void)fus_showGiftFlyImageAnimation:(UIImage *)giftImage
giftResource:(NSString *)giftResource giftResource:(NSString *)giftResource
...@@ -463,6 +493,15 @@ ...@@ -463,6 +493,15 @@
}]; }];
} }
- (void)fus_reloadFirstChargeAlertInfo{
// 拉取首冲信息
[FUSLiveHttpHelper fus_requestLiveFirstCharge:0 success:^(BOOL isQualifications, NSDictionary * _Nonnull dataDict) {
} failure:^(NSString * _Nonnull msg, int code) {
}];
}
#pragma mark - HTTP #pragma mark - HTTP
/** /**
* 追踪包房 * 追踪包房
......
...@@ -120,6 +120,9 @@ ...@@ -120,6 +120,9 @@
00E5022A2E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E502282E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m */; }; 00E5022A2E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E502282E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m */; };
00E5022C2E0AA93D00579DB0 /* FUSInviteEmissaryRewardDrawHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E5022B2E0AA93D00579DB0 /* FUSInviteEmissaryRewardDrawHeader.swift */; }; 00E5022C2E0AA93D00579DB0 /* FUSInviteEmissaryRewardDrawHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E5022B2E0AA93D00579DB0 /* FUSInviteEmissaryRewardDrawHeader.swift */; };
00E5022E2E0AAA1C00579DB0 /* FUSInviteEmissaryRewardDrawCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E5022D2E0AAA1C00579DB0 /* FUSInviteEmissaryRewardDrawCell.swift */; }; 00E5022E2E0AAA1C00579DB0 /* FUSInviteEmissaryRewardDrawCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E5022D2E0AAA1C00579DB0 /* FUSInviteEmissaryRewardDrawCell.swift */; };
00E502302E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E5022F2E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift */; };
00E502322E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E502312E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift */; };
00E502342E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00E502332E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift */; };
9E8D0BED6061C8C88FBF8686 /* Pods_FUSUserCenterModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BED3EAC4EA2F921CB5B2FEE8 /* Pods_FUSUserCenterModule.framework */; }; 9E8D0BED6061C8C88FBF8686 /* Pods_FUSUserCenterModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BED3EAC4EA2F921CB5B2FEE8 /* Pods_FUSUserCenterModule.framework */; };
BE189A2D2C7323FE0008418B /* FSRDynamicImModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */; }; BE189A2D2C7323FE0008418B /* FSRDynamicImModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */; };
BE189A2E2C7323FE0008418B /* FSRDynamicImModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */; }; BE189A2E2C7323FE0008418B /* FSRDynamicImModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */; };
...@@ -1073,6 +1076,9 @@ ...@@ -1073,6 +1076,9 @@
00E502282E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSInviteDataObtainDetailGetListDataModel.m; sourceTree = "<group>"; }; 00E502282E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSInviteDataObtainDetailGetListDataModel.m; sourceTree = "<group>"; };
00E5022B2E0AA93D00579DB0 /* FUSInviteEmissaryRewardDrawHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteEmissaryRewardDrawHeader.swift; sourceTree = "<group>"; }; 00E5022B2E0AA93D00579DB0 /* FUSInviteEmissaryRewardDrawHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteEmissaryRewardDrawHeader.swift; sourceTree = "<group>"; };
00E5022D2E0AAA1C00579DB0 /* FUSInviteEmissaryRewardDrawCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteEmissaryRewardDrawCell.swift; sourceTree = "<group>"; }; 00E5022D2E0AAA1C00579DB0 /* FUSInviteEmissaryRewardDrawCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteEmissaryRewardDrawCell.swift; sourceTree = "<group>"; };
00E5022F2E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSMyInviteQRCodeDownloadView.swift; sourceTree = "<group>"; };
00E502312E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteRecallWellcomeAlertView.swift; sourceTree = "<group>"; };
00E502332E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSInviteConfigHalfWebAlertView.swift; sourceTree = "<group>"; };
29DC17A1A1D4B29CA3BB6003 /* Pods-FUSUserCenterModule.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FUSUserCenterModule.debug.xcconfig"; path = "Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule.debug.xcconfig"; sourceTree = "<group>"; }; 29DC17A1A1D4B29CA3BB6003 /* Pods-FUSUserCenterModule.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FUSUserCenterModule.debug.xcconfig"; path = "Target Support Files/Pods-FUSUserCenterModule/Pods-FUSUserCenterModule.debug.xcconfig"; sourceTree = "<group>"; };
BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSRDynamicImModel.h; sourceTree = "<group>"; }; BE1899A72C7323FE0008418B /* FSRDynamicImModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FSRDynamicImModel.h; sourceTree = "<group>"; };
BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSRDynamicImModel.m; sourceTree = "<group>"; }; BE1899A82C7323FE0008418B /* FSRDynamicImModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FSRDynamicImModel.m; sourceTree = "<group>"; };
...@@ -2162,6 +2168,9 @@ ...@@ -2162,6 +2168,9 @@
00B45E462D9401CE00FF138F /* FUSInviteRewardTaskView.swift */, 00B45E462D9401CE00FF138F /* FUSInviteRewardTaskView.swift */,
00E5020F2E0940E100579DB0 /* FUSInviteRewardWebView.swift */, 00E5020F2E0940E100579DB0 /* FUSInviteRewardWebView.swift */,
00B45E472D9401CE00FF138F /* FUSMyEmissaryQRCodeView.swift */, 00B45E472D9401CE00FF138F /* FUSMyEmissaryQRCodeView.swift */,
00E5022F2E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift */,
00E502312E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift */,
00E502332E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -4562,6 +4571,7 @@ ...@@ -4562,6 +4571,7 @@
BE78CB702C538D7E00F38855 /* FUSZoneDBOperate.m in Sources */, BE78CB702C538D7E00F38855 /* FUSZoneDBOperate.m in Sources */,
009CC32C2CF1876C000AA251 /* FUSCompleteUserInfoSignView.swift in Sources */, 009CC32C2CF1876C000AA251 /* FUSCompleteUserInfoSignView.swift in Sources */,
BE189A602C7323FE0008418B /* FSRPrivacyVoiceViewController.m in Sources */, BE189A602C7323FE0008418B /* FSRPrivacyVoiceViewController.m in Sources */,
00E502342E0BEEE200579DB0 /* FUSInviteConfigHalfWebAlertView.swift in Sources */,
BE78CC972C538D8000F38855 /* FUSNewsFeedLikeListView.m in Sources */, BE78CC972C538D8000F38855 /* FUSNewsFeedLikeListView.m in Sources */,
BEDEDC4A2C66075400B4B0B0 /* FUSSingleDailyCheckInView.m in Sources */, BEDEDC4A2C66075400B4B0B0 /* FUSSingleDailyCheckInView.m in Sources */,
BE78CC162C538D7F00F38855 /* FUSSettingHttpRequest.m in Sources */, BE78CC162C538D7F00F38855 /* FUSSettingHttpRequest.m in Sources */,
...@@ -4591,6 +4601,7 @@ ...@@ -4591,6 +4601,7 @@
009CC33D2CF1C708000AA251 /* FUSCompleteUserInfoVoiceSignView.swift in Sources */, 009CC33D2CF1C708000AA251 /* FUSCompleteUserInfoVoiceSignView.swift in Sources */,
BE78CCA32C538D8000F38855 /* FUSNewsFeedReplyView.m in Sources */, BE78CCA32C538D8000F38855 /* FUSNewsFeedReplyView.m in Sources */,
BE189A442C7323FE0008418B /* FSRStartModel.m in Sources */, BE189A442C7323FE0008418B /* FSRStartModel.m in Sources */,
00E502322E0BD68E00579DB0 /* FUSInviteRecallWellcomeAlertView.swift in Sources */,
BE78CB882C538D7E00F38855 /* FUSMyZoneFireCountCell.m in Sources */, BE78CB882C538D7E00F38855 /* FUSMyZoneFireCountCell.m in Sources */,
BE78CB602C538D7E00F38855 /* FUSUserCultureModel.swift in Sources */, BE78CB602C538D7E00F38855 /* FUSUserCultureModel.swift in Sources */,
BE78CB862C538D7E00F38855 /* FUSMyZoneBaseCell.m in Sources */, BE78CB862C538D7E00F38855 /* FUSMyZoneBaseCell.m in Sources */,
...@@ -4915,6 +4926,7 @@ ...@@ -4915,6 +4926,7 @@
BE78CC892C538D8000F38855 /* FUSNewsFeedCommentInputView.m in Sources */, BE78CC892C538D8000F38855 /* FUSNewsFeedCommentInputView.m in Sources */,
00E5022A2E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m in Sources */, 00E5022A2E0AA31F00579DB0 /* FUSInviteDataObtainDetailGetListDataModel.m in Sources */,
BE78CB3A2C538D7E00F38855 /* FUSBoundAgentInfoView.m in Sources */, BE78CB3A2C538D7E00F38855 /* FUSBoundAgentInfoView.m in Sources */,
00E502302E0BA65600579DB0 /* FUSMyInviteQRCodeDownloadView.swift in Sources */,
00495FD82CF093E700B6F8D3 /* FUSCompleteUserInfoViewModel.swift in Sources */, 00495FD82CF093E700B6F8D3 /* FUSCompleteUserInfoViewModel.swift in Sources */,
BE78CCEE2C538D8000F38855 /* FUSPhotoViewController.m in Sources */, BE78CCEE2C538D8000F38855 /* FUSPhotoViewController.m in Sources */,
BE78CB942C538D7E00F38855 /* FUSMyZoneMotoringCell.m in Sources */, BE78CB942C538D7E00F38855 /* FUSMyZoneMotoringCell.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "InviteReward_invite_qrCodeDownload_logo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "InviteReward_invite_qrCodeDownload_logo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "inviteReward_recall_recallReward_img@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "inviteReward_recall_recallReward_img@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -25,6 +25,7 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController { ...@@ -25,6 +25,7 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController {
} }
let emissaryView = FUSMyEmissaryQRCodeView() let emissaryView = FUSMyEmissaryQRCodeView()
let inviteCodeDownloadView = FUSMyInviteQRCodeDownloadView()
let saveBtn = FUSStyleButton(type: .custom) let saveBtn = FUSStyleButton(type: .custom)
func makeUI() { func makeUI() {
...@@ -35,6 +36,14 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController { ...@@ -35,6 +36,14 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController {
make.centerY.equalToSuperview().offset(-UIView.fus_StatusBarAndNavgationBarHeight()) make.centerY.equalToSuperview().offset(-UIView.fus_StatusBarAndNavgationBarHeight())
} }
self.view.addSubview(self.inviteCodeDownloadView)
self.inviteCodeDownloadView.snp.makeConstraints { make in
// make.left.right.equalToSuperview()
make.centerX.equalToSuperview()
make.width.equalTo(414)
make.top.equalTo(self.view.snp.bottom)
}
saveBtn.style = .blue saveBtn.style = .blue
saveBtn.titleLabel?.font = .fus_themeMediumFont(17) saveBtn.titleLabel?.font = .fus_themeMediumFont(17)
saveBtn.setTitle(.fus_localString("保存QRCode"), for: .normal) saveBtn.setTitle(.fus_localString("保存QRCode"), for: .normal)
...@@ -48,7 +57,7 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController { ...@@ -48,7 +57,7 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController {
func bindViewModel() { func bindViewModel() {
self.emissaryView.avatarImageIsReady self.inviteCodeDownloadView.avatarImageIsReady
.subscribe(onNext: {[weak self] isReady in .subscribe(onNext: {[weak self] isReady in
self?.saveBtn.isHidden = !isReady self?.saveBtn.isHidden = !isReady
}) })
...@@ -57,7 +66,7 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController { ...@@ -57,7 +66,7 @@ class FUSMyEmissaryQRCodeController: FUSBaseViewController {
// 保存图片 // 保存图片
saveBtn.rx.tap.subscribe(onNext: {[weak self] in saveBtn.rx.tap.subscribe(onNext: {[weak self] in
self?.emissaryView.fus_saveQRCodeView() self?.inviteCodeDownloadView.fus_saveQRCodeView()
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
} }
......
...@@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger awardReadRemindnum; @property (nonatomic, assign) NSInteger awardReadRemindnum;
/// 分享数据 /// 分享数据
@property (nonatomic, strong) FUSInviteDataShareDataModel *shareData; @property (nonatomic, strong) FUSInviteDataShareDataModel *shareData;
/// 二维码Subtitle文案
@property (nonatomic, copy) NSString *qrCodeSubtitle;
/// 返回html富文本 /// 返回html富文本
/// - Parameters: /// - Parameters:
...@@ -42,6 +44,14 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -42,6 +44,14 @@ NS_ASSUME_NONNULL_BEGIN
/// - isCenter: 是否居中 /// - isCenter: 是否居中
+(NSAttributedString *)fus_getAttrWithContent:(NSString *)content font:(UIFont * _Nullable )font isCenter:(BOOL)isCenter; +(NSAttributedString *)fus_getAttrWithContent:(NSString *)content font:(UIFont * _Nullable )font isCenter:(BOOL)isCenter;
/// 返回html富文本
/// - Parameters:
/// - content: 字符
/// - font: 大小
/// - colorStr: 默认颜色
/// - isCenter: 是否居中
+(NSAttributedString *)fus_getAttrWithContent:(NSString *)content font:(UIFont * _Nullable )font color:(NSString *)colorStr isCenter:(BOOL)isCenter;
@end @end
......
...@@ -24,6 +24,21 @@ ...@@ -24,6 +24,21 @@
return attr1; return attr1;
} }
+ (NSAttributedString *)fus_getAttrWithContent:(NSString *)content font:(UIFont *)font color:(NSString *)colorStr isCenter:(BOOL)isCenter{
UIFont *defaultFont = [UIFont fus_themeFont:13];
if (font != nil) {
defaultFont = font;
}
NSMutableAttributedString *attr1 = [FUSFormatContentHelper fus_createContentAttributedStringWithHTMLString:content font:defaultFont defaultColor:[UIColor colorWithHex:colorStr] imageSize:CGSizeMake(20, 20)];
if (isCenter) {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.alignment = NSTextAlignmentCenter;
[attr1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attr1.length)];
}
return attr1;
}
@end @end
......
//
// FUSInviteConfigHalfWebAlertView.swift
// FUSUserCenterModule
//
// Created by aaa on 2025/6/25.
//
import UIKit
import SwiftyJSON
@objcMembers public class FUSInviteConfigHalfWebAlertView: FUSBaseView {
@objc public var tapToHide = true
@objc public var transparent: Bool = true {
didSet {
if self.transparent {
self.backgroundColor = .clear
} else {
self.backgroundColor = .white
}
}
}
@objc public var cleanCache = true
@objc public var urlStr: String?
@objc public var mute: Bool = false
@objc public var roomid: String?
public var halfWebViewCloseWebViewHandler: ((Int) -> Void)?
public var halfWebViewRechargeHandler: ((Bool, String) -> Void)?
private let webVC: FUSWKWebViewController = .init()
public var wkVCView: UIView?
public var webView: FUSWKWebView?
private var halfViewFrame: CGRect = .zero
static public func fus_show(halfDict: [String: Any], rootView: UIView) -> FUSInviteConfigHalfWebAlertView? {
let dictJson = JSON(halfDict)
var url = dictJson["url"].stringValue
let width = dictJson["width"].floatValue
let height = dictJson["height"].floatValue
guard url.count > 0 else { return nil }
let maxHeight: CGFloat = UIView.fus_screenH() * 0.9
let halfWidth: CGFloat = UIView.fus_screenW()
var halfHeight: CGFloat = CGFloat(width * 2)
if width > 0 && height > 0 {
halfHeight = CGFloat(ceil(Float(halfWidth) * (height/width)))
if halfHeight < 0 || halfHeight > maxHeight {
halfHeight = maxHeight
}
}
let halfViewFrame = CGRectMake(0, UIView.fus_screenH() - halfHeight, halfWidth, halfHeight)
if url.contains("?") {
url = url + .init(format: "&w=%f&h=%f", halfViewFrame.size.width, halfViewFrame.size.height)
}
else {
url = url + .init(format: "?w=%f&h=%f", halfViewFrame.size.width, halfViewFrame.size.height)
}
let halfView = FUSInviteConfigHalfWebAlertView(frame: rootView.bounds)
halfView.halfViewFrame = halfViewFrame
halfView.fus_loadRequest(url: url)
rootView.addSubview(halfView)
return halfView
}
func fus_loadRequest(url: String){
if self.urlStr == url {
return
}
self.urlStr = url
webVC.webView.clearCache = cleanCache
webVC.modalPresentationStyle = .overCurrentContext
webVC.webUrlString = url
webVC.webView.wkWebView.scrollView.bounces = false
webVC.view.backgroundColor = .clear
webVC.webView.backgroundColor = .clear
webVC.webView.wkWebView.backgroundColor = .clear
webVC.webView.showProgressAtBottom = true
self.addSubview(webVC.view)
webVC.view.frame = self.halfViewFrame
webVC.webView.frame = webVC.view.bounds
self.webView = webVC.webView
self.wkVCView = webVC.view
// loading
let loadingView = UIView(frame: webVC.view.bounds)
loadingView.backgroundColor = .black.withAlphaComponent(0.3)
loadingView.addRoundedCorners(UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue), withRadii: CGSizeMake(15, 15))
loadingView.fus_showLoading(message: nil)
webVC.view.insertSubview(loadingView, belowSubview: webVC.webView)
webVC.view.backgroundColor = .clear
webVC.webView.loadingStateChangedHandler = { isLoading, isSucceed in
if !isLoading {
loadingView.fus_hideLoading()
loadingView.removeFromSuperview()
}
}
webVC.view.y = UIView.fus_screenH()
UIView.animate(withDuration: 0.25) {
self.webVC.view.frame = self.halfViewFrame
}
webVC.webView.halfViewCloseTypeDidChangedHandler = {[weak self]
closeType in
self?.tapToHide = closeType == 0
}
webVC.webView.closeWebViewHandler = {[weak self] cidType in
self?.dismiss()
self?.halfWebViewCloseWebViewHandler?(cidType)
}
webVC.webView.rechargeHandler = {[weak self] success, msg in
self?.halfWebViewRechargeHandler?(success,msg)
}
webVC.webView.webEventHelper.webCidEventHandler = {[weak self] dict , cid in
if cid == 14 {
self?.dismiss()
self?.halfWebViewCloseWebViewHandler?(cid)
}
}
}
// MARK: Data
public override func bindViewModel() {
super.bindViewModel()
}
// MARK: Method
public func dismiss() {
UIView.animate(withDuration: 0.2) {
self.wkVCView?.y = UIView.fus_screenH()
} completion: { _ in
self.removeFromSuperview()
}
}
}
extension FUSInviteConfigHalfWebAlertView{
public override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
if tapToHide {
self.dismiss()
}
}
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let respondView = super.hitTest(point, with: event)
if respondView == self && self.tapToHide == false {
return nil
}
return respondView
}
}
//
// FUSInviteRecallWellcomeAlertView.swift
// FUSUserCenterModule
//
// Created by aaa on 2025/6/25.
//
import UIKit
class FUSInviteRecallWellcomeAlertView: FUSBaseView {
static public func fus_create(showOn: UIView? = nil, clickHandle: @escaping (Bool) -> Void) -> FUSInviteRecallWellcomeAlertView? {
guard let showOnView = ((showOn != nil) ? showOn : UIViewController.fus_top()?.view) else { return nil }
let view = FUSInviteRecallWellcomeAlertView(frame: showOnView.bounds)
view.clickHandle = clickHandle
showOnView.addSubview(view)
view.fus_showWithAnimation()
return view
}
public var clickHandle: ((Bool) -> Void)?
let bgBtn = UIButton(type: .custom)
let contentView = UIImageView()
let titleLabel = UILabel()
let recallImageView = UIImageView(image: FUSUserCenterBunble.imageNamed("inviteReward_recall_recallReward_img"))
let recallLabel = UILabel()
let descLabel = UILabel()
let okBtn = FUSStyleButton(type: .custom)
override func makeUI() {
super.makeUI()
self.alpha = 0
self.backgroundColor = .fus_alertViewBackground()
self.addSubview(bgBtn)
bgBtn.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
contentView.backgroundColor = .white
contentView.layer.cornerRadius = 22
contentView.layer.masksToBounds = true
contentView.isUserInteractionEnabled = true
bgBtn.addSubview(contentView)
contentView.snp.makeConstraints { make in
make.center.equalToSuperview()
make.width.equalTo(300)
}
titleLabel.font = .fus_themeBoldFont(20)
titleLabel.textColor = .fus_textColorDeep()
titleLabel.text = .fus_versionLocalString("欢迎回归")
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.top.equalTo(24)
make.centerX.equalToSuperview()
}
descLabel.font = .fus_themeFont(14)
descLabel.textColor = .fus_textColorMedium()
descLabel.numberOfLines = 0
descLabel.text = .fus_versionLocalString("许久未见,恭迎回归。回归7日内完成储值可以获得回归大礼包奖励。")
contentView.addSubview(descLabel)
descLabel.snp.makeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(10)
make.left.right.equalToSuperview().inset(28)
}
contentView.addSubview(recallImageView)
recallImageView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(descLabel.snp.bottom).offset(-20)
make.width.height.equalTo(185)
}
recallLabel.font = .fus_themeMediumFont(15)
recallLabel.textColor = .white
recallLabel.backgroundColor = .init(hexString: "#C1C0C0")
recallLabel.text = " " + .fus_versionLocalString("回归大礼包") + " "
recallLabel.layer.cornerRadius = 14
recallLabel.layer.masksToBounds = true
recallImageView.addSubview(recallLabel)
recallLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.bottom.equalToSuperview().offset(-10)
make.height.equalTo(28)
}
okBtn.style = .blue
okBtn.titleLabel?.font = .fus_themeMediumFont(15)
okBtn.setTitle(.fus_versionLocalString("确认"), for: .normal)
contentView.addSubview(okBtn)
okBtn.snp.makeConstraints { make in
make.top.equalTo(recallImageView.snp.bottom).offset(2)
make.centerX.equalToSuperview()
make.size.equalTo(CGSizeMake(214, 42))
make.bottom.equalToSuperview().offset(-24)
}
}
override func bindViewModel() {
super.bindViewModel()
okBtn.rx.tap.subscribe(onNext: {[weak self] in
self?.clickHandle?(true)
if FUSRouter.live().isInRoom() == true {
let config = FUSCacheDataShare.shareStore().settingInitDataModel.recallPacketConfig
let _ = FUSRouter.live().fus_showConfigHalfWebView(config, needMouted: false, allowScroll: false, userInteractionEnabled: true) {
}
}else {
var rechargeVC: FUSRechargeViewController?
if let vc = UIViewController.fus_top() as? FUSRechargeViewController {
rechargeVC = vc
}else {
let vc = FUSRechargeViewController.fus_getAndShow(forRootVC: UIViewController.fus_top(), from: .other, rechargePageFrom: .others) {
}
rechargeVC = vc
}
rechargeVC?.fus_showRecallPacketIfIneed()
}
self?.fus_dismissWithAnimation()
}).disposed(by: disposeBag)
bgBtn.rx.tap.subscribe(onNext: {[weak self] in
self?.clickHandle?(false)
self?.fus_dismissWithAnimation()
}).disposed(by: disposeBag)
}
func fus_showWithAnimation() {
UIView.animate(withDuration: 0.3) {[weak self] in
self?.alpha = 1
} completion: { _ in
}
}
func fus_dismissWithAnimation() {
UIView.animate(withDuration: 0.3) {[weak self] in
self?.alpha = 0
} completion: {[weak self] _ in
self?.removeFromSuperview()
}
}
}
...@@ -28,7 +28,8 @@ class FUSMyEmissaryQRCodeView: FUSBaseView { ...@@ -28,7 +28,8 @@ class FUSMyEmissaryQRCodeView: FUSBaseView {
let titleLabel = UILabel() let titleLabel = UILabel()
titleLabel.font = .fus_themeMediumFont(22) titleLabel.font = .fus_themeMediumFont(22)
titleLabel.textColor = .fus_textColorRich() titleLabel.textColor = .fus_textColorRich()
titleLabel.text = .fus_localString("我的使者码") // titleLabel.text = .fus_localString("我的使者码")
titleLabel.text = .fus_versionLocalString("我的邀请码")
self.addSubview(titleLabel) self.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
...@@ -39,7 +40,8 @@ class FUSMyEmissaryQRCodeView: FUSBaseView { ...@@ -39,7 +40,8 @@ class FUSMyEmissaryQRCodeView: FUSBaseView {
descLabel.font = .fus_themeFont(15) descLabel.font = .fus_themeFont(15)
descLabel.textColor = .fus_textColorMedium() descLabel.textColor = .fus_textColorMedium()
descLabel.numberOfLines = 0 descLabel.numberOfLines = 0
descLabel.text = .fus_localString("在APP—「我的」—「邀请有奖」—「右上角菜单」 -「绑定使者」扫描QRCode绑定您为使者") // descLabel.text = .fus_localString("在APP—「我的」—「邀请有奖」—「右上角菜单」 -「绑定使者」扫描QRCode绑定您为使者")
descLabel.text = .fus_versionLocalString("保存QRCode到您的相册,将此图片发送给您要邀请的好友扫描即可完成绑定您为使者和成功注册在部分国家和地区,只有完成使者绑定对方才能注册成功")
self.addSubview(descLabel) self.addSubview(descLabel)
descLabel.snp.makeConstraints { make in descLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(35) make.left.right.equalToSuperview().inset(35)
...@@ -146,12 +148,12 @@ class FUSMyEmissaryQRCodeView: FUSBaseView { ...@@ -146,12 +148,12 @@ class FUSMyEmissaryQRCodeView: FUSBaseView {
self.userNameLabel.text = FUSSwiftCacheDataShare.share.userInfo.value?.nickname self.userNameLabel.text = FUSSwiftCacheDataShare.share.userInfo.value?.nickname
// 使者码 // 使者码
qrCodeLabel.attributedText = .sj.makeText({ make in // qrCodeLabel.attributedText = .sj.makeText({ make in
make.append(.fus_localString("使者码")).textColor(.fus_textColorRich()) // make.append(.fus_localString("使者码")).textColor(.fus_textColorRich())
make.append(" ") // make.append(" ")
make.append(FUSSwiftCacheDataShare.share.userInfo.value?.uid ?? "").textColor(.fus_diamondBlue()) // make.append(FUSSwiftCacheDataShare.share.userInfo.value?.uid ?? "").textColor(.fus_diamondBlue())
make.font(.fus_themeMediumFont(20)) // make.font(.fus_themeMediumFont(20))
}) // })
} }
......
//
// FUSMyInviteQRCodeDownloadView.swift
// FUSUserCenterModule
//
// Created by aaa on 2025/6/25.
//
import UIKit
import RxSwift
import RxCocoa
class FUSMyInviteQRCodeDownloadView: FUSBaseView {
/// 头像下载完毕
let avatarImageIsReady: BehaviorRelay<Bool> = .init(value: false)
let descLabel = YYLabel()
let avatarView: UIImageView = .init(frame: CGRectMake(0, 0, 28, 28))
let userNameLabel : UILabel = .init()
let vipLevelImageView : UIImageView = .init()
let qrCodeView = FUSInviteQRCodeView(frame: CGRectMake(0, 0, 248, 248))
let qrCodeLabel = UILabel()
override func makeUI() {
super.makeUI()
self.backgroundColor = .fus_appBG()
let logoImageView = UIImageView(image: FUSUserCenterBunble.imageNamed("InviteReward_invite_qrCodeDownload_logo"))
self.addSubview(logoImageView)
logoImageView.snp.makeConstraints { make in
make.left.top.equalToSuperview().inset(14)
}
let titleLabel = UILabel()
titleLabel.font = .fus_themeMediumFont(22)
titleLabel.textColor = .fus_textColorRich()
// titleLabel.text = .fus_localString("我的使者码")
titleLabel.text = .fus_versionLocalString("我的邀请码")
self.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalTo(logoImageView).offset(100)
}
descLabel.numberOfLines = 0
descLabel.preferredMaxLayoutWidth = UIView.fus_screenW() - 35*2
self.addSubview(descLabel)
descLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(35)
make.top.equalTo(titleLabel.snp.bottom).offset(14)
}
let avatarCenterView = UIView()
self.addSubview(avatarCenterView)
avatarCenterView.snp.makeConstraints { make in
make.top.equalTo(descLabel.snp.bottom).offset(50)
make.centerX.equalToSuperview()
make.height.equalTo(28)
}
avatarView.layer.cornerRadius = 14
avatarView.layer.masksToBounds = true
avatarCenterView.addSubview(avatarView)
avatarView.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.width.equalTo(avatarView.snp.height)
}
avatarCenterView.addSubview(vipLevelImageView)
self.userNameLabel.textColor = .fus_textColorMedium()
self.userNameLabel.font = .fus_themeFont(14)
avatarCenterView.addSubview(userNameLabel)
userNameLabel.snp.makeConstraints { make in
// make.left.equalTo(avatarView.snp.right).offset(40)
make.left.equalTo(avatarView.snp.right).offset(4)
make.centerY.equalTo(avatarView.snp.centerY)
make.right.equalToSuperview()
}
vipLevelImageView.snp.makeConstraints { make in
make.left.equalTo(userNameLabel.snp.right).offset(2)
make.centerY.equalTo(avatarView.snp.centerY)
// make.size.equalTo(CGSizeMake(32, 13))
make.height.equalTo(14)
}
self.addSubview(qrCodeView)
qrCodeView.snp.makeConstraints { make in
make.top.equalTo(avatarCenterView.snp.bottom).offset(4)
make.centerX.equalToSuperview()
make.size.equalTo(CGSizeMake(248, 248))
}
qrCodeLabel.font = .fus_themeFont(15)
qrCodeLabel.textColor = .fus_textColorLight2()
qrCodeLabel.text = .init(format: .fus_versionLocalString("官网:%@"), "fusiclub.com")
self.addSubview(qrCodeLabel)
qrCodeLabel.snp.makeConstraints { make in
make.top.equalTo(qrCodeView.snp.bottom).offset(10)
make.centerX.equalToSuperview()
make.bottom.equalToSuperview().offset(-100)
}
}
override func bindViewModel() {
super.bindViewModel()
FUSInviteRewardInviteViewModel.share.inviteDataModel.subscribe(onNext: {[weak self] model in
self?.descLabel.attributedText = FUSInviteDataIndexGetInfoModel.fus_getAttr(withContent: model?.qrCodeSubtitle ?? "", font: .fus_themeFont(15), color: "#808080", isCenter: true)
})
.disposed(by: disposeBag)
self.qrCodeView.fus_setup(url: FUSInviteRewardInviteViewModel.share.inviteDataModel.value?.qrcodeFormLink ?? "", avatarURL: FUSSwiftCacheDataShare.share.userInfo.value?.face.fus_bigCdn ?? "") {[weak self] isSuccess in
if isSuccess {
self?.avatarImageIsReady.accept(true)
}
}
//vip
let privilege = FUSSwiftCacheDataShare.share.userInfo.value?.privilege
let richPower = (privilege?["richPower"] as? Bool) ?? false
self.userNameLabel.textColor = .fus_textColorMedium()
self.avatarView.setWebImageWithSubURLString(FUSSwiftCacheDataShare.share.userInfo.value?.face ?? "")
if richPower == true {
let level = FUSSwiftCacheDataShare.share.userInfo.value?.level.intValue ?? 0
self.vipLevelImageView.image = .fus_image(withLevel: level)
} else {
self.vipLevelImageView.isHidden = true
}
self.userNameLabel.text = FUSSwiftCacheDataShare.share.userInfo.value?.nickname
}
public func fus_saveQRCodeView(){
FUSAuthCenter.getAlbumPermission {[weak self] (enable) in
guard let self = self else { return }
if enable {
guard let image = self.snapshotImage() else { return }
UIImageWriteToSavedPhotosAlbum(image, self, #selector(savedPhotosAlbum(image:didFinishSavingWithError:contextInfo:)), nil)
} else {
FUSAlertView.showAlert(withTitle: nil, message: .fus_localString("请打开权限以访问相册"), cancelButtonTitle: .fus_localString("取消"), otherButtonTitles: [String.fus_localString("去设置")]) { index in
if index == 1 {
FUSAuthCenter.jumpToSystemSetting()
}
}
}
}
}
}
extension FUSMyInviteQRCodeDownloadView{
@objc func savedPhotosAlbum(image: UIImage?, didFinishSavingWithError error: NSError?, contextInfo: AnyObject) {
if error != nil {
FUSDialogView.fus_showDialog(.fus_localString("使者码QRCode保存失败"))
} else {
FUSDialogView.fus_showDialog(.fus_localString("使者码QRCode保存成功"))
}
}
}
...@@ -980,4 +980,8 @@ ...@@ -980,4 +980,8 @@
[FUSInviteRewardController fus_pushToInviteRewardWithSegmentTypeStr:segmentTypeStr]; [FUSInviteRewardController fus_pushToInviteRewardWithSegmentTypeStr:segmentTypeStr];
} }
- (UIView *)fus_showInviteRewardHalfWebAlertView:(NSDictionary *)configDict rootView:(UIView *)rootView{
return [FUSInviteConfigHalfWebAlertView fus_showWithHalfDict:configDict rootView:rootView];
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment