Просмотр исходного кода

1.修复keychain 无法存储的问题
2.首页UI+ 个人中心UI

Steven 2 лет назад
Родитель
Сommit
9a2c2e918e

+ 3 - 3
KulexiuForStudent/KulexiuForStudent.xcodeproj/project.pbxproj

@@ -4716,12 +4716,12 @@
 		BC802DA828BC62A20079E350 /* HotTalent */ = {
 			isa = PBXGroup;
 			children = (
-				BC802DA928BC6EDA0079E350 /* HomeHotTalentView.h */,
-				BC802DAA28BC6EDA0079E350 /* HomeHotTalentView.m */,
-				BC802DAC28BC6EE40079E350 /* HomeHotTalentView.xib */,
 				BC802DAF28BC70370079E350 /* HomeHotTalentCell.h */,
 				BC802DB028BC70370079E350 /* HomeHotTalentCell.m */,
 				BC802DB128BC70370079E350 /* HomeHotTalentCell.xib */,
+				BC802DA928BC6EDA0079E350 /* HomeHotTalentView.h */,
+				BC802DAA28BC6EDA0079E350 /* HomeHotTalentView.m */,
+				BC802DAC28BC6EE40079E350 /* HomeHotTalentView.xib */,
 			);
 			path = HotTalent;
 			sourceTree = "<group>";

BIN
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


+ 16 - 0
KulexiuForStudent/KulexiuForStudent.xcworkspace/xcuserdata/wangzhi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -500,5 +500,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "9712843B-E2BB-423F-8233-006E6AA62DEA"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForStudent/Common/Tools/Custom/KeyChainTools.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "30"
+            endingLineNumber = "30"
+            landmarkName = "+getUUID"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Common/Tools/Custom/KeyChainTools.m

@@ -9,7 +9,7 @@
 #import "KeyChainTools.h"
 #import <Security/Security.h>
 
-NSString *const KEY_ASSESSGROUP = @"2K89M44X82.Colexiu";
+NSString *const KEY_ASSESSGROUP = @"B2AP53HHTU.Colexiu";
 
 @implementation KeyChainTools
 

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/KulexiuForStudent.entitlements

@@ -22,7 +22,7 @@
 	</array>
 	<key>keychain-access-groups</key>
 	<array>
-		<string>$(AppIdentifierPrefix)com.Colexiu.Kulexiu</string>
+		<string>$(AppIdentifierPrefix)Colexiu</string>
 	</array>
 </dict>
 </plist>

+ 9 - 2
KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

@@ -1169,7 +1169,10 @@
     else if (collectionView == self.talentCollectionView) {
         TalentTeacherModel *talentModel = self.talentArray[indexPath.item];
         HomeHotTalentCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotTalentCell" forIndexPath:indexPath];
-        [cell configWithSource:talentModel];
+        MJWeakSelf;
+        [cell configWithSource:talentModel callback:^(NSString *teacherId) {
+            [weakSelf followTalentTeacher:teacherId];
+        }];
         return cell;
     }
     else if (collectionView == self.videoCollectionView) {
@@ -1186,6 +1189,10 @@
     }
 }
 
