MineViewController.m 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. //
  2. // MineViewController.m
  3. // BuguLive
  4. //
  5. // Created by Mac on 2021/7/6.
  6. // Copyright © 2021 xfg. All rights reserved.
  7. //
  8. #import "MineViewController.h"
  9. #import "userPageModel.h"
  10. #import "BogoShopKit.h"
  11. #import "SIdentificationVC.h"
  12. #import "SChargerVC.h"
  13. #import "BogoSetViewController.h"
  14. #import "SHomePageVC.h"
  15. #import "SignViewController.h"
  16. #import "SVGAHeader.h"
  17. #import "EditFamilyViewController.h"
  18. #import "FamilyDesViewController.h"
  19. #import "FamilyListViewController.h"
  20. #import "SocietyListViewController.h"
  21. #import "EditSocietyViewController.h"
  22. #import "SocietyDesViewController.h"
  23. #import "SocietyDetailVC.h"
  24. //邀请赚钱
  25. #import "BogoShareInviteViewController.h"
  26. //新充值界面
  27. #import "BogoRechargeViewController.h"
  28. //贵族列表
  29. #import "BogoNobleViewController.h"
  30. #import "IncomeViewController.h"
  31. #import "BogoNetworkKit.h"
  32. #import "BGEditInfoController.h"
  33. #import "PerfectInfoPopView.h"
  34. #import "BogoGuildKit.h"
  35. #import "BogoInviteViewController.h"
  36. #import "UIImageView+RTL.h"
  37. #import "IconInfoView.h"
  38. #import "MerchantEnrollViewController.h"
  39. @interface MineViewController ()<PerfectInfoPopViewDelegate>
  40. @property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
  41. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *topViewHeight;
  42. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentViewHeight;
  43. @property (weak, nonatomic) IBOutlet QMUIButton *signBtn;
  44. @property (weak, nonatomic) IBOutlet UIImageView *authImgView;
  45. @property (weak, nonatomic) IBOutlet QMUIButton *nobleCenterBtn;
  46. @property (weak, nonatomic) IBOutlet QMUIButton *itemShopBtn;
  47. @property (weak, nonatomic) IBOutlet QMUIButton *levelBtn;
  48. @property (weak, nonatomic) IBOutlet QMUIButton *familyBtn;
  49. @property (weak, nonatomic) IBOutlet QMUIButton *allOrderBtn;
  50. @property (weak, nonatomic) IBOutlet QMUIButton *waitPayBtn;
  51. @property (weak, nonatomic) IBOutlet QMUIButton *waitTransferBtn;
  52. @property (weak, nonatomic) IBOutlet QMUIButton *waitConfirmBtn;
  53. @property (weak, nonatomic) IBOutlet QMUIButton *refundBtn;
  54. @property (weak, nonatomic) IBOutlet QMUIButton *applyBtn;
  55. @property (weak, nonatomic) IBOutlet QMUIButton *goodManageBtn;
  56. @property (weak, nonatomic) IBOutlet QMUIButton *orderManageBtn;
  57. @property (weak, nonatomic) IBOutlet QMUIButton *dataBtn;
  58. @property (weak, nonatomic) IBOutlet QMUIButton *authBtn;
  59. @property (weak, nonatomic) IBOutlet QMUIButton *inviteBtn;
  60. @property (weak, nonatomic) IBOutlet QMUIButton *logBtn;
  61. @property (weak, nonatomic) IBOutlet QMUIButton *setBtn;
  62. @property (weak, nonatomic) IBOutlet QMUIButton *openVipBtn;
  63. @property (weak, nonatomic) IBOutlet QMUIButton *serverBtn;
  64. @property (weak, nonatomic) IBOutlet QMUIButton *merchantsAuthBtn;
  65. @property(nonatomic, strong) userPageModel *userModel;
  66. @property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
  67. @property (weak, nonatomic) IBOutlet UILabel *nameLabel;
  68. @property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
  69. @property (weak, nonatomic) IBOutlet UIImageView *VIPImgV;
  70. @property (weak, nonatomic) IBOutlet UIImageView *levelImgV;
  71. //实名认证标识
  72. @property (weak, nonatomic) IBOutlet UIImageView *shimingBGImgV;
  73. @property (weak, nonatomic) IBOutlet UIImageView *shimingIconImgV;
  74. @property (weak, nonatomic) IBOutlet UILabel *shiminglabel;
  75. @property (weak, nonatomic) IBOutlet UIImageView *rankImageView;
  76. @property (weak, nonatomic) IBOutlet UIImageView *authImageView;
  77. @property (weak, nonatomic) IBOutlet UILabel *idLabel;
  78. @property (weak, nonatomic) IBOutlet UILabel *accountLabel;
  79. @property (weak, nonatomic) IBOutlet UILabel *profitLabel;
  80. @property (weak, nonatomic) IBOutlet UIView *profitView;
  81. @property (weak, nonatomic) IBOutlet UIView *accountView;
  82. @property (weak, nonatomic) IBOutlet UIImageView *topView;
  83. @property (weak, nonatomic) IBOutlet QMUIButton *earningsBtn;
  84. /*
  85. 公会相关
  86. */
  87. @property (nonatomic, strong) UIView *backgroundView; //大的背景遮罩
  88. @property (nonatomic, strong) UIView *backView; //小的背景遮罩
  89. @property (nonatomic, strong) UIView *bigView; //背景图
  90. @property (nonatomic, strong) UIButton *addFamilyBtn; //加入公会按钮
  91. @property (nonatomic, strong) UIButton *createBtn; //创建公会按钮
  92. @property (nonatomic, strong) UIButton *bigButton;
  93. /*
  94. 公会相关
  95. */
  96. @property (nonatomic, strong) UIView *backgroundViewTwo; //大的背景遮罩
  97. @property (nonatomic, strong) UIView *backViewTwo; //小的背景遮罩
  98. @property (nonatomic, strong) UIView *bigViewTwo; //背景图
  99. @property (nonatomic, strong) UIButton *addSocietyBtn; //加入公会按钮
  100. @property (nonatomic, strong) UIButton *createSocietyBtn; //创建公会按钮
  101. @property (nonatomic, strong) UIButton *bigBtn;
  102. @property (weak, nonatomic) IBOutlet UIImageView *nobleImageView;
  103. @property (weak, nonatomic) IBOutlet UILabel *nobleNameLabel;
  104. @property (weak, nonatomic) IBOutlet UILabel *nobleTipLabel;
  105. //@property (weak, nonatomic) IBOutlet QMUIButton *nobleMoreBtn;
  106. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *openBtnWidthConstraint;
  107. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *applyShopWidthConstraint;
  108. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *shopManagerWidthConstraint;
  109. @property (weak, nonatomic) IBOutlet UIImageView *imgBanner;
  110. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *nobleNextBtnWidth;
  111. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *editLeftConstraint;
  112. @property (weak, nonatomic) IBOutlet UIImageView *vipImageView;
  113. @property(nonatomic, strong) PerfectInfoPopView *infoPopView;
  114. @property (weak, nonatomic) IBOutlet UIImageView *wimage;
  115. @property(nonatomic, strong) SVGAHeader *svgaHeader;
  116. @property(nonatomic, strong) IconInfoView *iconInfoView;
  117. @property (weak, nonatomic) IBOutlet UIImageView *rtlDiamonds;
  118. @property (weak, nonatomic) IBOutlet UIImageView *rtlInccome;
  119. @end
  120. @implementation MineViewController
  121. - (void)viewDidLoad {
  122. [super viewDidLoad];
  123. // Do any additional setup after loading the view from its nib.
  124. self.topViewHeight.constant = 342;
  125. self.contentViewHeight.constant = kTopHeight + 776;
  126. self.view.backgroundColor = kWhiteColor;
  127. self.nobleCenterBtn.imagePosition = QMUIButtonImagePositionTop;
  128. self.itemShopBtn.imagePosition = QMUIButtonImagePositionTop;
  129. self.levelBtn.imagePosition = QMUIButtonImagePositionTop;
  130. self.familyBtn.imagePosition = QMUIButtonImagePositionTop;
  131. self.allOrderBtn.imagePosition = QMUIButtonImagePositionRight;
  132. self.waitPayBtn.imagePosition = QMUIButtonImagePositionTop;
  133. self.waitTransferBtn.imagePosition = QMUIButtonImagePositionTop;
  134. self.waitConfirmBtn.imagePosition = QMUIButtonImagePositionTop;
  135. self.refundBtn.imagePosition = QMUIButtonImagePositionTop;
  136. self.applyBtn.imagePosition = QMUIButtonImagePositionTop;
  137. self.goodManageBtn.imagePosition = QMUIButtonImagePositionTop;
  138. self.orderManageBtn.imagePosition = QMUIButtonImagePositionTop;
  139. self.dataBtn.imagePosition = QMUIButtonImagePositionTop;
  140. self.authBtn.imagePosition = QMUIButtonImagePositionTop;
  141. self.inviteBtn.imagePosition = QMUIButtonImagePositionTop;
  142. self.logBtn.imagePosition = QMUIButtonImagePositionTop;
  143. self.setBtn.imagePosition = QMUIButtonImagePositionTop;
  144. self.serverBtn.imagePosition = QMUIButtonImagePositionTop;
  145. self.earningsBtn.imagePosition = QMUIButtonImagePositionTop;
  146. self.merchantsAuthBtn.imagePosition = QMUIButtonImagePositionTop;
  147. // self.openVipBtn.imagePosition = QMUIButtonImagePositionRight;
  148. self.signBtn.imagePosition = QMUIButtonImagePositionLeft;
  149. self.nobleCenterBtn.spacingBetweenImageAndTitle = 5;
  150. self.itemShopBtn.spacingBetweenImageAndTitle = 5;
  151. self.levelBtn.spacingBetweenImageAndTitle = 5;
  152. self.familyBtn.spacingBetweenImageAndTitle = 5;
  153. self.allOrderBtn.spacingBetweenImageAndTitle = 5;
  154. self.waitPayBtn.spacingBetweenImageAndTitle = 5;
  155. self.waitTransferBtn.spacingBetweenImageAndTitle = 5;
  156. self.waitConfirmBtn.spacingBetweenImageAndTitle = 5;
  157. self.refundBtn.spacingBetweenImageAndTitle = 5;
  158. self.applyBtn.spacingBetweenImageAndTitle = 5;
  159. self.goodManageBtn.spacingBetweenImageAndTitle = 5;
  160. self.orderManageBtn.spacingBetweenImageAndTitle = 5;
  161. self.dataBtn.spacingBetweenImageAndTitle = 5;
  162. self.authBtn.spacingBetweenImageAndTitle = 5;
  163. self.inviteBtn.spacingBetweenImageAndTitle = 5;
  164. self.logBtn.spacingBetweenImageAndTitle = 5;
  165. self.setBtn.spacingBetweenImageAndTitle = 5;
  166. self.serverBtn.spacingBetweenImageAndTitle = 5;
  167. self.merchantsAuthBtn.spacingBetweenImageAndTitle = 5;
  168. [self.nobleNameLabel sizeToFit];
  169. [self.nobleNameLabel setAdjustsFontSizeToFitWidth:YES];
  170. // self.openVipBtn.spacingBetweenImageAndTitle = 5;
  171. self.signBtn.spacingBetweenImageAndTitle = 5;
  172. [self.serverBtn setTitle:ASLocalizedString(@"客服") forState:UIControlStateNormal];
  173. [self.earningsBtn setTitle:ASLocalizedString(@"收益") forState:UIControlStateHighlighted];
  174. if (@available(iOS 11.0, *)) {
  175. self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  176. } else {
  177. // Fallback on earlier versions
  178. self.automaticallyAdjustsScrollViewInsets = NO;
  179. }
  180. [self setNeedsStatusBarAppearanceUpdate];
  181. [self.accountView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(accountViewAction)]];
  182. [self.allOrderBtn setTitle:ASLocalizedString(@"查看全部订单") forState:UIControlStateNormal];
  183. [self.openVipBtn setTitle:ASLocalizedString(@"开通贵族") forState:UIControlStateNormal];
  184. [self.openVipBtn.titleLabel sizeToFit];
  185. [self.openVipBtn.titleLabel setAdjustsFontSizeToFitWidth:YES];
  186. [self.profitView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(profitViewAction)]];
  187. // [self.topView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(topViewAction)]];
  188. // [self.signBtn setTitle:ASLocalizedString(@"已签到") forState:UIControlStateSelected];
  189. [self.signBtn.titleLabel adjustsFontSizeToFitWidth];
  190. self.wimage.image = [UIImage imageNamed:@"bogo_me_top_income"];
  191. ViewRadius(self.imgBanner, 5);
  192. self.svgaHeader = [[SVGAHeader alloc] init];
  193. self.svgaHeader.layer.masksToBounds = NO;
  194. self.svgaHeader.userInteractionEnabled = NO;
  195. [self.view addSubview:self.svgaHeader];
  196. [self.svgaHeader mas_makeConstraints:^(MASConstraintMaker *make) {
  197. make.center.equalTo(self.iconImageView);
  198. make.height.and.width.equalTo(self.iconImageView).offset(32);
  199. }];
  200. self.iconInfoView = [[IconInfoView alloc] init];
  201. [self.view addSubview:self.iconInfoView];
  202. [self.iconInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
  203. make.top.equalTo(self.idLabel.mas_bottom).offset(3);
  204. make.centerX.equalTo(self.view);
  205. make.height.equalTo(@17);
  206. }];
  207. self.iconInfoView.ageView.hidden = YES;
  208. self.iconInfoView.vipView.hidden = YES;
  209. self.iconInfoView.nobleView.hidden = YES;
  210. [self.iconInfoView updateConstraintsIfNeeded];
  211. //rtl
  212. self.rtlDiamonds.image = [self.rtlDiamonds.image checkOverturn];
  213. self.rtlInccome.image = [self.rtlInccome.image checkOverturn];
  214. if (kIsCheckingVersion()) {
  215. [self.inviteBtn setTitle:ASLocalizedString(@"我的公会") forState:UIControlStateNormal];
  216. }
  217. }
  218. - (IBAction)earningsClick:(id)sender {
  219. NSString *url = [GlobalVariables sharedInstance].appModel.h5_url.month_statistics_log;
  220. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:url isShowIndicator:YES isShowNavBar:NO isShowBackBtn:NO];
  221. // tmpController.navTitleStr = ASLocalizedString(@"道具商城");
  222. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  223. return;
  224. }
  225. - (IBAction)serverClick:(id)sender {
  226. }
  227. - (void)viewWillAppear:(BOOL)animated{
  228. [super viewWillAppear:animated];
  229. [self.navigationController setNavigationBarHidden:YES animated:NO];
  230. [self requestData];
  231. [self requestDataToady];
  232. [self requestNumberData];
  233. }
  234. - (void)requestData{
  235. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  236. [parmDict setObject:@"user" forKey:@"ctl"];
  237. [parmDict setObject:@"userinfo" forKey:@"act"];
  238. FWWeakify(self)
  239. [self.httpsManager POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson)
  240. {
  241. FWStrongify(self)
  242. if ([responseJson toInt:@"status"] == 1)
  243. {
  244. _userModel = [userPageModel mj_objectWithKeyValues:[responseJson objectForKey:@"user"]];
  245. UserModel *model = [UserModel modelWithDictionary:[responseJson objectForKey:@"user"]];
  246. // [GlobalVariables sharedInstance].is_noble_mysterious = _userModel.is_noble_mysterious;
  247. [GlobalVariables sharedInstance].userModel = model;
  248. CGFloat viewWidth = (kScreenW - 10 * 2) / 4;
  249. if (_userModel.shop_status.integerValue == 1 || _userModel.shop_status.integerValue == 4) {
  250. self.applyShopWidthConstraint.constant = 0;
  251. self.shopManagerWidthConstraint.constant = viewWidth;
  252. self.applyBtn.hidden = YES;
  253. }else{
  254. self.applyBtn.hidden = NO;
  255. self.shopManagerWidthConstraint.constant = self.applyShopWidthConstraint.constant = viewWidth;
  256. }
  257. self.vipImageView.hidden = !_userModel.is_vip.integerValue;
  258. if (_userModel.is_vip.integerValue) {
  259. self.editLeftConstraint.constant = 20;
  260. }else{
  261. self.editLeftConstraint.constant = 5;
  262. }
  263. [self.svgaHeader setHeaderUrl:model.avatar_frame_url];
  264. [self reloadData];
  265. /*if (!_userModel.is_tips.integerValue) {
  266. [self.infoPopView show:[UIApplication sharedApplication].keyWindow type:FDPopTypeBottom];
  267. [self.httpsManager POSTWithParameters:[NSMutableDictionary dictionaryWithDictionary:@{@"ctl":@"login",@"act":@"is_tips"}] SuccessBlock:^(NSDictionary *responseJson) {
  268. } FailureBlock:^(NSError *error) {
  269. }];
  270. }*/
  271. }else
  272. {
  273. [FanweMessage alertHUD:[responseJson toString:@"error"]];
  274. }
  275. } FailureBlock:^(NSError *error)
  276. {
  277. }];
  278. }
  279. - (void)reloadData{
  280. self.iconImageView.contentMode = UIViewContentModeScaleAspectFill;
  281. [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:_userModel.head_image] placeholderImage:kDefaultPreloadHeadImg];
  282. self.nameLabel.text = _userModel.nick_name;
  283. self.sexImageView.image = [UIImage imageNamed:_userModel.sex.integerValue == 1 ? @"dy_sex_male" : @"dy_sex_female"];
  284. self.iconInfoView.levelView.image = [UIImage imageNamed:[NSString stringWithFormat:@"level%ld",_userModel.user_level.integerValue]];
  285. self.iconInfoView.levelView.hidden = YES;
  286. self.levelImgV.image = [UIImage imageNamed:[NSString stringWithFormat:@"level%ld",_userModel.user_level.integerValue]];
  287. if(StrValid(_userModel.noble_icon))
  288. {
  289. self.iconInfoView.nobleView.hidden = NO;
  290. [self.iconInfoView.nobleView sd_setImageWithURL:[NSURL URLWithString:SafeStr(_userModel.noble_icon)]];
  291. }
  292. else
  293. {
  294. self.iconInfoView.nobleView.hidden = YES;
  295. }
  296. //隐藏贵族图标
  297. self.iconInfoView.nobleView.hidden = YES;
  298. if(_userModel.is_vip.intValue)
  299. {
  300. self.iconInfoView.vipView.hidden = NO;
  301. self.VIPImgV.hidden = NO;
  302. }
  303. else
  304. {
  305. self.iconInfoView.vipView.hidden = YES;
  306. self.VIPImgV.hidden = YES;
  307. }
  308. [self.iconInfoView updateConstraintsIfNeeded];
  309. self.rankImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"level%ld",_userModel.user_level.integerValue]];
  310. self.idLabel.text = [NSString stringWithFormat:@"ID:%@",_userModel.user_id];
  311. if (_userModel.luck_num.length && [_userModel.luck_num intValue] > 0)
  312. {
  313. self.idLabel.text = [NSString stringWithFormat:@"ID: %@",_userModel.luck_num];
  314. }
  315. // float diamond = _userModel.diamonds.doubleValue;
  316. // if (diamond > 10000) {
  317. self.accountLabel.text = [NSString stringWithFormat:@"%@:%@",ASLocalizedString(@"钻石"),_userModel.n_diamonds];
  318. // }else{
  319. // self.accountLabel.text = [NSString stringWithFormat:@"%@:%.0f",ASLocalizedString(@"钻石余额"),diamond];
  320. // }
  321. self.profitLabel.text = [NSString stringWithFormat:@"%@:%@",ASLocalizedString(@"金币"),_userModel.ticket];
  322. self.authImgView.hidden = _userModel.is_authentication.intValue != 2;
  323. [self.authImgView setImage:[UIImage imageNamed:ASLocalizedString(@"mg_zhifu_certication")]];
  324. self.authImgView.hidden = YES;
  325. if (_userModel.is_authentication.intValue != 2) {
  326. self.shimingBGImgV.image = [UIImage imageNamed:@"mine_shimingiconBg"];
  327. self.shimingIconImgV.image = [UIImage imageNamed:@"mine_shimingicon"];
  328. self.shiminglabel.textColor = [UIColor colorWithHexString:@"#999999"];
  329. } else {
  330. self.shimingBGImgV.image = [UIImage imageNamed:@"mine_shimingiconBg_already"];
  331. self.shimingIconImgV.image = [UIImage imageNamed:@"mine_shimingicon_already"];
  332. self.shiminglabel.textColor = UIColor.whiteColor;
  333. }
  334. self.shiminglabel.text = ASLocalizedString(@"实名");
  335. if (_userModel.noble_name.length) {
  336. self.nobleNameLabel.text = _userModel.noble_name;
  337. [self.nobleImageView sd_setImageWithURL:[NSURL URLWithString:_userModel.noble_shop]];
  338. // self.nobleTipLabel.text = ASLocalizedString(@"解锁更多专属特权");
  339. self.nobleTipLabel.text = [NSString stringWithFormat:@"| %@",self.userModel.noble_time];
  340. // [self.nobleMoreBtn setTitle:ASLocalizedString(@"查看权益") forState:UIControlStateNormal];
  341. [self.openVipBtn setTitle:ASLocalizedString(@"续费贵族") forState:UIControlStateNormal];
  342. self.openBtnWidthConstraint.constant = 75;
  343. self.nobleNextBtnWidth.constant = 80;
  344. }
  345. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
  346. [self.iconImageView addGestureRecognizer:tap];
  347. [self.iconImageView setUserInteractionEnabled:YES];
  348. [tap addTarget:self action:@selector(tapPushPerson)];
  349. }
  350. -(void)tapPushPerson{
  351. SHomePageVC *tmpController= [[SHomePageVC alloc]init];
  352. tmpController.user_id = _userModel.user_id;
  353. tmpController.type = 0;
  354. [[AppDelegate sharedAppDelegate]pushViewController:tmpController animated:YES];
  355. }
  356. - (void)requestDataToady{
  357. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  358. [parmDict setObject:@"index" forKey:@"ctl"];
  359. [parmDict setObject:@"is_signin" forKey:@"act"];
  360. FWWeakify(self)
  361. [[NetHttpsManager manager] POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson) {
  362. FWStrongify(self)
  363. self.signBtn.selected = [responseJson toInt:@"today_signin"] == 1;
  364. self.signBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
  365. [self.signBtn.titleLabel adjustsFontSizeToFitWidth];
  366. } FailureBlock:^(NSError *error) {
  367. }];
  368. }
  369. - (void)requestNumberData{
  370. // /shopapi/order_api/getUserOrderNumUrl?token=5128c13ee8ecce49649a47187a4bcd0a
  371. [[BogoNetwork shareInstance] GET:@"order_api/getUserOrderNumUrl" param:nil success:^(BogoNetworkResponseModel * _Nonnull result) {
  372. // goods_payment": 5, 待付款数量
  373. // "goods_shipped": 0, 待发货数量
  374. // "goods_received": 1, 待收货数量
  375. // "goods_refund": 0, 退货退款的数量
  376. // "order_manage": 0 商家订单管理
  377. NSString *goods_payment = [NSString stringWithFormat:@"%@",result.data[@"goods_payment"]];
  378. NSString *goods_shipped = [NSString stringWithFormat:@"%@",result.data[@"goods_shipped"]];
  379. NSString *goods_received = [NSString stringWithFormat:@"%@",result.data[@"goods_received"]];
  380. NSString *goods_refund = [NSString stringWithFormat:@"%@",result.data[@"goods_refund"]];
  381. NSString *order_manage = [NSString stringWithFormat:@"%@",result.data[@"order_manage"]];
  382. [self addBadgeForButton:self.waitPayBtn andBadge:goods_payment];
  383. [self addBadgeForButton:self.waitTransferBtn andBadge:goods_shipped];
  384. [self addBadgeForButton:self.waitConfirmBtn andBadge:goods_received];
  385. [self addBadgeForButton:self.refundBtn andBadge:goods_refund];
  386. [self addBadgeForButton:self.orderManageBtn andBadge:order_manage];
  387. } failure:^(NSString * _Nonnull error) {
  388. }];
  389. }
  390. - (void)addBadgeForButton:(UIButton *)sender andBadge:(NSString *)badge{
  391. sender.shouldHideBadgeAtZero = YES;
  392. sender.badgeValue = badge;
  393. sender.badgeOriginX = self.waitPayBtn.width * 3 / 5;
  394. sender.badgeOriginY = self.waitPayBtn.height / 8;
  395. sender.badgeFont = [UIFont systemFontOfSize:10];
  396. }
  397. - (IBAction)itemShopBtnAction:(QMUIButton *)sender {
  398. NSString *pay_nobleUrl = [GlobalVariables sharedInstance].appModel.h5_url.shop_url;
  399. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:pay_nobleUrl isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  400. tmpController.navTitleStr = ASLocalizedString(@"道具商城");
  401. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  402. }
  403. - (void)topViewAction{
  404. SHomePageVC *vc = [SHomePageVC new];
  405. vc.user_id = self.userModel.user_id;
  406. [[AppDelegate sharedAppDelegate]pushViewController:vc animated:YES];
  407. }
  408. - (IBAction)signBtnAction:(QMUIButton *)sender {
  409. SignViewController *setViewController = [[SignViewController alloc]init];
  410. setViewController.userID = self.userModel.user_id;
  411. [[AppDelegate sharedAppDelegate] pushViewController:setViewController animated:YES];
  412. }
  413. - (IBAction)nobleCenterBtnAction:(QMUIButton *)sender {
  414. BogoNobleViewController *vc = [BogoNobleViewController new];
  415. [[AppDelegate sharedAppDelegate] pushViewController:vc animated:YES];
  416. }
  417. - (IBAction)levelBtnAction:(QMUIButton *)sender {
  418. NSString *tmpUrlStr;
  419. #if kSupportH5Shopping
  420. tmpUrlStr = [NSString stringWithFormat:@"%@&user_id=%@",[GlobalVariables sharedInstance].appModel.h5_url.url_my_grades,_userModel.user_id];
  421. #else
  422. tmpUrlStr = [GlobalVariables sharedInstance].appModel.h5_url.url_my_grades;
  423. #endif
  424. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  425. tmpController.navTitleStr = ASLocalizedString(@"我的等级");
  426. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  427. }
  428. - (IBAction)familyBtnAction:(QMUIButton *)sender {
  429. if (1) {
  430. BogoGuildViewController *guildVC = [[BogoGuildViewController alloc]init];
  431. guildVC.family_id = _userModel.family_id;
  432. guildVC.hidesBottomBarWhenPushed = YES;
  433. [[AppDelegate sharedAppDelegate] pushViewController:guildVC animated:YES];
  434. }
  435. return;
  436. if ([_userModel.family_id intValue] == 0)
  437. {
  438. [self createFamilyViewWithVC:self andModel:_userModel];
  439. }
  440. else
  441. {
  442. [self goToFamilyDesVCWithModel:_userModel];
  443. }
  444. }
  445. - (IBAction)applyBtnAction:(QMUIButton *)sender {
  446. if (self.userModel.shop_status.integerValue == 1) {
  447. [[FDHUDManager defaultManager] show:@"您已开店" ToView:self.view];
  448. return;
  449. }
  450. [[BogoNetwork shareInstance] GET:@"api/getIsCertificationUrl" param:nil success:^(BogoNetworkResponseModel * _Nonnull result) {
  451. // "state": "0", 是否实名认证【0未认证;1已认证;2审核不通过;3审核中】
  452. // "shop_status": -1 是否认证店铺【0 审核中 1通过 2失败 -1未提交】
  453. NSInteger state = [NSString stringWithFormat:@"%@",result.data[@"state"]].integerValue;
  454. NSInteger shop_status = [NSString stringWithFormat:@"%@",result.data[@"shop_status"]].integerValue;
  455. if (state == 0 || state == 2) {
  456. UIAlertController *alert = [UIAlertController alertControllerWithTitle:ASLocalizedString(@"账户还未进行实名认证,不能申请开店") message:nil preferredStyle:UIAlertControllerStyleAlert];
  457. [alert addAction:[UIAlertAction actionWithTitle:ASLocalizedString(@"取消") style:UIAlertActionStyleCancel handler:nil]];
  458. [alert addAction:[UIAlertAction actionWithTitle:ASLocalizedString(@"实名认证") style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
  459. SIdentificationVC *identificationVC = [[SIdentificationVC alloc]init];
  460. identificationVC.user_id = self.userModel.user_id;
  461. identificationVC.sexString = self.userModel.sex;
  462. identificationVC.nameString = self.userModel.nick_name;
  463. [[AppDelegate sharedAppDelegate] pushViewController:identificationVC animated:YES];
  464. }]];
  465. [self presentViewController:alert animated:YES completion:nil];
  466. }else if (state == 3){
  467. [[FDHUDManager defaultManager] show:@"实名认证审核中" ToView:self.view];
  468. }else if (state == 1){
  469. if (shop_status == 2 || shop_status == -1) {
  470. BogoShopInfoFillViewController *fillVC = [[BogoShopInfoFillViewController alloc]init];
  471. fillVC.status = shop_status;
  472. fillVC.hidesBottomBarWhenPushed = YES;
  473. [[AppDelegate sharedAppDelegate] pushViewController:fillVC animated:YES];
  474. }else if (shop_status == 0){
  475. [[FDHUDManager defaultManager] show:@"店铺资料审核中" ToView:self.view];
  476. }
  477. }
  478. } failure:^(NSString * _Nonnull error) {
  479. [[FDHUDManager defaultManager] show:error ToView:self.view];
  480. }];
  481. }
  482. - (IBAction)dataBtnAction:(id)sender {
  483. if (self.userModel.shop_status.integerValue != 1) {
  484. if (self.userModel.shop_status.integerValue == 4) {
  485. [[FDHUDManager defaultManager] show:ASLocalizedString(@"店铺存在异常,已被关停") ToView:self.view];
  486. return;
  487. }else{
  488. [[FDHUDManager defaultManager] show:ASLocalizedString(@"您还未开通店铺,请先去申请开店") ToView:self.view];
  489. return;
  490. }
  491. }
  492. BogoShopDataViewController *fillVC = [[BogoShopDataViewController alloc]initWithNibName:@"BogoShopDataViewController" bundle:kShopKitBundle];
  493. fillVC.hidesBottomBarWhenPushed = YES;
  494. [[AppDelegate sharedAppDelegate] pushViewController:fillVC animated:YES];
  495. }
  496. - (IBAction)allOrderBtnAction:(QMUIButton *)sender {
  497. BogoOrderManageViewController *orderManage = [[BogoOrderManageViewController alloc]init];
  498. orderManage.listType = BogoOrderManageViewControllerTypeUser;
  499. orderManage.index = 0;
  500. orderManage.hidesBottomBarWhenPushed = YES;
  501. [[AppDelegate sharedAppDelegate] pushViewController:orderManage animated:YES];
  502. }
  503. - (IBAction)waitPayBtnAction:(QMUIButton *)sender {
  504. BogoOrderManageViewController *orderManage = [[BogoOrderManageViewController alloc]init];
  505. orderManage.listType = BogoOrderManageViewControllerTypeUser;
  506. orderManage.index = 1;
  507. orderManage.hidesBottomBarWhenPushed = YES;
  508. [[AppDelegate sharedAppDelegate] pushViewController:orderManage animated:YES];
  509. }
  510. - (IBAction)waitTransferBtnAction:(QMUIButton *)sender {
  511. BogoOrderManageViewController *orderManage = [[BogoOrderManageViewController alloc]init];
  512. orderManage.listType = BogoOrderManageViewControllerTypeUser;
  513. orderManage.index = 2;
  514. orderManage.hidesBottomBarWhenPushed = YES;
  515. [[AppDelegate sharedAppDelegate] pushViewController:orderManage animated:YES];
  516. }
  517. - (IBAction)waitConfirmBtnAction:(QMUIButton *)sender {
  518. BogoOrderManageViewController *orderManage = [[BogoOrderManageViewController alloc]init];
  519. orderManage.listType = BogoOrderManageViewControllerTypeUser;
  520. orderManage.index = 3;
  521. orderManage.hidesBottomBarWhenPushed = YES;
  522. [[AppDelegate sharedAppDelegate] pushViewController:orderManage animated:YES];
  523. }
  524. - (IBAction)refundBtnAction:(QMUIButton *)sender {
  525. BogoOrderManageViewController *orderManage = [[BogoOrderManageViewController alloc]init];
  526. orderManage.listType = BogoOrderManageViewControllerTypeUser;
  527. orderManage.index = 4;
  528. orderManage.hidesBottomBarWhenPushed = YES;
  529. [[AppDelegate sharedAppDelegate] pushViewController:orderManage animated:YES];
  530. }
  531. - (IBAction)goodManageBtnAction:(QMUIButton *)sender {
  532. if (self.userModel.shop_status.integerValue != 1) {
  533. if (self.userModel.shop_status.integerValue == 4) {
  534. [[FDHUDManager defaultManager] show:@"店铺存在异常,已被关停" ToView:self.view];
  535. }else{
  536. [[FDHUDManager defaultManager] show:ASLocalizedString(@"您还未开通店铺,请先去申请开店") ToView:self.view];
  537. return;
  538. }
  539. return;
  540. }
  541. BogoCommodityManagementViewController *manageVC = [[BogoCommodityManagementViewController alloc]init];
  542. manageVC.hidesBottomBarWhenPushed = YES;
  543. [[AppDelegate sharedAppDelegate] pushViewController:manageVC animated:YES];
  544. }
  545. - (IBAction)orderManageBtnAction:(QMUIButton *)sender {
  546. if (self.userModel.shop_status.integerValue != 1) {
  547. if (self.userModel.shop_status.integerValue == 4) {
  548. [[FDHUDManager defaultManager] show:@"店铺存在异常,已被关停" ToView:self.view];
  549. }else{
  550. [[FDHUDManager defaultManager] show:ASLocalizedString(@"您还未开通店铺,请先去申请开店") ToView:self.view];
  551. return;
  552. }
  553. return;
  554. }
  555. BogoOrderManageViewController *orderManage = [[BogoOrderManageViewController alloc]init];
  556. orderManage.listType = BogoOrderManageViewControllerTypeShop;
  557. orderManage.index = 0;
  558. orderManage.hidesBottomBarWhenPushed = YES;
  559. [[AppDelegate sharedAppDelegate] pushViewController:orderManage animated:YES];
  560. }
  561. - (IBAction)authBtnAction:(QMUIButton *)sender {
  562. SIdentificationVC *identificationVC = [[SIdentificationVC alloc]init];
  563. identificationVC.user_id = self.userModel.user_id;
  564. identificationVC.sexString = self.userModel.sex;
  565. identificationVC.nameString = self.userModel.nick_name;
  566. [[AppDelegate sharedAppDelegate] pushViewController:identificationVC animated:YES];
  567. }
  568. - (IBAction)inviteBtnAction:(QMUIButton *)sender {
  569. if (kIsCheckingVersion()) {
  570. [self familyBtnAction:nil];
  571. return;
  572. }
  573. // BogoInviteViewController *inviteVC = [[BogoInviteViewController alloc]initWithNibName:@"BogoInviteViewController" bundle:[NSBundle mainBundle]];
  574. // inviteVC.hidesBottomBarWhenPushed = YES;
  575. // [[AppDelegate sharedAppDelegate] pushViewController:inviteVC animated:YES];
  576. NSString *tmpUrlStr = [GlobalVariables sharedInstance].appModel.h5_url.invite_rewards;
  577. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:NO];
  578. tmpController.navTitleStr = ASLocalizedString(@"邀请赚钱");
  579. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  580. }
  581. - (IBAction)logBtnAction:(QMUIButton *)sender {
  582. NSString *tmpUrlStr = [GlobalVariables sharedInstance].appModel.h5_url.emcee_income_log_url;
  583. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:NO];
  584. tmpController.navTitleStr = ASLocalizedString(@"收支记录");
  585. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  586. return;
  587. SChargerVC *chargerVC = [[SChargerVC alloc]init];
  588. chargerVC.recordIndex = 0;
  589. chargerVC.feeIndex = [GlobalVariables sharedInstance].appModel.live_pay_time ? 0:1;
  590. [[AppDelegate sharedAppDelegate] pushViewController:chargerVC animated:YES];
  591. }
  592. - (IBAction)setBtnAction:(QMUIButton *)sender {
  593. BogoSetViewController *setViewController = [[BogoSetViewController alloc]init];
  594. setViewController.userID = self.userModel.user_id;
  595. [[AppDelegate sharedAppDelegate] pushViewController:setViewController animated:YES];
  596. }
  597. - (IBAction)merchantsAuthBtnClick:(QMUIButton *)sender {
  598. MerchantEnrollViewController *vc = [[MerchantEnrollViewController alloc] init];
  599. vc.hidesBottomBarWhenPushed = YES;
  600. [self.navigationController pushViewController:vc animated:YES];
  601. }
  602. #pragma mark - 我的账户
  603. - (void)accountViewAction{
  604. BogoRechargeViewController *acountVC = [BogoRechargeViewController new];
  605. // AccountRechargeVC *acountVC = [[AccountRechargeVC alloc]init];
  606. [[AppDelegate sharedAppDelegate] pushViewController:acountVC animated:YES];
  607. }
  608. //收益
  609. - (void)profitViewAction{
  610. IncomeViewController *profitVC = [[IncomeViewController alloc]init];
  611. [[AppDelegate sharedAppDelegate] pushViewController:profitVC animated:YES];
  612. }
  613. - (IBAction)clickEditBtn:(UIButton *)sender {
  614. BGEditInfoController *editVC = [[BGEditInfoController alloc]init];
  615. [[AppDelegate sharedAppDelegate] pushViewController:editVC animated:YES];
  616. }
  617. #pragma mark ======================我的公会======================
  618. - (void)createFamilyViewWithVC:(UIViewController *)myVC andModel:(userPageModel *)userModel
  619. {
  620. self.userModel = userModel;
  621. if (!self.backgroundView)
  622. {
  623. self.backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  624. self.backgroundView.backgroundColor = kAppGrayColor6;
  625. self.backgroundView.alpha = 0.5;
  626. self.backgroundView.hidden = NO;
  627. [myVC.view addSubview:self.backgroundView];
  628. self.bigButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  629. [self.bigButton addTarget:self action:@selector(closeFamilyView) forControlEvents:UIControlEventTouchUpInside];
  630. [self.backgroundView addSubview:_bigButton];
  631. self.backView = [[UIView alloc] initWithFrame:CGRectMake(10, (kScreenH-170)/2, kScreenW-20, 170)];
  632. self.backView.backgroundColor = [UIColor grayColor];
  633. self.backView.layer.cornerRadius = 5;
  634. self.backView.layer.masksToBounds = YES;
  635. [myVC.view addSubview:_backView];
  636. self.bigView = [[UIView alloc] initWithFrame:CGRectMake(5, 5, kScreenW-30, 160)];
  637. self.bigView.backgroundColor = [UIColor whiteColor];
  638. self.bigView.layer.cornerRadius = 5;
  639. self.bigView.layer.masksToBounds = YES;
  640. [self.backView addSubview:self.bigView];
  641. self.addFamilyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  642. self.addFamilyBtn.frame = CGRectMake(15, 20, kScreenW-60, 48);
  643. self.addFamilyBtn.backgroundColor = kAppMainColor;
  644. self.addFamilyBtn.layer.cornerRadius = 15;
  645. self.addFamilyBtn.layer.masksToBounds = YES;
  646. [self.addFamilyBtn addTarget:self action:@selector(clickAddBtn) forControlEvents:UIControlEventTouchUpInside];
  647. [self.addFamilyBtn setTitle:ASLocalizedString(@"加入公会")forState:UIControlStateNormal];
  648. [self.bigView addSubview:self.addFamilyBtn];
  649. self.createBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  650. self.createBtn.backgroundColor = kAppFamilyBtnColor;
  651. self.createBtn.layer.cornerRadius = 15;
  652. self.createBtn.layer.masksToBounds = YES;
  653. [self.createBtn setTitle:ASLocalizedString(@"创建公会")forState:UIControlStateNormal];
  654. [self.createBtn addTarget:self action:@selector(clickCreateBtn) forControlEvents:UIControlEventTouchUpInside];
  655. [self.bigView addSubview:self.createBtn];
  656. if ([self.BuguLive.appModel.family_join intValue] == 0)
  657. {
  658. self.backView.frame = CGRectMake(10, (kScreenH-85)/2, kScreenW-20, 85);
  659. self.bigView.frame = CGRectMake(5, 2.5, kScreenW-30, 80);
  660. self.addFamilyBtn.hidden = YES;
  661. self.createBtn.frame = CGRectMake(15, CGRectGetMidY(_bigView.frame)-26, kScreenW-60, 48);
  662. }
  663. else if ([self.BuguLive.appModel.family_join intValue] == 1)
  664. {
  665. self.backView.frame = CGRectMake(10, (kScreenH-170)/2, kScreenW-20, 170);
  666. self.bigView.frame = CGRectMake(5, 5, kScreenW-30, 160);
  667. self.addFamilyBtn.hidden = NO;
  668. self.createBtn.frame = CGRectMake(15, 92, kScreenW-60, 48);
  669. }
  670. }
  671. else
  672. {
  673. self.backgroundView.hidden = NO;
  674. self.backView.hidden = NO;
  675. }
  676. }
  677. //关闭公会页面
  678. - (void)closeFamilyView
  679. {
  680. self.backgroundView.hidden = YES;
  681. self.backView.hidden = YES;
  682. }
  683. //加入公会
  684. - (void)clickAddBtn
  685. {
  686. self.backgroundView.hidden = YES;
  687. self.backView.hidden = YES;
  688. FamilyListViewController *familyListVC = [[FamilyListViewController alloc] init];
  689. [[AppDelegate sharedAppDelegate] pushViewController:familyListVC animated:YES];
  690. }
  691. //创建公会
  692. - (void)clickCreateBtn
  693. {
  694. self.backgroundView.hidden = YES;
  695. self.backView.hidden = YES;
  696. EditFamilyViewController * editFamilyVC = [[EditFamilyViewController alloc] init];
  697. editFamilyVC.hidesBottomBarWhenPushed = YES;
  698. //创建公会时type=0;
  699. editFamilyVC.type = 0;
  700. editFamilyVC.user_id = self.userModel.user_id;
  701. [[AppDelegate sharedAppDelegate] pushViewController:editFamilyVC animated:YES];
  702. }
  703. //公会详情
  704. - (void)goToFamilyDesVCWithModel:(userPageModel *)userModel
  705. {
  706. FamilyDesViewController * familyDesVc = [[FamilyDesViewController alloc] init];
  707. //是否是族长
  708. familyDesVc.isFamilyHeder = [userModel.family_chieftain intValue];
  709. familyDesVc.jid =userModel.family_id;
  710. familyDesVc.user_id =userModel.user_id;
  711. [[AppDelegate sharedAppDelegate] pushViewController:familyDesVc animated:YES];
  712. }
  713. #pragma mark ======================我的公会======================
  714. - (void)createSocietyViewWithVC:(UIViewController *)myVC andModel:(userPageModel *)userModel
  715. {
  716. // if (!self.backgroundViewTwo)
  717. // {
  718. // self.backgroundViewTwo = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  719. // self.backgroundViewTwo.backgroundColor = kAppGrayColor6;
  720. // self.backgroundViewTwo.alpha = 0.5;
  721. // self.backgroundViewTwo.hidden = NO;
  722. // [myVC.view addSubview:self.backgroundViewTwo];
  723. // self.bigBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  724. // [self.bigBtn addTarget:self action:@selector(closeSocietyView) forControlEvents:UIControlEventTouchUpInside];
  725. // [self.backgroundViewTwo addSubview:self.bigBtn];
  726. // self.backViewTwo = [[UIView alloc] initWithFrame:CGRectMake(10, (kScreenH-170)/2, kScreenW-20, 110)];
  727. // self.backViewTwo.backgroundColor = [UIColor grayColor];
  728. // self.backViewTwo.layer.cornerRadius = 5;
  729. // self.backViewTwo.layer.masksToBounds = YES;
  730. // [myVC.view addSubview:self.backViewTwo];
  731. // self.bigViewTwo = [[UIView alloc] initWithFrame:CGRectMake(5, 5, kScreenW-30, 100)];
  732. // self.bigViewTwo.backgroundColor = [UIColor whiteColor];
  733. // self.bigViewTwo.layer.cornerRadius = 5;
  734. // self.bigViewTwo.layer.masksToBounds = YES;
  735. // [self.backViewTwo addSubview:self.bigViewTwo];
  736. // self.createSocietyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  737. // self.createSocietyBtn.frame = CGRectMake(15, CGRectGetMidY(_bigViewTwo.frame)-27.5, kScreenW-60, 48);
  738. // self.createSocietyBtn.backgroundColor = kAppFamilyBtnColor;
  739. // self.createSocietyBtn.layer.cornerRadius = 15;
  740. // self.createSocietyBtn.layer.masksToBounds = YES;
  741. // [self.createSocietyBtn setTitle:ASLocalizedString(@"创建公会")forState:UIControlStateNormal];
  742. // [self.createSocietyBtn addTarget:self action:@selector(clickCreateSocietyBtn) forControlEvents:UIControlEventTouchUpInside];
  743. // [self.bigViewTwo addSubview:self.createSocietyBtn];
  744. // }
  745. // else
  746. // {
  747. // self.backgroundViewTwo.hidden = NO;
  748. // self.backViewTwo.hidden = NO;
  749. // }
  750. [self clickCreateSocietyBtn:userModel];
  751. }
  752. //关闭公会页面
  753. - (void)closeSocietyView
  754. {
  755. self.backgroundViewTwo.hidden = YES;
  756. self.backViewTwo.hidden = YES;
  757. }
  758. //加入公会
  759. - (void)clickAddSocietyBtn
  760. {
  761. self.backgroundViewTwo.hidden = YES;
  762. self.backViewTwo.hidden = YES;
  763. SocietyListViewController * societyListVC = [[SocietyListViewController alloc] init];
  764. [[AppDelegate sharedAppDelegate] pushViewController:societyListVC animated:YES];
  765. }
  766. //创建公会
  767. - (void)clickCreateSocietyBtn:(userPageModel *)model
  768. {
  769. self.backgroundViewTwo.hidden = YES;
  770. self.backViewTwo.hidden = YES;
  771. EditSocietyViewController * editSocietyVC = [[EditSocietyViewController alloc] init];
  772. //创建公会时type=0;
  773. editSocietyVC.type = 0;
  774. editSocietyVC.user_id = model.user_id;
  775. [[AppDelegate sharedAppDelegate] pushViewController:editSocietyVC animated:YES];
  776. }
  777. //公会详情
  778. - (void)goToSocietyDesVCWithModel:(userPageModel *)userModel
  779. {
  780. SocietyDetailVC *detailVC = [[SocietyDetailVC alloc]init];
  781. detailVC.hidesBottomBarWhenPushed = YES;
  782. detailVC.mySocietyID =[userModel.society_id intValue];
  783. detailVC.type =[userModel.society_chieftain intValue];
  784. detailVC.mygh_status = [userModel.gh_status intValue];
  785. detailVC.flagStr = @"MySociety";
  786. [[AppDelegate sharedAppDelegate] pushViewController:detailVC animated:YES];
  787. }
  788. - (UIStatusBarStyle)preferredStatusBarStyle{
  789. return UIStatusBarStyleLightContent;
  790. }
  791. #pragma mark PerfectInfoPopViewDelegate
  792. - (void)infoPopView:(PerfectInfoPopView *)infoPopView didClickEditBtn:(UIButton *)sender{
  793. BGEditInfoController *editVC = [[BGEditInfoController alloc]init];
  794. [[AppDelegate sharedAppDelegate] pushViewController:editVC animated:YES];
  795. }
  796. - (PerfectInfoPopView *)infoPopView{
  797. if (!_infoPopView) {
  798. _infoPopView = [[NSBundle mainBundle] loadNibNamed:@"PerfectInfoPopView" owner:nil options:nil].lastObject;
  799. _infoPopView.delegate = self;
  800. }
  801. return _infoPopView;
  802. }
  803. @end