|
@@ -54,7 +54,8 @@
|
|
|
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
|
|
[self addSubview:self.tableView];
|
|
|
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
|
-
|
|
|
+ [self.tableView registerNib:[UINib nibWithNibName:@"MinePageVipProgramCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"MinePageVipProgramCell"];
|
|
|
+
|
|
|
UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 10)];
|
|
|
bottomView.backgroundColor = HexRGB(0xf8f9fc);
|
|
|
self.tableView.tableFooterView = bottomView;
|
|
@@ -106,8 +107,30 @@
|
|
|
}
|
|
|
|
|
|
- (void)requestData {
|
|
|
- [self endRefresh];
|
|
|
- [self changePromptLabelStateWithArray:self.dataArray];
|
|
|
+ [KSNetworkingManager teacherSubjectPriceRequest:KS_POST courseType:@"PRACTICE" page:self.pages rows:self.rows success:^(NSDictionary * _Nonnull dic) {
|
|
|
+ [self endRefresh];
|
|
|
+ if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
|
|
|
+ NSArray *sourceArray = [dic ks_arrayValueForKey:@"data"];
|
|
|
+ for (NSDictionary *parm in sourceArray) {
|
|
|
+ CoursePargramListModel *model = [[CoursePargramListModel alloc] initWithDictionary:parm];
|
|
|
+ [self.dataArray addObject:model];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
|
|
|
+ }
|
|
|
+ [self.tableView reloadData];
|
|
|
+ [self changePromptLabelStateWithArray:self.dataArray];
|
|
|
+ } faliure:^(NSError * _Nonnull error) {
|
|
|
+ [self endRefresh];
|
|
|
+ if (self.networkAvaiable == NO) {
|
|
|
+ [self setPromptString:@"暂无网络" imageName:@"no_networking" inView:self.tableView];
|
|
|
+ }
|
|
|
+ [self.dataArray removeAllObjects];
|
|
|
+ [self.tableView reloadData];
|
|
|
+ [self changePromptLabelStateWithArray:self.dataArray];
|
|
|
+ }];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)beginRefreshImmediately {
|
|
@@ -203,14 +226,48 @@
|
|
|
}
|
|
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
- return 88.0f;
|
|
|
+ return 86.0f;
|
|
|
}
|
|
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
+ CoursePargramListModel *model = self.dataArray[indexPath.row];
|
|
|
MinePageVipProgramCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MinePageVipProgramCell"];
|
|
|
+ MJWeakSelf;
|
|
|
+ [cell configWithSource:model callback:^(NSString * _Nonnull programId) {
|
|
|
+ [weakSelf showAlert:programId];
|
|
|
+ }];
|
|
|
return cell;
|
|
|
}
|
|
|
|
|
|
+- (void)showAlert:(NSString *)programId {
|
|
|
+ KSConfirmAlertView *alert = [KSConfirmAlertView shareInstance];
|
|
|
+ [alert configWithTitle:@"提示" subTitle:@"确认删除该课程方案吗?"];
|
|
|
+ [alert configLeftTitle:@"取消" rightTitle:@"确认"];
|
|
|
+ MJWeakSelf;
|
|
|
+ [alert opreationSure:^{
|
|
|
+ [weakSelf removeProgram:programId];
|
|
|
+ } cancel:^{
|
|
|
+
|
|
|
+ }];
|
|
|
+ [alert showAlert];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)removeProgram:(NSString *)programId {
|
|
|
+ [LOADING_MANAGER showHUD];
|
|
|
+ [KSNetworkingManager teacherSubjectPriceDeleteRequest:KS_POST programId:programId success:^(NSDictionary * _Nonnull dic) {
|
|
|
+ [LOADING_MANAGER removeHUD];
|
|
|
+ if ([dic ks_integerValueForKey:@"code"] == 200 && [dic ks_boolValueForKey:@"status"]) {
|
|
|
+ [self refreshAndRequestData];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ [LOADING_MANAGER MBShowAUTOHidingInWindow:MESSAGEKEY];
|
|
|
+ }
|
|
|
+ } faliure:^(NSError * _Nonnull error) {
|
|
|
+ [LOADING_MANAGER removeHUD];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
#pragma mark ----- lazying
|
|
|
- (UIView *)headView {
|
|
|
if (!_headView) {
|
|
@@ -223,7 +280,7 @@
|
|
|
if (!_tipsView) {
|
|
|
_tipsView = [MinePageCourseTipsView shareIntance];
|
|
|
MJWeakSelf;
|
|
|
- [_tipsView configWithTypeImage:@"minePage_course_introduce" headTitle:@"什么是趣纠课?" descMsg:@"趣纠课是老师在您的练习过程中提供的个性化指导服务,旨在纠正错误并帮助您更好地理解和掌握所学内容。上课形式为1v1线上课程。" callback:^(COURSE_TIPS_ACTION action) {
|
|
|
+ [_tipsView configWithTypeImage:@"minePage_course_introduce" headTitle:@"什么是趣纠课?" descMsg:@"趣纠课以一对一专属、高度针对性的形式进行,每次课程时长为25分钟。本课程专为解决学生日常练习中的疑问与误区设计,尤其适合那些在自我练习后感到困惑或不确定自己方法是否正确的学生。不同于传统的教学模式,趣纠课不侧重于新知识或新技能的传授,而是全心全意致力于检查学生现有的练习成果,并及时纠正其中出现的问题。这种方式不仅有助于学生巩固已掌握的知识和技能,还能有效防止错误习惯的形成和发展,为他们今后的学习打下更加坚实的基础。" callback:^(COURSE_TIPS_ACTION action) {
|
|
|
[weakSelf courseTipsAction:action];
|
|
|
}];
|
|
|
}
|
|
@@ -330,21 +387,6 @@
|
|
|
return isExistenceNetwork;
|
|
|
}
|
|
|
|
|
|
-- (void)showAlert:(NSString *)programId {
|
|
|
- KSConfirmAlertView *alert = [KSConfirmAlertView shareInstance];
|
|
|
- MJWeakSelf;
|
|
|
- [alert configWithTitle:@"提示" subTitle:@"确认删除该课程方案吗?"];
|
|
|
- [alert opreationSure:^{
|
|
|
- [weakSelf deleteProgram:programId];
|
|
|
- } cancel:^{
|
|
|
-
|
|
|
- }];
|
|
|
- [alert showAlert];
|
|
|
-}
|
|
|
-
|
|
|
-- (void)deleteProgram:(NSString *)programId {
|
|
|
-
|
|
|
-}
|
|
|
|
|
|
/*
|
|
|
// Only override drawRect: if you perform custom drawing.
|