+- (void)followTalentTeacher:(NSString *)teacherId {
+    
+}
+
 - (void)displaySongDetail:(NSString *)songId {
     // 检测权限
     PREMISSIONTYPE micEnable = [RecordCheckManager checkPermissionShowAlert:NO showInView:nil];
@@ -1270,7 +1277,7 @@
         return CGSizeMake(KPortraitWidth * 0.83, 240);
     }
     else if (collectionView == self.talentCollectionView) {
-        return CGSizeMake(110, 150);
+        return CGSizeMake(110, 178);
     }
     else if (collectionView == self.videoCollectionView) {
         return CGSizeMake(168, 157);

+ 3 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotTalent/HomeHotTalentCell.h

@@ -8,11 +8,13 @@
 #import <UIKit/UIKit.h>
 #import "TalentTeacherModel.h"
 
+typedef void(^FollowTalentAction)(NSString * _Nonnull teacherId);
+
 NS_ASSUME_NONNULL_BEGIN
 
 @interface HomeHotTalentCell : UICollectionViewCell
 
-- (void)configWithSource:(TalentTeacherModel *)sourceModel;
+- (void)configWithSource:(TalentTeacherModel *)sourceModel callback:(FollowTalentAction)callback;
 
 @end
 

+ 18 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotTalent/HomeHotTalentCell.m

@@ -25,6 +25,10 @@
 
 @property (nonatomic, strong) LOTAnimationView *animationView;
 
+@property (nonatomic, copy) FollowTalentAction callback;
+
+@property (nonatomic, strong) TalentTeacherModel *sourceModel;
+
 
 @end
 
@@ -57,7 +61,11 @@
     return gradientLayer;
 }
 
