@aks-dev/easyui 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -1
- package/ios/RNEasyui.h +0 -18
- package/ios/RNEasyui.m +0 -20
- package/ios/UpgradeModule.h +0 -12
- package/ios/UpgradeModule.m +0 -132
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aks-dev/easyui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "工具箱",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -83,6 +83,11 @@
|
|
|
83
83
|
"jsSrcsDir": "./src/specs",
|
|
84
84
|
"android": {
|
|
85
85
|
"javaPackageName": "com.easyui"
|
|
86
|
+
},
|
|
87
|
+
"ios": {
|
|
88
|
+
"modulesProvider": {
|
|
89
|
+
"RNEasyui": "RNEasyui"
|
|
90
|
+
}
|
|
86
91
|
}
|
|
87
92
|
}
|
|
88
93
|
}
|
package/ios/RNEasyui.h
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-25 17:57:29
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-04-27 09:21:02
|
|
6
|
-
* @FilePath: /easy/ios/RNEasyui.h
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
#if __has_include("RCTBridgeModule.h")
|
|
10
|
-
#import "RCTBridgeModule.h"
|
|
11
|
-
#else
|
|
12
|
-
#import <React/RCTBridgeModule.h>
|
|
13
|
-
#endif
|
|
14
|
-
|
|
15
|
-
@interface RNEasyui : NSObject <RCTBridgeModule>
|
|
16
|
-
|
|
17
|
-
@end
|
|
18
|
-
|
package/ios/RNEasyui.m
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#import "RNEasyui.h"
|
|
3
|
-
#import "RomUtil.h"
|
|
4
|
-
|
|
5
|
-
@implementation RNEasyui
|
|
6
|
-
|
|
7
|
-
- (dispatch_queue_t)methodQueue
|
|
8
|
-
{
|
|
9
|
-
return dispatch_get_main_queue();
|
|
10
|
-
}
|
|
11
|
-
RCT_EXPORT_MODULE()
|
|
12
|
-
|
|
13
|
-
RCT_EXPORT_METHOD(getDeviceBrand:(RCTPromiseResolveBlock)resolve
|
|
14
|
-
reject:(RCTPromiseRejectBlock)reject){
|
|
15
|
-
resolve([RomUtil getCurrentDeviceModel]);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@end
|
|
20
|
-
|
package/ios/UpgradeModule.h
DELETED
package/ios/UpgradeModule.m
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// UpgradeModule.m
|
|
3
|
-
// AksFireApp
|
|
4
|
-
//
|
|
5
|
-
// Created by mac on 2022/5/5.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "UpgradeModule.h"
|
|
9
|
-
#import <UIKit/UIKit.h>
|
|
10
|
-
#import "UpgradeView.h"
|
|
11
|
-
#import "LEEAlert.h"
|
|
12
|
-
@interface UpgradeModule ()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@implementation UpgradeModule
|
|
21
|
-
|
|
22
|
-
- (dispatch_queue_t)methodQueue
|
|
23
|
-
{
|
|
24
|
-
return dispatch_get_main_queue();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
RCT_EXPORT_MODULE();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
RCT_EXPORT_METHOD(getAppVersion:(RCTPromiseResolveBlock)resolve
|
|
34
|
-
reject:(RCTPromiseRejectBlock)reject){
|
|
35
|
-
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
|
|
36
|
-
NSString *currentVersion = [infoDict objectForKey:@"CFBundleShortVersionString"];
|
|
37
|
-
resolve(currentVersion);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
RCT_EXPORT_METHOD(getOSVersion:(RCTPromiseResolveBlock)resolve
|
|
43
|
-
reject:(RCTPromiseRejectBlock)reject){
|
|
44
|
-
UIDevice *device = [UIDevice currentDevice];
|
|
45
|
-
NSString *systemVersion = [NSString stringWithFormat:@"%@ %@",device.systemName,device.systemVersion];
|
|
46
|
-
resolve(systemVersion);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
RCT_EXPORT_METHOD(upgrade:(NSDictionary *)info
|
|
53
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
54
|
-
reject:(RCTPromiseRejectBlock)reject){//checkCode, desc
|
|
55
|
-
|
|
56
|
-
NSString * version = info[@"version"];
|
|
57
|
-
NSString * title = info[@"title"];
|
|
58
|
-
NSString * downloadUrl = info[@"downloadUrl"];
|
|
59
|
-
NSString * note = info[@"note"];
|
|
60
|
-
BOOL force = info[@"force"];
|
|
61
|
-
|
|
62
|
-
NSString *currentVersion = [self getLocalVersion];
|
|
63
|
-
NSComparisonResult result =[self buildVersion:currentVersion compareWithAppstoreVersion:version];
|
|
64
|
-
if( result== NSOrderedAscending){
|
|
65
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
66
|
-
CGFloat SCREEN_WIDTH = [UIScreen mainScreen].bounds.size.width;
|
|
67
|
-
UpgradeView *view = [[UpgradeView alloc] initWithTitle:title note:note force:force];
|
|
68
|
-
view.closeBlock = ^{
|
|
69
|
-
[LEEAlert closeWithCompletionBlock:nil];
|
|
70
|
-
};
|
|
71
|
-
view.settingBlock = ^{
|
|
72
|
-
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: [downloadUrl stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]] options:@{} completionHandler:nil];
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
[LEEAlert alert].config
|
|
76
|
-
.LeeMaxWidth(SCREEN_WIDTH-40)
|
|
77
|
-
.LeeCustomView(view)
|
|
78
|
-
.LeeHeaderInsets(UIEdgeInsetsMake(0, 0, 0, 0))
|
|
79
|
-
.LeeItemInsets(UIEdgeInsetsMake(0, 0, 0, 0))
|
|
80
|
-
#ifdef __IPHONE_13_0
|
|
81
|
-
.LeeUserInterfaceStyle(UIUserInterfaceStyleLight)
|
|
82
|
-
#endif
|
|
83
|
-
.LeeShow();
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
else if(result == NSOrderedDescending){
|
|
88
|
-
reject(@"error_app_upgrade",@"商城版本低于本地版本",NULL);
|
|
89
|
-
}else if(result == NSOrderedSame){
|
|
90
|
-
reject(@"error_app_upgrade",@"已是最新版本",NULL);
|
|
91
|
-
}else{
|
|
92
|
-
resolve(@"发现新版本");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
- (NSString*) getLocalVersion {
|
|
99
|
-
return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
版本比较
|
|
104
|
-
*/
|
|
105
|
-
-(NSComparisonResult)buildVersion:(NSString*)buildVersion compareWithAppstoreVersion:(NSString*)appStoreVersion{
|
|
106
|
-
NSArray* buildVersionNums = [buildVersion componentsSeparatedByString:@"."];
|
|
107
|
-
NSArray* appStoreVersionNums = [appStoreVersion componentsSeparatedByString:@"."];
|
|
108
|
-
for (NSInteger i=0; i<buildVersionNums.count; i++) {
|
|
109
|
-
NSInteger buildNum = [buildVersionNums[i] integerValue];
|
|
110
|
-
if(i<appStoreVersionNums.count){
|
|
111
|
-
NSInteger appStoreNum = [appStoreVersionNums[i] integerValue];
|
|
112
|
-
if(buildNum < appStoreNum){
|
|
113
|
-
return NSOrderedAscending;
|
|
114
|
-
}else if(buildNum>appStoreNum){
|
|
115
|
-
return NSOrderedDescending;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if(buildVersionNums.count > appStoreVersionNums.count){
|
|
121
|
-
return NSOrderedDescending;
|
|
122
|
-
}else if(buildVersionNums.count < appStoreVersionNums.count){
|
|
123
|
-
return NSOrderedAscending;
|
|
124
|
-
}
|
|
125
|
-
return NSOrderedSame;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
+ (BOOL)requiresMainQueueSetup {
|
|
130
|
-
return YES;
|
|
131
|
-
}
|
|
132
|
-
@end
|