YOUPAILZProfileVC.m 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. //
  2. // YOUPAILZProfileVC.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/6/30.
  6. // Copyright © 2021 leo. All rights reserved.
  7. //
  8. #import "YOUPAILZProfileVC.h"
  9. #import "YOUPAILZProfileHeaderView.h"
  10. #import "YOUPAILZProfileMenuItemCell.h"
  11. #import "YOUPAILZUnionsPopularizeVC.h"
  12. #import "YOUPAILCIMSessionVC.h"
  13. #import "YOUPAILCVerifyBigCastVC.h"
  14. #import "YOUPAILCBigCastSetVC.h"
  15. #import "LPBeautySetVC.h"
  16. #import "YOUPAILZVipVC.h"
  17. #import "YOUPAILPYoungSettingVC.h"
  18. #import "YOUPAILCSettingVC.h"
  19. #import "YOUPAILZGameListVC.h"
  20. #import "YOUPAILZGameAccompanyListVC.h"
  21. #import <StoreKit/StoreKit.h>
  22. #import "YOUPAIXRWalletVC.h"
  23. #import "YOUPAILZPersonalizedDressVC.h"
  24. #import "YOUPAILZBaseBackpackVC.h"
  25. #import "YOUPAILZBadgeVC.h"
  26. #import "YOUPAIHRsendRankVC.h"
  27. #import "YOUPAIHRReddotModel.h"
  28. #import "YOUPAIHRGuildCenterSearchVC.h"
  29. #import "YOUPAIHRGuildCenterDetailVC.h"
  30. #import "YOUPAIRealPersonFaceVC.h"
  31. #import <RPSDK/RPSDK.h>
  32. #import "YOUPAILZLiveVerifyResultVC.h"
  33. #import "YOUPAIProfileContentCell.h"
  34. #import "YOUPAIBigCastSettingVC.h"
  35. #import "YOUPAIMyNetworkVC.h"
  36. #import "YOUPAILCBigCastProtocolVC.h"
  37. #import "YOUPAIHRRechargePayWindow.h"
  38. #import "UIViewController+TFPresent.h"
  39. #import "YOUPAILCUploadCameraAuditVC.h"
  40. #import "WHVipDropView.h"
  41. #import "WHMineSwitchView.h"
  42. #import "WHMineBottomView.h"
  43. #import "YOUPAIBBSettingVC.h"
  44. #define kHeaderViewHeight (45 + 251.0f + StatusBarHeight)
  45. @interface YOUPAILZProfileVC () <UITableViewDelegate,UITableViewDataSource>
  46. //@property (nonatomic, weak) UITableView* youpaiptableView;
  47. @property (nonatomic, strong) NSMutableArray *youpaipdataSource;//一级
  48. @property (nonatomic, strong) NSMutableArray *youpaipdataSourceTableView;//二级
  49. @property (nonatomic, strong) NSMutableArray *switchArr; //开关 视频勿扰 私信勿扰 私信音效
  50. @property (nonatomic, strong) YOUPAILZProfileHeaderView *youpaipheaderView;
  51. @property (nonatomic, strong) YOUPAIProfileContentCell *functionView; //功能模块
  52. @property (nonatomic, weak) UIImageView *youpaipavatarImgV;
  53. @property (nonatomic, strong) NSString *youpaipweiguiUrl; ///违规公布
  54. @property (nonatomic, strong) NSString *youpaiphelpURL; ///在线客服
  55. @property (nonatomic, strong) NSString *youpaipinviteUrl; ///邀请
  56. @property (nonatomic, strong) NSString *youpaiptaskCenterUrl; ///任务中心
  57. @property (nonatomic,strong) YOUPAIHRReddotModel *youpaipdotModel;
  58. @property (nonatomic,assign) NSInteger youpaipguild;//0:未加入公会;1:已加入公会;2:已加入公会会长
  59. @property (nonatomic,assign) NSInteger is_complete_info;//1展示 0隐藏
  60. @property (nonatomic, strong) UIScrollView *scrollView;
  61. @property (nonatomic, strong) UIStackView *stackView;
  62. @property (nonatomic, strong) WHMineBottomView *bottomView;
  63. @end
  64. @implementation YOUPAILZProfileVC
  65. - (void)dealloc{
  66. [[NSNotificationCenter defaultCenter] removeObserver:self];
  67. }
  68. - (void)viewWillAppear:(BOOL)animated{
  69. [super viewWillAppear:animated];
  70. [self.navigationController setNavigationBarHidden:YES animated:animated];
  71. }
  72. - (void)viewDidAppear:(BOOL)animated{
  73. [super viewDidAppear:animated];
  74. if ([LCSaveData getIsspecial]== NO && [LCSaveModel getUserModel].youpaipuserinfo.youpaipgender ==1){
  75. [self youpaifcheckSetting];
  76. }
  77. [self youpaifrefreshData];
  78. }
  79. - (void)viewWillDisappear:(BOOL)animated{
  80. [super viewWillDisappear:animated];
  81. [self.navigationController setNavigationBarHidden:NO animated:animated];
  82. }
  83. - (void)viewDidLoad {
  84. [super viewDidLoad];
  85. self.youpaipdataSource = [NSMutableArray array];
  86. self.youpaipdataSourceTableView = [NSMutableArray array];
  87. self.switchArr = [NSMutableArray array];
  88. [[YMGlobalUtils shared] getConfig];
  89. [self youpaifinitUI];
  90. /// 线上版本状态改变,接收通知
  91. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youpaifreloadDataSource) name:@"OnlineVersion" object:nil];
  92. [self.switchArr addObject:@{
  93. @"image":[UIImage imageNamed:@"mine_video_wurao"],
  94. @"title":@"视频勿扰",
  95. @"type":@"videoSwitch",
  96. }];
  97. [self.switchArr addObject:@{
  98. @"image":[UIImage imageNamed:@"mine_sixin_chat"],
  99. @"title":@"私信聊天",
  100. @"type":@"messageSwitch",
  101. }];
  102. [self.switchArr addObject:@{
  103. @"image":[UIImage imageNamed:@"mine_sixin_yinxiao"],
  104. @"title":@"私信音效",
  105. @"type":@"msgSoundSwitch",
  106. }];
  107. for (NSDictionary *dict in self.switchArr) {
  108. WHMineSwitchView *view = [[WHMineSwitchView alloc] init];
  109. view.dict = dict;
  110. [self.stackView addArrangedSubview:view];
  111. }
  112. }
  113. - (void)youpaifreloadDataSource{
  114. [self.youpaipdataSource removeAllObjects];
  115. [self.youpaipdataSourceTableView removeAllObjects];
  116. [self.switchArr removeAllObjects];
  117. YOUPAILCBaseInfo *userinfo = [LCSaveModel getUserModel].youpaipuserinfo;
  118. NSString *vip_des = userinfo.youpaipvip_des;
  119. //糖豆抽盲盒
  120. // [self.dataSource addObject:@{
  121. // @"type":@"MangHe",
  122. // @"image":[UIImage imageNamed:@"vqu_images_ic_manghe"],
  123. // @"title":@"糖豆抽盲盒",
  124. // @"accessoryType":@(LZTableViewCellAccessoryRightTitle),
  125. // @"rightText":@"更多任务赚金币",
  126. // }];
  127. // NSString *badgeCount ;
  128. // if (userinfo.youpaipbadge_all.count>0) {
  129. // badgeCount = [NSString stringWithFormat:@"我的勋章(%ld)",userinfo.youpaipbadge_all.count];
  130. // }else{
  131. // badgeCount = [NSString stringWithFormat:@"我的勋章"];
  132. // }
  133. // YOUPAIHRReddotModel *dotModel = self.youpaipdotModel;
  134. // // 邀请有奖
  135. // if ([LCSaveData getOnlineVersion]) {
  136. [self.youpaipdataSource addObject:@{
  137. @"type":@"invite",
  138. @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_invite"],
  139. @"title":@"邀请有奖",//邀请有奖
  140. @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  141. @"rightText":@"",
  142. }];
  143. // 美颜设置
  144. [self.youpaipdataSource addObject:@{
  145. @"type":@"beauty_set",
  146. @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_beauty_set"],
  147. @"title":@"美颜设置",
  148. @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  149. @"rightText":@"",
  150. }];
  151. // 女神认证
  152. if (userinfo.youpaipgender == 1) { //女
  153. // 女神认证
  154. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  155. [dict setObject:@"big_cast" forKey:@"type"];
  156. NSString *title = @"";
  157. if (userinfo.youpaipis_anchor == 0) {
  158. title = @"真人认证";
  159. [dict setObject:[UIImage imageNamed:@"vqu_images_Host_settings_nonra"] forKey:@"image"];
  160. }else{
  161. title = @"聊天价格";
  162. [dict setObject:[UIImage imageNamed:@"vqu_images_Host_settings_auth"] forKey:@"image"];
  163. }
  164. [dict setObject:title forKey:@"title"];
  165. [dict setObject:@(LZTableViewCellAccessoryDisclosureIndicator) forKey:@"accessoryType"];
  166. [dict setObject:@"" forKey:@"rightText"];
  167. [self.youpaipdataSource addObject:dict];
  168. }
  169. // 我的账单
  170. [self.youpaipdataSource addObject:@{
  171. @"type":@"zhangdan",
  172. @"image":[UIImage imageNamed:@"vqu_images_Host_settings_zhangdan"],
  173. @"title":@"我的账单",
  174. @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  175. @"rightText":@"",
  176. }];
  177. // }
  178. // //任务中心
  179. // [self.youpaipdataSource addObject:@{
  180. // @"type":@"Task",
  181. // @"image":[UIImage imageNamed:@"vqu_images_D_task"],
  182. // @"title":@"任务中心",
  183. // @"accessoryType":@(LZTableViewCellAccessoryRightTitle),
  184. // @"rightText":@"",
  185. // }];
  186. // // 贵族中心
  187. // [self.youpaipdataSource addObject:@{
  188. // @"type":@"vip",
  189. // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_vip"],
  190. // @"title":@"贵族中心",
  191. // @"accessoryType":@(LZTableViewCellAccessoryRightTitle),
  192. // @"rightText":vip_des,
  193. // }];
  194. // //我的背包
  195. // [self.youpaipdataSource addObject:@{
  196. // @"type":@"mine_beibao",
  197. // @"image":[UIImage imageNamed:@"vqu_images_my_backpack"],
  198. // @"title":@"我的背包",
  199. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  200. // @"rightText":@"",
  201. // @"redView":[NSString stringWithFormat:@"%ld",(long)dotModel.youpaippackage_watch]
  202. // }];
  203. // //我的人脉
  204. // [self.youpaipdataSource addObject:@{
  205. // @"type":@"my_network",
  206. // @"image":[UIImage imageNamed:@"vqu_images_my_network"],
  207. // @"title":@"我的人脉",
  208. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  209. // @"rightText":@""
  210. //
  211. // }];
  212. // if (userinfo.youpaipis_anchor == 1) {
  213. // //女神设置
  214. // [self.youpaipdataSource addObject:@{
  215. // @"type":@"Host_settings",
  216. // @"image":[UIImage imageNamed:@"vqu_images_Host_settings"],
  217. // @"title":@"女神设置",
  218. // @"accessoryType":@(LZTableViewCellAccessoryNone),
  219. // @"rightText":@""
  220. //
  221. // }];
  222. // }
  223. //送礼榜
  224. // if (userinfo.youpaipis_anchor == 1) {
  225. // [self.youpaipdataSource addObject:@{
  226. // @"type":@"sendRank",
  227. // @"image":[UIImage imageNamed:@"vqu_images_sendRank"],
  228. // @"title":@"送礼榜",
  229. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  230. // @"rightText":@"",
  231. //
  232. // }];
  233. // }
  234. // //我的认证
  235. // [self.youpaipdataSource addObject:@{
  236. // @"type":@"my_face",
  237. // @"image":[UIImage imageNamed:@"vqu_images_my_face"],
  238. // @"title":@"我的认证",
  239. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  240. // @"rightText":@"",
  241. // }];
  242. // 在线客服
  243. [self.youpaipdataSourceTableView addObject:@{
  244. @"type":@"im_service",
  245. @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_im_service"],
  246. @"title":@"在线客服",
  247. @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  248. @"rightText":@"",
  249. }];
  250. // 违规公布
  251. [self.youpaipdataSourceTableView addObject:@{
  252. @"type":@"weiguigongbu",
  253. @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_weiguigongbu"],
  254. @"title":@"违规公布",
  255. @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  256. @"rightText":@"",
  257. }];
  258. //系统设置
  259. [self.youpaipdataSourceTableView addObject:@{
  260. @"type":@"vqu_images_P_mine_Set",
  261. @"image":[UIImage imageNamed:@"vqu_images_P_mine_Set"],
  262. @"title":@"系统设置",
  263. @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  264. @"rightText":@"",
  265. }];
  266. // // 勿扰模式
  267. // [self.youpaipdataSource addObject:@{
  268. // @"type":@"mine_darao",
  269. // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_mine_darao"],
  270. // @"title":@"勿扰模式",
  271. // @"accessoryType":@(LZTableViewCellAccessorySwitch),
  272. // @"rightText":@"",
  273. // @"subTitle":[LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor == 1 ? @"(开启后男用户将无法给你拨打视频)" : @"(开启后女神不可群发打招呼给你)",
  274. // }];
  275. // // 我的勋章
  276. // [self.youpaipdataSource addObject:@{
  277. // @"type":@"my_badge",
  278. // @"image":[UIImage imageNamed:@"vqu_images_ic_profile_bedge"],
  279. // @"title":badgeCount,
  280. // @"accessoryType":@(LZTableViewCellAccessoryRightImage),
  281. // @"rightText":@"",
  282. // @"redView":[NSString stringWithFormat:@"%ld",(long)dotModel.youpaipbadges_watch]
  283. // }];
  284. // //公会中心
  285. // [self.youpaipdataSource addObject:@{
  286. // @"type":@"guild",
  287. // @"image":[UIImage imageNamed:@"vqu_images_mine_guild"],
  288. // @"title":@"公会中心",
  289. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  290. // @"rightText":@"",
  291. // }];
  292. // // 个性装扮
  293. // [self.youpaipdataSource addObject:@{
  294. // @"type":@"personalizedDress",
  295. // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_personalized_dress"],
  296. // @"title":@"个性装扮",
  297. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  298. // @"rightText":@"",
  299. // @"redView":[NSString stringWithFormat:@"%ld",(long)dotModel.youpaipdress_watch]
  300. // }];
  301. // if (userinfo.youpaipis_anchor == 1) {
  302. // [self.youpaipdataSource addObject:@{
  303. // @"type":@"sendRank",
  304. // @"image":[UIImage imageNamed:@"vqu_images_sendRank"],
  305. // @"title":@"送礼榜",
  306. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  307. // @"rightText":@"",
  308. //
  309. // }];
  310. // }
  311. //
  312. //
  313. //
  314. //
  315. // // 推广制度
  316. // [self.youpaipdataSource addObject:@{
  317. // @"type":@"unions",
  318. // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_unions"],
  319. // @"title":@"推广制度",
  320. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  321. // @"rightText":@"",
  322. // }];
  323. //// 使用帮助
  324. // if (userinfo.youpaipgender==1) { //女
  325. // [self.youpaipdataSource addObject:@{
  326. // @"type":@"help",
  327. // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_beauty_set"],
  328. // @"title":@"使用帮助",
  329. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  330. // }];
  331. // }
  332. //
  333. // 青少年模式
  334. if (userinfo.youpaipgender != 1) { //男
  335. [self.youpaipdataSource addObject:@{
  336. @"type":@"vqu_images_ic_my_young",
  337. @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_Young"],
  338. @"title":@"青少年模式",
  339. @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  340. @"rightText":@"",
  341. }];
  342. }
  343. //// 设置
  344. // [self.youpaipdataSource addObject:@{
  345. // @"type":@"set",
  346. // @"image":[UIImage imageNamed:@"vqu_images_D_profile_item_set"],
  347. // @"title":@"设置",
  348. // @"accessoryType":@(LZTableViewCellAccessoryDisclosureIndicator),
  349. // @"rightText":@"",
  350. // }];
  351. // [self.youpaiptableView reloadData];
  352. self.functionView.vqupaipdataArr = self.youpaipdataSource;
  353. }
  354. - (void)youpaifinitUI{
  355. // UIView *bgView = [UIView new];
  356. [self.view addSubview:self.scrollView];
  357. [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  358. make.left.mas_equalTo(0);
  359. make.right.mas_equalTo(0);
  360. make.top.mas_equalTo(0);
  361. make.bottom.mas_equalTo(0);
  362. }];
  363. UIImageView *topImageView = [UIImageView new];
  364. [self.scrollView addSubview:topImageView];
  365. [topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  366. make.top.equalTo(self.view);
  367. make.left.mas_equalTo(0);
  368. make.right.mas_equalTo(0);
  369. make.height.mas_greaterThanOrEqualTo(WHScreenEqualWidth(497));
  370. }];
  371. // UIImage *bgImage = [LCTools imageForSize:CGSizeMake(KScreenWidth, KScreenEqualWidth(497)) colors:@[HexColorFromRGB(0xDF84C7),HexColorFromRGB(0xDF84C8),HexColorFromRGB(0x4C26AC )] locations:@[@0, @0, @1] ByGradientType:GradientupleftTolowRight];
  372. topImageView.image = [UIImage imageNamed:@"mine_bg"];
  373. // UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,0, KScreenWidth, KScreenHeight-TabbarHeight) style:UITableViewStyleGrouped];
  374. // tableView.showsVerticalScrollIndicator = NO;
  375. // tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  376. // tableView.backgroundColor = [UIColor clearColor];
  377. //
  378. // tableView.estimatedSectionHeaderHeight = 0;
  379. // tableView.estimatedSectionFooterHeight = 0;
  380. // tableView.dataSource = self;
  381. // tableView.delegate = self;
  382. // [self.view addSubview:tableView];
  383. // self.youpaiptableView = tableView;
  384. YOUPAILZProfileHeaderView *headerView = [[YOUPAILZProfileHeaderView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeaderViewHeight)];
  385. headerView.is_complete_info = self.is_complete_info;
  386. headerView.youpaipinfoModel = [LCSaveModel getUserModel].youpaipuserinfo;
  387. [self.scrollView addSubview:headerView];
  388. self.youpaipheaderView = headerView;
  389. YOUPAIProfileContentCell *cell = [[YOUPAIProfileContentCell alloc] init];
  390. [self.scrollView addSubview:cell.contentView];
  391. [cell.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
  392. make.top.equalTo(headerView.mas_bottom).offset(WHScreenEqualWidth(16));
  393. make.left.mas_equalTo(0);
  394. make.right.mas_equalTo(0);
  395. make.height.mas_equalTo(WHScreenEqualWidth(93));
  396. }];
  397. self.functionView = cell;
  398. [self.scrollView addSubview:self.stackView];
  399. [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
  400. make.left.mas_equalTo(WHScreenEqualWidth(12));
  401. make.right.mas_equalTo(WHScreenEqualWidth(-12));
  402. make.top.equalTo(self.functionView.contentView.mas_bottom).offset(WHScreenEqualWidth(16));
  403. }];
  404. [self.scrollView addSubview:self.bottomView];
  405. [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
  406. make.left.mas_equalTo(WHScreenEqualWidth(12));
  407. make.right.mas_equalTo(WHScreenEqualWidth(-12));
  408. make.top.equalTo(self.stackView.mas_bottom).offset(WHScreenEqualWidth(16));
  409. make.bottom.equalTo(self.scrollView).offset(-(TabbarHeight + WHScreenEqualWidth(20)));
  410. }];
  411. }
  412. - (UIScrollView *)scrollView{
  413. if(!_scrollView){
  414. _scrollView = [[UIScrollView alloc] init];
  415. // _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; //不考虑安全区域边缘
  416. [_scrollView setShowsVerticalScrollIndicator:NO];
  417. [_scrollView setShowsHorizontalScrollIndicator:NO];
  418. [_scrollView setBackgroundColor:HexColorFromRGB(0xF8F9FE)];
  419. _scrollView.alwaysBounceVertical = YES; //垂直 - 弹簧效果
  420. }
  421. return _scrollView;
  422. }
  423. - (UIStackView *)stackView{
  424. if(!_stackView){
  425. _stackView = [[UIStackView alloc] init];
  426. [_stackView setAxis:(UILayoutConstraintAxisVertical)]; //垂直布局
  427. [_stackView setSpacing:0];
  428. [_stackView setBackgroundColor:[UIColor whiteColor]];
  429. [_stackView.layer setCornerRadius:WHScreenEqualWidth(8)];
  430. [_stackView.layer setMasksToBounds:YES];
  431. _stackView.layer.shadowColor = [UIColor colorWithWhite:0 alpha:0.6f].CGColor;
  432. // [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.0600].CGColor;
  433. _stackView.layer.shadowOffset = CGSizeMake(0,2);
  434. _stackView.layer.shadowOpacity = 1;
  435. _stackView.layer.shadowRadius = 4;
  436. }
  437. return _stackView;
  438. }
  439. - (WHMineBottomView *)bottomView{
  440. if(!_bottomView){
  441. _bottomView = [[WHMineBottomView alloc] init];
  442. __weak typeof(self) weakSelf = self;
  443. _bottomView.actionBlock = ^(NSDictionary * _Nonnull sourceDict) {
  444. if(sourceDict){
  445. if([sourceDict[@"type"] isEqualToString:@"home"]){ // 个人主页
  446. }else if([sourceDict[@"type"] isEqualToString:@"server"]){ // 在线客服
  447. }else if([sourceDict[@"type"] isEqualToString:@"cooperate"]){ // 合作洽谈
  448. }else if([sourceDict[@"type"] isEqualToString:@"setting"]){ // 系统设置
  449. YOUPAIBBSettingVC* setting = [[YOUPAIBBSettingVC alloc]init];
  450. setting.youpaipinfoModel = [LCSaveModel getUserModel].youpaipuserinfo;
  451. [weakSelf.navigationController pushViewController:setting animated:YES];
  452. }
  453. }
  454. };
  455. }
  456. return _bottomView;
  457. }
  458. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  459. if (indexPath.section == 0) {
  460. NSInteger count = self.youpaipdataSource.count;
  461. NSInteger rowCount = count%4 == 0? count/4:count/4+1;
  462. if ((self.youpaipdataSource.count%4) != 0) {
  463. rowCount+=1;
  464. }
  465. return rowCount*WHScreenEqualWidth(93);
  466. }else{
  467. return self.youpaipdataSourceTableView.count*71+20;
  468. }
  469. }
  470. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  471. return 1;
  472. }
  473. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  474. return 2;
  475. }
  476. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  477. if (indexPath.section == 0) {
  478. NSString *cellID = @"YOUPAIProfileContentCell";
  479. YOUPAIProfileContentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
  480. cell = [[YOUPAIProfileContentCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
  481. cell.vqupaipdataArr = self.youpaipdataSource;
  482. @weakify(self)
  483. [cell setVqupaipDidSelectBlock:^(NSString * _Nonnull title) {
  484. @strongify(self)
  485. [self youpaifgoPageWithType:title];
  486. }];
  487. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  488. return cell;
  489. }else{
  490. // 最底部的cell
  491. NSMutableDictionary *cellData = self.youpaipdataSourceTableView[indexPath.row];
  492. NSString *cellID = @"YOUPAILZProfileMenuItemCell";
  493. YOUPAILZProfileMenuItemCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
  494. cell = [[YOUPAILZProfileMenuItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
  495. cell.youpaipimgV.image = [cellData valueForKey:@"image"];
  496. cell.youpaiptextL.text = [cellData valueForKey:@"title"];
  497. cell.youpaiplz_accessoryType = [[cellData valueForKey:@"accessoryType"] integerValue];
  498. cell.youpaiprightLabel.text = [cellData valueForKey:@"rightText"];
  499. cell.youpaipsubTextL.text = @"";
  500. cell.youpaipisShow = cellData[@"redView"];
  501. if ([cellData.allKeys containsObject:@"subTitle"]) {
  502. cell.youpaipsubTextL.text = cellData[@"subTitle"];
  503. }
  504. @weakify(self)
  505. [cell setVqupaipDidSelectBlock:^(NSString * _Nonnull title) {
  506. @strongify(self)
  507. [self youpaifgoPageWithType:title];
  508. }];
  509. cell.countArr = self.youpaipdataSourceTableView;
  510. return cell;
  511. }
  512. return nil;
  513. }
  514. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  515. return CGFLOAT_MIN;
  516. }
  517. - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  518. return CGFLOAT_MIN;
  519. }
  520. - (void)youpaifgoPageWithType:(NSString *)type{
  521. if ([type isEqualToString:@"unions"]) {
  522. YOUPAILZUnionsPopularizeVC *unions = [[YOUPAILZUnionsPopularizeVC alloc]init];
  523. [self.navigationController pushViewController:unions animated:YES];
  524. }else if ([type isEqualToString:@"wallet"]) {
  525. YOUPAIXRWalletVC *wallet = [[YOUPAIXRWalletVC alloc]init];
  526. [self.navigationController pushViewController:wallet animated:YES];
  527. }else if ([type isEqualToString:@"invite"]){
  528. // YOUPAILCInviteVC *invite = [[YOUPAILCInviteVC alloc]init];
  529. // [self.navigationController pushViewController:invite animated:YES];
  530. ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init];
  531. vc.contentUrl = self.youpaipinviteUrl;
  532. [self.navigationController pushViewController:vc animated:YES];
  533. }else if ([type isEqualToString:@"mine_beibao"]){
  534. YOUPAILZBaseBackpackVC *invite = [[YOUPAILZBaseBackpackVC alloc]init];
  535. [self.navigationController pushViewController:invite animated:YES];
  536. }else if ([type isEqualToString:@"my_face"]){
  537. YOUPAILCBaseInfo *userinfo = [LCSaveModel getUserModel].youpaipuserinfo;
  538. if (userinfo.youpaipgender == 1){//女
  539. if (userinfo.youpaipis_auth ==1) {//成功
  540. YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init];
  541. vc.youpaipstate = LZLiveVerifyStateWithSuccess;
  542. [self.navigationController pushViewController:vc animated:YES];
  543. }else if (userinfo.youpaipis_auth ==2){//失败
  544. YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init];
  545. vc.youpaipstate = LZLiveVerifyStateWithInError;
  546. [self.navigationController pushViewController:vc animated:YES];
  547. @weakify(self)
  548. [vc setDidReviewClickBlock:^{
  549. @strongify(self)
  550. [self youpaifrealNameAuthentication];
  551. }];
  552. }
  553. else{
  554. @weakify(self);
  555. YOUPAILCBigCastProtocolVC* vc = [[YOUPAILCBigCastProtocolVC alloc]init];
  556. [vc setAgreeProtocolBlock:^{
  557. @strongify(self);
  558. [self youpaifrealNameAuthentication];
  559. }];
  560. [self.navigationController pushViewController:vc animated:YES];
  561. }
  562. }else{//男
  563. if (userinfo.youpaipis_auth == 1) {
  564. YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init];
  565. vc.youpaipstate = LZLiveVerifyStateWithSuccess;
  566. [self.navigationController pushViewController:vc animated:YES];
  567. }else{
  568. YOUPAIRealPersonFaceVC *vc = [YOUPAIRealPersonFaceVC new];
  569. [self.navigationController pushViewController:vc animated:YES];
  570. }
  571. }
  572. }else if ([type isEqualToString:@"my_network"]){
  573. YOUPAIMyNetworkVC *vc = [YOUPAIMyNetworkVC new];
  574. vc.youpaipinviteUrl = self.youpaipinviteUrl;
  575. [self.navigationController pushViewController:vc animated:YES];
  576. }else if ([type isEqualToString:@"help"]){
  577. NSString *urlStr;
  578. if ([LCSaveModel getUserModel].youpaipuserinfo.youpaipgender==1) {
  579. urlStr = [NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,HelpBigCastH5];
  580. }else{
  581. urlStr = [NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,HelpNormalH5];
  582. }
  583. if([LCSaveData getIsspecial]){
  584. urlStr = [NSString stringWithFormat:@"%@%@",[LCSaveData getBaseURL]?[LCSaveData getBaseURL]:BaseURL,HelpSpecialH5];
  585. }
  586. ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init];
  587. vc.contentUrl = urlStr;
  588. [self.navigationController pushViewController:vc animated:YES];
  589. }else if ([type isEqualToString:@"im_service"]){
  590. ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init];
  591. vc.contentUrl = self.youpaiphelpURL;
  592. [self.navigationController pushViewController:vc animated:YES];
  593. }else if ([type isEqualToString:@"big_cast"]){
  594. if ([LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor == 0) {
  595. YOUPAILCVerifyBigCastVC* verifyBigCast = [[YOUPAILCVerifyBigCastVC alloc]init];
  596. [self.navigationController pushViewController:verifyBigCast animated:YES];
  597. }else{
  598. YOUPAILCBigCastSetVC* bigCast = [[YOUPAILCBigCastSetVC alloc]init];
  599. [self.navigationController pushViewController:bigCast animated:YES];
  600. }
  601. }else if([type isEqualToString:@"beauty_set"]){
  602. LPBeautySetVC* beautySet = [[LPBeautySetVC alloc]init];
  603. //modify by leo fix ios13 bug
  604. beautySet.modalPresentationStyle =0;
  605. [self.navigationController presentViewController:beautySet animated:YES completion:^{
  606. }];
  607. }else if([type isEqualToString:@"set"]){
  608. YOUPAILCSettingVC* setting = [[YOUPAILCSettingVC alloc]init];
  609. [self.navigationController pushViewController:setting animated:YES];
  610. }else if([type isEqualToString:@"vip"]){
  611. YOUPAILZVipVC* setting = [[YOUPAILZVipVC alloc]init];
  612. [self.navigationController pushViewController:setting animated:YES];
  613. }else if([type isEqualToString:@"personalizedDress"]){
  614. YOUPAILZPersonalizedDressVC* vc = [[YOUPAILZPersonalizedDressVC alloc]init];
  615. [self.navigationController pushViewController:vc animated:YES];
  616. }else if([type isEqualToString:@"my_badge"]){
  617. YOUPAILZBadgeVC *vc = [[YOUPAILZBadgeVC alloc] init];
  618. [self.navigationController pushViewController:vc animated:YES];
  619. }else if ([type isEqualToString:@"guild"]){//公会中心
  620. if (self.youpaipguild ==0) {//0:未加入公会;1:已加入公会;2:已加入公会会长
  621. YOUPAIHRGuildCenterSearchVC *vc = [YOUPAIHRGuildCenterSearchVC new];
  622. [self.navigationController pushViewController:vc animated:YES];
  623. }else{
  624. YOUPAIHRGuildCenterDetailVC *vc = [YOUPAIHRGuildCenterDetailVC new];
  625. vc.youpaipguild = self.youpaipguild;
  626. [self.navigationController pushViewController:vc animated:YES];
  627. }
  628. }
  629. else if([type isEqualToString:@"vqu_images_ic_my_young"]){
  630. YOUPAILPYoungSettingVC* setting = [[YOUPAILPYoungSettingVC alloc]init];
  631. [self.navigationController pushViewController:setting animated:YES];
  632. }else if ([type isEqualToString:@"weiguigongbu"]){
  633. ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init];
  634. vc.contentUrl = self.youpaipweiguiUrl;
  635. [self.navigationController pushViewController:vc animated:YES];
  636. }else if ([type isEqualToString:@"gameCertification"]) {
  637. YOUPAILZGameListVC *vc = [[YOUPAILZGameListVC alloc] init];
  638. [self.navigationController pushViewController:vc animated:YES];
  639. }else if ([type isEqualToString:@"gameAccompany"]){
  640. YOUPAILZGameAccompanyListVC *vc = [[YOUPAILZGameAccompanyListVC alloc] init];
  641. [self.navigationController pushViewController:vc animated:YES];
  642. }else if ([type isEqualToString:@"vqu_images_P_mine_Set"]){
  643. YOUPAILCSettingVC* setting = [[YOUPAILCSettingVC alloc]init];
  644. setting.youpaipinfoModel = [LCSaveModel getUserModel].youpaipuserinfo;
  645. [self.navigationController pushViewController:setting animated:YES];
  646. }else if ([type isEqualToString:@"sendRank"]){
  647. YOUPAIHRsendRankVC *vc = [YOUPAIHRsendRankVC new];
  648. [self.navigationController pushViewController:vc animated:YES ];
  649. }else if([type isEqualToString:@"Host_settings"]){
  650. YOUPAIBigCastSettingVC *vc = [[YOUPAIBigCastSettingVC alloc] init];
  651. [self.navigationController pushViewController:vc animated:YES];
  652. }else if ([type isEqualToString:@"Task"]){
  653. [UMengRecordTool umengEventCountWithId:TaskCenter];
  654. ZCBaseWebVC * vc = [[ZCBaseWebVC alloc]init];
  655. vc.contentUrl = self.youpaiptaskCenterUrl;
  656. [self.navigationController pushViewController:vc animated:YES];
  657. }else if ([type isEqualToString:@"zhangdan"]){ // 我的账单
  658. NSLog(@"asdasdads");
  659. }
  660. }
  661. /// 阿里实名认证
  662. - (void)youpaifrealNameAuthentication{
  663. [UCAuthorityManager cameraAuthority:^{
  664. YMCustomCameraViewModel *customCameraVM = [[YMCustomCameraViewModel alloc]initWithParams:@{}];
  665. [YMRouter openURL:stringFormat(@"%@%@",YM_ROUTER_URL_PREFIX,YM_ROUTER_CUSTOM_CAMERA) withUserInfo:@{
  666. RouterViewModel:customCameraVM
  667. } completion:nil];
  668. } denied:^{
  669. YMTipsPopupView *customView = [[YMTipsPopupView alloc]init];
  670. [customView configutationWithTips:@"请在iphone的“设置-隐私-相机”选项中,允许APP访问您的相机。" TipsAlignment:NSTextAlignmentCenter IsHideTitle:NO IsHideSingleButton:NO];
  671. YMPopupView *popupView = [YMPopupView initWithCustomView:customView parentView:[YMGlobalUtils getCurrentVC].view popStyle:YMPopupStyleFade dismissStyle:YMDismissStyleFade];
  672. popupView.priority = 999;
  673. popupView.cornerRadius = adapt(10);
  674. popupView.rectCorners = UIRectCornerAllCorners;
  675. popupView.positionStyle = YMPositionStyleCenter;
  676. popupView.isHideBg = NO;
  677. popupView.bgAlpha = 0.3;
  678. @weakify(popupView)
  679. customView.buttonBlock = ^(BOOL isConfirm) {
  680. @strongify(popupView)
  681. if (isConfirm) {
  682. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
  683. }
  684. [popupView dismissWithStyle:YMDismissStyleFade duration:2.0];
  685. };
  686. [popupView pop];
  687. }];
  688. // [LCHttpHelper requestWithURLString:GetLiveVerifyToken parameters:@{} needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  689. // NSDictionary* dict = (NSDictionary*)responseObject;
  690. // NSInteger code = [[dict objectForKey:@"code"] integerValue];
  691. // if (code == 0) {
  692. // NSString *token = dict[@"data"][@"VerifyToken"];
  693. // NSString *BizId = dict[@"data"][@"BizId"];
  694. // [weakSelf youpaifpushToAliSdk:token BizId:BizId];
  695. //
  696. // }else{
  697. //
  698. // [ZCHUDHelper showTitle:[dict objectForKey:@"message"]];
  699. // }
  700. //
  701. //
  702. //
  703. // } failure:^(NSError *error) {
  704. // [ZCHUDHelper showTitle:error.localizedDescription];
  705. //
  706. // }];
  707. }
  708. -(void)youpaifpushToAliSdk:(NSString*)token BizId:(NSString*)bizIdStr{
  709. RPConfiguration *configuration = [RPConfiguration configuration];
  710. NSString *filePath1 = [[NSBundle mainBundle] pathForResource:@"RPCustomUI" ofType:@"bundle"];
  711. configuration.customUIPath = filePath1;
  712. [RPSDK startWithVerifyToken:token viewController:self configuration:configuration completion:^(RPResult * _Nonnull result) {
  713. NSLog(@"实人认证结果:%@==%@", result,result.message);
  714. switch (result.state) {
  715. case RPStatePass:
  716. // 认证通过。
  717. [self youpaifpostBizId:bizIdStr];
  718. break;
  719. case RPStateFail:
  720. // 认证不通过。
  721. [ZCHUDHelper showTitle:@"认证失败,请重新认证"];
  722. break;
  723. case RPStateNotVerify:
  724. // 未认证。
  725. // 通常是用户主动退出或者姓名身份证号实名校验不匹配等原因导致。
  726. // 具体原因可通过result.errorCode来区分(详见文末错误码说明表格)。
  727. break;
  728. }
  729. }];
  730. }
  731. -(void)youpaifpostBizId:(NSString*)ID{
  732. NSMutableDictionary *dict = [NSMutableDictionary new];
  733. [dict setObject:ID forKey:@"BizId"];
  734. WeakSelf;
  735. [LCHttpHelper requestWithURLString:LiveVerifyTokenSuccess parameters:dict needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  736. NSDictionary* dict = (NSDictionary*)responseObject;
  737. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  738. if (code == 0) {
  739. YOUPAILZLiveVerifyResultVC *vc = [[YOUPAILZLiveVerifyResultVC alloc] init];
  740. vc.youpaipstate = LZLiveVerifyStateWithInReview;
  741. vc.youpaipcontent_str = [dict objectForKey:@"message"];
  742. [weakSelf.navigationController pushViewController:vc animated:YES];
  743. }else{
  744. [ZCHUDHelper showTitle:[dict objectForKey:@"message"]];
  745. }
  746. } failure:^(NSError *error) {
  747. [ZCHUDHelper showTitle:error.localizedDescription];
  748. }];
  749. }
  750. - (void)scrollViewDidScroll:(UIScrollView *)scrollView{
  751. CGFloat y = scrollView.contentOffset.y;
  752. if(y > 0){
  753. self.youpaipavatarImgV.mj_y = 0;
  754. self.youpaipavatarImgV.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
  755. }else{
  756. y = -y;
  757. CGFloat scale = y / kHeaderViewHeight;
  758. self.youpaipavatarImgV.mj_y = -y;
  759. self.youpaipavatarImgV.transform = CGAffineTransformMakeScale(1.0f + scale, 1.0f + scale);
  760. }
  761. }
  762. - (void)youpaifcheckSetting{
  763. if ([LCTools canShowNoticationTip]) {
  764. UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
  765. if (UIUserNotificationTypeNone == setting.types) {
  766. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:@"您的系统关闭了相语欢颜的通知提醒,会导致您错过重要的视频通话,需要您前往打开通知" preferredStyle:UIAlertControllerStyleAlert];
  767. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action){
  768. }];
  769. UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action){
  770. NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
  771. if ([[UIApplication sharedApplication] canOpenURL:url]) {
  772. [[UIApplication sharedApplication] openURL:url];
  773. }
  774. }];
  775. [alertController addAction:cancelAction];
  776. [alertController addAction:okAction];
  777. [self presentViewController:alertController animated:YES completion:nil];
  778. }
  779. }
  780. }
  781. - (void)youpaifcheckAppraise{//盈利大于1000提示
  782. if (@available(iOS 10.3, *)) {
  783. if ([LCTools canShowAppraise]) {//判断时间 一个月只弹一次
  784. if([SKStoreReviewController respondsToSelector:@selector(requestReview)]){
  785. [SKStoreReviewController requestReview];
  786. }
  787. }
  788. }
  789. }
  790. - (void)youpaifrefreshData{
  791. [LCHttpHelper requestWithURLString:UserCenter parameters:nil needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  792. NSDictionary* dict = (NSDictionary*)responseObject;
  793. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  794. if (code==0) {//成功
  795. NSDictionary *anchor = [[dict objectForKey:@"data"]objectForKey:@"anchor"];
  796. NSDictionary *info = [[dict objectForKey:@"data"]objectForKey:@"userinfo"];
  797. if ([[anchor allKeys] containsObject:@"open_video_status"]) {
  798. if ([[anchor objectForKey:@"open_video_status"] integerValue] == 0) {//0 未开启 1 已开启
  799. [LCSaveData saveVideoOpenStatu:NO];
  800. }else{
  801. [LCSaveData saveVideoOpenStatu:YES];
  802. }
  803. }
  804. NSInteger guild = [[[dict objectForKey:@"data"]objectForKey:@"guild"] integerValue];
  805. self.youpaipguild = guild;
  806. if ([[anchor allKeys] containsObject:@"order_switch"]) {
  807. if ([[anchor objectForKey:@"order_switch"] integerValue] == 1) {//1隐藏 2不隐藏
  808. [LCSaveData saveOrderOpenStatu:YES];
  809. }else{
  810. [LCSaveData saveOrderOpenStatu:NO];
  811. }
  812. }
  813. if ([[info allKeys] containsObject:@"is_msg_refuse"]) {
  814. if ([[info objectForKey:@"is_msg_refuse"] integerValue] == 1) {//1开启 0关闭
  815. [LCSaveData saveProfileWuraoStatus:YES];
  816. }else{
  817. [LCSaveData saveProfileWuraoStatus:NO];
  818. }
  819. }
  820. if ([[[dict objectForKey:@"data"] allKeys] containsObject:@"webUrl"]) {
  821. self.youpaipweiguiUrl = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"publish"]];
  822. self.youpaipinviteUrl = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"share"]];
  823. self.youpaiphelpURL = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"help"]];
  824. self.youpaiptaskCenterUrl = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"taskCenter"]];
  825. NSString *myGrade = [NSString stringWithFormat:@"%@",[[[dict objectForKey:@"data"]objectForKey:@"webUrl"] objectForKey:@"myGrade"]];
  826. self.youpaipheaderView.youpaipmyGrade = myGrade;
  827. }
  828. YOUPAILCBaseInfo* userinfo = [YOUPAILCBaseInfo mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"userinfo"]];
  829. self.is_complete_info = [dict[@"data"][@"is_complete_info"] intValue];
  830. if (userinfo.youpaipalbum_list_new.count>0) {
  831. NSMutableArray *arrm = [NSMutableArray new];
  832. [userinfo.youpaipalbum_list_new enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  833. album_list_newModel *model = [album_list_newModel mj_objectWithKeyValues:obj];
  834. [arrm addObject:model];
  835. }];
  836. userinfo.youpaipalbum_list_new = arrm;
  837. }
  838. YOUPAIHRReddotModel *dotModel = [YOUPAIHRReddotModel mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"red_dot"]];
  839. self.youpaipdotModel = dotModel;
  840. YOUPAILCUserModel* userModel = [LCSaveModel getUserModel];
  841. userModel.youpaipuserinfo = userinfo;
  842. [LCSaveModel saveUserModel:userModel];
  843. [self.youpaipheaderView youpaifreloadUserInfoWithModel:userModel];
  844. [self.youpaipavatarImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:[LCSaveModel getUserModel].youpaipuserinfo.youpaipavatar]];
  845. YOUPAILCUserCountModel* userCount = [YOUPAILCUserCountModel mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"usercount"]];
  846. [self.youpaipheaderView youpaifreloadUserRedDotModel:dotModel];
  847. [self.youpaipheaderView youpaifreloadCountWithModel:userCount];
  848. [self.youpaipheaderView youpaifreloadUserLevelModel:[YOUPAILZLiveCardModel mj_objectWithKeyValues:[[dict objectForKey:@"data"]objectForKey:@"gr"]]];
  849. [self youpaifreloadDataSource];
  850. }
  851. } failure:^(NSError *error) {
  852. }];
  853. [LCHttpHelper requestWithURLString:WalletInit parameters:nil needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  854. NSDictionary* dict = (NSDictionary*)responseObject;
  855. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  856. if (code==0) {//成功
  857. CGFloat coin = [[[[dict objectForKey:@"data"]objectForKey:@"account"]objectForKey:@"coin"]integerValue];
  858. NSString *income_coin = [[[dict objectForKey:@"data"]objectForKey:@"account"]objectForKey:@"income_coin_money"];
  859. [self.youpaipheaderView youpaifreloadAccountWithBalance:coin profit:income_coin];
  860. }
  861. } failure:^(NSError *error) {
  862. }];
  863. }
  864. - (void)youpaifopenDontDisturb{
  865. NSString *status = [LCSaveData getProfileWuraoStatus] ? @"0" : @"1";
  866. [LCHttpHelper requestWithURLString:SetWuRaoStatus parameters:@{@"is_msg_refuse":status} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  867. NSDictionary* dict = (NSDictionary*)responseObject;
  868. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  869. if (code==0) {
  870. if ([status isEqualToString:@"1"]) {
  871. [ZCHUDHelper showTitle:@"打开勿打扰"];
  872. [LCSaveData saveProfileWuraoStatus:YES];
  873. // [self.youpaiptableView reloadData];
  874. }else{
  875. [ZCHUDHelper showTitle:@"关闭勿打扰"];
  876. [LCSaveData saveProfileWuraoStatus:NO];
  877. // [self.youpaiptableView reloadData];
  878. }
  879. }
  880. } failure:^(NSError *error) {
  881. }];
  882. }
  883. - (void)youpaifvideoSwitchValueChange:(UIButton*)switchView{
  884. NSInteger status = 0;
  885. if (switchView.selected == NO) {//将状态置为1空闲
  886. status = 0;
  887. }else{
  888. status = 1;
  889. }
  890. [LCHttpHelper requestWithURLString:BigCastSetVideoStatus parameters:@{@"status":@(status)} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  891. NSDictionary* dict = (NSDictionary*)responseObject;
  892. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  893. if (code==0) {
  894. if (status==0) {
  895. [ZCHUDHelper showTitle:@"关闭视频"];
  896. [LCSaveData saveVideoOpenStatu:NO];
  897. }else{
  898. [ZCHUDHelper showTitle:@"打开视频"];
  899. [LCSaveData saveVideoOpenStatu:YES];
  900. }
  901. }
  902. // [self.youpaiptableView reloadData];
  903. } failure:^(NSError *error) {
  904. }];
  905. }
  906. @end