-- (void)configWithSource:(TalentTeacherModel *)sourceModel {
+- (void)configWithSource:(TalentTeacherModel *)sourceModel callback:(FollowTalentAction)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+    self.sourceModel = sourceModel;
     if (sourceModel.living) {
         self.liveView.hidden = NO;
         self.animationBgView.hidden = NO;
@@ -79,12 +87,21 @@
     else {
         self.teacherName.text = [NSString stringWithFormat:@"%@",sourceModel.username];
     }
+    
     if ([NSString isEmptyString:sourceModel.graduateSchool]) {
         self.graduateSchool.text = @"认证达人";
     }
     else {
         self.graduateSchool.text = [NSString returnNoNullStringWithString:sourceModel.graduateSchool];
     }
+    
+}
+
+
+- (IBAction)followAction:(id)sender {
+    if (self.callback) {
+        self.callback([NSString stringWithFormat:@"%.0f",self.sourceModel.userId]);
+    }
 }
 
 

+ 24 - 3
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotTalent/HomeHotTalentCell.xib

@@ -12,14 +12,14 @@
         <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="HomeHotTalentCell">
-            <rect key="frame" x="0.0" y="0.0" width="110" height="150"/>
+            <rect key="frame" x="0.0" y="0.0" width="110" height="178"/>
             <autoresizingMask key="autoresizingMask"/>
             <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
-                <rect key="frame" x="0.0" y="0.0" width="110" height="150"/>
+                <rect key="frame" x="0.0" y="0.0" width="110" height="178"/>
                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QRJ-mO-zJO">
-                        <rect key="frame" x="2" y="2" width="106" height="146"/>
+                        <rect key="frame" x="2" y="2" width="106" height="174"/>
                         <subviews>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_default_avatal" translatesAutoresizingMaskIntoConstraints="NO" id="AqF-It-spJ">
                                 <rect key="frame" x="24" y="17" width="58" height="58"/>
@@ -105,6 +105,25 @@
                                     <constraint firstAttribute="height" constant="14" id="5K0-04-Rux"/>
                                 </constraints>
                             </view>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5fX-oe-QBC">
+                                <rect key="frame" x="24" y="141" width="58" height="24"/>
+                                <color key="backgroundColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="58" id="fln-cg-DC9"/>
+                                    <constraint firstAttribute="height" constant="24" id="hAu-8P-aY5"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <state key="normal" title="关注"/>
+                                <userDefinedRuntimeAttributes>
+                                    <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                        <real key="value" value="12"/>
+                                    </userDefinedRuntimeAttribute>
+                                </userDefinedRuntimeAttributes>
+                                <connections>
+                                    <action selector="followAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="92T-as-pTh"/>
+                                </connections>
+                            </button>
                         </subviews>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
@@ -120,6 +139,8 @@
                             <constraint firstItem="PcD-yn-vxS" firstAttribute="leading" secondItem="QRJ-mO-zJO" secondAttribute="leading" constant="12" id="fs8-JQ-NPs"/>
                             <constraint firstAttribute="trailing" secondItem="S4c-t1-3Yg" secondAttribute="trailing" constant="12" id="fyR-jX-nrb"/>
                             <constraint firstItem="AqF-It-spJ" firstAttribute="centerX" secondItem="QRJ-mO-zJO" secondAttribute="centerX" id="ghn-5q-7fh"/>
+                            <constraint firstItem="5fX-oe-QBC" firstAttribute="top" secondItem="S4c-t1-3Yg" secondAttribute="bottom" constant="9" id="ngX-6L-O0Z"/>
+                            <constraint firstItem="5fX-oe-QBC" firstAttribute="centerX" secondItem="QRJ-mO-zJO" secondAttribute="centerX" id="p4y-zw-M7q"/>
                         </constraints>
                         <userDefinedRuntimeAttributes>
                             <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotTalent/HomeHotTalentView.m

@@ -31,7 +31,7 @@
 }
 
 + (CGFloat)getViewHeight {
-    return 216;
+    return 244;
 }
 /*
 // Only override drawRect: if you perform custom drawing.

+ 4 - 4
KulexiuForStudent/KulexiuForStudent/Module/Home/View/HotTalent/HomeHotTalentView.xib

@@ -10,7 +10,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="HomeHotTalentView">
-            <rect key="frame" x="0.0" y="0.0" width="623" height="212"/>
+            <rect key="frame" x="0.0" y="0.0" width="623" height="244"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="推荐达人" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ocF-cI-geX">
@@ -23,10 +23,10 @@
                     <nil key="highlightedColor"/>
                 </label>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TvN-a5-fF0">
-                    <rect key="frame" x="0.0" y="66" width="623" height="150"/>
+                    <rect key="frame" x="0.0" y="66" width="623" height="178"/>
                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
-                        <constraint firstAttribute="height" constant="150" id="Iwn-9Q-bda"/>
+                        <constraint firstAttribute="height" constant="178" id="Iwn-9Q-bda"/>
                     </constraints>
                 </view>
                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_left" translatesAutoresizingMaskIntoConstraints="NO" id="yk3-O1-fKs">
@@ -101,7 +101,7 @@
             <connections>
                 <outlet property="talentContentView" destination="TvN-a5-fF0" id="yD2-CZ-Qhm"/>
             </connections>
-            <point key="canvasLocation" x="63.04347826086957" y="-59.933035714285708"/>
+            <point key="canvasLocation" x="63.04347826086957" y="-49.553571428571423"/>
         </view>
     </objects>
     <resources>

+ 9 - 8
KulexiuForStudent/KulexiuForStudent/Module/Live/Controller/KSLiveWebViewController.m

@@ -21,18 +21,19 @@
 
 - (void)liveroomClose {
     [self MBPShow:@"直播已结束"];
-//    [self.navigationController popToRootViewControllerAnimated:YES];
 }
 
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
-}
 
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-    self.navigationController.interactivePopGestureRecognizer.enabled = YES;
+
+- (void)handleScriptMessageSource:(NSDictionary *)parm {
+    if ([[parm stringValueForKey:@"api"] isEqualToString:@"joinLiveRoom"]) {
+        [self backAction];
+    }
+    else {
+        [super handleScriptMessageSource:parm];
+    }
 }
+
 /*
 #pragma mark - Navigation
 

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Mine/Controller/MineViewController.m

@@ -242,7 +242,7 @@
         case MINEVIEWTYPE_TICKET:
         {
             KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];
-            webCtrl.url = [NSString stringWithFormat:@"%@%@", WEBHOST, @"/#/teacherFollow"];
+            webCtrl.url = [NSString stringWithFormat:@"%@%@", WEBHOST, @"/#/coupons"];
             [self.navigationController pushViewController:webCtrl animated:YES];
         }
             break;