浏览代码

收入差一个视频课的统计

Steven 3 年之前
父节点
当前提交
52822f6308

二进制
KulexiuForTeacher/KulexiuForTeacher.xcworkspace/xcuserdata/wangzhi.xcuserdatad/UserInterfaceState.xcuserstate


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

@@ -240,5 +240,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "87FDC9D5-6128-40ED-8BC6-060B4EAEF26C"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KulexiuForTeacher/Module/Home/Income/Controller/MyIncomeViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "146"
+            endingLineNumber = "146"
+            landmarkName = "-requestData"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 0 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/Controller/IncomeCountViewController.m

@@ -144,7 +144,6 @@
     }];
 }
 
-//- (void)configMessage:(NSArray *)topAmount 
 
 - (void)configMessage:(NSArray *)source {
     NSArray *colorArray = @[@"#01C1B5",

+ 13 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/Controller/MyIncomeViewController.m

@@ -154,6 +154,7 @@
         else {
             [self MBPShow:MESSAGEKEY];
         }
+        
         [self.tableView reloadData];
         [self changePromptLabelState];
     } faliure:^(NSError * _Nonnull error) {
@@ -174,7 +175,14 @@
 }
 
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    IncomeListModel *model = self.dataArray[indexPath.row];
+    NSString *preDay = nil;
+    if (indexPath.row != 0) {
+        IncomeListModel *preModel = self.dataArray[indexPath.row-1];
+        preDay = preModel.timeDay;
+    }
     MyIncomeListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIncomeListCell"];
+    [cell configSource:model preSourceDay:preDay];
     return cell;
 }
 
@@ -195,6 +203,11 @@
         _tableView.dataSource = self;
         _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
         [_tableView registerNib:[UINib nibWithNibName:@"MyIncomeListCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"MyIncomeListCell"];
+        _tableView.estimatedRowHeight = 125.0f;
+        _tableView.rowHeight = UITableViewAutomaticDimension;
+        UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 15)];
+        bottomView.backgroundColor = HexRGB(0xf3f4f8);
+        _tableView.tableFooterView = bottomView;
     }
     return _tableView;
 }

+ 3 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/View/MyIncomeListCell.h

@@ -6,11 +6,14 @@
 //
 
 #import <UIKit/UIKit.h>
+#import "IncomeListModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface MyIncomeListCell : UITableViewCell
 
+- (void)configSource:(IncomeListModel *)sourceModel preSourceDay:(NSString *)preSourceDay;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 60 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/View/MyIncomeListCell.m

@@ -7,6 +7,22 @@
 
 #import "MyIncomeListCell.h"
 
+@interface MyIncomeListCell ()
+
+@property (weak, nonatomic) IBOutlet UIImageView *courseTypeImage;
+
+@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
+
+@property (weak, nonatomic) IBOutlet UILabel *incomeLabel;
+
+@property (weak, nonatomic) IBOutlet UILabel *courseTime;
+
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *dayLabelHeight;
+
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *spaceHeight;
+
+@end
+
 @implementation MyIncomeListCell
 
 - (void)awakeFromNib {
@@ -15,6 +31,50 @@
     self.selectionStyle = UITableViewCellSelectionStyleNone;
 }
 
+- (void)configSource:(IncomeListModel *)sourceModel preSourceDay:(NSString *)preSourceDay {
+    if ([NSString isEmptyString:preSourceDay]) {
+        self.spaceHeight.constant = 10;
+        self.dayLabelHeight.constant = 20;
+        self.timeLabel.text = [NSString returnNoNullStringWithString:sourceModel.timeDay];
+    }
+    else if ([sourceModel.timeDay isEqualToString:preSourceDay])
+    {
+        self.timeLabel.text = @"";
+        self.spaceHeight.constant = 0;
+        self.dayLabelHeight.constant = 0;
+    }
+    else {
+        self.spaceHeight.constant = 10;
+        self.dayLabelHeight.constant = 20;
+        self.timeLabel.text = [NSString returnNoNullStringWithString:sourceModel.timeDay];
+    }
+    
+    NSDateFormatter *dateFormatter = [NSObject getDateformatter];
+    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
+    NSDate *beginDate = [dateFormatter dateFromString:sourceModel.startTime];
+    NSDate *endDate = [dateFormatter dateFromString:sourceModel.endTime];
+    [dateFormatter setDateFormat:@"yyyy/MM/dd HH:mm"];
+    NSString *beginStr = [NSString returnNoNullStringWithString:[dateFormatter stringFromDate:beginDate]];
+    
+    [dateFormatter setDateFormat:@"HH:mm"];
+    NSString *endStr = [NSString returnNoNullStringWithString:[dateFormatter stringFromDate:endDate]];
+    self.courseTime.text = [NSString stringWithFormat:@"%@~%@", beginStr, endStr];
+    
+    if ([sourceModel.bizType isEqualToString:@"PRACTICE"]) {
+        [self.courseTypeImage setImage:[UIImage imageNamed:@"income_accompany"]];
+    }
+    else if ([sourceModel.bizType isEqualToString:@"LIVE"]) {
+        [self.courseTypeImage setImage:[UIImage imageNamed:@"income_live"]];
+    }
+    else if ([sourceModel.bizType isEqualToString:@"VIDEO"]) {
+        [self.courseTypeImage setImage:[UIImage imageNamed:@"income_video"]];
+    }
+    else  {
+        [self.courseTypeImage setImage:[UIImage imageNamed:@"income_music"]];
+    }
+
+}
+
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
     [super setSelected:selected animated:animated];
 

