| | |
| | | } |
| | | |
| | | - (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"]]; |
| | |
| | | [[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]; |
| | | } |
| | | } |
| | | } |
| | |
| | | - (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 { |