@aks-dev/easyui 1.0.31 → 1.0.34
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/android/src/main/java/com/easyui/UpgradeModule.java +2 -2
- package/ios/UpgradeModule.m +80 -1
- package/ios/assets/infor_colse_image.png +0 -0
- package/ios/assets/upgrade_bg.png +0 -0
- package/ios/libs/LEEAlert/LEEAlert.h +462 -0
- package/ios/libs/LEEAlert/LEEAlert.m +3823 -0
- package/ios/libs/LEEAlert/LEEAlertHelper.h +153 -0
- package/ios/libs/SDAutoLayout/SDAutoLayout.h +24 -0
- package/ios/libs/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.h +169 -0
- package/ios/libs/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.m +537 -0
- package/ios/libs/SDAutoLayout/UIView+SDAutoLayout.h +484 -0
- package/ios/libs/SDAutoLayout/UIView+SDAutoLayout.m +1812 -0
- package/ios/views/UpgradeView.h +23 -0
- package/ios/views/UpgradeView.m +172 -0
- package/jsbridge/index.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// UpgradeView.h
|
|
3
|
+
// LEEAlertDemo
|
|
4
|
+
//
|
|
5
|
+
// Created by mac on 2021/5/14.
|
|
6
|
+
// Copyright © 2021 lee. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <UIKit/UIKit.h>
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface UpgradeView : UIView
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
- (instancetype)initWithTitle:(NSString*)title
|
|
17
|
+
note:(NSString*)note
|
|
18
|
+
force:(BOOL)force;
|
|
19
|
+
@property (nonatomic , copy ) void (^closeBlock)(void);
|
|
20
|
+
@property (nonatomic , copy ) void (^settingBlock)(void);
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
#import "SDAutoLayout.h"
|
|
2
|
+
|
|
3
|
+
#import "LEEAlert.h"
|
|
4
|
+
|
|
5
|
+
#import "UpgradeView.h"
|
|
6
|
+
|
|
7
|
+
@interface UpgradeView ()
|
|
8
|
+
|
|
9
|
+
@property (nonatomic , strong ) UIImageView *imageView; //图片
|
|
10
|
+
@property (nonatomic , strong ) UILabel *titleLabel; //标题
|
|
11
|
+
@property (nonatomic , strong ) UILabel *contentLabel; //内容
|
|
12
|
+
|
|
13
|
+
@property (nonatomic , strong ) UIButton *settingButton; //设置按钮
|
|
14
|
+
|
|
15
|
+
@property (nonatomic , strong ) UIButton *colseButton; //关闭按钮
|
|
16
|
+
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation UpgradeView
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
- (instancetype)initWithTitle:(NSString*)title
|
|
23
|
+
note:(NSString*)note
|
|
24
|
+
force:(BOOL)force{
|
|
25
|
+
if(self = [super init]){
|
|
26
|
+
CGFloat SCREEN_WIDTH = [UIScreen mainScreen].bounds.size.width;
|
|
27
|
+
self.frame = CGRectMake(0, 0, SCREEN_WIDTH-40, 0);
|
|
28
|
+
//初始化子视图
|
|
29
|
+
[self initSubviewWithTitle:title note:note force:force];
|
|
30
|
+
//设置自动布局
|
|
31
|
+
[self configAutoLayoutWithForce:force];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return self;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#pragma mark - 初始化子视图
|
|
38
|
+
|
|
39
|
+
- (void)initSubviewWithTitle:(NSString*)title
|
|
40
|
+
note:(NSString*)note
|
|
41
|
+
force:(BOOL)force{
|
|
42
|
+
|
|
43
|
+
// 图片
|
|
44
|
+
|
|
45
|
+
_imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"upgrade_bg"]];
|
|
46
|
+
_imageView.contentMode = UIViewContentModeScaleAspectFit | UIViewContentModeTop | UIViewContentModeLeft | UIViewContentModeRight ;
|
|
47
|
+
[self addSubview:_imageView];
|
|
48
|
+
// 标题
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
_titleLabel = [[UILabel alloc] init];
|
|
52
|
+
|
|
53
|
+
_titleLabel.text = title;
|
|
54
|
+
|
|
55
|
+
_titleLabel.textColor = [UIColor blackColor];
|
|
56
|
+
|
|
57
|
+
_titleLabel.font = [UIFont systemFontOfSize:16.0f];
|
|
58
|
+
|
|
59
|
+
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
|
60
|
+
_titleLabel.numberOfLines = 2;
|
|
61
|
+
|
|
62
|
+
[self addSubview:_titleLabel];
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// 内容
|
|
66
|
+
|
|
67
|
+
_contentLabel = [[UILabel alloc] init];
|
|
68
|
+
_contentLabel.text = note;
|
|
69
|
+
_contentLabel.textColor = [UIColor colorWithRed:87/255.0f green:87/255.0f blue:87/255.0f alpha:1.0f];
|
|
70
|
+
_contentLabel.font = [UIFont systemFontOfSize:14.0f];
|
|
71
|
+
_contentLabel.numberOfLines = 0;
|
|
72
|
+
[self addSubview:_contentLabel];
|
|
73
|
+
|
|
74
|
+
// 设置按钮
|
|
75
|
+
|
|
76
|
+
_settingButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
77
|
+
|
|
78
|
+
_settingButton.sd_cornerRadius = @5.0f;
|
|
79
|
+
|
|
80
|
+
[_settingButton.titleLabel setFont:[UIFont systemFontOfSize:16.0f]];
|
|
81
|
+
|
|
82
|
+
[_settingButton setTitle:@"立即升级" forState:UIControlStateNormal];
|
|
83
|
+
|
|
84
|
+
[_settingButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
85
|
+
|
|
86
|
+
[_settingButton setBackgroundColor:[UIColor colorWithRed:233/255.0f green:101/255.0f blue:99/255.0f alpha:1.0f]];
|
|
87
|
+
|
|
88
|
+
[_settingButton addTarget:self action:@selector(settingButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
89
|
+
|
|
90
|
+
[self addSubview:_settingButton];
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
// 关闭按钮
|
|
94
|
+
_colseButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
95
|
+
_colseButton.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);
|
|
96
|
+
UIImage * colseButtonImage = [UIImage imageNamed:@"infor_colse_image"];
|
|
97
|
+
[_colseButton setImage: colseButtonImage forState:UIControlStateNormal];
|
|
98
|
+
|
|
99
|
+
[_colseButton addTarget:self action:@selector(closeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
100
|
+
|
|
101
|
+
[self addSubview:_colseButton];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#pragma mark - 设置自动布局
|
|
105
|
+
|
|
106
|
+
- (void)configAutoLayoutWithForce:(BOOL)force{
|
|
107
|
+
CGFloat SCREEN_WIDTH = [UIScreen mainScreen].bounds.size.width;
|
|
108
|
+
CGFloat W =SCREEN_WIDTH-60;
|
|
109
|
+
// 图片
|
|
110
|
+
|
|
111
|
+
self.imageView.sd_layout
|
|
112
|
+
.topSpaceToView(self , 0.0f)
|
|
113
|
+
.leftSpaceToView(self , 0.0f)
|
|
114
|
+
.rightSpaceToView(self , 0.0f)
|
|
115
|
+
.heightIs((SCREEN_WIDTH-60)/2.2);
|
|
116
|
+
// 标题
|
|
117
|
+
|
|
118
|
+
// 标题
|
|
119
|
+
|
|
120
|
+
self.titleLabel.sd_layout
|
|
121
|
+
.topSpaceToView(self.imageView , 0.0f)
|
|
122
|
+
.centerXEqualToView(self)
|
|
123
|
+
.widthIs(W)
|
|
124
|
+
.minHeightIs(0.0f)
|
|
125
|
+
.maxHeightIs(0.0f);
|
|
126
|
+
|
|
127
|
+
// 内容
|
|
128
|
+
|
|
129
|
+
self.contentLabel.sd_layout
|
|
130
|
+
.topSpaceToView(self.titleLabel , 0.0f)
|
|
131
|
+
.centerXEqualToView(self)
|
|
132
|
+
.widthIs(W)
|
|
133
|
+
.minHeightIs(0.0f)
|
|
134
|
+
.maxHeightIs(120.0f);
|
|
135
|
+
|
|
136
|
+
// 设置按钮
|
|
137
|
+
|
|
138
|
+
self.settingButton.sd_layout
|
|
139
|
+
.topSpaceToView(self.contentLabel , 10.0f)
|
|
140
|
+
.leftSpaceToView(self , 30.0f)
|
|
141
|
+
.rightSpaceToView(self , 30.0f)
|
|
142
|
+
.heightIs(40.0f);
|
|
143
|
+
|
|
144
|
+
// 关闭按钮
|
|
145
|
+
if(!force){
|
|
146
|
+
self.colseButton.sd_layout
|
|
147
|
+
.topSpaceToView(self , .0f)
|
|
148
|
+
.rightSpaceToView(self , .0f)
|
|
149
|
+
.widthIs(44.0f)
|
|
150
|
+
.heightIs(44.0f);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
[self setupAutoHeightWithBottomView:self.settingButton bottomMargin:20.0f];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
#pragma mark - 设置按钮点击事件
|
|
158
|
+
|
|
159
|
+
- (void)settingButtonAction:(UIButton *)sender{
|
|
160
|
+
|
|
161
|
+
if(self.settingBlock) self.settingBlock();
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
#pragma mark - 关闭按钮点击事件
|
|
166
|
+
|
|
167
|
+
- (void)closeButtonAction:(UIButton *)sender{
|
|
168
|
+
|
|
169
|
+
if (self.closeBlock) self.closeBlock();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@end
|
package/jsbridge/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-19 10:23:01
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-23
|
|
5
|
+
* @LastEditTime: 2022-05-23 19:39:00
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/jsbridge/index.ts
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
export declare type UpgradeOptions = {
|
|
17
|
+
title:string;
|
|
17
18
|
version: string;
|
|
18
19
|
downloadUrl: string;
|
|
19
20
|
note: string;
|