|
@@ -172,6 +172,9 @@
|
|
|
|
|
|
@property (nonatomic, assign) BOOL isCheck;
|
|
@property (nonatomic, assign) BOOL isCheck;
|
|
|
|
|
|
|
|
+
|
|
|
|
+@property (nonatomic, strong) HomeMessageModel *buttonModel;
|
|
|
|
+
|
|
@end
|
|
@end
|
|
|
|
|
|
@implementation HomeViewController
|
|
@implementation HomeViewController
|
|
@@ -568,6 +571,12 @@
|
|
if (flashArray.count) {
|
|
if (flashArray.count) {
|
|
self.flashModel = [[HomeMessageModel alloc] initWithDictionary:[flashArray firstObject]];
|
|
self.flashModel = [[HomeMessageModel alloc] initWithDictionary:[flashArray firstObject]];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 首页悬浮按钮
|
|
|
|
+ NSArray *suspensionArray = [result arrayValueForKey:@"suspension"];
|
|
|
|
+ if (suspensionArray.count) {
|
|
|
|
+ self.buttonModel = [[HomeMessageModel alloc] initWithDictionary:[flashArray firstObject]];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
[self MBPShow:MESSAGEKEY];
|
|
[self MBPShow:MESSAGEKEY];
|
|
@@ -841,7 +850,16 @@
|
|
[self showNewsWithSource:self.flashModel];
|
|
[self showNewsWithSource:self.flashModel];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 悬浮按钮
|
|
|
|
+ if (self.buttonModel) {
|
|
|
|
+ [self showFloatingWindow];
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
+// 显示悬浮窗
|
|
|
|
+- (void)showFloatingWindow {
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
- (void)showNewsWithSource:(HomeMessageModel *)sourceModel {
|
|
- (void)showNewsWithSource:(HomeMessageModel *)sourceModel {
|
|
@@ -1301,18 +1319,18 @@
|
|
return self.albumArray.count;
|
|
return self.albumArray.count;
|
|
}
|
|
}
|
|
else if (collectionView == self.recommendMusicCollectionView) {
|
|
else if (collectionView == self.recommendMusicCollectionView) {
|
|
- NSInteger lastRowCount = (self.recommendMusicArray.count % 3) > 0 ? 1 : 0;
|
|
|
|
- NSInteger count = self.recommendMusicArray.count / 3 + lastRowCount;
|
|
|
|
|
|
+ NSInteger lastRowCount = (self.recommendMusicArray.count % 4) > 0 ? 1 : 0;
|
|
|
|
+ NSInteger count = self.recommendMusicArray.count / 4 + lastRowCount;
|
|
return count;
|
|
return count;
|
|
}
|
|
}
|
|
else if (collectionView == self.newestMusicCollectionView) {
|
|
else if (collectionView == self.newestMusicCollectionView) {
|
|
- NSInteger lastRowCount = (self.newestMusicArray.count % 3) > 0 ? 1 : 0;
|
|
|
|
- NSInteger count = self.newestMusicArray.count / 3 + lastRowCount;
|
|
|
|
|
|
+ NSInteger lastRowCount = (self.newestMusicArray.count % 4) > 0 ? 1 : 0;
|
|
|
|
+ NSInteger count = self.newestMusicArray.count / 4 + lastRowCount;
|
|
return count;
|
|
return count;
|
|
}
|
|
}
|
|
else if (collectionView == self.musicCollectionView) { // 乐谱
|
|
else if (collectionView == self.musicCollectionView) { // 乐谱
|
|
- NSInteger lastRowCount = (self.musicArray.count % 3) > 0 ? 1 : 0;
|
|
|
|
- NSInteger count = self.musicArray.count / 3 + lastRowCount;
|
|
|
|
|
|
+ NSInteger lastRowCount = (self.musicArray.count % 4) > 0 ? 1 : 0;
|
|
|
|
+ NSInteger count = self.musicArray.count / 4 + lastRowCount;
|
|
return count;
|
|
return count;
|
|
}
|
|
}
|
|
else if (collectionView == self.talentCollectionView) { // 推荐达人
|
|
else if (collectionView == self.talentCollectionView) { // 推荐达人
|
|
@@ -1336,8 +1354,8 @@
|
|
}
|
|
}
|
|
else if (collectionView == self.recommendMusicCollectionView) {
|
|
else if (collectionView == self.recommendMusicCollectionView) {
|
|
NSMutableArray *songArray = [NSMutableArray array];
|
|
NSMutableArray *songArray = [NSMutableArray array];
|
|
- NSInteger length = indexPath.item * 3 + 3 > self.recommendMusicArray.count ? self.recommendMusicArray.count - indexPath.item * 3: 3;
|
|
|
|
- NSRange range = NSMakeRange(indexPath.item * 3, length);
|
|
|
|
|
|
+ NSInteger length = indexPath.item * 4 + 4 > self.recommendMusicArray.count ? self.recommendMusicArray.count - indexPath.item * 4: 4;
|
|
|
|
+ NSRange range = NSMakeRange(indexPath.item * 4, length);
|
|
|
|
|
|
songArray = [NSMutableArray arrayWithArray:[self.recommendMusicArray subarrayWithRange:range]];
|
|
songArray = [NSMutableArray arrayWithArray:[self.recommendMusicArray subarrayWithRange:range]];
|
|
HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
|
|
HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
|
|
@@ -1349,8 +1367,8 @@
|
|
}
|
|
}
|
|
else if (collectionView == self.newestMusicCollectionView) {
|
|
else if (collectionView == self.newestMusicCollectionView) {
|
|
NSMutableArray *songArray = [NSMutableArray array];
|
|
NSMutableArray *songArray = [NSMutableArray array];
|
|
- NSInteger length = indexPath.item * 3 + 3 > self.newestMusicArray.count ? self.newestMusicArray.count - indexPath.item * 3: 3;
|
|
|
|
- NSRange range = NSMakeRange(indexPath.item * 3, length);
|
|
|
|
|
|
+ NSInteger length = indexPath.item * 4 + 4 > self.newestMusicArray.count ? self.newestMusicArray.count - indexPath.item * 4: 4;
|
|
|
|
+ NSRange range = NSMakeRange(indexPath.item * 4, length);
|
|
|
|
|
|
songArray = [NSMutableArray arrayWithArray:[self.newestMusicArray subarrayWithRange:range]];
|
|
songArray = [NSMutableArray arrayWithArray:[self.newestMusicArray subarrayWithRange:range]];
|
|
HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
|
|
HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
|
|
@@ -1362,8 +1380,8 @@
|
|
}
|
|
}
|
|
else if (collectionView == self.musicCollectionView) {
|
|
else if (collectionView == self.musicCollectionView) {
|
|
NSMutableArray *songArray = [NSMutableArray array];
|
|
NSMutableArray *songArray = [NSMutableArray array];
|
|
- NSInteger length = indexPath.item * 3 + 3 > self.musicArray.count ? self.musicArray.count - indexPath.item * 3: 3;
|
|
|
|
- NSRange range = NSMakeRange(indexPath.item * 3, length);
|
|
|
|
|
|
+ NSInteger length = indexPath.item * 4 + 4 > self.musicArray.count ? self.musicArray.count - indexPath.item * 4: 4;
|
|
|
|
+ NSRange range = NSMakeRange(indexPath.item * 4, length);
|
|
|
|
|
|
songArray = [NSMutableArray arrayWithArray:[self.musicArray subarrayWithRange:range]];
|
|
songArray = [NSMutableArray arrayWithArray:[self.musicArray subarrayWithRange:range]];
|
|
HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
|
|
HomeHotMusicCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeHotMusicCollectionCell" forIndexPath:indexPath];
|
|
@@ -1477,13 +1495,13 @@
|
|
return CGSizeMake(100, 134);
|
|
return CGSizeMake(100, 134);
|
|
}
|
|
}
|
|
else if (collectionView == self.recommendMusicCollectionView) {
|
|
else if (collectionView == self.recommendMusicCollectionView) {
|
|
- return CGSizeMake(KPortraitWidth * 0.83, 240);
|
|
|
|
|
|
+ return CGSizeMake(KPortraitWidth * 0.83, 320);
|
|
}
|
|
}
|
|
else if (collectionView == self.newestMusicCollectionView) {
|
|
else if (collectionView == self.newestMusicCollectionView) {
|
|
- return CGSizeMake(KPortraitWidth * 0.83, 240);
|
|
|
|
|
|
+ return CGSizeMake(KPortraitWidth * 0.83, 320);
|
|
}
|
|
}
|
|
else if (collectionView == self.musicCollectionView) {
|
|
else if (collectionView == self.musicCollectionView) {
|
|
- return CGSizeMake(KPortraitWidth * 0.83, 240);
|
|
|
|
|
|
+ return CGSizeMake(KPortraitWidth * 0.83, 320);
|
|
}
|
|
}
|
|
else if (collectionView == self.talentCollectionView) {
|
|
else if (collectionView == self.talentCollectionView) {
|
|
return CGSizeMake(110, 178);
|
|
return CGSizeMake(110, 178);
|