Browse Source

课程提示弹窗

Steven 4 months ago
parent
commit
3b9f35dbae

+ 10 - 0
KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj

@@ -885,6 +885,8 @@
 		BCD1603A2CEC808700A78B43 /* ArrangeTeacherModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD160392CEC808700A78B43 /* ArrangeTeacherModel.m */; };
 		BCD160402CEC8CB000A78B43 /* ArrangeLiveCourseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD1603F2CEC8CB000A78B43 /* ArrangeLiveCourseModel.m */; };
 		BCD160432CEC938400A78B43 /* ArrangeVideoCourseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD160422CEC938400A78B43 /* ArrangeVideoCourseModel.m */; };
+		BCD160472CEC9A4700A78B43 /* CourseDescAlertCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCD160462CEC9A4700A78B43 /* CourseDescAlertCell.xib */; };
+		BCD160482CEC9A4700A78B43 /* CourseDescAlertCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD160452CEC9A4700A78B43 /* CourseDescAlertCell.m */; };
 		BCD457A1286313D70010B493 /* NotiferNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD4579E286313D70010B493 /* NotiferNavView.m */; };
 		BCD457A2286313D70010B493 /* NotiferNavView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCD457A0286313D70010B493 /* NotiferNavView.xib */; };
 		BCD457AB286469600010B493 /* PublicNoticeView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD457A92864695F0010B493 /* PublicNoticeView.m */; };
@@ -2441,6 +2443,9 @@
 		BCD1603F2CEC8CB000A78B43 /* ArrangeLiveCourseModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ArrangeLiveCourseModel.m; sourceTree = "<group>"; };
 		BCD160412CEC938400A78B43 /* ArrangeVideoCourseModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ArrangeVideoCourseModel.h; sourceTree = "<group>"; };
 		BCD160422CEC938400A78B43 /* ArrangeVideoCourseModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ArrangeVideoCourseModel.m; sourceTree = "<group>"; };
+		BCD160442CEC9A4700A78B43 /* CourseDescAlertCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CourseDescAlertCell.h; sourceTree = "<group>"; };
+		BCD160452CEC9A4700A78B43 /* CourseDescAlertCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CourseDescAlertCell.m; sourceTree = "<group>"; };
+		BCD160462CEC9A4700A78B43 /* CourseDescAlertCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseDescAlertCell.xib; sourceTree = "<group>"; };
 		BCD4579E286313D70010B493 /* NotiferNavView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotiferNavView.m; sourceTree = "<group>"; };
 		BCD4579F286313D70010B493 /* NotiferNavView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotiferNavView.h; sourceTree = "<group>"; };
 		BCD457A0286313D70010B493 /* NotiferNavView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NotiferNavView.xib; sourceTree = "<group>"; };
@@ -4316,6 +4321,9 @@
 				BC3332792CEC32AA00649FF9 /* CourseDescAlertView.h */,
 				BC33327A2CEC32AA00649FF9 /* CourseDescAlertView.m */,
 				BC33327C2CEC32B200649FF9 /* CourseDescAlertView.xib */,
+				BCD160442CEC9A4700A78B43 /* CourseDescAlertCell.h */,
+				BCD160452CEC9A4700A78B43 /* CourseDescAlertCell.m */,
+				BCD160462CEC9A4700A78B43 /* CourseDescAlertCell.xib */,
 				BCC17DEA2CEC5CBE00808B60 /* HomeArrangeRankView.h */,
 				BCC17DEB2CEC5CBE00808B60 /* HomeArrangeRankView.m */,
 				BCC17DED2CEC5CC600808B60 /* HomeArrangeRankView.xib */,
@@ -6692,6 +6700,7 @@
 				BCCE95E92AB057C400AB6385 /* MorePageSearchView.xib in Resources */,
 				BC71D26B288804CD0010F14B /* img_8.png in Resources */,
 				BC756CC828FE867000AA9ECB /* UserDetailBottomView.xib in Resources */,
+				BCD160472CEC9A4700A78B43 /* CourseDescAlertCell.xib in Resources */,
 				BCFDA62628BC94480022B497 /* HomeNavSearchView.xib in Resources */,
 				BC71D0F42881A2420010F14B /* UMCommonLog.bundle in Resources */,
 				BC8A45C1283DDD7100094BBB /* synthgms.sf2 in Resources */,
@@ -7124,6 +7133,7 @@
 				BCF472E72AB019CD0032BE16 /* TenantDarkViewController.m in Sources */,
 				BC83A83E2AD28A9F0033D48B /* TenantNotiferNavView.m in Sources */,
 				BC106C032A933829000759A9 /* TXLiveMessageOpenLive.m in Sources */,
+				BCD160482CEC9A4700A78B43 /* CourseDescAlertCell.m in Sources */,
 				BCECE2462B3D670500C0D555 /* FeedbackViewController.m in Sources */,
 				BC1E28492C77151A0063E0A1 /* KSDeleteFailedAlertView.m in Sources */,
 				BC2888592A80F7BF0064B773 /* TXIMLinsenter.m in Sources */,

+ 14 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/Controller/HomeArrangeCourseController.m

@@ -15,6 +15,7 @@
 #import "HomeArrangeAccompanyCourseView.h"
 #import "HomeArrangeLiveCourseView.h"
 #import "HomeArrangeVideoCourseView.h"
+#import "CourseDescAlertView.h"
 
 #define HEADER_HEIGHT (50)
 
@@ -28,6 +29,10 @@
 
 @property (nonatomic, assign) DISPLAY_INDEX displayIndex;
 
+@property (nonatomic, strong) CourseDescAlertView *tipsAlert;
+
+//@property (no)
+
 @end
 
 @implementation HomeArrangeCourseController
@@ -145,6 +150,7 @@
 - (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];
     self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0);
+    [self showTipsAlert];
 }
 
 - (JXPagerView *)preferredPagingView {
@@ -282,9 +288,16 @@
 }
 
 - (void)showTipsAlert {
-    
+    [self.tipsAlert displayCourseTypeIndex:self.categoryView.selectedIndex];
+    [self.tipsAlert showInView:[NSObject getKeyWindow]];
 }
 
