Commit f94730fe authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

box webVC

parent aaad9fcf
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<key>GYDemo.xcscheme_^#shared#^_</key> <key>GYDemo.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>7</integer> <integer>6</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -69,8 +69,26 @@ ...@@ -69,8 +69,26 @@
} }
- (void)setBoxModel:(GYOpenBoxModel *)boxModel{ - (void)setBoxModel:(GYOpenBoxModel *)boxModel{
//奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 现金红包 //boxModel 1 种子 2 金币 3 加速剂
_boxModel = boxModel; _boxModel = boxModel;
self.dataSource = [NSMutableArray new];
switch (_boxModel.type) {
case 1:
self.dataSource = _boxModel.seeds;
break;
case 2:
[self.dataSource addObject:[GYExtModel new]];
break;
case 3:
[self.dataSource addObject:[GYExtModel new]];
break;
default:
break;
}
_giftHeaderImv.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_header_%ld", (long)(_boxModel.type+2)]];
[self.giftBgView bringSubviewToFront:self.collectionView];
[self.collectionView reloadData];
} }
- (void)setWheelSurfModel:(GYWheelSurfModel *)wheelSurfModel{ - (void)setWheelSurfModel:(GYWheelSurfModel *)wheelSurfModel{
...@@ -85,10 +103,7 @@ ...@@ -85,10 +103,7 @@
[self.dataSource addObject:[GYExtModel new]]; [self.dataSource addObject:[GYExtModel new]];
break; break;
case 5: case 5:
[self.dataSource addObject:[GYExtModel new]];
break;
case 6:
break; break;
default: default:
break; break;
...@@ -150,7 +165,7 @@ ...@@ -150,7 +165,7 @@
//item的大小 //item的大小
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{ {
return CGSizeMake(collectionView.frame.size.width/self.dataSource.count, 108); return CGSizeMake(collectionView.frame.size.width/self.dataSource.count, 120);
} }
//区头的大小 //区头的大小
...@@ -186,13 +201,31 @@ ...@@ -186,13 +201,31 @@
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{ {
GYGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GYGiftCell" forIndexPath:indexPath]; GYGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GYGiftCell" forIndexPath:indexPath];
GYExtModel * model = self.dataSource[indexPath.row]; if (_boxModel) {
if (_wheelSurfModel.awardType == 4) { GYExtModel * model = self.dataSource[indexPath.row];
cell.giftImv.image = [UIImage imageNamed:@"gift_gold"]; if (_boxModel.type == 2) {
cell.numLab.text = [NSString stringWithFormat:@"+%@", _wheelSurfModel.awardNum]; cell.giftImv.image = [UIImage imageNamed:@"gift_gold"];
}else if (_wheelSurfModel.awardType == 4){ cell.numLab.text = [NSString stringWithFormat:@"+%ld", (long)_boxModel.awardNum];
cell.giftImv.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_seed_%ld", model.id]]; }else if (_boxModel.type == 1){
cell.numLab.text = [NSString stringWithFormat:@"+%ld", model.num]; cell.giftImv.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_seed_%ld", model.id]];
cell.numLab.text = [NSString stringWithFormat:@"+%ld", model.num];
}else{
cell.giftImv.image = [UIImage imageNamed:@"gift_accelerator"];
cell.numLab.text = [NSString stringWithFormat:@"+%ld", (long)_boxModel.awardNum];
}
}else{
GYExtModel * model = self.dataSource[indexPath.row];
if (_wheelSurfModel.awardType == 4) {
cell.giftImv.image = [UIImage imageNamed:@"gift_gold"];
cell.numLab.text = [NSString stringWithFormat:@"+%@", _wheelSurfModel.awardNum];
}else if (_wheelSurfModel.awardType == 3){
cell.giftImv.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_seed_%ld", model.id]];
cell.numLab.text = [NSString stringWithFormat:@"+%ld", model.num];
}else if (_wheelSurfModel.awardType == 5){
cell.giftImv.image = [UIImage imageNamed:@"gift_accelerator"];
cell.numLab.text = [NSString stringWithFormat:@"+%@", _wheelSurfModel.awardNum];
}
} }
return cell; return cell;
} }
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#import "GYTaskAlertView.h" #import "GYTaskAlertView.h"
#import "GYOrderInfoModel.h" #import "GYOrderInfoModel.h"
#import "GYOrderAlertView.h" #import "GYOrderAlertView.h"
#import "GYOpenBoxModel.h"
#import "GYGiftAlertView.h"
UnityFramework* UnityFrameworkLoad() UnityFramework* UnityFrameworkLoad()
...@@ -192,6 +193,31 @@ NSDictionary* appLaunchOpts; ...@@ -192,6 +193,31 @@ NSDictionary* appLaunchOpts;
// 获得宝箱点击观看视频 // 获得宝箱点击观看视频
- (void)ios_adFlyBox { - (void)ios_adFlyBox {
[[CGNetworkTools shared] postWithAction:OpenBox parameters:@{} success:^(id _Nonnull response) {
if ([[response objectForKey:@"status"] integerValue] == 200) {
NSDictionary *dic = [[response objectForKey:@"result"] objectForKey:@"data"];
GYOpenBoxModel * model = [GYOpenBoxModel new];
[model setValuesForKeysWithDictionary:dic];
model.seeds = [[NSMutableArray alloc] init];
for (NSDictionary * seed in model.seedList) {
GYExtModel * seedModel = [[GYExtModel alloc] init];
[seedModel setValuesForKeysWithDictionary:seed];
[model.seeds addObject:seedModel];
}
GYGiftAlertView * gift = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([GYGiftAlertView class]) owner:self options:nil].firstObject;
gift.boxModel = model;
gift.frame = [[self ufw] appController].window.bounds;
[[[self ufw] appController].window addSubview:gift];
[gift show:nil];
}
} failure:^(NSError * _Nonnull error) {
}];
} }
// ====================== 获取收据 接口回调 ====================== // ====================== 获取收据 接口回调 ======================
...@@ -384,14 +410,14 @@ NSDictionary* appLaunchOpts; ...@@ -384,14 +410,14 @@ NSDictionary* appLaunchOpts;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
// [self initUnity]; [ZJGuideConfig configWithWindow:self.window finishMainVC: nil showGuide:^(BOOL result) {
[ZJGuideConfig configWithWindow:self.window finishMainVC: tempVC showGuide:^(BOOL result) {
// dispatch_async(dispatch_get_global_queue(0, 0), ^{ // dispatch_async(dispatch_get_global_queue(0, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self initUnity];
[[[self ufw] appController].window makeKeyAndVisible];
}); });
// }); // });
}]; }];
[self initUnity];
return YES; return YES;
} }
......
...@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger awardNum; @property (nonatomic, assign) NSInteger awardNum;
@property (nonatomic, assign) NSInteger boxSumNum; @property (nonatomic, assign) NSInteger boxSumNum;
@property (nonatomic, assign) NSInteger type; @property (nonatomic, assign) NSInteger type;
@property (nonatomic, strong) NSDictionary * seedList;
@property (nonatomic, strong) NSMutableArray * seeds;
@end @end
......
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
- (void)dealloc { - (void)dealloc {
[_webView removeObserver:self forKeyPath:@"estimatedProgress"]; [_webView removeObserver:self forKeyPath:@"estimatedProgress"];
[_webView.configuration.userContentController removeScriptMessageHandlerForName:@"CommitFinished"]; [_webView.configuration.userContentController removeScriptMessageHandlerForName:@"backTrack"];
} }
......
...@@ -3,22 +3,4 @@ ...@@ -3,22 +3,4 @@
uuid = "28FAD1AB-5A9D-4768-93A5-B3F5FCE13BA3" uuid = "28FAD1AB-5A9D-4768-93A5-B3F5FCE13BA3"
type = "0" type = "0"
version = "2.0"> version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "71AC211B-8804-438F-8F24-6708336CDA23"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GYDemo/GYDemo/ViewController/GYWebViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "187"
endingLineNumber = "187"
landmarkName = "-userContentController:didReceiveScriptMessage:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket> </Bucket>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<key>UnityFramework.xcscheme_^#shared#^_</key> <key>UnityFramework.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>6</integer> <integer>7</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment