瀏覽代碼

award 弹窗修改

Steven 1 天之前
父節點
當前提交
2943432c7d

+ 1 - 1
KulexiuForStudent/KulexiuForStudent.xcodeproj/xcshareddata/xcschemes/KulexiuForStudent.xcscheme

@@ -92,7 +92,7 @@
       buildConfiguration = "Debug">
    </AnalyzeAction>
    <ArchiveAction
-      buildConfiguration = "Release"
+      buildConfiguration = "DEV"
       revealArchiveInOrganizer = "YES">
    </ArchiveAction>
 </Scheme>

+ 22 - 0
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Home/award_button.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "award_button@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "award_button@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Home/award_button.imageset/award_button@2x.png


二進制
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Home/award_button.imageset/award_button@3x.png


二進制
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Home/award_image.imageset/award_image@2x.png


二進制
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Home/award_image.imageset/award_image@3x.png


+ 5 - 0
KulexiuForStudent/KulexiuForStudent/Module/Course/MyGroupCourse/View/GroupCourseListCell.xib

@@ -211,6 +211,11 @@
                             <constraint firstItem="qeE-Ft-83e" firstAttribute="top" secondItem="iLa-EZ-zRx" secondAttribute="bottom" id="rM8-gQ-B7T"/>
                             <constraint firstAttribute="bottom" secondItem="qeE-Ft-83e" secondAttribute="bottom" constant="12" id="uTX-mt-T4L"/>
                         </constraints>
+                        <userDefinedRuntimeAttributes>
+                            <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                <real key="value" value="10"/>
+                            </userDefinedRuntimeAttribute>
+                        </userDefinedRuntimeAttributes>
                     </view>
                 </subviews>
                 <constraints>

+ 0 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

@@ -442,7 +442,6 @@
     [USER_MANAGER queryUserInfoCallback:^(UserInfo * _Nonnull userInfo) {
         self.mineInfo = userInfo;
         [self refreshSource:checkSubject];
-        [self refreshView];
     }];
 }
 

+ 17 - 16
KulexiuForStudent/KulexiuForStudent/Module/Home/View/AwardAlert/KSAwardAlertView.m

@@ -9,21 +9,25 @@
 #import <UIView+Animation.h>
 
 
-@interface KSAwardAlertView ()
+@interface KSAwardAlertView ()<UIGestureRecognizerDelegate>
 
-@property (weak, nonatomic) IBOutlet UIView *colorView;
+@property (weak, nonatomic) IBOutlet UIView *bgView;
 
 @property (nonatomic, copy) AwardAlertCallback callback;
 
 @end
 
 @implementation KSAwardAlertView
+
 - (void)awakeFromNib {
     [super awakeFromNib];
-    CAGradientLayer *layer = [self createGradientLayerFromColor:HexRGB(0x59E5D5) startPoint:CGPointMake(0.5, 0) endColor:HexRGB(0x2DC7AA) endPoint:CGPointMake(0.5, 1) bounds:CGRectMake(0, 0, 169, 40)];
-    layer.cornerRadius = 12.0f;
-    layer.masksToBounds = YES;
-    [self.colorView.layer addSublayer:layer];
+    [self addTagGesture];
+}
+
+- (void)addTagGesture {
+    UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancleAction)];
+    gesture.delegate = self;
+    [self addGestureRecognizer:gesture];
 }
 
 + (instancetype)shareInstance {
@@ -60,22 +64,19 @@
     [self hiddenAction];
 }
 
