提交
This commit is contained in:
20
SweetParty/主类/Mine/青少年模式/YXYoungAlertDescView.h
Executable file
20
SweetParty/主类/Mine/青少年模式/YXYoungAlertDescView.h
Executable file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// YXYoungAlertDescView.h
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2023/1/15.
|
||||
// Copyright © 2023 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YXYoungUseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YXYoungAlertDescView : UIView
|
||||
@property (weak, nonatomic) IBOutlet UIButton *knowButton;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *accLabel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
23
SweetParty/主类/Mine/青少年模式/YXYoungAlertDescView.m
Executable file
23
SweetParty/主类/Mine/青少年模式/YXYoungAlertDescView.m
Executable file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// YXYoungAlertDescView.m
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2023/1/15.
|
||||
// Copyright © 2023 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YXYoungAlertDescView.h"
|
||||
|
||||
@implementation YXYoungAlertDescView
|
||||
|
||||
- (IBAction)knowButtonAction:(id)sender {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
|
||||
self.knowButton.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(ScreenWidth-70*2, 44) direction:FXGradientChangeDirectionHorizontal startColor:mainLightColor endColor:mainDeepColor];
|
||||
}
|
||||
|
||||
@end
|
||||
131
SweetParty/主类/Mine/青少年模式/YXYoungAlertDescView.xib
Executable file
131
SweetParty/主类/Mine/青少年模式/YXYoungAlertDescView.xib
Executable file
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="YXYoungAlertDescView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dFj-kT-03l">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pVx-hr-pFv">
|
||||
<rect key="frame" x="30" y="189.5" width="315" height="352"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="young_bg" translatesAutoresizingMaskIntoConstraints="NO" id="FXR-fI-n00">
|
||||
<rect key="frame" x="0.0" y="0.0" width="315" height="352"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="青少年模式" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9SD-PB-yrK">
|
||||
<rect key="frame" x="0.0" y="125" width="315" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0039215686274509803" blue="0.14901960784313725" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="为呵护未成年人健康成长,平台特别推出青少年模式,该模式下部分功能无法正常使用。请监护人主动选择并设置监护密码。" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WfG-4e-4ZI">
|
||||
<rect key="frame" x="18" y="165.5" width="279" height="50.5"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="进入青少年模式 >" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yug-x5-TU8">
|
||||
<rect key="frame" x="97" y="226" width="121.5" height="40"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="Ofd-fY-Xbu"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
|
||||
<color key="textColor" red="0.050980392156862744" green="1" blue="0.72549019607843135" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Rv4-ek-tna">
|
||||
<rect key="frame" x="40" y="278" width="235" height="44"/>
|
||||
<color key="backgroundColor" red="0.050980392156862744" green="1" blue="0.72549019607843135" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="VqZ-IY-OET"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="知道了">
|
||||
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="22"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="knowButtonAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="DdY-aF-jdS"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sqm-S9-t5w">
|
||||
<rect key="frame" x="265" y="40" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="7ia-d8-URb"/>
|
||||
<constraint firstAttribute="width" constant="40" id="fsa-Oc-bqv"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="young_close_alert"/>
|
||||
<connections>
|
||||
<action selector="knowButtonAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="pNJ-R4-bBr"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Rv4-ek-tna" firstAttribute="leading" secondItem="pVx-hr-pFv" secondAttribute="leading" constant="40" id="0fh-12-Gc2"/>
|
||||
<constraint firstItem="yug-x5-TU8" firstAttribute="centerX" secondItem="pVx-hr-pFv" secondAttribute="centerX" id="9QO-Nm-R9U"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Rv4-ek-tna" secondAttribute="bottom" constant="30" id="9qr-Sj-dPZ"/>
|
||||
<constraint firstAttribute="trailing" secondItem="9SD-PB-yrK" secondAttribute="trailing" id="BkF-3l-czY"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Rv4-ek-tna" secondAttribute="trailing" constant="40" id="Dsx-3u-jdb"/>
|
||||
<constraint firstItem="WfG-4e-4ZI" firstAttribute="top" secondItem="9SD-PB-yrK" secondAttribute="bottom" constant="20" id="OP6-DU-IfT"/>
|
||||
<constraint firstItem="FXR-fI-n00" firstAttribute="top" secondItem="pVx-hr-pFv" secondAttribute="top" id="OWC-eX-6so"/>
|
||||
<constraint firstItem="Sqm-S9-t5w" firstAttribute="top" secondItem="pVx-hr-pFv" secondAttribute="top" constant="40" id="Ree-CL-e3h"/>
|
||||
<constraint firstItem="yug-x5-TU8" firstAttribute="top" secondItem="WfG-4e-4ZI" secondAttribute="bottom" constant="10" id="ZXa-nn-nM0"/>
|
||||
<constraint firstAttribute="trailing" secondItem="WfG-4e-4ZI" secondAttribute="trailing" constant="18" id="aB0-Xs-RBO"/>
|
||||
<constraint firstItem="9SD-PB-yrK" firstAttribute="top" secondItem="pVx-hr-pFv" secondAttribute="top" constant="125" id="hAD-gI-KOZ"/>
|
||||
<constraint firstItem="FXR-fI-n00" firstAttribute="leading" secondItem="pVx-hr-pFv" secondAttribute="leading" id="jIv-GI-oHx"/>
|
||||
<constraint firstAttribute="width" secondItem="pVx-hr-pFv" secondAttribute="height" multiplier="315:352" id="pi2-Vn-5hf"/>
|
||||
<constraint firstAttribute="trailing" secondItem="FXR-fI-n00" secondAttribute="trailing" id="rcN-e8-VOB"/>
|
||||
<constraint firstItem="WfG-4e-4ZI" firstAttribute="leading" secondItem="pVx-hr-pFv" secondAttribute="leading" constant="18" id="sVZ-1f-GNI"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Sqm-S9-t5w" secondAttribute="trailing" constant="10" id="tE4-En-vYJ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="FXR-fI-n00" secondAttribute="bottom" id="yGi-oJ-Kjj"/>
|
||||
<constraint firstItem="9SD-PB-yrK" firstAttribute="leading" secondItem="pVx-hr-pFv" secondAttribute="leading" id="yrf-Ku-tYh"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="pVx-hr-pFv" secondAttribute="trailing" constant="30" id="1aI-ju-9Ih"/>
|
||||
<constraint firstItem="pVx-hr-pFv" firstAttribute="leading" secondItem="dFj-kT-03l" secondAttribute="leading" constant="30" id="bJm-pd-cFa"/>
|
||||
<constraint firstItem="pVx-hr-pFv" firstAttribute="centerX" secondItem="dFj-kT-03l" secondAttribute="centerX" id="cvl-ZF-KGi"/>
|
||||
<constraint firstItem="pVx-hr-pFv" firstAttribute="centerY" secondItem="dFj-kT-03l" secondAttribute="centerY" multiplier="0.9" id="y7D-QF-91T"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="dFj-kT-03l" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="EiT-t1-x2L"/>
|
||||
<constraint firstItem="dFj-kT-03l" firstAttribute="trailing" secondItem="iN0-l3-epB" secondAttribute="trailing" id="HbC-y3-Uec"/>
|
||||
<constraint firstItem="dFj-kT-03l" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="auH-wK-Uza"/>
|
||||
<constraint firstAttribute="bottom" secondItem="dFj-kT-03l" secondAttribute="bottom" id="pPt-Ly-dZo"/>
|
||||
</constraints>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="accLabel" destination="yug-x5-TU8" id="f2y-8j-NWt"/>
|
||||
<outlet property="knowButton" destination="Rv4-ek-tna" id="8aq-z2-wPl"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="131.8840579710145" y="107.8125"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="young_bg" width="315" height="352"/>
|
||||
<image name="young_close_alert" width="24" height="24"/>
|
||||
</resources>
|
||||
</document>
|
||||
26
SweetParty/主类/Mine/青少年模式/YXYoungSetPwView.h
Executable file
26
SweetParty/主类/Mine/青少年模式/YXYoungSetPwView.h
Executable file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// YXYoungSetPwView.h
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "CRBoxInputView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YXYoungSetPwView : UIView
|
||||
|
||||
@property (nonatomic,strong) CRBoxInputView *boxInputView;
|
||||
@property (nonatomic,strong) CRBoxInputView *boxInputViewTwo;
|
||||
|
||||
@property (nonatomic,strong) UILabel *nameLabel;
|
||||
@property (nonatomic,strong) UILabel *descLabel;
|
||||
@property (nonatomic,strong) YYLabel *shensuLabel;
|
||||
|
||||
@property (nonatomic,assign) int type; //type == 1,标识需要开启青少年模式 ==2代表需要关闭青少年模式
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
220
SweetParty/主类/Mine/青少年模式/YXYoungSetPwView.m
Executable file
220
SweetParty/主类/Mine/青少年模式/YXYoungSetPwView.m
Executable file
@@ -0,0 +1,220 @@
|
||||
//
|
||||
// YXYoungSetPwView.m
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YXYoungSetPwView.h"
|
||||
#import "YXYoungShenSuViewController.h"
|
||||
|
||||
@interface YXYoungSetPwView ()
|
||||
|
||||
@property (nonatomic,copy) NSString *password;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YXYoungSetPwView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self setUI];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setUI {
|
||||
self.backgroundColor = HEXCOLORA(0x000000, 0.5);
|
||||
UIView *baseView = [[UIView alloc] initWithFrame:CGRectMake(15, 240, ScreenWidth-30, 248)];
|
||||
baseView.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(ScreenWidth-30, 248) direction:FXGradientChangeDirectionVertical startColor:HEXCOLOR(0xDFFFF6) endColor:HEXCOLOR(0xFFFFFF)];
|
||||
baseView.layer.cornerRadius = 16;
|
||||
[self addSubview:baseView];
|
||||
|
||||
self.nameLabel = [UILabel new];
|
||||
[baseView addSubview:self.nameLabel];
|
||||
self.nameLabel.frame = CGRectMake(0, 15, APPW-30 , 22);
|
||||
self.nameLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.nameLabel.font = YBBoldFont(18);
|
||||
self.nameLabel.text = @"请设置密码开启";
|
||||
self.nameLabel.textColor = HEXCOLOR(0x333333);
|
||||
|
||||
self.descLabel = [UILabel new];
|
||||
[baseView addSubview:self.descLabel];
|
||||
self.descLabel.frame = CGRectMake(0, CGRectGetMaxY(self.nameLabel.frame) + 10, APPW - 30, 20);
|
||||
self.descLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.descLabel.font = YBBoldFont(14);
|
||||
self.descLabel.text = @"开启青少年模式请输入密码";
|
||||
self.descLabel.textColor = HEXCOLOR(0x333333);
|
||||
|
||||
self.shensuLabel = [YYLabel new];
|
||||
[baseView addSubview:self.shensuLabel];
|
||||
self.shensuLabel.frame = CGRectMake(30, 50, APPW - 90, 50);
|
||||
self.shensuLabel.numberOfLines = 2;
|
||||
self.shensuLabel.hidden = YES;
|
||||
NSString *string = @"忘记密码可通过身份验证申诉申诉仅限成年人, \n未成年人请通知监护人完成";
|
||||
NSMutableAttributedString *arrString = [[NSMutableAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName: YBBoldFont(14),NSForegroundColorAttributeName:HEXCOLOR(0x333333)}];
|
||||
|
||||
NSRange range = [string rangeOfString:@"身份验证申诉"];
|
||||
[arrString yy_setColor:HEXCOLOR(0x0DFFB9) range:range];
|
||||
WEAK_SELF
|
||||
[arrString yy_setTextHighlightRange:range color:HEXCOLOR(0x0DFFB9) backgroundColor:kClearColor tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
NSLog(@"被点击");
|
||||
[weakSelf removeFromSuperview];
|
||||
YXYoungShenSuViewController *VC= [YXYoungShenSuViewController new];
|
||||
[VC pushSelf];
|
||||
}];
|
||||
self.shensuLabel.attributedText = arrString;
|
||||
self.shensuLabel.textVerticalAlignment = YYTextVerticalAlignmentTop;
|
||||
self.shensuLabel.textAlignment = NSTextAlignmentCenter;
|
||||
|
||||
CRBoxInputCellProperty *cellProperty = [CRBoxInputCellProperty new];
|
||||
cellProperty.cellBgColorNormal = HEXCOLORA(0x0DFFB9, 1);
|
||||
cellProperty.cellBgColorSelected = HEXCOLORA(0x0DFFB9, 1);
|
||||
cellProperty.cellCursorColor = HEXCOLORA(0x333333, 1);
|
||||
// cellProperty.cellBorderColorNormal = HEXCOLORA(0x9249FF, 1);
|
||||
// cellProperty.cellBorderColorSelected = HEXCOLORA(0xFF5157, 1);
|
||||
// cellProperty.cellCursorWidth = 0;
|
||||
cellProperty.cellCursorHeight = 30;
|
||||
cellProperty.cornerRadius = 15;
|
||||
cellProperty.cellFont = YBBoldFont(24);
|
||||
cellProperty.cellTextColor = HEXCOLOR(0x333333);
|
||||
|
||||
_boxInputView = [CRBoxInputView new];
|
||||
_boxInputView.frame = CGRectMake(30, 105, APPW-30-60, 55);
|
||||
_boxInputView.codeLength = 4;
|
||||
// _boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
|
||||
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(55, 55);
|
||||
_boxInputView.customCellProperty = cellProperty;
|
||||
[_boxInputView loadAndPrepareViewWithBeginEdit:YES];
|
||||
[baseView addSubview:_boxInputView];
|
||||
|
||||
_boxInputViewTwo = [CRBoxInputView new];
|
||||
_boxInputViewTwo.frame = CGRectMake(30, 105, APPW-30-60, 55);
|
||||
_boxInputViewTwo.codeLength = 4;
|
||||
// _boxInputViewTwo.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
|
||||
_boxInputViewTwo.boxFlowLayout.itemSize = CGSizeMake(55, 55);
|
||||
_boxInputViewTwo.customCellProperty = cellProperty;
|
||||
[_boxInputViewTwo loadAndPrepareViewWithBeginEdit:YES];
|
||||
_boxInputViewTwo.hidden = YES;
|
||||
[baseView addSubview:_boxInputViewTwo];
|
||||
|
||||
UIButton *cancelBtn = [ControlCreator createButton:baseView rect:CGRectMake(30, 190, 125, 44) text:@"取消" font:YBBoldFont(18) color:kWhiteColor backguoundColor:HEXCOLOR(0xCCCCCC) imageName:nil target:self action:@selector(cancelClick:)];
|
||||
cancelBtn.layer.cornerRadius = 22;
|
||||
cancelBtn.layer.masksToBounds = YES;
|
||||
|
||||
UIButton *confirmBtn = [ControlCreator createButton:baseView rect:CGRectMake(APPW-30-30-125, 190, 125, 44) text:@"确认" font:YBBoldFont(18) color:kBlackColor backguoundColor:kClearColor imageName:nil target:self action:@selector(confirmClick:)];
|
||||
confirmBtn.layer.cornerRadius = 22;
|
||||
confirmBtn.layer.masksToBounds = YES;
|
||||
confirmBtn.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(125, 44) direction:FXGradientChangeDirectionHorizontal startColor:HEXCOLOR(0x9FF6DD) endColor:HEXCOLOR(0x0DFFB9)];
|
||||
}
|
||||
|
||||
|
||||
- (void)cancelClick:(UIButton *)sender {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
|
||||
- (void)confirmClick:(UIButton *)sender {
|
||||
WEAK_SELF
|
||||
if (self.type == 1) {
|
||||
if (self.password.length == 4) {
|
||||
NSDictionary *parms = @{
|
||||
@"type":@"1",
|
||||
@"password":self.password,
|
||||
@"again_password":self.password
|
||||
};
|
||||
[AFNetworkRequset.shared postRequestWithParams:parms Path:@"api/mode/open_teen_mode" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
[HelpPageDefine showMessage:@"青少年模式已开启"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf removeFromSuperview];
|
||||
[UIViewController.currentViewController.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
|
||||
}];
|
||||
}
|
||||
}else if (self.type == 2) {
|
||||
if (self.password.length == 4) {
|
||||
NSDictionary *parms = @{
|
||||
@"type":@"1",
|
||||
@"password":weakSelf.password,
|
||||
};
|
||||
[AFNetworkRequset.shared postRequestWithParams:parms Path:@"api/mode/close_teen_mode" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
[HelpPageDefine showMessage:@"青少年模式已关闭"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf removeFromSuperview];
|
||||
[UIViewController.currentViewController.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
|
||||
}];
|
||||
}
|
||||
}else if (self.type == 3) {
|
||||
if (self.password.length == 4) {
|
||||
NSDictionary *parms = @{
|
||||
@"type":@"1",
|
||||
@"password":weakSelf.password,
|
||||
};
|
||||
[AFNetworkRequset.shared postRequestWithParams:parms Path:@"api/mode/close_teen_mode" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
[HelpPageDefine showMessage:@"青少年模式已关闭"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf removeFromSuperview];
|
||||
[UIViewController.currentViewController.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setType:(int)type {
|
||||
_type = type;
|
||||
WEAK_SELF
|
||||
if (self.type == 1) {
|
||||
_nameLabel.text = @"请设置密码开启";
|
||||
_descLabel.text = @"开启青少年模式请输入密码";
|
||||
_shensuLabel.hidden = YES;
|
||||
_boxInputView.hidden = NO;
|
||||
_boxInputViewTwo.hidden = YES;
|
||||
_boxInputView.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.password = text;
|
||||
}else {
|
||||
weakSelf.password = @"";
|
||||
}
|
||||
};
|
||||
} else if (_type == 2) {
|
||||
_nameLabel.text = @"请输入密码关闭";
|
||||
_descLabel.text = @"";
|
||||
_shensuLabel.hidden = NO;
|
||||
_boxInputView.hidden = NO;
|
||||
_boxInputViewTwo.hidden = YES;
|
||||
_boxInputView.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.password = text;
|
||||
}else {
|
||||
weakSelf.password = @"";
|
||||
}
|
||||
};
|
||||
}else if (_type == 3){
|
||||
_nameLabel.text = @"请输入密码关闭";
|
||||
_descLabel.text = @"关闭青少年模式请输入密码";
|
||||
_shensuLabel.hidden = YES;
|
||||
_boxInputView.hidden = NO;
|
||||
_boxInputViewTwo.hidden = YES;
|
||||
_boxInputView.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.password = text;
|
||||
}else {
|
||||
weakSelf.password = @"";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
23
SweetParty/主类/Mine/青少年模式/YXYoungSetPwViewController.h
Executable file
23
SweetParty/主类/Mine/青少年模式/YXYoungSetPwViewController.h
Executable file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// YXYoungSetPwViewController.h
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseController.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YXYoungSetPwViewController : BaseController
|
||||
|
||||
@property (nonatomic,assign) int type; //type == 1,标识需要开启青少年模式 ==2代表需要关闭青少年模式
|
||||
|
||||
|
||||
//第一打开青少年模式需要输入两次,相当于设置青少年密码,如果再次开启的话,是输入一次密码
|
||||
|
||||
//关闭青少年模式输入密码是一次
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
174
SweetParty/主类/Mine/青少年模式/YXYoungSetPwViewController.m
Executable file
174
SweetParty/主类/Mine/青少年模式/YXYoungSetPwViewController.m
Executable file
@@ -0,0 +1,174 @@
|
||||
//
|
||||
// YXYoungSetPwViewController.m
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YXYoungSetPwViewController.h"
|
||||
#import "YXYoungSetPwView.h"
|
||||
|
||||
@interface YXYoungSetPwViewController ()
|
||||
|
||||
@property (nonatomic,strong) YXYoungSetPwView *loginView;
|
||||
@property (nonatomic,copy) NSString *password;
|
||||
@property (nonatomic,copy) NSString *again_password;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YXYoungSetPwViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
UIImageView *bgImg = [ControlCreator createImageView:self.view rect:CGRectMake(0, 0, APPW, APPH) imageName:@"party_bg" backguoundColor:nil];
|
||||
bgImg.contentMode = UIViewContentModeScaleToFill;
|
||||
[self initNavBar];
|
||||
[self.view addSubview:self.loginView];
|
||||
}
|
||||
|
||||
- (void)initNavBar {
|
||||
self.navTitle = @"青少年模式";
|
||||
[self.customNavBar styleClear];
|
||||
[self.customNavBar.left0Btn setImage:ImageNamed(@"blackBack") forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
- (YXYoungSetPwView *)loginView {
|
||||
if (_loginView == nil) {
|
||||
WEAK_SELF
|
||||
_loginView = [[YXYoungSetPwView alloc] initWithFrame:CGRectMake(0, 0, APPW, APPH)];
|
||||
[self.view addSubview:_loginView];
|
||||
if (self.type == 1) {
|
||||
_loginView.shensuLabel.hidden = YES;
|
||||
_loginView.descLabel.text = @"开启青少年模式请输入密码";
|
||||
_loginView.nameLabel.text = @"请设置密码开启";
|
||||
_loginView.boxInputView.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.loginView.nameLabel.text = @"确认密码";
|
||||
weakSelf.loginView.boxInputView.hidden = YES;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = NO;
|
||||
weakSelf.password = text;
|
||||
}
|
||||
};
|
||||
_loginView.boxInputViewTwo.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.again_password = text;
|
||||
if ([weakSelf.again_password isEqualToString:weakSelf.password] == NO) {
|
||||
[HelpPageDefine showMessage:@"输入密码不一致,请重新输入"];
|
||||
weakSelf.loginView.descLabel.text = @"开启青少年模式时,需输入该密码";
|
||||
weakSelf.loginView.nameLabel.text = @"输入密码";
|
||||
weakSelf.loginView.boxInputView.hidden = NO;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = YES;
|
||||
[weakSelf.loginView.boxInputView clearAll];
|
||||
[weakSelf.loginView.boxInputViewTwo clearAll];
|
||||
weakSelf.password = @"";
|
||||
} else {
|
||||
NSDictionary *parms = @{
|
||||
@"type":@"1",
|
||||
@"password":weakSelf.password,
|
||||
@"again_password":weakSelf.again_password
|
||||
};
|
||||
[AFNetworkRequset.shared postRequestWithParams:parms Path:@"api/mode/open_teen_mode" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
[HelpPageDefine showMessage:@"青少年模式已开启"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
weakSelf.password = @"";
|
||||
weakSelf.again_password = @"";
|
||||
weakSelf.loginView.descLabel.text = @"开启青少年模式时,需输入该密码";
|
||||
weakSelf.loginView.nameLabel.text = @"输入密码";
|
||||
weakSelf.loginView.boxInputView.hidden = NO;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = YES;
|
||||
[weakSelf.loginView.boxInputView clearAll];
|
||||
[weakSelf.loginView.boxInputViewTwo clearAll];
|
||||
}];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} else if (_type == 2) {
|
||||
_loginView.shensuLabel.hidden = NO;
|
||||
_loginView.descLabel.text = @"关闭青少年模式请输入密码";
|
||||
_loginView.boxInputViewTwo.hidden = YES;
|
||||
_loginView.boxInputView.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.loginView.nameLabel.text = @"输入密码";
|
||||
weakSelf.loginView.boxInputView.hidden = YES;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = NO;
|
||||
weakSelf.password = text;
|
||||
|
||||
NSDictionary *parms = @{
|
||||
@"type":@"1",
|
||||
@"password":weakSelf.password,
|
||||
};
|
||||
[AFNetworkRequset.shared postRequestWithParams:parms Path:@"api/mode/close_teen_mode" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
[HelpPageDefine showMessage:@"青少年模式已关闭"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
weakSelf.password = @"";
|
||||
weakSelf.again_password = @"";
|
||||
weakSelf.loginView.descLabel.text = @"关闭青少年模式,请输入开启时设置的密码";
|
||||
weakSelf.loginView.nameLabel.text = @"输入密码";
|
||||
weakSelf.loginView.boxInputView.hidden = NO;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = YES;
|
||||
[weakSelf.loginView.boxInputView clearAll];
|
||||
[weakSelf.loginView.boxInputViewTwo clearAll];
|
||||
}];
|
||||
} else {
|
||||
|
||||
}
|
||||
};
|
||||
}else if (_type == 3){
|
||||
_loginView.shensuLabel.hidden = YES;
|
||||
_loginView.descLabel.text = @"关闭青少年模式请输入密码";
|
||||
_loginView.boxInputView.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.loginView.nameLabel.text = @"确认密码";
|
||||
weakSelf.loginView.boxInputView.hidden = YES;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = NO;
|
||||
weakSelf.password = text;
|
||||
}
|
||||
};
|
||||
_loginView.boxInputViewTwo.textDidChangeblock = ^(NSString * _Nullable text, BOOL isFinished) {
|
||||
if (isFinished == YES) {
|
||||
weakSelf.loginView.nameLabel.text = @"输入密码";
|
||||
weakSelf.loginView.boxInputView.hidden = YES;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = NO;
|
||||
weakSelf.password = text;
|
||||
|
||||
NSDictionary *parms = @{
|
||||
@"type":@"1",
|
||||
@"password":weakSelf.password,
|
||||
};
|
||||
[AFNetworkRequset.shared postRequestWithParams:parms Path:@"api/mode/close_teen_mode" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
[HelpPageDefine showMessage:@"青少年模式已关闭"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
weakSelf.password = @"";
|
||||
weakSelf.again_password = @"";
|
||||
weakSelf.loginView.descLabel.text = @"关闭青少年模式,请输入开启时设置的密码";
|
||||
weakSelf.loginView.nameLabel.text = @"输入密码";
|
||||
weakSelf.loginView.boxInputView.hidden = NO;
|
||||
weakSelf.loginView.boxInputViewTwo.hidden = YES;
|
||||
[weakSelf.loginView.boxInputView clearAll];
|
||||
[weakSelf.loginView.boxInputViewTwo clearAll];
|
||||
}];
|
||||
} else {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
return _loginView;
|
||||
}
|
||||
|
||||
@end
|
||||
17
SweetParty/主类/Mine/青少年模式/YXYoungShenSuViewController.h
Executable file
17
SweetParty/主类/Mine/青少年模式/YXYoungShenSuViewController.h
Executable file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// YXYoungShenSuViewController.h
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YXYoungShenSuViewController : BaseController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
81
SweetParty/主类/Mine/青少年模式/YXYoungShenSuViewController.m
Executable file
81
SweetParty/主类/Mine/青少年模式/YXYoungShenSuViewController.m
Executable file
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// YXYoungShenSuViewController.m
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YXYoungShenSuViewController.h"
|
||||
#import "YXYoungSetPwViewController.h"
|
||||
#import "YXYoungSetPwView.h"
|
||||
|
||||
@interface YXYoungShenSuViewController ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *idTextField;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *submitButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YXYoungShenSuViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.view.backgroundColor = HEXCOLOR(0xFAFAFA);
|
||||
UIImageView *bgImg = [ControlCreator createImageView:self.view rect:CGRectMake(0, 0, APPW, APPH) imageName:@"party_bg" backguoundColor:nil];
|
||||
bgImg.contentMode = UIViewContentModeScaleToFill;
|
||||
[self.view sendSubviewToBack:bgImg];
|
||||
|
||||
[self initNavBar];
|
||||
UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 15, 48)];
|
||||
leftView.backgroundColor = HEXCOLOR(0xFAFAFA);
|
||||
|
||||
UIView *leftView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 15, 48)];
|
||||
leftView1.backgroundColor = HEXCOLOR(0xFAFAFA);
|
||||
// self.nameTextField.leftView = leftView;
|
||||
// self.idTextField.leftView = leftView1;
|
||||
self.nameTextField.leftViewMode = UITextFieldViewModeAlways;
|
||||
self.idTextField.leftViewMode = UITextFieldViewModeAlways;
|
||||
[self.submitButton setJianBianWithCGSize:CGSizeMake(APPW - 30, 48)];
|
||||
}
|
||||
|
||||
- (void)initNavBar {
|
||||
self.navTitle = @"身份申诉";
|
||||
[self.customNavBar styleClear];
|
||||
[self.customNavBar.left0Btn setImage:ImageNamed(@"blackBack") forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
- (IBAction)submitButtonAction:(id)sender {
|
||||
if (self.nameTextField.text.length < 1) {
|
||||
[HelpPageDefine showMessage:@"请输入姓名"];
|
||||
return;
|
||||
}
|
||||
if (self.idTextField.text.length < 1) {
|
||||
[HelpPageDefine showMessage:@"请输入身份证号码"];
|
||||
return;
|
||||
}
|
||||
NSDictionary *parms = @{
|
||||
@"real_name":self.nameTextField.text,
|
||||
@"card_id":self.idTextField.text
|
||||
};
|
||||
[AFNetworkRequset.shared postRequestWithParams:parms Path:@"api/mode/edit_teen_mode" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
// [self.view makeToast:@"青少年模式已关闭" duration:0.5 position:CSToastPositionCenter];
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// [self.navigationController popToRootViewControllerAnimated:YES];
|
||||
// });
|
||||
|
||||
// YXYoungSetPwViewController *setpwvc = [[YXYoungSetPwViewController alloc] init];
|
||||
// setpwvc.type = 3;
|
||||
// [setpwvc pushSelf];
|
||||
|
||||
YXYoungSetPwView *view = [[YXYoungSetPwView alloc] initWithFrame:CGRectMake(0, 0, APPW, APPH)];
|
||||
view.type = 3;
|
||||
[MainWindow() addSubview:view];
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
156
SweetParty/主类/Mine/青少年模式/YXYoungShenSuViewController.xib
Executable file
156
SweetParty/主类/Mine/青少年模式/YXYoungShenSuViewController.xib
Executable file
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina5_9" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="YXYoungShenSuViewController">
|
||||
<connections>
|
||||
<outlet property="idTextField" destination="iay-t2-7GE" id="TfP-Q5-YhT"/>
|
||||
<outlet property="nameTextField" destination="0Gd-Te-9Wh" id="hje-gb-Y9I"/>
|
||||
<outlet property="submitButton" destination="fIN-Jy-LTm" id="xIY-oB-ARr"/>
|
||||
<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" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qLs-mD-XRs">
|
||||
<rect key="frame" x="15" y="55" width="345" height="220"/>
|
||||
<subviews>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PPb-aG-XRf">
|
||||
<rect key="frame" x="0.0" y="60" width="345" height="54"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入您的真实姓名" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="0Gd-Te-9Wh">
|
||||
<rect key="frame" x="58" y="0.0" width="272" height="54"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="22.5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textField>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="姓名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bln-Rs-9WH">
|
||||
<rect key="frame" x="15" y="17" width="33" height="20"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="0Gd-Te-9Wh" secondAttribute="trailing" constant="15" id="0i3-yC-Aec"/>
|
||||
<constraint firstItem="0Gd-Te-9Wh" firstAttribute="leading" secondItem="bln-Rs-9WH" secondAttribute="trailing" constant="10" id="FdW-X7-Pf3"/>
|
||||
<constraint firstAttribute="height" constant="54" id="IB0-ZD-BZw"/>
|
||||
<constraint firstItem="0Gd-Te-9Wh" firstAttribute="top" secondItem="PPb-aG-XRf" secondAttribute="top" id="clz-Eu-hoQ"/>
|
||||
<constraint firstItem="bln-Rs-9WH" firstAttribute="leading" secondItem="PPb-aG-XRf" secondAttribute="leading" constant="15" id="fjO-dd-ylS"/>
|
||||
<constraint firstItem="bln-Rs-9WH" firstAttribute="centerY" secondItem="PPb-aG-XRf" secondAttribute="centerY" id="kIA-vh-W0A"/>
|
||||
<constraint firstAttribute="bottom" secondItem="0Gd-Te-9Wh" secondAttribute="bottom" id="ovN-SK-cKU"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="16"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DWI-qP-UNp">
|
||||
<rect key="frame" x="0.0" y="129" width="345" height="54"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="身份证号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oph-Lg-BI5">
|
||||
<rect key="frame" x="15" y="17" width="65.333333333333329" height="20"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入您的身份证号" textAlignment="right" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="iay-t2-7GE">
|
||||
<rect key="frame" x="90.333333333333329" y="0.0" width="239.66666666666669" height="54"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="22.5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</textField>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="iay-t2-7GE" secondAttribute="bottom" id="Ba3-sp-ky1"/>
|
||||
<constraint firstItem="oph-Lg-BI5" firstAttribute="centerY" secondItem="DWI-qP-UNp" secondAttribute="centerY" id="Jp7-a3-R9h"/>
|
||||
<constraint firstAttribute="trailing" secondItem="iay-t2-7GE" secondAttribute="trailing" constant="15" id="YdR-Ab-FAH"/>
|
||||
<constraint firstItem="iay-t2-7GE" firstAttribute="top" secondItem="DWI-qP-UNp" secondAttribute="top" id="jYw-2T-eyD"/>
|
||||
<constraint firstItem="oph-Lg-BI5" firstAttribute="leading" secondItem="DWI-qP-UNp" secondAttribute="leading" constant="15" id="sv4-4d-N9n"/>
|
||||
<constraint firstItem="iay-t2-7GE" firstAttribute="leading" secondItem="oph-Lg-BI5" secondAttribute="trailing" constant="10" id="yAQ-NK-qYX"/>
|
||||
<constraint firstAttribute="height" constant="54" id="zTS-l9-aMn"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="16"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="DWI-qP-UNp" secondAttribute="trailing" id="Uir-po-y73"/>
|
||||
<constraint firstItem="DWI-qP-UNp" firstAttribute="leading" secondItem="qLs-mD-XRs" secondAttribute="leading" id="Ww4-J4-crK"/>
|
||||
<constraint firstItem="PPb-aG-XRf" firstAttribute="top" secondItem="qLs-mD-XRs" secondAttribute="top" constant="60" id="bMO-1Y-Lmq"/>
|
||||
<constraint firstItem="DWI-qP-UNp" firstAttribute="top" secondItem="PPb-aG-XRf" secondAttribute="bottom" constant="15" id="fDr-aJ-Due"/>
|
||||
<constraint firstAttribute="trailing" secondItem="PPb-aG-XRf" secondAttribute="trailing" id="pYA-HS-wgD"/>
|
||||
<constraint firstItem="PPb-aG-XRf" firstAttribute="leading" secondItem="qLs-mD-XRs" secondAttribute="leading" id="qBO-Zw-uxj"/>
|
||||
<constraint firstAttribute="height" constant="220" id="wzY-dk-18F"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="15"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fIN-Jy-LTm">
|
||||
<rect key="frame" x="15" y="380" width="345" height="48"/>
|
||||
<color key="backgroundColor" red="0.050980392156862744" green="1" blue="0.72549019607843135" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="48" id="ufZ-Rc-zPG"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="确定">
|
||||
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<state key="highlighted" title="下一步">
|
||||
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="24"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="submitButtonAction:" destination="-1" eventType="touchUpInside" id="ksx-C7-p4Y"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="qLs-mD-XRs" secondAttribute="trailing" constant="15" id="5na-0P-7DP"/>
|
||||
<constraint firstItem="fIN-Jy-LTm" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="15" id="CRS-33-TwP"/>
|
||||
<constraint firstItem="qLs-mD-XRs" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="15" id="RhX-5n-gVv"/>
|
||||
<constraint firstItem="fIN-Jy-LTm" firstAttribute="top" secondItem="qLs-mD-XRs" secondAttribute="bottom" constant="105" id="T1s-rc-gMV"/>
|
||||
<constraint firstItem="qLs-mD-XRs" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="55" id="pBZ-dC-go6"/>
|
||||
<constraint firstAttribute="trailing" secondItem="fIN-Jy-LTm" secondAttribute="trailing" constant="15" id="xYg-6B-O9g"/>
|
||||
</constraints>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="130.40000000000001" y="-11.083743842364532"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
33
SweetParty/主类/Mine/青少年模式/YXYoungUseView.h
Executable file
33
SweetParty/主类/Mine/青少年模式/YXYoungUseView.h
Executable file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// YXYoungUseView.h
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YXYoungUseView : UIView
|
||||
|
||||
@property (nonatomic,strong) UIImageView *iconImageView;
|
||||
@property (nonatomic,strong) UILabel *nameLabel;
|
||||
@property (nonatomic,strong) UIView *coverView;
|
||||
@property (nonatomic,strong) YYLabel *nameOne;
|
||||
@property (nonatomic,strong) YYLabel *nameTwo;
|
||||
@property (nonatomic,strong) YYLabel *nameThree;
|
||||
|
||||
@property (nonatomic,strong) UIImageView *oneDot;
|
||||
@property (nonatomic,strong) UIImageView *twoDot;
|
||||
@property (nonatomic,strong) UIImageView *threeDot;
|
||||
|
||||
@property (nonatomic,strong) YYLabel *delegateLabel;
|
||||
@property (nonatomic,strong) UIButton *agreeButton;
|
||||
|
||||
@property (nonatomic,strong) UIButton *submitButton;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
135
SweetParty/主类/Mine/青少年模式/YXYoungUseView.m
Executable file
135
SweetParty/主类/Mine/青少年模式/YXYoungUseView.m
Executable file
@@ -0,0 +1,135 @@
|
||||
//
|
||||
// YXYoungUseView.m
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YXYoungUseView.h"
|
||||
#import "BJWebVC.h"
|
||||
|
||||
@implementation YXYoungUseView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self setUI];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setUI {
|
||||
self.iconImageView = [UIImageView new];
|
||||
[self addSubview:self.iconImageView];
|
||||
self.iconImageView.frame = CGRectMake(APPW * 0.5 - 125/2, yb_NavigationBar_H + 25, 125, 125);
|
||||
self.iconImageView.image = ImageNamed(@"young_dunpai");
|
||||
|
||||
self.nameLabel = [UILabel new];
|
||||
[self addSubview:self.nameLabel];
|
||||
self.nameLabel.frame = CGRectMake(32, CGRectGetMaxY(self.iconImageView.frame) + 12, APPW - 64, 22);
|
||||
self.nameLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.nameLabel.font = YBBoldFont(17);
|
||||
self.nameLabel.text = @"青少年模式";
|
||||
self.nameLabel.textColor = HEXCOLOR(0x000126);
|
||||
|
||||
self.coverView = [UIView new];
|
||||
[self addSubview:self.coverView];
|
||||
self.coverView.frame = CGRectMake(15, CGRectGetMaxY(self.nameLabel.frame) + 30, APPW - 30, 250);
|
||||
self.coverView.layer.cornerRadius = 14;
|
||||
self.coverView.layer.masksToBounds = YES;
|
||||
self.coverView.backgroundColor = kClearColor;
|
||||
|
||||
self.nameOne = [YYLabel new];
|
||||
[self.coverView addSubview:self.nameOne];
|
||||
self.nameOne.frame = CGRectMake(34, 22, APPW - 30 - 34 -20, 35);
|
||||
self.nameOne.text = @"1、在青少年模式中,我们在首页精选了一些教育类、知识类内容,且无法开启直播功能;";
|
||||
self.nameOne.numberOfLines = 0;
|
||||
self.nameOne.font = YBMediumFont(13);
|
||||
self.nameOne.textVerticalAlignment = YYTextVerticalAlignmentTop;
|
||||
self.nameOne.textAlignment = NSTextAlignmentLeft;
|
||||
|
||||
self.oneDot = [UIImageView new];
|
||||
[self.coverView addSubview:self.oneDot];
|
||||
self.oneDot.sd_layout.topEqualToView(self.nameOne).leftSpaceToView(self.coverView, 16).widthIs(10).heightIs(10);
|
||||
self.oneDot.image = ImageNamed(@"young_detail_dot");
|
||||
self.oneDot.hidden = YES;
|
||||
|
||||
self.nameTwo = [YYLabel new];
|
||||
[self.coverView addSubview:self.nameTwo];
|
||||
self.nameTwo.frame = CGRectMake(34, CGRectGetMaxY(self.nameOne.frame) + 35, APPW - 30 - 34 -20, 54);
|
||||
self.nameTwo.text = @"2、开启青少年模式后,将自动为您开启时间锁,单日使用时间不超过40分钟,晚上10点至早上6点无法使用;";
|
||||
self.nameTwo.numberOfLines = 0;
|
||||
self.nameTwo.font = YBMediumFont(13);
|
||||
self.nameTwo.textVerticalAlignment = YYTextVerticalAlignmentTop;
|
||||
self.nameTwo.textAlignment = NSTextAlignmentLeft;
|
||||
|
||||
self.twoDot = [UIImageView new];
|
||||
[self.coverView addSubview:self.twoDot];
|
||||
self.twoDot.sd_layout.topEqualToView(self.nameTwo).leftSpaceToView(self.coverView, 16).widthIs(10).heightIs(10);
|
||||
self.twoDot.image = ImageNamed(@"young_detail_dot");
|
||||
self.twoDot.hidden = YES;
|
||||
|
||||
self.nameThree = [YYLabel new];
|
||||
[self.coverView addSubview:self.nameThree];
|
||||
self.nameThree.frame = CGRectMake(34, CGRectGetMaxY(self.nameTwo.frame) + 35, APPW - 30 - 34 -20, 56);
|
||||
self.nameThree.text = @"3、青少年模式下收集的所有用户(包括可能的14周岁以上的用户)的个人信息,平台承诺将均按照《平台儿童个人信息保护规则》进行处理和保护。";
|
||||
self.nameThree.numberOfLines = 0;
|
||||
self.nameThree.font = YBMediumFont(13);
|
||||
self.nameThree.textVerticalAlignment = YYTextVerticalAlignmentTop;
|
||||
self.nameThree.textAlignment = NSTextAlignmentLeft;
|
||||
|
||||
self.threeDot = [UIImageView new];
|
||||
[self.coverView addSubview:self.threeDot];
|
||||
self.threeDot.sd_layout.topEqualToView(self.nameThree).leftSpaceToView(self.coverView, 16).widthIs(10).heightIs(10);
|
||||
self.threeDot.image = ImageNamed(@"young_detail_dot");
|
||||
self.threeDot.hidden = YES;
|
||||
|
||||
[self setBottomUI];
|
||||
|
||||
self.nameOne.textColor = self.nameTwo.textColor = self.nameThree.textColor = HEXCOLOR(0x000126);
|
||||
}
|
||||
|
||||
- (void)setBottomUI {
|
||||
self.delegateLabel = [YYLabel new];
|
||||
[self addSubview:self.delegateLabel];
|
||||
self.delegateLabel.frame = CGRectMake(54, APPH - 140, APPW - 54 - 0, 15);
|
||||
self.delegateLabel.numberOfLines = 2;
|
||||
NSString *string = @"我已认真阅读并同意《语音儿童个人信息保护规则》";
|
||||
NSMutableAttributedString *arrString = [[NSMutableAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName: YBFont(12),NSForegroundColorAttributeName: HEXCOLOR(0x333333)}];
|
||||
|
||||
NSRange range = [string rangeOfString:@"《语音儿童个人信息保护规则》"];
|
||||
[arrString yy_setColor:HEXCOLOR(0x00B682) range:range];
|
||||
|
||||
[arrString yy_setTextHighlightRange:range color:HEXCOLOR(0x00B682) backgroundColor:kClearColor tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||
NSLog(@"被点击");
|
||||
BJWebVC *vc = [[BJWebVC alloc] init];
|
||||
vc.webUrl = [NSString stringWithFormat:@"%@%@", VERSION_HTTPS_SERVER, @"index.php/index/index/page_show?id=10"];
|
||||
[vc pushSelf];
|
||||
|
||||
}];
|
||||
self.delegateLabel.attributedText = arrString;
|
||||
self.delegateLabel.textVerticalAlignment = YYTextVerticalAlignmentTop;
|
||||
self.delegateLabel.textAlignment = NSTextAlignmentLeft;
|
||||
|
||||
self.agreeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[self addSubview:self.agreeButton];
|
||||
self.agreeButton.sd_layout.widthIs(40).heightIs(40).rightSpaceToView(self.delegateLabel, 5).topEqualToView(self.delegateLabel);
|
||||
self.agreeButton.imageView.sd_layout.rightEqualToView(self.agreeButton).topEqualToView(self.agreeButton).widthIs(13).heightIs(13);
|
||||
[self.agreeButton setImage:ImageNamed(@"xieyi_nor") forState:0];
|
||||
[self.agreeButton setImage:ImageNamed(@"xieyi_sel") forState:UIControlStateSelected];
|
||||
|
||||
self.submitButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[self addSubview:self.submitButton];
|
||||
self.submitButton.sd_layout.centerXEqualToView(self).bottomSpaceToView(self, 60).heightIs(48).widthIs(APPW - 68);
|
||||
self.submitButton.sd_cornerRadius = @(24);
|
||||
[self.submitButton setJianBianWithCGSize:CGSizeMake(APPW - 68, 48)];
|
||||
[self.submitButton setTitleColor:kBlackColor forState:0];
|
||||
[self.submitButton setTitle:@"开启青少年模式" forState:0];
|
||||
self.submitButton.titleLabel.font = YBBoldFont(16);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
20
SweetParty/主类/Mine/青少年模式/YXYoungUseViewController.h
Executable file
20
SweetParty/主类/Mine/青少年模式/YXYoungUseViewController.h
Executable file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// YXYoungUseViewController.h
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YXYoungUseViewController : BaseController
|
||||
|
||||
@property (nonatomic,assign) int type; //type == 1,标识需要开启青少年模式 ==2代表需要关闭青少年模式
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
94
SweetParty/主类/Mine/青少年模式/YXYoungUseViewController.m
Executable file
94
SweetParty/主类/Mine/青少年模式/YXYoungUseViewController.m
Executable file
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// YXYoungUseViewController.m
|
||||
// romantic
|
||||
//
|
||||
// Created by MAC on 2022/12/15.
|
||||
// Copyright © 2022 romantic. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YXYoungUseViewController.h"
|
||||
#import "YXYoungUseView.h"
|
||||
#import "YXYoungSetPwViewController.h"
|
||||
#import "YXYoungSetPwView.h"
|
||||
|
||||
@interface YXYoungUseViewController ()
|
||||
|
||||
@property (nonatomic,strong) YXYoungUseView *userView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YXYoungUseViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
UIImageView *bgImg = [ControlCreator createImageView:self.view rect:CGRectMake(0, 0, APPW, APPH) imageName:@"party_bg" backguoundColor:nil];
|
||||
bgImg.contentMode = UIViewContentModeScaleToFill;
|
||||
[self initNavBar];
|
||||
[self.view addSubview:self.userView];
|
||||
}
|
||||
|
||||
- (void)initNavBar {
|
||||
self.navTitle = @"青少年模式";
|
||||
[self.customNavBar styleClear];
|
||||
[self.customNavBar.left0Btn setImage:ImageNamed(@"blackBack") forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
- (YXYoungUseView *)userView {
|
||||
if(_userView == nil) {
|
||||
_userView = [[YXYoungUseView alloc] initWithFrame:CGRectMake(0, 0, APPW, APPH)];
|
||||
[self.view addSubview:self.userView];
|
||||
|
||||
[self.userView.submitButton addTarget:self
|
||||
action:@selector(submitButtonAction:)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[self.userView.agreeButton addTarget:self
|
||||
action:@selector(agreeButtonAction:)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
if (self.type == 1) {
|
||||
self.userView.nameLabel.text = @"青少年模式已关闭";
|
||||
[self.userView.submitButton setTitle:@"开启青少年模式" forState:0];
|
||||
self.userView.agreeButton.hidden = self.userView.delegateLabel.hidden = NO;
|
||||
self.userView.iconImageView.image = ImageNamed(@"young_dunpai");
|
||||
} else {
|
||||
self.userView.nameLabel.text = @"青少年模式已开启";
|
||||
[self.userView.submitButton setTitle:@"关闭青少年模式" forState:0];
|
||||
self.userView.agreeButton.hidden = self.userView.delegateLabel.hidden = YES;
|
||||
self.userView.iconImageView.image = ImageNamed(@"young_dunpai_sel");
|
||||
|
||||
}
|
||||
}
|
||||
return _userView;
|
||||
}
|
||||
|
||||
- (void)submitButtonAction:(UIButton *)sender {
|
||||
if (self.type == 1) {
|
||||
if (_userView.agreeButton.isSelected == NO) {
|
||||
[HelpPageDefine showMessage:@"请先阅读并同意协议"];
|
||||
return;
|
||||
}
|
||||
// YXYoungSetPwViewController *vc = [YXYoungSetPwViewController new];
|
||||
// vc.type = 1;//开启青少年模式
|
||||
// [vc pushSelf];
|
||||
|
||||
YXYoungSetPwView *view = [[YXYoungSetPwView alloc] initWithFrame:CGRectMake(0, 0, APPW, APPH)];
|
||||
view.type = 1;
|
||||
[MainWindow() addSubview:view];
|
||||
} else {
|
||||
// YXYoungSetPwViewController *vc = [YXYoungSetPwViewController new];
|
||||
// vc.type = 2;//关闭青少年模式
|
||||
// [vc pushSelf];
|
||||
|
||||
YXYoungSetPwView *view = [[YXYoungSetPwView alloc] initWithFrame:CGRectMake(0, 0, APPW, APPH)];
|
||||
view.type = 2;
|
||||
[MainWindow() addSubview:view];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)agreeButtonAction:(UIButton *)sender {
|
||||
sender.selected = !sender.selected;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user