1.0.18 feat:调整 web 小游戏逻辑

This commit is contained in:
eggmanQQQ
2024-10-22 14:34:42 +08:00
parent 602789ab5c
commit 6bc081dbad
2 changed files with 19 additions and 19 deletions

View File

@@ -70,6 +70,11 @@
make.edges.mas_equalTo(self);
}];
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
[self addSubview:self.gameIcon];
[self.gameIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(44);
@@ -173,7 +178,6 @@
self.titleLabel.attributedText = attribute;
BOOL isSvga = [model.resourceType.uppercaseString isEqualToString:@"SVGA"];
@kWeakify(self);
if (isSvga == YES) {
@@ -192,7 +196,15 @@
}else{
self.bgSVGA.hidden = YES;
self.bgImageView.hidden = NO;
self.bgImageView.imageUrl = model.resourceContent;
@kWeakify(self);
[self.bgImageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
@kStrongify(self);
if (image) {
[self loadLocalSVGA];
} else {
self.bgImageView.image = image;
}
}];
}
}
@@ -222,7 +234,7 @@
#pragma mark -
- (NetImageView *)bgImageView {
if (_bgImageView) {
if (!_bgImageView) {
_bgImageView = [[NetImageView alloc] init];
_bgImageView.layer.cornerRadius = 2;
_bgImageView.layer.masksToBounds = YES;

View File

@@ -294,17 +294,7 @@ NSString * const kMSGameLoaded = @"gameLoaded";
#pragma mark - LeaderCC Delegate
//
- (void)closeGame:(NSDictionary*)args {
// NSLog(@"1234");
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.message = YMLocalizedString(@"MSRoomGameWebVC0");
config.actionStyle = TTAlertActionBothStyle;
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
[self willMoveToParentViewController:nil]; //1
[self.view removeFromSuperview]; //2
[self removeFromParentViewController]; //3
} cancelHandler:^{
}];
[self backBtnAction];
}
//
@@ -394,14 +384,12 @@ NSString * const kMSGameLoaded = @"gameLoaded";
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.message = YMLocalizedString(@"MSRoomGameWebVC0");
config.actionStyle = TTAlertActionBothStyle;
@kWeakify(self);
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
[self willMoveToParentViewController:nil]; //1
[self.view removeFromSuperview]; //2
[self removeFromParentViewController]; //3
@kStrongify(self);
[self destroy:nil];
} cancelHandler:^{
}];
}
//
- (void) gameRecharge:(NSDictionary*)args