相册上传
This commit is contained in:
@@ -161,6 +161,10 @@
|
||||
E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825CC26EA18C8009E8E9F /* ThemeColor.m */; };
|
||||
E8B825D026EA3825009E8E9F /* LoginPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825CF26EA3825009E8E9F /* LoginPasswordViewController.m */; };
|
||||
E8B846BC26FD7C1200A777FE /* UploadImage.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846BB26FD7C1200A777FE /* UploadImage.m */; };
|
||||
E8B846BF26FD827900A777FE /* XPMineUserInfoAlbumViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846BE26FD827900A777FE /* XPMineUserInfoAlbumViewController.m */; };
|
||||
E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */; };
|
||||
E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */; };
|
||||
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */; };
|
||||
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8CEA03C26EA3DE500644B44 /* LoginPasswordPresent.m */; };
|
||||
E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7626F2F15100F03460 /* XPMineViewController.m */; };
|
||||
E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7926F2F16600F03460 /* XPMinePresent.m */; };
|
||||
@@ -480,6 +484,13 @@
|
||||
E8B825CF26EA3825009E8E9F /* LoginPasswordViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPasswordViewController.m; sourceTree = "<group>"; };
|
||||
E8B846BA26FD7C1200A777FE /* UploadImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UploadImage.h; sourceTree = "<group>"; };
|
||||
E8B846BB26FD7C1200A777FE /* UploadImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UploadImage.m; sourceTree = "<group>"; };
|
||||
E8B846BD26FD827900A777FE /* XPMineUserInfoAlbumViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumViewController.h; sourceTree = "<group>"; };
|
||||
E8B846BE26FD827900A777FE /* XPMineUserInfoAlbumViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoAlbumViewController.m; sourceTree = "<group>"; };
|
||||
E8B846C026FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoAlbumCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
E8B846C326FDB41A00A777FE /* XPMineUserInfolbumPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfolbumPresenter.h; sourceTree = "<group>"; };
|
||||
E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfolbumPresenter.m; sourceTree = "<group>"; };
|
||||
E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumProtocol.h; sourceTree = "<group>"; };
|
||||
E8CEA03B26EA3DE500644B44 /* LoginPasswordPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPasswordPresent.h; sourceTree = "<group>"; };
|
||||
E8CEA03C26EA3DE500644B44 /* LoginPasswordPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPasswordPresent.m; sourceTree = "<group>"; };
|
||||
E8CEA03E26EA3E0200644B44 /* LoginPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPasswordProtocol.h; sourceTree = "<group>"; };
|
||||
@@ -1169,6 +1180,8 @@
|
||||
E8EEB91326FC7786007C6EBA /* XPMineUserInfoNickViewController.m */,
|
||||
E8EEB91526FC7B35007C6EBA /* XPMineUserInfoDesViewController.h */,
|
||||
E8EEB91626FC7B35007C6EBA /* XPMineUserInfoDesViewController.m */,
|
||||
E8B846BD26FD827900A777FE /* XPMineUserInfoAlbumViewController.h */,
|
||||
E8B846BE26FD827900A777FE /* XPMineUserInfoAlbumViewController.m */,
|
||||
);
|
||||
path = MineInfo;
|
||||
sourceTree = "<group>";
|
||||
@@ -1307,6 +1320,8 @@
|
||||
E8EEB90026FC31B6007C6EBA /* XPMineUserInfoPresenter.m */,
|
||||
E8EEB90D26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.h */,
|
||||
E8EEB90E26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m */,
|
||||
E8B846C326FDB41A00A777FE /* XPMineUserInfolbumPresenter.h */,
|
||||
E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */,
|
||||
);
|
||||
path = Presenter;
|
||||
sourceTree = "<group>";
|
||||
@@ -1326,6 +1341,7 @@
|
||||
E88B5CB926FB327500DA9178 /* XPMineTeenagerPwdProtocol.h */,
|
||||
E8EEB90226FC31CE007C6EBA /* XPMineUserInfoProtocol.h */,
|
||||
E8EEB91026FC6AD3007C6EBA /* XPMineUserInfoEditProtocol.h */,
|
||||
E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */,
|
||||
);
|
||||
path = Protocol;
|
||||
sourceTree = "<group>";
|
||||
@@ -1390,6 +1406,8 @@
|
||||
E8EEB8FD26FC2DF8007C6EBA /* XPMineUserInfoCustomNavView.m */,
|
||||
E8EEB90726FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.h */,
|
||||
E8EEB90826FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m */,
|
||||
E8B846C026FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.h */,
|
||||
E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */,
|
||||
);
|
||||
path = MineInfo;
|
||||
sourceTree = "<group>";
|
||||
@@ -1527,6 +1545,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */,
|
||||
E8EEB91126FC6AE2007C6EBA /* XPMineUserInfoEditProtocol.h in Sources */,
|
||||
E8EEB90326FC31DC007C6EBA /* XPMineUserInfoProtocol.h in Sources */,
|
||||
E88B5CBA26FB329C00DA9178 /* XPMineTeenagerPwdProtocol.h in Sources */,
|
||||
@@ -1537,6 +1556,7 @@
|
||||
E824544826F5945300BE8163 /* XPMinePayPwdProtocol.h in Sources */,
|
||||
E824543A26F5880E00BE8163 /* XPLoginVerifBindPhoneProtocol.h in Sources */,
|
||||
E824543826F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.m in Sources */,
|
||||
E8B846BF26FD827900A777FE /* XPMineUserInfoAlbumViewController.m in Sources */,
|
||||
E824545C26F5EEBA00BE8163 /* XPMineVerifIdentityPresenter.m in Sources */,
|
||||
E8AC723726F49982007D6E91 /* XPMineNotificaProtocol.h in Sources */,
|
||||
E8AC723226F49710007D6E91 /* XPMineNotificationTableViewCell.m in Sources */,
|
||||
@@ -1598,6 +1618,7 @@
|
||||
E824544626F5934700BE8163 /* XPMinePayPwdPresenter.m in Sources */,
|
||||
186A536A26FC6F2E00D67B2C /* XCShareItem.m in Sources */,
|
||||
189DD54B26DE338800AB55B1 /* BaseViewController.m in Sources */,
|
||||
E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */,
|
||||
E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */,
|
||||
E8E70D8626F2F55C00F03460 /* XPMineAccountView.m in Sources */,
|
||||
E81C279026EB314D0031E639 /* LoginForgetEditView.m in Sources */,
|
||||
@@ -1648,6 +1669,7 @@
|
||||
E8B825BF26E9E57D009E8E9F /* LoginTicketInfo.m in Sources */,
|
||||
187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */,
|
||||
186A536B26FC6F2E00D67B2C /* XCShareItemCell.m in Sources */,
|
||||
E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */,
|
||||
E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */,
|
||||
186A534626FC6ED900D67B2C /* TTPopup.m in Sources */,
|
||||
E81C278C26EAFAF60031E639 /* Base64.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Mine/mine_user_info_album_add.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Mine/mine_user_info_album_add.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "mine_user_info_album_add@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "mine_user_info_album_add@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Mine/mine_user_info_album_add.imageset/mine_user_info_album_add@2x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/mine_user_info_album_add.imageset/mine_user_info_album_add@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 712 B |
BIN
xplan-ios/Assets.xcassets/Mine/mine_user_info_album_add.imageset/mine_user_info_album_add@3x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/mine_user_info_album_add.imageset/mine_user_info_album_add@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
22
xplan-ios/Assets.xcassets/Mine/mine_user_info_edit_photo_delete.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Mine/mine_user_info_edit_photo_delete.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "mine_user_info_edit_photo_delete@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "mine_user_info_edit_photo_delete@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 472 B |
Binary file not shown.
After Width: | Height: | Size: 914 B |
@@ -13,7 +13,7 @@
|
||||
NSString * const kImageTypeRoomFace = @""; //房间表情
|
||||
NSString * const kImageTypeRoomGift = @""; //房间礼物
|
||||
NSString * const kImageTypeUserIcon = @"imageMogr2/auto-orient/thumbnail/150x150"; //用户头像150x150
|
||||
NSString * const kImageTypeUserLibaryDetail = @""; //用户相册大图nil
|
||||
NSString * const kImageTypeUserLibaryDetail = @"imageMogr2/auto-orient/thumbnail/300x300"; //用户相册大图nil
|
||||
NSString * const kImageTypeCornerAvatar = @"imageMogr2/auto-orient/thumbnail/300x300/format/png";
|
||||
|
||||
|
||||
|
@@ -74,6 +74,25 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 上传七牛获取token
|
||||
/// @param complection 完成
|
||||
+ (void)qiniuUpLoadImageWithComplection:(HttpRequestHelperCompletion)complection;
|
||||
|
||||
/// 上传用户图像到服务器
|
||||
/// @param complection 完成
|
||||
/// @param photoStr 相册
|
||||
/// @param uid 用户的uid
|
||||
/// @param ticket ticket
|
||||
+ (void)uploadUserAlbumWithComplection:(HttpRequestHelperCompletion)complection
|
||||
photoStr:(NSString *)photoStr
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket;
|
||||
/// 删除用户图像从服务器
|
||||
/// @param complection 完成
|
||||
/// @param pid 相册
|
||||
/// @param uid 用户的uid
|
||||
/// @param ticket ticket
|
||||
+ (void)deleteImageFromServerWithComplection:(HttpRequestHelperCompletion)complection
|
||||
pid:(NSString *)pid
|
||||
uid:(NSString *)uid
|
||||
ticket:(NSString *)ticket;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -78,4 +78,23 @@
|
||||
+ (void)qiniuUpLoadImageWithComplection:(HttpRequestHelperCompletion)complection {
|
||||
[self makeRequest:@"qiniu/upload/getUploadToken" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
|
||||
/// 上传用户图像到服务器
|
||||
/// @param complection 完成
|
||||
/// @param photoStr 相册
|
||||
/// @param uid 用户的uid
|
||||
/// @param ticket ticket
|
||||
+ (void)uploadUserAlbumWithComplection:(HttpRequestHelperCompletion)complection photoStr:(NSString *)photoStr uid:(NSString *)uid ticket:(NSString *)ticket {
|
||||
[self makeRequest:@"photo/v2/upload" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__,photoStr, uid, ticket, nil];
|
||||
}
|
||||
|
||||
/// 删除用户图像从服务器
|
||||
/// @param complection 完成
|
||||
/// @param pid 相册
|
||||
/// @param uid 用户的uid
|
||||
/// @param ticket ticket
|
||||
+ (void)deleteImageFromServerWithComplection:(HttpRequestHelperCompletion)complection pid:(NSString *)pid uid:(NSString *)uid ticket:(NSString *)ticket {
|
||||
[self makeRequest:@"photo/delPhoto" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__,pid, uid, ticket, nil];
|
||||
}
|
||||
@end
|
||||
|
29
xplan-ios/Main/Mine/Presenter/XPMineUserInfolbumPresenter.h
Normal file
29
xplan-ios/Main/Mine/Presenter/XPMineUserInfolbumPresenter.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// XPMineUserInfolbumPresenter.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/24.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineUserInfolbumPresenter : BaseMvpPresenter
|
||||
///获取用户信息
|
||||
- (void)getUserInfo;
|
||||
/// 将图片的地址上传到自己的服务器
|
||||
/// @param url 图片的地址
|
||||
|
||||
- (void)uploadUserAlbumWithUrlStr:(NSString *)url;
|
||||
|
||||
/// 相册
|
||||
/// @param albumImage 相册的image
|
||||
- (void)uploadAlbumImage:(UIImage *)albumImage;
|
||||
|
||||
/// 删除用户图片
|
||||
/// @param pid 相册的id
|
||||
- (void)deleteImageUrlFromServerWithPid:(NSString *)pid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
66
xplan-ios/Main/Mine/Presenter/XPMineUserInfolbumPresenter.m
Normal file
66
xplan-ios/Main/Mine/Presenter/XPMineUserInfolbumPresenter.m
Normal file
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// XPMineUserInfolbumPresenter.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/24.
|
||||
//
|
||||
|
||||
#import "XPMineUserInfolbumPresenter.h"
|
||||
///Api
|
||||
#import "Api+Mine.h"
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
///Tool
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "UploadImage.h"
|
||||
///P
|
||||
#import "XPMineUserInfoAlbumProtocol.h"
|
||||
|
||||
@implementation XPMineUserInfolbumPresenter
|
||||
|
||||
///获取用户信息
|
||||
- (void)getUserInfo {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api getUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data];
|
||||
[[self getView] onGetUserInfoSuccess:infoModel];
|
||||
}] uid:uid];
|
||||
}
|
||||
|
||||
/// 将图片的地址上传到自己的服务器
|
||||
/// @param url 图片的地址
|
||||
- (void)uploadUserAlbumWithUrlStr:(NSString *)url {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api uploadUserAlbumWithComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] uploadUserAlbumSuccess];
|
||||
} showLoading:YES] photoStr:url uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
/// 相册
|
||||
/// @param albumImage 相册的image
|
||||
- (void)uploadAlbumImage:(UIImage *)albumImage {
|
||||
[Api qiniuUpLoadImageWithComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSString *key = data.data[@"key"];
|
||||
NSString *token = data.data[@"token"];
|
||||
[UploadImage uploadImage:albumImage named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull resp) {
|
||||
NSString *url = resp[@"path"];
|
||||
[[self getView] uploadAlbumImageToThirdSuccess:url];
|
||||
} failure:^(NSNumber * _Nonnull resCode, NSString * _Nonnull message) {
|
||||
[[self getView] showErrorToast:@"上传失败"];
|
||||
}];
|
||||
} showLoading:YES]];
|
||||
}
|
||||
|
||||
|
||||
/// 删除用户图片
|
||||
/// @param pid 相册的id
|
||||
- (void)deleteImageUrlFromServerWithPid:(NSString *)pid {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api deleteImageFromServerWithComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] deleteUserAlbumSuccess];
|
||||
} showLoading:YES] pid:pid uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
@end
|
23
xplan-ios/Main/Mine/Protocol/XPMineUserInfoAlbumProtocol.h
Normal file
23
xplan-ios/Main/Mine/Protocol/XPMineUserInfoAlbumProtocol.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// XPMineUserInfoAlbumProtocol.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/24.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class UserInfoModel;
|
||||
@protocol XPMineUserInfoAlbumProtocol <NSObject>
|
||||
///获取用户信息成功
|
||||
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo;
|
||||
///上传用户的头像成功
|
||||
- (void)uploadUserAlbumSuccess;
|
||||
///上传图片 到第三方成功
|
||||
- (void)uploadAlbumImageToThirdSuccess:(NSString *)url;
|
||||
///删除用户的头像成功
|
||||
- (void)deleteUserAlbumSuccess;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// XPMineUserInfoAlbumCollectionViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/24.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class UserPhoto, XPMineUserInfoAlbumCollectionViewCell;
|
||||
|
||||
@protocol XPMineUserInfoAlbumCollectionViewCellDelegate <NSObject>
|
||||
///点击了删除某个
|
||||
- (void)xPMineUserInfoAlbumCollectionViewCell:(XPMineUserInfoAlbumCollectionViewCell * )cell didDeleteItem:(UserPhoto *)photo;
|
||||
@end
|
||||
|
||||
@interface XPMineUserInfoAlbumCollectionViewCell : UICollectionViewCell
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPMineUserInfoAlbumCollectionViewCellDelegate> delegate;
|
||||
///相册
|
||||
@property (nonatomic,strong) UserPhoto *photo;
|
||||
///添加
|
||||
@property (nonatomic,copy) NSString *addImageName;
|
||||
///是否编辑
|
||||
@property (nonatomic,assign) BOOL isEdit;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// XPMineUserInfoAlbumCollectionViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/24.
|
||||
//
|
||||
|
||||
#import "XPMineUserInfoAlbumCollectionViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "UIButton+EnlargeTouchArea.h"
|
||||
#import "UIImageView+LoadImage.h"
|
||||
///Model
|
||||
#import "UserPhoto.h"
|
||||
|
||||
@interface XPMineUserInfoAlbumCollectionViewCell ()
|
||||
///
|
||||
@property (nonatomic,strong) UIImageView *logoImageView;
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *deleteButton;
|
||||
@end
|
||||
|
||||
@implementation XPMineUserInfoAlbumCollectionViewCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Response
|
||||
- (void)deleteButtonAction:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoAlbumCollectionViewCell:didDeleteItem:)]) {
|
||||
[self.delegate xPMineUserInfoAlbumCollectionViewCell:self didDeleteItem:self.photo];
|
||||
}
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self.contentView addSubview:self.logoImageView];
|
||||
[self.contentView addSubview:self.deleteButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
[self.deleteButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(25, 25));
|
||||
make.top.right.mas_equalTo(self.contentView).inset(0);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPhoto:(UserPhoto *)photo {
|
||||
_photo = photo;
|
||||
if (_photo) {
|
||||
[self.logoImageView load_setImageImageWithUrl:_photo.photoUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserLibaryDetail];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setIsEdit:(BOOL)isEdit {
|
||||
_isEdit = isEdit;
|
||||
self.deleteButton.hidden = !_isEdit;
|
||||
}
|
||||
|
||||
- (void)setAddImageName:(NSString *)addImageName {
|
||||
_addImageName = addImageName;
|
||||
if (_addImageName.length > 0) {
|
||||
self.logoImageView.image = [UIImage imageNamed:_addImageName];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)logoImageView {
|
||||
if (!_logoImageView) {
|
||||
_logoImageView = [[UIImageView alloc] init];
|
||||
_logoImageView.userInteractionEnabled = YES;
|
||||
_logoImageView.layer.cornerRadius = 5;
|
||||
_logoImageView.layer.masksToBounds = YES;
|
||||
_logoImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _logoImageView;
|
||||
}
|
||||
|
||||
- (UIButton *)deleteButton {
|
||||
if (!_deleteButton) {
|
||||
_deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_deleteButton setImage:[UIImage imageNamed:@"mine_user_info_edit_photo_delete"] forState:UIControlStateNormal];
|
||||
[_deleteButton setImage:[UIImage imageNamed:@"mine_user_info_edit_photo_delete"] forState:UIControlStateSelected];
|
||||
[_deleteButton addTarget:self action:@selector(deleteButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _deleteButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -13,6 +13,7 @@
|
||||
#import "UIImageView+LoadImage.h"
|
||||
///Model
|
||||
#import "XPMineUserInfoEditModel.h"
|
||||
#import "UserPhoto.h"
|
||||
|
||||
@interface XPMineUserInfoEditTableViewCell ()
|
||||
///容器
|
||||
@@ -68,7 +69,7 @@
|
||||
|
||||
[self.photoViewArray addObject:self.firstPhotoImageView];
|
||||
[self.photoViewArray addObject:self.secondPhotoImageView];
|
||||
[self.photoViewArray addObject:self.secondPhotoImageView];
|
||||
[self.photoViewArray addObject:self.thirdPhotoImageView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -105,14 +106,14 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadPhotoViewWithPhotoArray:(NSArray *)array {
|
||||
- (void)loadPhotoViewWithPhotoArray:(NSArray<UserPhoto *> *)array {
|
||||
if (array.count > 3) {
|
||||
array = [array subarrayWithRange:NSMakeRange(0, 3)];
|
||||
}
|
||||
for (int i = 0; i < array.count; i++) {
|
||||
UIImageView * imageView = [self.photoViewArray objectAtIndex:i];
|
||||
NSString * imageUrl = [array objectAtIndex:i];
|
||||
[imageView load_setImageImageWithUrl:imageUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder]];
|
||||
NSString * imageUrl = [array objectAtIndex:i].photoUrl;
|
||||
[imageView load_setImageImageWithUrl:imageUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserIcon];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +125,7 @@
|
||||
self.phototStackView.hidden = YES;
|
||||
self.avatarImageView.hidden = NO;
|
||||
if (model.avatarUrl.length > 0) {
|
||||
[self.avatarImageView load_setImageImageWithUrl:model.avatarUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder]];
|
||||
[self.avatarImageView load_setImageImageWithUrl:model.avatarUrl placeholderImage:[UIImageConstant defaultAvatarPlaceholder] type:ImageTypeUserIcon];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPMineUserInfoAlbumViewController.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/24.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineUserInfoAlbumViewController : MvpViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,273 @@
|
||||
//
|
||||
// XPMineUserInfoAlbumViewController.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/24.
|
||||
//
|
||||
|
||||
#import "XPMineUserInfoAlbumViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import "SDPhotoBrowser.h"
|
||||
#import "UIImageConstant.h"
|
||||
#import "TTPopup.h"
|
||||
#import "YYUtility.h"
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
///View
|
||||
#import "XPMineUserInfoAlbumCollectionViewCell.h"
|
||||
///P
|
||||
#import "XPMineUserInfolbumPresenter.h"
|
||||
#import "XPMineUserInfoAlbumProtocol.h"
|
||||
|
||||
@interface XPMineUserInfoAlbumViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, XPMineUserInfoAlbumProtocol, UIImagePickerControllerDelegate, UINavigationControllerDelegate, SDPhotoBrowserDelegate, XPMineUserInfoAlbumCollectionViewCellDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSArray<UserPhoto *> *datasource;
|
||||
///完成
|
||||
@property (nonatomic,strong) UIButton *complectButton;
|
||||
///是否编辑
|
||||
@property (nonatomic,assign) BOOL isEdit;
|
||||
@end
|
||||
|
||||
@implementation XPMineUserInfoAlbumViewController
|
||||
|
||||
- (XPMineUserInfolbumPresenter*)createPresenter {
|
||||
return [[XPMineUserInfolbumPresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self loadUserInfo];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self initEvents];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.title = @"我的相册";
|
||||
///添加完成按钮
|
||||
[self addNavigationItemWithItems:@[self.complectButton] isLeft:NO];
|
||||
[self.view addSubview:self.collectionView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)initEvents {
|
||||
@weakify(self);
|
||||
[[self.complectButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
|
||||
@strongify(self);
|
||||
x.selected = !x.selected;
|
||||
self.isEdit = x.selected;
|
||||
[self.collectionView reloadData];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)loadUserInfo {
|
||||
[self.presenter getUserInfo];
|
||||
}
|
||||
|
||||
/// 取消编辑
|
||||
- (void)cancelEditing {
|
||||
self.complectButton.selected = NO;
|
||||
self.isEdit = NO;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - 选择图片
|
||||
- (void)showPhotoView {
|
||||
@weakify(self);
|
||||
TTActionSheetConfig *cameraConfig = [TTActionSheetConfig normalTitle:@"拍照上传" clickAction:^{
|
||||
[YYUtility checkCameraAvailable:^{
|
||||
@strongify(self);
|
||||
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
|
||||
imagePicker.delegate = self;
|
||||
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
|
||||
imagePicker.allowsEditing = YES;
|
||||
[self presentViewController:imagePicker animated:YES completion:NULL];
|
||||
} denied:^{
|
||||
@strongify(self);
|
||||
[self showNotPhoto:@"相机不可用" content:@"相机权限受限,点击确定去系统设置"];
|
||||
} restriction:^{
|
||||
@strongify(self);
|
||||
[self showNotPhoto:@"相机不可用" content:@"相册权限受限,点击确定去系统设置"];
|
||||
}];
|
||||
}];
|
||||
|
||||
TTActionSheetConfig *photoLibrayConfig = [TTActionSheetConfig normalTitle:@"本地相册" clickAction:^{
|
||||
[YYUtility checkAssetsLibrayAvailable:^{
|
||||
@strongify(self);
|
||||
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
|
||||
imagePicker.modalPresentationCapturesStatusBarAppearance = YES;
|
||||
imagePicker.delegate = self;
|
||||
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
|
||||
imagePicker.allowsEditing = YES;
|
||||
[self presentViewController:imagePicker animated:YES completion:NULL];
|
||||
} denied:^{
|
||||
@strongify(self);
|
||||
[self showNotPhoto:@"相册不可用" content:@"相册权限受限,点击确定去系统设置"];
|
||||
} restriction:^{
|
||||
@strongify(self);
|
||||
[self showNotPhoto:@"相册不可用" content:@"相册权限受限,点击确定去系统设置"];
|
||||
}];
|
||||
}];
|
||||
|
||||
[TTPopup actionSheetWithItems:@[cameraConfig, photoLibrayConfig]];
|
||||
}
|
||||
|
||||
- (void)showNotPhoto:(NSString *)title content:(NSString *)content{
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.title = title;
|
||||
config.message = content;
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
|
||||
if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
||||
[[UIApplication sharedApplication] openURL:url];
|
||||
}
|
||||
} cancelHandler:^{
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.datasource.count + 1;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPMineUserInfoAlbumCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoAlbumCollectionViewCell class]) forIndexPath:indexPath];
|
||||
cell.delegate = self;
|
||||
if (indexPath.row == 0) {
|
||||
cell.addImageName = @"mine_user_info_album_add";
|
||||
cell.isEdit = NO;
|
||||
} else {
|
||||
if (self.datasource.count > 0) {
|
||||
cell.photo = [self.datasource objectAtIndex:indexPath.row - 1];
|
||||
cell.isEdit = self.isEdit;
|
||||
}
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
|
||||
if (indexPath.row == 0) {
|
||||
if (self.datasource.count < 8) {
|
||||
[self showPhotoView];
|
||||
[self cancelEditing];
|
||||
}else{
|
||||
[self showErrorToast:@"最多只能上传8张照片"];
|
||||
}
|
||||
}else {
|
||||
if (!self.isEditing) {
|
||||
SDPhotoBrowser *browser = [[SDPhotoBrowser alloc]init];
|
||||
browser.sourceImagesContainerView = self.collectionView;
|
||||
browser.delegate = self;
|
||||
browser.imageCount = self.datasource.count;
|
||||
browser.currentImageIndex = indexPath.item - 1;
|
||||
browser.isHaveUserAdd = YES;
|
||||
[browser show];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMineUserInfoAlbumCollectionViewCellDelegate
|
||||
- (void)xPMineUserInfoAlbumCollectionViewCell:(XPMineUserInfoAlbumCollectionViewCell *)cell didDeleteItem:(UserPhoto *)photo {
|
||||
TTAlertConfig * config = [[TTAlertConfig alloc] init];
|
||||
config.title = @"删除是不可逆操作";
|
||||
config.message = @"是否需要删除?";
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
[self.presenter deleteImageUrlFromServerWithPid:photo.pid];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - SDPhotoBrowserDelegate
|
||||
- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index {
|
||||
return [UIImage imageNamed:[UIImageConstant defaultAvatarPlaceholder]];
|
||||
}
|
||||
|
||||
- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index {
|
||||
return [NSURL URLWithString:self.datasource[index].photoUrl];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIImagePickerControllerDelegate
|
||||
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
|
||||
|
||||
[picker dismissViewControllerAnimated:YES completion:^{
|
||||
UIImage *selectedPhoto = [info objectForKey:UIImagePickerControllerOriginalImage];
|
||||
if (selectedPhoto) {
|
||||
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
|
||||
UIImageWriteToSavedPhotosAlbum(selectedPhoto, nil, nil, nil);
|
||||
}
|
||||
[self.presenter uploadAlbumImage:selectedPhoto];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
|
||||
[picker dismissViewControllerAnimated:YES completion:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - XPMineUserInfoAlbumProtocol
|
||||
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
self.datasource = userInfo.privatePhoto;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
///上传第三方服务器
|
||||
- (void)uploadAlbumImageToThirdSuccess:(NSString *)url {
|
||||
[self.presenter uploadUserAlbumWithUrlStr:url];
|
||||
}
|
||||
///上传自己服务器
|
||||
- (void)uploadUserAlbumSuccess {
|
||||
[self.presenter getUserInfo];
|
||||
[self showSuccessToast:@"更新成功"];
|
||||
}
|
||||
|
||||
- (void)deleteUserAlbumSuccess {
|
||||
[self.presenter getUserInfo];
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
|
||||
layout.itemSize = CGSizeMake((self.view.frame.size.width - 50) / 3, (self.view.frame.size.width - 50) / 3);
|
||||
layout.minimumLineSpacing = 15;
|
||||
layout.minimumInteritemSpacing = 15;
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPMineUserInfoAlbumCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoAlbumCollectionViewCell class])];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
- (UIButton *)complectButton {
|
||||
if (!_complectButton) {
|
||||
_complectButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_complectButton setTitle:@"编辑" forState:UIControlStateNormal];
|
||||
[_complectButton setTitle:@"完成" forState:UIControlStateSelected];
|
||||
[_complectButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
|
||||
[_complectButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateSelected];
|
||||
_complectButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
}
|
||||
return _complectButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -26,6 +26,7 @@
|
||||
///VC
|
||||
#import "XPMineUserInfoNickViewController.h"
|
||||
#import "XPMineUserInfoDesViewController.h"
|
||||
#import "XPMineUserInfoAlbumViewController.h"
|
||||
|
||||
@interface XPMineUserInfoEditViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineUserInfoEditProtocol, XPMineUserInfoDesViewControllerDelegate, XPMineUserInfoNickViewControllerDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, XPMineUserInfoDateViewDelegate>
|
||||
///列表
|
||||
@@ -182,7 +183,8 @@
|
||||
break;
|
||||
case XPMineUserInfoEditType_Photo:
|
||||
{
|
||||
#warning to do 选择相册
|
||||
XPMineUserInfoAlbumViewController * albumVC = [[XPMineUserInfoAlbumViewController alloc] init];
|
||||
[self.navigationController pushViewController:albumVC animated:YES];
|
||||
}
|
||||
break;
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
///VC
|
||||
#import "XPMineUserInfoEditViewController.h"
|
||||
|
||||
@interface XPMineUserInfoViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineCustomNavViewDelegate, XPMineUserInfoProtocol>
|
||||
@interface XPMineUserInfoViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, UIGestureRecognizerDelegate>
|
||||
///列别
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///头部视图
|
||||
@@ -48,13 +48,22 @@
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
if (self.uid > 0) {
|
||||
NSString * uidStr = [NSString stringWithFormat:@"%lld", self.uid];
|
||||
[self.presenter getUserInfoWithUid:uidStr];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self.view addSubview:self.headView];
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.view addSubview:self.navView];
|
||||
#warning to do 头像无法点击的问题
|
||||
self.tableView.tableHeaderView = self.tableViewHeadView;
|
||||
}
|
||||
|
||||
|
@@ -136,6 +136,7 @@
|
||||
_cycleScrollView.delegate = self;
|
||||
_cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
|
||||
_cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleNone;;
|
||||
_cycleScrollView.placeholderImage = [UIImage imageNamed:[UIImageConstant defaultAvatarPlaceholder]];
|
||||
_cycleScrollView.autoScroll = NO;
|
||||
}
|
||||
return _cycleScrollView;
|
||||
@@ -157,7 +158,7 @@
|
||||
_pageLabel.textColor = [ThemeColor textThirdColor];
|
||||
_pageLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_pageLabel.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1];
|
||||
_pageLabel.alpha = 0.2;
|
||||
_pageLabel.alpha = 0.1;
|
||||
_pageLabel.layer.masksToBounds = YES;
|
||||
_pageLabel.layer.cornerRadius = 8;
|
||||
}
|
||||
|
Reference in New Issue
Block a user