YOUPAILZLiveUserInfoWindow.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. //
  2. // YOUPAILZLiveUserInfoWindow.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/6/21.
  6. // Copyright © 2021 leo. All rights reserved.
  7. //
  8. #import "YOUPAILZLiveUserInfoWindow.h"
  9. #import "YOUPAILZLevelView.h"
  10. #import "YOUPAILZAvatarView.h"
  11. #import "YOUPAIHRAgeSexView.h"
  12. @interface YOUPAILZLiveUserInfoWindow ()
  13. @property (nonatomic, strong) YOUPAILCUserShowModel *youpaipmodel;
  14. @property (nonatomic, assign) BOOL youpaipisAnchor;
  15. @property (nonatomic, assign) BOOL youpaipisManage;
  16. @end
  17. @implementation YOUPAILZLiveUserInfoWindow
  18. - (instancetype)initWithModel:(YOUPAILCUserShowModel *)model isAnchor:(BOOL)youpaipisAnchor isManage:(BOOL)youpaipisManage{
  19. if (self = [super init]) {
  20. _youpaipmodel = model;
  21. _youpaipisAnchor = youpaipisAnchor;
  22. _youpaipisManage = youpaipisManage;
  23. }
  24. return self;
  25. }
  26. - (void)viewDidLoad {
  27. [super viewDidLoad];
  28. self.baseView.hidden = YES;
  29. [self youpaifinitUI];
  30. }
  31. - (void)youpaifinitUI{
  32. UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 228.0f + SafeHeight)];
  33. // bgV.backgroundColor = [UIColor clearColor];
  34. // [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:bgV size:CGSizeMake(8.0f, 8.0f)];
  35. [self.view addSubview:bgV];
  36. [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
  37. make.left.offset(-0.5f);
  38. make.bottom.right.offset(0.5f);
  39. make.height.offset(228.0f + SafeHeight);
  40. }];
  41. UIImageView *avatarBgV = [[UIImageView alloc] init];
  42. // avatarBgV.backgroundColor = [UIColor whiteColor];
  43. [bgV addSubview:avatarBgV];
  44. [avatarBgV mas_makeConstraints:^(MASConstraintMaker *make) {
  45. make.edges.mas_equalTo(0);
  46. }];
  47. avatarBgV.image = [UIImage imageNamed:@"vqu_images_L_live_card_bg"];
  48. avatarBgV.userInteractionEnabled = YES;
  49. if (self.youpaipmodel.youpaipcard_info.youpaipfile.length != 0) {
  50. [avatarBgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.youpaipmodel.youpaipcard_info.youpaipfile]];
  51. }
  52. // UIImageView *cardImgV = [[UIImageView alloc] init];
  53. // [cardImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.model.card_info.file]];
  54. // [self.view addSubview:cardImgV];
  55. // [cardImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  56. // make.left.right.offset(0.0f);
  57. // make.top.equalTo(avatarBgV.mas_top).offset(ScaleSize(-10.0f-(65.0f/2.0f)));
  58. // make.height.offset(ScaleSize(192.0f));
  59. // }];
  60. YOUPAILZAvatarView *youpaipavatarView = [[YOUPAILZAvatarView alloc] initWithFrame:CGRectMake(0, 0, 55.0f, 55.0f) avatarURL:[LCTools getImageUrlWithAddress:self.youpaipmodel.youpaipinfo.youpaipavatar] personalityBoxURL:[LCTools getImageUrlWithAddress:self.youpaipmodel.youpaipinfo.youpaipavatar_frame]];
  61. [self.view addSubview:youpaipavatarView];
  62. [youpaipavatarView mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.centerX.offset(0.0f);
  64. make.top.equalTo(bgV.mas_top).offset(2.0f);
  65. make.size.mas_equalTo(CGSizeMake(55.0f, 55.0f));
  66. }];
  67. UITapGestureRecognizer *avatarTapG = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(youpaifavatarBtnClick)];
  68. [youpaipavatarView addGestureRecognizer:avatarTapG];
  69. // UIButton *avatarBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  70. // avatarBtn.layer.cornerRadius = 55/2;
  71. // avatarBtn.clipsToBounds = YES;
  72. // avatarBtn.imageView.contentMode = UIViewContentModeScaleAspectFill;
  73. // [avatarBtn sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.model.info.avatar] forState:UIControlStateNormal];
  74. // [avatarBtn addTarget:self action:@selector(avatarBtnClick) forControlEvents:UIControlEventTouchUpInside];
  75. // [avatarBgV addSubview:avatarBtn];
  76. // [avatarBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  77. // make.centerX.offset(2.0f);
  78. // make.top.offset(10.5f);
  79. // make.size.mas_equalTo(CGSizeMake(55, 55));
  80. // }];
  81. // CGFloat topHeight;
  82. // if (Is_iPhoneX) {
  83. // topHeight = 44;
  84. // }else{
  85. // topHeight = 34;
  86. // }
  87. UIButton *reportBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  88. [reportBtn setTitle:@"举报" forState:UIControlStateNormal];
  89. [reportBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  90. reportBtn.titleLabel.font = LCFont(10.0f);
  91. [reportBtn addTarget:self action:@selector(youpaifreportBtnClick) forControlEvents:UIControlEventTouchUpInside];
  92. [avatarBgV addSubview:reportBtn];
  93. [reportBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  94. make.right.offset(-14.0f);
  95. make.top.offset(36.0f);
  96. // make.size.mas_offset(CGSizeMake(70.0f, 30.0f));
  97. }];
  98. if (self.youpaipisAnchor || self.youpaipisManage) {
  99. UIButton *manageBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  100. [manageBtn setTitle:@"管理" forState:UIControlStateNormal];
  101. [manageBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  102. manageBtn.titleLabel.font = LCFont(10.0f);
  103. [manageBtn addTarget:self action:@selector(youpaifmanageBtnClick) forControlEvents:UIControlEventTouchUpInside];
  104. [avatarBgV addSubview:manageBtn];
  105. [manageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  106. make.right.equalTo(reportBtn.mas_left).offset(-7.0f);
  107. make.top.offset(36.0f);
  108. // make.size.mas_offset(CGSizeMake(70.0f, 30.0f));
  109. }];
  110. }
  111. UILabel* nickLab = [[UILabel alloc]init];
  112. nickLab.textColor = [UIColor whiteColor];
  113. nickLab.font = LCBoldFont(14.0f);
  114. [avatarBgV addSubview:nickLab];
  115. [nickLab makeConstraints:^(MASConstraintMaker *make) {
  116. make.centerX.equalTo(youpaipavatarView).offset(-9.0f);
  117. make.top.mas_equalTo(youpaipavatarView.mas_bottom).offset(14.0f);
  118. make.height.offset(14.0f);
  119. }];
  120. nickLab.text = self.youpaipmodel.youpaipinfo.youpaipnickname;
  121. nickLab.textAlignment = NSTextAlignmentLeft;
  122. YOUPAIHRAgeSexView *sexView = [YOUPAIHRAgeSexView new];
  123. [avatarBgV addSubview:sexView];
  124. [sexView makeConstraints:^(MASConstraintMaker *make) {
  125. make.left.equalTo(nickLab.right).offset(@3);
  126. make.centerY.equalTo(nickLab);
  127. make.size.mas_equalTo(CGSizeMake(30, 14));
  128. }];
  129. [sexView youpaifreloadWith:self.youpaipmodel.youpaipinfo.youpaipgender Age:self.youpaipmodel.youpaipinfo.youpaipage];
  130. //标签背景
  131. UIView *tagBgV = [UIView new];
  132. [avatarBgV addSubview:tagBgV];
  133. [tagBgV mas_makeConstraints:^(MASConstraintMaker *make) {
  134. make.top.equalTo(nickLab.mas_bottom).offset(5);
  135. make.centerX.equalTo(avatarBgV.mas_centerX);
  136. make.height.offset(17.0f);
  137. }];
  138. // 贵族
  139. UIImageView *youpaipvipImgV = [[UIImageView alloc] init];
  140. [tagBgV addSubview:youpaipvipImgV];
  141. // 榜单
  142. UIImageView *youpaipboardImgV = [[UIImageView alloc] init];
  143. [tagBgV addSubview:youpaipboardImgV];
  144. // 勋章
  145. UIImageView *youpaipbadgeImgV = [[UIImageView alloc] init];
  146. [tagBgV addSubview:youpaipbadgeImgV];
  147. // 等级
  148. YOUPAILZLevelView *youpaiplevelView = [[YOUPAILZLevelView alloc] init];
  149. [tagBgV addSubview:youpaiplevelView];
  150. //花舞号
  151. UIView *IDbgView = [UIView new];
  152. [avatarBgV addSubview:IDbgView];
  153. [IDbgView mas_makeConstraints:^(MASConstraintMaker *make) {
  154. make.left.mas_equalTo(91);
  155. make.right.mas_equalTo(-91);
  156. make.top.mas_equalTo(tagBgV.mas_bottom).offset(7);
  157. make.height.mas_equalTo(15);
  158. }];
  159. UIButton *idBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  160. idBtn.titleLabel.font = [UIFont systemFontOfSize:10];
  161. [idBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  162. [idBtn setTitle:[NSString stringWithFormat:@"花舞号:%@",self.youpaipmodel.youpaipinfo.youpaipusercode] forState:UIControlStateNormal];
  163. [idBtn addTarget:self action:@selector(youpaifcopyBtnClick) forControlEvents:UIControlEventTouchUpInside];
  164. [IDbgView addSubview:idBtn];
  165. [idBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  166. make.left.offset(0.0f);
  167. make.centerY.offset(0.0f);
  168. make.height.offset(12.0f);
  169. }];
  170. UIButton *copyIDBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  171. [copyIDBtn setImage:[UIImage imageNamed:@"vqu_images_ic_profile_copy_code"] forState:UIControlStateNormal];
  172. [copyIDBtn addTarget:self action:@selector(youpaifcopyBtnClick) forControlEvents:UIControlEventTouchUpInside];
  173. [IDbgView addSubview:copyIDBtn];
  174. [copyIDBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  175. make.left.equalTo(idBtn.mas_right).offset(4.0f);
  176. make.centerY.equalTo(idBtn.mas_centerY);
  177. make.size.mas_offset(CGSizeMake(12.0f, 12.0f));
  178. }];
  179. UIView *line1 = [[UIView alloc] init];
  180. line1.backgroundColor = [UIColor whiteColor];
  181. [IDbgView addSubview:line1];
  182. [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
  183. make.left.equalTo(copyIDBtn.mas_right).offset(10.0f);
  184. make.centerY.equalTo(idBtn.mas_centerY);
  185. make.size.mas_offset(CGSizeMake(0.5f, 7.0f));
  186. }];
  187. UILabel* youpaipcountL = [[UILabel alloc]init];
  188. youpaipcountL.textColor = [UIColor whiteColor];
  189. youpaipcountL.font = LCFont(10.0f);
  190. [IDbgView addSubview:youpaipcountL];
  191. [youpaipcountL makeConstraints:^(MASConstraintMaker *make) {
  192. make.left.equalTo(line1.mas_right).offset(7);
  193. make.centerY.equalTo(0);
  194. make.height.offset(11.0f);
  195. }];
  196. youpaipcountL.text = [NSString stringWithFormat:@"粉丝 %@ | 关注 %@",@(self.youpaipmodel.youpaipinfo.youpaipfans_count),@(self.youpaipmodel.youpaipinfo.youpaipfollow_count)];
  197. //简介
  198. UILabel* contentLabel = [[UILabel alloc]init];
  199. contentLabel.textColor = [UIColor whiteColor];
  200. contentLabel.font = LCFont(10.0f);
  201. [avatarBgV addSubview:contentLabel];
  202. [contentLabel makeConstraints:^(MASConstraintMaker *make) {
  203. make.centerX.equalTo(0);
  204. make.top.equalTo(IDbgView.mas_bottom).offset(3);
  205. make.height.offset(10.0f);
  206. make.width.mas_lessThanOrEqualTo(200);
  207. }];
  208. contentLabel.text = self.youpaipmodel.youpaipinfo.youpaipsign;
  209. contentLabel.lineBreakMode = NSLineBreakByTruncatingTail;
  210. //赠送砖石
  211. UILabel* dashangLabel = [[UILabel alloc]init];
  212. dashangLabel.textColor = HexColorFromRGB(0xffffff);
  213. dashangLabel.font = LCFont(10.0f);
  214. [avatarBgV addSubview:dashangLabel];
  215. [dashangLabel makeConstraints:^(MASConstraintMaker *make) {
  216. make.centerX.equalTo(0);
  217. make.top.equalTo(contentLabel.mas_bottom).offset(12);
  218. make.height.offset(10.0f);
  219. }];
  220. dashangLabel.text = [NSString stringWithFormat:@"赠送钻石:%d",[self.youpaipmodel.youpaipgr.youpaipgrade.youpaiptotal_growth intValue]];
  221. UIView *line = [[UIView alloc] init];
  222. line.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.4f];
  223. [avatarBgV addSubview:line];
  224. [line mas_makeConstraints:^(MASConstraintMaker *make) {
  225. make.left.right.offset(0.0f);
  226. make.top.equalTo(dashangLabel.mas_bottom).offset(15.0f);
  227. make.height.offset(0.5f);
  228. }];
  229. NSArray *btnContents = @[
  230. @{@"image":[UIImage new],@"selectedImage":[UIImage new],@"title":@"关注",@"selectedTitle":@"取消关注",@"titleColor":HexColorFromRGB(0xffffff),@"selectedTitleColor":HexColorFromRGB(0xffffff),@"isSelected":@(self.youpaipmodel.youpaipinfo.youpaipis_follow)},
  231. @{@"image":[UIImage imageNamed:@"vqu_images_IM_card_shouhu"],@"selectedImage":[UIImage imageNamed:@"vqu_images_IM_card_shouhu"],@"title":@"守护",@"selectedTitle":@"守护",@"titleColor":HexColorFromRGB(0xffffff),@"selectedTitleColor":HexColorFromRGB(0xffffff),@"isSelected":@(NO)},
  232. @{@"image":[UIImage imageNamed:@"vqu_images_L_live_userinfo_gift_new"],@"selectedImage":[UIImage imageNamed:@"vqu_images_L_live_userinfo_gift_new"],@"title":@"送礼",@"selectedTitle":@"送礼",@"titleColor":HexColorFromRGB(0xffffff),@"selectedTitleColor":HexColorFromRGB(0xffffff),@"isSelected":@(NO),},
  233. @{@"image":[UIImage new],@"selectedImage":[UIImage new],@"title":@"私信",@"selectedTitle":@"私信",@"titleColor":HexColorFromRGB(0xffffff),@"selectedTitleColor":HexColorFromRGB(0xffffff),@"isSelected":@(NO),}
  234. ];
  235. NSMutableArray <UIButton *>*youpaipbtns = [NSMutableArray array];
  236. for (NSInteger i = 0; i < btnContents.count; i ++) {
  237. NSDictionary *dict = btnContents[i];
  238. UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
  239. [btn setTitle:dict[@"title"] forState:UIControlStateNormal];
  240. [btn setTitle:dict[@"selectedTitle"] forState:UIControlStateSelected];
  241. [btn setTitleColor:dict[@"titleColor"] forState:UIControlStateNormal];
  242. [btn setTitleColor:dict[@"selectedTitleColor"] forState:UIControlStateSelected];
  243. [btn setImage:dict[@"image"] forState:UIControlStateNormal];
  244. [btn setImage:dict[@"selectedImage"] forState:UIControlStateSelected];
  245. btn.selected = [dict[@"isSelected"] boolValue];
  246. btn.titleLabel.font = LCFont13;
  247. btn.tag = i;
  248. [btn addTarget:self action:@selector(youpaifbtnClick:) forControlEvents:UIControlEventTouchUpInside];
  249. [avatarBgV addSubview:btn];
  250. [youpaipbtns addObject:btn];
  251. }
  252. [youpaipbtns mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
  253. [youpaipbtns mas_makeConstraints:^(MASConstraintMaker *make) {
  254. make.top.equalTo(line.mas_bottom).offset(0.0f);
  255. make.height.equalTo(44.0f);
  256. }];
  257. CGFloat x = KScreenWidth / 4.0f;
  258. for (NSInteger i = 0; i < 3; i ++) {
  259. UIView *v = [[UIView alloc] init];
  260. v.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.4f];
  261. [avatarBgV addSubview:v];
  262. [v mas_makeConstraints:^(MASConstraintMaker *make) {
  263. make.left.offset((i + 1) * x);
  264. make.top.equalTo(line.mas_bottom).offset(15.0f);
  265. make.width.offset(0.5f);
  266. make.height.offset(14.0f);
  267. }];
  268. }
  269. UIImageView *anchorTagImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_anchor_vlog"]];
  270. [self.view addSubview:anchorTagImgV];
  271. [anchorTagImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  272. make.right.equalTo(youpaipavatarView.youpaipavatarImgV.mas_right).offset(0.0f);
  273. make.bottom.equalTo(youpaipavatarView.youpaipavatarImgV.mas_bottom).offset(0.0f);
  274. make.size.mas_offset(CGSizeMake(10.0f, 10.0f));
  275. }];
  276. anchorTagImgV.hidden = self.youpaipmodel.youpaipinfo.youpaipis_live != 1;
  277. UIView *frontV;
  278. if (self.youpaipmodel.youpaipinfo.youpaipvip_icon.length != 0) {
  279. [youpaipvipImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.youpaipmodel.youpaipinfo.youpaipvip_icon]];
  280. [youpaipvipImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  281. if (frontV == nil) {
  282. make.left.offset(0.0f);
  283. }else{
  284. make.left.equalTo(frontV.mas_right).offset(3.0f);
  285. }
  286. make.centerY.equalTo(0.0f);
  287. make.size.mas_offset(CGSizeMake(30.0f, 19.0f));
  288. }];
  289. frontV = youpaipvipImgV;
  290. }
  291. if (self.youpaipmodel.youpaipgr.youpaiprank.youpaipimg.length != 0) {
  292. [youpaipboardImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.youpaipmodel.youpaipgr.youpaiprank.youpaipimg]];
  293. [youpaipboardImgV mas_remakeConstraints:^(MASConstraintMaker *make) {
  294. if (frontV == nil) {
  295. make.left.offset(0.0f);
  296. }else{
  297. make.left.equalTo(frontV.mas_right).offset(3.0f);
  298. }
  299. make.centerY.equalTo(0.0f);
  300. make.size.mas_offset(CGSizeMake(21.0f, 18.0f));
  301. }];
  302. frontV = youpaipboardImgV;
  303. }
  304. if (self.youpaipmodel.youpaipbadge_info.youpaipfile.length != 0) {
  305. [youpaipbadgeImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.youpaipmodel.youpaipbadge_info.youpaipfile]];
  306. [youpaipbadgeImgV mas_remakeConstraints:^(MASConstraintMaker *make) {
  307. if (frontV == nil) {
  308. make.left.offset(0.0f);
  309. }else{
  310. make.left.equalTo(frontV.mas_right).offset(3.0f);
  311. }
  312. make.centerY.equalTo(0.0f);
  313. make.size.mas_offset(CGSizeMake(self.youpaipmodel.youpaipbadge_info.youpaipwidth, 17.0f));
  314. }];
  315. frontV = youpaipbadgeImgV;
  316. }
  317. [youpaiplevelView youpaifreloadWithIcon:self.youpaipmodel.youpaipgr.youpaipgrade.youpaipimg1 iconWidth:self.youpaipmodel.youpaipgr.youpaipgrade.youpaipicon_width bgImg:self.youpaipmodel.youpaipgr.youpaipgrade.youpaipimg2 bgImgWidth:self.youpaipmodel.youpaipgr.youpaipgrade.youpaipicon1_width levelName:self.youpaipmodel.youpaipgr.youpaipgrade.youpaipgrade_name level:self.youpaipmodel.youpaipgr.youpaipgrade.youpaipgrade];
  318. [youpaiplevelView mas_remakeConstraints:^(MASConstraintMaker *make) {
  319. if (frontV == nil) {
  320. make.left.offset(0.0f);
  321. }else{
  322. make.left.equalTo(frontV.mas_right).offset(3.0f);
  323. }
  324. make.centerY.equalTo(0);
  325. make.size.mas_offset(youpaiplevelView.mj_size);
  326. make.right.offset(0.0f);
  327. }];
  328. }
  329. // 复制ID点击事件
  330. - (void)youpaifcopyBtnClick{
  331. UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
  332. pasteboard.string = self.youpaipmodel.youpaipinfo.youpaipusercode;
  333. [ZCHUDHelper showTitle:@"复制成功"];
  334. }
  335. - (void)youpaifavatarBtnClick{
  336. if(!self.youpaipisAnchor){
  337. [self dismissViewControllerAnimated:YES completion:^{
  338. if (self.youpaipuserShowBlock != nil) {
  339. self.youpaipuserShowBlock(self.youpaipmodel);
  340. }
  341. }];
  342. }
  343. }
  344. - (void)youpaifreportBtnClick{
  345. if(!self.youpaipisAnchor){
  346. [self dismissViewControllerAnimated:YES completion:^{
  347. if (self.youpaipreportBlock != nil) {
  348. self.youpaipreportBlock(self.youpaipmodel);
  349. }
  350. }];
  351. }
  352. }
  353. - (void)youpaifmanageBtnClick{
  354. [self dismissViewControllerAnimated:YES completion:^{
  355. if (self.youpaipmanageBlock != nil) {
  356. self.youpaipmanageBlock(self.youpaipmodel,self.youpaipisAnchor);
  357. }
  358. }];
  359. }
  360. - (void)youpaifbtnClick:(UIButton *)sender{
  361. if ([self.youpaipmodel.youpaipinfo.youpaipuserid isEqual:[LCSaveModel getUserModel].youpaipuserinfo.youpaipuser_id] && sender.tag == 0) {
  362. [ZCHUDHelper showTitle:@"不能关注自己哦~"];
  363. return;
  364. }
  365. sender.selected = !sender.selected;
  366. if (sender.tag == 0) {
  367. [LCCommonHttp followUserId:self.youpaipmodel.youpaipinfo.youpaipuserid];
  368. }else if (sender.tag == 1){
  369. [self dismissViewControllerAnimated:YES completion:^{
  370. if (self.youpaipguardBlock != nil) {
  371. self.youpaipguardBlock(self.youpaipmodel);
  372. }
  373. }];
  374. }else if (sender.tag == 2){
  375. [self dismissViewControllerAnimated:YES completion:^{
  376. if (self.youpaipgiftBlock != nil) {
  377. self.youpaipgiftBlock(self.youpaipmodel);
  378. }
  379. }];
  380. }else if (sender.tag == 3){
  381. [self dismissViewControllerAnimated:YES completion:^{
  382. if (self.youpaipsiXinBlock != nil) {
  383. self.youpaipsiXinBlock(self.youpaipmodel);
  384. }
  385. }];
  386. }
  387. }
  388. @end