PersonCenterModel.m 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935
  1. //
  2. // PersonCenterModel.m
  3. // BuguLive
  4. //
  5. // Created by 丁凯 on 2017/7/20.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "PersonCenterModel.h"
  9. #import "userPageModel.h"
  10. #import "AccountRechargeVC.h"
  11. #import "IncomeViewController.h"
  12. #import "DistributionController.h"
  13. #import "SIdentificationVC.h"
  14. #import "BogoSetViewController.h"
  15. #import "GameDistributionViewController.h"
  16. #import "ShopListViewController.h"
  17. #import "OnLiveViewController.h"
  18. #import "FollowerViewController.h"
  19. #import "EditFamilyViewController.h"
  20. #import "FamilyDesViewController.h"
  21. #import "FamilyListViewController.h"
  22. #import "SocietyListViewController.h"
  23. #import "EditSocietyViewController.h"
  24. #import "SocietyDesViewController.h"
  25. #import "MPCHeadView.h"
  26. #import "SSearchVC.h"
  27. #import "BGEditInfoController.h"
  28. #import "GetHeadImgViewController.h"
  29. #import "SocietyDetailVC.h"
  30. #import "MSmallVideoVC.h"
  31. #import "SChargerVC.h"
  32. #import "BGShopViewController.h"
  33. //#import "SignViewController.h"
  34. #import "GuiZuViewController.h"
  35. #import "MGInvateCodeViewController.h"
  36. //邀请赚钱
  37. #import "BogoShareInviteViewController.h"
  38. //新充值界面
  39. #import "BogoRechargeViewController.h"
  40. //贵族列表
  41. #import "BogoNobleViewController.h"
  42. @implementation PersonCenterModel
  43. - (void)creatUIWithModel:(userPageModel *)userModel andMArr:(NSMutableArray *)detailArray andMyView:(UIView *)myView
  44. {
  45. self.BuguLive = [GlobalVariables sharedInstance];
  46. // if (userModel.n_diamonds.length)//账户
  47. // {
  48. //// [detailArray replaceObjectAtIndex:MPCAcountSection withObject:[NSString stringWithFormat:@"%@%@",userModel.n_diamonds,self.BuguLive.appModel.diamond_name]];
  49. // }
  50. // if (userModel.n_useable_ticket.length && self.BuguLive.appModel.ticket_name.length)//收益
  51. // {
  52. //// [detailArray replaceObjectAtIndex:MPCIncomeSection withObject:[NSString stringWithFormat:@"%@%@",userModel.n_useable_ticket,self.BuguLive.appModel.ticket_name]];
  53. // }
  54. //
  55. // if ([self.BuguLive.appModel.open_vip isEqualToString:@"1"])//VIP会员
  56. // {
  57. // if ([userModel.is_vip isEqualToString:@"1"])
  58. // {
  59. //// [detailArray replaceObjectAtIndex:MPCVIPSection withObject:ASLocalizedString(@"已开通")];
  60. // }
  61. // else
  62. // {
  63. //// [detailArray replaceObjectAtIndex:MPCVIPSection withObject:userModel.vip_expire_time];
  64. // }
  65. // }
  66. // else
  67. // {
  68. // [detailArray replaceObjectAtIndex:MPCVIPSection withObject:@""];
  69. // }
  70. // if (userModel.n_coin.length)//兑换游戏币
  71. // {
  72. // [detailArray replaceObjectAtIndex:MPCexchangeCoinsSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@游戏币"),userModel.n_coin]];
  73. // }
  74. // if (userModel.use_diamonds.length)//送出
  75. // {
  76. // [detailArray replaceObjectAtIndex:MPCOutPutSection withObject:[NSString stringWithFormat:@"%@%@",userModel.use_diamonds,self.BuguLive.appModel.diamond_name]];
  77. // }
  78. // if (userModel.user_level.length)//等级
  79. // {
  80. // [detailArray replaceObjectAtIndex:MPCGradeSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@级"),userModel.user_level]];
  81. // }
  82. NSString *idStr; //认证
  83. if ([userModel.is_authentication intValue] ==0)
  84. {
  85. idStr = ASLocalizedString(@"未认证");
  86. }
  87. if ([userModel.is_authentication intValue] ==1)
  88. {
  89. idStr = ASLocalizedString(@"等待审核");
  90. }
  91. if ([userModel.is_authentication intValue] ==2)
  92. {
  93. idStr = ASLocalizedString(@"已认证");
  94. }
  95. if ([userModel.is_authentication intValue] ==3)
  96. {
  97. idStr = ASLocalizedString(@"审核不通过");
  98. }
  99. [detailArray replaceObjectAtIndex:MPCRenZhenSection withObject:idStr];
  100. // if (userModel.n_podcast_goods.length)//商品管理
  101. // {
  102. // [detailArray replaceObjectAtIndex:MPCGoodsMSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@ 个商品"),userModel.n_podcast_goods]];
  103. // }
  104. // if (userModel.show_user_order.length)//我的订单
  105. // {
  106. // [detailArray replaceObjectAtIndex:MPCMyOrderSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@ 个订单"),userModel.n_user_order]];
  107. // }
  108. // if (userModel.n_podcast_order.length)//订单管理
  109. // {
  110. // [detailArray replaceObjectAtIndex:MPCOrderMSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@ 个订单"),userModel.n_podcast_order]];
  111. // }
  112. // if (userModel.n_shopping_cart.length)//我的购物车
  113. // {
  114. // [detailArray replaceObjectAtIndex:MPCShopCartSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@ 个商品"),userModel.n_shopping_cart]];
  115. // }
  116. // if (userModel.n_user_pai.length)//我的竞拍
  117. // {
  118. // [detailArray replaceObjectAtIndex:MPCMyAutionSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@ 个竞拍"),userModel.n_user_pai]];
  119. // }
  120. // if (userModel.n_podcast_pai.length)//竞拍管理
  121. // {
  122. // [detailArray replaceObjectAtIndex:MPCAutionMSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@ 个竞拍"),userModel.n_podcast_pai]];
  123. // }
  124. // if (userModel.open_podcast_goods.length)//我的小店
  125. // {
  126. // [detailArray replaceObjectAtIndex:MPCMyLitteShopSection withObject:[NSString stringWithFormat:ASLocalizedString(@"%@ 个商品"),userModel.n_shop_goods]];
  127. // }
  128. }
  129. -(void)didSelectWithModel:(userPageModel *)userModel andSection:(int)section
  130. {
  131. self.BuguLive = [GlobalVariables sharedInstance];
  132. if (section == MPCMyVideoSection) //小视频
  133. {
  134. MSmallVideoVC *sVideoVC = [[MSmallVideoVC alloc]init];
  135. sVideoVC.notHaveTabbar = YES;
  136. sVideoVC.isHaveNavBar = YES;
  137. [[AppDelegate sharedAppDelegate] pushViewController:sVideoVC animated:YES];
  138. }
  139. if (section == MPCMyInfoSection) {
  140. SHomePageVC *vc = [SHomePageVC new];
  141. vc.user_id = userModel.user_id;
  142. [[AppDelegate sharedAppDelegate]pushViewController:vc animated:YES];
  143. }else if (section == MPCMyEditSection)//27编辑
  144. {
  145. BGEditInfoController *editVC = [[BGEditInfoController alloc]init];
  146. [[AppDelegate sharedAppDelegate] pushViewController:editVC animated:YES];
  147. }
  148. else if (section == MPCSetInvateCode) {
  149. MGInvateCodeViewController *vc = [MGInvateCodeViewController new];
  150. [[AppDelegate sharedAppDelegate] pushViewController:vc animated:YES];
  151. }else if (section == MPCInviteUser) {
  152. // BogoShareInviteViewController *shareVC = [BogoShareInviteViewController new];
  153. // [[AppDelegate sharedAppDelegate]pushViewController:shareVC];
  154. //邀请好友
  155. NSString *tmpUrlStr = _BuguLive.appModel.h5_url.invite_rewards;
  156. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:NO];
  157. tmpController.navTitleStr = ASLocalizedString(@"邀请赚钱");
  158. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  159. }
  160. else if (section == MPCAcountSection)//账户
  161. {
  162. BogoRechargeViewController *acountVC = [BogoRechargeViewController new];
  163. // AccountRechargeVC *acountVC = [[AccountRechargeVC alloc]init];
  164. [[AppDelegate sharedAppDelegate] pushViewController:acountVC animated:YES];
  165. }
  166. else if (section == MPCIncomeSection)//收益
  167. {
  168. IncomeViewController *profitVC = [[IncomeViewController alloc]init];
  169. [[AppDelegate sharedAppDelegate] pushViewController:profitVC animated:YES];
  170. }
  171. else if(section == MPCarBuy)//vip会员
  172. {
  173. NSString *tmpUrlStr = _BuguLive.appModel.h5_url.pay_car;
  174. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  175. tmpController.navTitleStr = ASLocalizedString(@"座驾");
  176. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  177. }
  178. else if(section == MPBGSHOP)//商城
  179. {
  180. NSString *pay_nobleUrl = _BuguLive.appModel.h5_url.shop_url;
  181. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:pay_nobleUrl isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  182. tmpController.navTitleStr = ASLocalizedString(@"道具商城");
  183. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  184. // BGShopViewController *shop = [BGShopViewController new];
  185. // shop.title = ASLocalizedString(@"道具商城");
  186. // [[AppDelegate sharedAppDelegate] pushViewController:shop];
  187. }
  188. else if(section == MPGuiZu)//贵族中心
  189. {
  190. BogoNobleViewController *vc = [BogoNobleViewController new];
  191. [[AppDelegate sharedAppDelegate] pushViewController:vc animated:YES];
  192. // GuiZuViewController *nextVC = [GuiZuViewController new];
  193. // nextVC.title = ASLocalizedString(@"贵族中心");
  194. // [[AppDelegate sharedAppDelegate] pushViewController:nextVC];
  195. // NSString *pay_nobleUrl = _BuguLive.appModel.h5_url.pay_noble;
  196. // BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:pay_nobleUrl isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  197. // tmpController.navTitleStr = ASLocalizedString(@"贵族中心");
  198. // [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  199. }
  200. else if (section == MPCLiveHostCenter){
  201. NSString *pay_nobleUrl = _BuguLive.appModel.h5_url.emcee_center_url;
  202. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:pay_nobleUrl isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  203. tmpController.navTitleStr = ASLocalizedString(@"主播中心");
  204. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  205. } else if (section == MPCMySmallShop){
  206. NSString *url;
  207. if ([userModel.is_open_shop isEqualToString:@"1"]) {
  208. url = _BuguLive.appModel.h5_url.shop_manage_url;
  209. }else{
  210. url = _BuguLive.appModel.h5_url.shop_product_url;
  211. }
  212. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:url isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  213. tmpController.navTitleStr = ASLocalizedString(@"我的小店");
  214. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  215. }
  216. else if(section == MPCVIPSection)
  217. {
  218. NSString *tmpUrlStr = _BuguLive.appModel.h5_url.members_url;
  219. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  220. tmpController.navTitleStr = ASLocalizedString(@"VIP会员");
  221. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  222. }
  223. else if(section == MPCLuckNumber)
  224. {
  225. NSString *tmpUrlStr = _BuguLive.appModel.h5_url.luck_num_url;
  226. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  227. tmpController.navTitleStr = ASLocalizedString(@"靓号商城");
  228. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  229. }
  230. else if(section == MPCVIPSection)//vip会员
  231. {
  232. AccountRechargeVC *acountVC = [[AccountRechargeVC alloc]init];
  233. acountVC.is_vip = YES;
  234. [[AppDelegate sharedAppDelegate] pushViewController:acountVC animated:YES];
  235. }
  236. else if(section == MPCSZJLSection)//直播间收支记录
  237. {
  238. SChargerVC *chargerVC = [[SChargerVC alloc]init];
  239. chargerVC.recordIndex = 0;
  240. chargerVC.feeIndex = _BuguLive.appModel.live_pay_time ? 0:1;
  241. [[AppDelegate sharedAppDelegate] pushViewController:chargerVC animated:YES];
  242. }
  243. else if (section == MPCGradeSection)//等级
  244. {
  245. NSString *tmpUrlStr;
  246. #if kSupportH5Shopping
  247. tmpUrlStr = [NSString stringWithFormat:@"%@&user_id=%@",_BuguLive.appModel.h5_url.url_my_grades,_userModel.user_id];
  248. #else
  249. tmpUrlStr = _BuguLive.appModel.h5_url.url_my_grades;
  250. #endif
  251. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:tmpUrlStr isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES];
  252. tmpController.navTitleStr = ASLocalizedString(@"我的等级");
  253. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  254. }
  255. else if(section == MPCRenZhenSection)//认证
  256. {
  257. SIdentificationVC *identificationVC = [[SIdentificationVC alloc]init];
  258. identificationVC.user_id = userModel.user_id;
  259. identificationVC.sexString = userModel.sex;
  260. identificationVC.nameString = userModel.nick_name;
  261. [[AppDelegate sharedAppDelegate] pushViewController:identificationVC animated:YES];
  262. }
  263. else if(section == MPCContributeSection)//贡献榜
  264. {
  265. ContributionListViewController *contributionVC =[[ContributionListViewController alloc]init];
  266. contributionVC.type = @"1";
  267. contributionVC.user_id = userModel.user_id;
  268. contributionVC.hidesBottomBarWhenPushed = YES;
  269. [[AppDelegate sharedAppDelegate] pushViewController:contributionVC animated:YES];
  270. }
  271. else if(section == MPCShareISection)//分享收益
  272. {
  273. DistributionController *DistributionVC = [[DistributionController alloc]init];
  274. [[AppDelegate sharedAppDelegate] pushViewController:DistributionVC animated:YES];
  275. }else if(section == MPCGameSISection)//游戏分享收益
  276. {
  277. GameDistributionViewController *gameDistributionVC = [[GameDistributionViewController alloc]init];
  278. [[AppDelegate sharedAppDelegate] pushViewController:gameDistributionVC animated:YES];
  279. }
  280. else if(section == MPCGoodsMSection) //商品管理
  281. {
  282. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:self.BuguLive.appModel.h5_url.url_podcast_goods isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:YES];
  283. tmpController.navTitleStr = ASLocalizedString(@"商品管理");
  284. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  285. }
  286. else if(section == MPCMyOrderSection)//我的订单
  287. {
  288. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:self.BuguLive.appModel.h5_url.url_user_order isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:YES];
  289. tmpController.navTitleStr = ASLocalizedString(@"我的订单");
  290. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  291. }else if(section == MPCOrderMSection)//订单管理
  292. {
  293. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:self.BuguLive.appModel.h5_url.url_podcast_order isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:YES];
  294. tmpController.navTitleStr = ASLocalizedString(@"订单管理");
  295. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  296. }else if(section == MPCShopCartSection)//我的购物车
  297. {
  298. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:self.BuguLive.appModel.h5_url.url_shopping_cart isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:YES];
  299. tmpController.navTitleStr = ASLocalizedString(@"我的购物车");
  300. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  301. }else if(section == MPCMyAutionSection)//我的竞拍
  302. {
  303. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:self.BuguLive.appModel.h5_url.url_user_pai isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:YES];
  304. tmpController.navTitleStr = ASLocalizedString(@"我的竞拍");
  305. tmpController.isFrontRefresh = YES;
  306. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  307. }else if(section == MPCAutionMSection)//竞拍管理
  308. {
  309. BGMainWebViewController *tmpController = [BGMainWebViewController webControlerWithUrlStr:self.BuguLive.appModel.h5_url.url_podcast_pai isShowIndicator:YES isShowNavBar:YES isShowBackBtn:YES isShowCloseBtn:YES];
  310. tmpController.navTitleStr = ASLocalizedString(@"竞拍管理");
  311. tmpController.isFrontRefresh = YES;
  312. [[AppDelegate sharedAppDelegate] pushViewController:tmpController animated:YES];
  313. }else if(section == MPCMyLitteShopSection)//我的小店
  314. {
  315. ShopListViewController *shopListVC = [[ShopListViewController alloc]init];
  316. shopListVC.user_id = userModel.user_id;
  317. shopListVC.isOTOShop = YES;
  318. shopListVC.hidesBottomBarWhenPushed = YES;
  319. [[AppDelegate sharedAppDelegate] pushViewController:shopListVC animated:YES];
  320. }else if(section == MPCSetSection)//设置
  321. {
  322. BogoSetViewController *setViewController = [[BogoSetViewController alloc]init];
  323. setViewController.userID = userModel.user_id;
  324. [[AppDelegate sharedAppDelegate] pushViewController:setViewController animated:YES];
  325. }else if(section == 999)//设置
  326. {
  327. BogoSetViewController *setViewController = [[BogoSetViewController alloc]init];
  328. setViewController.userID = userModel.user_id;
  329. [[AppDelegate sharedAppDelegate] pushViewController:setViewController animated:YES];
  330. //
  331. }else if(section == 21)//回播
  332. {
  333. OnLiveViewController *onliveVC = [[OnLiveViewController alloc]init];
  334. onliveVC.user_id = userModel.user_id;
  335. [[AppDelegate sharedAppDelegate] pushViewController:onliveVC animated:YES];
  336. }else if(section == 52 || section == 53)//关注22 粉丝23
  337. {
  338. FollowerViewController *FollowVC = [[FollowerViewController alloc]init];
  339. FollowVC.user_id = userModel.user_id;
  340. FollowVC.type = [NSString stringWithFormat:@"%d",section-51];
  341. [[AppDelegate sharedAppDelegate] pushViewController:FollowVC animated:YES];
  342. }else if (section == 24)//24搜索
  343. {
  344. SSearchVC *searchVC = [[SSearchVC alloc]init];
  345. searchVC.searchType = @"0";
  346. [[AppDelegate sharedAppDelegate] pushViewController:searchVC animated:YES];
  347. }else if (section == 25)//25IM消息
  348. {
  349. BGConversationSegmentController *chatListVC = [[BGConversationSegmentController alloc]init];
  350. [[AppDelegate sharedAppDelegate] pushViewController:chatListVC animated:YES];
  351. }else if (section == 26)//26更换头像
  352. {
  353. SHomePageVC *tmpController= [[SHomePageVC alloc]init];
  354. tmpController.user_id = userModel.user_id;
  355. tmpController.type = 0;
  356. [[AppDelegate sharedAppDelegate]pushViewController:tmpController animated:YES];
  357. // [self.videoView.player pausePlay];
  358. // GetHeadImgViewController *headVC =[[GetHeadImgViewController alloc]init];
  359. // headVC.headImgString =userModel.head_image;
  360. // headVC.userId =userModel.user_id;
  361. // [[AppDelegate sharedAppDelegate]pushViewController:headVC];
  362. }
  363. }
  364. #pragma mark ======================兑换游戏币======================
  365. - (void)createExchangeCoinViewWithVC:(UIViewController *)myVC
  366. {
  367. _bgWindow = [[UIApplication sharedApplication].delegate window];
  368. if (!_exchangeView)
  369. {
  370. _exchangeBgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  371. _exchangeBgView.backgroundColor = kGrayTransparentColor4;
  372. _exchangeBgView.hidden = YES;
  373. [myVC.view addSubview:_exchangeBgView];
  374. UITapGestureRecognizer *bgViewTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(exchangeBgViewTap)];
  375. [_exchangeBgView addGestureRecognizer:bgViewTap];
  376. _exchangeView = [ExchangeCoinView EditNibFromXib];
  377. _exchangeView.exchangeType = 1;
  378. _exchangeView.delegate = self;
  379. _exchangeView.frame = CGRectMake((kScreenW - 300)/2, kScreenH, 300, 230);
  380. [_exchangeView createSomething];
  381. [_bgWindow addSubview:_exchangeView];
  382. }
  383. }
  384. - (void)exchangeViewDownWithExchangeCoinView:(ExchangeCoinView *)exchangeCoinView
  385. {
  386. if (_exchangeView == exchangeCoinView)
  387. {
  388. [_exchangeView.diamondLeftTextfield resignFirstResponder];
  389. _exchangeView.diamondLeftTextfield.text = nil;
  390. _exchangeView.coinLabel.text = ASLocalizedString(@"0游戏币");
  391. [UIView animateWithDuration:0.3 animations:^{
  392. _exchangeView.frame = CGRectMake((kScreenW - 300)/2, kScreenH, 300, 230);
  393. } completion:^(BOOL finished) {
  394. _exchangeBgView.hidden = YES;
  395. }];
  396. }
  397. }
  398. - (void)exchangeBgViewTap
  399. {
  400. [self exchangeViewDownWithExchangeCoinView:_exchangeView];
  401. }
  402. - (void)exchangeGaomeCoinsWithModel:(userPageModel *)userModel
  403. {
  404. [_bgWindow bringSubviewToFront:_exchangeBgView];
  405. [_bgWindow bringSubviewToFront:_exchangeView];
  406. [_exchangeView obtainCoinProportion];
  407. [UIView animateWithDuration:0.3 animations:^{
  408. _exchangeBgView.hidden = NO;
  409. [_exchangeView.diamondLeftTextfield becomeFirstResponder];
  410. _exchangeView.ticket = userModel.diamonds;
  411. _exchangeView.diamondLabel.text =[NSString stringWithFormat:ASLocalizedString(@"%@余额:%@"),self.BuguLive.appModel.diamond_name,userModel.diamonds];
  412. _exchangeView.frame = CGRectMake((kScreenW - 300)/2, (kScreenH - 350)/2, 300, 230);
  413. }];
  414. }
  415. #pragma mark ======================我的公会======================
  416. - (void)createFamilyViewWithVC:(UIViewController *)myVC andModel:(userPageModel *)userModel
  417. {
  418. self.userModel = userModel;
  419. if (!self.backgroundView)
  420. {
  421. self.backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  422. self.backgroundView.backgroundColor = kAppGrayColor6;
  423. self.backgroundView.alpha = 0.5;
  424. self.backgroundView.hidden = NO;
  425. [myVC.view addSubview:self.backgroundView];
  426. self.bigButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  427. [self.bigButton addTarget:self action:@selector(closeFamilyView) forControlEvents:UIControlEventTouchUpInside];
  428. [self.backgroundView addSubview:_bigButton];
  429. self.backView = [[UIView alloc] initWithFrame:CGRectMake(10, (kScreenH-170)/2, kScreenW-20, 170)];
  430. self.backView.backgroundColor = [UIColor grayColor];
  431. self.backView.layer.cornerRadius = 5;
  432. self.backView.layer.masksToBounds = YES;
  433. [myVC.view addSubview:_backView];
  434. self.bigView = [[UIView alloc] initWithFrame:CGRectMake(5, 5, kScreenW-30, 160)];
  435. self.bigView.backgroundColor = [UIColor whiteColor];
  436. self.bigView.layer.cornerRadius = 5;
  437. self.bigView.layer.masksToBounds = YES;
  438. [self.backView addSubview:self.bigView];
  439. self.addFamilyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  440. self.addFamilyBtn.frame = CGRectMake(15, 20, kScreenW-60, 48);
  441. self.addFamilyBtn.backgroundColor = kAppMainColor;
  442. self.addFamilyBtn.layer.cornerRadius = 15;
  443. self.addFamilyBtn.layer.masksToBounds = YES;
  444. [self.addFamilyBtn addTarget:self action:@selector(clickAddBtn) forControlEvents:UIControlEventTouchUpInside];
  445. [self.addFamilyBtn setTitle:ASLocalizedString(@"加入公会")forState:UIControlStateNormal];
  446. [self.bigView addSubview:self.addFamilyBtn];
  447. self.createBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  448. self.createBtn.backgroundColor = kAppFamilyBtnColor;
  449. self.createBtn.layer.cornerRadius = 15;
  450. self.createBtn.layer.masksToBounds = YES;
  451. [self.createBtn setTitle:ASLocalizedString(@"创建公会")forState:UIControlStateNormal];
  452. [self.createBtn addTarget:self action:@selector(clickCreateBtn) forControlEvents:UIControlEventTouchUpInside];
  453. [self.bigView addSubview:self.createBtn];
  454. if ([self.BuguLive.appModel.family_join intValue] == 0)
  455. {
  456. self.backView.frame = CGRectMake(10, (kScreenH-85)/2, kScreenW-20, 85);
  457. self.bigView.frame = CGRectMake(5, 2.5, kScreenW-30, 80);
  458. self.addFamilyBtn.hidden = YES;
  459. self.createBtn.frame = CGRectMake(15, CGRectGetMidY(_bigView.frame)-26, kScreenW-60, 48);
  460. }
  461. else if ([self.BuguLive.appModel.family_join intValue] == 1)
  462. {
  463. self.backView.frame = CGRectMake(10, (kScreenH-170)/2, kScreenW-20, 170);
  464. self.bigView.frame = CGRectMake(5, 5, kScreenW-30, 160);
  465. self.addFamilyBtn.hidden = NO;
  466. self.createBtn.frame = CGRectMake(15, 92, kScreenW-60, 48);
  467. }
  468. }
  469. else
  470. {
  471. self.backgroundView.hidden = NO;
  472. self.backView.hidden = NO;
  473. }
  474. }
  475. //关闭公会页面
  476. - (void)closeFamilyView
  477. {
  478. self.backgroundView.hidden = YES;
  479. self.backView.hidden = YES;
  480. }
  481. //加入公会
  482. - (void)clickAddBtn
  483. {
  484. self.backgroundView.hidden = YES;
  485. self.backView.hidden = YES;
  486. FamilyListViewController *familyListVC = [[FamilyListViewController alloc] init];
  487. [[AppDelegate sharedAppDelegate] pushViewController:familyListVC animated:YES];
  488. }
  489. //创建公会
  490. - (void)clickCreateBtn
  491. {
  492. self.backgroundView.hidden = YES;
  493. self.backView.hidden = YES;
  494. EditFamilyViewController * editFamilyVC = [[EditFamilyViewController alloc] init];
  495. editFamilyVC.hidesBottomBarWhenPushed = YES;
  496. //创建公会时type=0;
  497. editFamilyVC.type = 0;
  498. editFamilyVC.user_id = self.userModel.user_id;
  499. [[AppDelegate sharedAppDelegate] pushViewController:editFamilyVC animated:YES];
  500. }
  501. //公会详情
  502. - (void)goToFamilyDesVCWithModel:(userPageModel *)userModel
  503. {
  504. FamilyDesViewController * familyDesVc = [[FamilyDesViewController alloc] init];
  505. //是否是族长
  506. familyDesVc.isFamilyHeder = [userModel.family_chieftain intValue];
  507. familyDesVc.jid =userModel.family_id;
  508. familyDesVc.user_id =userModel.user_id;
  509. [[AppDelegate sharedAppDelegate] pushViewController:familyDesVc animated:YES];
  510. }
  511. #pragma mark ======================我的公会======================
  512. - (void)createSocietyViewWithVC:(UIViewController *)myVC andModel:(userPageModel *)userModel
  513. {
  514. // if (!self.backgroundViewTwo)
  515. // {
  516. // self.backgroundViewTwo = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  517. // self.backgroundViewTwo.backgroundColor = kAppGrayColor6;
  518. // self.backgroundViewTwo.alpha = 0.5;
  519. // self.backgroundViewTwo.hidden = NO;
  520. // [myVC.view addSubview:self.backgroundViewTwo];
  521. // self.bigBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
  522. // [self.bigBtn addTarget:self action:@selector(closeSocietyView) forControlEvents:UIControlEventTouchUpInside];
  523. // [self.backgroundViewTwo addSubview:self.bigBtn];
  524. // self.backViewTwo = [[UIView alloc] initWithFrame:CGRectMake(10, (kScreenH-170)/2, kScreenW-20, 110)];
  525. // self.backViewTwo.backgroundColor = [UIColor grayColor];
  526. // self.backViewTwo.layer.cornerRadius = 5;
  527. // self.backViewTwo.layer.masksToBounds = YES;
  528. // [myVC.view addSubview:self.backViewTwo];
  529. // self.bigViewTwo = [[UIView alloc] initWithFrame:CGRectMake(5, 5, kScreenW-30, 100)];
  530. // self.bigViewTwo.backgroundColor = [UIColor whiteColor];
  531. // self.bigViewTwo.layer.cornerRadius = 5;
  532. // self.bigViewTwo.layer.masksToBounds = YES;
  533. // [self.backViewTwo addSubview:self.bigViewTwo];
  534. // self.createSocietyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  535. // self.createSocietyBtn.frame = CGRectMake(15, CGRectGetMidY(_bigViewTwo.frame)-27.5, kScreenW-60, 48);
  536. // self.createSocietyBtn.backgroundColor = kAppFamilyBtnColor;
  537. // self.createSocietyBtn.layer.cornerRadius = 15;
  538. // self.createSocietyBtn.layer.masksToBounds = YES;
  539. // [self.createSocietyBtn setTitle:ASLocalizedString(@"创建公会")forState:UIControlStateNormal];
  540. // [self.createSocietyBtn addTarget:self action:@selector(clickCreateSocietyBtn) forControlEvents:UIControlEventTouchUpInside];
  541. // [self.bigViewTwo addSubview:self.createSocietyBtn];
  542. // }
  543. // else
  544. // {
  545. // self.backgroundViewTwo.hidden = NO;
  546. // self.backViewTwo.hidden = NO;
  547. // }
  548. [self clickCreateSocietyBtn:userModel];
  549. }
  550. //关闭公会页面
  551. - (void)closeSocietyView
  552. {
  553. self.backgroundViewTwo.hidden = YES;
  554. self.backViewTwo.hidden = YES;
  555. }
  556. //加入公会
  557. - (void)clickAddSocietyBtn
  558. {
  559. self.backgroundViewTwo.hidden = YES;
  560. self.backViewTwo.hidden = YES;
  561. SocietyListViewController * societyListVC = [[SocietyListViewController alloc] init];
  562. [[AppDelegate sharedAppDelegate] pushViewController:societyListVC animated:YES];
  563. }
  564. //创建公会
  565. - (void)clickCreateSocietyBtn:(userPageModel *)model
  566. {
  567. self.backgroundViewTwo.hidden = YES;
  568. self.backViewTwo.hidden = YES;
  569. EditSocietyViewController * editSocietyVC = [[EditSocietyViewController alloc] init];
  570. //创建公会时type=0;
  571. editSocietyVC.type = 0;
  572. editSocietyVC.user_id = model.user_id;
  573. [[AppDelegate sharedAppDelegate] pushViewController:editSocietyVC animated:YES];
  574. }
  575. //公会详情
  576. - (void)goToSocietyDesVCWithModel:(userPageModel *)userModel
  577. {
  578. SocietyDetailVC *detailVC = [[SocietyDetailVC alloc]init];
  579. detailVC.hidesBottomBarWhenPushed = YES;
  580. detailVC.mySocietyID =[userModel.society_id intValue];
  581. detailVC.type =[userModel.society_chieftain intValue];
  582. detailVC.mygh_status = [userModel.gh_status intValue];
  583. detailVC.flagStr = @"MySociety";
  584. [[AppDelegate sharedAppDelegate] pushViewController:detailVC animated:YES];
  585. }
  586. //消息的角标
  587. - (void)loadBadageDataWithView:(MPCHeadView *)headV
  588. {
  589. return;
  590. [SFriendObj getAllUnReadCountComplete:^(int num) {
  591. int scount = num;
  592. if(scount)
  593. {
  594. if(scount >98){
  595. headV.badge.badgeText = @"99+";
  596. }else{
  597. headV.badge.badgeText = [NSString stringWithFormat:@"%d",scount];
  598. }
  599. }
  600. else
  601. {
  602. headV.badge.badgeText = @"";
  603. }
  604. }];
  605. }
  606. - (GlobalVariables *)BuguLive
  607. {
  608. if (!_BuguLive)
  609. {
  610. _BuguLive = [GlobalVariables sharedInstance];
  611. }
  612. return _BuguLive;
  613. }
  614. - (CGFloat)getMyHeightWithModel:(userPageModel *)myUserModel andBuguLive:(GlobalVariables *)myBuguLive andSection:(int)section andType:(int)type
  615. {
  616. if (type == 1)
  617. {
  618. if (section == MPCInviteUser) {
  619. return 1;
  620. }
  621. if(section == MPCarBuy || section == MPCVIPSection || section == MPCLuckNumber || section == MPCOutPutSection )
  622. {
  623. return 0;
  624. }
  625. if(section == MPBGSHOP)
  626. {
  627. return 1;
  628. }
  629. if(section == MPGuiZu)
  630. {
  631. if ([self.BuguLive.appModel.open_noble isEqualToString:@"1"]) {
  632. return 1;
  633. }
  634. return 0;
  635. }
  636. if (section == MPCSetSection) {
  637. return 1;
  638. }
  639. if (section == MPCOutPutSection || section == MPCGradeSection || section == MPCAcountSection ||section == MPCRenZhenSection || section == MPCLuckNumber || section == MPCInviteUser)//送出 等级 账户 贡献榜 认证 设置
  640. {
  641. return 1;
  642. }else if (section == MPCContributeSection){
  643. return 1;
  644. }
  645. else if (section == MPCVIPSection)//VIP会员
  646. {
  647. if ([myBuguLive.appModel.open_vip isEqualToString:@"1"])
  648. {
  649. return 1;
  650. }else
  651. {
  652. return 0;
  653. }
  654. }
  655. else if(section == MPCarBuy)
  656. {
  657. return 1;
  658. }
  659. else if (section == MPCexchangeCoinsSection)//兑换游戏币
  660. {
  661. if (myBuguLive.appModel.open_diamond_game_module == 0 && myBuguLive.appModel.open_game_module == 1)
  662. {
  663. return 1;
  664. }else
  665. {
  666. return 0;
  667. }
  668. }else if (section == MPCIncomeSection)//收益
  669. {
  670. // if ([VersionNum isEqualToString:self.BuguLive.appModel.ios_check_version])
  671. // {
  672. return 0;
  673. // }else
  674. // {
  675. // return 1;
  676. // }
  677. }else if (section == MPCOrderMSection )//订单管理
  678. {
  679. if (![myUserModel.show_podcast_order isEqualToString:@""] &&[myUserModel.show_podcast_order intValue] !=0)
  680. {
  681. return 1;
  682. }else
  683. {
  684. return 0;
  685. }
  686. }else if (section == MPCAutionMSection)//竞拍管理
  687. {
  688. if (![myUserModel.show_podcast_pai isEqualToString:@""] &&[myUserModel.show_podcast_pai intValue] !=0)
  689. {
  690. return 1;
  691. }else
  692. {
  693. return 0;
  694. }
  695. }else if (section == MPCMyOrderSection)//我的订单
  696. {
  697. if (![myUserModel.show_user_order isEqualToString:@""] &&[myUserModel.show_user_order intValue] !=0)
  698. {
  699. return 1;
  700. }else
  701. {
  702. return 0;
  703. }
  704. }else if (section == MPCGoodsMSection)//商品管理
  705. {
  706. if (![myUserModel.show_podcast_goods isEqualToString:@""] &&[myUserModel.show_podcast_goods intValue] !=0)
  707. {
  708. return 1;
  709. }else
  710. {
  711. return 0;
  712. }
  713. }else if (section == MPCMyAutionSection)//我的竞拍
  714. {
  715. if (![myUserModel.show_user_pai isEqualToString:@""] &&[myUserModel.show_user_pai intValue] !=0)
  716. {
  717. return 1;
  718. }else
  719. {
  720. return 0;
  721. }
  722. }else if (section == MPCShopCartSection)//我的购物车
  723. {
  724. if ([myBuguLive.appModel.shop_shopping_cart integerValue] == 1)
  725. {
  726. return 1;
  727. }else
  728. {
  729. return 0;
  730. }
  731. }else if (section == MPCMyLitteShopSection)//我的小店
  732. {
  733. if ([myUserModel.open_podcast_goods integerValue] == 1)
  734. {
  735. return 1;
  736. }else
  737. {
  738. return 0;
  739. }
  740. }else if (section == MPCFamilySection)//我的公会
  741. {
  742. if ([myBuguLive.appModel.open_family_module integerValue]==1)
  743. {
  744. return 1;
  745. }else
  746. {
  747. return 0;
  748. }
  749. }else if (section == MPCSZJLSection)//直播间收支记录
  750. {
  751. if (myBuguLive.appModel.live_pay==1)
  752. {
  753. return 1;
  754. }else
  755. {
  756. return 0;
  757. }
  758. }else if (section == MPCTradeSection)//我的公会
  759. {
  760. if ([myBuguLive.appModel.open_society_module integerValue]==1)
  761. {
  762. return 1;
  763. }else
  764. {
  765. return 0;
  766. }
  767. }
  768. else if (section == MPCLiveHostCenter){
  769. return 1;
  770. }
  771. else if (section == MPCMySmallShop){
  772. return 1;
  773. }
  774. else if (section == MPCShareISection)//分享收益
  775. {
  776. if (myBuguLive.appModel.distribution==1)
  777. {
  778. return 1;
  779. }else
  780. {
  781. return 0;
  782. }
  783. }
  784. else if(section == MPCSetInvateCode)//邀请码
  785. {
  786. if (kIsCheckingVersion())
  787. {
  788. return 0;
  789. }
  790. return 1;
  791. }
  792. else//游戏分享收益
  793. {
  794. if (myBuguLive.appModel.game_distribution==1)
  795. {
  796. return 1;
  797. }else
  798. {
  799. return 0;
  800. }
  801. }
  802. }else
  803. {
  804. if (section == MPCGradeSection || section == MPCSetSection)//等级 设置
  805. {
  806. return 0.01;
  807. // 10*kAppRowHScale;
  808. }else if (section == MPCSetInvateCode){
  809. return 0.01;
  810. }
  811. else if (section == MPCShareISection)//分享收益
  812. {
  813. return 0.01;
  814. // if (myBuguLive.appModel.distribution==1)
  815. // {
  816. // return 10*kAppRowHScale;
  817. // }else
  818. // {
  819. // if (myBuguLive.appModel.game_distribution==1)
  820. // {
  821. // return 10*kAppRowHScale;
  822. // }else
  823. // {
  824. // return 0.01;
  825. // }
  826. // }
  827. }else if (section == MPCGoodsMSection)//商品管理
  828. {
  829. if (![myUserModel.show_podcast_goods isEqualToString:@""] &&[myUserModel.show_podcast_goods intValue] !=0)
  830. {
  831. return 10*kAppRowHScale;
  832. }else
  833. {
  834. if ((![myUserModel.show_user_order isEqualToString:@""] &&[myUserModel.show_user_order intValue] !=0)||(![myUserModel.show_podcast_order isEqualToString:@""] &&[myUserModel.show_podcast_order intValue] !=0)||([myBuguLive.appModel.shop_shopping_cart integerValue] == 1))
  835. {
  836. return 10*kAppRowHScale;
  837. }else
  838. {
  839. return 0.01;
  840. }
  841. }
  842. }else if (section == MPCMyAutionSection)//我的竞拍
  843. {
  844. if (![myUserModel.show_user_pai isEqualToString:@""] &&[myUserModel.show_user_pai intValue] !=0)
  845. {
  846. return 10*kAppRowHScale;
  847. }else
  848. {
  849. return 0.01;
  850. }
  851. }else if (section == MPCMyLitteShopSection)//我的小店
  852. {
  853. if ([myUserModel.open_podcast_goods integerValue] == 1)
  854. {
  855. return 10*kAppRowHScale;
  856. }else
  857. {
  858. return 0.01;
  859. }
  860. }else if (section == MPCFamilySection)//我的公会
  861. {
  862. return 0.01;
  863. // if ([myBuguLive.appModel.open_family_module integerValue]==1)
  864. // {
  865. // return 10*kAppRowHScale;
  866. // }else
  867. // {
  868. // if ([myBuguLive.appModel.open_society_module integerValue]==1)
  869. // {
  870. // return 10*kAppRowHScale;
  871. // }else
  872. // {
  873. // return 0.01;
  874. // }
  875. // }
  876. }else
  877. {
  878. return 0.01;
  879. }
  880. }
  881. }
  882. @end