+ 11 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Income/View/MyIncomeListCell.xib

@@ -14,7 +14,7 @@
         <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="125" id="KGk-i7-Jjw" customClass="MyIncomeListCell">
             <rect key="frame" x="0.0" y="0.0" width="434" height="125"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
+            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
                 <rect key="frame" x="0.0" y="0.0" width="434" height="125"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
@@ -60,12 +60,13 @@
                             <constraint firstItem="2Jh-sq-z46" firstAttribute="leading" secondItem="9xw-2T-8bx" secondAttribute="leading" constant="13" id="EM4-tu-kf9"/>
                             <constraint firstItem="WBq-ZP-ehT" firstAttribute="centerY" secondItem="egb-TU-4Uf" secondAttribute="centerY" id="H7k-eb-q0Q"/>
                             <constraint firstItem="uKk-JC-tKp" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="kS8-LB-QVW" secondAttribute="trailing" constant="10" id="ICX-bv-cam"/>
+                            <constraint firstItem="2Jh-sq-z46" firstAttribute="top" secondItem="9xw-2T-8bx" secondAttribute="top" constant="20" id="KSO-Oe-NTn"/>
                             <constraint firstItem="uKk-JC-tKp" firstAttribute="centerY" secondItem="kS8-LB-QVW" secondAttribute="centerY" id="KXi-Kg-Wt4"/>
                             <constraint firstItem="kS8-LB-QVW" firstAttribute="leading" secondItem="2Jh-sq-z46" secondAttribute="trailing" constant="13" id="Uco-ZZ-xvC"/>
                             <constraint firstItem="egb-TU-4Uf" firstAttribute="top" secondItem="kS8-LB-QVW" secondAttribute="bottom" constant="2" id="Z6G-Yx-cU8"/>
                             <constraint firstItem="egb-TU-4Uf" firstAttribute="leading" secondItem="2Jh-sq-z46" secondAttribute="trailing" constant="13" id="fTh-wL-C4t"/>
                             <constraint firstItem="WBq-ZP-ehT" firstAttribute="leading" secondItem="egb-TU-4Uf" secondAttribute="trailing" constant="7" id="fhL-Ef-ut7"/>
-                            <constraint firstAttribute="height" constant="82" id="ihN-zK-wU0"/>
+                            <constraint firstAttribute="bottom" secondItem="2Jh-sq-z46" secondAttribute="bottom" constant="20" id="t5U-jP-aNH"/>
                             <constraint firstAttribute="trailing" secondItem="uKk-JC-tKp" secondAttribute="trailing" constant="13" id="tLJ-oP-rzN"/>
                         </constraints>
                         <userDefinedRuntimeAttributes>
@@ -95,6 +96,14 @@
             </tableViewCellContentView>
             <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <connections>
+                <outlet property="courseTime" destination="WBq-ZP-ehT" id="xqH-Ss-mZ6"/>
+                <outlet property="courseTypeImage" destination="2Jh-sq-z46" id="afR-Gn-Yex"/>
+                <outlet property="dayLabelHeight" destination="h84-He-cJc" id="869-U9-uVN"/>
+                <outlet property="incomeLabel" destination="uKk-JC-tKp" id="PZH-LW-Wtg"/>
+                <outlet property="spaceHeight" destination="vn6-47-ha3" id="b3h-NO-mzq"/>
+                <outlet property="timeLabel" destination="ODu-Td-Ufa" id="UWp-Nc-6vx"/>
+            </connections>
             <point key="canvasLocation" x="159.42028985507247" y="100.11160714285714"/>
         </tableViewCell>
     </objects>