Commit 2b1d4f08 by xuning

集成配置、网络请求、缓存等工具

parent ad2a407a
......@@ -7,7 +7,7 @@
<key>fastservice.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>19</integer>
<integer>20</integer>
</dict>
</dict>
</dict>
......
......@@ -57,17 +57,17 @@
//}
- (void)onGetNetworkState:(int)iError{
if (0 == iError) {
Log(@"联网成功");
DebugLog(@"联网成功");
}else{
Log(@"onGetNetworkState %d",iError);
DebugLog(@"onGetNetworkState %d",iError);
}
}
- (void)onGetPermissionState:(int)iError{
if (0 == iError) {
Log(@"授权成功");
DebugLog(@"授权成功");
}else {
Log(@"onGetPermissionState %d",iError);
DebugLog(@"onGetPermissionState %d",iError);
}
}
@end
......@@ -12,5 +12,8 @@
}
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) NSString * token;
@end
......@@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "fanhui@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "fanhui@3x.png",
"filename" : "iconPark-left 1 Copy 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "arcoDesign-right 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XVBaseViewController : UIViewController<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
- (void)setNavigationBarsetBackgroundColor:(UIColor *)color;
......
......@@ -27,6 +27,8 @@
}
- (void)setNavigationBarsetBackgroundColor:(UIColor *)color {
if(@available(iOS 15.0, *)) {
......
......@@ -35,7 +35,7 @@
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
if (self.viewControllers.count > 0) {
viewController.hidesBottomBarWhenPushed = YES;
viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(back) image:IMG(@"fanhui")];
viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(back) image:IMG(@"iconPark-left 1 Copy 1")];
}
[super pushViewController:viewController animated:animated];
......
//
// LocalCache.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface LocalCache : NSObject
@property (nonatomic,assign) int udTip_flag;//该版本不再提示
@property (nonatomic,assign) int sound_flag;//提示音设置
@property (nonatomic,copy ) NSString *sserver_address;
@property (nonatomic,assign) int screenL_flag;//屏幕常亮标识
@property (nonatomic,assign) int courier_set;//骑士高级设置
@property (nonatomic,assign) int vibration_flag;//新订单&派单震动标识
@property (nonatomic,copy) NSString *showTime; //1个小时后展示的时间
@property (nonatomic, copy) NSString *clanAlredyTime; //记录的昨日战绩弹框的时间
@property (nonatomic, assign) int invitationCount; //进入邀请有钱页面的引导计数
//自定义经纬度
@property (nonatomic, assign) int is_custom; //经纬度是否自定义
@property (nonatomic,copy ) NSString * user_mob;//用户登录手机号
@property(nonatomic, assign) BOOL closeVoice;//关闭声音
@end
NS_ASSUME_NONNULL_END
//
// LocalCache.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "LocalCache.h"
@implementation LocalCache
@end
//
// UserInfo.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
//默认地址信息
@interface UserInfoAddr : NSObject
@property (nonatomic, assign) double longitude;
@property (nonatomic, assign) double latitude;
@property (nonatomic, assign) int address_id;
@property (nonatomic, copy) NSString *mobile;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *label;
@property (nonatomic, copy) NSString *area;
@property (nonatomic, copy) NSString *address;
@property (nonatomic, copy) NSString *city;
@property (nonatomic, copy) NSString *district;
@end
@interface UserInfoB : NSObject
@property (nonatomic, copy) NSString *nickname;//用户名
@property (nonatomic, assign) int gender;//性别
@property (nonatomic, copy) NSString *mobile;
@property (nonatomic, copy) NSString *portrait;//头像
@property (nonatomic,assign) int u_count;//发单数
@property (nonatomic,assign) int uc_count;//取消单数
//微信信息
@property (nonatomic,copy) NSString *wx_name;
@property (nonatomic,copy) NSString *wx_openid;
@property (nonatomic,strong) UserInfoAddr *addr_d;
@end
//骑士信息
@interface UserInfoC : NSObject
@property (nonatomic, assign) int group_id;
@property (nonatomic, assign) int c_s;//骑士状态,0-无效,2-正常(抢单),3-收工,4-封禁,6-接受派单推送
@property (nonatomic, assign) int a_s;//审核状态,0-未认证,1-已认证
@property (nonatomic, assign) int t_s;//培训状态,0-未培训,1-已培训
@property (nonatomic, assign) int g_s;//服务保障状态,0-未认证,1-已认证
@property (nonatomic, copy) NSString *qr;//二维码地址
@property (nonatomic, assign) int c_count;//骑士接单数
@property (nonatomic, copy) NSString *a_name;//展现名字(如刘师傅)
@property (nonatomic, copy) NSString *name;//真实姓名
@property (nonatomic, copy) NSString *bstr;//保证金200元
@property (nonatomic, copy) NSString *reason_r; //认证驳回原因
@property (nonatomic, assign) int l; //骑士等级标志 0=铁牌骑士,1=铜牌骑士,2=银牌骑士,3=金牌骑士,4=钻石骑士
@property (nonatomic, assign) int assignable;//0 没有骑士调配功能
@property (nonatomic, strong) NSString *workDate;// 开工日期,避免第二天还是第一天的开工状态,导致无法接单
@end
//商户信息
@interface UserInfoM : NSObject
@property (nonatomic,assign) int group_id;//商户认证时的group_id
@property (nonatomic,assign) int m_s;//商户状态,0-未审核,1-已审核
@property (nonatomic,copy) NSString *cate;//商户品类
@property (nonatomic,assign) int *mul_f;//一取多发标志位,0-未开通,1-开通
@end
@interface UserInfo : NSObject
@property (nonatomic, strong) NSString * mobile;
@property (nonatomic, assign) int user_id;
@property (nonatomic, strong) NSString * cookie;
@property (nonatomic,copy ) NSString *spw;
@property (nonatomic,strong) UserInfoB *b;//普通用户信息
@property (nonatomic,strong) UserInfoC *c;//骑士信息
@property (nonatomic,strong) UserInfoM *m;//商户信息
@property (nonatomic,strong) NSString *headPortrait;//头像
//zi
@property (nonatomic, strong) NSString *lastDate;//上一次保存的时间 :保险使用
@property (nonatomic,assign) int merchant_set;//商家高级设置
@property (nonatomic,assign) int hide_flag;//隐身登录标识
@end
NS_ASSUME_NONNULL_END
//
// UserInfo.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "UserInfo.h"
@implementation UserInfoAddr
@end
@implementation UserInfoB
@end
@implementation UserInfoC
@end
@implementation UserInfoM
@end
@implementation UserInfo
@end
//
// MBProgressHUD+Extention.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <MBProgressHUD/MBProgressHUD.h>
NS_ASSUME_NONNULL_BEGIN
@interface MBProgressHUD (Extention)
+ (MBProgressHUD *)showMessage:(NSString *)message toView:(UIView *)view;
+ (MBProgressHUD *)showMessage:(NSString *)message;
/**
需要主动关闭
*/
+ (MBProgressHUD *)showLoading:(NSString *)message toView:(UIView *)view;
@end
NS_ASSUME_NONNULL_END
//
// MBProgressHUD+Extention.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "MBProgressHUD+Extention.h"
@implementation MBProgressHUD (Extention)
+ (MBProgressHUD *)showMessage:(NSString *)message toView:(UIView *)view {
// if (!message.length) {
// return nil;
// }
if (message == nil || message.length < 1) {
return nil;
}
if (view == nil) view = [UIApplication sharedApplication].keyWindow;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
hud.bezelView.color = [UIColor colorWithWhite:0 alpha:0.4];
hud.userInteractionEnabled = NO;
hud.mode = MBProgressHUDModeText;
hud.detailsLabel.text = message;
hud.detailsLabel.font = [UIFont systemFontOfSize:16];
hud.detailsLabel.textColor = [UIColor whiteColor];
hud.removeFromSuperViewOnHide = YES;
[hud hideAnimated:YES afterDelay:2];
return hud;
}
+ (MBProgressHUD *)showMessage:(NSString *)message {
return [MBProgressHUD showMessage:message toView:nil];
}
/**
需要主动关闭
*/
+ (MBProgressHUD *)showLoading:(NSString *)message toView:(UIView *)view {
if (view == nil) view = [UIApplication sharedApplication].keyWindow;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
hud.contentColor = [UIColor whiteColor];
hud.bezelView.color = [UIColor colorWithWhite:0 alpha:0.4];
hud.userInteractionEnabled = NO;
hud.mode = MBProgressHUDModeIndeterminate;
if (message.length > 0) {
hud.label.text = message;
hud.label.font = [UIFont systemFontOfSize:14];
hud.label.textColor = [UIColor whiteColor];
}
hud.removeFromSuperViewOnHide = YES;
return hud;
}
@end
//
// NSMutableDictionary+Extention.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSMutableDictionary (Extention)
- (void)setAnyObject:(id)anObject forKey:(NSString *)aKey;
@end
NS_ASSUME_NONNULL_END
//
// NSMutableDictionary+Extention.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "NSMutableDictionary+Extention.h"
@implementation NSMutableDictionary (Extention)
- (void)setAnyObject:(id)anObject forKey:(NSString *)aKey{
if (anObject != nil) {
[self setObject:anObject forKey:aKey];
}else{
[self setObject:@"" forKey:aKey];
}
}
@end
//
// NSString+XVAdd.h
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (XVAdd)
-(CGFloat)getSpaceLabelHeightwithSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font withWidth:(CGFloat)width;
/**
获取指定宽度width,字体大小fontSize,字符串value的高度
@param text 文本
@param font 字体大小
@param width 限制字符串显示区域的宽度
@return 返回的高度
*/
- (CGFloat)heightForString:(NSString *)text font:(UIFont *)font width:(CGFloat)width;
/**
* 计算当前字符串的size
*
* @param font 使用的字体
* @param maxSize 最大的size
*
* @return 需要的最小size
*/
- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize;
@end
NS_ASSUME_NONNULL_END
//
// NSString+XVAdd.m
// fastservice
//
// Created by xuning on 2/3/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "NSString+XVAdd.h"
@implementation NSString (XVAdd)
- (CGFloat)heightForString:(NSString *)text font:(UIFont *)font width:(CGFloat)width {
NSDictionary *attributes = @{NSFontAttributeName : font};
CGSize sizeToFit = [text boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil].size;
return sizeToFit.height;
}
/**
* 计算当前字符串的size
*
* @param font 使用的字体
* @param maxSize 最大的size
*
* @return 需要的最小size
*/
- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize
{
CGSize size = CGSizeZero;
if ([self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) {
size = [self boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : font} context:nil].size;
}
//额外增加一个点,防止计算误差
return CGSizeMake(size.width + 1, size.height);
}
/**
* 计算富文本字体高度
*
* @param lineSpeace 行高
* @param font 字体
* @param width 字体所占宽度
*
* @return 富文本高度
*/
-(CGFloat)getSpaceLabelHeightwithSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font withWidth:(CGFloat)width {
NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
// paraStyle.lineBreakMode = NSLineBreakByCharWrapping;
/** 行高 */
paraStyle.lineSpacing = lineSpeace;
// NSKernAttributeName字体间距
NSDictionary *dic = @{NSFontAttributeName:font, NSParagraphStyleAttributeName:paraStyle};
CGSize size = [self boundingRectWithSize:CGSizeMake(width,MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil].size;
return size.height;
}
@end
//
// AFNetworkingClient.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
NS_ASSUME_NONNULL_BEGIN
/**
* 注册
*/
static NSString * const SS_SIGN = @"/flow/v1_0/user/signup";
/**
* 验证码
*/
static NSString * const SS_SMS_CODE12 = @"/flow/v1_2/user/smscode";
/**
* 更新上传DeviceToken
*/
static NSString * const SS_SMS_CODEW = @"/flow/v1_1//user/smscodew";
/**
* 登陆新
*/
static NSString * const SS_LOGINX = @"/flow/v1_1/user/login";
/**
* 环信账号
*/
static NSString * const SS_EASESPW = @"/flow/v1_0/user/easemobSPW";
/**
* 修改密码
*/
static NSString * const SS_RESET_PWD = @"/flow/v1_0/user/resetPasswd";
/**
* 修改手机号
*/
static NSString * const SS_REVISE_MB = @"/flow/v1_1/user/reviseMobile";
/**
* 忘记密码
*/
static NSString * const SS_FORGET_PWD = @"/flow/v1_0/user/forgetPasswd";
/**
* 获取随机图片验证码
*/
static NSString * const SS_SMS_PIC_CODE = @"/flow/v1_2/user/smsimgcode";
/**
* 用户信息
*/
static NSString * const SS_GET_USERPROFILE = @"/flow/v1_3/user/profile";
/**
* 设置用户信息
*/
static NSString * const SS_BASICINFO = @"/flow/v1_0/customer/basicInfo";
/**
* 位置更新x
*/
static NSString * const SS_GEO_UPDATE = @"/lbs/v1_0/location/geoUpdate";
/**
* 检测服务器是否连接正常
*/
static NSString * const SS_40_INDEX = @"/flow/v1_0/flow/index";
/**
* 百度
*/
static NSString * const SS_BAIDU = @"https://www.baidu.com";
/**
骑士在线时长统计
*/
static NSString *const SS_ONLINE_DURATION = @"/flow/v1_0/courier/onlineDuration";
@interface AFNetworkingClient : AFHTTPSessionManager
+ (instancetype)sharedClient;
+ (NSString *) baseURLString;
- (NSURLSessionTask * )runGET:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionTask * )runPost:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionTask * )runPut:(NSString *)URLString
parameters:(NSMutableDictionary *)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
- (NSURLSessionTask *)runDELETE:(NSString *)URLString
parameters:(id)parameters
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
+ (void)updateBaseURL:(NSString *)baseURL;
@end
NS_ASSUME_NONNULL_END
//
// AppConfig.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UserInfo.h"
#import "LocalCache.h"
NS_ASSUME_NONNULL_BEGIN
@interface AppConfig : NSObject
@property (nonatomic,strong) UserInfo *user;
//当前开发环境 灰度 线上
+ (void)setEnvironmentType:(int)type;
+ (int)getEnvironmentType;
+ (void)clearUserInfo;
+ (void)setUser:(UserInfo *)userInfo;
+ (UserInfo *)getUserInfo;
+ (NSString * )cookie;
+ (BOOL)needLogin;
//本地缓存
+ (void)saveLocalCache:(LocalCache *)lc;
+ (LocalCache *)getLocalCache;
//保存当前位置经纬度
+ (void)saveLocationCoordinate:(CLLocationCoordinate2D)coordinate;
+ (CLLocationCoordinate2D)getLocationCoordinate;
//保存和删除自定义的位置经纬度
+ (void)saveCustomLocationCoordinateWithLongitude:(NSString *)longitude Latitude:(NSString *)latitude;
+ (void)deleteCustomLocationCoordinate;
@end
NS_ASSUME_NONNULL_END
//
// AppConfig.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "AppConfig.h"
@implementation AppConfig
DEF_SINGLETION(AppConfig);
- (instancetype)init
{
self = [super init];
if (self) {
}
return self;
}
+ (void)setEnvironmentType:(int)type
{
[[NSUserDefaults standardUserDefaults] setInteger:type forKey:kAppEnvironmentType];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (int)getEnvironmentType
{
int type = (int)[[NSUserDefaults standardUserDefaults] integerForKey:kAppEnvironmentType];
return type;
}
+ (void)clearUserInfo{
[AppConfig sharedAppConfig].user = nil;
[[NSUserDefaults standardUserDefaults]removeObjectForKey:kAppUserInfo];
[[NSUserDefaults standardUserDefaults]synchronize];
}
+ (void)setUser:(UserInfo *)userInfo{
[AppConfig sharedAppConfig].user = userInfo;
[[NSUserDefaults standardUserDefaults] setObject:userInfo.mj_keyValues forKey:kAppUserInfo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (UserInfo *)getUserInfo{
if ([AppConfig sharedAppConfig].user) {
return [AppConfig sharedAppConfig].user;
}else{
NSDictionary * dic = [[NSUserDefaults standardUserDefaults] objectForKey:kAppUserInfo];
UserInfo * userInfo;
if (dic) {
userInfo = [UserInfo mj_objectWithKeyValues:dic];
}
[AppConfig sharedAppConfig].user = userInfo;
return userInfo;
}
}
+ (NSString * )cookie{
UserInfo * userInfo = [self getUserInfo];
return userInfo.cookie;
}
//courier_status 0=未提交认证信息,1=已提交认证信息,2=认证成功,正常工作,3=收工状态 4-已封禁配送权限
+ (BOOL)needCer{
UserInfo * userInfo = [self getUserInfo];
if (userInfo.c.c_s == 0) {
return YES;
}
if (userInfo.c.c_s >= 1) {
return NO;
}
return YES;
}
+ (BOOL)needLogin{
UserInfo * userInfo = [self getUserInfo];
if (userInfo == nil) {
return YES;
}
if (StringNotNullAndEmpty(userInfo.cookie)) {
return NO;
}
return YES;
}
//本地缓存标识 int
+ (void)saveLocalCache:(LocalCache *)localCache{
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSString *filePath = [path stringByAppendingPathComponent:@"localCache.plist"];
[@[localCache.mj_keyValues] writeToFile:filePath atomically:YES];
}
+ (LocalCache *)getLocalCache{
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSString *filePath = [path stringByAppendingPathComponent:@"localCache.plist"];
NSArray *plist_arr = [NSArray arrayWithContentsOfFile:filePath];
LocalCache *localCache;
if ([plist_arr firstObject]) {
localCache = [LocalCache mj_objectWithKeyValues:[plist_arr firstObject]];
}
return localCache;
}
//保存经纬度
+ (void)saveLocationCoordinate:(CLLocationCoordinate2D)coordinate{
[[NSUserDefaults standardUserDefaults] setValue:@{@"longitude":@(coordinate.longitude),@"latitude":@(coordinate.latitude)} forKey:kAppLocationCoo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (void)saveCustomLocationCoordinateWithLongitude:(NSString *)longitude Latitude:(NSString *)latitude {
[[NSUserDefaults standardUserDefaults] setValue:@{@"longitude":longitude,@"latitude":latitude} forKey:kAppCustomLocationCoo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (void)deleteCustomLocationCoordinate {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kAppCustomLocationCoo];
[[NSUserDefaults standardUserDefaults] synchronize];
}
+ (CLLocationCoordinate2D)getLocationCoordinate{
NSDictionary *dic;
LocalCache *lc = [AppConfig getLocalCache];
if (lc.is_custom == 1) {
dic = [[NSUserDefaults standardUserDefaults] objectForKey:kAppCustomLocationCoo];
} else {
dic = [[NSUserDefaults standardUserDefaults] objectForKey:kAppLocationCoo];
}
if (dic) {
CLLocationCoordinate2D cood = CLLocationCoordinate2DMake([[dic objectForKey:@"latitude"] doubleValue], [[dic objectForKey:@"longitude"] doubleValue]);
return cood;
}
return CLLocationCoordinate2DMake(0, 0);
}
@end
//
// AppTools.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface AppTools : NSObject
AS_SINGLETION(AppTools);
- (int)versionToIntValue;
//json串 unicode转中文
+ (NSString *)replaceUnicode:(NSString *)unicodeStr;
@end
NS_ASSUME_NONNULL_END
//
// AppTools.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "AppTools.h"
@interface AppTools()
@property (nonatomic,assign) int version_int;
@end
@implementation AppTools
DEF_SINGLETION(AppTools);
- (int)versionToIntValue{
if (self.version_int == 0) {
//将版本号点去除,拼接成int型传给服务器
NSArray *vs = [APP_VERSION componentsSeparatedByString:@"."];
NSMutableString *ver = [NSMutableString string];
for (NSString *string in vs) {
[ver appendString:string];
}
self.version_int = [ver intValue];
}
return self.version_int;
}
//json串 unicode转中文
+ (NSString *)replaceUnicode:(NSString *)unicodeStr {
if (StringIsNullOrEmpty(unicodeStr)) {
return @"空数据";
}else{
NSString *tempStr1 = [unicodeStr stringByReplacingOccurrencesOfString:@"\\u" withString:@"\\U"];
NSString *tempStr2 = [tempStr1 stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
NSString *tempStr3 = [[@"\"" stringByAppendingString:tempStr2] stringByAppendingString:@"\""];
NSData *tempData = [tempStr3 dataUsingEncoding:NSUTF8StringEncoding];
NSString* returnStr = [NSPropertyListSerialization propertyListWithData:tempData options:NSPropertyListImmutable format:NULL error:NULL];
return [returnStr stringByReplacingOccurrencesOfString:@"\\r\\n" withString:@"\n"];
}
}
@end
//
// TestClient.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface TestClient : NSObject
/**
弹出测试密码框
*/
+ (void)alertTESTViewWithBlock:(EventVoidHandler)block;
/**
切换环境
@param view 展示view
@param longPress 长按手势
*/
+ (void)changeEnvironment:(UIView *)view longPress:(UILongPressGestureRecognizer *)longPress;
/**
5下单击处罚自定义经纬度
@param vc 需要显示的控制器
@param view 需要显示的View
@param fivePress 响应的手势
*/
//
+ (void)changeCustomLocationWithTempVc:(UIViewController *)vc TempView:(UIView *)view fivePress:(UITapGestureRecognizer *)fivePress;
//统计带字典参数
+ (void)dicMobClickStatistics:(NSString *)event;
+ (void)dicMobClickStatistics:(NSString *)event url:(NSString *)url;
@end
NS_ASSUME_NONNULL_END
//
// XVAlertTools.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVAlertTools : NSObject
void showAlertMessage(NSString * _Nullable message);
void showAlertTitleAndMessage(NSString *title, NSString *message,NSString *ok);
void showIndicator(BOOL flag,NSString *title , EventVoidHandler block);
void showFullScreen(BOOL flag);
void showFullView(BOOL flag,UIViewController *bvc);
@end
NS_ASSUME_NONNULL_END
//
// XVAlertTools.m
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVAlertTools.h"
@implementation XVAlertTools
void showAlertMessage(NSString *message){
[LEEAlert alert].config
.LeeBackgroundStyleTranslucent(0)
.LeeContent(message)
.LeeAction(@"好", ^{
// 点击事件Block
})
.LeeShow();
}
void showAlertTitleAndMessage(NSString *title, NSString *message,NSString *ok) {
[LEEAlert alert].config
.LeeBackgroundStyleTranslucent(0)
.LeeTitle(title)
.LeeContent(message)
.LeeAction(ok, ^{
// 点击事件Block
})
.LeeShow();
}
void showFullScreen(BOOL flag){
theApp().window.userInteractionEnabled = !flag;
}
void showFullView(BOOL flag,UIViewController * bvc){
bvc.view.userInteractionEnabled = !flag;
}
void showIndicator(BOOL flag,NSString * title, EventVoidHandler block){
// if (flag) {
// MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:theApp().window animated:YES];
// hud.tag = 70021;
// hud.bezelView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.8];
// hud.contentColor = [UIColor whiteColor];
// hud.userInteractionEnabled = NO;
// hud.mode = MBProgressHUDModeIndeterminate;
// hud.label.text = title;
// hud.label.font = [UIFont systemFontOfSize:14];
// hud.label.textColor = [UIColor whiteColor];
// hud.removeFromSuperViewOnHide = YES;
// }else{
// dispatch_async(dispatch_get_main_queue(), ^{
// MBProgressHUD *hud = (MBProgressHUD *)[theApp().window viewWithTag:70021];
// [hud hideAnimated:YES];
// });
//
// BlockCallWithVoidArg(block);
// }
UIView *activityView = (UIView *)[theApp().window viewWithTag:70021];
if (flag) {
if (activityView==nil) {
activityView = [[UIView alloc] initWithFrame:CGRectMake(110, 120, 100, 100)];
activityView.tag = 70021;
activityView.backgroundColor = [UIColor clearColor];
UIView * v = [[UIView alloc]initWithFrame:activityView.bounds];
v.backgroundColor = [UIColor blackColor];
v.alpha = .4;
v.layer.cornerRadius = 5;
v.layer.masksToBounds = YES;
[activityView addSubview:v];
[activityView.layer setContents:(id)[[UIImage imageNamed:@"incativy.png"] CGImage]];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(3, 65, 95, 32)];
label.textAlignment = NSTextAlignmentCenter;
label.text = title;
label.numberOfLines = 0;
label.font = [UIFont systemFontOfSize:12];
label.textColor = [UIColor whiteColor];
label.backgroundColor = [UIColor clearColor];
[v addSubview:label];
UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
activity.center = CGPointMake(activityView.width / 2.0, activityView.height / 2.0 - 5);
activity.tag = 794232;
[activity startAnimating];
[activityView addSubview:activity];
activityView.center = CGPointMake(theApp().window.center.x, theApp().window.center.y - 100);
[theApp().window addSubview:activityView];
}
}
else{
if (activityView && [activityView superview]) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIActivityIndicatorView *activityIndicator = (UIActivityIndicatorView *)[activityView viewWithTag:794232];
[UIView animateWithDuration:.5 animations:^{
activityView.alpha = 0;
} completion:^(BOOL finished) {
if (activityIndicator) {
[activityIndicator stopAnimating];
}
[activityView removeFromSuperview];
BlockCallWithVoidArg(block);
}];
});
}
}
}
@end
//
// NSString+Extention.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
//获取一个字符串转换为URL
#define URL(str) [NSURL URLWithString:str]
///如果有nil或者null替换为空串
UIKIT_STATIC_INLINE NSString * StringIsNullRetBlank(NSString *str)
{
if (str==nil || (NSNull *)(str)==[NSNull null]) {
return @"";
}
return str;
}
/**
判断字符串为空或者为空字符串,只有空格也算是空
@param str : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringTrimIsNullOrEmpty(NSString* str)
{
str = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
return ((NSNull *)str==[NSNull null] || str==nil||[str isEqualToString:@""]);
}
/**
判断字符串为空或者为空字符串
@param str : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringIsNullOrEmpty(NSString* str)
{
if ([str isKindOfClass:[NSNumber class]] || [str integerValue] > 0) {
return NO;
}else{
return ((NSNull *)str==[NSNull null] || str == nil || [str isEqualToString:@""] || [str isEqualToString:@"null"] || [str isEqualToString:@"NULL"]);
}
}
UIKIT_STATIC_INLINE BOOL StringIsNullOrEmptyOrSpace(NSString* str)
{
if ([str isKindOfClass:[NSNumber class]] || [str integerValue] > 0) {
return NO;
}else{
return ((NSNull *)str==[NSNull null] || str == nil || [str isEqualToString:@""] || [str isEqualToString:@"null"] || [str isEqualToString:@"NULL"] || [str isEqualToString:@" "]);
}
}
/**
判断字符串不为空并且不为空字符串
@param str : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringNotNullAndEmpty(NSString* str)
{
if ([str isKindOfClass:[NSNumber class]] || [str integerValue] > 0) {
return YES;
}else{
return ((NSNull *)str!=[NSNull null] && str!=nil&&![str isEqualToString:@""]);
}
}
///返回一个占位字符,用于做Placeholder显示
UIKIT_STATIC_INLINE NSString * StringPlaceholderForString(NSString* placeholder,NSString* string)
{
return StringNotNullAndEmpty(string)?string:placeholder;
}
///用于判断字符串非空的结尾参数
UIKIT_EXTERN NSString * const kStringsNotNullAndEmptyEnd;
/**
判断一级字符串不为空并且不为空字符串
必需在字符串的最后一个放置kStringsNotNullAndEmptyEnd
@param str1 : 要判断的字符串
@return 返回BOOL表示结果
*/
UIKIT_STATIC_INLINE BOOL StringsNotNullAndEmpty(NSString * str1,...)
{
if (StringIsNullOrEmpty(str1)) {
return NO;
}
BOOL result=YES;
va_list argptr;
va_start(argptr, str1);
str1=va_arg(argptr, id);
while (str1!=kStringsNotNullAndEmptyEnd) {
str1=va_arg(argptr, id);
if (StringIsNullOrEmpty(str1)) {
result=NO;
break;
}
}
va_end(argptr);
return result;
}
//快速格式化一个字符串
#define _S(str,...) [NSString stringWithFormat:str,##__VA_ARGS__]
@class MREntitiesConverter;
@interface NSString (Extention)
- (NSString *)URLEncodedString;
- (float) heightWithFont: (UIFont *) font withinWidth: (float) width;
/**
* 返回字符串所占尺寸
*
* @param font 字体
* @param maxSize 最大尺寸
*/
- (CGSize)sizeWithMaxSize:(CGSize)maxSize font:(UIFont *)font;
//获取某固定文本的显示高度
+(CGRect)heightForString:(NSString*)str Size:(CGSize)size Font:(UIFont*)font;
+(CGRect)heightForString:(NSString*)str Size:(CGSize)size Font:(UIFont*)font Lines:(NSInteger)lines;
//动态计算文字的font
- (CGFloat)minFontForLabel:(UILabel *)lb maxFont:(CGFloat)maxFont;
//返回取到的token的字符串格式
+(NSString*)tokenString:(NSData*)devToken;
//返回字符串经过md5加密后的字符
+(NSString*)stringDecodingByMD5:(NSString*)str;
-(NSString*)md5DecodingString;
///生成16位md5
-(NSString*)md5StringFor16;
//返回经base64编码过后的数据
+ (NSString*)base64Encode:(NSData *)data;
-(NSString*)base64Encode;
//返回经base64解码过后的数据
+ (NSString*) base64Decode:(NSString *)string;
-(NSString*)base64Decode;
// 方法1:使用NSFileManager来实现获取文件大小
+ (long long) fileSizeAtPath1:(NSString*) filePath;
// 方法1:使用unix c函数来实现获取文件大小
+ (long long) fileSizeAtPath2:(NSString*) filePath;
// 方法1:循环调用fileSizeAtPath1
+ (long long) folderSizeAtPath1:(NSString*) folderPath;
// 方法2:循环调用fileSizeAtPath2
+ (long long) folderSizeAtPath2:(NSString*) folderPath;
// 方法2:在folderSizeAtPath2基础之上,去除文件路径相关的字符串拼接工作
+ (long long) folderSizeAtPath3:(NSString*) folderPath;
/// 去除字符串中收尾空格和换行
- (NSString *)trimString;
/// 计算字符串字节数,英文为1,中文为2
- (int)byteCount;
/// 根据最大字节数截取字符串
- (NSString *)substringWithMaxByteCount:(NSInteger)maxByteCount;
+ (NSArray *)getPhoneNumberContentTextUseString:(NSString *)originContentText;
//============================for core text=====================//
/*** 返回符合 pattern 的所有 items */
- (NSMutableArray *)itemsForPattern:(NSString *)pattern;
/*** 返回符合 pattern 的 捕获分组为 index 的所有 items */
- (NSMutableArray *)itemsForPattern:(NSString *)pattern captureGroupIndex:(NSUInteger)index;
/*** 返回符合 pattern 的第一个 item */
- (NSString *)itemForPatter:(NSString *)pattern;
/*** 返回符合 pattern 的 捕获分组为 index 的第一个 item */
- (NSString *)itemForPattern:(NSString *)pattern captureGroupIndex:(NSUInteger)index;
/*** 按 format 格式化字符串生成 NSDate 类型的对象,返回 timeString 时间与 1970年1月1日的时间间隔
* @discussion 格式化后的 NSDate 类型对象为 +0000 时区时间
*/
- (NSTimeInterval)timeIntervalFromString:(NSString *)timeString withDateFormat:(NSString *)format;
/*** 按 format 格式化字符串生成 NSDate 类型的对象,返回当前时间距给定 timeString 之间的时间间隔
* @discussion 格式化后的 NSDate 类型对象为本地时间
*/
- (NSTimeInterval)localTimeIntervalFromString:(NSString *)timeString withDateFormat:(NSString *)format;
- (BOOL)contains:(NSString *)piece;
// 删除字符串开头与结尾的空白符与换行
- (NSString *)trim;
//============================for core text=====================//
//============================for JSON ========================//
- (id)objectFromJSONString;
-(NSComparisonResult)floatCompare:(NSString*)other;
@end
NS_ASSUME_NONNULL_END
//
// Constants.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
/**
* 当前用户Info
*/
static NSString * const kAppUserInfo = @"kAppUserInfo" ;
/**
* 微信用户Info
*/
static NSString * const kAppWXUserInfo = @"kAppWXUserInfo" ;
/**
* 当前用户身份
*/
static NSString * const kAppPersonalType = @"user-current-type" ;
/**
* 用户改变登录通知
*/
static NSString * const kAppChangeLogin = @"kAppChangeLogin" ;
/**
* 定位名字
*/
static NSString * const kAppLocationName = @"kAppLocationName" ;
/**
* 定位经纬度
*/
static NSString * const kAppLocationCoo = @"kAppLocationCoo" ;
/**
* 自定义经纬度
*/
static NSString *const kAppCustomLocationCoo = @"kAppCustomLocationCoo";
/**
* 未完成数量
*/
static NSString * const kAppUndoneCount = @"kAppUndoneCount";
/**
* 环境类型
*/
static NSString * const kAppEnvironmentType = @"app-Environment-type" ;
/**
* 自动保险
*/
static NSString * const kAppAutoBuyInsurance = @"kAppAutoBuyInsurance";
/**
* 自动打开新订单
*/
static NSString * const kAppOpenNewOrder = @"kAppOpenNewOrder";
/**
* 该版本不再提示
*/
static NSString * const kAppUpdateTipFlag = @"kAppUpdateTipFlag";
/**
* 新订单语音提醒
*/
static NSString * const kAppNewOrderVoice = @"closevoice";
/**
* 新订单震动提醒
*/
static NSString * const kAppNewOrderVibrate = @"kAppNewOrderVibrate";
/**
* 预约单
*/
static NSString * const kAppPreOrder = @"kAppPreOrder";
static NSString * const kAppSildeOrder = @"kAppSildeOrder";
static NSString * const kAppWayScore = @"kAppWayScore";
static NSString * const kAppPrivacy = @"kAppPrivacy";
//
// Header.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
#ifndef Header_h
#define Header_h
// 百度地图
#define BAIDU_APPKEY @"9fzRTgXAOSma0WLs5ko09vSuw4I6L7Oz"
#ifdef DEBUG
#define DebugLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DebugLog( s, ... )
#endif
#define theApp() ((AppDelegate *) [[UIApplication sharedApplication] delegate])
#define IMG(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
#define S(str,...) [NSString stringWithFormat:str,##__VA_ARGS__]
#define RGBAColor(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define kHexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kRandomColor RGBAColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256),1)
#define COLOR_THEMEGRENN [UIColor colorWithHexString:@"#4EB97B"]
#define BLUE_COLOR [UIColor colorWithHexString:@"#4290E5"]
#define YELLOW_COLOR [UIColor colorWithHexString:@"#edb10f"]
#define PURPLE_COLOR [UIColor colorWithHexString:@"#9E5BCA"]
#define RED_COLOR [UIColor colorWithHexString:@"#f25555"]
#define F_3D3B4F_COLOR [UIColor colorWithHexString:@"#3D3B4F"]
#define F_415058_COLOR [UIColor colorWithHexString:@"#415058"]
#define F_707070_COLOR [UIColor colorWithHexString:@"#707070"]
#define F_8A8A8A_COLOR [UIColor colorWithHexString:@"#8a8a8a"]
#define F_BCBCBC_COLOR [UIColor colorWithHexString:@"#bcbcbc"]
#define F_CFCFCF_COLOR [UIColor colorWithHexString:@"#cfcfcf"]
#define F_7D7D7d_COLOR [UIColor colorWithHexString:@"#7D7D7D"]
#define F_9B9B9B_COLOR [UIColor colorWithHexString:@"#9B9B9B"]
#define F_666666_COLOR [UIColor colorWithHexString:@"#666666"]
#define F_606060_COLOR [UIColor colorWithHexString:@"#606060"]
#define F_BBBBBB_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define F_101010_COLOR [UIColor colorWithHexString:@"#101010"]
#define E9_3_COLOR [UIColor colorWithHexString:@"#e9e9e9"]
#define F2_3_COLOR [UIColor colorWithHexString:@"#f2f2f2"]
#define FA_3_COLOR [UIColor colorWithHexString:@"#fafafa"]
#define F7_3_COLOR [UIColor colorWithHexString:@"#F7F7F7"]
#define BB_3_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define EF_3_COLOR [UIColor colorWithHexString:@"#efefef"]
#define B2_3_COLOR [UIColor colorWithHexString:@"#b2b2b2"]
#define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf7f7f7)
#define kViewBorderRadius(View, Radius, Width, Color)\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]];
#define widthScale ([UIScreen mainScreen].bounds.size.width/375.0f)
#define heightScale ([UIScreen mainScreen].bounds.size.height/844.0f)
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
//状态栏高度
#define KSTATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
//导航条高度
#define KNAVBAR_HEIGHT 44.0
//底部tabbar高度
#define KTABBAR_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
//整个顶部的高度
#define KTOP_HEIGHT (KSTATUSBAR_HEIGHT + KNAVBAR_HEIGHT)
//app 版本
#define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define APP_BUILD [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
#define AS_SINGLETION( __class ) \
+ (__class *)shared##__class
#define DEF_SINGLETION( __class ) \
+ (__class *)shared##__class \
{ \
static dispatch_once_t once; \
static __class * __singleton__; \
dispatch_once( &once, ^{ __singleton__ = [[__class alloc] init]; } ); \
return __singleton__; \
}
#define IS_IPHONEX ({\
BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
if ([[[UIApplication sharedApplication] delegate] window].safeAreaInsets.bottom > 0.0) {\
isPhoneX = YES;\
}\
}\
isPhoneX;\
})
//iphoneX适配差值
#define KiPhoneXSafeAreaDValue ([[UIApplication sharedApplication] statusBarFrame].size.height>20?34:0)
#define kObjectIsEmpty(_object) (_object == nil \
|| [_object isKindOfClass:[NSNull class]] \
|| ([_object respondsToSelector:@selector(length)] && [(NSData *)_object length] == 0) \
|| ([_object respondsToSelector:@selector(count)] && [(NSArray *)_object count] == 0))
// 字符串是否为空
#define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1 ? YES : NO )
// 数组是否为空
#define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
typedef void(^EventHandler)(id sender);
typedef void(^EventVoidHandler)(void);
typedef void(^EventTwoHandler)(id sender,id sender1);
typedef void(^EventThreeHandler)(id sender,id sender1,id sender2);
typedef void(^RightActionBlock)(id sender,id sender1);
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithVoidArg(block) if(block){block();}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithOneArg(block,arg) if(block){block(arg);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithTwoArg(block,arg1,arg2) if(block){block(arg1,arg2);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithThreeArg(block,arg1,arg2,arg3) if(block){block(arg1,arg2,arg3);}
#endif /* Header_h */
......@@ -15,6 +15,7 @@
#import <TXScrollLabelView.h>
#import "WMDragView.h"
#import "XVOrderSearchView.h"
#import "XVJobStatusToolView.h"
@interface XVMainJobViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
......@@ -34,6 +35,7 @@
@property (nonatomic, strong) XVOrderSearchView *searchView;
@property (nonatomic, strong) XVJobStatusToolView *toolView;
@end
......@@ -42,19 +44,39 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.barView];
[self.view addSubview:self.categoryView];
[self.view addSubview:self.marqueeView];
[self.view addSubview:self.toolView];
[self.toolView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.view);
make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo(SCREEN_WIDTH);
make.height.mas_equalTo(61+KiPhoneXSafeAreaDValue);
}];
[self.view addSubview:self.listContainerView];
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.top.mas_equalTo(self.marqueeView.mas_bottom).mas_offset(6);
make.bottom.mas_equalTo(self.toolView.mas_top);
}];
[self.listContainerView layoutIfNeeded];
[self.view addSubview:self.sortView];
CGFloat h = (SCREEN_HEIGHT - self.listContainerView.tx_y) / 2;
CGFloat h = (SCREEN_HEIGHT - self.listContainerView.top) / 2;
self.dragView = [[WMDragView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-48, h, 48, 48)];
......@@ -193,6 +215,14 @@
return _categoryView;
}
- (XVJobStatusToolView *)toolView {
if(_toolView == nil) {
_toolView = [[XVJobStatusToolView alloc]init];
_toolView.backgroundColor = [UIColor colorWithHexString:@"#EEEEEE"];
}
return _toolView;
}
- (TXScrollLabelView *)marqueeView {
if (_marqueeView == nil) {
_marqueeView = [TXScrollLabelView scrollWithTitle:@"测试跑马灯" type:0];
......@@ -210,8 +240,8 @@
if(_listContainerView == nil) {
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
CGFloat h = self.barView.height + self.categoryView.height + self.marqueeView.height + 6;
_listContainerView.frame = CGRectMake(0, h, SCREEN_WIDTH, SCREEN_HEIGHT - h);
// CGFloat h = self.barView.height + self.categoryView.height + self.marqueeView.height + 6;
// _listContainerView.frame = CGRectMake(0, h, SCREEN_WIDTH, SCREEN_HEIGHT - h);
_listContainerView.scrollView.scrollEnabled = NO;
}
return _listContainerView;
......
......@@ -8,14 +8,13 @@
#import "XVNewJobViewController.h"
#import "XVOrderDetailsViewController.h"
#import "XVJobStatusToolView.h"
#import "XVNewJobViewCell.h"
@interface XVNewJobViewController ()<UITextFieldDelegate>
@property (nonatomic, strong) XVJobStatusToolView *toolView;
@property (nonatomic, strong) UITableView *tableView;
......@@ -40,20 +39,12 @@
- (void)setupUI {
[self.view addSubview:self.toolView];
[self.toolView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.view);
make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo(SCREEN_WIDTH);
make.height.mas_equalTo(61 + KiPhoneXSafeAreaDValue);
}];
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view);
make.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-61);
make.bottom.mas_equalTo(self.view);
}];
}
......@@ -82,13 +73,6 @@
}
- (XVJobStatusToolView *)toolView {
if(_toolView == nil) {
_toolView = [[XVJobStatusToolView alloc]init];
_toolView.backgroundColor = [UIColor colorWithHexString:@"#EEEEEE"];
}
return _toolView;
}
- (UITableView *)tableView {
if (_tableView == nil) {
......
......@@ -9,8 +9,12 @@
#import "XVOrderDetailsViewController.h"
#import "XVOrderInfoViewController.h"
@interface XVOrderDetailsViewController ()<UIGestureRecognizerDelegate>
@property (nonatomic, strong) XVOrderInfoViewController *infoVc;
@property (nonatomic, assign) CGPoint containerOrigin;
@property (nonatomic, assign) NSInteger lastPos;
......@@ -22,6 +26,8 @@
[super viewDidLoad];
self.view.backgroundColor = [UIColor greenColor];
[self setupUI];
}
......@@ -57,7 +63,7 @@
}else{
view.top += offset.y;
}
Log(@"%f===%ld",view.top,(long)pan.state);
DebugLog(@"%f===%ld",view.top,(long)pan.state);
if(pan.state == UIGestureRecognizerStateEnded) {
......
......@@ -44,7 +44,7 @@
.LeeShow();
}
- (void)dealloc {
Log(@"XVNewOrderAlter dealloc");
DebugLog(@"XVNewOrderAlter dealloc");
// if (_mapView) {
// _mapView.delegate = nil;
// _mapView = nil;
......
//
// Notification.h
// fastservice
//
// Created by xuning on 5/5/25.
// Copyright © 2025 FastService. All rights reserved.
//
/**
* 网络断开
*/
static NSString * const kAFNNotReachable = @"kAFNNotReachable" ;
/**
* 网络重新加载数据
*/
static NSString * const kAFNReloadData = @"kAFNReloadData" ;
/**
* 服务器异常通知
*/
static NSString * const kAppServerError = @"kAppServerError";
/**
* 服务器慢通知
*/
static NSString * const kAppServerLow = @"kAppServerLow";
//
// XVHealthCardTypeViewController.h
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardTypeViewController : XVBaseViewController
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardTypeViewController.m
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardTypeViewController.h"
#import "XVHealthCardTypeView.h"
#import "XVUploadHealthCardViewController.h"
@interface XVHealthCardTypeViewController ()
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) XVHealthCardTypeView *type1View;
@property (nonatomic, strong) XVHealthCardTypeView *type2View;
@property (nonatomic, strong) XVHealthCardTypeView *type3View;
@property (nonatomic, strong) XVHealthCardTypeView *type4View;
@end
@implementation XVHealthCardTypeViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"上传健康证";
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.scrollView];
[self.scrollView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.scrollView).mas_offset(14);
make.left.mas_equalTo(self.view).mas_offset(13);
}];
[self.scrollView addSubview:self.type1View];
[self.type1View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(9);
make.right.mas_equalTo(self.view).mas_offset(-9);
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(10);
make.height.mas_equalTo(102);
}];
kViewBorderRadius(self.type1View, 20, 0, [UIColor whiteColor]);
[self.scrollView addSubview:self.type2View];
[self.type2View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.height.right.mas_equalTo(self.type1View);
make.top.mas_equalTo(self.type1View.mas_bottom).mas_offset(10);
}];
kViewBorderRadius(self.type2View, 20, 0, [UIColor whiteColor]);
[self.scrollView addSubview:self.type3View];
[self.type3View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.height.right.mas_equalTo(self.type1View);
make.top.mas_equalTo(self.type2View.mas_bottom).mas_offset(10);
}];
kViewBorderRadius(self.type3View, 20, 0, [UIColor whiteColor]);
[self.scrollView addSubview:self.type4View];
[self.type4View mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.height.right.mas_equalTo(self.type1View);
make.top.mas_equalTo(self.type3View.mas_bottom).mas_offset(10);
make.bottom.mas_equalTo(self.scrollView).mas_offset(-40);
}];
kViewBorderRadius(self.type4View, 20, 0, [UIColor whiteColor]);
}
- (UIScrollView *)scrollView {
if (_scrollView == nil) {
_scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
_scrollView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_scrollView.alwaysBounceVertical = YES;
}
return _scrollView;
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"请选择健康证类型" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
}
return _titleLabel;
}
- (XVHealthCardTypeView *)type1View {
if (_type1View == nil) {
_type1View = [[XVHealthCardTypeView alloc]init];
_type1View.backgroundColor = [UIColor whiteColor];
[_type1View title:@"卡制" subTitle:@"印有个人信息及日期的卡片"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type1View addGestureRecognizer:tap];
}
return _type1View;
}
- (XVHealthCardTypeView *)type2View {
if (_type2View == nil) {
_type2View = [[XVHealthCardTypeView alloc]init];
_type2View.backgroundColor = [UIColor whiteColor];
[_type2View title:@"本制" subTitle:@"含有手写和机打信息、印章的本子"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type2View addGestureRecognizer:tap];
}
return _type2View;
}
- (XVHealthCardTypeView *)type3View {
if (_type3View == nil) {
_type3View = [[XVHealthCardTypeView alloc]init];
_type3View.backgroundColor = [UIColor whiteColor];
[_type3View title:@"纸制" subTitle:@"含有手写和机打信息、印章的纸张"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type3View addGestureRecognizer:tap];
}
return _type3View;
}
- (XVHealthCardTypeView *)type4View {
if (_type4View == nil) {
_type4View = [[XVHealthCardTypeView alloc]init];
_type4View.backgroundColor = [UIColor whiteColor];
[_type4View title:@"电子" subTitle:@"官方渠道下载的含有个人信息及日期的图片"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVUploadHealthCardViewController *vc = [[XVUploadHealthCardViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
}];
[_type4View addGestureRecognizer:tap];
}
return _type4View;
}
@end
//
// XVHealthCardViewController.h
// fastservice
//
// Created by xuning on 4/28/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardViewController : XVBaseViewController
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardViewController.m
// fastservice
//
// Created by xuning on 4/28/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardViewController.h"
#import "XVHealthCardStatusView.h"
#import "XVHealthCardTypeViewController.h"
@interface XVHealthCardViewController ()
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) XVHealthCardStatusView *statusView;
@property (nonatomic, strong) UIButton *uploadButton;
@end
@implementation XVHealthCardViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"健康证";
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.uploadButton];
[self.uploadButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(15);
make.right.mas_equalTo(self.view).mas_offset(-15);
make.height.mas_equalTo(47);
if (@available(iOS 11.0, *)) {
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-7);
} else {
make.bottom.mas_equalTo(self.view).mas_offset(-7);
}
}];
kViewBorderRadius(self.uploadButton, 4, 0, COLOR_THEMEGRENN);
[self.view addSubview:self.scrollView];
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.uploadButton.mas_top);
}];
[self.scrollView addSubview:self.statusView];
[self.statusView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.scrollView).mas_offset(18);
make.left.mas_equalTo(self.view).mas_offset(9);
make.right.mas_equalTo(self.view).mas_offset(-9);
make.height.mas_equalTo(165*widthScale);
}];
kViewBorderRadius(self.statusView, 20, 0, [UIColor whiteColor]);
}
- (UIButton *)uploadButton {
if (_uploadButton == nil) {
_uploadButton = [[UIButton alloc]initWithTitle:@"上传健康证" fontSize:14 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
[_uploadButton addBlockForControlEvents:(UIControlEventTouchUpInside) block:^(id _Nonnull sender) {
XVHealthCardTypeViewController *typeVc = [[XVHealthCardTypeViewController alloc]init];
[self.navigationController pushViewController:typeVc animated:YES];
}];
}
return _uploadButton;
}
- (UIScrollView *)scrollView {
if (_scrollView == nil) {
_scrollView = [[UIScrollView alloc]init];
_scrollView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_scrollView.alwaysBounceVertical = YES;
}
return _scrollView;
}
- (XVHealthCardStatusView *)statusView {
if (_statusView == nil) {
_statusView = [[XVHealthCardStatusView alloc]init];
_statusView.backgroundColor = [UIColor whiteColor];
}
return _statusView;
}
@end
......@@ -8,6 +8,7 @@
#import "XVMyViewController.h"
#import "XVMyCertificateView.h"
#import "XVHealthCardViewController.h"
@interface XVMyViewController ()
@property (nonatomic, strong) UIImageView *userImageView;
......@@ -258,6 +259,11 @@
if (_healthView == nil) {
_healthView = [[XVMyCertificateView alloc]init];
[_healthView setNormalImageName:@"群组 2" selectedImgName:@"群组 2" title:@"健康证"];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id _Nonnull sender) {
XVHealthCardViewController *healthVc = [[XVHealthCardViewController alloc]init];
[self.navigationController pushViewController:healthVc animated:YES];
}];
[_healthView addGestureRecognizer:tap];
}
return _healthView;
}
......
......@@ -132,7 +132,12 @@
make.left.mas_equalTo(self.view).mas_offset(13);
make.right.mas_equalTo(self.view).mas_offset(-13);
make.height.mas_equalTo(44);
make.bottom.mas_equalTo(self.view).mas_offset(-KiPhoneXSafeAreaDValue - 18);
if (@available(iOS 11.0, *)) {
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-18);
} else {
make.bottom.mas_equalTo(self.view).mas_offset(-18);
}
}];
kViewBorderRadius(self.serviceButton, 4, 0, [UIColor whiteColor]);
......
//
// XVUploadHealthCardViewController.h
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XVUploadHealthCardViewController : XVBaseViewController
@end
NS_ASSUME_NONNULL_END
//
// XVUploadHealthCardViewController.m
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVUploadHealthCardViewController.h"
#import "XVHealthCardTipView.h"
@interface XVUploadHealthCardViewController ()
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *uploadImageView;
@property (nonatomic, strong) UILabel *subTitleLabel;
@property (nonatomic, strong) UILabel *descLabel;
@property (nonatomic, strong) UIButton *uploadButton;
@property (nonatomic, strong) XVHealthCardTipView *tip1View;
@property (nonatomic, strong) XVHealthCardTipView *tip2View;
@property (nonatomic, strong) XVHealthCardTipView *tip3View;
@property (nonatomic, strong) XVHealthCardTipView *tip4View;
@end
@implementation XVUploadHealthCardViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"上传健康证";
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.uploadButton];
[self.uploadButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(15);
make.right.mas_equalTo(self.view).mas_offset(-15);
make.height.mas_equalTo(47);
if (@available(iOS 11.0, *)) {
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-7);
} else {
make.bottom.mas_equalTo(self.view).mas_offset(-7);
}
}];
kViewBorderRadius(self.uploadButton, 4, 0, COLOR_THEMEGRENN);
[self.view addSubview:self.scrollView];
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.uploadButton.mas_top);
}];
[self.scrollView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(17);
make.top.mas_equalTo(self.scrollView).mas_offset(18);
}];
[self.scrollView addSubview:self.uploadImageView];
[self.uploadImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(16);
make.right.mas_equalTo(self.view).mas_offset(-16);
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(15);
make.height.mas_equalTo(186*widthScale);
}];
[self.scrollView addSubview:self.subTitleLabel];
[self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(13);
make.top.mas_equalTo(self.uploadImageView.mas_bottom).mas_offset(14);
}];
[self.scrollView addSubview:self.descLabel];
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).mas_offset(16);
make.top.mas_equalTo(self.subTitleLabel.mas_bottom).mas_offset(14);
}];
CGFloat w = (SCREEN_WIDTH - 15*5) / 4;
[self.scrollView addSubview:self.tip1View];
[self.tip1View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.view).mas_offset(15);
}];
[self.scrollView addSubview:self.tip2View];
[self.tip2View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.tip1View.mas_right).mas_offset(15);
}];
[self.scrollView addSubview:self.tip3View];
[self.tip3View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.tip2View.mas_right).mas_offset(15);
}];
[self.scrollView addSubview:self.tip4View];
[self.tip4View mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.descLabel.mas_bottom).mas_offset(24);
make.width.mas_equalTo(w);
make.left.mas_equalTo(self.tip3View.mas_right).mas_offset(15);
make.right.mas_equalTo(self.view).mas_offset(-15);
}];
}
- (UIScrollView *)scrollView {
if (_scrollView == nil) {
_scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
_scrollView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_scrollView.alwaysBounceVertical = YES;
}
return _scrollView;
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"请拍摄您的健康证" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
}
return _titleLabel;
}
- (UIImageView *)uploadImageView {
if (_uploadImageView == nil) {
_uploadImageView = [[UIImageView alloc]initWithImageName:@"jk群组 1"];
UIImageView *icon = [[UIImageView alloc]initWithImageName:@"riFill-camera-fill 1"];
[_uploadImageView addSubview:icon];
[icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(_uploadImageView);
make.size.mas_equalTo(CGSizeMake(38, 38));
}];
}
return _uploadImageView;
}
- (UILabel *)subTitleLabel {
if (_subTitleLabel == nil) {
_subTitleLabel = [[UILabel alloc]initWithText:@"拍摄要求" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
}
return _subTitleLabel;
}
- (UILabel *)descLabel {
if (_descLabel == nil) {
_descLabel = [[UILabel alloc]init];
UIFont *font = [UIFont systemFontOfSize:12];
NSMutableAttributedString *text = [NSMutableAttributedString new];
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
paragraphStyle.lineSpacing = 10;
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@"请拍摄本人证件原件,不得使用复印件或他人证件" attributes:@{NSFontAttributeName : font,NSForegroundColorAttributeName:F_101010_COLOR,NSParagraphStyleAttributeName:paragraphStyle}]];
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@"\n" attributes:nil]];
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@"拍摄时确保证件边框完整、字体清晰" attributes:@{NSFontAttributeName : font,NSForegroundColorAttributeName:F_101010_COLOR}]];
_descLabel.numberOfLines = 2;
_descLabel.attributedText = text;
}
return _descLabel;
}
- (UIButton *)uploadButton {
if (_uploadButton == nil) {
_uploadButton = [[UIButton alloc]initWithTitle:@"上传健康证" fontSize:14 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
[_uploadButton addBlockForControlEvents:(UIControlEventTouchUpInside) block:^(id _Nonnull sender) {
}];
}
return _uploadButton;
}
- (XVHealthCardTipView *)tip1View {
if (_tip1View == nil) {
_tip1View = [[XVHealthCardTipView alloc]init];
[_tip1View title:@" 边框缺失" imageName:nil];
}
return _tip1View;
}
- (XVHealthCardTipView *)tip2View {
if (_tip2View == nil) {
_tip2View = [[XVHealthCardTipView alloc]init];
[_tip2View title:@" 照片模糊" imageName:nil];
}
return _tip2View;
}
- (XVHealthCardTipView *)tip3View {
if (_tip3View == nil) {
_tip3View = [[XVHealthCardTipView alloc]init];
[_tip3View title:@" 信息遮挡" imageName:nil];
}
return _tip3View;
}
- (XVHealthCardTipView *)tip4View {
if (_tip4View == nil) {
_tip4View = [[XVHealthCardTipView alloc]init];
[_tip4View title:@" 拍复印件" imageName:nil];
}
return _tip4View;
}
@end
//
// XVHealthCardStatusView.h
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardStatusView : UIView
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardStatusView.m
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardStatusView.h"
@interface XVHealthCardStatusView()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *rightImageView;
@property (nonatomic, strong) UIImageView *healthImageView;
@property (nonatomic, strong) UIImageView *statusImageView;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) UIButton *submitButton;
@end
@implementation XVHealthCardStatusView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).mas_offset(30);
make.left.mas_equalTo(self).mas_offset(22);
}];
[self addSubview:self.rightImageView];
[self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.size.mas_equalTo(CGSizeMake(24, 24));
make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(5);
}];
[self addSubview:self.healthImageView];
[self.healthImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.size.mas_equalTo(CGSizeMake(53, 53));
make.right.mas_equalTo(self).mas_offset(-26);
}];
[self addSubview:self.statusImageView];
[self.statusImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).mas_offset(16);
make.bottom.mas_equalTo(self).mas_offset(-16);
make.size.mas_equalTo(CGSizeMake(65, 27));
}];
[self addSubview:self.submitButton];
[self.submitButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(80, 30));
make.right.mas_equalTo(self).mas_offset(-26);
make.centerY.mas_equalTo(self.statusImageView);
}];
kViewBorderRadius(self.submitButton, 4, 0, [UIColor whiteColor]);
[self addSubview:self.dateLabel];
[self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.statusImageView);
make.left.mas_equalTo(self.statusImageView.mas_right).mas_offset(9);
make.height.mas_equalTo(27);
make.right.mas_equalTo(self.submitButton.mas_left).mas_offset(-25);
}];
kViewBorderRadius(self.dateLabel, 10, 0, [UIColor whiteColor]);
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"暂无证件" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:24];
}
return _titleLabel;
}
- (UIImageView *)rightImageView {
if (_rightImageView == nil) {
_rightImageView = [[UIImageView alloc]initWithImageName:@"arcoDesign-right 1"];
}
return _rightImageView;
}
- (UIImageView *)statusImageView {
if (_statusImageView == nil) {
_statusImageView = [[UIImageView alloc]initWithImageName:@"图标 3"];
}
return _statusImageView;
}
- (UIImageView *)healthImageView {
if (_healthImageView == nil) {
_healthImageView = [[UIImageView alloc]initWithImageName:@"图标 1"];
}
return _healthImageView;
}
- (UILabel *)dateLabel {
if (_dateLabel == nil) {
_dateLabel = [[UILabel alloc]initWithText:@"" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentCenter) fontSize:12];
}
return _dateLabel;
}
- (UIButton *)submitButton {
if (_submitButton == nil) {
_submitButton = [[UIButton alloc]initWithTitle:@"重新提交" fontSize:14 titleColor:[UIColor whiteColor] bgColor:kHexRGB(0xA4ADB3)];
}
return _submitButton;
}
@end
//
// XVHealthCardTipView.h
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardTipView : UIView
- (void)title:(NSString *)title imageName:(NSString *)imageName;
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardTipView.m
// fastservice
//
// Created by xuning on 5/4/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardTipView.h"
@interface XVHealthCardTipView()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) YYLabel *label;
@end
@implementation XVHealthCardTipView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)title:(NSString *)title imageName:(NSString *)imageName {
NSMutableAttributedString *text = [NSMutableAttributedString new];
UIFont *font = [UIFont systemFontOfSize:12];
UIColor *color = [UIColor colorWithHexString:@"#737272"];
// UIView attachment
UIImageView *imageView = [[UIImageView alloc]initWithImageName:@"if-close-circled 1"];
imageView.size = CGSizeMake(17, 17);
NSMutableAttributedString *attachment = [NSMutableAttributedString attachmentStringWithContent:imageView contentMode:UIViewContentModeBottom attachmentSize:imageView.size alignToFont:font alignment:YYTextVerticalAlignmentCenter];
[text appendAttributedString: attachment];
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:title];
str.font = font;
str.color = color;
[text appendAttributedString:str];
_label.attributedText = text;
_label.textAlignment = NSTextAlignmentCenter;
}
- (void)setupUI {
[self addSubview:self.imageView];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self);
make.height.mas_equalTo(53);
}];
kViewBorderRadius(self.imageView, 6, 0, [UIColor whiteColor]);
[self addSubview:self.label];
[self.label mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self);
make.top.mas_equalTo(self.imageView.mas_bottom).mas_offset(5);
}];
}
- (UIImageView *)imageView {
if (_imageView == nil) {
_imageView = [[UIImageView alloc]init];
_imageView.backgroundColor = [UIColor whiteColor];
}
return _imageView;
}
- (YYLabel *)label {
if (_label == nil) {
_label = [[YYLabel alloc]init];
NSMutableAttributedString *text = [NSMutableAttributedString new];
UIFont *font = [UIFont systemFontOfSize:12];
UIColor *color = [UIColor colorWithHexString:@"#737272"];
// UIView attachment
UIImageView *imageView = [[UIImageView alloc]initWithImageName:@"if-close-circled 1"];
imageView.size = CGSizeMake(17, 17);
NSMutableAttributedString *attachment = [NSMutableAttributedString attachmentStringWithContent:imageView contentMode:UIViewContentModeBottom attachmentSize:imageView.size alignToFont:font alignment:YYTextVerticalAlignmentCenter];
[text appendAttributedString: attachment];
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@" 边框缺失"];
str.font = font;
str.color = color;
[text appendAttributedString:str];
_label.attributedText = text;
_label.textAlignment = NSTextAlignmentCenter;
}
return _label;
}
@end
//
// XVHealthCardTypeView.h
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVHealthCardTypeView : UIView
- (void)title:(NSString *)title subTitle:(NSString *)subTitle;
@end
NS_ASSUME_NONNULL_END
//
// XVHealthCardTypeView.m
// fastservice
//
// Created by xuning on 4/29/25.
// Copyright © 2025 FastService. All rights reserved.
//
#import "XVHealthCardTypeView.h"
@interface XVHealthCardTypeView()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *subTitleLabel;
@property (nonatomic, strong) UIImageView *healthImageView;
@end
@implementation XVHealthCardTypeView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.userInteractionEnabled = YES;
[self setupUI];
}
return self;
}
- (void)title:(NSString *)title subTitle:(NSString *)subTitle {
self.titleLabel.text = title;
self.subTitleLabel.text = subTitle;
}
- (void)setupUI {
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).mas_offset(22);
make.left.mas_equalTo(self).mas_offset(22);
}];
[self addSubview:self.subTitleLabel];
[self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self).mas_offset(-15);
make.left.mas_equalTo(self).mas_offset(22);
}];
[self addSubview:self.healthImageView];
[self.healthImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(53, 53));
make.right.mas_equalTo(self).mas_offset(-26);
}];
}
- (UILabel *)titleLabel {
if (_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:24];
}
return _titleLabel;
}
- (UILabel *)subTitleLabel {
if (_subTitleLabel == nil) {
_subTitleLabel = [[UILabel alloc]initWithText:@"副标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:14];
}
return _subTitleLabel;
}
- (UIImageView *)healthImageView {
if (_healthImageView == nil) {
_healthImageView = [[UIImageView alloc]initWithImageName:@"图标 1"];
}
return _healthImageView;
}
@end
......@@ -36,6 +36,8 @@
- (void)setupUI {
self.userInteractionEnabled = YES;
[self addSubview:self.button];
[self.button mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
......@@ -69,6 +71,7 @@
[_button setTitleColor:kHexRGB(0xF78606) forState:UIControlStateNormal];
[_button setTitleColor:kHexRGB(0x00BE70) forState:UIControlStateSelected];
_button.titleLabel.font = [UIFont systemFontOfSize:10];
_button.userInteractionEnabled = NO;
}
return _button;
}
......
......@@ -9,6 +9,7 @@
#define PrefixHeader_pch
#ifdef __OBJC__
#import <YYKit.h>
#import "MJExtension.h"
#import "UIImageView+WebCache.h"
......@@ -32,141 +33,20 @@
//#import<BaiduMapAPI_Utils/BMKUtilsComponent.h>
//#import <BaiduMapAPI_WalkNavi/BMKWalkNaviComponent.h>
//#import <BaiduNaviKit-All/BNaviService.h>
#import "Header.h"
#import "AppDelegate.h"
#import "UIScrollView+XVAdd.h"
#import "UIView+XVAdd.h"
#import "NSString+XVAdd.h"
#import "NSString+Extention.h"
#import "MBProgressHUD+Extention.h"
#import "NSMutableDictionary+Extention.h"
#import "Notification.h"
#import "Constants.h"
#import "AppConfig.h"
#import "TestClient.h"
#import "XVAlertTools.h"
#import "AppTools.h"
#endif
// 百度地图
#define BAIDU_APPKEY @"9fzRTgXAOSma0WLs5ko09vSuw4I6L7Oz"
#ifdef DEBUG
#define Log(FORMAT, ...) fprintf(stderr,"[%s:%d行] %s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define Log(...)
#endif
#define IMG(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
#define S(str,...) [NSString stringWithFormat:str,##__VA_ARGS__]
#define RGBAColor(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define kHexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kRandomColor RGBAColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256),1)
#define COLOR_THEMEGRENN [UIColor colorWithHexString:@"#4EB97B"]
#define BLUE_COLOR [UIColor colorWithHexString:@"#4290E5"]
#define YELLOW_COLOR [UIColor colorWithHexString:@"#edb10f"]
#define PURPLE_COLOR [UIColor colorWithHexString:@"#9E5BCA"]
#define RED_COLOR [UIColor colorWithHexString:@"#f25555"]
#define F_3D3B4F_COLOR [UIColor colorWithHexString:@"#3D3B4F"]
#define F_415058_COLOR [UIColor colorWithHexString:@"#415058"]
#define F_707070_COLOR [UIColor colorWithHexString:@"#707070"]
#define F_8A8A8A_COLOR [UIColor colorWithHexString:@"#8a8a8a"]
#define F_BCBCBC_COLOR [UIColor colorWithHexString:@"#bcbcbc"]
#define F_CFCFCF_COLOR [UIColor colorWithHexString:@"#cfcfcf"]
#define F_7D7D7d_COLOR [UIColor colorWithHexString:@"#7D7D7D"]
#define F_9B9B9B_COLOR [UIColor colorWithHexString:@"#9B9B9B"]
#define F_666666_COLOR [UIColor colorWithHexString:@"#666666"]
#define F_606060_COLOR [UIColor colorWithHexString:@"#606060"]
#define F_BBBBBB_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define F_101010_COLOR [UIColor colorWithHexString:@"#101010"]
#define E9_3_COLOR [UIColor colorWithHexString:@"#e9e9e9"]
#define F2_3_COLOR [UIColor colorWithHexString:@"#f2f2f2"]
#define FA_3_COLOR [UIColor colorWithHexString:@"#fafafa"]
#define F7_3_COLOR [UIColor colorWithHexString:@"#F7F7F7"]
#define BB_3_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define EF_3_COLOR [UIColor colorWithHexString:@"#efefef"]
#define B2_3_COLOR [UIColor colorWithHexString:@"#b2b2b2"]
#define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf7f7f7)
#define kViewBorderRadius(View, Radius, Width, Color)\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]];
#define widthScale ([UIScreen mainScreen].bounds.size.width/375.0f)
#define heightScale ([UIScreen mainScreen].bounds.size.height/844.0f)
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
//状态栏高度
#define KSTATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
//导航条高度
#define KNAVBAR_HEIGHT 44.0
//底部tabbar高度
#define KTABBAR_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
//整个顶部的高度
#define KTOP_HEIGHT (KSTATUSBAR_HEIGHT + KNAVBAR_HEIGHT)
//app 版本
#define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define APP_BUILD [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
#define IS_IPHONEX ({\
BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
if ([[[UIApplication sharedApplication] delegate] window].safeAreaInsets.bottom > 0.0) {\
isPhoneX = YES;\
}\
}\
isPhoneX;\
})
//iphoneX适配差值
#define KiPhoneXSafeAreaDValue ([[UIApplication sharedApplication] statusBarFrame].size.height>20?34:0)
#define kObjectIsEmpty(_object) (_object == nil \
|| [_object isKindOfClass:[NSNull class]] \
|| ([_object respondsToSelector:@selector(length)] && [(NSData *)_object length] == 0) \
|| ([_object respondsToSelector:@selector(count)] && [(NSArray *)_object count] == 0))
// 字符串是否为空
#define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] < 1 ? YES : NO )
// 数组是否为空
#define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
typedef void(^EventHandler)(id sender);
typedef void(^EventVoidHandler)(void);
typedef void(^EventTwoHandler)(id sender,id sender1);
typedef void(^EventThreeHandler)(id sender,id sender1,id sender2);
typedef void(^RightActionBlock)(id sender,id sender1);
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithVoidArg(block) if(block){block();}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithOneArg(block,arg) if(block){block(arg);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithTwoArg(block,arg1,arg2) if(block){block(arg1,arg2);}
/**
调用一个block,会判断block不为空
*/
#define BlockCallWithThreeArg(block,arg1,arg2,arg3) if(block){block(arg1,arg2,arg3);}
#endif /* PrefixHeader_pch */
......@@ -37,6 +37,9 @@ target 'fastservice' do
# pod 'BMKLocationKit'
# pod 'BaiduNaviKit-All', '6.4.0' # 集成地图Map包
pod 'CWLateralSlide', '~> 1.6.3'
pod 'HWPanModal', '~> 0.9.9'
# pod 'FloatingPanel'
end
......@@ -30,6 +30,7 @@ PODS:
- Bugly (2.5.93)
- CWLateralSlide (1.6.5)
- DZNEmptyDataSet (1.8.1)
- HWPanModal (0.9.9)
- IQKeyboardManager (6.5.11)
- JXCategoryView (1.6.1)
- LEEAlert (1.6.4)
......@@ -55,6 +56,7 @@ DEPENDENCIES:
- Bugly
- CWLateralSlide (~> 1.6.3)
- DZNEmptyDataSet
- HWPanModal (~> 0.9.9)
- IQKeyboardManager
- JXCategoryView
- LEEAlert
......@@ -76,6 +78,7 @@ SPEC REPOS:
- Bugly
- CWLateralSlide
- DZNEmptyDataSet
- HWPanModal
- IQKeyboardManager
- JXCategoryView
- LEEAlert
......@@ -96,6 +99,7 @@ SPEC CHECKSUMS:
Bugly: b8715e6ec4004b7f7fbffab0643ba80545aee3da
CWLateralSlide: 8939c8dea91a24e40d0793553118cb57cd67f64b
DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7
HWPanModal: b57a6717d3cdcd666bff44f9dd2a5be9f4d6f5d2
IQKeyboardManager: ef43ce1ba1e5aaf4adf222c0a46f39761f246879
JXCategoryView: 7b1ee69ede4843c581688afe84d0f047723262f2
LEEAlert: a604ad481e3e9b021421a271f78594926dd034bb
......@@ -109,6 +113,6 @@ SPEC CHECKSUMS:
TXScrollLabelView: 0e1650caf61198bf5dc0938ea6493254aeb80f90
YYKit: 7cda43304a8dc3696c449041e2cb3107b4e236e7
PODFILE CHECKSUM: c7adb24e1766e2a88ca10141694f2ba79f8557d6
PODFILE CHECKSUM: 9b2eae658cd096a7fea42e04e882b217100d7c13
COCOAPODS: 1.11.3
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment