Selaa lähdekoodia

风采编辑刷新

Steven 7 kuukautta sitten
vanhempi
commit
0087592d7c

+ 12 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Controller/HomeViewController.m

@@ -475,8 +475,7 @@
                 [self.navigationController pushViewController:ctrl animated:YES];
             }
             else if ([model.linkUrl isEqualToString:@"native-homepage"]) {
-                MinePageViewController *pageCtrl = [[MinePageViewController alloc] init];
-                [self.navigationController pushViewController:pageCtrl animated:YES];
+                [self toMinePage];
             }
             else if ([model.linkUrl isEqualToString:@"native-homework"]) {
                 HomeworkListViewController *ctrl = [[HomeworkListViewController alloc] init];
@@ -492,6 +491,17 @@
     }
 }
 
+- (void)toMinePage {
+    if (![self.mineInfo.entryStatus isEqualToString:@"PASS"]) { // 跳转老师认证
+        KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
+        webCtrl.url = [NSString stringWithFormat:@"%@%@", WEBHOST, @"/#/teacherCert"];
+        [self.navigationController pushViewController:webCtrl animated:YES];
+    }
+    else {
+        MinePageViewController *pageCtrl = [[MinePageViewController alloc] init];
+        [self.navigationController pushViewController:pageCtrl animated:YES];
+    }
+}
 
 - (void)requestAlbumSource {
     dispatch_group_enter(self.requestGroup);

+ 20 - 11
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/CreateStyle/Controller/MyStyleViewController.m

@@ -72,6 +72,8 @@
 
 @property (nonatomic, assign) BOOL courseTimeFlag;
 
+@property (nonatomic, assign) BOOL isFirstLoad;
+
 @end
 
 @implementation MyStyleViewController
@@ -80,8 +82,9 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     self.ks_prefersNavigationBarHidden = YES;
+    self.isFirstLoad = YES;
     [self configUI];
-    [self requestMyStyle];
+    [self requestMyStyleRefreshTimeFlag:NO];
     [self countUMEvent];
 }
 
@@ -92,6 +95,10 @@
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [self requestUserMessage];
+    if (self.isFirstLoad == NO) {
+        [self requestMyStyleRefreshTimeFlag:YES];
+    }
+    self.isFirstLoad = NO;
 }
 
 - (void)configUI {
@@ -123,7 +130,7 @@
     [self.infoHeadView configUserMessage:self.mineInfo];
 }
 
-- (void)requestMyStyle {
+- (void)requestMyStyleRefreshTimeFlag:(BOOL)refreshTimeFlag {
     [LOADING_MANAGER showHUD];
     [KSNetworkingManager queryTeacherStyleRequest:KS_GET success:^(NSDictionary * _Nonnull dic) {
         [LOADING_MANAGER removeHUD];
@@ -131,16 +138,18 @@
             NSDictionary *result = [dic ks_dictionaryValueForKey:@"data"];
             NSString *subjectIds = [result ks_stringValueForKey:@"subjectId"];
             NSString *subjectNames = [result ks_stringValueForKey:@"subjectName"];
-            [self configWithSubjectMessage:subjectIds subjectName:subjectNames];
-            self.courseTimeFlag = [result ks_boolValueForKey:@"courseTimeFlag"];
-            // introduction
-            self.content = [result ks_stringValueForKey:@"introduction"];
-            NSArray *videoList = [result ks_arrayValueForKey:@"styleVideo"];
-            [self.videoArray removeAllObjects];
-            for (NSDictionary *parm in videoList) {
-                StyleVideoModel *model = [[StyleVideoModel alloc] initWithDictionary:parm];
-                [self.videoArray addObject:model];
+            if (refreshTimeFlag == NO) { // 刷新约课时间时,不处理其他刷新 避免修改数据被刷新
+                [self configWithSubjectMessage:subjectIds subjectName:subjectNames];
+                // introduction
+                self.content = [result ks_stringValueForKey:@"introduction"];
+                NSArray *videoList = [result ks_arrayValueForKey:@"styleVideo"];
+                [self.videoArray removeAllObjects];
+                for (NSDictionary *parm in videoList) {
+                    StyleVideoModel *model = [[StyleVideoModel alloc] initWithDictionary:parm];
+                    [self.videoArray addObject:model];
+                }
             }
+            self.courseTimeFlag = [result ks_boolValueForKey:@"courseTimeFlag"];
         }
         else {
             [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];

+ 5 - 5
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/CreateStyle/View/MyStyleNavView.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" 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_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -33,10 +33,10 @@
                                 <action selector="backAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="mtf-XP-BqQ"/>
                             </connections>
                         </button>
-                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我的风采编辑" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bU6-BQ-iXc">
-                            <rect key="frame" x="151.5" y="11" width="111" height="22"/>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="编辑资料" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bU6-BQ-iXc">
+                            <rect key="frame" x="171.5" y="11" width="71.5" height="22"/>
                             <fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
-                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XzJ-wE-EDk">

+ 7 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/FansGroupAlert/FansGroupAlertCell.xib

@@ -20,12 +20,17 @@
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="76n-GO-SJx">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="83"/>
                         <subviews>
-                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chat_fansGroup_logo" translatesAutoresizingMaskIntoConstraints="NO" id="cOU-Gd-KLn">
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chat_fansGroup_logo" translatesAutoresizingMaskIntoConstraints="NO" id="cOU-Gd-KLn">
                                 <rect key="frame" x="20" y="20.666666666666671" width="42" height="42"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="42" id="GO6-9I-49O"/>
                                     <constraint firstAttribute="width" constant="42" id="UbU-XM-x44"/>
                                 </constraints>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                        <real key="value" value="21"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
                             </imageView>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="长笛群" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u61-Cw-ZNy">
                                 <rect key="frame" x="72" y="21.666666666666671" width="211" height="21"/>
@@ -44,7 +49,7 @@
                                 </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="9Qg-fN-QGW">
-                                <rect key="frame" x="72" y="45" width="211" height="17"/>
+                                <rect key="frame" x="72" y="44.666666666666664" width="211" height="17"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="17" id="hPL-vc-xSY"/>
                                 </constraints>

+ 2 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Mine/MinePage/View/HeadView/MinePageTopView.m

@@ -99,6 +99,7 @@
         else {
             self.teacherName.text = infoMessage.username;
         }
+        
         if ([NSString isEmptyString:infoMessage.subjectName]) {
             [self.tagScroll removeAllSubViews];
         }
@@ -210,7 +211,7 @@
     UIView *bgView = [[UIView alloc] initWithFrame:frame];
     bgView.backgroundColor = HexRGBAlpha(0xFFFFFF, 0.2f);
     bgView.layer.cornerRadius = 10.0f;
-    [self.subjectView addSubview:bgView];
+    [self.tagScroll addSubview:bgView];
     
     UILabel *tagLabel = [[UILabel alloc] init];
     tagLabel.text = name;