SellerView.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. //
  2. // SellerView.m
  3. // yunbaolive
  4. //
  5. // Created by ybRRR on 2020/1/16.
  6. // Copyright © 2020 cat. All rights reserved.
  7. //
  8. #import "SellerView.h"
  9. #import "ShopInfoVC.h"
  10. #import "BillManageVC.h"
  11. #import "SellerOrderManagementVC.h"
  12. #import "CommodityManagementVC.h"
  13. #import "AddressVC.h"
  14. #import "AddCommodityVC.h"
  15. #import "AddGoodsVC.h"
  16. #import "ClassificationVC.h"
  17. #import "ClassToExamineVC.h"
  18. #import "PlatformGoodsVC.h"
  19. @implementation SellerView
  20. -(instancetype)initWithFrame:(CGRect)frame
  21. {
  22. self = [super initWithFrame:frame];
  23. if (self) {
  24. [self creatUI];
  25. [self creatSectionOne];
  26. [self creatSectionTwo];
  27. [self creatSectionThree];
  28. // [self getUnreadCount];
  29. }
  30. return self;
  31. }
  32. #pragma mark -----数据请求-------------
  33. -(void)requstData{
  34. YBWeakSelf;
  35. NSDictionary *signdic = @{@"uid":[Config getOwnID],@"token":[Config getOwnToken], @"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]]};
  36. NSString *sign = [PublicObj sortString:signdic];
  37. NSDictionary *dic = @{
  38. @"uid":[Config getOwnID],
  39. @"token":[Config getOwnToken],
  40. @"time":[NSNumber numberWithLong: (long)[[NSDate date] timeIntervalSince1970]],
  41. @"sign":sign
  42. };
  43. [YBNetworking postWithUrl:@"Seller.getHome" Dic:dic Suc:^(int code, id info, NSString *msg) {
  44. if (code ==0) {
  45. NSDictionary *infos = [info firstObject];
  46. shopInfo = [infos valueForKey:@"shop_info"];
  47. [weakSelf reloadData:infos];
  48. }else{
  49. [MBProgressHUD showError:msg];
  50. }
  51. } Fail:^(id fail) {
  52. }];
  53. }
  54. -(void)reloadData:(NSDictionary *)infos{
  55. NSString *point = minstr([[infos valueForKey:@"shop_info"] valueForKey:@"composite_points"]);
  56. NSString *ptStr = YZMsg(@"综合分");
  57. NSString *composite_points = [NSString stringWithFormat:@"%@ \n %@",point,ptStr];
  58. NSRange redRange = NSMakeRange(0, composite_points.length-ptStr.length);
  59. NSMutableAttributedString *contentStr = [[NSMutableAttributedString alloc] initWithString:composite_points];
  60. [contentStr addAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:14]} range:redRange];
  61. [scoreBtn setAttributedTitle:contentStr forState:0];
  62. NSString *balance = minstr([[infos valueForKey:@"balance_info"] valueForKey:@"balance"]);
  63. NSString *balance_total = minstr([[infos valueForKey:@"balance_info"] valueForKey:@"balance_total"]);
  64. //账户余额
  65. NSString *str = [NSString stringWithFormat:@"%@\n%@",priceTitleArr[0],balance];
  66. NSMutableAttributedString *balanceStr = [[NSMutableAttributedString alloc] initWithString:str];
  67. NSRange redRangesss = [str rangeOfString:balance];
  68. [balanceStr addAttributes:@{NSForegroundColorAttributeName:Pink_Cor,NSFontAttributeName:[UIFont boldSystemFontOfSize:16]} range:redRangesss];
  69. if ([str hasSuffix:@".00"]) {
  70. [balanceStr addAttributes:@{NSFontAttributeName:SYS_Font(11)} range:NSMakeRange(str.length-3, 3)];
  71. }
  72. [balanceBtn setAttributedTitle:balanceStr forState:0];
  73. //全部收入
  74. NSString *totalstr = [NSString stringWithFormat:@"%@\n%@",priceTitleArr[1],balance_total];
  75. NSMutableAttributedString *balanceTotalStr = [[NSMutableAttributedString alloc] initWithString:totalstr];
  76. NSRange redRangebbb = [totalstr rangeOfString:balance_total];
  77. [balanceTotalStr addAttributes:@{NSForegroundColorAttributeName:Pink_Cor,NSFontAttributeName:[UIFont boldSystemFontOfSize:16]} range:redRangebbb];
  78. if ([totalstr hasSuffix:@".00"]) {
  79. [balanceTotalStr addAttributes:@{NSFontAttributeName:SYS_Font(11)} range:NSMakeRange(totalstr.length-3, 3)];
  80. }
  81. [allIncomeBtn setAttributedTitle:balanceTotalStr forState:0];
  82. //待付款
  83. NSString *waitPay =minstr([[infos valueForKey:@"order_info"] valueForKey:@"wait_payment"]);
  84. [waitPayBtn setTitle:[NSString stringWithFormat:@"%@ \n %@",waitPay,orderTitleArr[0]] forState:0];
  85. //待发货
  86. NSString *waitSend =minstr([[infos valueForKey:@"order_info"] valueForKey:@"wait_shipment"]);
  87. [waitSendBtn setTitle:[NSString stringWithFormat:@"%@ \n %@",waitSend,orderTitleArr[1]] forState:0];
  88. //待退款
  89. NSString *waitRefund =minstr([[infos valueForKey:@"order_info"] valueForKey:@"wait_refund"]);
  90. [waitRefundBtn setTitle:[NSString stringWithFormat:@"%@ \n %@",waitRefund,orderTitleArr[2]] forState:0];
  91. sellerInfoLb.text = minstr([infos valueForKey:@"seller_desc"]);
  92. }
  93. -(void)creatUI{
  94. headImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, _window_width, 190)];
  95. headImg.userInteractionEnabled = YES;
  96. headImg.image = [UIImage imageNamed:@"sellerBackground"];
  97. [self addSubview:headImg];
  98. UIImageView *avatarImg = [[UIImageView alloc]init];
  99. [avatarImg sd_setImageWithURL:[NSURL URLWithString:[Config getUserAvatar]]];
  100. avatarImg.layer.cornerRadius = 25;
  101. avatarImg.layer.masksToBounds = YES;
  102. [self addSubview:avatarImg];
  103. [avatarImg mas_makeConstraints:^(MASConstraintMaker *make) {
  104. make.top.equalTo(self).offset(34+statusbarHeight+20+15);
  105. make.width.height.mas_equalTo(50);
  106. make.left.equalTo(self).offset(20);
  107. }];
  108. UIButton *nameBtn = [UIButton buttonWithType:0];
  109. nameBtn.titleLabel.font =[UIFont boldSystemFontOfSize:15];
  110. [nameBtn setTitleColor:[UIColor whiteColor] forState:0] ;
  111. [nameBtn setTitle:[Config getOwnNicename] forState:0];
  112. [nameBtn addTarget:self action:@selector(shopInfoClick:) forControlEvents:UIControlEventTouchUpInside];
  113. [self addSubview:nameBtn];
  114. [nameBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  115. make.left.equalTo(avatarImg.mas_right).offset(10);
  116. make.top.equalTo(avatarImg.mas_top).offset(5);
  117. make.height.mas_equalTo(15);
  118. }];
  119. UIImageView *rightimg = [[UIImageView alloc]init];
  120. rightimg.image = [UIImage imageNamed:@"shop_right"];
  121. [self addSubview:rightimg];
  122. [rightimg mas_makeConstraints:^(MASConstraintMaker *make) {
  123. make.left.equalTo(nameBtn.mas_right).offset(10);
  124. make.width.height.mas_equalTo(18);
  125. make.centerY.equalTo(nameBtn);
  126. }];
  127. sellerInfoLb= [[UILabel alloc]init];
  128. sellerInfoLb.font = [UIFont systemFontOfSize:13];
  129. sellerInfoLb.textColor = [UIColor grayColor];
  130. sellerInfoLb.text = YZMsg(@"暂无信息");
  131. sellerInfoLb.numberOfLines = 0;
  132. [self addSubview:sellerInfoLb];
  133. [sellerInfoLb mas_makeConstraints:^(MASConstraintMaker *make) {
  134. make.left.equalTo(nameBtn);
  135. make.top.equalTo(nameBtn.mas_bottom).offset(10);
  136. //make.height.mas_equalTo(16);
  137. make.right.lessThanOrEqualTo(self.mas_right).offset(-80);
  138. }];
  139. UIButton *infoBtn = [UIButton buttonWithType:0];
  140. [infoBtn addTarget:self action:@selector(shopInfoClick:) forControlEvents:UIControlEventTouchUpInside];
  141. [self addSubview:infoBtn];
  142. [infoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  143. make.left.equalTo(nameBtn.mas_left);
  144. make.top.equalTo(nameBtn.mas_top);
  145. make.right.equalTo(rightimg.mas_right);
  146. make.bottom.equalTo(sellerInfoLb.mas_bottom);
  147. }];
  148. UIImageView *scoreImg = [[UIImageView alloc]init];
  149. scoreImg.layer.borderColor = [UIColor whiteColor].CGColor;
  150. scoreImg.layer.borderWidth = 1;
  151. scoreImg.layer.cornerRadius = 28;
  152. scoreImg.layer.masksToBounds = YES;
  153. scoreImg.backgroundColor = [UIColor clearColor];
  154. [self addSubview:scoreImg];
  155. [scoreImg mas_makeConstraints:^(MASConstraintMaker *make) {
  156. make.width.height.mas_equalTo(56);
  157. make.centerY.equalTo(avatarImg);
  158. make.right.equalTo(self).offset(-20);
  159. }];
  160. scoreBtn = [UIButton buttonWithType:0];
  161. [scoreBtn setBackgroundColor:[UIColor whiteColor]];
  162. [scoreBtn setTitleColor:[UIColor blackColor] forState:0];
  163. scoreBtn.titleLabel.font = [UIFont systemFontOfSize:10];
  164. scoreBtn.titleLabel.numberOfLines = 0;
  165. scoreBtn.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
  166. scoreBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
  167. scoreBtn.layer.cornerRadius = 25;
  168. [self addSubview:scoreBtn];
  169. [scoreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  170. make.width.height.mas_equalTo(50);
  171. make.center.equalTo(scoreImg);
  172. }];
  173. }
  174. -(void)creatSectionOne{
  175. backView1 = [[UIView alloc]init];
  176. backView1.frame = CGRectMake(15, headImg.bottom-35, _window_width-30, 70);
  177. backView1.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0];
  178. backView1.layer.cornerRadius = 5;
  179. backView1.layer.masksToBounds = YES;
  180. backView1.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.05].CGColor;
  181. backView1.layer.shadowOffset = CGSizeMake(0,0);
  182. backView1.layer.shadowOpacity = 1;
  183. backView1.layer.shadowRadius = 3;
  184. [self addSubview:backView1];
  185. priceTitleArr = @[YZMsg(@"账户余额 (元)"),YZMsg(@"累计收入 (元)")];
  186. NSArray *scoreArr = @[@"0.00",@"0.00"];
  187. for (int i = 0; i < priceTitleArr.count; i ++) {
  188. UIButton *btn = [UIButton buttonWithType:0];
  189. btn.frame = CGRectMake(i *backView1.width/2+10, 10, backView1.width/2-20, 50);
  190. btn.titleLabel.font = [UIFont systemFontOfSize:14];
  191. btn.titleLabel.textAlignment = NSTextAlignmentLeft;
  192. btn.titleLabel.numberOfLines = 0;
  193. btn.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
  194. NSString *title = priceTitleArr[i];
  195. NSString *score = scoreArr[i];
  196. NSString *str = [NSString stringWithFormat:@"%@ \n %@",title,score];
  197. NSMutableAttributedString *contentStr = [[NSMutableAttributedString alloc] initWithString:str];
  198. NSRange redRange = NSMakeRange(title.length, str.length-title.length);
  199. [contentStr addAttributes:@{NSForegroundColorAttributeName:Pink_Cor,NSFontAttributeName:[UIFont boldSystemFontOfSize:16]} range:redRange];
  200. [btn setAttributedTitle:contentStr forState:0];
  201. [btn addTarget:self action:@selector(billClick) forControlEvents:UIControlEventTouchUpInside];
  202. [backView1 addSubview:btn];
  203. if (i == 0) {
  204. balanceBtn = btn;
  205. }else{
  206. allIncomeBtn = btn;
  207. }
  208. }
  209. }
  210. -(void)creatSectionTwo{
  211. backView2 = [[UIView alloc]initWithFrame:CGRectMake(15, backView1.bottom+10, _window_width-30, 120)];
  212. backView2.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0];
  213. backView2.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.05].CGColor;
  214. backView2.layer.shadowOffset = CGSizeMake(0,0);
  215. backView2.layer.shadowOpacity = 1;
  216. backView2.layer.shadowRadius = 3;
  217. backView2.layer.cornerRadius = 5;
  218. [self addSubview:backView2];
  219. UILabel *orderTitle = [[UILabel alloc]init];
  220. orderTitle.frame = CGRectMake(15, 15, 180, 18);
  221. orderTitle.text =YZMsg(@"订单管理");
  222. orderTitle.font = [UIFont boldSystemFontOfSize:14];
  223. orderTitle.textColor = [UIColor blackColor];
  224. [backView2 addSubview:orderTitle];
  225. UIButton *allOrderBtn = [UIButton buttonWithType:0];
  226. allOrderBtn.frame = CGRectMake(backView2.width-110, 15, 110, 18);
  227. [allOrderBtn setTitleColor:RGB(200, 200, 200) forState:0];
  228. [allOrderBtn setTitle:YZMsg(@"查看全部订单") forState:0];
  229. [allOrderBtn setImage:[UIImage imageNamed:@"shop_right"] forState:0];
  230. allOrderBtn.titleLabel.font = [UIFont systemFontOfSize:13];
  231. [allOrderBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, - allOrderBtn.imageView.image.size.width, 0, allOrderBtn.imageView.image.size.width)];
  232. [allOrderBtn setImageEdgeInsets:UIEdgeInsetsMake(0, allOrderBtn.titleLabel.bounds.size.width, 0, -allOrderBtn.titleLabel.bounds.size.width)];
  233. allOrderBtn.tag = 10009;
  234. [allOrderBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
  235. [backView2 addSubview:allOrderBtn];
  236. orderTitleArr = @[YZMsg(@"待付款"),YZMsg(@"待发货"),YZMsg(@"等待退款")];
  237. for (int i = 0; i < orderTitleArr.count; i ++) {
  238. UIButton *btn = [UIButton buttonWithType:0];
  239. btn.frame = CGRectMake(i *backView2.width/4, orderTitle.bottom +18, backView1.width/4, 50);
  240. [btn setTitle:[NSString stringWithFormat:@"%@ \n %@",@"0",orderTitleArr[i]] forState:0];
  241. [btn setTitleColor:[UIColor blackColor] forState:0];
  242. btn.titleLabel.font = [UIFont boldSystemFontOfSize:12];
  243. btn.titleLabel.numberOfLines = 0;
  244. btn.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
  245. btn.titleLabel.textAlignment = NSTextAlignmentCenter;
  246. btn.tag = 20000+i;
  247. [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
  248. [backView2 addSubview:btn];
  249. if (i == 0) {
  250. waitPayBtn= btn ;
  251. }else if (i == 1){
  252. waitSendBtn = btn ;
  253. }else{
  254. waitRefundBtn = btn;
  255. }
  256. }
  257. }
  258. -(void)creatSectionThree{
  259. UIView *backView3 = [[UIView alloc]initWithFrame:CGRectMake(15, backView2.bottom+10, _window_width-30, 70)];
  260. backView3.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0];
  261. backView3.layer.shadowColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.05].CGColor;
  262. backView3.layer.shadowOffset = CGSizeMake(0,0);
  263. backView3.layer.shadowOpacity = 1;
  264. backView3.layer.shadowRadius = 3;
  265. backView3.layer.cornerRadius = 5;
  266. [self addSubview:backView3];
  267. NSArray *imgeTitle = @[@"添加商品",@"商品管理",@"地址管理",@"经营类别"];
  268. NSArray *title2Arr = @[YZMsg(@"添加商品"),YZMsg(@"商品管理"),YZMsg(@"地址管理"),YZMsg(@"经营类别")];//YZMsg(@"消息"),
  269. for (int i = 0; i < title2Arr.count; i ++) {
  270. UIButton *btn = [UIButton buttonWithType:0];
  271. // if (i < 4) {
  272. btn.frame = CGRectMake(i *backView3.width/4, 10, backView3.width/4, 50);
  273. // }else{
  274. // btn.frame = CGRectMake(0, 70, backView3.width/4, 50);
  275. //
  276. // }
  277. /*
  278. [btn setTitle:title2Arr[i] forState:0];
  279. [btn setTitleColor:[UIColor blackColor] forState:0];
  280. btn.titleLabel.font = [UIFont systemFontOfSize:12];
  281. btn.imageView.contentMode = UIViewContentModeScaleAspectFit;
  282. [btn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"shop_%@",imgeTitle[i]]] forState:0];
  283. */
  284. btn = [PublicObj setUpImgDownText:btn];
  285. btn.tag = 30000+i;
  286. [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
  287. [backView3 addSubview:btn];
  288. UIImageView *icomImg = [[UIImageView alloc]init];
  289. icomImg.frame = CGRectMake(btn.width/2-10, 0, 20, 20);
  290. icomImg.image = [UIImage imageNamed:[NSString stringWithFormat:@"shop_%@",imgeTitle[i]]];
  291. [btn addSubview:icomImg];
  292. UILabel *titleLb = [[UILabel alloc]init];
  293. titleLb.frame = CGRectMake(10, icomImg.bottom+3, btn.width-20, 30);
  294. titleLb.font =[UIFont systemFontOfSize:12];
  295. titleLb.text = title2Arr[i];
  296. titleLb.textColor = UIColor.blackColor;
  297. titleLb.lineBreakMode = NSLineBreakByWordWrapping;
  298. titleLb.numberOfLines = 0;
  299. titleLb.textAlignment = NSTextAlignmentCenter;
  300. [btn addSubview:titleLb];
  301. // if (i == 3) {
  302. // msgTaglb= [[UILabel alloc]init];
  303. // msgTaglb.frame = CGRectMake(btn.width/2+10, 0, 12, 12);
  304. // msgTaglb.backgroundColor = [UIColor redColor];
  305. // msgTaglb.layer.cornerRadius = 6;
  306. // msgTaglb.layer.masksToBounds = YES;
  307. // msgTaglb.textColor = [UIColor whiteColor];
  308. // msgTaglb.textAlignment = NSTextAlignmentCenter;
  309. // msgTaglb.font = [UIFont systemFontOfSize:8];
  310. // [btn addSubview:msgTaglb];
  311. // msgTaglb.hidden = YES;
  312. // }
  313. }
  314. }
  315. -(void)btnClick:(UIButton *)sender{
  316. switch (sender.tag) {
  317. case 10009:{
  318. SellerOrderManagementVC *order = [[SellerOrderManagementVC alloc]init];
  319. order.selectIndex = 3;
  320. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:order animated:YES];
  321. }
  322. break;
  323. //待付款
  324. case 20000:{
  325. SellerOrderManagementVC *order = [[SellerOrderManagementVC alloc]init];
  326. order.selectIndex = 2;
  327. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:order animated:YES];
  328. }
  329. break;
  330. //待发货
  331. case 20001:{
  332. SellerOrderManagementVC *order = [[SellerOrderManagementVC alloc]init];
  333. order.selectIndex = 0;
  334. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:order animated:YES];
  335. }
  336. break;
  337. //等待退款
  338. case 20002:{
  339. SellerOrderManagementVC *order = [[SellerOrderManagementVC alloc]init];
  340. order.selectIndex = 1;
  341. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:order animated:YES];
  342. }
  343. break;
  344. //添加商品
  345. case 30000:{
  346. YBWeakSelf;
  347. NSArray *arr = @[YZMsg(@"平台商品"),YZMsg(@"站内商品"),YZMsg(@"站外商品")];
  348. if ([PublicObj isUp]) {
  349. arr = @[YZMsg(@"平台商品"),YZMsg(@"编辑新商品")];
  350. }
  351. _actionSheet = [[YBAlertActionSheet alloc]initWithFrame:CGRectMake(0, 0, _window_width, _window_height) cancelTitle:YZMsg(@"取消") cancelColor:[UIColor blackColor] andRowHeight:50 andOtherTitle:arr];
  352. _actionSheet.btnEvent = ^(NSString *btnTitle) {
  353. NSString *titleStr = btnTitle;
  354. if ([titleStr isEqual:YZMsg(@"取消")]) {
  355. [weakSelf.actionSheet removeFromSuperview];
  356. weakSelf.actionSheet = nil;
  357. }else if ([titleStr isEqual:YZMsg(@"站内商品")] || [titleStr isEqual:YZMsg(@"编辑新商品")]) {
  358. [weakSelf.actionSheet removeFromSuperview];
  359. weakSelf.actionSheet = nil;
  360. AddCommodityVC *add = [[AddCommodityVC alloc]init];
  361. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:add animated:YES];
  362. }else if ([titleStr isEqual:YZMsg(@"站外商品")]) {
  363. [weakSelf.actionSheet removeFromSuperview];
  364. weakSelf.actionSheet = nil;
  365. AddGoodsVC *vc = [[AddGoodsVC alloc]init];
  366. [[YBBaseAppDelegate sharedAppDelegate] pushViewController:vc animated:YES];
  367. }else if ([titleStr isEqual:YZMsg(@"平台商品")]) {
  368. [weakSelf.actionSheet removeFromSuperview];
  369. weakSelf.actionSheet = nil;
  370. PlatformGoodsVC *platgoods = [[PlatformGoodsVC alloc]init];
  371. [[YBBaseAppDelegate sharedAppDelegate] pushViewController:platgoods animated:YES];
  372. }
  373. };
  374. [self addSubview:_actionSheet];
  375. }
  376. break;
  377. //商品管理
  378. case 30001:{
  379. CommodityManagementVC *commodity = [[CommodityManagementVC alloc]init];
  380. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:commodity animated:YES];
  381. }
  382. break;
  383. //地址管理
  384. case 30002:{
  385. AddressVC *address = [[AddressVC alloc]init];
  386. address.titleStr = YZMsg(@"退货地址管理");
  387. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:address animated:YES];
  388. }
  389. break;
  390. // //消息
  391. // case 30003:{
  392. // MessageListVC *MC = [[MessageListVC alloc]init];
  393. // [[YBBaseAppDelegate sharedAppDelegate]pushViewController:MC animated:YES];
  394. // }
  395. break;
  396. //经营类别
  397. case 30003:{
  398. [self getCategoryStatus];
  399. }
  400. break;
  401. default:
  402. break;
  403. }
  404. }
  405. #pragma mark-----账单管理-------
  406. -(void)billClick{
  407. BillManageVC *bill = [[BillManageVC alloc]init];
  408. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:bill animated:YES];
  409. }
  410. #pragma mark-----小店详情-------
  411. -(void)shopInfoClick:(UIButton *)sender{
  412. ShopInfoVC *shop = [[ShopInfoVC alloc]init];
  413. shop.shopInfoDic = shopInfo;
  414. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:shop animated:YES];
  415. }
  416. #pragma mark----获取经营类目状态---------
  417. -(void)getCategoryStatus{
  418. NSDictionary *dic = @{
  419. @"uid":[Config getOwnID],
  420. @"token":[Config getOwnToken],
  421. };
  422. [YBNetworking postWithUrl:@"Shop.getApplyBusinessCategory" Dic:dic Suc:^(int code, id info, NSString *msg) {
  423. if (code ==0) {
  424. NSDictionary *infos = [info firstObject];
  425. //['status'] 0(审核中) 1(审核通过和未提交过申请) 2(审核失败)
  426. if ([minstr([infos valueForKey:@"status"]) isEqual:@"1"]) {
  427. ClassificationVC *classVc = [[ClassificationVC alloc]init];
  428. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:classVc animated:YES];
  429. }else {
  430. ClassToExamineVC *examine = [[ClassToExamineVC alloc]init];
  431. examine.statusStr =minstr([infos valueForKey:@"status"]);
  432. examine.reasonStr =minstr([infos valueForKey:@"reason"]);
  433. [[YBBaseAppDelegate sharedAppDelegate]pushViewController:examine animated:YES];
  434. }
  435. }else{
  436. [MBProgressHUD showError:msg];
  437. }
  438. } Fail:^(id fail) {
  439. }];
  440. }
  441. @end