MGRegisterViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. //
  2. // MGRegisterViewController.m
  3. // BuguLive
  4. //
  5. // Created by 宋晨光 on 2020/6/28.
  6. // Copyright © 2020 xfg. All rights reserved.
  7. //
  8. #import "MGRegisterViewController.h"
  9. #import "MGLoginTextBgView.h"
  10. #import "LPhoneRegistVC.h"
  11. #import <QPDialCodePickerView/QPDialCodePickerView.h>
  12. @interface MGRegisterViewController ()<UITextFieldDelegate>
  13. @property(nonatomic, strong) MGLoginTextBgView *countryView;;
  14. @property(nonatomic, strong) MGLoginTextBgView *phoneView;
  15. @property(nonatomic, strong) MGLoginTextBgView *codeView;
  16. @property(nonatomic, strong) MGLoginTextBgView *passwordView;
  17. @property(nonatomic, strong) MGLoginTextBgView *rePasswordView;
  18. @property(nonatomic, strong) NSString *curCode;
  19. @property(nonatomic, strong) UIButton *registerBtn;
  20. @property(nonatomic, strong) UIButton *agreeBtn;
  21. @end
  22. @implementation MGRegisterViewController{
  23. NSTimer *_timer; //定时器
  24. int _timeCount; //定时器时间
  25. }
  26. - (void)viewDidLoad {
  27. [super viewDidLoad];
  28. // Do any additional setup after loading the view.
  29. [self setUpView];
  30. [self setupBackBtnWithBlock:nil];
  31. self.view.backgroundColor = kWhiteColor;
  32. if (self.loginType == MGLOGIN_TYPE_REGISTER) {//注册账号
  33. self.title = ASLocalizedString(@"注册账号");
  34. [self.registerBtn setTitle:ASLocalizedString(@"完成注册")forState:UIControlStateNormal];
  35. }else if (self.loginType == MGLOGIN_TYPE_FINDPASSWORD){//找回密码
  36. self.title = ASLocalizedString(@"找回密码");
  37. [self.registerBtn setTitle:ASLocalizedString(@"确定")forState:UIControlStateNormal];
  38. self.agreeBtn.hidden = YES;
  39. }else if (self.loginType == MGLOGIN_TYPE_CODELOGIN){//验证码登录
  40. self.title = ASLocalizedString(@"验证码登录");
  41. self.passwordView.hidden = self.rePasswordView.hidden = YES;
  42. self.registerBtn.top = self.codeView.bottom + kRealValue(30);
  43. [self.registerBtn setTitle:ASLocalizedString(@"登录")forState:UIControlStateNormal];
  44. }
  45. }
  46. - (instancetype)initWithLoginType:(MGLOGIN_TYPE)loginType{
  47. MGRegisterViewController *vc = [MGRegisterViewController new];
  48. vc.loginType = loginType;
  49. return vc;
  50. }
  51. - (void)viewWillAppear:(BOOL)animated {
  52. [super viewWillAppear:animated];
  53. // [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDarkContent];
  54. }
  55. - (void)viewWillDisappear:(BOOL)animated {
  56. [super viewWillDisappear:animated];
  57. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
  58. }
  59. -(void)setUpView{
  60. _timeCount = 60;
  61. CGFloat viewHeight = kRealValue(57);
  62. WeakSelf
  63. self.countryView = [[MGLoginTextBgView alloc]initWithFrame:CGRectMake(0, kRealValue(20), kScreenW, viewHeight)];
  64. // if (self.loginType == MGLOGIN_TYPE_REGISTER || self.loginType == MGLOGIN_TYPE_CODELOGIN) {
  65. [self.view addSubview:self.countryView];
  66. // }else{
  67. // self.countryView.top = self.countryView.height = 0;
  68. // }
  69. self.phoneView = [[MGLoginTextBgView alloc]initWithFrame:CGRectMake(0, self.countryView.bottom + kRealValue(5), kScreenW, viewHeight)];
  70. self.phoneView.textField.delegate = self;
  71. [self.phoneView.textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
  72. self.codeView = [[MGLoginTextBgView alloc]initWithFrame:CGRectMake(0,
  73. self.phoneView.bottom + kRealValue(5), kScreenW, viewHeight)];
  74. self.codeView.clickCodeBtnBlock = ^(BOOL clickRegister) {
  75. [weakSelf loginCodeBtn];
  76. };
  77. self.passwordView = [[MGLoginTextBgView alloc]initWithFrame:CGRectMake(0, self.codeView.bottom, kScreenW, viewHeight)];
  78. self.rePasswordView = [[MGLoginTextBgView alloc]initWithFrame:CGRectMake(0, self.passwordView.bottom, kScreenW, viewHeight)];
  79. [self.countryView setUpTextViewWithPlaceholder:@"" text:ASLocalizedString(@"中国大陆 +86")showRightBtn:YES type:MGREGISTER_VIEW_TYPE_COUNTRY];
  80. [self.phoneView setUpTextViewWithPlaceholder:ASLocalizedString(@"请输入手机号")text:@"" showRightBtn:NO type:MGREGISTER_VIEW_TYPE_PHONE];
  81. [self.codeView setUpTextViewWithPlaceholder:ASLocalizedString(@"请输入验证码")text:@"" showRightBtn:YES type:MGREGISTER_VIEW_TYPE_CODE];
  82. [self.passwordView setUpTextViewWithPlaceholder:ASLocalizedString(@"请输入密码")text:@"" showRightBtn:NO type:MGREGISTER_VIEW_TYPE_PASSWORD];
  83. [self.rePasswordView setUpTextViewWithPlaceholder:ASLocalizedString(@"再次输入密码")text:@"" showRightBtn:NO type:MGREGISTER_VIEW_TYPE_REPASSWORD];
  84. self.passwordView.textField.secureTextEntry = YES;
  85. self.rePasswordView.textField.secureTextEntry = YES;
  86. //添加手势
  87. UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGestureRecognizer)];
  88. [self.countryView addGestureRecognizer:tapGesture];
  89. [self.view addSubview:self.phoneView];
  90. [self.view addSubview:self.codeView];
  91. [self.view addSubview:self.rePasswordView];
  92. [self.view addSubview:self.passwordView];
  93. self.registerBtn.frame = CGRectMake(kRealValue(20), self.rePasswordView.bottom + kRealValue(15), kScreenW - kRealValue(20 * 2), kRealValue(44));
  94. _registerBtn.layer.cornerRadius = kRealValue(44 / 2);
  95. [self.view addSubview:self.registerBtn];
  96. self.agreeBtn.frame = CGRectMake(self.registerBtn.left, self.registerBtn.bottom + kRealValue(15), kScreenW - self.registerBtn.left * 2, kRealValue(20));
  97. [self.view addSubview:self.agreeBtn];
  98. }
  99. //iOS 13以上
  100. //-(void)textFieldDidChangeSelection:(UITextField *)textField{
  101. //
  102. //
  103. // if (self.phoneView.textField.text.length < 1 && [self.countryView.textField.text containsString:@"中国"])
  104. // {
  105. //
  106. //// if (textField == self.mobileTF) {
  107. // if (self.phoneView.textField.text.length > 11) {
  108. // [FanweMessage alertHUD:ASLocalizedString(@"手机号限制11位数!")];
  109. // self.phoneView.textField.text = [self.phoneView.textField.text substringToIndex:11];
  110. // }
  111. // }
  112. //}
  113. - (void)handleTapGestureRecognizer {
  114. [self.view endEditing:YES];
  115. __weak typeof (MGLoginTextBgView*) weakCountryView = self.countryView;
  116. QPDialCodePickerView *pickerView = [[QPDialCodePickerView alloc] initWithAreaFormat:QPDialCodeAreaNameFormatCurrentLocale complete:^(QPDialCodeObject *item) {
  117. self.curCode = item.dial_code;
  118. [weakCountryView setUpTextViewWithPlaceholder:@"" text:[NSString stringWithFormat:@"%@ +%@",item.area_name,item.dial_code] showRightBtn:YES type:MGREGISTER_VIEW_TYPE_COUNTRY];
  119. // [weakBtn setTitle:[NSString stringWithFormat:@"+%@", item.dial_code] forState:UIControlStateNormal];
  120. }];
  121. pickerView.roundCorner = YES;
  122. [pickerView show];
  123. }
  124. -(void)clickBtn:(UIButton *)sender{
  125. if (self.phoneView.textField.text.length < 1 && [self.countryView.textField.text containsString:@"中国"])
  126. {
  127. [FanweMessage alert:ASLocalizedString(@"手机号限制11位数!")];
  128. return;
  129. }
  130. if ([BGUtils isBlankString:self.codeView.textField.text]) {
  131. [FanweMessage alertHUD:ASLocalizedString(@"请输入验证码")];
  132. return;
  133. }
  134. if (self.loginType == MGLOGIN_TYPE_REGISTER) {
  135. if ([BGUtils isBlankString:self.phoneView.textField.text]) {
  136. [FanweMessage alertHUD:ASLocalizedString(@"请输入密码")];
  137. return;
  138. }
  139. if (![self.passwordView.textField.text isEqualToString:self.rePasswordView.textField.text]) {
  140. [FanweMessage alertHUD:ASLocalizedString(@"两次密码输入不一致")];
  141. return;
  142. }
  143. [self clickRegister];
  144. }else if (self.loginType == MGLOGIN_TYPE_FINDPASSWORD){
  145. if ([BGUtils isBlankString:self.phoneView.textField.text]) {
  146. [FanweMessage alertHUD:ASLocalizedString(@"请输入密码")];
  147. return;
  148. }
  149. if (![self.passwordView.textField.text isEqualToString:self.rePasswordView.textField.text]) {
  150. [FanweMessage alertHUD:ASLocalizedString(@"两次密码输入不一致")];
  151. return;
  152. }
  153. [self clickFindPassword];
  154. }else if (self.loginType == MGLOGIN_TYPE_CODELOGIN){
  155. [self loginByPhone];
  156. }
  157. }
  158. #pragma mark 手机登录
  159. - (void)loginByPhone
  160. {
  161. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  162. [parmDict setObject:@"login" forKey:@"ctl"];
  163. [parmDict setObject:@"do_login" forKey:@"act"];
  164. [parmDict setObject:self.phoneView.textField.text forKey:@"mobile"];
  165. [parmDict setObject:self.codeView.textField.text forKey:@"verify_coder"];
  166. FWWeakify(self)
  167. [self showMyHud];
  168. [self.httpsManager POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson)
  169. {
  170. FWStrongify(self)
  171. [self hideMyHud];
  172. if ([responseJson toInt:@"status"] == 1)
  173. {
  174. self.BuguLive.appModel.new_level = [responseJson toInt:@"new_level"];
  175. self.BuguLive.appModel.first_login = [responseJson toString:@"first_login"];
  176. self.BuguLive.appModel.login_send_score = [responseJson toString:@"login_send_score"];
  177. if ([responseJson toInt:@"is_lack"] == 1)
  178. {
  179. LPhoneRegistVC *phoneRegist = [[LPhoneRegistVC alloc]init];
  180. phoneRegist.used_id = [responseJson toString:@"user_id"];
  181. phoneRegist.userInfoDic = responseJson[@"user_info"];
  182. phoneRegist.userName = [responseJson[@"user_info"] toString:@"nick_name"];
  183. NSDictionary *userDic = [responseJson valueForKey:@"user_info"];
  184. [GlobalVariables sharedInstance].token = [userDic toString:@"token"];
  185. // [[AppDelegate sharedAppDelegate]pushViewController:phoneRegist];
  186. [self.navigationController presentViewController:phoneRegist animated:YES completion:nil];
  187. }
  188. else
  189. {
  190. [self showMyHud];
  191. [BGIMLoginManager sharedInstance].loginParam.identifier = [responseJson toString:@"user_id"];
  192. [BGIMLoginManager sharedInstance].loginParam.isAgree = [responseJson toInt:@"is_agree"];
  193. NSDictionary *userDic = [responseJson valueForKey:@"user_info"];
  194. [BGIMLoginManager sharedInstance].loginParam.identifier = [responseJson toString:@"user_id"];
  195. [BGIMLoginManager sharedInstance].loginParam.isAgree = [responseJson toInt:@"is_agree"];
  196. [GlobalVariables sharedInstance].token = [userDic toString:@"token"];
  197. [[BGIMLoginManager sharedInstance] getUserSig:^{
  198. [[AppDelegate sharedAppDelegate] enterMainUI];
  199. [self hideMyHud];
  200. } failed:^(int errId, NSString *errMsg) {
  201. [self hideMyHud];
  202. }];
  203. }
  204. }
  205. } FailureBlock:^(NSError *error)
  206. {
  207. FWStrongify(self)
  208. [self hideMyHud];
  209. }];
  210. }
  211. -(void)clickRegister{
  212. // LPhoneRegistVC *phoneRegist = [[LPhoneRegistVC alloc]init];
  213. // phoneRegist.used_id = @"";
  214. //// [responseJson toString:@"user_id"];
  215. //// phoneRegist.userInfoDic = @"12312";
  216. // phoneRegist.userName = @"123132";
  217. //// [[AppDelegate sharedAppDelegate]pushViewController:phoneRegist];
  218. // [self.navigationController presentViewController:phoneRegist animated:YES completion:nil];
  219. //
  220. //
  221. // return;
  222. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  223. [parmDict setObject:@"login" forKey:@"ctl"];
  224. [parmDict setObject:@"password_registered" forKey:@"act"];
  225. [parmDict setObject:self.phoneView.textField.text forKey:@"mobile"];
  226. [parmDict setObject:self.codeView.textField.text forKey:@"verify_coder"];
  227. [parmDict setObject:self.passwordView.textField.text forKey:@"password"];
  228. [parmDict setObject:self.rePasswordView.textField.text forKey:@"confirm_password"];
  229. [self showMyHud];
  230. FWWeakify(self)
  231. [[NetHttpsManager manager] POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson) {
  232. FWStrongify(self)
  233. if ([responseJson toInt:@"status"] == 1)
  234. {
  235. [BGIMLoginManager sharedInstance].loginParam.identifier = [[responseJson objectForKey:@"user_info"] toString:@"user_id"];
  236. [BGIMLoginManager sharedInstance].loginParam.isAgree = [[responseJson objectForKey:@"user"] toInt:@"is_agree"];
  237. self.BuguLive.appModel.first_login = [responseJson toString:@"first_login"];
  238. self.BuguLive.appModel.new_level = [responseJson toInt:@"new_level"];
  239. self.BuguLive.appModel.login_send_score = [responseJson toString:@"login_send_score"];
  240. NSDictionary *userDic = [responseJson valueForKey:@"user_info"];
  241. [GlobalVariables sharedInstance].token = [userDic toString:@"token"];
  242. [[BGIMLoginManager sharedInstance] getUserSig:^{
  243. [[AppDelegate sharedAppDelegate] enterMainUI];
  244. // LPhoneRegistVC *phoneRegist = [[LPhoneRegistVC alloc]init];
  245. // phoneRegist.used_id = [responseJson toString:@"user_id"];
  246. // phoneRegist.userInfoDic = responseJson[@"user_info"];
  247. // phoneRegist.userName = [responseJson[@"user_info"] toString:@"nick_name"];
  248. //// [[AppDelegate sharedAppDelegate]pushViewController:phoneRegist];
  249. // [self.navigationController presentViewController:phoneRegist animated:YES completion:nil];
  250. [self hideMyHud];
  251. } failed:^(int errId, NSString *errMsg) {
  252. [self hideMyHud];
  253. }];
  254. }
  255. else
  256. {
  257. [self hideMyHud];
  258. }
  259. } FailureBlock:^(NSError *error) {
  260. FWStrongify(self)
  261. [self hideMyHud];
  262. }];
  263. }
  264. //找回密码\修改密码
  265. -(void)clickFindPassword{
  266. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  267. [parmDict setObject:@"login" forKey:@"ctl"];
  268. [parmDict setObject:@"update_password" forKey:@"act"];
  269. [parmDict setObject:self.phoneView.textField.text forKey:@"mobile"];
  270. [parmDict setObject:self.codeView.textField.text forKey:@"verify_coder"];
  271. [parmDict setObject:self.passwordView.textField.text forKey:@"password"];
  272. [parmDict setObject:self.rePasswordView.textField.text forKey:@"confirm_password"];
  273. [self showMyHud];
  274. FWWeakify(self)
  275. [[NetHttpsManager manager] POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson) {
  276. FWStrongify(self)
  277. if ([responseJson toInt:@"status"] == 1)
  278. {
  279. [FanweMessage alertHUD:ASLocalizedString(@"修改密码成功")];
  280. [self hideMyHud];
  281. }
  282. else
  283. {
  284. [self hideMyHud];
  285. }
  286. } FailureBlock:^(NSError *error) {
  287. FWStrongify(self)
  288. [self hideMyHud];
  289. }];
  290. }
  291. //点击获取验证码
  292. -(void)loginCodeBtn{
  293. if (self.phoneView.textField.text.length < 1 && [self.countryView.textField.text containsString:@"中国"])
  294. {
  295. [FanweMessage alert:ASLocalizedString(@"手机号限制11位数!")];
  296. return;
  297. }
  298. self.codeView.codeBtn.enabled = NO;
  299. _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timego) userInfo:nil repeats:YES];
  300. [self timego];
  301. FWWeakify(self)
  302. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  303. [parmDict setObject:@"login" forKey:@"ctl"];
  304. [parmDict setObject:@"send_mobile_verify_international" forKey:@"act"];
  305. [parmDict setObject:[NSString stringWithFormat:@"%@",self.curCode] forKey:@"area_code"];
  306. // [parmDict setObject:@"1" forKey:@"wx_binding"];
  307. [parmDict setObject:[NSString stringWithFormat:@"%@", self.phoneView.textField.text] forKey:@"mobile"];
  308. // [parmDict setObject:self.phoneView.textField.text forKey:@"mobile"];
  309. [self showMyHud];
  310. [self.httpsManager POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson)
  311. {
  312. FWStrongify(self)
  313. [self hideMyHud];
  314. [GlobalVariables sharedInstance].otp_message_id = [NSString stringWithFormat:@"%@",[responseJson toString:@"otp_message_id"]];
  315. if ([responseJson toInt:@"status"] != 1)
  316. {
  317. self.codeView.codeBtn.enabled = YES;
  318. [self.codeView.codeBtn setTitle:ASLocalizedString(@"发送验证码")forState:UIControlStateNormal];
  319. [_timer invalidate];
  320. _timer = nil;
  321. }
  322. } FailureBlock:^(NSError *error) {
  323. FWStrongify(self)
  324. [self hideMyHud];
  325. [self.codeView.codeBtn setTitle:ASLocalizedString(@"发送验证码")forState:UIControlStateNormal];
  326. [FanweMessage alert:ASLocalizedString(@"发送失败")];
  327. self.codeView.codeBtn.enabled = YES;
  328. }];
  329. }
  330. #pragma mark 获取验证码的倒计时
  331. - (void)timego
  332. {
  333. [self timerDec:_timeCount];
  334. }
  335. -(void)textFieldDidChangeSelection:(UITextField *)textField{
  336. if (textField == self.phoneView.textField && [self.countryView.textField.text containsString:@"中国"]) {
  337. if (textField.text.length > 11) {
  338. [FanweMessage alertHUD:ASLocalizedString(@"手机号限制11位数!")];
  339. textField.text = [textField.text substringToIndex:11];
  340. }
  341. }
  342. }
  343. - (void)textFieldDidChange:(UITextField *)textField{
  344. if (textField == self.phoneView.textField && [self.countryView.textField.text containsString:@"中国"]) {
  345. if (textField.text.length > 11) {
  346. [FanweMessage alertHUD:ASLocalizedString(@"手机号限制11位数!")];
  347. textField.text = [textField.text substringToIndex:11];
  348. }
  349. }
  350. }
  351. - (void)timerDec:(NSInteger)time
  352. {
  353. if(time > 0)
  354. {
  355. [self.codeView.codeBtn setTitle:[NSString stringWithFormat:ASLocalizedString(@"重新获取(%lds)"),(long)time] forState:UIControlStateDisabled];
  356. // [self.loginView.codeBtn setTitleColor:kAppGrayColor1 forState:UIControlStateDisabled];
  357. _timeCount --;
  358. }else if(time == 0)
  359. {
  360. self.codeView.codeBtn.enabled = YES;
  361. [self.codeView.codeBtn setTitle:[NSString stringWithFormat:ASLocalizedString(@"获取验证码")] forState:UIControlStateNormal];
  362. [_timer invalidate];
  363. _timeCount = 60;
  364. }
  365. }
  366. -(UIButton *)registerBtn{
  367. if (!_registerBtn) {
  368. _registerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  369. [_registerBtn setTitle:ASLocalizedString(@"完成注册")forState:UIControlStateNormal];
  370. _registerBtn.titleLabel.font = [UIFont systemFontOfSize:15];
  371. [_registerBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  372. [_registerBtn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside];
  373. [_registerBtn setBackgroundImage:[UIImage imageNamed:@"mg_button_global"] forState:UIControlStateNormal];
  374. _registerBtn.layer.masksToBounds = YES;
  375. }
  376. return _registerBtn;
  377. }
  378. -(UIButton *)agreeBtn{
  379. if (!_agreeBtn) {
  380. _agreeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  381. NSString *firstStr = ASLocalizedString(@"登录即代表你同意");
  382. NSString *secondStr = ASLocalizedString(@"《用户隐私政策》");
  383. NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%@",firstStr,secondStr]];
  384. [attributeString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#646464"] range:NSMakeRange(0, firstStr.length)];
  385. [attributeString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#9E63FE"] range:NSMakeRange(firstStr.length, secondStr.length)];
  386. _agreeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
  387. [_agreeBtn setAttributedTitle:attributeString forState:UIControlStateNormal];
  388. _agreeBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
  389. [_agreeBtn addTarget:self action:@selector(clickAgreement:) forControlEvents:UIControlEventTouchUpInside];
  390. }
  391. return _agreeBtn;
  392. }
  393. -(void)clickAgreement:(UIButton *)sender{
  394. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:self.BuguLive.appModel.privacy_link isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  395. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  396. }
  397. - (UIStatusBarStyle)preferredStatusBarStyle{
  398. if (@available(iOS 13, *)) {
  399. return UIStatusBarStyleDarkContent;
  400. }
  401. return UIStatusBarStyleDefault;
  402. }
  403. @end