MySetViewController.m 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. //
  2. // MySetViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by APPLE on 2023/8/17.
  6. //
  7. #import "MySetViewController.h"
  8. #import <SDWebImage.h>
  9. #import <Masonry.h>
  10. #import "HelpDownScrollView.h"
  11. #import "MineViewCell.h"
  12. #import "ChangeLogoViewController.h"
  13. #import "HidenMaskSetViewController.h"
  14. #import "CustomerWebViewController.h"
  15. #import "AboutViewController.h"
  16. #import "iPhone.h"
  17. #import "CloudPhoneAPI.h"
  18. #import "ComontAlretViewController.h"
  19. #import "ModifyPWDFirstViewController.h"
  20. #import "TipsQRCodeForChangeDeviceViewController.h"
  21. @interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
  22. {
  23. UILabel *phoneLabel;
  24. UILabel *vipTypeTipsLabel;
  25. }
  26. @property (nonatomic, strong, nullable) UITableView *tableView;
  27. @end
  28. @implementation MySetViewController
  29. - (void)viewDidLoad {
  30. [super viewDidLoad];
  31. // Do any additional setup after loading the view.
  32. [self drawAnyView];
  33. }
  34. - (void)drawAnyView{
  35. [self.view setBackgroundColor:HWF5F7FAColor];
  36. [self.toolBar setHidden:YES];
  37. [self.navigationBar setHidden:YES];
  38. [self.navBarBGView setHidden:NO];
  39. [self.titleLabel setText:NSLocalizedString(@"more_set",nil)];
  40. [self.view addSubview:self.tableView];
  41. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.left.mas_equalTo(0);
  43. make.right.mas_equalTo(0);
  44. make.bottom.mas_equalTo(0);
  45. make.top.equalTo(self.navBarBGView.mas_bottom).offset(5.f);
  46. }];
  47. }
  48. - (UIView *)tableFoorView{
  49. UIView *bgView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, SCREEN_W, 68.f))];
  50. [bgView setBackgroundColor:[UIColor clearColor]];
  51. UIButton *tvP2PBtn = [[UIButton alloc] initWithFrame:(CGRectMake(15, 20, SCREEN_W - 2*15.f, 48.f))];
  52. [tvP2PBtn setBackgroundColor:HWFFFFFFColor];
  53. [tvP2PBtn setTitle:NSLocalizedString(@"my_set_no_TV_p2p",nil) forState:(UIControlStateNormal)];
  54. [tvP2PBtn setTitleColor:HW0A132BColor forState:(UIControlStateNormal)];
  55. [tvP2PBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:14.f]];
  56. [tvP2PBtn addTarget:self
  57. action:@selector(tvP2PBtnPressed)
  58. forControlEvents:(UIControlEventTouchUpInside)];
  59. [tvP2PBtn.layer setCornerRadius:8.f];
  60. [bgView addSubview:tvP2PBtn];
  61. return bgView;
  62. }
  63. - (void)tvP2PBtnPressed{
  64. ;
  65. }
  66. /*
  67. #pragma mark - Navigation
  68. // In a storyboard-based application, you will often want to do a little preparation before navigation
  69. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  70. // Get the new view controller using [segue destinationViewController].
  71. // Pass the selected object to the new view controller.
  72. }
  73. */
  74. - (void)helpDownScrollViewBePressed:(nonnull id)sender withIndex:(NSInteger)index {
  75. HLog(@"\n----点击了第个%ld按钮----",index);
  76. if (index == 0){
  77. ChangeLogoViewController *nextVC = [[ChangeLogoViewController alloc] init];
  78. [self.navigationController pushViewController:nextVC animated:YES];
  79. }else if (index == 1){/**/
  80. HidenMaskSetViewController *nextVC = [[HidenMaskSetViewController alloc] init];
  81. [self.navigationController pushViewController:nextVC animated:YES];
  82. }
  83. }
  84. #pragma mark - 懒加载
  85. - (UITableView *)tableView{
  86. if (!_tableView) {
  87. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  88. _tableView.delegate = self;
  89. _tableView.dataSource = self;
  90. _tableView.showsVerticalScrollIndicator = NO;
  91. _tableView.showsHorizontalScrollIndicator = NO;
  92. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  93. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  94. [_tableView setSeparatorColor:[UIColor clearColor]];
  95. [_tableView setBackgroundColor:[UIColor clearColor]];
  96. [_tableView setTableFooterView:[UIView new]];
  97. [_tableView setBounces:YES];
  98. if (@available(iOS 15.0, *)) {
  99. _tableView.sectionHeaderTopPadding = 0;
  100. }
  101. //TV投屏 阿胡说暂不做
  102. //[_tableView setTableFooterView:[self tableFoorView]];
  103. }
  104. return _tableView;
  105. }
  106. #pragma mark - 列表委托
  107. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  108. return 1;
  109. }
  110. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  111. //return 7;
  112. return 6;//去掉隐藏进程
  113. }
  114. - (MineViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  115. NSInteger row = indexPath.row;
  116. static NSString *identifier = @"MineViewCell";
  117. MineViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  118. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  119. if (!cell){
  120. cell = [[MineViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  121. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  122. [cell setBackgroundColor:[UIColor clearColor]];
  123. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  124. }
  125. [cell.bgViewLayer removeFromSuperlayer];
  126. [cell.titleLabel2 setHidden:YES];
  127. [cell.rightImage setHidden:NO];
  128. [cell.lineView setHidden:NO];
  129. [cell.maskSwitch setHidden:YES];
  130. if (row == 0){
  131. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_modify_pwd",nil)];
  132. [cell.mImageView setImage:[UIImage imageNamed:@"mdoify_pwd"]];
  133. /*上圆角*/
  134. //设置部分圆角 贝塞尔曲线
  135. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
  136. byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
  137. cornerRadii:CGSizeMake(8, 8)];
  138. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  139. maskLayer.frame = cell.cellBgView.bounds;
  140. maskLayer.path = maskPath.CGPath;
  141. cell.bgViewLayer = maskLayer;
  142. cell.cellBgView.layer.mask = cell.bgViewLayer;
  143. }else if (row == 1){
  144. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_change_logo",nil)];
  145. [cell.mImageView setImage:[UIImage imageNamed:@"icon_change_logo"]];
  146. // }else if (row == 2){
  147. // [cell.titleLabel setText:NSLocalizedString(@"mask_view_hiden_set_hiden",nil)];
  148. // [cell.mImageView setImage:[UIImage imageNamed:@"icon-jincheng"]];
  149. // }else if (row == 3){
  150. }else if (row == 2){
  151. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_fanzhuan_exit",nil)];
  152. [cell.mImageView setImage:[UIImage imageNamed:@"fanzhuan"]];
  153. [cell.rightImage setHidden:YES];
  154. [cell.maskSwitch setHidden:NO];
  155. //}else if (row == 4){/*版本信息*/
  156. }else if (row == 3){/*版本信息*/
  157. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_check_update",nil)];
  158. [cell.mImageView setImage:[UIImage imageNamed:@"app_update"]];
  159. [cell.titleLabel2 setText:[iPhone appVersion]];
  160. [cell.titleLabel2 setHidden:NO];
  161. //}else if (row == 5){/*更换设备*/
  162. }else if (row == 4){/*更换设备*/
  163. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_change_phone",nil)];
  164. [cell.mImageView setImage:[UIImage imageNamed:@"icon_change_ohone"]];
  165. //}else if (row == 6){
  166. }else if (row == 5){
  167. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_restart_phone",nil)];
  168. [cell.mImageView setImage:[UIImage imageNamed:@"icon-gengxin"]];
  169. /*下圆角*/
  170. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
  171. byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
  172. cornerRadii:CGSizeMake(8, 8)];
  173. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  174. maskLayer.frame = cell.cellBgView.bounds;
  175. maskLayer.path = maskPath.CGPath;
  176. cell.bgViewLayer = maskLayer;
  177. cell.cellBgView.layer.mask = cell.bgViewLayer;
  178. [cell.lineView setHidden:YES];
  179. }
  180. return cell;
  181. }
  182. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  183. return 60;
  184. }
  185. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  186. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  187. NSInteger row = indexPath.row;
  188. if (0 == row){
  189. /*修改密码*/
  190. ModifyPWDFirstViewController *nextVC = [[ModifyPWDFirstViewController alloc] init];
  191. [self.navigationController pushViewController:nextVC animated:YES];
  192. }else if (1 == row){
  193. /*更换图标*/
  194. ChangeLogoViewController *nextVC = [[ChangeLogoViewController alloc] init];
  195. [self.navigationController pushViewController:nextVC animated:YES];
  196. }else if (2 == row){/*进城隐藏*/
  197. // HidenMaskSetViewController *nextVC = [[HidenMaskSetViewController alloc] init];
  198. // [self.navigationController pushViewController:nextVC animated:YES];
  199. // }else if (3 == row){/*设备翻转*/
  200. // ;
  201. }
  202. //else if (4 == row){/*版本信息*/
  203. else if (3 == row){/*版本信息*/
  204. AboutViewController *vc = [[AboutViewController alloc] init];
  205. [self.navigationController pushViewController:vc animated:YES];
  206. //}else if (5 == row){/*更换设备*/
  207. }else if (4 == row){/*更换设备*/
  208. TipsQRCodeForChangeDeviceViewController *vc = [[TipsQRCodeForChangeDeviceViewController alloc] init];
  209. [self.navigationController pushViewController:vc animated:YES];
  210. // }else if (6 == row){/*重启空间*/
  211. }else if (5 == row){/*重启空间*/
  212. /*弹窗提示重启*/
  213. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_restart_phone_tips",nil)
  214. msg:nil
  215. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  216. okTitle:NSLocalizedString(@"my_set_no_restart_phone_btn_ok",nil) isOkBtnHighlight:NO];
  217. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  218. nextVC.delegate = self;
  219. [self presentViewController:nextVC animated:YES completion:^{
  220. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  221. }];
  222. }
  223. }
  224. - (void)okBtnClickPressed{
  225. // /*重启云手机*/
  226. // 通过指令通道发送 {"type":"reboot"}
  227. if(_needToReboot){
  228. _needToReboot();
  229. }
  230. //提示语
  231. [[iToast makeText:NSLocalizedString(@"my_set_no_restart_phone_ok_tips",nil)] show];
  232. }
  233. @end