MySetViewController.m 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. }
  113. - (MineViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  114. NSInteger row = indexPath.row;
  115. static NSString *identifier = @"MineViewCell";
  116. MineViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  117. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  118. if (!cell){
  119. cell = [[MineViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  120. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  121. [cell setBackgroundColor:[UIColor clearColor]];
  122. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  123. }
  124. [cell.bgViewLayer removeFromSuperlayer];
  125. [cell.titleLabel2 setHidden:YES];
  126. [cell.rightImage setHidden:NO];
  127. [cell.lineView setHidden:NO];
  128. [cell.maskSwitch setHidden:YES];
  129. if (row == 0){
  130. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_modify_pwd",nil)];
  131. [cell.mImageView setImage:[UIImage imageNamed:@"mdoify_pwd"]];
  132. /*上圆角*/
  133. //设置部分圆角 贝塞尔曲线
  134. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
  135. byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
  136. cornerRadii:CGSizeMake(8, 8)];
  137. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  138. maskLayer.frame = cell.cellBgView.bounds;
  139. maskLayer.path = maskPath.CGPath;
  140. cell.bgViewLayer = maskLayer;
  141. cell.cellBgView.layer.mask = cell.bgViewLayer;
  142. }else if (row == 1){
  143. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_change_logo",nil)];
  144. [cell.mImageView setImage:[UIImage imageNamed:@"icon_change_logo"]];
  145. }else if (row == 2){
  146. [cell.titleLabel setText:NSLocalizedString(@"mask_view_hiden_set_hiden",nil)];
  147. [cell.mImageView setImage:[UIImage imageNamed:@"icon-jincheng"]];
  148. }else if (row == 3){
  149. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_fanzhuan_exit",nil)];
  150. [cell.mImageView setImage:[UIImage imageNamed:@"fanzhuan"]];
  151. [cell.rightImage setHidden:YES];
  152. [cell.maskSwitch setHidden:NO];
  153. }else if (row == 4){/*版本信息*/
  154. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_check_update",nil)];
  155. [cell.mImageView setImage:[UIImage imageNamed:@"app_update"]];
  156. [cell.titleLabel2 setText:[iPhone appVersion]];
  157. [cell.titleLabel2 setHidden:NO];
  158. }else if (row == 5){/*更换设备*/
  159. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_change_phone",nil)];
  160. [cell.mImageView setImage:[UIImage imageNamed:@"icon_change_ohone"]];
  161. }else if (row == 6){
  162. [cell.titleLabel setText:NSLocalizedString(@"my_set_no_restart_phone",nil)];
  163. [cell.mImageView setImage:[UIImage imageNamed:@"icon-gengxin"]];
  164. /*下圆角*/
  165. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-30 , 60)
  166. byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
  167. cornerRadii:CGSizeMake(8, 8)];
  168. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  169. maskLayer.frame = cell.cellBgView.bounds;
  170. maskLayer.path = maskPath.CGPath;
  171. cell.bgViewLayer = maskLayer;
  172. cell.cellBgView.layer.mask = cell.bgViewLayer;
  173. [cell.lineView setHidden:YES];
  174. }
  175. return cell;
  176. }
  177. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  178. return 60;
  179. }
  180. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  181. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  182. NSInteger row = indexPath.row;
  183. if (0 == row){
  184. /*修改密码*/
  185. ModifyPWDFirstViewController *nextVC = [[ModifyPWDFirstViewController alloc] init];
  186. [self.navigationController pushViewController:nextVC animated:YES];
  187. }else if (1 == row){
  188. /*更换图标*/
  189. ChangeLogoViewController *nextVC = [[ChangeLogoViewController alloc] init];
  190. [self.navigationController pushViewController:nextVC animated:YES];
  191. }else if (2 == row){/*进城隐藏*/
  192. HidenMaskSetViewController *nextVC = [[HidenMaskSetViewController alloc] init];
  193. [self.navigationController pushViewController:nextVC animated:YES];
  194. }else if (3 == row){/*设备翻转*/
  195. ;
  196. }
  197. else if (4 == row){/*版本信息*/
  198. AboutViewController *vc = [[AboutViewController alloc] init];
  199. [self.navigationController pushViewController:vc animated:YES];
  200. }else if (5 == row){/*更换设备*/
  201. TipsQRCodeForChangeDeviceViewController *vc = [[TipsQRCodeForChangeDeviceViewController alloc] init];
  202. [self.navigationController pushViewController:vc animated:YES];
  203. }else if (6 == row){/*重启空间*/
  204. /*弹窗提示重启*/
  205. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"my_set_no_restart_phone_tips",nil)
  206. msg:nil
  207. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  208. okTitle:NSLocalizedString(@"my_set_no_restart_phone_btn_ok",nil)];
  209. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  210. nextVC.delegate = self;
  211. [self presentViewController:nextVC animated:YES completion:^{
  212. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  213. }];
  214. }
  215. }
  216. - (void)okBtnClickPressed{
  217. // /*重启云手机*/
  218. // 通过指令通道发送 {"type":"reboot"}
  219. if(_needToReboot){
  220. _needToReboot();
  221. }
  222. //提示语
  223. [[iToast makeText:NSLocalizedString(@"my_set_no_restart_phone_ok_tips",nil)] show];
  224. }
  225. @end