-- (IBAction)cancleAction:(id)sender {
+- (void)cancleAction {
     if (self.callback) {
         self.callback(NO);
     }
     [self hiddenAction];
 }
 
-
-- (CAGradientLayer *)createGradientLayerFromColor:(UIColor *)fromColor startPoint:(CGPoint)startPoint endColor:(UIColor *)endColor endPoint:(CGPoint)endPoint bounds:(CGRect)bounds {
-    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
-    gradientLayer.colors = @[(__bridge id)fromColor.CGColor, (__bridge id)endColor.CGColor];
-    gradientLayer.startPoint = startPoint;
-    gradientLayer.endPoint = endPoint;
-    gradientLayer.frame = bounds;
-    gradientLayer.locations = @[@(0),@(1.0f)];
-    return gradientLayer;
+#pragma mark ---- gesture delegate
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
+    if ([touch.view isDescendantOfView:self.bgView]) {
+        return NO;
+    }
+    return YES;
 }
 
 /*

+ 22 - 70
KulexiuForStudent/KulexiuForStudent/Module/Home/View/AwardAlert/KSAwardAlertView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina6_0" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -14,51 +14,24 @@
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MiZ-wq-ORz">
-                    <rect key="frame" x="59" y="156.66666666666663" width="257" height="354"/>
+                    <rect key="frame" x="48" y="179.66666666666663" width="279" height="308"/>
                     <subviews>
-                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="award_image" translatesAutoresizingMaskIntoConstraints="NO" id="IC2-xC-CLi">
-                            <rect key="frame" x="35.666666666666686" y="23" width="186" height="106"/>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="award_image" translatesAutoresizingMaskIntoConstraints="NO" id="bfs-ZH-s6o">
+                            <rect key="frame" x="0.0" y="0.0" width="279" height="308"/>
                             <constraints>
-                                <constraint firstAttribute="height" constant="106" id="anK-1i-GVd"/>
-                                <constraint firstAttribute="width" constant="186" id="fOA-cb-ers"/>
+                                <constraint firstAttribute="width" constant="279" id="Pbv-te-EoC"/>
+                                <constraint firstAttribute="height" constant="308" id="hgL-ch-txq"/>
                             </constraints>
                         </imageView>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="您有待领取奖品" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YML-3d-3xZ">
-                            <rect key="frame" x="64" y="150.00000000000003" width="129" height="25"/>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="25" id="g0B-ln-iIz"/>
-                            </constraints>
-                            <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
-                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                            <nil key="highlightedColor"/>
-                        </label>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="您还有奖品未领取哦!" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FdQ-H5-bhI">
-                            <rect key="frame" x="57" y="185.00000000000003" width="143" height="20"/>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="20" id="G7h-27-P1x"/>
-                            </constraints>
-                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                            <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                            <nil key="highlightedColor"/>
-                        </label>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="shF-sU-HAn">
-                            <rect key="frame" x="44" y="276" width="169" height="40"/>
-                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                            <userDefinedRuntimeAttributes>
-                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                    <real key="value" value="10"/>
-                                </userDefinedRuntimeAttribute>
-                            </userDefinedRuntimeAttributes>
-                        </view>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QeN-Iz-5Fd">
-                            <rect key="frame" x="44" y="276" width="169" height="40"/>
+                            <rect key="frame" x="73" y="202.00000000000003" width="133" height="54.999999999999972"/>
                             <constraints>
-                                <constraint firstAttribute="width" constant="169" id="7qk-v3-bhT"/>
-                                <constraint firstAttribute="height" constant="40" id="Zv6-71-ZF2"/>
+                                <constraint firstAttribute="height" constant="55" id="jTd-Ne-jCX"/>
+                                <constraint firstAttribute="width" constant="133" id="xC5-fG-KOY"/>
                             </constraints>
                             <fontDescription key="fontDescription" type="system" pointSize="16"/>
                             <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                            <state key="normal" title="立即领取"/>
+                            <state key="normal" backgroundImage="award_button"/>
                             <userDefinedRuntimeAttributes>
                                 <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                                     <real key="value" value="10"/>
@@ -69,21 +42,14 @@
                             </connections>
                         </button>
                     </subviews>
-                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
-                        <constraint firstItem="FdQ-H5-bhI" firstAttribute="top" secondItem="YML-3d-3xZ" secondAttribute="bottom" constant="10" id="4b8-fZ-AAk"/>
-                        <constraint firstItem="YML-3d-3xZ" firstAttribute="top" secondItem="IC2-xC-CLi" secondAttribute="bottom" constant="21" id="5A5-vD-syR"/>
-                        <constraint firstItem="FdQ-H5-bhI" firstAttribute="centerX" secondItem="MiZ-wq-ORz" secondAttribute="centerX" id="Gye-jC-eR5"/>
-                        <constraint firstItem="QeN-Iz-5Fd" firstAttribute="centerX" secondItem="MiZ-wq-ORz" secondAttribute="centerX" id="Pcd-Q3-Ezv"/>
-                        <constraint firstItem="QeN-Iz-5Fd" firstAttribute="top" secondItem="shF-sU-HAn" secondAttribute="top" id="a63-7b-Ehi"/>
-                        <constraint firstItem="YML-3d-3xZ" firstAttribute="centerX" secondItem="MiZ-wq-ORz" secondAttribute="centerX" id="aRq-ob-Zrl"/>
-                        <constraint firstItem="IC2-xC-CLi" firstAttribute="top" secondItem="MiZ-wq-ORz" secondAttribute="top" constant="23" id="cSa-s7-MfX"/>
-                        <constraint firstItem="IC2-xC-CLi" firstAttribute="centerX" secondItem="MiZ-wq-ORz" secondAttribute="centerX" id="exL-ag-L9Q"/>
-                        <constraint firstAttribute="bottom" secondItem="QeN-Iz-5Fd" secondAttribute="bottom" constant="38" id="iRd-4w-yLl"/>
-                        <constraint firstAttribute="width" secondItem="MiZ-wq-ORz" secondAttribute="height" multiplier="257:354" id="l24-6q-vsW"/>
-                        <constraint firstItem="QeN-Iz-5Fd" firstAttribute="trailing" secondItem="shF-sU-HAn" secondAttribute="trailing" id="nPo-f6-IUt"/>
-                        <constraint firstItem="QeN-Iz-5Fd" firstAttribute="leading" secondItem="shF-sU-HAn" secondAttribute="leading" id="wY8-hs-shA"/>
-                        <constraint firstItem="QeN-Iz-5Fd" firstAttribute="bottom" secondItem="shF-sU-HAn" secondAttribute="bottom" id="zvl-z3-ehd"/>
+                        <constraint firstItem="bfs-ZH-s6o" firstAttribute="leading" secondItem="MiZ-wq-ORz" secondAttribute="leading" id="5qA-0S-nLN"/>
+                        <constraint firstAttribute="bottom" secondItem="QeN-Iz-5Fd" secondAttribute="bottom" constant="51" id="Acp-z7-URb"/>
+                        <constraint firstAttribute="bottom" secondItem="bfs-ZH-s6o" secondAttribute="bottom" id="Eta-9i-aom"/>
+                        <constraint firstItem="bfs-ZH-s6o" firstAttribute="top" secondItem="MiZ-wq-ORz" secondAttribute="top" id="Lnc-8V-GAU"/>
+                        <constraint firstItem="QeN-Iz-5Fd" firstAttribute="centerX" secondItem="MiZ-wq-ORz" secondAttribute="centerX" id="RE6-iJ-ZZx"/>
+                        <constraint firstAttribute="trailing" secondItem="bfs-ZH-s6o" secondAttribute="trailing" id="ZVI-2M-nYI"/>
                     </constraints>
                     <userDefinedRuntimeAttributes>
                         <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
@@ -91,37 +57,23 @@
                         </userDefinedRuntimeAttribute>
                     </userDefinedRuntimeAttributes>
                 </view>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bIK-mD-ZCc">
-                    <rect key="frame" x="167.66666666666666" y="520.66666666666663" width="40" height="40"/>
-                    <constraints>
-                        <constraint firstAttribute="height" constant="40" id="0R3-Vj-qjX"/>
-                        <constraint firstAttribute="width" constant="40" id="B7L-cH-EMp"/>
-                    </constraints>
-                    <state key="normal" image="alert_cancle"/>
-                    <connections>
-                        <action selector="cancleAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="yjy-Uj-O67"/>
-                    </connections>
-                </button>
             </subviews>
-            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.46000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
+            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
                 <constraint firstItem="MiZ-wq-ORz" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Bew-aJ-rIM"/>
-                <constraint firstItem="bIK-mD-ZCc" firstAttribute="top" secondItem="MiZ-wq-ORz" secondAttribute="bottom" constant="10" id="JvZ-b3-XVX"/>
-                <constraint firstItem="MiZ-wq-ORz" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="59" id="Kgi-N1-xhh"/>
-                <constraint firstItem="bIK-mD-ZCc" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="vNa-JL-E2l"/>
                 <constraint firstItem="MiZ-wq-ORz" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="vpd-Ho-UBP"/>
             </constraints>
             <nil key="simulatedTopBarMetrics"/>
             <nil key="simulatedBottomBarMetrics"/>
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <connections>
-                <outlet property="colorView" destination="shF-sU-HAn" id="n5q-60-PDe"/>
+                <outlet property="bgView" destination="MiZ-wq-ORz" id="Ru1-oZ-fQE"/>
             </connections>
             <point key="canvasLocation" x="56.153846153846153" y="-11.018957345971563"/>
         </view>
     </objects>
     <resources>
-        <image name="alert_cancle" width="28" height="28"/>
-        <image name="award_image" width="186" height="106"/>
+        <image name="award_button" width="133" height="55"/>
+        <image name="award_image" width="279" height="308"/>
     </resources>
 </document>