fixed: 1.适配小屏幕机型

feature: 1.忘记密码新增语音和短信验证码切换功能
This commit is contained in:
jiangxuefei718
2019-03-14 08:41:00 +08:00
parent 5746d392a3
commit 91aee9dac1
35 changed files with 293 additions and 129 deletions
@@ -13,9 +13,11 @@
@interface ForgetViewController ()
@property (weak, nonatomic) IBOutlet UIButton *timerButton;
@property (weak, nonatomic) IBOutlet UIButton *nextTepBtn;
@property (weak, nonatomic) IBOutlet UIButton *switchBtn;
@property(nonatomic,copy)NSString*verifyData;
@property(nonatomic,copy) NSString *areaCode;
@end
@implementation ForgetViewController
@@ -124,11 +126,11 @@
-(void)getVerifycode{
[IFISHHTTPTOOL getverifyWithTimerButton:_timerButton addphoneNumber:self.phoneNumberFiled.text zone:self.areaCode result:^(NSError *err) {
BOOL isTextCode = [[_switchBtn titleForState:UIControlStateNormal] isEqualToString:@"语音验证码"];
[IFISHHTTPTOOL getverifyWithTimerButton:_timerButton addphoneNumber:self.phoneNumberFiled.text zone:self.areaCode isTextCode:isTextCode result:^(NSError *err) {
}];
}
#define mark - 获取阿里验证码 已去
@@ -236,4 +238,16 @@
}
#pragma mark -- Actions --
// 切换语音验证码还是短信验证码
- (IBAction)switchAction:(UIButton* )sender {
if ([[self.timerButton titleForState:UIControlStateNormal] isEqualToString:@"语音验证码"]) {
[self.timerButton setTitle:@"短信验证码" forState:UIControlStateNormal];
[sender setTitle:@"语音验证码" forState:UIControlStateNormal];
} else if ([[self.timerButton titleForState:UIControlStateNormal] isEqualToString:@"短信验证码"]) {
[self.timerButton setTitle:@"语音验证码" forState:UIControlStateNormal];
[sender setTitle:@"短信验证码" forState:UIControlStateNormal];
}
}
@end
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina5_5" orientation="portrait">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -16,6 +15,7 @@
<outlet property="countryView" destination="Kuc-iA-yGB" id="lJV-d6-vuw"/>
<outlet property="nextTepBtn" destination="ONp-Rz-9VY" id="svf-xf-Go3"/>
<outlet property="phoneNumberFiled" destination="9AU-7X-or2" id="oi7-IL-dVy"/>
<outlet property="switchBtn" destination="PNt-YY-iAQ" id="nnr-9g-i1e"/>
<outlet property="timerButton" destination="qvS-eF-OGr" id="eFS-2p-xwc"/>
<outlet property="verifyTextFiled" destination="m6b-aY-UbD" id="KIH-4Q-u1O"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
@@ -23,14 +23,14 @@
</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="414" height="736"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Fse-85-LUi">
<rect key="frame" x="21" y="93" width="372" height="300.33333333333331"/>
<rect key="frame" x="21" y="93" width="333" height="274"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入您的手机号" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="9AU-7X-or2">
<rect key="frame" x="25" y="75.666666666666657" width="322" height="47.666666666666686"/>
<rect key="frame" x="25" y="70" width="283" height="42"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="9AU-7X-or2" secondAttribute="height" multiplier="283:42" id="IW4-cg-TR8"/>
@@ -39,7 +39,7 @@
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入短信验证码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="m6b-aY-UbD">
<rect key="frame" x="25" y="132.33333333333337" width="322" height="47.666666666666657"/>
<rect key="frame" x="25" y="121" width="283" height="42"/>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="m6b-aY-UbD" secondAttribute="height" multiplier="283:42" id="FIB-ry-7SG"/>
@@ -48,7 +48,7 @@
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ONp-Rz-9VY">
<rect key="frame" x="25" y="208" width="322" height="49"/>
<rect key="frame" x="25" y="191" width="283" height="43"/>
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="ONp-Rz-9VY" secondAttribute="height" multiplier="283:43" id="7QK-kc-iEt"/>
@@ -60,21 +60,19 @@
<action selector="nextStep:" destination="-1" eventType="touchUpInside" id="eCT-th-Hqi"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qvS-eF-OGr">
<rect key="frame" x="261" y="132.33333333333337" width="86" height="47.666666666666657"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qvS-eF-OGr">
<rect key="frame" x="222" y="121" width="86" height="42"/>
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="86" id="p4x-JI-IVe"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<state key="normal" title="语音验证码">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Kuc-iA-yGB">
<rect key="frame" x="25" y="20" width="322" height="47.666666666666657"/>
<rect key="frame" x="25" y="20" width="283" height="42"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="国家/地区" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4t2-r8-Y7e">
<rect key="frame" x="10" y="13" width="71" height="21"/>
<rect key="frame" x="10" y="10.5" width="71" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="kBo-mD-Uyr"/>
<constraint firstAttribute="width" constant="71" id="sSK-8u-5YK"/>
@@ -84,7 +82,7 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kqZ-N3-UXK">
<rect key="frame" x="102" y="5" width="212" height="39"/>
<rect key="frame" x="63" y="5" width="212" height="33.5"/>
<constraints>
<constraint firstAttribute="width" constant="212" id="mfY-IJ-ZE0"/>
</constraints>
@@ -96,7 +94,6 @@
</subviews>
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="kqZ-N3-UXK" firstAttribute="centerY" secondItem="Kuc-iA-yGB" secondAttribute="centerY" id="Epi-7M-LkN"/>
<constraint firstAttribute="width" secondItem="Kuc-iA-yGB" secondAttribute="height" multiplier="283:42" id="Nq1-PQ-s9o"/>
<constraint firstItem="kqZ-N3-UXK" firstAttribute="top" secondItem="Kuc-iA-yGB" secondAttribute="top" constant="5" id="SvQ-gG-zEs"/>
<constraint firstAttribute="trailing" secondItem="kqZ-N3-UXK" secondAttribute="trailing" constant="8" id="ViY-4n-Z5K"/>
@@ -105,6 +102,16 @@
<constraint firstItem="4t2-r8-Y7e" firstAttribute="centerY" secondItem="Kuc-iA-yGB" secondAttribute="centerY" id="wUe-7b-dhI"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PNt-YY-iAQ">
<rect key="frame" x="246" y="241" width="62" height="27"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<state key="normal" title="短信验证码">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="switchAction:" destination="-1" eventType="touchUpInside" id="cKh-I5-tup"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
@@ -115,10 +122,12 @@
<constraint firstItem="qvS-eF-OGr" firstAttribute="height" secondItem="m6b-aY-UbD" secondAttribute="height" id="7fW-dZ-bcG"/>
<constraint firstAttribute="trailing" secondItem="9AU-7X-or2" secondAttribute="trailing" constant="25" id="BPA-jS-yUj"/>
<constraint firstItem="ONp-Rz-9VY" firstAttribute="top" secondItem="m6b-aY-UbD" secondAttribute="bottom" constant="28" id="C7t-Kf-WQ8"/>
<constraint firstItem="qvS-eF-OGr" firstAttribute="trailing" secondItem="9AU-7X-or2" secondAttribute="trailing" id="ENO-iH-NRW"/>
<constraint firstItem="9AU-7X-or2" firstAttribute="top" secondItem="Kuc-iA-yGB" secondAttribute="bottom" constant="8" id="L1w-J9-O6C"/>
<constraint firstItem="m6b-aY-UbD" firstAttribute="top" secondItem="9AU-7X-or2" secondAttribute="bottom" constant="9" id="LbP-7q-Ho8"/>
<constraint firstItem="qvS-eF-OGr" firstAttribute="leading" secondItem="m6b-aY-UbD" secondAttribute="trailing" constant="-86" id="Lij-Yz-btH"/>
<constraint firstAttribute="trailing" secondItem="Kuc-iA-yGB" secondAttribute="trailing" constant="25" id="MoP-80-S8X"/>
<constraint firstItem="PNt-YY-iAQ" firstAttribute="trailing" secondItem="ONp-Rz-9VY" secondAttribute="trailing" id="ODp-YI-FtE"/>
<constraint firstItem="m6b-aY-UbD" firstAttribute="centerX" secondItem="Fse-85-LUi" secondAttribute="centerX" id="Qur-Jo-Efx"/>
<constraint firstAttribute="trailing" secondItem="ONp-Rz-9VY" secondAttribute="trailing" constant="25" id="dmo-K3-nIC"/>
<constraint firstAttribute="width" secondItem="Fse-85-LUi" secondAttribute="height" multiplier="333:224" constant="-74.33035714285711" id="hja-fF-Y7Q"/>
@@ -127,6 +136,7 @@
<constraint firstItem="qvS-eF-OGr" firstAttribute="bottom" secondItem="m6b-aY-UbD" secondAttribute="bottom" id="mHf-AZ-g3T"/>
<constraint firstItem="9AU-7X-or2" firstAttribute="leading" secondItem="Fse-85-LUi" secondAttribute="leading" constant="25" id="mco-Fk-Z4F"/>
<constraint firstItem="Kuc-iA-yGB" firstAttribute="top" secondItem="Fse-85-LUi" secondAttribute="top" constant="20" id="nK2-hI-tfT"/>
<constraint firstItem="PNt-YY-iAQ" firstAttribute="top" secondItem="ONp-Rz-9VY" secondAttribute="bottom" constant="7" id="ona-GE-0ZJ"/>
</constraints>
</view>
</subviews>