直接跳转淘宝

This commit is contained in:
kai60
2021-10-15 13:06:02 +08:00
parent 22673fef3d
commit cb537f1949
8 changed files with 11 additions and 19 deletions
@@ -97,22 +97,14 @@ Strong UILabel *subTitleLabel;
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"需要定位权限才能获取wifi信息给设备配网,来添加设备" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ok = [UIAlertAction actionWithTitle:@"打开定位" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if([[UIApplication sharedApplication] canOpenURL:url]) {
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}else {
[[UIApplication sharedApplication] openURL:url];
}
}
UIAlertAction *ok = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self.navigationController popViewControllerAnimated:YES];
}];
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[self.navigationController popViewControllerAnimated:YES];
}];
[alert addAction:ok];
[alert addAction:cancel];
//[alert addAction:cancel];
[self presentViewController:alert animated:YES completion:nil];