chore: Pod更新、AppIcon替换、文件清理及配置调整
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
2bcac71a19
commit
f597c63ae0
@@ -1,65 +0,0 @@
|
||||
//
|
||||
// MapMessageCustomCell.m
|
||||
// EscortProject
|
||||
//
|
||||
// Created by 仁康信息 on 2023/7/7.
|
||||
//
|
||||
|
||||
#import "MapMessageCustomCell.h"
|
||||
|
||||
@implementation MapMessageCustomCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self) {
|
||||
self.container.layer.cornerRadius = 10;
|
||||
self.container.backgroundColor = UIColor.whiteColor;
|
||||
self.myTextLabel = [[UILabel alloc] init];
|
||||
self.myTextLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.myTextLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.myTextLabel.backgroundColor = UIColor.whiteColor;
|
||||
[self.container addSubview:self.myTextLabel];
|
||||
self.mapImage = [[UIImageView alloc] init];
|
||||
[self.container addSubview:self.mapImage];
|
||||
|
||||
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
// 根据 cellData 绘制 cell
|
||||
- (void)fillWithData:(MapMessageCustomCellData *)data;
|
||||
{
|
||||
[super fillWithData:data];
|
||||
self.myTextLabel.text = @" 位置";
|
||||
[self.mapImage sd_setImageWithURL:[NSURL URLWithString:data.MapPictureImg] placeholderImage:nil];
|
||||
|
||||
}
|
||||
// 设置控件坐标
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
self.myTextLabel.mm_right(0).mm_top(0).mm_left(0).mm_height(30).mm_width(245);
|
||||
self.mapImage.mm_top(self.myTextLabel.mm_y + 30 ).mm_width(245).mm_height(140);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
+20
-13
@@ -25,39 +25,46 @@
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self) {
|
||||
self.container.layer.cornerRadius = 10;
|
||||
self.container.layer.cornerRadius = 8;
|
||||
self.container.layer.masksToBounds = YES;
|
||||
self.container.backgroundColor = UIColor.whiteColor;
|
||||
|
||||
self.myTextLabel = [[UILabel alloc] init];
|
||||
self.myTextLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.myTextLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.myTextLabel.backgroundColor = UIColor.whiteColor;
|
||||
self.myTextLabel.numberOfLines = 0;
|
||||
[self.container addSubview:self.myTextLabel];
|
||||
self.mapImage = [[UIImageView alloc] init];
|
||||
[self.container addSubview:self.mapImage];
|
||||
|
||||
|
||||
|
||||
self.mapImage = [[UIImageView alloc] init];
|
||||
[self.container addSubview:self.mapImage];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
// 根据 cellData 绘制 cell
|
||||
- (void)fillWithData:(MapMessageCustomCellData *)data;
|
||||
{
|
||||
[super fillWithData:data];
|
||||
self.myTextLabel.text = @" 位置";
|
||||
self.bubbleView.image = nil;
|
||||
self.myTextLabel.text = data.text.length > 0 ? data.text : @"我的位置";
|
||||
[self.mapImage sd_setImageWithURL:[NSURL URLWithString:data.MapPictureImg] placeholderImage:nil];
|
||||
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
// 设置控件坐标
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
|
||||
self.myTextLabel.mm_right(0).mm_top(0).mm_left(0).mm_height(30).mm_width(245);
|
||||
self.mapImage.mm_top(self.myTextLabel.mm_y + 30 ).mm_width(245).mm_height(140);
|
||||
CGFloat containerW = self.container.bounds.size.width;
|
||||
CGFloat containerH = self.container.bounds.size.height;
|
||||
CGFloat padding = 10;
|
||||
CGFloat textWidth = containerW - padding * 2;
|
||||
CGSize textSize = [self.myTextLabel sizeThatFits:CGSizeMake(textWidth, CGFLOAT_MAX)];
|
||||
CGFloat textHeight = textSize.height + 12;
|
||||
|
||||
|
||||
self.myTextLabel.mm_left(padding).mm_top(6).mm_width(textWidth).mm_height(textHeight);
|
||||
|
||||
CGFloat mapTop = self.myTextLabel.mm_y + textHeight;
|
||||
self.mapImage.mm_left(0).mm_top(mapTop).mm_width(containerW).mm_height(containerH - mapTop);
|
||||
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// MapMessageCustomCellData.h
|
||||
// EscortProject
|
||||
//
|
||||
// Created by 仁康信息 on 2023/7/7.
|
||||
//
|
||||
|
||||
#import "TUIMessageCellData.h"
|
||||
#import <TIMCommon/TUIBubbleMessageCellData.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MapMessageCustomCellData : TUIBubbleMessageCellData
|
||||
|
||||
@property (nonatomic, copy) NSString *text;
|
||||
@property (nonatomic, copy) NSString * MapPictureImg;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,80 +0,0 @@
|
||||
//
|
||||
// MapMessageCustomCellData.m
|
||||
// EscortProject
|
||||
//
|
||||
// Created by 仁康信息 on 2023/7/7.
|
||||
//
|
||||
|
||||
#import "MapMessageCustomCellData.h"
|
||||
#import "MapMessageCustomCell.h"
|
||||
#import<CommonCrypto/CommonDigest.h>
|
||||
|
||||
@implementation MapMessageCustomCellData
|
||||
|
||||
+ (TUIMessageCellData *)getCellData:(V2TIMMessage *)message{
|
||||
// NSDictionary *param = [NSJSONSerialization JSONObjectWithData:message.locationElem.desc options:NSJSONReadingAllowFragments error:nil];
|
||||
MapMessageCustomCellData *cellData = [[MapMessageCustomCellData alloc] initWithDirection:message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming];
|
||||
cellData.innerMessage = message;
|
||||
cellData.msgID = message.msgID;
|
||||
cellData.text = message.locationElem.desc;
|
||||
cellData.MapPictureImg = [self mapLocationImage:message.locationElem.longitude Withlation:message.locationElem.latitude];
|
||||
cellData.reuseId = @"MapMessageCustomCell";
|
||||
cellData.showAvatar = true;
|
||||
// cellData.avatarUrl = [NSURL URLWithString:message.faceURL];
|
||||
return cellData;
|
||||
}
|
||||
|
||||
|
||||
+ (NSString *)mapLocationImage:(CGFloat)longLation Withlation:(CGFloat)lation {
|
||||
// 0: self.longLation,self.lation
|
||||
NSString * staciUrl = @"https://restapi.amap.com/v3/staticmap?key=9e4aac9a04b8296e9039adce3b472f28";
|
||||
NSString * mapKey = @"9e4aac9a04b8296e9039adce3b472f28";
|
||||
NSString * loctaionUrl = @"https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png";
|
||||
|
||||
NSString * needMdString = [NSString stringWithFormat:@"key=%@&location=%f,%f&markers=-1,%@,0:%f,%f&size=700*500&zoom=154985aa1abb49ce2daa20d032a374eb58",mapKey,longLation,lation,loctaionUrl,longLation,lation];
|
||||
|
||||
|
||||
NSString * mapUrl = [NSString stringWithFormat:@"%@&location=%f,%f&markers=-1,%@,0:%f,%f&size=700*500&zoom=15&sig=%@",staciUrl,longLation,lation,loctaionUrl,longLation,lation,[self md5:needMdString]];
|
||||
|
||||
return mapUrl;
|
||||
|
||||
|
||||
|
||||
}
|
||||
//md加密
|
||||
+ (NSString *)md5:(NSString *)str
|
||||
{
|
||||
const char *cStr = [str UTF8String];
|
||||
unsigned char result[16];
|
||||
CC_MD5(cStr, strlen(cStr), result); // This is the md5 call
|
||||
return [NSString stringWithFormat:
|
||||
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
result[0], result[1], result[2], result[3],
|
||||
result[4], result[5], result[6], result[7],
|
||||
result[8], result[9], result[10], result[11],
|
||||
result[12], result[13], result[14], result[15]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (CGSize)contentSize
|
||||
{
|
||||
// CGRect rect = [self.text boundingRectWithSize:CGSizeMake(300, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:15] } context:nil];
|
||||
// CGSize size = CGSizeMake(ceilf(rect.size.width)+1, ceilf(rect.size.height));
|
||||
// // 加上气泡边距
|
||||
// size.height += 60;
|
||||
// size.width += 20;
|
||||
// return size;
|
||||
|
||||
|
||||
CGFloat textMaxWidth = 245.f;
|
||||
|
||||
CGSize size = CGSizeMake(textMaxWidth, 170);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
+12
-13
@@ -27,11 +27,11 @@
|
||||
|
||||
+ (NSString *)mapLocationImage:(CGFloat)longLation Withlation:(CGFloat)lation {
|
||||
// 0: self.longLation,self.lation
|
||||
NSString * staciUrl = @"https://restapi.amap.com/v3/staticmap?key=9e4aac9a04b8296e9039adce3b472f28";
|
||||
NSString * mapKey = @"9e4aac9a04b8296e9039adce3b472f28";
|
||||
NSString * staciUrl = @"https://restapi.amap.com/v3/staticmap?key=e9926badd26aaa766d13439c88a83f2d";
|
||||
NSString * mapKey = @"e9926badd26aaa766d13439c88a83f2d";
|
||||
NSString * loctaionUrl = @"https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png";
|
||||
|
||||
NSString * needMdString = [NSString stringWithFormat:@"key=%@&location=%f,%f&markers=-1,%@,0:%f,%f&size=700*500&zoom=154985aa1abb49ce2daa20d032a374eb58",mapKey,longLation,lation,loctaionUrl,longLation,lation];
|
||||
NSString * needMdString = [NSString stringWithFormat:@"key=%@&location=%f,%f&markers=-1,%@,0:%f,%f&size=700*500&zoom=15124d58f7223ac9738312a8d187a21f2b",mapKey,longLation,lation,loctaionUrl,longLation,lation];
|
||||
|
||||
|
||||
NSString * mapUrl = [NSString stringWithFormat:@"%@&location=%f,%f&markers=-1,%@,0:%f,%f&size=700*500&zoom=15&sig=%@",staciUrl,longLation,lation,loctaionUrl,longLation,lation,[self md5:needMdString]];
|
||||
@@ -60,18 +60,17 @@
|
||||
|
||||
- (CGSize)contentSize
|
||||
{
|
||||
// CGRect rect = [self.text boundingRectWithSize:CGSizeMake(300, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:15] } context:nil];
|
||||
// CGSize size = CGSizeMake(ceilf(rect.size.width)+1, ceilf(rect.size.height));
|
||||
// // 加上气泡边距
|
||||
// size.height += 60;
|
||||
// size.width += 20;
|
||||
// return size;
|
||||
|
||||
|
||||
CGFloat textMaxWidth = 245.f;
|
||||
CGFloat textLabelWidth = textMaxWidth - 20; // 左右各 10 边距
|
||||
|
||||
CGSize size = CGSizeMake(textMaxWidth, 170);
|
||||
return size;
|
||||
CGRect rect = [self.text boundingRectWithSize:CGSizeMake(textLabelWidth, MAXFLOAT)
|
||||
options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
|
||||
attributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:14] }
|
||||
context:nil];
|
||||
CGFloat textHeight = ceil(rect.size.height) + 12; // 上下各 6pt
|
||||
CGFloat totalHeight = textHeight + 140; // 文字 + 地图图片
|
||||
|
||||
return CGSizeMake(textMaxWidth, totalHeight);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user