al
liurenjie
2021-07-24 4be386d6c552eed17d7e8b2271c81ac65e02cebf
BuWanVideo2.0/PPTVController.m
@@ -86,7 +86,9 @@
}
- (void)refrshData {
   @ weakify(self)
    [[YTHNetInterface startInterface] getLoginUserInfoWithUid:[YTHsharedManger startManger].Uid WithSystem:@"1" WithLoginUid:[[NSUserDefaults standardUserDefaults] objectForKey:@"LoginUid"] withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        @strongify(self)
        if (isSuccessful) {
            //首先判断数据是否获成功
            NSString *err = [NSString stringWithFormat:@"%@",[result objectForKey:@"Error"]];
@@ -94,12 +96,12 @@
                [[NSUserDefaults standardUserDefaults] setObject:[result objectForKey:@"Data"] forKey:@"buUserInfo"];
                [[NSUserDefaults standardUserDefaults] synchronize];
                
                [_webView removeFromSuperview];
                _webView.DSUIDelegate = nil;
                _webView.navigationDelegate = nil;
                _webView = nil;
                [self.webView removeFromSuperview];
                self.webView.DSUIDelegate = nil;
                self.webView.navigationDelegate = nil;
                self.webView = nil;
                [self.view addSubview:self.webView];
                [self loadWebView:_content];
                [self loadWebView:self.content];
            }
        }
    }
@@ -231,6 +233,17 @@
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation {
    [self jsAdds];
    [self performSelector:@selector(afterDelay) withObject:nil afterDelay:0.5];
    NSString *vid = [self getParamByName:@"vid" URLString:_content];
    NSString *cid = [self getParamByName:@"cid" URLString:_content];
    [[YTHNetInterface startInterface] fetchPPTVVideoPlayStateWith:[YTHsharedManger startManger].Uid WithSystem:@"1" WithLoginUid:[[NSUserDefaults standardUserDefaults] objectForKey:@"LoginUid"] url:_content vid:vid cid:cid withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
            if (result[@"Data"][@"title"]) {
                self.viewPPTVNav.name = result[@"Data"][@"title"];
            }
        }
    }];
}
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void(^)(WKNavigationActionPolicy))decisionHandler {