2018-02-06-SVN 相关问题和登录密码问题

Read more   2018/2/5 posted in  工作总结

2018-02-02-上传壁纸功能

Read more   2018/2/2 posted in  工作总结

2018-01-31-获取本地图片

打开本地相册并添加到视图

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"上传壁纸";
    // 点击UIButton AddWallpaper 就是打开相册添加图片
    [_AddWallpaper addTarget:self action:@selector(AddWallpaperClick) forControlEvents:UIControlEventTouchUpInside];
    
    // 点击UIButton UpWallPaper 就是上传图片
    [_UpWallpaper addTarget:self action:@selector(UpWallpaperClick) forControlEvents:UIControlEventTouchUpInside];
}
- (void)AddWallpaperClick {
    
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:@"请选择图片" preferredStyle:UIAlertControllerStyleActionSheet];
    
    UIAlertAction *OKAction = [UIAlertAction actionWithTitle:@"打开相册" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        // 打开相册
        [self open];
    }];
    
    
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
    
    [alertController addAction:OKAction];
    [alertController addAction:cancelAction];
    
    [self presentViewController:alertController animated:YES completion:nil];
    
    
}
Read more   2018/1/31 posted in  工作总结

2018-01-30-收藏功能

收藏

  • 项目要求要在首页的视频右下角添加一个收藏的功能
  • 思路:
    • 1. 进入一个界面先要进行判断是否有收藏,所以进行第一次网络请求
    • 2. 判断成功后,在进行第二次事件,用户点击了收藏按钮所做的动作,例如收藏成功、取消收藏
NSString *getiscollect = [QWHttpUrls getiscollectUrl];
NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
[params setValue:[QWAccountModel sharedModel].uid forKey:@"uid"];
[params setValue:@"3" forKey:@"collect_type"];
[params setValue:self.gameID forKey:@"collect_id"];
[QWHttpTool postmanager:getiscollect params:params success:^(id  _Nonnull manager, id  _Nonnull json) {
    QWLog(@"显示collectstatus===%@",json[@"status"]);
    QWLog(@"显示collectURLdata===%@",json[@"data"]);
    if ([json[@"status"] isEqualToString:@"1"]) {
        [self.collectBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"已收藏"]] forState:UIControlStateNormal];
//            Isselected = 2;
    }else{
        [self.collectBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"收藏"]] forState:UIControlStateNormal];
//            Isselected = 1;
    }
} failure:^(NSError * _Nonnull error) {
    
}];
- (void)btnClick{
    self.collectBtn.selected = !self.collectBtn.selected;
    
    if (Isselected==1) {
        if (self.collectBtn.selected) {
            NSString *collectURL = [QWHttpUrls CollectUrlWithOp:1 withcollect_type:3 Withcollect_id:_movieStr];
            NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
            [params setValue:[QWAccountModel sharedModel].uid forKey:@"uid"];
            [QWHttpTool postmanager:collectURL params:params success:^(id  _Nonnull manager, id  _Nonnull json) {
                QWLog(@"collect结果===%@",json[@"msg"]);
                [QWShowMessage showMessage:[NSString stringWithFormat:@"%@",json[@"msg"]]];
                [self.collectBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"已收藏"]] forState:UIControlStateSelected];
            } failure:^(NSError * _Nonnull error) {
                
            }];
        }else{
            NSString *collectURL = [QWHttpUrls CollectUrlWithOp:2 withcollect_type:3 Withcollect_id:_movieStr];
            NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
            [params setValue:[QWAccountModel sharedModel].uid forKey:@"uid"];
            [QWHttpTool postmanager:collectURL params:params success:^(id  _Nonnull manager, id  _Nonnull json) {
                QWLog(@"collect结果===%@",json[@"msg"]);
                [QWShowMessage showMessage:[NSString stringWithFormat:@"%@",json[@"msg"]]];
                [self.collectBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"收藏"]] forState:UIControlStateSelected];
            } failure:^(NSError * _Nonnull error) {
                
            }];
            
        }
        
    }else{
        if (self.collectBtn.selected) {
            
            NSString *collectURL = [QWHttpUrls CollectUrlWithOp:2 withcollect_type:3 Withcollect_id:_movieStr];
            NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
            [params setValue:[QWAccountModel sharedModel].uid forKey:@"uid"];
            [QWHttpTool postmanager:collectURL params:params success:^(id  _Nonnull manager, id  _Nonnull json) {
                QWLog(@"collect结果===%@",json[@"msg"]);
                [QWShowMessage showMessage:[NSString stringWithFormat:@"%@",json[@"msg"]]];
                [self.collectBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"收藏"]] forState:UIControlStateSelected];
            } failure:^(NSError * _Nonnull error) {
                
            }];
        }else{
            NSString *collectURL = [QWHttpUrls CollectUrlWithOp:1 withcollect_type:3 Withcollect_id:_movieStr];
            NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
            [params setValue:[QWAccountModel sharedModel].uid forKey:@"uid"];
            [QWHttpTool postmanager:collectURL params:params success:^(id  _Nonnull manager, id  _Nonnull json) {
                QWLog(@"collect结果===%@",json[@"msg"]);
                [QWShowMessage showMessage:[NSString stringWithFormat:@"%@",json[@"msg"]]];
                [self.collectBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"已收藏"]] forState:UIControlStateSelected];
            } failure:^(NSError * _Nonnull error) {
                
            }];
            
        }
        
    }
}
2018/1/30 posted in  工作总结

2018-01-25-低级错误

在 ContenView 上添加 button 不显示

    self.collectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.collectBtn.frame = CGRectMake(screen_width-(screen_width-40), CGRectGetMaxY(_videoImage.frame)+left, 40, 40);
//    self.collectBtn.backgroundColor = [UIColor redColor];
    [self.collectBtn setBackgroundImage:[UIImage imageNamed:@"star-highlighted"] forState:UIControlStateNormal];
    [self.collectBtn setBackgroundImage:[UIImage imageNamed:@"star-highlighted-template"] forState:UIControlStateHighlighted];
    [self.collectBtn addTarget:self action:@selector(collectBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    [self.contentView addSubview:self.collectBtn];

这里的美工给的图片不是我之前的公司的美工,他们的命名方式很奇怪

  • 默认的格式:star-template
  • 高亮的格式:star-highlighted-template

一般的美工都是这么明名的

  • 默认的格式:star-template
  • 高亮的格式:star-template-highlighted

再加上我最近状态不佳,就直接写成以上的样子,最后什么都没显示

总结:不管是在哪上班摸清楚他们的行为方式
2018/1/25 posted in  工作总结

2018-01-22 Jeklly 搭建博客

Read more   2018/1/24 posted in  工作总结