login 适配 se 5s 新增icon 主页修改
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
NSDictionary *param = @{
|
||||
@"mobile":phoneNumber
|
||||
};
|
||||
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/sendcode" method:RequestPostMethod parms:param];
|
||||
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/registersendcode" method:RequestPostMethod parms:param];
|
||||
|
||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
@property (weak, nonatomic) IBOutlet UIButton *weiXinLoginBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *registBtn;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *wexinbtnImageView;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *secretBtn;
|
||||
|
||||
@end
|
||||
@@ -36,7 +35,7 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
[self setUpX];
|
||||
[self textFieldUI];
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -28,139 +27,155 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="RIl-8E-GcR">
|
||||
<rect key="frame" x="131" y="102" width="114" height="114"/>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Z8i-yN-1Cd">
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="手机号码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Yiv-h8-4V1">
|
||||
<rect key="frame" x="65" y="225" width="245" height="48"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="48" id="vg0-nn-MyL"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qzA-vE-CGR">
|
||||
<rect key="frame" x="65" y="275" width="245" height="2"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="2" id="4IT-CI-Nj4"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Y1I-OE-6t1">
|
||||
<rect key="frame" x="65" y="279" width="161" height="48"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="48" id="rw6-Ax-vah"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
|
||||
</textField>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZJU-Uo-5TM">
|
||||
<rect key="frame" x="65" y="331" width="245" height="2"/>
|
||||
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="2" id="kqB-Hm-kqr"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="chq-bd-6sQ">
|
||||
<rect key="frame" x="234" y="341" width="76" height="37"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="76" id="7Tc-Zf-bbN"/>
|
||||
<constraint firstAttribute="height" constant="37" id="xjD-it-bBa"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<state key="normal" title="忘记密码">
|
||||
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="forgetPassBtn:" destination="-1" eventType="touchUpInside" id="GR3-Gw-sRB"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Of-JP-gMR">
|
||||
<rect key="frame" x="65" y="386" width="245" height="42"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="42" id="apM-nh-gox"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
|
||||
<state key="normal" title=" 登录">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Szo-8C-Zin">
|
||||
<rect key="frame" x="234" y="282" width="76" height="42"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="42" id="HyY-eo-8yw"/>
|
||||
<constraint firstAttribute="width" constant="76" id="pz1-th-22o"/>
|
||||
</constraints>
|
||||
<state key="normal" image="btn_tab_desplay"/>
|
||||
</button>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_circle_avatar" translatesAutoresizingMaskIntoConstraints="NO" id="RIl-8E-GcR">
|
||||
<rect key="frame" x="131" y="82" width="114" height="114"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="114" id="JgO-PU-ypI"/>
|
||||
<constraint firstAttribute="width" constant="114" id="mG0-1p-gP7"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dnL-WV-spY">
|
||||
<rect key="frame" x="115" y="523" width="144" height="38"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="38" id="l1O-3i-Plv"/>
|
||||
<constraint firstAttribute="width" constant="144" id="zzO-p2-ENu"/>
|
||||
</constraints>
|
||||
<inset key="titleEdgeInsets" minX="-130" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<inset key="imageEdgeInsets" minX="9" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" image="btn_wechat">
|
||||
<attributedString key="attributedTitle">
|
||||
<fragment content="微信号登录">
|
||||
<attributes>
|
||||
<font key="NSFont" size="12" name="PingFangSC-Regular"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
</state>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F5p-cf-frr">
|
||||
<rect key="frame" x="108" y="436" width="161" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="161" id="EU3-ax-K1r"/>
|
||||
<constraint firstAttribute="height" constant="40" id="W9a-lX-GbY"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<state key="normal" title="创建账号">
|
||||
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="RIl-8E-GcR" secondAttribute="height" multiplier="1:1" id="bfp-Q6-OmK"/>
|
||||
<constraint firstItem="RIl-8E-GcR" firstAttribute="top" secondItem="Z8i-yN-1Cd" secondAttribute="top" constant="82" id="4Ud-t0-vg5"/>
|
||||
<constraint firstItem="chq-bd-6sQ" firstAttribute="top" secondItem="ZJU-Uo-5TM" secondAttribute="bottom" constant="8" id="4uH-Hy-3Ai"/>
|
||||
<constraint firstItem="RIl-8E-GcR" firstAttribute="centerX" secondItem="Yiv-h8-4V1" secondAttribute="centerX" id="7Xu-ux-Onh"/>
|
||||
<constraint firstItem="chq-bd-6sQ" firstAttribute="trailing" secondItem="ZJU-Uo-5TM" secondAttribute="trailing" id="AYA-eD-1K2"/>
|
||||
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="leading" secondItem="8Of-JP-gMR" secondAttribute="leading" id="B8L-kP-kUe"/>
|
||||
<constraint firstItem="F5p-cf-frr" firstAttribute="top" secondItem="8Of-JP-gMR" secondAttribute="bottom" constant="8" id="Frt-kl-gMg"/>
|
||||
<constraint firstItem="qzA-vE-CGR" firstAttribute="top" secondItem="Yiv-h8-4V1" secondAttribute="bottom" constant="2" id="L0e-cp-tPg"/>
|
||||
<constraint firstItem="RIl-8E-GcR" firstAttribute="centerX" secondItem="F5p-cf-frr" secondAttribute="centerX" id="Moz-Pn-3O3"/>
|
||||
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="width" secondItem="qzA-vE-CGR" secondAttribute="width" id="Mpu-H1-Myf"/>
|
||||
<constraint firstItem="Szo-8C-Zin" firstAttribute="centerY" secondItem="Y1I-OE-6t1" secondAttribute="centerY" id="O8A-1t-51Q"/>
|
||||
<constraint firstItem="Y1I-OE-6t1" firstAttribute="top" secondItem="qzA-vE-CGR" secondAttribute="bottom" constant="2" id="P0X-8h-DcU"/>
|
||||
<constraint firstItem="8Of-JP-gMR" firstAttribute="centerX" secondItem="dnL-WV-spY" secondAttribute="centerX" id="PVe-Ht-ZJP"/>
|
||||
<constraint firstItem="Y1I-OE-6t1" firstAttribute="leading" secondItem="qzA-vE-CGR" secondAttribute="leading" id="Phn-mX-UR9"/>
|
||||
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="top" secondItem="Y1I-OE-6t1" secondAttribute="bottom" constant="4" id="SMR-RS-X6x"/>
|
||||
<constraint firstItem="Szo-8C-Zin" firstAttribute="trailing" secondItem="qzA-vE-CGR" secondAttribute="trailing" id="VMD-Z5-VYQ"/>
|
||||
<constraint firstItem="chq-bd-6sQ" firstAttribute="trailing" secondItem="8Of-JP-gMR" secondAttribute="trailing" id="XtD-fx-sr4"/>
|
||||
<constraint firstItem="Y1I-OE-6t1" firstAttribute="leading" secondItem="ZJU-Uo-5TM" secondAttribute="leading" id="Y9N-XV-3ir"/>
|
||||
<constraint firstItem="Yiv-h8-4V1" firstAttribute="leading" secondItem="Z8i-yN-1Cd" secondAttribute="leading" constant="65" id="Yd4-bz-xUn"/>
|
||||
<constraint firstItem="Szo-8C-Zin" firstAttribute="leading" secondItem="Y1I-OE-6t1" secondAttribute="trailing" constant="8" id="lp1-dg-UCs"/>
|
||||
<constraint firstItem="dnL-WV-spY" firstAttribute="top" secondItem="F5p-cf-frr" secondAttribute="bottom" constant="47" id="mjV-eX-FF7"/>
|
||||
<constraint firstAttribute="bottom" secondItem="dnL-WV-spY" secondAttribute="bottom" constant="86" id="ooQ-OL-P5e"/>
|
||||
<constraint firstItem="Yiv-h8-4V1" firstAttribute="top" secondItem="RIl-8E-GcR" secondAttribute="bottom" constant="29" id="p63-hU-APq"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Yiv-h8-4V1" secondAttribute="trailing" constant="65" id="phk-GT-PvS"/>
|
||||
<constraint firstItem="dnL-WV-spY" firstAttribute="centerX" secondItem="Z8i-yN-1Cd" secondAttribute="centerX" id="rMH-NL-gTu"/>
|
||||
<constraint firstItem="qzA-vE-CGR" firstAttribute="width" secondItem="Yiv-h8-4V1" secondAttribute="width" id="rUt-lu-gtM"/>
|
||||
<constraint firstItem="8Of-JP-gMR" firstAttribute="top" secondItem="chq-bd-6sQ" secondAttribute="bottom" constant="8" id="u7n-Dz-uJc"/>
|
||||
<constraint firstItem="Yiv-h8-4V1" firstAttribute="leading" secondItem="qzA-vE-CGR" secondAttribute="leading" id="xYo-qi-cOe"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="手机号码" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Yiv-h8-4V1">
|
||||
<rect key="frame" x="65" y="232" width="245" height="54"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="54" id="593-Iu-1XC"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="密码" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Y1I-OE-6t1">
|
||||
<rect key="frame" x="65" y="302" width="167" height="56"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="56" id="36A-Rk-HnV"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numbersAndPunctuation"/>
|
||||
</textField>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qzA-vE-CGR">
|
||||
<rect key="frame" x="65" y="286" width="245" height="2"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="2" id="HWD-IP-ygd"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZJU-Uo-5TM">
|
||||
<rect key="frame" x="65" y="366" width="245" height="2"/>
|
||||
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="2" id="xGp-5h-fFD"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Of-JP-gMR">
|
||||
<rect key="frame" x="65" y="444" width="245" height="42"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.87058823529411766" blue="0.74117647058823533" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="42" id="H8S-wQ-QzQ"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
|
||||
<state key="normal" title=" 登录">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Szo-8C-Zin">
|
||||
<rect key="frame" x="246" y="309" width="64" height="42"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="42" id="gsN-u1-wM1"/>
|
||||
<constraint firstAttribute="width" constant="64" id="ulR-IN-Puf"/>
|
||||
</constraints>
|
||||
<state key="normal" image="btn_tab_desplay"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F5p-cf-frr">
|
||||
<rect key="frame" x="107" y="491" width="161" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="aCl-R3-YZF"/>
|
||||
<constraint firstAttribute="width" constant="161" id="hOA-ag-StR"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<state key="normal" title="创建账号">
|
||||
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="chq-bd-6sQ">
|
||||
<rect key="frame" x="246" y="384" width="64" height="49"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="64" id="joP-Ev-vou"/>
|
||||
<constraint firstAttribute="height" constant="49" id="oH5-Gs-uju"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="12"/>
|
||||
<state key="normal" title="忘记密码">
|
||||
<color key="titleColor" red="0.19215686274509802" green="0.81960784313725488" blue="0.76470588235294112" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="forgetPassBtn:" destination="-1" eventType="touchUpInside" id="GR3-Gw-sRB"/>
|
||||
<outlet property="delegate" destination="i5M-Pr-FkT" id="BFJ-dW-e5f"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dnL-WV-spY">
|
||||
<rect key="frame" x="116" y="554" width="143" height="69"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="69" id="n98-b8-MZa"/>
|
||||
<constraint firstAttribute="width" constant="143" id="r6X-3m-usd"/>
|
||||
</constraints>
|
||||
<inset key="titleEdgeInsets" minX="-130" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<inset key="imageEdgeInsets" minX="9" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" image="btn_wechat">
|
||||
<attributedString key="attributedTitle">
|
||||
<fragment content="微信号登录">
|
||||
<attributes>
|
||||
<font key="NSFont" size="12" name="PingFangSC-Regular"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
</state>
|
||||
</button>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="dnL-WV-spY" firstAttribute="top" secondItem="F5p-cf-frr" secondAttribute="bottom" constant="23" id="0vh-Hr-cIl"/>
|
||||
<constraint firstItem="8Of-JP-gMR" firstAttribute="width" secondItem="Yiv-h8-4V1" secondAttribute="width" id="1Xh-Cl-oZI"/>
|
||||
<constraint firstItem="Yiv-h8-4V1" firstAttribute="top" secondItem="RIl-8E-GcR" secondAttribute="bottom" constant="16" id="4qd-F2-kp1"/>
|
||||
<constraint firstItem="chq-bd-6sQ" firstAttribute="top" secondItem="ZJU-Uo-5TM" secondAttribute="bottom" constant="16" id="68l-K4-uY8"/>
|
||||
<constraint firstAttribute="trailing" secondItem="qzA-vE-CGR" secondAttribute="trailing" constant="65" id="9hg-No-Rbp"/>
|
||||
<constraint firstItem="Szo-8C-Zin" firstAttribute="leading" secondItem="Y1I-OE-6t1" secondAttribute="trailing" constant="14" id="Ba4-21-nhi"/>
|
||||
<constraint firstItem="8Of-JP-gMR" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="F77-OA-qbT"/>
|
||||
<constraint firstItem="Y1I-OE-6t1" firstAttribute="top" secondItem="qzA-vE-CGR" secondAttribute="bottom" constant="14" id="FzB-6D-IYx"/>
|
||||
<constraint firstItem="Yiv-h8-4V1" firstAttribute="leading" secondItem="1vd-yc-0a5" secondAttribute="leading" constant="65" id="H5c-S5-H7V"/>
|
||||
<constraint firstItem="RIl-8E-GcR" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="KlR-Tg-PMd"/>
|
||||
<constraint firstItem="F5p-cf-frr" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="MgV-ph-Nz2"/>
|
||||
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="width" secondItem="qzA-vE-CGR" secondAttribute="width" id="Nfi-Mk-t19"/>
|
||||
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="Qub-d1-Mfd"/>
|
||||
<constraint firstItem="ZJU-Uo-5TM" firstAttribute="top" secondItem="Y1I-OE-6t1" secondAttribute="bottom" constant="8" id="WmU-UK-hwV"/>
|
||||
<constraint firstItem="qzA-vE-CGR" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="65" id="ZAX-Q0-wIE"/>
|
||||
<constraint firstItem="Szo-8C-Zin" firstAttribute="centerY" secondItem="Y1I-OE-6t1" secondAttribute="centerY" id="a5D-rG-Cqf"/>
|
||||
<constraint firstItem="dnL-WV-spY" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="eWL-Ih-wBt"/>
|
||||
<constraint firstItem="chq-bd-6sQ" firstAttribute="trailing" secondItem="ZJU-Uo-5TM" secondAttribute="trailing" id="f3g-Rk-Fbd"/>
|
||||
<constraint firstItem="F5p-cf-frr" firstAttribute="top" secondItem="8Of-JP-gMR" secondAttribute="bottom" constant="5" id="hqv-KT-isO"/>
|
||||
<constraint firstItem="8Of-JP-gMR" firstAttribute="top" secondItem="chq-bd-6sQ" secondAttribute="bottom" constant="11" id="kQN-mZ-Kew"/>
|
||||
<constraint firstItem="RIl-8E-GcR" firstAttribute="leading" secondItem="1vd-yc-0a5" secondAttribute="leading" constant="131" id="kRM-p6-38K"/>
|
||||
<constraint firstItem="Szo-8C-Zin" firstAttribute="trailing" secondItem="Yiv-h8-4V1" secondAttribute="trailing" id="py7-9K-mmp"/>
|
||||
<constraint firstItem="qzA-vE-CGR" firstAttribute="top" secondItem="Yiv-h8-4V1" secondAttribute="bottom" id="uYb-wj-NLt"/>
|
||||
<constraint firstItem="RIl-8E-GcR" firstAttribute="top" secondItem="1vd-yc-0a5" secondAttribute="top" constant="82" id="vOK-NT-5LM"/>
|
||||
<constraint firstItem="Yiv-h8-4V1" firstAttribute="centerX" secondItem="1vd-yc-0a5" secondAttribute="centerX" id="y10-W0-LYh"/>
|
||||
<constraint firstItem="Y1I-OE-6t1" firstAttribute="leading" secondItem="qzA-vE-CGR" secondAttribute="leading" id="zC7-Wr-oTQ"/>
|
||||
<constraint firstItem="Z8i-yN-1Cd" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Gug-bY-bRv"/>
|
||||
<constraint firstItem="1vd-yc-0a5" firstAttribute="bottom" secondItem="Z8i-yN-1Cd" secondAttribute="bottom" id="TXU-c3-0M6"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Z8i-yN-1Cd" secondAttribute="trailing" id="UyN-ah-Reu"/>
|
||||
<constraint firstItem="Z8i-yN-1Cd" firstAttribute="top" secondItem="1vd-yc-0a5" secondAttribute="top" id="bbt-Lx-gQG"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="1vd-yc-0a5"/>
|
||||
<point key="canvasLocation" x="10.5" y="22.5"/>
|
||||
<point key="canvasLocation" x="-84.5" y="-2.5"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface GiGaMaskTaskViewController : UIViewController
|
||||
#import "GiGaBaseViewController.h"
|
||||
@interface GiGaMaskTaskViewController : GiGaBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,42 +25,61 @@
|
||||
#import "GiGaMeViewController.h"
|
||||
#import "GiGaFlyingCommitInputView.h"
|
||||
#import "GiGaFlingCommitVC.h"
|
||||
@interface GiGaMaskTaskViewController ()<UITextFieldDelegate>
|
||||
#import "MaskTimeCircularProgressView.h"
|
||||
#import "UINavigationBar+Custom.h"
|
||||
|
||||
@interface GiGaMaskTaskViewController ()<MaskCirCularProGressViewDelegate>
|
||||
{
|
||||
AVAudioPlayer *_musicPalyer;
|
||||
}
|
||||
|
||||
@property(nonatomic,strong)MaskViewBootomWaringView *waringView;
|
||||
@property(nonatomic,strong)UILabel *countLabel;
|
||||
@property (strong ,nonatomic) LXCountTimer *timer;
|
||||
@property(nonatomic,strong)UILabel *descLabl;
|
||||
@property(nonatomic,strong)UIView *descBackView;
|
||||
//@property (nonatomic,strong) GiGaFlyingCommitInputView *commitInputView;
|
||||
@property(nonatomic,strong) UIImageView *maskImageView;
|
||||
@property(nonatomic,strong) UIImageView *faceView;
|
||||
//@property(nonatomic,strong) UIDynamicAnimator *animator;
|
||||
//@property(nonatomic,strong) UIAttachmentBehavior *attachmentBehavior;
|
||||
@property(nonatomic) CGPoint attachPoint;
|
||||
//@property(nonatomic) UISnapBehavior *snapBehavior;
|
||||
@property(nonatomic,strong) MaskTimeCircularProgressView *cicleProgressView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation GiGaMaskTaskViewController
|
||||
|
||||
//倒计时label
|
||||
-(UILabel *)countLabel{
|
||||
if (!_countLabel) {
|
||||
_countLabel = [[UILabel alloc] init];
|
||||
_countLabel.textColor = [UIColor redColor];
|
||||
_countLabel.text = @"00:00";
|
||||
_countLabel.textAlignment = NSTextAlignmentCenter;
|
||||
|
||||
//提示label
|
||||
- (UILabel *)descLabl{
|
||||
if(!_descLabl){
|
||||
_descLabl = [[UILabel alloc] init];
|
||||
_descLabl.text = @"请点击或按住面膜上滑敷到脸部开始倒计时";
|
||||
_descLabl.textAlignment = NSTextAlignmentCenter;
|
||||
_descLabl.numberOfLines = 2;
|
||||
_descLabl.textColor = GIGARGB(89, 216, 197, 1);
|
||||
_descLabl.font = [UIFont fontWithName:GIGA_FONTNAME size:11];
|
||||
}
|
||||
return _countLabel;
|
||||
return _descLabl;
|
||||
}
|
||||
|
||||
- (UIView *)descBackView{
|
||||
|
||||
if(!_descBackView){
|
||||
_descBackView = [[UIView alloc] init];
|
||||
_descBackView.layer.borderWidth = 1;
|
||||
_descBackView.layer.borderColor = GIGARGB(120, 217, 202, 1).CGColor;
|
||||
_descBackView.layer.masksToBounds = YES;
|
||||
_descBackView.layer.cornerRadius = 1;
|
||||
}
|
||||
return _descBackView;
|
||||
}
|
||||
|
||||
//面膜
|
||||
- (UIImageView *)maskImageView{
|
||||
if (!_maskImageView) {
|
||||
_maskImageView = [[UIImageView alloc] init];
|
||||
_maskImageView.userInteractionEnabled = YES;
|
||||
_maskImageView.backgroundColor = [UIColor purpleColor];
|
||||
//_maskImageView.backgroundColor = [UIColor purpleColor];
|
||||
_maskImageView.image = [UIImage imageNamed:@"img_bg"];
|
||||
UIPanGestureRecognizer *pangesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)];
|
||||
[_maskImageView addGestureRecognizer:pangesture];
|
||||
}
|
||||
@@ -70,12 +89,36 @@
|
||||
- (UIImageView *)faceView{
|
||||
if (!_faceView) {
|
||||
_faceView = [[UIImageView alloc] init];
|
||||
_faceView.backgroundColor = [UIColor lightGrayColor];
|
||||
//_faceView.backgroundColor = [UIColor lightGrayColor];
|
||||
_faceView.userInteractionEnabled = YES;
|
||||
_faceView.image = [UIImage imageNamed:@"img_bg_head"];
|
||||
}
|
||||
return _faceView;
|
||||
}
|
||||
//倒计时圆环
|
||||
- (MaskTimeCircularProgressView *)cicleProgressView{
|
||||
|
||||
if (!_cicleProgressView) {
|
||||
|
||||
_cicleProgressView = [[MaskTimeCircularProgressView alloc] initWithFrame:CGRectMake(100, 500, 136, 136) backColor:GIGARGB(22, 22, 22, 1) progressColor:[UIColor blueColor] lineWidth:10 timeinterval:10];
|
||||
_cicleProgressView.delegate = self;
|
||||
_cicleProgressView.hidden = YES;
|
||||
|
||||
}
|
||||
return _cicleProgressView;
|
||||
}
|
||||
|
||||
//底部提示栏
|
||||
- (MaskViewBootomWaringView *)waringView{
|
||||
|
||||
if (!_waringView) {
|
||||
self.waringView = [[MaskViewBootomWaringView alloc] init];
|
||||
self.waringView.frame = CGRectMake(0,CGRectGetMaxY(self.view.frame), self.view.frame.size.width, 60);
|
||||
}
|
||||
return _waringView;
|
||||
}
|
||||
|
||||
//弹幕
|
||||
-(void)createInputView{
|
||||
|
||||
GiGaFlingCommitVC* GiGaFlingVC = [[GiGaFlingCommitVC alloc] init];
|
||||
@@ -89,32 +132,18 @@
|
||||
|
||||
}
|
||||
|
||||
-(LXCountTimer *)timer{
|
||||
|
||||
if (!_timer) {
|
||||
_timer = [[LXCountTimer alloc] init];
|
||||
}
|
||||
return _timer;
|
||||
}
|
||||
|
||||
//滑动手势
|
||||
-(void)panGestureAction:(UIPanGestureRecognizer *)pan{
|
||||
|
||||
CGPoint panLocation = [pan locationInView:self.view];
|
||||
NSLog(@"panlocation.y:%f",panLocation.y);
|
||||
if (pan.state == UIGestureRecognizerStateBegan) {
|
||||
|
||||
[self animaMask];
|
||||
// self.attachmentBehavior = [[UIAttachmentBehavior alloc] initWithItem:self.faceView attachedToAnchor:self.attachPoint];
|
||||
// [self.animator addBehavior: self.attachmentBehavior ];
|
||||
|
||||
}else if (pan.state == UIGestureRecognizerStateChanged){
|
||||
// [self.snapBehavior setSnapPoint:self.attachPoint];
|
||||
// [self.attachmentBehavior setAnchorPoint:panLocation];
|
||||
|
||||
|
||||
}else if (pan.state == UIGestureRecognizerStateEnded){
|
||||
// [self.animator addBehavior:self.snapBehavior];
|
||||
// [self.animator removeBehavior:self.attachmentBehavior];
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
@@ -123,20 +152,21 @@
|
||||
#pragma mark -开始面膜时间动画
|
||||
-(void)animaMask{
|
||||
|
||||
self.descLabl.hidden = YES;
|
||||
self.descBackView.hidden = YES;
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
[UIView animateWithDuration:1.0 animations:^{
|
||||
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.attachPoint.y - 50);
|
||||
make.top.mas_equalTo(self.attachPoint.y - 118);
|
||||
}];
|
||||
[self.faceView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.attachPoint.y - 50);
|
||||
}];
|
||||
[self.countLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.attachPoint.y + 50 + 10);
|
||||
make.top.mas_equalTo(self.attachPoint.y -174);
|
||||
}];
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
} completion:^(BOOL finished) {
|
||||
self.countLabel.hidden = NO;
|
||||
self.cicleProgressView.hidden = NO;
|
||||
self.maskImageView.userInteractionEnabled = NO;
|
||||
//开始面膜时间
|
||||
[self startMaskTime];
|
||||
@@ -146,28 +176,31 @@
|
||||
#pragma mark 面膜时间结束复原动画
|
||||
-(void)endMaskAnimation{
|
||||
|
||||
self.countLabel.hidden = YES;
|
||||
self.cicleProgressView.hidden = YES;
|
||||
self.descLabl.hidden = NO;
|
||||
self.descBackView.hidden = NO;
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
[UIView animateWithDuration:1.0 animations:^{
|
||||
[self.maskImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(100 + 100 + 200);
|
||||
make.top.mas_equalTo(314 + PhoneX_TopMargin);
|
||||
}];
|
||||
|
||||
[self.faceView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(100);
|
||||
make.top.mas_equalTo(103 + PhoneX_TopMargin);
|
||||
}];
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
|
||||
} completion:^(BOOL finished) {
|
||||
self.maskImageView.userInteractionEnabled = YES;
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
@@ -181,6 +214,7 @@
|
||||
[self showAPPappGaurdView];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
|
||||
@@ -196,84 +230,83 @@
|
||||
[self initUI];
|
||||
[self addNotify];
|
||||
[self creatBackGroundMusic];
|
||||
|
||||
}
|
||||
|
||||
-(void)initUI{
|
||||
|
||||
self.view.backgroundColor = GIGARGB(56, 56, 56, 1);
|
||||
[self.view addSubview:self.maskImageView];
|
||||
[self.view addSubview:self.faceView];
|
||||
[self.view bringSubviewToFront:self.maskImageView];
|
||||
[self.view addSubview:self.countLabel];
|
||||
|
||||
//self.animator = [[UIDynamicAnimator alloc] initWithReferenceView:self.view];
|
||||
[self.view addSubview:self.descBackView];
|
||||
[self.view addSubview:self.cicleProgressView];
|
||||
|
||||
//face
|
||||
[self.faceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.view.mas_top).offset(100);
|
||||
make.left.mas_equalTo(self.view.mas_centerX).offset(-50);
|
||||
make.size.mas_equalTo(CGSizeMake(100, 100));
|
||||
|
||||
make.top.mas_equalTo(self.view.mas_top).offset(103 + PhoneX_TopMargin);
|
||||
make.left.mas_equalTo(self.view.mas_centerX).offset(-69);
|
||||
make.size.mas_equalTo(CGSizeMake(138, 174));
|
||||
}];
|
||||
|
||||
//mask
|
||||
[self.maskImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
||||
make.top.mas_equalTo(self.view.mas_top).offset(100 + 100 + 200);
|
||||
make.left.mas_equalTo(self.view.mas_centerX).offset(-50);
|
||||
make.size.mas_equalTo(CGSizeMake(100, 100));
|
||||
make.top.mas_equalTo(self.view.mas_top).offset(314 + PhoneX_TopMargin);
|
||||
make.left.mas_equalTo(self.view.mas_centerX).offset(-51);
|
||||
make.size.mas_equalTo(CGSizeMake(102, 118));
|
||||
|
||||
}];
|
||||
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.view.mas_top).offset(200);
|
||||
make.width.and.height.mas_equalTo(100);
|
||||
//描述
|
||||
|
||||
[self.descBackView mas_makeConstraints:^(MASConstraintMaker *make){
|
||||
make.top.mas_equalTo(500 + PhoneX_TopMargin);
|
||||
make.width.mas_equalTo(149);
|
||||
make.height.mas_equalTo(45);
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX);
|
||||
}];
|
||||
self.countLabel.hidden = YES;
|
||||
|
||||
UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[testBtn setTitle:@"测试肤质" forState:UIControlStateNormal];
|
||||
[testBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
testBtn.backgroundColor = [UIColor blueColor];
|
||||
[testBtn addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside];
|
||||
testBtn.layer.masksToBounds = YES;
|
||||
testBtn.layer.cornerRadius = 4;
|
||||
|
||||
[self.view addSubview:testBtn];
|
||||
[testBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX);
|
||||
make.width.mas_equalTo(150);
|
||||
make.height.mas_equalTo(40);
|
||||
make.bottom.mas_equalTo(self.view.mas_bottom).offset(-130);
|
||||
|
||||
}];
|
||||
|
||||
[self.descBackView addSubview:self.descLabl];
|
||||
|
||||
[self.descLabl mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(121);
|
||||
make.height.mas_equalTo(32);
|
||||
make.center.mas_equalTo(self.descBackView.center);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
// UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
// [testBtn setTitle:@"测试肤质" forState:UIControlStateNormal];
|
||||
// [testBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
// testBtn.backgroundColor = [UIColor blueColor];
|
||||
// [testBtn addTarget:self action:@selector(testBtnAcion:) forControlEvents:UIControlEventTouchUpInside];
|
||||
// testBtn.layer.masksToBounds = YES;
|
||||
// testBtn.layer.cornerRadius = 4;
|
||||
// [self.view addSubview:testBtn];
|
||||
//
|
||||
// [testBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.centerX.mas_equalTo(self.view.mas_centerX);
|
||||
// make.width.mas_equalTo(150);
|
||||
// make.height.mas_equalTo(40);
|
||||
// make.bottom.mas_equalTo(self.view.mas_bottom).offset(-130);
|
||||
// }];
|
||||
|
||||
|
||||
[self.view layoutIfNeeded];
|
||||
CGFloat Y = CGRectGetMinY(self.maskImageView.frame) - 100;
|
||||
CGFloat Y = CGRectGetMaxY(self.faceView.frame) + (CGRectGetMaxY(self.maskImageView.frame) - CGRectGetMaxY(self.faceView.frame)) / 2;
|
||||
CGFloat X = CGRectGetMidX(self.view.frame);
|
||||
// 下巴合并位置
|
||||
CGPoint anchorPoint = CGPointMake(X, Y);
|
||||
self.attachPoint = anchorPoint;
|
||||
// self.snapBehavior = [[UISnapBehavior alloc] initWithItem:self.maskImageView snapToPoint:self.attachPoint];
|
||||
}
|
||||
|
||||
#pragma mark 开始计时
|
||||
|
||||
-(void)countTimeBegain:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second{
|
||||
|
||||
long nowTimestamp = [GiGaHelper getNowDateTimestamp];
|
||||
long futrueTimestamp = [GiGaHelper getFutureTimetstamp:hour minute:minute second:second];
|
||||
weakify(self);
|
||||
[self.timer countDownWithStratTimeStamp:nowTimestamp finishTimeStamp:futrueTimestamp completeBlock:^(NSInteger day, NSInteger hour, NSInteger minute, NSInteger second) {
|
||||
[weakSelf refreshTimeCount:hour minute:minute second:second];
|
||||
[self.cicleProgressView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(Y + 68);
|
||||
make.height.and.width.mas_equalTo(136);
|
||||
make.centerX.mas_equalTo(self.view.mas_centerX);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)refreshTimeCount:(NSInteger)hour minute:(NSInteger)minute second:(NSInteger)second{
|
||||
|
||||
self.countLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",minute,second];
|
||||
if (hour == 0 && minute == 0 && second == 0) {
|
||||
//面膜结束
|
||||
[self maskTimeEnd];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark 面膜时间背景音乐
|
||||
@@ -286,14 +319,14 @@
|
||||
_musicPalyer = player;
|
||||
[[AVAudioSession sharedInstance] setActive:YES error:nil];
|
||||
//设置后台模式和锁屏模式下依然能够播放
|
||||
//[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 开始面膜时间
|
||||
-(void)startMaskTime{
|
||||
|
||||
[self createInputView]; //出现弹幕
|
||||
//[self createInputView]; //出现弹幕
|
||||
AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate];
|
||||
if (delegate.isMasking) {
|
||||
return;
|
||||
@@ -303,17 +336,12 @@
|
||||
[self setBackGroundPlayingInfo];//锁屏音频信息
|
||||
|
||||
//总时间隔 s
|
||||
NSTimeInterval timeInterVal = 61;
|
||||
NSString *timeformat = [GiGaHelper stringWithNSTimerinterval:timeInterVal];
|
||||
NSArray *timesArr = [timeformat componentsSeparatedByString:@":"];
|
||||
NSString *hour = timesArr[0];
|
||||
NSString *min = timesArr[1];
|
||||
NSString *sec = timesArr[2];
|
||||
[self countTimeBegain:hour.integerValue minute:min.integerValue second:sec.integerValue];
|
||||
NSTimeInterval timeInterVal = 10;
|
||||
[self.cicleProgressView startWith:timeInterVal];
|
||||
|
||||
//底部弹窗
|
||||
[self showWaringView];
|
||||
|
||||
return;
|
||||
//app 前台时收到本地通知showAlert 后台时通知提醒
|
||||
[[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"本地推送" fireTimeInterval:timeInterVal alertAction:@"测试面膜时间" withIdentifier:kLOCALNotifiID_MASKETIMEEND];
|
||||
|
||||
@@ -368,7 +396,7 @@
|
||||
AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate];
|
||||
delegate.isMasking = NO;
|
||||
[_musicPalyer stop];
|
||||
[self.timer destoryTimer];
|
||||
|
||||
//复原动画
|
||||
[self endMaskAnimation];
|
||||
}
|
||||
@@ -390,8 +418,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)addNotify{
|
||||
|
||||
NC_ADD_TARGET_NAME_OBJECT(self, @selector(guardViewDissmiss), USER_GUARD_DISSMISS, nil) ;
|
||||
@@ -465,6 +491,8 @@
|
||||
[rightBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
|
||||
[rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
|
||||
|
||||
[self.navigationController.navigationBar cnSetBackgroundColor:GIGARGB(216, 216, 216, 1)];
|
||||
}
|
||||
|
||||
#pragma mark 消息 action
|
||||
@@ -494,29 +522,22 @@
|
||||
#pragma mark -bottomView
|
||||
-(void)showWaringView{
|
||||
|
||||
[UIView animateWithDuration:0.4 animations:^{
|
||||
self.waringView.frame = CGRectMake(0,self.view.frame.size.height - 60, self.view.frame.size.width, 60);
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.waringView];
|
||||
weakify(self);
|
||||
[self.waringView.dismissBtn initWithBlock:^(UIButton *btn) {
|
||||
NSLog(@"GIGAdismissBtn");
|
||||
[UIView animateWithDuration:0.4 animations:^{
|
||||
weakSelf.waringView.frame = CGRectMake(0, self.view.frame.size.height, self.view.frame.size.height, 60);
|
||||
} completion:^(BOOL finished) {
|
||||
[weakSelf.waringView removeFromSuperview];
|
||||
}];
|
||||
|
||||
} for:UIControlEventTouchUpInside ];
|
||||
[UIView animateWithDuration:0.4 animations:^{
|
||||
self.waringView.frame = CGRectMake(0,CGRectGetMaxY(self.view.frame) - 60, self.view.frame.size.width, 60);
|
||||
}];
|
||||
[self.waringView showView];
|
||||
}
|
||||
|
||||
- (MaskViewBootomWaringView *)waringView{
|
||||
#pragma mark - MaskCirCularProGressViewDelegate
|
||||
|
||||
if (!_waringView) {
|
||||
self.waringView = [[MaskViewBootomWaringView alloc] initWithFrame: CGRectMake(0, self.view.frame.size.height, self.view.frame.size.height, 60)];
|
||||
}
|
||||
return _waringView;
|
||||
- (void)updateProgressViewWith:(NSTimeInterval)timeInterval{
|
||||
|
||||
}
|
||||
|
||||
- (void)progressDidFish{
|
||||
NSLog(@"结束");
|
||||
[self maskTimeEnd];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// MaskTimeCircularProgressView.h
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/3.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SHineLabel.h"
|
||||
@protocol MaskCirCularProGressViewDelegate<NSObject>
|
||||
@optional
|
||||
-(void)updateProgressViewWith:(NSTimeInterval)timeInterval;
|
||||
-(void)updateProgress;
|
||||
-(void)progressDidFish;
|
||||
@end
|
||||
|
||||
@interface MaskTimeCircularProgressView : UIView
|
||||
@property(nonatomic,weak) id<MaskCirCularProGressViewDelegate>delegate;
|
||||
@property(nonatomic) UIColor *backColor;
|
||||
@property(nonatomic) UIColor *progressColor;
|
||||
@property(nonatomic,strong) UILabel *countDownLabel;
|
||||
@property(nonatomic) NSTimeInterval timeinterval;
|
||||
@property(nonatomic) CGFloat lineWidth;
|
||||
@property(nonatomic) BOOL isMoving;
|
||||
@property (nonatomic,strong) SHineLabel *countLabel;
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame
|
||||
backColor:(UIColor *)backColor
|
||||
progressColor:(UIColor *)progressColor
|
||||
lineWidth:(CGFloat)lineWidth
|
||||
timeinterval:(NSTimeInterval)timeinterval;
|
||||
|
||||
-(void)startWith:(NSTimeInterval)time;
|
||||
-(void)stop;
|
||||
-(void)pasuse;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,261 @@
|
||||
//
|
||||
// MaskTimeCircularProgressView.m
|
||||
// GIGA
|
||||
//
|
||||
// Created by lianxiang on 2018/9/3.
|
||||
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MaskTimeCircularProgressView.h"
|
||||
#import "LXCountTimer.h"
|
||||
#import "SHineLabel.h"
|
||||
|
||||
@interface MaskTimeCircularProgressView()
|
||||
@property (nonatomic) CADisplayLink *displayLink;
|
||||
@property (nonatomic) CAShapeLayer *progressLayer;
|
||||
@property (nonatomic) float progress;
|
||||
@property (nonatomic) CGFloat angle;
|
||||
@property (nonatomic) NSTimeInterval currentTimeinterval;
|
||||
@property (nonatomic,strong) LXCountTimer *timer;
|
||||
@property (nonatomic,strong) NSTimer *playTimer;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation MaskTimeCircularProgressView
|
||||
- (id)initWithFrame:(CGRect)frame backColor:(UIColor *)backColor progressColor:(UIColor *)progressColor lineWidth:(CGFloat)lineWidth timeinterval:(NSTimeInterval)timeinterval
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
_backColor = backColor;
|
||||
_progressColor = progressColor;
|
||||
self.lineWidth = lineWidth;
|
||||
self.timeinterval = timeinterval;
|
||||
|
||||
[self setUP];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)aDecoder{
|
||||
self = [super initWithCoder:aDecoder];
|
||||
if (self) {
|
||||
[self setUP];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)setUP{
|
||||
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
_currentTimeinterval = 0;
|
||||
_isMoving = NO;
|
||||
self.countLabel.frame = CGRectMake(_lineWidth, self.frame.size.height /2 - 15 , self.frame.size.width - _lineWidth*2, 30);
|
||||
[self addSubview:self.countLabel];
|
||||
|
||||
}
|
||||
|
||||
-(LXCountTimer *)timer{
|
||||
|
||||
if (!_timer) {
|
||||
_timer = [[LXCountTimer alloc] init];
|
||||
}
|
||||
return _timer;
|
||||
}
|
||||
|
||||
- (NSTimer *)playTimer{
|
||||
if (!_playTimer) {
|
||||
_playTimer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(payCircular) userInfo:nil repeats:YES];
|
||||
}
|
||||
return _playTimer;
|
||||
}
|
||||
|
||||
//倒计时label
|
||||
-(SHineLabel *)countLabel{
|
||||
|
||||
if (!_countLabel) {
|
||||
_countLabel = [[SHineLabel alloc] init];
|
||||
_countLabel.outLineColor = [UIColor whiteColor];
|
||||
_countLabel.blurColor = [UIColor whiteColor];
|
||||
_countLabel.oinsideColor = [UIColor whiteColor];
|
||||
|
||||
_countLabel.text = @"00:00";
|
||||
_countLabel.font = [UIFont fontWithName:GIGA_FONTBOLD size:22];
|
||||
|
||||
}
|
||||
return _countLabel;
|
||||
}
|
||||
|
||||
- (void)setLineWidth:(CGFloat)lineWidth{
|
||||
CAShapeLayer *backgroundLayer = [self createRingLayerWithCenter:CGPointMake(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) radius:CGRectGetWidth(self.bounds) / 2 - lineWidth / 2 lineWidth:lineWidth color:self.backColor];
|
||||
_lineWidth = lineWidth;
|
||||
[self.layer addSublayer:backgroundLayer];
|
||||
_progressLayer = [self createRingLayerWithCenter:CGPointMake(CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame) / 2) radius:CGRectGetWidth(self.bounds) / 2 - lineWidth / 2 lineWidth:lineWidth color:self.progressColor];
|
||||
_progressLayer.strokeEnd = 0;
|
||||
[self.layer addSublayer:_progressLayer];
|
||||
|
||||
//渐变色
|
||||
CGFloat width = self.frame.size.width;
|
||||
CGFloat height = self.frame.size.height;
|
||||
|
||||
CALayer *gradientLayer = [CALayer layer];
|
||||
gradientLayer.frame = self.bounds;
|
||||
|
||||
CAGradientLayer *gradientLayer1 = [CAGradientLayer layer];
|
||||
gradientLayer1.frame = CGRectMake(0, 0, width, height);
|
||||
gradientLayer1.colors = @[(__bridge id) [UIColor colorWithRed:151/255.0 green:253/255.0 blue:255/255.0 alpha:1/1.0].CGColor,(__bridge id)[UIColor colorWithRed:165/255.0 green:81/255.0 blue:216/255.0 alpha:1/1.0].CGColor];
|
||||
|
||||
//纵向变化
|
||||
gradientLayer1.startPoint = CGPointMake(0.5, 0);
|
||||
gradientLayer1.endPoint = CGPointMake(0.5, 1);
|
||||
[gradientLayer addSublayer:gradientLayer1];
|
||||
[self.layer addSublayer:gradientLayer];
|
||||
gradientLayer.mask = _progressLayer ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (CAShapeLayer *)createRingLayerWithCenter:(CGPoint)center radius:(CGFloat)radius lineWidth:(CGFloat)lineWidth color:(UIColor *)color {
|
||||
UIBezierPath *smoothedPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(radius, radius) radius:radius startAngle:- M_PI_2 endAngle:(M_PI + M_PI_2) clockwise:YES];
|
||||
CAShapeLayer *slice = [CAShapeLayer layer];
|
||||
slice.contentsScale = [[UIScreen mainScreen] scale];
|
||||
slice.frame = CGRectMake(center.x - radius, center.y - radius, radius * 2, radius * 2);
|
||||
slice.fillColor = [UIColor clearColor].CGColor;
|
||||
slice.strokeColor = color.CGColor;
|
||||
slice.lineWidth = lineWidth;
|
||||
slice.lineCap = kCALineJoinRound;
|
||||
slice.lineJoin = kCALineJoinBevel;
|
||||
slice.path = smoothedPath.CGPath;
|
||||
|
||||
return slice;
|
||||
}
|
||||
|
||||
- (void)setProgress:(float)progress{
|
||||
|
||||
if (progress == 0) {
|
||||
self.progressLayer.hidden = YES;
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
self.progressLayer.strokeEnd = 0;
|
||||
});
|
||||
}else {
|
||||
self.progressLayer.hidden = NO;
|
||||
self.progressLayer.strokeEnd = progress;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateProgressCircle{
|
||||
//update progress value
|
||||
self.progress = (float) (self.currentTimeinterval / self.timeinterval);
|
||||
|
||||
if (self.delegate && [self.delegate conformsToProtocol:@protocol(MaskCirCularProGressViewDelegate)]) {
|
||||
//self.countLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",minute,second];
|
||||
[self.delegate updateProgressViewWith:self.currentTimeinterval];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)payCircular{
|
||||
|
||||
self.currentTimeinterval += 0.01;
|
||||
}
|
||||
|
||||
- (void)startWith:(NSTimeInterval)time{
|
||||
|
||||
self.timeinterval = time;
|
||||
[self countDown:time];
|
||||
[self start];
|
||||
}
|
||||
|
||||
-(void)start{
|
||||
|
||||
[[NSRunLoop mainRunLoop] addTimer:self.playTimer forMode:NSRunLoopCommonModes];
|
||||
if (!self.isMoving) {
|
||||
if (!self.displayLink) {
|
||||
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateProgressCircle)];
|
||||
[self.displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
|
||||
}else {
|
||||
self.displayLink.paused = NO;
|
||||
}
|
||||
self.isMoving = YES;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)countDown:(NSTimeInterval)timeInterVal{
|
||||
|
||||
NSString *timeformat = [GiGaHelper stringWithNSTimerinterval:timeInterVal];
|
||||
NSArray *timesArr = [timeformat componentsSeparatedByString:@":"];
|
||||
NSString *hour = timesArr[0];
|
||||
NSString *min = timesArr[1];
|
||||
NSString *sec = timesArr[2];
|
||||
[self countTimeBegain:hour.integerValue minute:min.integerValue second:sec.integerValue];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 开始计时
|
||||
-(void)countTimeBegain:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second{
|
||||
|
||||
long nowTimestamp = [GiGaHelper getNowDateTimestamp];
|
||||
long futrueTimestamp = [GiGaHelper getFutureTimetstamp:hour minute:minute second:second];
|
||||
weakify(self);
|
||||
[self.timer countDownWithStratTimeStamp:nowTimestamp finishTimeStamp:futrueTimestamp completeBlock:^(NSInteger day, NSInteger hour, NSInteger minute, NSInteger second) {
|
||||
[weakSelf refreshTimeCount:hour minute:minute second:second];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)refreshTimeCount:(NSInteger)hour minute:(NSInteger)minute second:(NSInteger)second{
|
||||
|
||||
self.countLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",minute,second];
|
||||
if (hour == 0 && minute == 0 && second == 0) {
|
||||
//面膜结束
|
||||
//[self maskTimeEnd];
|
||||
[self.timer destoryTimer];
|
||||
[self.playTimer invalidate];
|
||||
self.playTimer = nil;
|
||||
[self stop];
|
||||
|
||||
if (self.delegate && [self.delegate conformsToProtocol:@protocol(MaskCirCularProGressViewDelegate)]) {
|
||||
[self.delegate progressDidFish];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-(void)pasuse{
|
||||
if (self.isMoving) {
|
||||
self.displayLink.paused = YES;
|
||||
self.isMoving = NO;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)stop{
|
||||
self.isMoving = NO;
|
||||
self.progress = 0 ;
|
||||
self.currentTimeinterval = 0;
|
||||
[self.displayLink invalidate];
|
||||
self.displayLink = nil;
|
||||
}
|
||||
|
||||
//calculate angle between start to point
|
||||
- (CGFloat)angleFromStartToPoint:(CGPoint)point{
|
||||
CGFloat angle = [self angleBetweenLinesWithLine1Start:CGPointMake(CGRectGetWidth(self.bounds) / 2,CGRectGetHeight(self.bounds) / 2)
|
||||
Line1End:CGPointMake(CGRectGetWidth(self.bounds) / 2,CGRectGetHeight(self.bounds) / 2 - 1)
|
||||
Line2Start:CGPointMake(CGRectGetWidth(self.bounds) / 2,CGRectGetHeight(self.bounds) / 2)
|
||||
Line2End:point];
|
||||
if (CGRectContainsPoint(CGRectMake(0, 0, CGRectGetWidth(self.frame) / 2, CGRectGetHeight(self.frame)), point)) {
|
||||
angle = 2 * M_PI - angle;
|
||||
}
|
||||
return angle;
|
||||
}
|
||||
|
||||
//calculate angle between 2 lines
|
||||
- (CGFloat)angleBetweenLinesWithLine1Start:(CGPoint)line1Start
|
||||
Line1End:(CGPoint)line1End
|
||||
Line2Start:(CGPoint)line2Start
|
||||
Line2End:(CGPoint)line2End{
|
||||
CGFloat a = line1End.x - line1Start.x;
|
||||
CGFloat b = line1End.y - line1Start.y;
|
||||
CGFloat c = line2End.x - line2Start.x;
|
||||
CGFloat d = line2End.y - line2Start.y;
|
||||
return acos(((a * c) + (b * d)) / ((sqrt(a * a + b * b)) * (sqrt(c * c + d * d))));
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -11,5 +11,6 @@
|
||||
@interface MaskViewBootomWaringView : UIView
|
||||
|
||||
@property(nonatomic,strong) GiGaBlockButton *dismissBtn;
|
||||
-(void)showView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -38,12 +38,13 @@
|
||||
waringLabel.text = @"亲爱滴,请您务必要开启手机声音哦";
|
||||
waringLabel.textColor = [UIColor whiteColor];
|
||||
waringLabel.textAlignment = NSTextAlignmentCenter;
|
||||
waringLabel.font = [UIFont systemFontOfSize:16];
|
||||
[waringLabel sizeToFit];
|
||||
waringLabel.font = [UIFont systemFontOfSize:12];
|
||||
|
||||
[self addSubview:waringLabel];
|
||||
[waringLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
||||
make.left.mas_equalTo(iconImg.mas_right).offset(10);
|
||||
make.left.mas_equalTo(self.mas_left).offset(40);
|
||||
make.right.mas_equalTo(self.mas_right).offset(-40);
|
||||
make.centerY.mas_equalTo(self.mas_centerY);
|
||||
}];
|
||||
|
||||
@@ -61,5 +62,20 @@
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)showView{
|
||||
|
||||
[self.dismissBtn initWithBlock:^(UIButton *btn) {
|
||||
|
||||
[UIView animateWithDuration:0.4 animations:^{
|
||||
|
||||
self.frame = CGRectMake(0, KMainH, KMainW, 60);
|
||||
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
|
||||
} for:UIControlEventTouchUpInside ];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#import "GiGaMineInfoViewCell.h"
|
||||
#import "GiSysSettingsVC.h"
|
||||
#import "GiMaskTimeHistoryVC.h"
|
||||
#import "UINavigationBar+Custom.h"
|
||||
|
||||
@interface GiGaMeViewController ()
|
||||
|
||||
@@ -20,8 +21,8 @@
|
||||
@implementation GiGaMeViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[super viewDidLoad];
|
||||
|
||||
[self addNavTitile:@"我的"];
|
||||
// Do any additional setup after loading the view.
|
||||
[self.view addSubview:self.tableView];
|
||||
|
||||
Reference in New Issue
Block a user