+- (CourseDescAlertView *)tipsAlert {
+    if (!_tipsAlert) {
+        _tipsAlert = [CourseDescAlertView sharedInstance];
+    }
+    return _tipsAlert;
+}
 /*
 #pragma mark - Navigation
 

+ 18 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertCell.h

@@ -0,0 +1,18 @@
+//
+//  CourseDescAlertCell.h
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/11/19.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CourseDescAlertCell : UICollectionViewCell
+
+- (void)configWithTitle:(NSString *)title desc:(NSString *)desc;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 48 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertCell.m

@@ -0,0 +1,48 @@
+//
+//  CourseDescAlertCell.m
+//  KulexiuForStudent
+//
+//  Created by 王智 on 2024/11/19.
+//
+
+#import "CourseDescAlertCell.h"
+
+@interface CourseDescAlertCell ()
+
+@property (weak, nonatomic) IBOutlet UILabel *tipsTitle;
+
+@property (weak, nonatomic) IBOutlet UILabel *tipsDesc;
+
+
+@end
+
+@implementation CourseDescAlertCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)configWithTitle:(NSString *)title desc:(NSString *)desc {
+    self.tipsTitle.text = [NSString returnNoNullStringWithString:title];
+    
+    NSMutableParagraphStyle *paragraphStyle = [self getParagraphStyleWithFont:[UIFont systemFontOfSize:13.0f] lineHeight:22.0f];
+    CGFloat baselineOffset = [self getBaseOffline:[UIFont systemFontOfSize:13.0f] lineHeight:22.0f];
+    NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:desc attributes:@{NSParagraphStyleAttributeName:paragraphStyle, NSBaselineOffsetAttributeName:@(baselineOffset),NSFontAttributeName:[UIFont systemFontOfSize:13.0f]}];
+    self.tipsDesc.attributedText = attrs;
+}
+
+- (CGFloat)getBaseOffline:(UIFont *)font lineHeight:(CGFloat)lineHeight {
+    CGFloat baselineOffset = (lineHeight - font.lineHeight) / 4;
+    return baselineOffset;
+}
+
+- (NSMutableParagraphStyle *)getParagraphStyleWithFont:(UIFont *)font lineHeight:(CGFloat)lineHeigh {
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    paragraphStyle.maximumLineHeight = lineHeigh;
+    paragraphStyle.minimumLineHeight = lineHeigh;
+    return paragraphStyle;
+}
+
+
+@end

+ 67 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertCell.xib

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <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"/>
+        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="CourseDescAlertCell">
+            <rect key="frame" x="0.0" y="0.0" width="324" height="248"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+                <rect key="frame" x="0.0" y="0.0" width="324" height="248"/>
+                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZxP-yq-fSD">
+                        <rect key="frame" x="0.0" y="0.0" width="324" height="248"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="什么是VIP定制课程?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="H1O-RV-1Sz">
+                                <rect key="frame" x="20" y="16" width="139.33333333333334" height="18"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="18" id="EFZ-kx-sVa"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
+                                <color key="textColor" red="0.074509803921568626" green="0.078431372549019607" blue="0.082352941176470587" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="69V-S9-pbv">
+                                <rect key="frame" x="20" y="44" width="284" height="155.33333333333334"/>
+                                <string key="text">VIP定制课程采用一对一专属授课模式,每节课时长为45分钟。课程内容根据学生的具体需求量身打造,旨在全面提升学生的个人技能与表现。不论是希望在乐器演奏技巧上取得突破,如提高指法精准度、气息控制能力或节奏掌握等;还是为即将到来的重要活动、比赛或考级做充分准备,我们都能提供高度匹配的教学方案。此外,教学进度将根据每位学员的学习吸收情况灵活调整,确保每个人都能在最适合自己的节奏中稳步前进,扎实提升个人能力。</string>
+                                <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                                <color key="textColor" red="0.46666666666666667" green="0.46666666666666667" blue="0.46666666666666667" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstItem="H1O-RV-1Sz" firstAttribute="top" secondItem="ZxP-yq-fSD" secondAttribute="top" constant="16" id="2kY-FE-cfT"/>
+                            <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="69V-S9-pbv" secondAttribute="bottom" id="4dK-Lv-hAR"/>
+                            <constraint firstAttribute="trailing" secondItem="69V-S9-pbv" secondAttribute="trailing" constant="20" id="5nO-kp-aDg"/>
+                            <constraint firstItem="69V-S9-pbv" firstAttribute="leading" secondItem="ZxP-yq-fSD" secondAttribute="leading" constant="20" id="Cs4-Jp-vgs"/>
+                            <constraint firstItem="69V-S9-pbv" firstAttribute="top" secondItem="H1O-RV-1Sz" secondAttribute="bottom" constant="10" id="hVr-dq-nEI"/>
+                            <constraint firstItem="H1O-RV-1Sz" firstAttribute="leading" secondItem="ZxP-yq-fSD" secondAttribute="leading" constant="20" id="tkT-hc-iKz"/>
+                        </constraints>
+                    </view>
+                </subviews>
+            </view>
+            <viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
+            <constraints>
+                <constraint firstItem="ZxP-yq-fSD" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="BM5-4d-8VT"/>
+                <constraint firstItem="ZxP-yq-fSD" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="ZUE-0w-3Jx"/>
+                <constraint firstAttribute="bottom" secondItem="ZxP-yq-fSD" secondAttribute="bottom" id="v2a-iv-dYy"/>
+                <constraint firstAttribute="trailing" secondItem="ZxP-yq-fSD" secondAttribute="trailing" id="zJl-Sd-ASu"/>
+            </constraints>
+            <size key="customSize" width="324" height="248"/>
+            <connections>
+                <outlet property="tipsDesc" destination="69V-S9-pbv" id="gx1-jx-BTf"/>
+                <outlet property="tipsTitle" destination="H1O-RV-1Sz" id="OYV-hh-vlL"/>
+            </connections>
+            <point key="canvasLocation" x="74.809160305343511" y="89.436619718309871"/>
+        </collectionViewCell>
+    </objects>
+</document>

+ 4 - 2
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertView.h

@@ -8,7 +8,7 @@
 #import <UIKit/UIKit.h>
 
 typedef NS_ENUM(NSInteger, COURSE_DISPLAY_INDEX) {
-    COURSE_DISPLAY_INDEX_VIP,
+    COURSE_DISPLAY_INDEX_VIP = 0,
     COURSE_DISPLAY_INDEX_ACCOMPANY,
     COURSE_DISPLAY_INDEX_LIVE,
     COURSE_DISPLAY_INDEX_VIDEO,
@@ -20,7 +20,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 + (instancetype)sharedInstance;
 
-- (void)displayCourseType:(COURSE_DISPLAY_INDEX)courseType;
+- (void)displayCourseTypeIndex:(NSInteger)index;
+
+- (void)showInView:(UIView *)displayView;
 
 @end
 

File diff suppressed because it is too large
+ 112 - 3
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertView.m


+ 6 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertView.xib

@@ -43,6 +43,9 @@
                                     <real key="value" value="8"/>
                                 </userDefinedRuntimeAttribute>
                             </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="removeView:" destination="iN0-l3-epB" eventType="touchUpInside" id="RYg-4T-Fqi"/>
+                            </connections>
                         </button>
                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="cancle_button" translatesAutoresizingMaskIntoConstraints="NO" id="b4p-H9-rif">
                             <rect key="frame" x="274" y="13" width="13" height="13"/>
@@ -58,6 +61,9 @@
                                 <constraint firstAttribute="height" constant="40" id="gXB-Au-TeE"/>
                             </constraints>
                             <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <connections>
+                                <action selector="removeView:" destination="iN0-l3-epB" eventType="touchUpInside" id="MKw-fa-cG2"/>
+                            </connections>
                         </button>
                     </subviews>
                     <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

Some files were not shown because too many files changed in this diff