diff --git a/tongxin.xcodeproj/project.pbxproj b/tongxin.xcodeproj/project.pbxproj index bb32c38..a2275d3 100644 --- a/tongxin.xcodeproj/project.pbxproj +++ b/tongxin.xcodeproj/project.pbxproj @@ -7108,7 +7108,7 @@ CODE_SIGN_ENTITLEMENTS = tongxin/tongxin.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1.3.6; + CURRENT_PROJECT_VERSION = 1.3.8; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 8P345JS8F2; ENABLE_BITCODE = NO; @@ -7226,7 +7226,7 @@ CODE_SIGN_ENTITLEMENTS = tongxin/tongxin.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1.3.6; + CURRENT_PROJECT_VERSION = 1.3.8; DEVELOPMENT_TEAM = 8P345JS8F2; ENABLE_BITCODE = NO; EXCLUDED_ARCHS = "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8 EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))"; diff --git a/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme b/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme index a0968ec..c31df81 100644 --- a/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme +++ b/tongxin.xcodeproj/xcshareddata/xcschemes/yisai-LeKan.xcscheme @@ -60,7 +60,7 @@ + + + + @@ -2888,22 +2918,6 @@ - - - - #import "GuShiScrollCellView.h" -@interface GuShiViewController () +@interface GuShiViewController () @property (nonatomic ,assign) NSInteger page; @@ -45,6 +45,9 @@ @property (nonatomic ,strong) UIView *noModelView; + +@property (nonatomic ,strong) GuShiTableViewCell *tocell; + @end @implementation GuShiViewController @@ -62,26 +65,26 @@ make.top.equalTo(self.headerView.mas_bottom).offset(12); }]; -// [self.view addSubview:self.gushiTable]; -// [self.gushiTable mas_makeConstraints:^(MASConstraintMaker *make) { -// make.left.right.equalTo(self.view).inset(16); -// make.top.equalTo(titleLabel.mas_bottom).offset(4); -// make.bottom.equalTo(self.view.mas_bottom); -// }]; - - [self.view addSubview:self.gushiScrollView]; - [self.gushiScrollView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.view addSubview:self.gushiTable]; + [self.gushiTable mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.view).inset(16); make.top.equalTo(titleLabel.mas_bottom).offset(4); - make.bottom.equalTo(self.view.mas_bottom).inset(iPhoneX_TabbarSafeBottomMargin > 0 ? iPhoneX_TabbarSafeBottomMargin : 20); + make.bottom.equalTo(self.view.mas_bottom).inset(iPhoneX_TabbarSafeBottomMargin > 0 ? iPhoneX_TabbarSafeBottomMargin : 20); }]; - [self.view addSubview:self.noModelView]; - [self.noModelView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.view); - make.centerY.equalTo(self.gushiScrollView).inset(30); - make.size.mas_equalTo(CGSizeMake(280, 180)); - }]; +// [self.view addSubview:self.gushiScrollView]; +// [self.gushiScrollView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.right.equalTo(self.view).inset(16); +// make.top.equalTo(titleLabel.mas_bottom).offset(4); +// make.bottom.equalTo(self.view.mas_bottom).inset(iPhoneX_TabbarSafeBottomMargin > 0 ? iPhoneX_TabbarSafeBottomMargin : 20); +// }]; + +// [self.view addSubview:self.noModelView]; +// [self.noModelView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.centerX.equalTo(self.view); +// make.centerY.equalTo(self.gushiScrollView).inset(30); +// make.size.mas_equalTo(CGSizeMake(280, 180)); +// }]; [UICommon MessageUpload:@"加载中"]; [self getSwitch]; @@ -131,8 +134,15 @@ GuShiTableViewCell *cell = (GuShiTableViewCell *)cells; cell.model = self.modelListArr[indexPath.row]; - cell.PlaybtnTouchBack = ^(GuShiListModel * _Nonnull model) { + cell.PlaybtnTouchBack = ^(GuShiListModel * _Nonnull model){ [weakSelf playVoice:model]; + weakSelf.tocell = [[GuShiTableViewCell alloc]init]; + weakSelf.tocell = [weakSelf.gushiTable cellForRowAtIndexPath:indexPath]; + dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ + dispatch_async(dispatch_get_main_queue(), ^{ + weakSelf.tocell.playProgress = model.progress; + }); + }); }; } selectedCell:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath) { @@ -141,13 +151,48 @@ } DidscrollView:^(UIScrollView * _Nonnull scrollView) { }]; + _gushiTable.delegates = self; + _gushiTable.isEditing = YES; _gushiTable.backgroundColor = KKWhiteColorColor; _gushiTable.layer.cornerRadius = 12; _gushiTable.layer.masksToBounds = YES; + _gushiTable.emptyDataSetSource = self; + _gushiTable.emptyDataSetDelegate = self; +// _gushiTable.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ +// self.page = 0; +// [self getModelList]; +// }]; +// _gushiTable.mj_footer = [MJRefreshFooter footerWithRefreshingBlock:^{ +// [self getModelList]; +// }]; + + [_gushiTable bindHeadRefreshHandler:^{ + self.page = 0; + [self getModelList]; + } themeColor:mainColor refreshStyle:KafkaRefreshStyleReplicatorWoody]; + + [_gushiTable bindFootRefreshHandler:^{ + [self getModelList]; + } themeColor:mainColor refreshStyle:KafkaRefreshStyleReplicatorWoody]; } return _gushiTable; } +- (void)CommTableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.row == self.playIndex) + [self.player pause]; + [UICommon MessageUpload:@"删除中"]; + GuShiListModel *model = self.modelListArr[indexPath.row]; + [cUser.cDevice DeleteStoryDataWithId:model.Id Success:^(id responseObject) { + [UICommon HidenLoading]; + [UICommon MessageSuccessText:@"删除成功" isImg:NO]; + [self getModelList]; + } failure:^(NSError *error) { + + }]; +} + - (void)playVoice:(GuShiListModel *)model { @@ -184,12 +229,12 @@ [self isUpdata:i isPlay:0 repModel:toModel]; } } - for (int i = 0; i < self.modelListArr.count; i++) - { - GuShiScrollCellView *view = self.viewsArr[i]; - GuShiListModel *gmodel = self.modelListArr[i]; - view.model = gmodel; - } +// for (int i = 0; i < self.modelListArr.count; i++) +// { +// GuShiScrollCellView *view = self.viewsArr[i]; +// GuShiListModel *gmodel = self.modelListArr[i]; +// view.model = gmodel; +// } } - (void)isUpdata:(NSInteger)index isPlay:(NSInteger)isplay repModel:(GuShiListModel *)model @@ -201,8 +246,8 @@ self.playIndex = index; } -// NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; -// [self.gushiTable reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationNone]; + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; + [self.gushiTable reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationNone]; } - (void)SubheaderView @@ -293,38 +338,39 @@ [self.urlListArr addObject:[NSURL URLWithString:model.voice]]; [self.modelListArr addObject:model]; } - self.player.playListArray = self.urlListArr; if (arr.count >= 20) weakSelf.page++; else - [weakSelf.gushiScrollView.mj_footer endRefreshingWithNoMoreData]; -// self.gushiTable.cellRow = self.modelListArr.count; -// [self.gushiTable reloadData]; + weakSelf.gushiTable.footRefreshControl.hidden = arr.count < 20 ? YES : NO; - for (UIView *views in self.gushiScrollView.subviews) { - if ([views isKindOfClass:GuShiScrollCellView.class]) - [views removeFromSuperview]; - } - for (int i = 0; i < self.modelListArr.count; i++) - { - GuShiScrollCellView *view = [[GuShiScrollCellView alloc] initWithFrame:CGRectMake(0, i*Adapted(55), ScreenWidth-32, Adapted(55))]; - view.model = self.modelListArr[i]; - view.PlaybtnTouchBack = ^(GuShiListModel * _Nonnull model, GuShiScrollCellView * _Nonnull toView) { - self.toView = toView; - [weakSelf playVoice:model]; - }; - [self.viewsArr addObject:view]; - [self.gushiScrollView addSubview:view]; - - } - self.noModelView.hidden = self.modelListArr.count > 0 ? YES : NO; - self.gushiScrollView.contentSize = CGSizeMake(ScreenWidth-32, self.modelListArr.count*Adapted(55)); - [self.gushiScrollView.mj_header endRefreshing]; - [self.gushiScrollView.mj_footer endRefreshing]; + self.player.playListArray = self.urlListArr; + self.gushiTable.cellRow = self.modelListArr.count; + [self.gushiTable reloadData]; + +// for (UIView *views in self.gushiScrollView.subviews) { +// if ([views isKindOfClass:GuShiScrollCellView.class]) +// [views removeFromSuperview]; +// } +// for (int i = 0; i < self.modelListArr.count; i++) +// { +// GuShiScrollCellView *view = [[GuShiScrollCellView alloc] initWithFrame:CGRectMake(0, i*Adapted(55), ScreenWidth-32, Adapted(55))]; +// view.model = self.modelListArr[i]; +// view.PlaybtnTouchBack = ^(GuShiListModel * _Nonnull model, GuShiScrollCellView * _Nonnull toView) { +// self.toView = toView; +// [weakSelf playVoice:model]; +// }; +// [self.viewsArr addObject:view]; +// [self.gushiScrollView addSubview:view]; +// +// } +// self.noModelView.hidden = self.modelListArr.count > 0 ? YES : NO; +// self.gushiScrollView.contentSize = CGSizeMake(ScreenWidth-32, self.modelListArr.count*Adapted(55)); + [weakSelf.gushiTable.headRefreshControl endRefreshingWithAlertText:@"已为你加载最新数据~" completion:^{}]; + [weakSelf.gushiTable.footRefreshControl endRefreshing]; } failure:^(NSError *error) { [UICommon HidenLoading]; - self.noModelView.hidden = self.modelListArr.count > 0 ? YES : NO; +// self.noModelView.hidden = self.modelListArr.count > 0 ? YES : NO; }]; } @@ -401,16 +447,17 @@ WeakSelf [self.modelListArr replaceObjectAtIndex:self.playIndex withObject:toModel]; dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ dispatch_async(dispatch_get_main_queue(), ^{ + weakSelf.tocell.playProgress = progress; // NSIndexPath*indexPath = [NSIndexPath indexPathForRow:self.playIndex inSection:0]; // [self.gushiTable reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationNone]; // GuShiScrollCellView *view = self.viewsArr[self.playIndex]; // weakSelf.toView.playProgress = progress; - for (int i = 0; i < self.modelListArr.count; i++) - { - GuShiScrollCellView *view = self.viewsArr[i]; - GuShiListModel *gmodel = self.modelListArr[i]; - view.model = gmodel; - } +// for (int i = 0; i < self.modelListArr.count; i++) +// { +// GuShiScrollCellView *view = self.viewsArr[i]; +// GuShiListModel *gmodel = self.modelListArr[i]; +// view.model = gmodel; +// } if (progress == 1) { [weakSelf isUpdata:weakSelf.playIndex isPlay:0 repModel:toModel]; diff --git a/tongxin/VC/WatchHome/View/GuShiTableViewCell.h b/tongxin/VC/WatchHome/View/GuShiTableViewCell.h index 21d03f2..11bac23 100644 --- a/tongxin/VC/WatchHome/View/GuShiTableViewCell.h +++ b/tongxin/VC/WatchHome/View/GuShiTableViewCell.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN /// <#arguments#> @property (nonatomic ,assign) GuShiListModel *model; -@property (copy, nonatomic) void (^PlaybtnTouchBack) (GuShiListModel *model); +@property (copy, nonatomic) void (^PlaybtnTouchBack) (GuShiListModel *model ); /// 播放进度 diff --git a/tongxin/VC/WatchHome/View/GuShiTableViewCell.m b/tongxin/VC/WatchHome/View/GuShiTableViewCell.m index 0fa7534..81d3146 100644 --- a/tongxin/VC/WatchHome/View/GuShiTableViewCell.m +++ b/tongxin/VC/WatchHome/View/GuShiTableViewCell.m @@ -60,7 +60,7 @@ [self.fenBtn setBackgroundImage:model.isPlay == 0 ? ImageName_(@"icon_fen_grey") : ImageName_(@"icon_fen_red") forState:0]; self.dongView.hidden = model.isPlay == 2 ? NO : YES; self.progressView.hidden = model.isPlay > 0 ? NO : YES; - self.progressView.progress = model.progress; + self.progressView.progress = 0; if (model.isPlay == 0) self.boImg.image = ImageName_(@"icon_bo_grey");/// 未播放 else if (model.isPlay == 1)