1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- //
- // BaseVC.m
- // LNManager
- //
- // Created by EchoShacolee on 2017/4/6.
- // Copyright © 2017年 lee. All rights reserved.
- //
- #import "BaseVC.h"
- @interface BaseVC ()
- @end
- @implementation BaseVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.navigationController.navigationBar.translucent = NO;
- self.view.backgroundColor = KBackGroundColor;
- [self goBackByNavigation];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- #pragma mark 弹出框提示
- - (void)showMsgByAlertVCWithString:(NSString *)str{
- [RQ_SHARE_FUNCTION showAlertWithTitle:nil message:str alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"确定" otherButtonTitles:nil otherButtonStyles:nil completion:nil];
- }
- #pragma mark 获取数据
- -(void)getDataWithDic:(NSMutableDictionary *)mdic method:(NSString *)method block:(Block)block{
-
- //判断网络是否连接
- if (![NetManager connectedToNetWork]) {
- showMsgUnconnect();
- return;
- }
-
- [NetManager requestAnythingWithURL:method dictionary:mdic dataArray:nil completion:^(NSDictionary *root) {
-
- if (!root) {
- ShowMsg(@"数据请求失败,请重试");
- return;
- }
- if ([root[@"code"] integerValue] == 1) {
- ShowMsg(root[@"msg"]);
- return;
- }
-
- if (block) {
- block(root);
- }
- }];
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|