Compare commits

...

141 Commits

Author SHA1 Message Date
bb962cb8cf Merge pull request 'Update project config' (#68) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/68
2022-06-09 17:25:22 +08:00
d733c75371 Update project config 2022-06-09 17:23:09 +08:00
2fd3f5a0db (#22) Add Data Modular. 2022-01-28 08:41:22 +08:00
f2f68c1f4a Merge branch 'master' into dev-mrkbear 2022-01-26 14:51:03 +08:00
1917828eab Merge pull request '(#22)(#56) Add student info data ware.' (#67) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/67
2022-01-25 17:13:12 +08:00
afae6b7903 (#22)(#56) Add student info data ware. 2022-01-25 17:11:29 +08:00
b2854908a4 Merge pull request '(#56) Data prototype use custrmers function.' (#65) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/65
2022-01-25 13:05:55 +08:00
7f86ae9fd2 Merge branch 'master' into dev-mrkbear 2022-01-25 13:05:42 +08:00
22188907c2 (#56) Data prototype use custrmers function. 2022-01-25 13:04:41 +08:00
33e49cb8be Merge pull request '(#36) Optimization popup layer modular.' (#64) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/64
2022-01-24 16:57:00 +08:00
1dcc09980c (#36) Optimization popup layer modular. 2022-01-24 16:55:58 +08:00
6a4cae757d Merge pull request '(#36) Merge mask modular & popup modular in popup layer modular.' (#63) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/63
2022-01-24 14:59:33 +08:00
18381aa0c4 (#36) Merge mask modular & popup modular in popup layer modular. 2022-01-24 14:58:33 +08:00
943798f53c (#36) Add popuplayer. 2022-01-23 20:34:52 +08:00
a5dc26cd17 Merge pull request '(#60) Remove mixin generic paradigm.' (#62) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/62
2022-01-23 12:10:05 +08:00
464a9d3e59 (#60) Remove mixin generic paradigm. 2022-01-23 12:08:38 +08:00
292a4c26c5 (#60) Core emitter generic optimization 2022-01-22 17:50:25 +08:00
e97514a67f (#60) Core emitter generic optimization 2022-01-22 17:49:03 +08:00
27ac19141f Merge pull request '(#60) Core emitter generic optimization' (#61) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/61
2022-01-22 16:13:40 +08:00
c385965655 (#60) Core emitter generic optimization 2022-01-22 16:10:24 +08:00
43d87b40f7 Merge pull request '(#21) Mixin IAnyData in app' (#59) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/59
2022-01-21 17:39:13 +08:00
660f6921de (#21) Mixin IAnyData in app 2022-01-21 17:38:41 +08:00
86101e01d1 Merge pull request '(#22) Add StudentInfo file' (#58) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/58
2022-01-21 17:37:05 +08:00
1f2a2ad6bd (#22) Add StudentInfo file 2022-01-21 17:36:16 +08:00
b91a9271a7 Merge pull request '(#56) Add Core Data.' (#57) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/57
2022-01-21 17:33:10 +08:00
ec635b9ae6 (#56) Add Core Data. 2022-01-21 17:30:08 +08:00
6f96a69900 Merge pull request '(#35)Add mask modular event.' (#55) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/55
2022-01-21 10:43:24 +08:00
58d8d74158 (#35)Add mask modular event. 2022-01-21 10:38:37 +08:00
96b3414d22 Merge pull request '(#28)Add a api frame (incomplete file)' (#51) from dev-tamako into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/51
2022-01-20 23:52:35 +08:00
529011b0dd (#28)Add Schedule API 2022-01-20 23:47:02 +08:00
4da257c2e2 (#28)Add Schedule API 2022-01-20 22:19:10 +08:00
f11eb63ee1 Merge branch 'master' into dev-tamako 2022-01-20 21:45:30 +08:00
49c4f7f0d4 Merge pull request '(#52) Add EduBase API' (#53) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/53
2022-01-20 21:43:41 +08:00
4158887d2e (#52) Add EduBase API 2022-01-20 21:42:44 +08:00
a8e16f5972 (#28) Add output data mod 2022-01-20 20:57:41 +08:00
d9825d6d68 (#28)Add a api frame (incomplete file) 2022-01-20 20:38:57 +08:00
fab73f00ab Merge branch 'master' into dev-tamako 2022-01-20 20:33:02 +08:00
edb26b3d8b Merge branch 'dev-tamako' of http://git.mrkbear.com/MrKBear/mini-dlpu-v3 into dev-tamako 2022-01-20 20:31:52 +08:00
443f82ea75 (#28)Add a api frame (incomplete file) 2022-01-20 20:30:36 +08:00
75adb97abb (#28)Add a api frame (incomplete file) 2022-01-20 20:17:32 +08:00
b36996e352 Merge pull request '(#35) Add mask show hide motion' (#50) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/50
2022-01-20 17:20:42 +08:00
6bef08f12e (#35) Add mask show hide motion 2022-01-20 17:18:44 +08:00
1f24a59bd9 Merge pull request '(#48) Core Api baseUrl param can be overridden' (#49) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/49
2022-01-20 16:11:42 +08:00
14d0c9c123 (#48) Core Api baseUrl param can be overridden 2022-01-20 16:10:55 +08:00
b99a3412e2 Merge pull request '(#37) Optimize Account page' (#47) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/47
2022-01-20 13:27:16 +08:00
63300f68f8 (#37) Optimize Account page 2022-01-20 13:26:24 +08:00
acf4f94798 Merge pull request '(#45) Optimize Modular loading performance' (#46) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/46
2022-01-20 11:53:14 +08:00
87f4d220e5 (#45) Optimize Modular loading performance 2022-01-20 11:52:10 +08:00
cf4dd727c5 Merge pull request '(#37) Optimization function list' (#44) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/44
2022-01-19 21:58:20 +08:00
49055e892c (#37) Optimization function list 2022-01-19 21:55:55 +08:00
afedb81633 Merge pull request '(#37) Fix checkmark display' (#43) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/43
2022-01-19 21:22:03 +08:00
04b8bf365f Merge branch 'dev-mrkbear' of http://git.mrkbear.com/MrKBear/mini-dlpu-v3 into dev-mrkbear 2022-01-19 21:21:41 +08:00
874c64829a (#37) Add mask modular 2022-01-19 21:21:21 +08:00
82e1c0941e (#37) Fix checkmark display 2022-01-19 17:38:15 +08:00
3119c862b1 Merge pull request '用户页面实现 #37 dev-sanaesy' (#40) from dev-sanaesy into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/40
2022-01-18 22:34:12 +08:00
23f46a24c9 (#37)Add Function List 2022-01-18 22:30:05 +08:00
fc8aa19c67 Merge 'master' into dev-sanaesy 2022-01-18 21:36:37 +08:00
72448038d1 Merge pull request '用户界面实现(#37)dev-gia_jie' (#41) from dev-gia_jie into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/41
2022-01-18 21:18:46 +08:00
196be3099a (#37)Add main funcion modular 2022-01-18 21:16:08 +08:00
87d33bb1df Merge branch 'master' into dev-gia_jie 2022-01-18 20:32:01 +08:00
efd9b9be57 Merge pull request '(#37)Add icon' (#42) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/42
2022-01-18 20:30:53 +08:00
7dd46dbd15 (#37)Add ok no arrow ICON 2022-01-18 20:11:09 +08:00
d70ead2f77 (#37)Style optimization 2022-01-18 17:56:44 +08:00
95f1f6d484 (#37) 2022-01-18 11:47:25 +08:00
54d87fc5db (#37) 2022-01-18 11:39:15 +08:00
f434ad531c (#37) 2022-01-18 11:06:11 +08:00
gia_jie
3bb47109ed (#37) 2022-01-18 10:44:32 +08:00
84bc1c6fbc Merge pull request '(#37)Mod global image style' (#39) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/39
2022-01-18 08:40:20 +08:00
111
a92f2d06ea (#37) 2022-01-18 00:43:38 +08:00
111
45e8ef9322 (#37) 2022-01-17 23:03:48 +08:00
sanae kochiya
7c1e4e441a (#37) 2022-01-17 22:57:05 +08:00
7a5d43281b Add Schedule Api file 2022-01-17 22:52:51 +08:00
4d3c44be6e (#37)Mod global image style 2022-01-17 22:35:38 +08:00
2b300b83a4 Merge pull request '(#37)Separate Account page into Modular' (#38) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/38
2022-01-17 20:48:07 +08:00
77f9bc5223 Merge branch 'dev-mrkbear' of http://git.mrkbear.com/MrKBear/mini-dlpu-v3 into dev-mrkbear 2022-01-17 20:47:32 +08:00
f4d21f918f (#37)Add account icon 2022-01-17 20:45:58 +08:00
6531a07b26 (#37)Separate Account page into Modular 2022-01-17 17:30:11 +08:00
9dd73138e0 Merge pull request 'Add Login API(#20)' (#34) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/34
2022-01-14 17:09:56 +08:00
3285dba789 Merge branch 'dev-mrkbear' of http://git.mrkbear.com/MrKBear/mini-dlpu-v3 into dev-mrkbear 2022-01-12 17:14:55 +08:00
40dac39ba4 Update ReadMe 2022-01-12 17:14:19 +08:00
ac511387bc Merge branch 'master' into dev-mrkbear 2022-01-12 15:28:21 +08:00
4f83dd6822 Add Login API(#20) 2022-01-12 15:24:59 +08:00
891c9be907 Merge pull request 'Extend core API(#24)' (#33) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/33
2022-01-12 12:00:17 +08:00
478eafa4a3 Extend core API(#24) 2022-01-12 11:53:07 +08:00
67ff1f8c76 Extend core API(#24) 2022-01-11 17:39:51 +08:00
d52ddee947 Merge pull request 'Optimize global styles and add API documentation.' (#23) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/23
2022-01-11 08:45:52 +08:00
1db7507293 App Style 2022-01-04 22:48:21 +08:00
1c3171f1e4 Account page 2022-01-04 17:31:35 +08:00
28d6870a84 Change theme color 2022-01-04 13:57:47 +08:00
b312b2e57b Link API Doc 2022-01-03 17:52:42 +08:00
lyj
5b4842b261 Merge pull request 'Add GNU General Public License v3.0 LICENSE' (#17) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/17
2022-01-03 14:40:20 +08:00
691ac03cfd Merge branch 'master' into dev-mrkbear 2022-01-03 14:38:46 +08:00
5e4c4fdd22 Add GNU General Public License v3.0 LICENSE 2022-01-03 14:30:35 +08:00
de67ab0d68 Merge pull request 'Optimize Storage Modular' (#16) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/16
2022-01-03 13:36:55 +08:00
121b620312 Optimize Modular 2022-01-03 13:32:52 +08:00
49ed8e588a Remove test case 2022-01-03 08:44:39 +08:00
22af68428f Storage multi instance processing logic 2022-01-02 18:29:21 +08:00
4f49012bb6 Update ReadMe file 2021-12-31 17:20:54 +08:00
73563de980 Merge pull request 'Add API wait function, Update ReadMe file' (#15) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/15
2021-12-31 17:18:17 +08:00
eb77678686 Update ReadMe file 2021-12-31 17:17:04 +08:00
fc6fee74b0 Add api wait function 2021-12-31 16:26:57 +08:00
9543fa8409 Motd paprams name 2021-12-31 15:48:46 +08:00
fadbc4dc72 Update ReadMe file 2021-12-31 14:29:34 +08:00
ad4570dae0 Merge branch 'dev-mrkbear' of http://git.mrkbear.com/MrKBear/mini-dlpu-v3 into dev-mrkbear 2021-12-31 14:18:21 +08:00
8d248466eb Update ReadMe file 2021-12-31 14:17:52 +08:00
bfa5ed0e3a Merge pull request 'Rename Emitter Merge Logger into one file.' (#14) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/14
2021-12-31 14:04:31 +08:00
582c8446e2 Merge branch 'master' into dev-mrkbear 2021-12-31 14:03:26 +08:00
0fc0fa932a Rename event emitter to emitter 2021-12-31 13:53:26 +08:00
98f4236c35 Merge Logger Module into one File! 2021-12-31 13:43:23 +08:00
b37977418a Merge pull request 'Add API Module!' (#13) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/13
2021-12-31 11:24:27 +08:00
7a78cf0594 Add API Module! 2021-12-31 11:20:18 +08:00
ben.qin
af68984caa Add API Moudle! 2021-12-30 17:31:16 +08:00
623307ef2b Merge pull request 'Add API Module' (#12) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/12
2021-12-30 16:18:24 +08:00
ben.qin
14b03af584 Modify EventEmitter to class style 2021-12-30 16:14:21 +08:00
c3773a3c71 Add API Module! 2021-12-29 21:03:10 +08:00
ben.qin
0140136a0b Add API Moudle! 2021-12-29 17:33:27 +08:00
41519b78e4 Add API Lib 2021-12-21 07:48:03 +08:00
9b4cfe95a5 Merge pull request 'Add Storage Cacher' (#11) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/11
2021-12-13 19:51:11 +08:00
6937b93517 Add Storage Cacher 2021-12-13 19:49:33 +08:00
e1d4745ecb Merge pull request 'Add README File' (#10) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/10
2021-12-07 16:24:59 +08:00
faa7ed0b0e Add README File 2021-12-07 16:24:09 +08:00
77370eb3eb Merge pull request 'Add StatusBar Modular' (#9) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/9
2021-12-07 15:52:28 +08:00
82f438056e Optimize TopBar style 2021-12-07 15:49:26 +08:00
8d08589b4c Add StatusBar GUI Style 2021-12-02 20:50:04 +08:00
af2d88f651 Add StatusBar Modular Fix some BUG Add LoggerText feature 2021-12-01 21:13:15 +08:00
0528c2865d Merge pull request 'Add EventEmitter into Module, Optimize Manger so that it can load data' (#8) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/8
2021-12-01 16:31:55 +08:00
df10c22a8d Merge branch 'master' into dev-mrkbear 2021-12-01 16:27:52 +08:00
773da154ff Optimize the output of Logger in AddModular 2021-12-01 16:24:47 +08:00
55d52f446f Optimize Manger so that it can load data 2021-12-01 16:14:10 +08:00
da658cb371 Add EventEmitter into Module 2021-12-01 14:04:07 +08:00
ce7d6c74f0 Merge pull request 'Add LifeCycleLogLabel Test Case Modular and Manager, Merge Logger to core' (#7) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/7
2021-12-01 10:55:54 +08:00
7fa3a215cf Add Modular and Manager, merge Logger to core 2021-12-01 10:52:38 +08:00
cea68f5145 Add LifeCycleLogLabel 2021-11-28 16:25:48 +08:00
18b167266d Add test module 2021-11-28 15:03:37 +08:00
84b927a71b Merge pull request 'testgit' (#6) from dev-yzy into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/6
2021-11-27 20:25:45 +08:00
yzy
004ea1895b testgit 2021-11-27 20:22:25 +08:00
0f70998a5f Merge pull request 'Develop logger module' (#5) from dev-mrkbear into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/5
2021-11-27 18:38:24 +08:00
d02cc5db3b Merge branch 'master' into dev-mrkbear 2021-11-27 18:35:26 +08:00
2a85beba68 Merge pull request 'Add CI script dependency' (#4) from dev-lyj into master
Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/4
2021-11-27 18:23:12 +08:00
93d47426d8 Remove the old logger module 2021-11-27 18:20:03 +08:00
cf88f314f1 Separate logger into multiple sub-modules 2021-11-27 18:15:39 +08:00
61 changed files with 6350 additions and 593 deletions

7
.gitignore vendored
View File

@ -12,4 +12,9 @@ $RECYCLE.BIN/
# Node.js
node_modules/
.idea
# wxss
*.wxss
# idea
.idea

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

163
README.md Normal file
View File

@ -0,0 +1,163 @@
# 第三代掌上教务处小程序
掌上教务处作为工业大学的社区开源项目自从2017年开始已有近5年岁月在无数同学的贡献之下为大家打造便捷的校园服务。
__*!!!警告!!!*__
*请在主仓库提交代码,而非镜像仓库!在镜像仓库提交的代码将会在同步时被覆盖!*
主仓库: http://git.mrkbear.com/MrKBear/mini-dlpu-v3
镜像仓库: https://github.com/Mr-k-bear/mini-dlpu-v3
## 目录
- [社区介绍](#小程序社区)
- [项目设计](#第三代小程序)
- [贡献规范](#社区贡献规范)
- [社区福利](#贡献者分配制度)
- [API文档](https://docs.apipost.cn/preview/e737de418d4ef150/419d45d8c97d6a9f)
- [入门文档(等待撰写)](#快速入门)
- [设计架构(等待撰写)](#第三代掌上教务处小程序)
## 小程序社区
掌上教务处小程序诞生于2017年中旬此时微信小程序刚刚公测。
2017年信息学院吴学长因兴趣设计了一款方便课表查询的小工具在班级范围内使用就这样掌上教务处诞生了。
随着大家的好评和认可,小程序使用范围慢慢扩大,从班级到专业到学院,同时,吴学长也面临着越来越大的责任和压力。
正当小程序维护困难之际很多热心的同学为吴学长贡献代码创意UI设计图纸从此"成绩查询"、"考试日程"、"空教室"这样的小功能如雨后春笋,慢慢诞生......
此时,作为大家努力的结晶,小程序开放了源代码。
> PS:
> 哈哈你可能会好奇为什么小程序的LOGO看起来很奇怪其实这个 LOGO 是一个热心的同学在2018年贡献的为了纪念小程序最初的贡献者们一直沿用至今。
毕竟服务器是有成本的,随着用户的增多,吴学长自掏腰包租赁的服务器,已不再能维持小程序流畅运行,小程序再次陷入困境。
这时有其他热心同学,赞助了自己租赁的服务器...
越来越多,越来越多,不愿透露名字的热心人给服务器取了有趣的名字。
就这样,"笔芯"、"妲己"、"猪蹄"、"MOS"...一台台自租赁的服务器支撑起了大家的日常使用。
> PS:
> 如果你愿意考古的话,去看看老版本小程序的切换服务器页面,它们就这样静静的挺拨在那里,为大家默默的服务着...
后来随着开发者们的加入,小程序有了更多的功能、更好的技术、更高的性能。
2019年期间在吴学长、秦学长、梁学长、潘学姐、隋学长以及其他社区贡献者的共同努力下第二代小程序诞生了并更名为"掌上教务处"。
重构后的小程序犹如脱胎换骨性能提高很多倍得到了很多同学的关注用户数量达到19000人。
2020年随着小程序的稳定大家也已经习惯了目前的设计但是小程序仍有部分设计缺陷导致可拓展性降低难以拓展新功能无法和其他商业产品竞争。
老一代社区贡献者们开始逐渐毕业,社区迎来前所未有的空窗期。
社区团队逐渐消退,仅剩梁学长、秦学长在日常爱心维护小程序代码,供大家日常使用。
## 第三代小程序
突破内容:
1. 小程序在技术上突破更高的性能瓶颈
2. 更漂亮的UI和更好的交互体验
3. 更好的拓展性,加入更多大家喜欢的功能
新功能:
1. 正在讨论设计,等待你的建议...
## 社区贡献规范
请仔细阅读!
### 项目贡献流程
请先邮件联系 ```mrkbear@mrkbear.com``` 获得 Gitea 平台账号
在仓库中创建自己的分支,分支命名规范为 ```dev-你的昵称```,例如 ```dev-mrkbear```
克隆此储库,在本地 ```git checkout dev-你的昵称``` 到自己的分支,进行改动。
开发完成后 ```git push``` 到自己的远程分支,并发起合并请求到 ```master``` 分支
发起合并请求时,需要指派给 ```MrKBear``` 进行代码审核,审核通过后,代码将完成合并。
### 注意事项
1. ```master``` 分支处于保护状态,仅通过合并请求进行修改
2. 代码提交时,请使用清晰明确的 ```message```
正例: ```Add timetable page``` 反例: ```阿巴阿巴阿巴阿巴```
3. 请勿将任何个人隐私信息以任何方式,放入代码中
4. 为保证 CI/CD提交代码前必须保证编译可以通过
5. 一个文件不要超过 1000 行代码,尽量保证代码可读性
## 贡献者分配制度
作为公益的开源项目:
第三代开发时,将计划加入一个赞助功能,每个月赞助累计到达一定数额,将在下个月去除开屏广告。
第三代上线后,我们将在每个月公示小程序的账目流水,去除服务器成本和其他费用(微信认证,微信支付,域名,...)后,若有剩余数额将按照开发时大家的贡献分配。
小程序的广告位将计划外包给其他组织管理,我们也会得到一定收入,此收入也将按上面的规则处理。
小程序开屏广告收入也同样按上面的规则处理。
以上内容请大家仔细阅读,另外有意向负责项目财务的同学,处理财务账目也算做贡献。
## 快速入门
下面对大家的小问题进行解答:
> 我在参与贡献之前,我需要先会哪些知识?他们好学吗?
下面列出此项目使用的全部技术,从上到下是推荐学习顺序和学习重点,也是难度顺序:
- HTML
- 标签结构和语法
- CSS
- 基础样式
- 选择器
- 盒模型
- 布局和定位
- 行内元素和块级元素
- JS
- 数据类型
- 基础运算符
- 流程控制语句
- 函数与闭包 (瓶颈)
- 原型和对象 (突破)
- Vue (不用深入了解)
- 组件化设计思想
- 小程序 API
- 了解小程序如何编写页面
- 了解小程序大概的 API
- 不用深入了解,随时查阅
- TypeScript (只要JS数据结构玩的6TS五分钟学会)
- 类型约束
- 接口
- 泛型
- 类型运算
- Sass (拓展了CSS语法实际上没有任何新知识)
- 语法
> 小程序和主流前端技术差别在哪?对我以后职业发展帮助大嘛?
如果你已经掌握了前端主流技术,例如 VueReact那么上手小程序只是 __1__ 天的事情
换句话来说小程序开发用到技术和主流前端技术,有大概 __90%__ 是重叠的。
小程序学了可以成为加分项,参与贡献拥有 __20000__ 人的项目,丰富项目经历,稳赚不亏。
掌上教务处前端项目采用了很多创新的架构设计,虽然不一定优秀,但是一定是值得学习的。
## 贡献者
@MrKBear (熊鲜森)

View File

@ -0,0 +1,95 @@
import { API, IAnyData, GeneralCallbackResult } from "../core/Api";
import { EventType, Emitter } from "../core/Emitter";
type ILoginEvent = {
/**
* session
*/
expire: GeneralCallbackResult;
/**
*
*/
unauthorized: GeneralCallbackResult;
/**
*
*/
error: GeneralCallbackResult;
/**
*
*/
badData: GeneralCallbackResult;
}
/**
* API
* @template I API
* @template O API
* @template E API
* @template U
*/
abstract class EduBase<
I extends IAnyData = IAnyData,
O extends IAnyData = IAnyData,
E extends Record<EventType, any> = {}
> extends API<I, O, {
[P in (keyof ILoginEvent | keyof E)]: P extends keyof ILoginEvent ? ILoginEvent[P] : E[P]
}> {
protected useEduCallback(
parseFunction: (data: any) => O
): void {
this.addFailedCallBack();
this.on("success", (data) => {
let isSuccess = true;
let errMsg = "";
let res: O | undefined;
const info: any = data.data;
// 数据缺失检测
if(!info) {
isSuccess = false;
errMsg = "Bad Data";
(this as Emitter<IAnyData>).emit("badData", { errMsg });
}
if (isSuccess) switch (info.code) {
case (1):
res = parseFunction(info.data);
errMsg = info.err_msg ?? "Success";
(this as Emitter<IAnyData>).emit("ok", res!);
break;
case (2):
isSuccess = false;
errMsg = info.err_msg ?? "Session Expire";
(this as Emitter<IAnyData>).emit("expire", { errMsg });
break;
case (3):
isSuccess = false;
errMsg = info.err_msg ?? "Unauthorized";
(this as Emitter<IAnyData>).emit("unauthorized", { errMsg });
break;
case (4):
isSuccess = false;
errMsg = info.err_msg ?? "Error";
(this as Emitter<IAnyData>).emit("error", { errMsg });
break;
}
if (!isSuccess) (this as Emitter<IAnyData>).emit("no", { errMsg });
(this as Emitter<IAnyData>).emit("done", { errMsg, data: res });
});
}
}
export { EduBase };
export default EduBase;

78
miniprogram/api/Login.ts Normal file
View File

@ -0,0 +1,78 @@
import { HTTPMethod, IParamSetting } from "../core/Api";
import { EduBase } from "./EduBase";
interface ILoginInput {
/**
*
*/
studentId: string;
/**
*
*/
password: string;
}
interface ILoginOutput {
/**
*
*
*/
idCardLast6: string;
/**
* 使
*/
eduService: string;
/**
*
*/
actualName: string;
/**
* session
*/
eduSession: string;
}
/**
* Login API
* API
* session
*/
class Login extends EduBase<ILoginInput, ILoginOutput> {
public override url: string = "/login";
public override method: HTTPMethod = HTTPMethod.POST;
public override params: IParamSetting<ILoginInput> = {
studentId: {
mapKey: "id",
tester: /^\d{8,12}$/,
},
password: {
mapKey: "pwd"
}
};
public constructor() {
super();
this.initDebugLabel("Login");
this.useEduCallback((data) => ({
idCardLast6: data.idCard,
eduService: data.ip,
actualName: data.name,
isSubscribeWxAccount: data.official,
eduSession: data.session
}));
}
}
export { Login, ILoginInput, ILoginOutput };

110
miniprogram/api/Schedule.ts Normal file
View File

@ -0,0 +1,110 @@
import { HTTPMethod, IParamSetting } from "../core/Api";
import { EduBase } from "./EduBase";
interface IScheduleInput {
/**
* session
*/
cookie: string;
/**
*
*/
semester: string;
}
interface IClassData {
/**
*
*/
name: string;
/**
*
*/
room?: string;
/**
*
*/
teacher?: string;
/**
*
*/
week: string;
}
type IScheduleOutput = {
/**
*
*/
classList: IClassData[];
/**
*
*/
index: number;
}[];
/**
* Schedule API
* session与semester
* API
* JSON文件
*/
class Schedlue extends EduBase<IScheduleInput, IScheduleOutput> {
public override url = "/course_timetable";
public override method: HTTPMethod = HTTPMethod.GET;
public override params: IParamSetting<IScheduleInput> = {
cookie: {
mapKey: "cookie",
isHeader: true
},
semester: {
mapKey: "semester",
}
};
public constructor() {
super();
this.initDebugLabel("Schedule");
this.useEduCallback((data) => {
const res: IScheduleOutput = [];
for( let i = 0; i < data.length; i++ ) {
const classList: IClassData[] = [];
const CTTDetails = data[i].CTTDetails ?? [];
for( let j = 0; j < CTTDetails.length; j++ ) {
classList.push({
name: CTTDetails[j].Name,
room: CTTDetails[j].Room,
teacher: CTTDetails[j].Teacher,
week: CTTDetails[j].Week,
})
}
res.push({
classList,
index: data[i].Id
})
}
return res;
});
}
}
export { Schedlue };
export default Schedlue;

View File

@ -0,0 +1,119 @@
$theme-color-blue: #3EA3D8;
$theme-color-red: #FF9393;
$theme-color-light-layout: #F8F8F8;
$theme-color-light-background: #f4f0f1;
$theme-color-light-title: rgba(0, 0, 0, .65);
$theme-color-light-text: rgba(0, 0, 0, .5);
$theme-color-dark-layout: #1f1f1f;
$theme-color-dark-background: #181615;
$theme-color-dark-title: rgba(255, 255, 255, .65);
$theme-color-dark-text: rgba(255, 255, 255, .5);
$black-filter: brightness(0) opacity(.65);
$white-filter: brightness(100) opacity(.65);
$blue-filter: opacity(1);
@mixin container {
width: 88%;
padding: 0 6%;
}
// 页面容器外边距
view.container {
@include container;
}
// 带阴影的 card
view.card {
width: calc( 100% - 40px );
padding: 0 20px;
border-radius: 15px;
background-color: $theme-color-light-layout;
box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, .08),
0 0.3px 0.9px 0 rgba(0, 0, 0, .05);
}
image.icon {
filter: $black-filter;
}
image.icon-sub {
filter: $black-filter;
opacity: .6;
}
// 顶部导航栏阴影
view.top-shadow {
position: fixed;
z-index: 9999;
width: 100%;
height: 10px;
top: -10px;
box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, .05);
}
page {
background-color: $theme-color-light-background;
color: $theme-color-light-text;
}
view, text {
font-size: .97em;
letter-spacing: .1em;
font-family: Hiragino Sans GB, MicroSoft YaHei;
}
view.h1 {
color: $theme-color-light-title;
font-size: 1.5em;
letter-spacing: .1em;
}
view.h2 {
color: $theme-color-light-title;
font-size: 1.3em;
letter-spacing: .1em;
}
view.h3 {
color: $theme-color-light-title;
font-size: 1em;
letter-spacing: .1em;
}
@media (prefers-color-scheme: dark){
page {
background-color: $theme-color-dark-background;
color: $theme-color-dark-text;
}
view.card {
background-color: $theme-color-dark-layout;
}
image.icon {
filter: $white-filter;
}
image.icon-sub {
filter: $white-filter;
}
view.h1 {
color: $theme-color-dark-title;
font-size: 1.2em;
}
view.h2 {
color: $theme-color-dark-title;
font-size: 1.3em;
}
view.h3 {
color: $theme-color-dark-title;
font-size: 1em;
}
}

View File

@ -1,27 +1,29 @@
import {Logger} from "./utils/Logger";
import * as label from "./utils/LogLabel";
import { IAppAPIParam, IAnyData } from "./core/Api";
import { IAppStorageParam, Storage, IStorageData } from "./core/Storage";
import { Logger, LevelLogLabel, LifeCycleLogLabel } from "./core/Logger";
App<IAppOption>({
App<IAppAPIParam & IAppStorageParam & IAnyData>({
/**
*
*/
globalData: {},
/**
* API
* "/core/Api"
*/
api: {
nextId: 1,
pool: new Set()
},
/**
*
*/
onLaunch() {
/**
*
*/
storage: new Map<string, Storage<IStorageData>>(),
Logger.log("hh",
label.FatalLabel,label.ErrorLabel,label.WarnLabel,
label.InfoLabel,label.DebugLabel,label.TraceLabel
);
Logger.logM(
[label.FatalLabel,label.ErrorLabel,label.WarnLabel,
label.InfoLabel,label.DebugLabel,label.TraceLabel], "hh"
);
}
/**
*
*/
onLaunch() {
Logger.log("小程序启动...",
LevelLogLabel.InfoLabel, LifeCycleLogLabel.OnLaunchLabel);
}
})

692
miniprogram/core/Api.ts Normal file
View File

@ -0,0 +1,692 @@
import { Emitter, EventType, EventMixin } from "./Emitter";
import { API_FAILED_SHOW_MESSAGE } from "./Config";
import { Logger, LogLabel, LevelLogLabel, colorRadio, StatusLabel } from "./Logger";
interface IAppAPIParam {
api: {
/**
* API
*/
nextId: number;
/**
*
* API
*/
pool: Set<API<IAnyData, IAnyData>>;
}
}
interface IAnyData {
[x:string]: any
}
type IWxRequestOption<O> = WechatMiniprogram.RequestOption<O>;
type DeepReadonly<T> = {
readonly [P in keyof T]: DeepReadonly<T[P]>;
};
/**
*
*/
type IParamSetting<T extends IAnyData> = {
[P in keyof T]: {
/**
*
*/
mapKey?: string,
/**
*
*/
defaultValue?: T[P],
/**
* ###
* 1 \
* 2使 string === string \
* 3使 number === number \
* 4使
*/
tester?: RegExp | ((data:T[P]) => boolean) | string | number,
/**
* ###
* 1 \
* 2 undefined \
* 3
*
* @param data
* @param key
* @param all
* @returns
*/
parse?: ((data:T[P], key:string, all:DeepReadonly<Partial<T>>) => T[P] | undefined),
/**
*
*/
isHeader?: boolean,
/**
*
*/
isTemplate?: boolean
/**
*
*/
Optional?: boolean
}
}
type SuccessCallbackResult<O extends IAnyData> = WechatMiniprogram.RequestSuccessCallbackResult<O>;
type GeneralCallbackResult = WechatMiniprogram.GeneralCallbackResult;
/**
* API
*/
type IAPIEvent<I extends IAnyData, O extends IAnyData> = {
/**
*
*/
initData: Partial<I>;
/**
*
*/
parseRequestData: Partial<I>;
/**
*
*/
request: IWxRequestOption<O>;
/**
*
*/
success: SuccessCallbackResult<O>;
/**
*
*/
fail: GeneralCallbackResult;
/**
*
*/
complete: GeneralCallbackResult;
}
/**
*
*/
type IAPIResultEvent<O extends IAnyData, U extends IAnyData> = {
/**
*
*/
ok: O,
/**
*
*
*/
no: GeneralCallbackResult & U,
/**
*
*
*/
done: { data?: O } & GeneralCallbackResult & U
}
/**
* API
* @template I API
* @template O API
* @template E API
* @template U
*/
class API<
I extends IAnyData = IAnyData,
O extends IAnyData = IAnyData,
E extends Record<EventType, any> = Record<EventType, any>,
U extends IAnyData = IAnyData
> extends Emitter<EventMixin<IAPIEvent<I, O> & IAPIResultEvent<O, U>, E>> {
/**
*
*/
public static defaultLogLabel:LogLabel = new LogLabel(
`API:API`, colorRadio(200, 120, 222)
);
/**
* URL
* TODO: 这里可能涉及负载均衡
*/
public baseUrl: string = "https://jwc.nogg.cn";
/**
* Logger 使
*/
private LogLabel:LogLabel = API.defaultLogLabel;
/**
* Api ID
*/
public key:string = "API";
/**
* API url
*/
public url:string = "/";
/**
* API
*/
public params:IParamSetting<I> = {} as any;
/**
* API
*/
public data?:Partial<I>;
/**
*
*/
public requestData?:IWxRequestOption<O>;
//#region wx.request
public timeout?:number;
public method:HTTPMethod = HTTPMethod.GET;
public enableHttp2:boolean = false;
public enableQuic:boolean = false;
public enableCache:boolean = false;
/**
* json
* wx.request dataType
*/
public jsonParse:boolean = true;
//#endregion wx.request
/**
*
*/
public initDebugLabel(key: string) {
this.key = key;
this.LogLabel = new LogLabel(
`API:${ this.key }`, colorRadio(200, 120, 222)
);
// 添加 API 生命周期调试事件
this.on("request", (data) => {
Logger.logMultiple(
[LevelLogLabel.InfoLabel, this.LogLabel, StatusLabel.Pending],
`请求发送中: `, data
);
})
this.on("success", (data) => {
Logger.logMultiple(
[LevelLogLabel.InfoLabel, this.LogLabel, StatusLabel.Success],
`请求成功: `, data
);
})
this.on("fail", (data) => {
Logger.logMultiple(
[LevelLogLabel.ErrorLabel, this.LogLabel, StatusLabel.Failed],
`请求失败: `, data.errMsg
);
})
}
/**
*
* data
* @param data API需要的全部数据
*/
public param(data?: Partial<I>):this {
this.data = data;
if (this.data === void 0) {
Logger.log(`数据初始化异常: 没有输入 [data] 数据!`,
LevelLogLabel.ErrorLabel, this.LogLabel);
return this;
}
for (let key in this.params) {
let data = this.data[key];
let { defaultValue, Optional, tester } = this.params[key];
// 默认值赋予
if (data === void 0 && defaultValue !== void 0) {
this.data[key] = defaultValue;
}
// 数据存在测试
if (data === void 0 && !Optional) {
Logger.log(`数据校验异常: 数据 [${key}] 是必须的,但是并没有接收到!`,
LevelLogLabel.ErrorLabel, this.LogLabel);
}
// 用户自定义测试
if (data !== void 0 && tester !== void 0) {
let testRes:boolean = false;
if (tester instanceof RegExp) {
testRes = tester.test(data!);
} else if (typeof tester === "string" || typeof tester === "number") {
testRes = tester === data;
} else if (tester instanceof Function) {
testRes = tester(data!);
} else {
Logger.logMultiple(
[LevelLogLabel.ErrorLabel, this.LogLabel],
`数据校验异常: [${ key }] 参数存在未知类型的 tester:`, tester
);
}
if (!testRes) {
Logger.logMultiple(
[LevelLogLabel.ErrorLabel, this.LogLabel],
`数据校验异常: [${ key }] 参数数据未通过自定义的 tester:`, data
);
}
}
}
// 触发数据初始化事件
(this as Emitter<IAnyData>).emit("initData", this.data);
// 重置请求数据
const requestData:IWxRequestOption<O> = this.requestData = {
url: this.baseUrl + this.url,
data: {}, header: {},
timeout: this.timeout,
method: this.method,
dataType: this.jsonParse ? "json" : undefined,
enableHttp2: this.enableHttp2,
enableQuic: this.enableQuic,
enableCache: this.enableCache
};
// 数据解析
for (let key in this.params) {
let data = this.data[key];
let { parse } = this.params[key];
// 数据预解析
if (parse !== void 0) {
this.data[key] = parse(data!, key, this.data as DeepReadonly<Partial<I>>);
}
}
// 触发数据解析
(this as Emitter<IAnyData>).emit("parseRequestData", this.data);
// 数据收集
for (let key in this.params) {
let data = this.data[key];
let { isHeader, isTemplate, mapKey } = this.params[key];
let useKey = mapKey ?? key;
// 加载数据
if (!isTemplate) {
if (isHeader) {
requestData.header![useKey] = data;
} else {
(requestData.data as IAnyData)[useKey] = data;
}
}
}
return this;
}
/**
*
*/
protected id:number = 0;
/**
*
*/
protected addPool():this {
let app = getApp<IAppAPIParam>();
if (app.api.pool.has(this as any)) {
return this;
}
// 获取标识符
if (!this.id) {
this.id = app.api.nextId;
app.api.nextId ++;
}
app.api.pool.add(this as any);
return this;
}
/**
* pool
*/
protected removePool():this {
let app = getApp<IAppAPIParam>();
app.api.pool.delete(this as any);
return this;
}
/**
*
*/
protected findSameAPI():API<IAnyData, IAnyData> | undefined {
if (this.requestData === void 0) {
Logger.log(`搜索相似请求异常: 没有收集 [requestData] 数据!`,
LevelLogLabel.ErrorLabel, this.LogLabel);
return;
}
let app = getApp<IAppAPIParam>();
let sameAPI:API<IAnyData, IAnyData> | undefined;
// 判断 API 是否相似
app.api.pool.forEach((api) => {
if ((api as API | this) === this) return;
if (!api.requestData) return;
if (api.requestData!.url !== this.requestData!.url) return;
if (api.requestData!.method !== this.requestData!.method) return;
sameAPI = api;
});
return sameAPI;
}
/**
* 使
*/
private isUsed = false;
/**
*
*/
public policy:RequestPolicy = RequestPolicy.RequestAnyway;
/**
* API
*/
public request():this {
if (this.requestData === void 0) {
Logger.log(`请求发送异常: 没有收集 [requestData] 数据!`,
LevelLogLabel.ErrorLabel, this.LogLabel);
return this;
}
if (this.isUsed) {
Logger.log(`请求发送异常: 此实例已经使用过了,请使用新实例操作`,
LevelLogLabel.ErrorLabel, this.LogLabel);
return this;
} else {
this.isUsed = true;
}
// 加入请求池
this.addPool();
// 发起请求
let request = () => {
// 触发请求发送事件
(this as Emitter<IAnyData>).emit("request", this.requestData!)
wx.request<O>({
...this.requestData!,
success: (e) => {
(this as Emitter<IAnyData>).emit("success", e);
},
fail: (e) => {
(this as Emitter<IAnyData>).emit("fail", e);
},
complete: (e) => {
(this as Emitter<IAnyData>).emit("complete", e);
}
});
}
if (this.policy !== RequestPolicy.RequestAnyway) {
let lastAPI = this.findSameAPI();
if (lastAPI) {
// 被上次请求阻止
if (this.policy === RequestPolicy.BlockByLastRequest) {
return this;
}
// 使用上次请求结果
if (this.policy === RequestPolicy.useLastRequest) {
lastAPI.on("success", (e) => {
(this as Emitter<IAnyData>).emit("success", e as SuccessCallbackResult<O>);
(this as Emitter<IAnyData>).emit("complete", {errMsg: e.errMsg});
});
lastAPI.on("fail", (e) => {
(this as Emitter<IAnyData>).emit("fail", e);
(this as Emitter<IAnyData>).emit("complete", {errMsg: e.errMsg});
});
}
// 等待上次请求
if (this.policy === RequestPolicy.waitLastRequest) {
lastAPI.on("success", () => request());
lastAPI.on("fail", () => request());
}
}
} else {
request();
}
// 监听请求完成后,从 pool 中移除,释放内存
this.on("complete", () => {
this.removePool();
})
return this;
}
/**
*
*/
public waitRequest(): Promise<IRespondData<O>>;
public waitRequest(callBack: ICallBack<O>): this;
public waitRequest(callBack?: ICallBack<O>): Promise<IRespondData<O>> | this {
// 存在 callback 使用传统回调
if (callBack) {
callBack.success && this.on("success", callBack.success);
callBack.fail && this.on("fail", callBack.fail);
callBack.complete && this.on("complete", callBack.complete);
return this;
}
// 不存在 callback 使用 Promise 对象
else {
return new Promise((r) => {
this.on("success", r);
this.on("fail", r);
});
}
}
public wait(): Promise<IAPIResultEvent<O, U>["done"]>;
public wait(callBack: IResCallBack<O, U>): this;
public wait(callBack?: IResCallBack<O, U>): Promise<IAPIResultEvent<O, U>["done"]> | this {
// 存在 callback 使用传统回调
if (callBack) {
callBack.ok && this.on("ok", callBack.ok);
callBack.no && this.on("no", callBack.no);
callBack.done && this.on("done", callBack.done);
return this;
}
// 不存在 callback 使用 Promise 对象
else {
return new Promise((r) => {
this.on("done", r);
});
}
}
/**
*
* @param message
* @param mask 使穿
*/
public showLoading(message: string | ((data?: Partial<I>) => string), mask: boolean = false): this {
// 获取标题
let title: string = message instanceof Function ? message(this.data) : message;
this.on("request", () => {
wx.showLoading({
title, mask
})
});
this.on("complete", () => {
wx.hideLoading();
});
return this;
};
/**
*
*/
public showNavigationBarLoading(): this {
this.on("request", () => {
wx.showNavigationBarLoading()
});
this.on("complete", () => {
wx.hideNavigationBarLoading();
});
return this;
}
/**
*
*/
public addFailedCallBack(): this {
this.on("fail", (e) => {
(this as Emitter<IAnyData>).emit("no", e as any);
(this as Emitter<IAnyData>).emit("done", e as any);
});
return this;
}
/**
*
*/
public showFailed(): this {
// 生成随机索引值
let randomIndex = Math.floor(
Math.random() * API_FAILED_SHOW_MESSAGE.length
);
this.on("fail", () => {
wx.showToast({
title: API_FAILED_SHOW_MESSAGE[randomIndex],
icon: "none"
});
});
return this;
};
}
/**
*
*/
type IRespondData<O extends IAnyData> = Partial<IAPIEvent<IAnyData, O>["success"]> & IAPIEvent<IAnyData, O>["fail"];
/**
*
*/
interface ICallBack<O extends IAnyData> {
success?: (data: IAPIEvent<{}, O>["success"]) => any;
fail?: (data: IAPIEvent<{}, O>["fail"]) => any;
complete?: (data: IAPIEvent<{}, O>["complete"]) => any;
}
interface IResCallBack<O extends IAnyData, U extends IAnyData> {
ok?: (data: IAPIResultEvent<O, U>["ok"]) => any;
no?: (data: IAPIResultEvent<O, U>["no"]) => any;
done?: (data: IAPIResultEvent<O, U>["done"]) => any;
}
/**
* Request
*
*/
enum RequestPolicy {
/**
*
*/
RequestAnyway = 1,
/**
*
*
*/
waitLastRequest = 2,
/**
*
*
*
*/
useLastRequest = 3,
/**
*
*
*/
BlockByLastRequest = 4
}
/**
* HTTP
*/
enum HTTPMethod {
OPTIONS = "OPTIONS",
GET = "GET",
HEAD = "HEAD",
POST = "POST",
PUT = "PUT",
DELETE = "DELETE",
TRACE = "TRACE",
CONNECT = "CONNECT"
}
export default API;
export { API, IParamSetting, IAppAPIParam, IAnyData, ICallBack, HTTPMethod, RequestPolicy, GeneralCallbackResult }

View File

@ -10,12 +10,19 @@
*/
export const LOGGER_CONSOLE:boolean = true;
/**
*
*
*
*/
export const LOGGER_STYLE:boolean = true;
/**
*
* LogLabel
*
*
* 1 ||
* 1 ||
* 2 &&
* 3
* 4使 ===
@ -29,3 +36,14 @@ export const LOGGER_FILTER:Array<RegExp | string>[] = [
// 输出警告和错误
// ["WARN", "ERROR", "FATAL"],
];
/**
*
*
*
*/
export const API_FAILED_SHOW_MESSAGE: string[] = [
"失败啦(ó_ò。)", "服务器睡着了", "数据移民火星了",
"数据在半路走丢了", "服务器打了个瞌睡", "服务器被玩坏了",
"服务器在扶老奶奶过马路", "服务器累了", "服务器在拯救世界"
]

277
miniprogram/core/Data.ts Normal file
View File

@ -0,0 +1,277 @@
import { Storage } from "./Storage";
/**
*
*/
interface IDataParamSettingItem {
/**
*
*/
type: any;
/**
*
*/
get?: ((...P: any) => this["type"]) | INone;
/**
*
*/
set?: ((...P: [this["type"], ...any]) => any) | INone;
/**
*
*/
getAsync?: ((...P: any) => Promise<this["type"]>) | INone;
/**
*
*/
setAsync?: ((...P: [this["type"], ...any]) => Promise<any>) | INone;
}
/**
*
*/
interface IDataParamSetting {
[x: string]: IDataParamSettingItem
}
type INone = undefined | void;
/**
*
*/
type IRegistryItem<S extends IDataParamSettingItem> = {
/**
*
*/
get: S["get"];
/**
*
*/
getAsync: S["getAsync"] extends Function ? S["getAsync"] :
S["get"] extends ((...P: any) => S["type"]) ? (...param: Parameters<S["get"]>) => Promise<S["type"]> : INone;
/**
*
*/
set: S["set"];
/**
*
*/
setAsync: S["setAsync"] extends Function ? S["setAsync"] :
S["set"] extends ((...P: [S["type"], ...any]) => any) ? (...param: Parameters<S["set"]>) => Promise<ReturnType<S["set"]>> : INone;
}
/**
*
*/
type IRegistry<D extends IDataParamSetting> = {
[P in keyof D]: IRegistryItem<D[P]>;
}
type IRegistryPartial<D extends IDataParamSetting> = {
[P in keyof D]?: Partial<IRegistryItem<D[P]>>;
}
type IAutoSelect<IF extends boolean, A, B> = IF extends true ? A : B;
/**
* Core
*
* 使
* ```typescript
* class TestData extends Data<{
* test: {
* type: number
* get: () => number,
* set: (val: number) => void,
* getAsync: () => Promise<number>
* }
* }> {
* public onLoad() {
* let dataObject = {key: 1}
* this.getter("test", () => 1);
* this.registerKeyFromObject(dataObject, "test", "key");
* }
* }
* ```
*/
class Data<D extends IDataParamSetting> {
/**
* getter setter
*/
private registryList: IRegistryPartial<D> = {};
/**
*
*/
public onLoad(): any {};
/**
* Setter
* @param key
* @param setter Setter
* @param isAsync
*/
protected setter<KEY extends keyof D> (key: KEY, setter: IRegistryItem<D[KEY]>["set"]): this
protected setter<KEY extends keyof D> (key: KEY, setter: IRegistryItem<D[KEY]>["setAsync"], isAsync: true): this
protected setter<
KEY extends keyof D,
ASYNC extends boolean
> (
key: KEY,
setter: IAutoSelect<ASYNC, IRegistryItem<D[KEY]>["setAsync"], IRegistryItem<D[KEY]>["set"]>,
isAsync?: ASYNC
): this {
// 如果此键值不存在,新建
if (!this.registryList[key]) this.registryList[key] = {};
// 设置异步 setter
if (isAsync) this.registryList[key]!.setAsync = setter as IRegistryItem<D[KEY]>["setAsync"];
// 设置同步 setter
else this.registryList[key]!.set = setter as IRegistryItem<D[KEY]>["set"];
return this;
}
/**
* Getter
* @param key
* @param getter Getter
* @param isAsync
*/
protected getter<KEY extends keyof D> (key: KEY, getter: IRegistryItem<D[KEY]>["get"]): this
protected getter<KEY extends keyof D> (key: KEY, getter: IRegistryItem<D[KEY]>["getAsync"], isAsync: true): this
protected getter<
KEY extends keyof D,
ASYNC extends boolean
> (
key: KEY,
getter: IAutoSelect<ASYNC, IRegistryItem<D[KEY]>["getAsync"], IRegistryItem<D[KEY]>["get"]>,
isAsync?: ASYNC
): this {
// 如果此键值不存在,新建
if (!this.registryList[key]) this.registryList[key] = {};
// 设置异步 getter
if (isAsync) this.registryList[key]!.getAsync = getter as IRegistryItem<D[KEY]>["getAsync"];
// 设置同步 getter
else this.registryList[key]!.get = getter as IRegistryItem<D[KEY]>["get"];
return this;
}
/**
* Data
* @param key Data
* @param keyFromObject
* @param object
*/
protected registerKeyFromObject<
KEY extends keyof D,
F extends string,
O extends {[K in F]: D[KEY]["type"]}
> (object: O, key: KEY, keyFromObject: F = key as any) {
// 注册同步获取
this.getter(key, () => {
return object[keyFromObject]
});
// 注册同步设置
this.setter(key, (data: any) => {
object[keyFromObject] = data
})
}
/**
* Storage key
* @param key Data
* @param keyFromStorage StorageKey
*/
protected registerKeyFromStorage<
KEY extends keyof D,
F extends string,
S extends Storage<{[K in F]: D[KEY]["type"]}>
> (storage: S, key: KEY, keyFromStorage: F = key as any) {
// 同步获取
this.getter(key, () => {
return storage.get(keyFromStorage);
});
// 同步设置
this.setter(key, (data: any) => {
storage.set(keyFromStorage, data);
});
// 异步设置
this.setter(key, (async (data: any) => {
await storage.set(keyFromStorage, data);
}) as any, true);
}
/**
*
* @returns
*/
public export(): IRegistry<D> {
this.autoFillFunction();
return this.registryList as IRegistry<D>;
}
/**
*
*
*
* export
*/
protected autoFillFunction(): void {
// 填充函数
const fillFunction = <KEY extends keyof D>(key: KEY): void => {
const item = this.registryList[key] as IRegistryItem<D[KEY]>;
if (!item) return;
// 检验 getter
if (item.get && !item.getAsync) {
item.getAsync = this.syncFn2AsyncFn(item.get) as any;
}
// 检验 setter
if (item.set && !item.setAsync) {
item.setAsync = this.syncFn2AsyncFn(item.set) as any;
}
}
// 在注册表中查找
for (const key in this.registryList) fillFunction(key);
}
/**
*
* @param fn
*/
protected syncFn2AsyncFn<F extends (...p: any) => any> (fn: F): (...param: Parameters<F>) => ReturnType<F> {
const asyncFn = async (...param: [D]) => {
return fn(...param);
};
return asyncFn as any;
}
}
export { Data };
export default Data;

104
miniprogram/core/Emitter.ts Normal file
View File

@ -0,0 +1,104 @@
export type EventType = string | symbol;
// An event handler can take an optional event argument
// and should not return a value
export type Handler<T = any> = (event: T) => void;
// An array of all currently registered event handlers for a type
export type EventHandlerList<T = any> = Array<Handler<T>>;
// A map of event types and their corresponding event handlers.
export type EventHandlerMap<Events extends Record<EventType, any>> = Map<
keyof Events,
EventHandlerList<Events[keyof Events]>
>;
// Emitter function type
type IEmitParamType<E extends Record<EventType, any>, K extends keyof E> =
E[K] extends ( undefined | void ) ? [type: K] : [type: K, evt: E[K]];
// Mixin to event object
export type EventMixin<A extends Record<EventType, any>, B extends Record<EventType, any>> = {
[P in (keyof A | keyof B)] :
P extends (keyof A & keyof B) ?
A[P] :
P extends keyof A ?
A[P] :
P extends keyof B ? B[P] :
never;
}
export class Emitter<Events extends Record<EventType, any>> {
/**
* A Map of event names to registered handler functions.
*/
public all: EventHandlerMap<Events>;
public constructor() {
this.all = new Map();
}
public resetAll() {
this.all = new Map();
}
public reset<Key extends keyof Events>(type: Key) {
this.all!.set(type, [] as EventHandlerList<Events[keyof Events]>);
}
/**
* Register an event handler for the given type.
* @param {string|symbol} type Type of event to listen for
* @param {Function} handler Function to call in response to given event
* @memberOf mitt
*/
public on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>) {
const handlers: Array<Handler<Events[Key]>> | undefined = this.all!.get(type);
if (handlers) {
handlers.push(handler);
}
else {
this.all!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);
}
}
/**
* Remove an event handler for the given type.
* If `handler` is omitted, all handlers of the given type are removed.
* @param {string|symbol} type Type of event to unregister `handler` from
* @param {Function} [handler] Handler function to remove
* @memberOf mitt
*/
public off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>) {
const handlers: Array<Handler<Events[Key]>> | undefined = this.all!.get(type);
if (handlers) {
if (handler) {
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
}
else {
this.all!.set(type, []);
}
}
}
/**
* Invoke all handlers for the given type.
*
* @param {string|symbol} type The event type to invoke
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
* @memberOf mitt
*/
public emit<Key extends keyof Events>(...param: IEmitParamType<Events, Key>): this {
const [ type, evt ] = param;
let handlers = this.all!.get(type);
if (handlers) {
(handlers as EventHandlerList<Events[keyof Events]>)
.slice()
.map((handler) => {
handler(evt!);
});
}
return this;
}
}

795
miniprogram/core/Logger.ts Normal file
View File

@ -0,0 +1,795 @@
import { LOGGER_FILTER, LOGGER_CONSOLE, LOGGER_STYLE } from "./Config";
/**
*
*/
class LogStyle {
/**
*
*/
private color:string | undefined;
/**
*
*/
private backgroundColor:string | undefined;
/**
*
*/
private weight:string | undefined;
/**
*
*/
private size:string | undefined;
/**
*
*/
private family:string | undefined;
/**
*
*/
private borderRadius:string | undefined;
/**
*
*/
private border:string | undefined;
/**
*
*/
private margin:string | undefined;
/**
*
*/
private padding:string | undefined;
/**
*
* @param color
* @param backgroundColor
*/
public setColor(color?:string, backgroundColor?:string):LogStyle {
this.color = color ?? this.color;
this.backgroundColor = backgroundColor ?? this.backgroundColor;
return this;
}
/**
*
* @param borderRadius
* @param border
*/
public setBorder(borderRadius?:string, border?:string):LogStyle {
this.borderRadius = borderRadius ?? this.borderRadius;
this.border = border ?? this.border;
return this;
}
/**
*
* @param weight
* @param family
*/
public setFont(weight?:string, family?:string):LogStyle {
this.weight = weight ?? this.weight;
this.family = family ?? this.family;
return this;
}
/**
*
* @param size
*/
public setSize(size?:string):LogStyle {
this.size = size ?? this.size;
return this;
}
/**
*
* @param padding
* @param margin
*/
public setBlank(padding?:string, margin?:string):LogStyle {
this.padding = padding ?? this.padding;
this.margin = margin ?? this.margin;
return this;
}
/**
*
*/
public stringify():string {
let stringArr:string[] = [];
this.color && stringArr.push(`color:${ this.color }`);
this.backgroundColor && stringArr.push(`background-color:${ this.backgroundColor }`);
this.weight && stringArr.push(`font-weight:${ this.weight }`);
this.family && stringArr.push(`font-family:${ this.family }`);
this.borderRadius && stringArr.push(`border-radius:${ this.borderRadius }`);
this.border && stringArr.push(`border:${ this.border }`);
this.size && stringArr.push(`font-size:${ this.size }`);
this.padding && stringArr.push(`padding:${ this.padding }`);
this.margin && stringArr.push(`margin:${ this.margin }`);
return stringArr.join(";");
}
/**
* LogStyle
*/
public clone():LogStyle {
return new LogStyle()
.setColor(this.color, this.backgroundColor)
.setBorder(this.borderRadius, this.border)
.setFont(this.weight, this.family)
.setBlank(this.padding, this.margin)
.setSize(this.size)
}
}
/**
*
*/
class LogLabel {
/**
*
*
*/
public key:string;
/**
*
*/
public style:LogStyle;
/**
*
*/
public checked:boolean;
/**
*
*/
public display:boolean;
/**
*
*
*/
public attach:boolean;
/**
* @param key
* @param style
*/
constructor(key:string, style:LogStyle,
checked?:boolean, display?:boolean, attach?:boolean) {
this.key = key;
this.style = style;
this.checked = checked ?? true;
this.display = display ?? true;
this.attach = attach ?? false;
}
/**
* Logger 使
*/
public getLoggerOutput():string {
if(!this.display) return "";
return `%c${ this.key }`;
}
/**
* Text
*/
public getTextOutput():string {
if(!this.display) return "";
return `[${ this.key }]`;
}
/**
* style
*/
public getStyleOutput():string {
if(!this.display) return "";
return this.style.stringify();
}
/**
*
*/
public checking(src:RegExp | string):boolean {
let pass = false;
// 关闭校验
if(!this.checked) return pass;
if(src instanceof RegExp) {
pass = (src as RegExp).test(this.key)
} else {
pass = (src as string) === this.key;
}
return pass;
}
}
/**
*
* log
*/
class MultipleLogContent<T extends Array<any>> {
/**
*
*/
private readonly content:T;
/**
* @param content
*/
public constructor(...content:T) {
this.content = content;
}
/**
*
*/
public getContent():T {
return this.content;
}
}
/**
*
*/
class Logger {
/**
*
*/
public static filterLog(filter:Array<RegExp | string>, labels:LogLabel[]):boolean {
let passNum:number = 0;
for(let i = 0; i < filter.length; i++) {
let pass:boolean = false;
for(let j = 0; j < labels.length; j++) {
pass = labels[j].checking(filter[i]);
if(pass) break;
}
if(pass) passNum ++;
}
return passNum === filter.length;
}
/**
*
* @param labels 使
*/
public static testLog(...labels:LogLabel[]):boolean {
if(!LOGGER_CONSOLE) return false;
let isLogging = false;
for(let i = 0; i < LOGGER_FILTER.length; i++) {
// 判断是否进行输出
isLogging = Logger.filterLog(LOGGER_FILTER[i], labels);
if(isLogging) break;
}
return isLogging;
}
/**
*
* @param labels 使
*/
public static calcStyle(...labels:LogLabel[]):[string[], string[]] {
let consoleLabels:string[] = [];
let consoleStyles:string[] = [];
// 放置标签
for(let i = 0; i < labels.length; i++) {
consoleLabels.push(labels[i].getLoggerOutput());
if (i !== ( labels.length - 1))
consoleLabels.push("%c ");
consoleStyles.push(labels[i].getStyleOutput());
if (i !== ( labels.length - 1))
consoleStyles.push("");
}
return [consoleLabels, consoleStyles];
}
/**
*
* @param labels
*/
public static calcLabel(...labels:LogLabel[]):string[] {
let consoleLabels:string[] = [];
// 放置标签
for(let i = 0; i < labels.length; i++) {
consoleLabels.push(labels[i].getTextOutput());
}
return consoleLabels
}
/**
*
* Log
* @param content
* @param label 使
* @param attachLabel
*/
public static logBase<T extends Array<any>>
(content:MultipleLogContent<T>, labels:LogLabel[], attachLabel:LogLabel[] = []):T {
// TODO: 这里可以添加一些钩子作为中间件处理日志输出
// 测试是否输出内容
if(!Logger.testLog(...labels, ...attachLabel, StackLogLabel.filterUrlLabel))
return content.getContent();
// 过滤出需要渲染的 Labels
let labelsNeedRender:LogLabel[] = [...labels, ...attachLabel].filter((label:LogLabel)=>{
return true
});
// 使用样式输出
if(LOGGER_STYLE) {
// 计算收集样式
let [consoleLabels, consoleStyles]= Logger.calcStyle(...labelsNeedRender);
// 调试输出
console.log(consoleLabels.join(""), ...consoleStyles, ...content.getContent());
} else {
// 计算收集标签
let consoleLabels= Logger.calcLabel(...labelsNeedRender);
// 输出
console.log(consoleLabels.join(" "), ...content.getContent());
}
return content.getContent();
}
/**
*
* @param content
* @param label 使
*/
public static log<T>(content:T, ...labels:LogLabel[]):T {
return Logger.logBase<Array<T>>(
new MultipleLogContent<Array<T>>(content), labels,
[StackLogLabel.fileNameLabel]
)[0];
}
/**
* Logger.log
*/
public static l:typeof Logger.log = Logger.log;
/**
*
* @param labels
* @param content 使
*/
public static logMultiple<T extends Array<any>>(labels:LogLabel[], ...content:T):T {
return Logger.logBase<T>(
new MultipleLogContent<T>(...content), labels,
[StackLogLabel.fileNameLabel]
);
}
/**
* Logger.logMultiple
*/
public static m:typeof Logger.logMultiple = Logger.logMultiple;
/**
*
* @param content
* @param label 使
*/
public static logLine<T>(content:T, ...labels:LogLabel[]):T {
return Logger.logBase<Array<T>>(
new MultipleLogContent<Array<T>>(content), labels,
[StackLogLabel.fileNameLabel, StackLogLabel.blankLabel]
)[0];
}
/**
* Logger.logLine
*/
public static ll:typeof Logger.logLine = Logger.logLine;
/**
*
* @param labels
* @param content 使
*/
public static logLineMultiple<T extends Array<any>>(labels:LogLabel[], ...content:T):T {
return Logger.logBase<T>(
new MultipleLogContent<T>(...content), labels,
[StackLogLabel.fileNameLabel, StackLogLabel.blankLabel]
);
}
/**
* Logger.logLineMultiple
*/
public static lm:typeof Logger.logLineMultiple = Logger.logLineMultiple;
}
/**
*
*/
class StackInfo {
/**
*
*/
public functionName:string | undefined;
/**
*
*/
public fileName:string | undefined;
/**
*
*/
public url:string | undefined;
/**
*
*/
public fileNameLine: string | undefined;
/**
*
* @param functionName
* @param fileName
* @param url
*/
public setInfo(functionName:string, fileNameLine:string, url:string):StackInfo {
this.functionName = functionName;
this.fileNameLine = fileNameLine;
this.url = url;
return this;
}
/**
*
*/
public calcFileName():string | undefined {
let replaceToTs = this.fileNameLine?.replace(".js", ".ts");
let matched = replaceToTs?.match(/^(.+\.(js|ts)):\d+:\d+$/);
return matched ? matched[1] : undefined;
}
/**
*
*/
public calcPathName():string | undefined {
let replaceToTs = this.url?.replace(".js", ".ts");
let matched = replaceToTs?.match(/^https?:\/\/(\d+\.){3}\d+:\d+\/(.+):\d+:\d+$/);
return matched ? matched[2] : undefined;
}
/**
*
*/
public static getCallStack():StackInfo[] {
// 获取堆栈信息
let stack:string | undefined = new Error().stack;
if (stack === void 0) return [];
// 去除 Error
stack = stack.replace(/^(Error)\s/, "");
// 获取堆栈信息
let stackList:string[] = stack.split(/\n/);
let callStack:StackInfo[] = [];
for(let i = 0; i < stackList.length; i++) {
let matcher = stackList[i].match(/^\s+at\s+(.+)\s(\(.+\))/);
if (matcher === null || matcher.length < 3) continue;
let fileName = matcher[2].match(/.+\/(.+\..+:\d+:\d+)\)/);
if (fileName === null || matcher.length < 2) continue;
callStack.push(new StackInfo().setInfo(
matcher[1], fileName[1], matcher[2]?.replace(/(\(|\))/g, "")
))
}
// console.log(callStack);
return callStack;
}
/**
*
*/
public static readonly excludeFile:RegExp = /^.*(\\|\/)core(\\|\/)(.*Log.*).js:\d+:\d+/;
/**
*
*/
public static getFirstStack():StackInfo | undefined {
let callStack = this.getCallStack();
for(let i = 0; i < callStack.length; i++) {
if(!callStack[i].url) continue;
if(!StackInfo.excludeFile.test(callStack[i].url ?? "")) {
return callStack[i];
}
}
return;
}
}
/**
* LogLabel
*/
class StackLogLabel {
/**
*
*/
public static readonly normalStyle:LogStyle = new LogStyle()
.setColor("#979797").setBorder("4px", "1px solid #979797").setBlank("0 5px");
/**
*
*/
public static readonly blankLabel = new LogLabel("\n\r",
new LogStyle(), false, true, true);
/**
* label
*/
public static get fileNameLabel():LogLabel {
// 获得调用堆栈
let stack = StackInfo.getFirstStack();
return new LogLabel(stack?.calcFileName() ?? "Unknown file name",
StackLogLabel.normalStyle, false, true, true);
}
/**
* URL label
*/
public static get urlLabel():LogLabel {
// 获得调用堆栈
let stack = StackInfo.getFirstStack();
return new LogLabel(stack?.calcPathName() ?? "Unknown url",
StackLogLabel.normalStyle, false, true, true);
}
/**
* filter URL label
*/
public static get filterUrlLabel():LogLabel {
// 获得调用堆栈
let stack = StackInfo.getFirstStack();
return new LogLabel(stack?.calcPathName() ?? "Unknown url",
StackLogLabel.normalStyle, true, false, true);
}
}
/**
*
*/
const normalLevelStyleGen = (color:string):LogStyle => {
return new LogStyle().setBorder("4px", `1px solid ${color}`)
.setColor(color).setBlank("0 5px");
}
/**
*
*/
class LevelLogLabel {
/**
*
*/
static readonly FatalLabel = new LogLabel(
"FATAL", normalLevelStyleGen("#FF00CC")
);
/**
*
*/
static readonly ErrorLabel = new LogLabel(
"ERROR", normalLevelStyleGen("#FF0000")
);
/**
*
*/
static readonly WarnLabel = new LogLabel(
"WARN", normalLevelStyleGen("#FF9900")
);
/**
*
*/
static readonly InfoLabel = new LogLabel(
"INFO", normalLevelStyleGen("#99FF00")
);
/**
*
*/
static readonly DebugLabel = new LogLabel(
"DEBUG", normalLevelStyleGen("#00FF99")
);
/**
*
*/
static readonly TraceLabel = new LogLabel(
"TRACE", normalLevelStyleGen("#00CCFF")
);
}
/**
*
*/
const normalLifeStyleGen = (r:number, g:number, b:number):LogStyle => {
return new LogStyle().setBorder("4px", `1px solid rgb(${ r }, ${ g }, ${ b })`)
.setColor(`rgb(${ r }, ${ g }, ${ b })`, `rgba(${ r }, ${ g }, ${ b }, .1)`)
.setBlank("0 5px");
}
/**
*
*/
class LifeCycleLogLabel {
/**
*
*/
static readonly OnLaunchLabel = new LogLabel(
"onLaunch", normalLifeStyleGen(160, 32, 240)
);
/**
* --
*/
static readonly OnLoadLabel = new LogLabel(
"onLoad", normalLifeStyleGen(255, 140, 105)
);
/**
* --
*/
static readonly OnReadyLabel = new LogLabel(
"onReady", normalLifeStyleGen(255, 127, 36)
);
/**
* --
*/
static readonly OnShowLabel = new LogLabel(
"onShow", normalLifeStyleGen(255, 215, 0)
)
/**
* --
*/
static readonly OnHideLabel = new LogLabel(
"onHide", normalLifeStyleGen(173, 255, 47)
);
/**
* --
*/
static readonly OnUnloadLabel = new LogLabel(
"onUnload", normalLifeStyleGen(127, 255, 212)
);
/**
* --
*/
static readonly OnPullDownRefreshLabel = new LogLabel(
"onPullDownRefresh", normalLifeStyleGen(0, 191, 255)
);
/**
*
*/
static readonly OnReachBottomLabel = new LogLabel(
"onReachBottom", normalLifeStyleGen(84, 255, 159)
);
/**
*
*/
static readonly OnShareAppMessageLabel = new LogLabel(
"onShareAppMessage", normalLifeStyleGen(147, 112, 219)
);
}
class StatusLabel {
/**
*
*/
static readonly Pending = new LogLabel(
"◉", new LogStyle().setBlank("0 2px").setBorder("1000px", "1px solid lightblue").setColor("lightblue")
);
/**
*
*/
static readonly Success = new LogLabel(
"√", new LogStyle().setBlank("0 4px").setBorder("1000px", "1px solid lightgreen").setColor("lightgreen")
);
/**
*
*/
static readonly Failed = new LogLabel(
"x", new LogStyle().setBlank("0 4px").setBorder("1000px", "1px solid red").setColor("red")
);
}
const NormalStyle = StackLogLabel.normalStyle;
export default Logger;
export {
Logger, LogLabel, LevelLogLabel, StackLogLabel, LifeCycleLogLabel, LogStyle,
StackInfo, StatusLabel, NormalStyle, normalLifeStyleGen as colorRadio
};

517
miniprogram/core/Module.ts Normal file
View File

@ -0,0 +1,517 @@
import { Emitter } from "./Emitter";
import { Logger, LogLabel, colorRadio, LevelLogLabel } from "./Logger";
/**
*
*/
type IAnyTypeObject<T = any> = {
[x:string]: T;
};
// 微信 Data 类型
type Data<D> = WechatMiniprogram.Page.Data<D>;
// 微信生命周期类型
type ILifetime = WechatMiniprogram.Page.ILifetime;
// 继承的方法
type InstanceMethods<D> = WechatMiniprogram.Page.InstanceMethods<D>;
// 继承的属性
type InstanceProperties = WechatMiniprogram.Page.InstanceProperties;
/**
*
*
* @template TD data
* @template TC MinIn
*
* Partial<ILifetime>
* Partial<Data<TD>> data
* InstanceMethods<TD>
* InstanceProperties
*/
type WXContext<TD, TC> = Partial<ILifetime> & Partial<Data<TD>>
& InstanceMethods<TD> & InstanceProperties & TC;
/**
*
*
* 使
*/
type AnyWXContext = WXContext<IAnyTypeObject, IAnyTypeObject>;
/**
*
* 注意: 这是一个递给类型
* @template M 使 manager
*/
type Depends<M extends Manager<AnyWXContext>> = {
[x:string]: Modular<M, Depends<M>>;
};
/**
*
*/
class WXInstanceMethods<
E extends IAnyTypeObject = IAnyTypeObject,
W extends AnyWXContext = AnyWXContext
>
extends Emitter<E>
implements InstanceMethods<W["data"]> {
public superContext: W;
public constructor(context: W) {
super();
this.superContext = context;
}
public setData(data: Partial<W["data"]> & WechatMiniprogram.IAnyObject, callback?: () => void): void {
return this.superContext.setData(data, callback);
}
public hasBehavior(behavior: string): void {
return this.superContext.hasBehavior(behavior);
}
public triggerEvent<DetailType = any>(name: string, detail?: DetailType, options?: WechatMiniprogram.Component.TriggerEventOption): void {
return this.superContext.triggerEvent(name, detail, options)
}
public createSelectorQuery(): WechatMiniprogram.SelectorQuery {
return this.superContext.createSelectorQuery();
}
public createIntersectionObserver(options: WechatMiniprogram.CreateIntersectionObserverOption): WechatMiniprogram.IntersectionObserver {
return this.superContext.createIntersectionObserver(options);
}
public selectComponent(selector: string): WechatMiniprogram.Component.TrivialInstance {
return this.superContext.selectComponent(selector);
}
public selectAllComponents(selector: string): WechatMiniprogram.Component.TrivialInstance[] {
return this.superContext.selectAllComponents(selector);
}
public selectOwnerComponent(): WechatMiniprogram.Component.TrivialInstance {
return this.superContext.selectOwnerComponent();
}
public getRelationNodes(relationKey: string): WechatMiniprogram.Component.TrivialInstance[] {
return this.superContext.getRelationNodes(relationKey);
}
public groupSetData(callback?: () => void): void {
return this.superContext.groupSetData(callback);
}
public getTabBar(): WechatMiniprogram.Component.TrivialInstance {
return this.superContext.getTabBar();
}
public getPageId(): string {
return this.superContext.getPageId();
}
public animate(selector: string, keyFrames: WechatMiniprogram.Component.KeyFrame[], duration: number, callback?: () => void): void;
public animate(selector: string, keyFrames: WechatMiniprogram.Component.ScrollTimelineKeyframe[], duration: number,
scrollTimeline: WechatMiniprogram.Component.ScrollTimelineOption): void;
public animate(selector: any, keyFrames: any, duration: any, scrollTimeline?: any): void {
return this.superContext.animate(selector, keyFrames, duration, scrollTimeline);
}
public clearAnimation(selector: string, callback: () => void): void;
public clearAnimation(selector: string, options?: WechatMiniprogram.Component.ClearAnimationOptions, callback?: () => void): void;
public clearAnimation(selector: any, options?: any, callback?: any): void {
return this.superContext.clearAnimation(selector, options, callback);
}
public getOpenerEventChannel(): WechatMiniprogram.EventChannel {
return this.superContext.getOpenerEventChannel();
}
}
/**
*
*/
class WXInstanceProperties<
E extends IAnyTypeObject = IAnyTypeObject,
W extends AnyWXContext = AnyWXContext
>
extends WXInstanceMethods<E, W>
implements InstanceProperties {
public override superContext: W;
constructor(context: W) {
super(context);
this.superContext = context;
}
public get is(): string { return this.superContext.is };
public get route(): string { return this.superContext.route };
public get options(): Record<string, string | undefined> { return this.superContext.options };
}
class WXILifetime<
E extends IAnyTypeObject = IAnyTypeObject,
W extends AnyWXContext = AnyWXContext
>
extends WXInstanceProperties<E, W>
implements ILifetime {
public onLoad(query: Record<string, string | undefined>): void | Promise<void> {};
public onShow(): void | Promise<void> {};
public onReady(): void | Promise<void> {};
public onHide(): void | Promise<void> {};
public onUnload(): void | Promise<void> {};
public onPullDownRefresh(): void | Promise<void> {};
public onReachBottom(): void | Promise<void> {};
public onShareAppMessage(options: WechatMiniprogram.Page.IShareAppMessageOption): void | WechatMiniprogram.Page.ICustomShareContent {};
public onShareTimeline(): void | WechatMiniprogram.Page.ICustomTimelineContent {};
public onPageScroll(options: WechatMiniprogram.Page.IPageScrollOption): void | Promise<void> {};
public onTabItemTap(options: WechatMiniprogram.Page.ITabItemTapOption): void | Promise<void> {};
public onResize(options: WechatMiniprogram.Page.IResizeOption): void | Promise<void> {};
public onAddToFavorites(options: WechatMiniprogram.Page.IAddToFavoritesOption): WechatMiniprogram.Page.IAddToFavoritesContent {
return {};
};
}
/**
*
* @template M Manager
* @template DEP
* @template E
* @template TD Data
*/
class Modular<
M extends Manager<AnyWXContext> = Manager<AnyWXContext>,
DEP extends Depends<M> = Depends<M>,
E extends IAnyTypeObject = IAnyTypeObject,
TD extends IAnyTypeObject = IAnyTypeObject
>
extends WXILifetime<E, M["context"]>
implements WXContext<TD, IAnyTypeObject> {
// [x:string]: any;
/**
*
*/
private manager:M;
/**
* Manager
*/
private get context():M["context"] {
return this.manager.context;
}
/**
*
*/
protected depends?:DEP
/**
*
*/
public data?:TD;
/**
* 使
*/
public functionList:Set<string>;
/**
* 使
*/
public paramList:Set<string>;
/**
*
*/
public nameSpace:string;
/**
*
*
* @param manager
* @param nameSpace
* @param depend
*/
public constructor(manager:M, nameSpace:string, depend?: DEP) {
super(manager.context);
// 保存微信上下文
this.manager = manager;
// 保存模块依赖
this.depends = depend;
// 初始化内部属性
this.functionList = new Set<string>();
this.paramList = new Set<string>();
this.nameSpace = nameSpace;
}
public override setData(data:Partial<TD>, callback?: () => void):void {
if(this.data === void 0) {
this.data = {} as TD;
}
let reportData:IAnyTypeObject = {};
for(let key in data) {
(this.data as IAnyTypeObject)[key] = data[key];
reportData[`${ this.nameSpace }$${ key }`] = data[key];
this.paramList.add(key);
}
return this.context.setData(reportData, callback);
}
/**
*
* @param fn
* @param name
*/
public setFunc(fn:Function, name:string):void {
this.functionList.add(name);
(this.context as IAnyTypeObject)
[`${ this.nameSpace }$${ name }`] = fn.bind(this);
}
}
/**
*
*
*/
class Manager<WXC extends AnyWXContext = AnyWXContext> {
/**
*
*/
static readonly WxLifeCycle:(keyof ILifetime)[] = [
"onShow", "onReady", "onHide", "onUnload", "onPullDownRefresh", "onReachBottom",
"onShareAppMessage", "onShareTimeline","onAddToFavorites","onPageScroll", "onResize", "onTabItemTap"
];
/**
*
*/
public context:WXC;
/**
*
*
*/
public constructor(context:WXC) {
// 保存微信上下文
this.context = context;
// 初始化模组列表
this.modules = [];
}
/**
*
*/
public modules:Modular[];
/**
*
* @param mode
* @param nameSpace
* @param depend
* @returns
*/
public addModule<DEP extends Depends<this>, M extends Modular<this, DEP>> (
mode: new (manager:this, nameSpace:string, depend?:DEP) => M,
nameSpace:string, depend?:DEP
):M {
let mod = new mode(this, nameSpace, depend);
this.modules.push(mod);
return mod;
}
/**
*
* @param key
*/
public creatHooks<Key extends keyof ILifetime>(key: Key): ILifetime[Key] {
let hook = (async (...arg: any[]) => {
let hooks:Promise<any>[] = [];
for(let i = 0; i < this.modules.length; i++) {
let fn:Function = this.modules[i][key];
if(fn === void 0) continue;
let res: Promise<any> | any = fn.apply(this.modules[i], arg);
if (res instanceof Promise) {
hooks.push(res);
} else {
hooks.push(Promise.resolve(res));
}
}
if (
key === "onShareAppMessage" ||
key === "onShareTimeline" ||
key === "onAddToFavorites"
) {
// 如果返回值有特殊含义在处理时进行 MinIn
return Promise.all(hooks).then((res) => {
let simple:IAnyTypeObject = {};
for(let i = 0; i < res.length; i++) {
simple = Object.assign({}, simple, res);
}
return Promise.resolve(simple);
})
}
return Promise.all(hooks);
});
// TODO: 此处为,关键位置,容易出错,请再次检查
return (hook as any);
}
/**
*
*/
public creatAllHooks() {
for(let i = 0; i < Manager.WxLifeCycle.length; i++) {
(this.context as IAnyTypeObject)[Manager.WxLifeCycle[i]] =
this.creatHooks(Manager.WxLifeCycle[i]);
}
}
/**
*
* @param query onLoad
*/
public loadAllModule(query:Record<string, string | undefined>) {
// 创建全部钩子
this.creatAllHooks();
// 加载全部模组数据
for(let i = 0; i < this.modules.length; i++) {
if(this.modules[i].data)
for(let key in this.modules[i].data) {
if(this.context.data === void 0) this.context.data = {};
if(this.modules[i].data !== void 0) {
this.context.data[`${ this.modules[i].nameSpace }$${ key }`] =
( this.modules[i].data as IAnyTypeObject )[key];
this.modules[i].paramList.add(key);
}
}
}
// 将全部数据发布到视图层
if(this.context.data !== void 0)
this.context.setData(this.context.data);
// 调用全部模块的 onLoad 周期
let res = this.creatHooks("onLoad")(query);
// 打印每个模块的键值对使用情况
for(let i = 0; i < this.modules.length; i++) {
let data:string[] = [];
let func:string[] = [];
for(let key of this.modules[i].paramList) {
data.push(`[${ key }]`);
}
for(let key of this.modules[i].functionList) {
func.push(`[${ key }]`);
}
let log:string = `模块 [${ this.modules[i].nameSpace }] 完成绑定...\n`;
if(data.length > 0) log += `Using Props: ${ data.join(", ") }\n`;
if(func.length > 0) log += `Using Function: ${ func.join(", ") }\n`;
Logger.log(log, LevelLogLabel.InfoLabel, Manager.AddModuleLabel);
}
return res;
}
/**
*
*/
public static readonly AddModuleLabel = new LogLabel(
"addModule",
colorRadio(54, 0, 255)
)
/**
* Manager
* @param fn
*/
public static Page(fn:(manager:Manager<AnyWXContext>) => void) {
Page({
async onLoad(query) {
let manager = new Manager(this);
fn(manager);
manager.loadAllModule(query);
}
})
}
/**
*
*
* **
* loadAllModule
* loadAllModule Modular
*
*/
public static async PageAsync(): Promise<{
manager: Manager<AnyWXContext>,
query: Record<string, string | undefined>
}> {
return new Promise((solve) => {
Page({
async onLoad(query) {
let manager = new Manager(this);
await solve({ manager, query });
}
})
});
}
}
export { Manager, Modular, AnyWXContext, WXContext, ILifetime}

270
miniprogram/core/Storage.ts Normal file
View File

@ -0,0 +1,270 @@
import { Logger, LogLabel, LevelLogLabel, colorRadio } from "./Logger";
interface IAppStorageParam {
/**
* storage
*/
storage: Map<string, Storage<IStorageData>>
}
/**
*
*/
enum StorageState {
/**
* waiter
*/
WORK = 1,
/**
* waiter
*/
DONE = 2
}
/**
*
*/
class Waiter {
/**
*
*/
public get state():StorageState {
if(this.waiterList.length <= 0) {
return StorageState.DONE;
} else {
return StorageState.WORK;
}
}
/**
*
*/
private waiterList:Function[] = [];
/**
*
* @param fn
*/
public addWaiter(fn:Function) {
this.waiterList.push(fn);
}
/**
*
* waiterList
* waiterList
*/
public done():Function {
// 复制 waiterList 生成闭包
let fnList = this.waiterList.concat([]);
let runAllWaiter = () => {
for(let i = 0; i < fnList.length; i++) {
fnList[i]();
}
}
this.waiterList = [];
return runAllWaiter;
}
}
/**
*
*/
type IStorageData = {
[x:string]:any
}
/**
*
* @template T
*
*
* 1. wxStorage
* 2.
* 3. 使
* 4. storage
*
*/
class Storage<T extends IStorageData> {
/**
* Logger 使
*/
public StorageLogLabel:LogLabel;
/**
*
*/
public key:string;
/**
*
*/
private readonly defaultData:T;
/**
*
*/
private _cache: T = {} as T;
private set cache(data: T) {
if (this.cacheStorage) {
for (const key in data) {
this.cacheStorage.cache[key] = data[key];
}
} else {
for (const key in data) {
this._cache[key] = data[key];
}
}
}
private get cache():T {
if (this.cacheStorage) return this.cacheStorage.cache;
else return this._cache;
}
/**
* cache storage
*/
private saveWaiter:Waiter = new Waiter();
/**
*
*/
private cacheStorage:Storage<T> | undefined;
/**
* cache storage
*/
public async save():Promise<void> {
// 如果存在链接的实例
if (this.cacheStorage) return this.cacheStorage.save();
// 如果没有开始存储
// 发起一次异步读取
if(this.saveWaiter.state === StorageState.DONE)
setTimeout(() => {
// 获取函数绑定列表
let fnList = this.saveWaiter.done();
wx.setStorage<T>({
key: this.key,
data: this.cache,
success: (data) => {
Logger.log(`数据保存成功! errMsg: ${ data.errMsg }`,
LevelLogLabel.InfoLabel, this.StorageLogLabel);
},
fail: (data) => {
Logger.log(`数据保存失败! errMsg: ${ data.errMsg }`,
LevelLogLabel.FatalLabel, this.StorageLogLabel);
},
complete: () => {
fnList();
}
});
});
return new Promise((r) => {
// 加入等待队列
this.saveWaiter.addWaiter(r);
});
}
/**
*
*/
private findStorageCache(): boolean {
let { storage: storageMap } = getApp<IAppStorageParam>();
// 查找缓存
let storage = storageMap.get(this.key);
if (storage) {
this.cacheStorage = storage as Storage<T>;
return true;
};
// 缓存此实例
storageMap.set(this.key, this);
return false;
}
/**
*
*/
public async reset() {
this.cache = this.defaultData;
Logger.logMultiple([LevelLogLabel.InfoLabel, this.StorageLogLabel],
`正在重置为默认数据... 数据内容:\n`, this.cache
);
return this.save();
}
/**
* @param defaultData
*/
public constructor(key:string, defaultData?:T) {
this.key = key;
this.defaultData = defaultData ?? {} as T;
this.StorageLogLabel = new LogLabel(
`Storage:${ this.key }`, colorRadio(34, 230, 258)
);
// 如果已找到其他实力,将此实例链接到目标实例
if (this.findStorageCache()) {
// 设置默认值
for (const key in this.defaultData) {
if (this.cache[key] === void 0) {
this.set(key, this.defaultData[key]);
}
}
return;
};
// 读取数据到缓存
this.cache = wx.getStorageSync<T>(this.key);
// 使用默认值
if(!this.cache) {
Logger.log(`找不到 Storage 数据!`,
LevelLogLabel.InfoLabel, this.StorageLogLabel);
this.reset();
} else {
Logger.logMultiple([LevelLogLabel.InfoLabel, this.StorageLogLabel],
`数据成功从 Storage 读取, 数据内容:\n`, this.cache
);
}
}
/**
*
* @param key
*/
public get<M extends keyof T>(key:M):T[M] {
return this.cache[key];
}
/**
*
* @param key
*/
public async set<M extends keyof T>(key:M, value:T[M]):Promise<void> {
this.cache[key] = value;
return this.save();
}
}
export default Storage;
export { Storage, StorageState, Waiter, IAppStorageParam, IStorageData };

View File

@ -0,0 +1,154 @@
import { Data } from "../core/Data";
import { Storage } from "../core/Storage";
import { Login, ILoginOutput } from "../api/Login";
/**
*
*/
enum LoginStatus {
/**
*
*/
verified = 1,
/**
*
*
*/
invalid = 2,
/**
*
*/
none = 3
}
/**
* API
*/
type ILoginApiData = {
[P in keyof ILoginOutput]: {
type: ILoginOutput[P];
getAsync: () => Promise<ILoginOutput[P]>;
}
}
/**
* Storage
*/
type IStudentInfoStorageData = ILoginOutput & {
[P in keyof IStudentInfoData]: IStudentInfoData[P]["type"];
};
/**
*
*/
type IStudentInfoData = {
/**
*
*/
studentId: {
type: string,
};
/**
*
*/
password: {
type: string
};
/**
*
*/
loginStatus: {
type: LoginStatus
}
/**
*
*
*/
lastLoginTime: {
type: number
}
/**
*
*
*/
isUserInfoChange: {
type: boolean
}
}
/**
*
*/
class StudentInfo extends Data<IStudentInfoData & ILoginApiData> {
/**
*
*/
private eduStorage = new Storage<IStudentInfoStorageData>("StudentInfo", {
idCardLast6: "",
eduService: "",
actualName: "",
eduSession: "",
studentId: "",
password: "",
loginStatus: LoginStatus.none,
lastLoginTime: 0,
isUserInfoChange: false
});
public override onLoad() {
}
/**
*
*/
private async login(): Promise<boolean> {
// 获取账号密码
const stuId = this.eduStorage.get("studentId");
const pwd = this.eduStorage.get("password");
if (!stuId || !pwd) return false;
// 发送请求
const data = await new Login().param({
studentId: stuId,
password: pwd
}).request().wait();
// 请求成功
let res = data.data;
if (res) {
// 保存数据
this.eduStorage.set("actualName", res.actualName);
this.eduStorage.set("eduService", res.eduService);
this.eduStorage.set("eduSession", res.eduSession);
this.eduStorage.set("idCardLast6", res.idCardLast6);
// 记录时间
this.eduStorage.set("lastLoginTime", new Date().getTime());
return true;
} else {
return false;
}
}
/**
*
*/
private async getStatus() {}
}
export { StudentInfo };
export default StudentInfo;

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000076592718380360388780000014023029871415092396_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M50,9.8c0.55,0,0.75,0.35,0.82,0.49l9.71,17.69c2.16,3.93,5.93,6.67,10.34,7.51l19.83,3.77
c0.15,0.02,0.55,0.11,0.71,0.63c0.18,0.53-0.11,0.82-0.21,0.94L77.37,55.51c-3.08,3.26-4.52,7.7-3.95,12.16l2.55,20.02
c0.02,0.21,0.02,0.46-0.2,0.71c-0.19,0.22-0.47,0.35-0.73,0.35c-0.13,0-0.26-0.03-0.41-0.11l-18.25-8.61
c-1.99-0.94-4.2-1.43-6.39-1.43c-2.2,0-4.4,0.49-6.39,1.43l-18.25,8.61c-0.15,0.07-0.28,0.11-0.41,0.11
c-0.26,0-0.53-0.14-0.73-0.35c-0.22-0.26-0.23-0.5-0.2-0.71l2.55-20.02c0.56-4.46-0.88-8.88-3.95-12.16L8.79,40.82
c-0.11-0.11-0.37-0.4-0.21-0.94c0.18-0.53,0.56-0.6,0.71-0.63l19.83-3.77c4.41-0.84,8.18-3.58,10.34-7.51l9.71-17.69
C49.25,10.15,49.45,9.8,50,9.8 M50,2.78c-2.74,0-5.47,1.38-6.97,4.13L33.31,24.6c-1.15,2.08-3.16,3.55-5.49,3.99L7.99,32.36
c-6.17,1.17-8.61,8.69-4.31,13.27l13.83,14.7c1.63,1.73,2.4,4.1,2.09,6.46L17.06,86.8c-0.63,5,3.36,8.97,7.89,8.97
c1.12,0,2.27-0.25,3.41-0.77l18.25-8.61c1.08-0.5,2.24-0.76,3.39-0.76c1.16,0,2.32,0.26,3.39,0.76l18.25,8.61
c1.12,0.53,2.28,0.77,3.4,0.77c4.53,0,8.52-3.98,7.89-8.97l-2.55-20.02c-0.3-2.35,0.47-4.73,2.09-6.46l13.83-14.7
c4.31-4.58,1.86-12.1-4.31-13.27l-19.83-3.77c-2.34-0.44-4.35-1.91-5.49-3.99L56.97,6.91C55.46,4.15,52.74,2.78,50,2.78L50,2.78z
M50,2.78"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000148643560888163687730000014354677953684036249_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<polyline class="st19" points="17.39,10.88 83.65,50 17.39,89.12 "/>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000126323571291076155810000009424538536835319964_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M58.58,71.91l25.74-14.13v-6.52L58.58,65.39V71.91z M15.68,57.78l25.74,14.13v-6.52L15.68,51.26V57.78z
M15.68,57.78"/>
<path class="st2" d="M90.04,19.77L55.72,2.5c-3.54-2.04-7.9-2.04-11.44,0L9.96,19.86c-3.53,2.04-5.71,5.8-5.72,9.87v40.76
c-0.02,4.1,2.17,7.9,5.72,9.95L44.28,97.6c1.77,1.05,3.8,1.61,5.86,1.6c1.95,0.04,3.87-0.44,5.58-1.37l34.32-17.48
c3.53-2.04,5.71-5.8,5.72-9.87V29.73C95.78,25.62,93.6,21.82,90.04,19.77L90.04,19.77z M12.82,24.86L47.14,7.42
C48.01,6.91,49,6.65,50,6.64c1.09,0,2.16,0.29,3.09,0.86l34.32,17.16c0.52,0.34,1,0.75,1.4,1.23L50,47.23L11.33,26.01
c0.36-0.45,0.79-0.84,1.29-1.14H12.82z M12.82,75.43c-1.77-1.02-2.86-2.91-2.86-4.95v-38.7l37.18,20.28v40.62h-0.2L12.82,75.43z
M90.04,70.48c0,1.96-1,3.78-2.66,4.83L52.86,92.79V52.06l37.18-20.39V70.48z M90.04,70.48"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000134231879972232262860000003624220645597976985_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M85.76,9.77h-14.9V6.79c0-1.65-1.33-2.98-2.98-2.98c-1.65,0-2.98,1.33-2.98,2.98v2.98H35.1V6.79
c0-1.65-1.33-2.98-2.98-2.98c-1.65,0-2.98,1.33-2.98,2.98v2.98h-14.9c-3.16,0-6.19,1.26-8.43,3.49c-2.24,2.24-3.49,5.27-3.49,8.43
v62.58c0,3.16,1.26,6.19,3.49,8.43c2.24,2.24,5.27,3.49,8.43,3.49h71.52c3.16,0,6.19-1.26,8.43-3.49
c2.24-2.24,3.49-5.27,3.49-8.43V21.69c0-3.16-1.26-6.19-3.49-8.43C91.96,11.02,88.92,9.77,85.76,9.77L85.76,9.77z M8.28,21.69
c0-1.58,0.63-3.1,1.75-4.21c1.12-1.12,2.63-1.75,4.21-1.75h14.9v2.98c0,1.65,1.33,2.98,2.98,2.98c1.65,0,2.98-1.33,2.98-2.98
v-2.98h29.8v2.98c0,1.65,1.33,2.98,2.98,2.98c1.65,0,2.98-1.33,2.98-2.98v-2.98h14.9c3.29,0,5.96,2.67,5.96,5.96v8.94H8.28V21.69z
M91.72,84.27c0,3.29-2.67,5.96-5.96,5.96H14.24c-3.29,0-5.96-2.67-5.96-5.96V36.59h83.45V84.27z M91.72,84.27"/>
<path class="st2" d="M23.18,54.47h17.88c1.65,0,2.98-1.33,2.98-2.98s-1.33-2.98-2.98-2.98H23.18c-1.65,0-2.98,1.33-2.98,2.98
S21.53,54.47,23.18,54.47L23.18,54.47z M23.18,72.35h17.88c1.65,0,2.98-1.33,2.98-2.98c0-1.65-1.33-2.98-2.98-2.98H23.18
c-1.65,0-2.98,1.33-2.98,2.98C20.2,71.02,21.53,72.35,23.18,72.35L23.18,72.35z M58.94,54.47h17.88c1.65,0,2.98-1.33,2.98-2.98
s-1.33-2.98-2.98-2.98H58.94c-1.65,0-2.98,1.33-2.98,2.98S57.3,54.47,58.94,54.47L58.94,54.47z M58.94,72.35h17.88
c1.65,0,2.98-1.33,2.98-2.98c0-1.65-1.33-2.98-2.98-2.98H58.94c-1.65,0-2.98,1.33-2.98,2.98C55.96,71.02,57.3,72.35,58.94,72.35
L58.94,72.35z M58.94,72.35"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 210 210" style="enable-background:new 0 0 210 210;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000119800197593363267330000003343045337348892552_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
</g>
<g id="DEFAULT_x5F_AVATOR">
<circle class="st17" cx="105" cy="105" r="105"/>
<circle class="st2" cx="105" cy="79.22" r="36.19"/>
<path class="st2" d="M171.07,166.47c0,9.46-2.94,18.35-8.1,26.09C146.36,203.58,126.43,210,105,210s-41.36-6.42-57.97-17.44
c-5.16-7.74-8.1-16.63-8.1-26.09c0-0.38,0-0.75,0.02-1.12c-0.01-0.04,0-0.08,0-0.11c0.04-1.46,0.14-2.9,0.32-4.33
c0-0.02,0.01-0.05,0.01-0.08c3.43-17.58,31.54-31.28,65.72-31.28s62.29,13.7,65.72,31.28c0,0.03,0.01,0.06,0.01,0.08
c0.18,1.43,0.28,2.87,0.32,4.33c0,0.03,0.01,0.07,0,0.11C171.07,165.72,171.07,166.09,171.07,166.47z"/>
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000182508922549869638690000002743709010317845661_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M50,10.66c5.29,0,10.41,1.03,15.22,3.08c4.66,1.97,8.85,4.79,12.44,8.38c3.59,3.59,6.42,7.78,8.38,12.44
c2.04,4.82,3.08,9.95,3.08,15.22c0,5.28-1.03,10.41-3.08,15.22c-1.97,4.66-4.79,8.85-8.38,12.44c-3.59,3.59-7.78,6.42-12.44,8.38
c-4.82,2.04-9.95,3.08-15.22,3.08c-5.28,0-10.41-1.03-15.22-3.08c-4.66-1.97-8.85-4.79-12.44-8.38
c-3.59-3.59-6.42-7.78-8.38-12.44c-2.04-4.82-3.08-9.95-3.08-15.22c0-5.28,1.03-10.41,3.08-15.22c1.97-4.66,4.79-8.85,8.38-12.44
c3.59-3.59,7.78-6.42,12.44-8.38C39.59,11.69,44.71,10.66,50,10.66 M50,4.61c-24.95,0-45.18,20.23-45.18,45.18
S25.05,94.96,50,94.96s45.18-20.23,45.18-45.18S74.95,4.61,50,4.61L50,4.61z M50,4.61"/>
<path class="st2" d="M64.78,35l-7.16,19.92c-0.41,1.16-1.32,2.06-2.48,2.47l-19.92,7.17l7.16-19.92c0.41-1.16,1.32-2.06,2.48-2.47
L64.78,35 M67.32,27.94c-0.5,0-1.03,0.09-1.53,0.27l-22.98,8.27c-2.85,1.03-5.1,3.27-6.12,6.12l-8.27,22.98
c-0.35,0.99-0.35,2.07,0,3.07c0.67,1.85,2.4,2.99,4.25,2.99c0.5,0,1.03-0.09,1.53-0.27l22.98-8.27c2.86-1.03,5.09-3.27,6.12-6.12
l8.27-22.98c0.35-0.99,0.35-2.07,0-3.07C70.91,29.08,69.18,27.94,67.32,27.94L67.32,27.94z M67.32,27.94"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000174590641328129768410000008888487617591348397_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<line class="st19" x1="10.88" y1="10.88" x2="89.12" y2="89.12"/>
<line class="st19" x1="89.12" y1="10.88" x2="10.88" y2="89.12"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000000193655916124849200000001531564748471850152_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<polyline class="st19" points="12.24,59.77 40.71,91.76 87.76,8.24 "/>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000089549096524624138190000001993487473804585391_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M51.82,18.46c0.22,0,0.53,0.12,0.81,0.44c0,0.02,0.01,0.05,0.01,0.06v62.07c0,0.18-0.27,0.47-0.67,0.47
c-0.14,0-0.23-0.01-0.26-0.02l-0.09-0.05l-0.12-0.06l-14.95-8.83c-3.32-1.98-6.95-2.98-10.78-2.98h-9.97
c-4.1,0-7.44-3.17-7.44-7.05V38.05c0-3.22,2.85-5.84,6.37-5.84h8.61c3.81,0,7.54-1.04,10.79-3.03h0.02l15.71-9.65h0.01l1.56-0.96
C51.57,18.51,51.69,18.46,51.82,18.46 M51.82,12c-1.28,0-2.57,0.34-3.77,1.08h-0.01L30.75,23.65c-2.24,1.37-4.8,2.08-7.43,2.08
h-8.59c-7.13,0-12.83,5.55-12.83,12.3v24.45C1.9,69.93,8.14,76,15.81,76h9.97c2.67,0,5.16,0.69,7.49,2.08l14.96,8.84
c1.08,0.7,2.32,1.04,3.74,1.04c3.92,0,7.13-3.12,7.13-6.94V18.97c0-1.21-0.36-2.61-1.08-3.64C56.52,13.2,54.19,12,51.82,12
L51.82,12z M94.55,46.53H73.17c-1.94-0.02-3.53,1.53-3.56,3.47c0,1.91,1.61,3.47,3.56,3.47h21.38c1.96,0,3.57-1.56,3.57-3.47
C98.08,48.06,96.49,46.51,94.55,46.53L94.55,46.53z M93.13,76.01L74.59,65.61c-1.66-0.99-3.81-0.45-4.81,1.21
c-0.48,0.78-0.64,1.72-0.4,2.61c0.24,0.88,0.83,1.64,1.64,2.07l18.54,10.4c1.66,0.99,3.81,0.45,4.81-1.21
C95.44,79.13,94.9,77.05,93.13,76.01L93.13,76.01z M74.42,34.4L92.94,24c1.79-1.03,2.32-3.11,1.25-4.69
c-1.07-1.73-3.2-2.25-4.81-1.21l-18.54,10.4c-1.78,1.04-2.32,3.12-1.25,4.69C70.68,34.75,72.81,35.44,74.42,34.4L74.42,34.4z
M74.42,34.4"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000083775721639409305130000017638257817945677498_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M94.18,41.64l-5.54-1.68c-0.91-3.53-2.32-6.91-4.18-10.05l2.67-5.09c1.11-2.07,0.73-4.63-0.93-6.29
l-4.64-4.74c-1.64-1.69-4.2-2.1-6.29-1.01l-5.09,2.66c-3.14-1.8-6.52-3.14-10.05-3.97L58.45,5.9c-0.68-2.24-2.75-3.78-5.09-3.78
h-6.72c-2.34,0-4.41,1.54-5.09,3.78l-1.68,5.54c-3.53,0.9-6.92,2.31-10.05,4.18l-5.09-2.85c-2.07-1.12-4.62-0.75-6.29,0.91
l-4.74,4.85c-1.69,1.64-2.1,4.2-1.01,6.29l2.66,5.09c-1.79,3.15-3.12,6.53-3.97,10.05l-5.57,1.68c-2.24,0.68-3.78,2.75-3.78,5.09
v6.72c0,2.34,1.54,4.41,3.78,5.09l5.54,1.68c0.91,3.53,2.32,6.91,4.18,10.05l-2.85,5.09c-1.11,2.07-0.73,4.63,0.93,6.29l4.74,4.74
c1.67,1.65,4.22,2.02,6.29,0.91l5.09-2.66c3.13,1.86,6.52,3.25,10.05,4.13l1.68,5.57c0.71,2.25,2.81,3.77,5.17,3.73h6.72
c2.34,0,4.41-1.54,5.09-3.78l1.68-5.54c3.53-0.9,6.92-2.31,10.05-4.18l5.09,2.67c2.07,1.12,4.62,0.75,6.29-0.91l4.74-4.74
c1.65-1.63,2.06-4.14,1.01-6.21l-2.66-5.09c1.84-3.14,3.23-6.52,4.13-10.05l5.57-1.68c2.18-0.74,3.64-2.79,3.62-5.09v-6.72
C97.96,44.38,96.43,42.31,94.18,41.64L94.18,41.64z M87.09,55.09c-1.77,0.54-3.13,1.97-3.6,3.76c-0.8,3.05-2.01,5.99-3.6,8.71
c-0.95,1.65-0.95,3.68,0,5.33l2.66,5.09l-4.77,4.61l-5.12-2.66c-1.65-0.95-3.68-0.95-5.33,0c-2.72,1.58-5.64,2.79-8.69,3.6
c-1.8,0.46-3.24,1.82-3.78,3.6l-1.52,5.6h-6.69l-1.68-5.54c-0.55-1.78-1.98-3.14-3.78-3.6c-3.04-0.8-5.97-2.01-8.69-3.6
c-0.81-0.48-1.73-0.74-2.66-0.75c-0.86,0-1.71,0.21-2.48,0.61l-5.09,2.66l-4.8-4.64l2.67-5.12c0.91-1.67,0.86-3.7-0.13-5.33
c-1.59-2.73-2.8-5.66-3.6-8.71c-0.47-1.79-1.83-3.21-3.6-3.76l-5.46-1.52v-6.69l5.54-1.68c1.77-0.54,3.13-1.97,3.6-3.76
c0.8-3.06,2.01-5.99,3.6-8.71c0.94-1.59,0.99-3.56,0.13-5.2l-2.67-5.09l4.64-4.74l5.12,2.67c1.64,0.86,3.6,0.81,5.2-0.13
c2.72-1.56,5.65-2.74,8.69-3.52c1.8-0.46,3.24-1.82,3.78-3.6l1.65-5.54h6.69l1.68,5.54c0.55,1.78,1.98,3.14,3.78,3.6
c3.04,0.8,5.97,2.01,8.69,3.6c1.63,0.99,3.66,1.04,5.33,0.13l5.09-2.67l4.74,4.74l-2.66,5.12c-0.9,1.62-0.9,3.58,0,5.2
c1.59,2.73,2.8,5.66,3.6,8.71c0.47,1.79,1.83,3.21,3.6,3.76l5.54,1.65v6.69L87.09,55.09z M87.09,55.09"/>
<path class="st2" d="M50,28.76c-11.77,0-21.32,9.54-21.32,21.32c0,11.77,9.54,21.32,21.32,21.32c11.77,0,21.32-9.55,21.32-21.32
c0-5.65-2.25-11.08-6.24-15.07C61.08,31.01,55.65,28.76,50,28.76L50,28.76z M50,66.07c-8.83,0-15.99-7.16-15.99-15.99
c0-8.83,7.16-15.99,15.99-15.99s15.99,7.16,15.99,15.99C65.99,58.91,58.83,66.07,50,66.07L50,66.07z M50,66.07"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000178901070286266389090000005326459498747094661_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M69.01,17.31c0.79,0,1.74,0.47,2.24,1.12l0.02,0.03l0.02,0.03l18.38,22.89c0.89,1.17,0.76,2.92-0.33,4.12
L52.88,84.81l-0.02,0.02c-0.44,0.48-1.13,0.78-2.03,0.86h-0.06c-0.66,0-1.42-0.28-1.97-0.74l-0.27-0.27L11.33,45.32
c-0.99-1.12-1.1-2.79-0.25-3.82l0.03-0.04l0.03-0.04l18.41-22.93v-0.02c0.62-0.77,1.39-1.17,2.28-1.17h37.17 M69.01,10.16H31.84
c-3.01,0-5.86,1.34-7.87,3.85L5.57,36.94c-3.18,3.85-2.85,9.54,0.5,13.23L43.4,89.68l0.5,0.5c1.84,1.67,4.35,2.68,6.86,2.68h0.34
c2.68-0.17,5.19-1.17,7.03-3.18l36.49-39.34c3.51-3.85,3.68-9.54,0.67-13.39L76.89,14.03C75.03,11.66,72.02,10.16,69.01,10.16
L69.01,10.16z M69.01,10.16"/>
<path class="st2" d="M30.33,42.38c-0.81,0-1.62,0.29-2.32,0.93c-1.34,1.17-1.34,3.35-0.17,4.69l18.08,19.08l0.34,0.34
c1.27,1.2,2.89,1.78,4.52,1.78c1.8,0,3.62-0.72,5.02-2.11L73.2,48.16c1.17-1.34,1.17-3.51-0.17-4.69
c-0.67-0.53-1.46-0.78-2.23-0.78c-0.95,0-1.88,0.38-2.62,1.12l-16.5,17.6c-0.25,0.26-0.59,0.4-0.93,0.4
c-0.34,0-0.66-0.13-0.92-0.39L32.85,43.47C32.14,42.75,31.24,42.38,30.33,42.38L30.33,42.38z M30.33,42.38"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000093862449718304528650000001831433815926670741_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M88.72,18.15c0.45,0,0.82,0.37,0.82,0.82v54.55c0,0.45-0.37,0.82-0.82,0.82H47.58c-3.3,0-6.44,1.23-8.86,3.47
l-8.73,8.06l-0.31-1.34c-1.36-6-6.59-10.19-12.75-10.19h-5.58c-0.45,0-0.82-0.37-0.82-0.82V18.97c0-0.45,0.37-0.82,0.82-0.82
H88.72 M88.72,12.03H11.36c-3.84,0-6.94,3.1-6.94,6.94v54.55c0,3.84,3.1,6.94,6.94,6.94h5.58c3.25,0,6.05,2.25,6.77,5.41
l0.66,2.96c0.57,2.52,2.78,4.03,5.06,4.03c1.23,0,2.46-0.43,3.48-1.38l9.95-9.19c1.29-1.18,2.96-1.84,4.71-1.84h41.15
c3.84,0,6.94-3.1,6.94-6.94V18.97C95.66,15.14,92.55,12.03,88.72,12.03L88.72,12.03z M88.72,12.03"/>
<path class="st2" d="M29.73,37.66c-3.25,0-5.87,2.63-5.87,5.87c0,3.24,2.63,5.87,5.87,5.87c3.24,0,5.87-2.63,5.87-5.87
C35.6,40.29,32.97,37.66,29.73,37.66L29.73,37.66z M51.1,38.07c-3.25,0-5.87,2.63-5.87,5.87c0,3.24,2.63,5.87,5.87,5.87
c3.24,0,5.88-2.62,5.88-5.87C56.98,40.69,54.35,38.07,51.1,38.07L51.1,38.07z M72.47,38.07c-3.25,0-5.87,2.63-5.87,5.87
c0,3.24,2.63,5.87,5.87,5.87c3.25,0,5.87-2.63,5.87-5.87C78.34,40.7,75.72,38.07,72.47,38.07L72.47,38.07z M72.47,38.07"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000069362941054203318130000012565035162419057327_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<path class="st2" d="M94.28,26.98L76.8,12.11c-1.82-1.6-4.27-2.28-6.66-1.86c-2.39,0.42-4.45,1.9-5.62,4.03
c-0.79,1.4-1.78,2.69-2.94,3.8c-6.44,5.96-16.38,5.96-22.82,0c-1.27-1.3-2.33-2.8-3.13-4.43c-1.1-2.15-3.12-3.68-5.49-4.14
c-2.37-0.52-4.85,0.06-6.74,1.59L5.83,26.41c-1.64,1.41-2.63,3.43-2.74,5.59c-0.13,2.19,0.63,4.35,2.12,5.97
c4.6,4.99,10,9.18,15.99,12.37c0.27,0.12,0.46,0.38,0.48,0.67v29.23c0,3.51,1.39,6.88,3.88,9.36c2.48,2.48,5.85,3.88,9.36,3.88
h11.31c1.99,0,3.61-1.62,3.61-3.61c0-1.99-1.62-3.61-3.61-3.61H34.77c-3.32,0-6.02-2.69-6.02-6.02V51.06
c-0.03-2.95-1.67-5.65-4.29-7.03c-5.23-2.83-9.95-6.5-13.96-10.88c-0.09-0.22-0.09-0.46,0-0.67c0.02-0.21,0.12-0.4,0.29-0.53
l17.33-15.17c0.21-0.1,0.46-0.1,0.67,0c0.21,0.03,0.39,0.15,0.48,0.34c1.25,2.35,2.87,4.49,4.82,6.31
c4.38,4.16,10.19,6.47,16.23,6.45c6.13,0,12.02-2.38,16.42-6.64c1.65-1.6,3.06-3.44,4.19-5.44c0.15-0.17,0.36-0.26,0.58-0.26
c0.22,0,0.43,0.1,0.58,0.26l17.48,14.88c0.17,0.13,0.27,0.32,0.29,0.53c0.01,0.27-0.1,0.53-0.29,0.72
c-3.92,4.1-8.45,7.56-13.43,10.26c-2.6,1.38-4.23,4.08-4.24,7.03v29.23c0,3.32-2.69,6.02-6.02,6.02c-1.99,0-3.61,1.62-3.61,3.61
c0,1.99,1.62,3.61,3.61,3.61c3.51-0.04,6.86-1.47,9.32-3.98c2.46-2.51,3.81-5.89,3.78-9.41V51.01c0.03-0.3,0.21-0.55,0.48-0.67
c5.65-3.07,10.78-7,15.22-11.65c1.55-1.63,2.37-3.82,2.26-6.07C96.85,30.46,95.9,28.42,94.28,26.98L94.28,26.98z M94.28,26.98"/>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#F4F0F1;}
.st1{fill:#FFFFFF;}
.st2{fill:#3EA3D8;}
.st3{fill:#CCCCCC;}
.st4{fill:none;stroke:#CCCCCC;stroke-linecap:square;stroke-miterlimit:10;}
.st5{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;}
.st6{fill:none;stroke:#CCCCCC;stroke-miterlimit:10;stroke-dasharray:1.9084,1.9084;}
.st7{fill:#1A1A1A;}
.st8{fill:none;stroke:#1A1A1A;stroke-width:3;stroke-miterlimit:10;}
.st9{fill:none;stroke:#1A1A1A;stroke-miterlimit:10;}
.st10{fill:none;stroke:#E6E6E6;stroke-miterlimit:10;}
.st11{fill:#666666;}
.st12{fill:none;stroke:#B3B3B3;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
.st13{fill:#B3B3B3;}
.st14{opacity:0.05;}
.st15{clip-path:url(#SVGID_00000042694534944456839630000009249756808104012177_);}
.st16{fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:10;}
.st17{opacity:0.4;fill:#3EA3D8;}
.st18{fill:none;stroke:#3EA3D8;stroke-miterlimit:10;}
.st19{fill:none;stroke:#3EA3D8;stroke-width:11;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="A1">
<g id="NAV_x5F_BAR_00000129914889952932149030000011711506177042644156_">
</g>
<g id="HEADER_x5F_BAR_00000015351907221170818370000001589878730520391302_">
</g>
<g id="FUNC_x5F_LIST">
</g>
<g id="MAIN_x5F_FUNC">
</g>
<g id="USER_x5F_CARD">
<g id="BG" class="st14">
</g>
</g>
</g>
<g id="ICON">
<g>
<path class="st2" d="M60.93,54.42c7.91-6.23,12.37-15.86,12-25.92c0.05-4.54-0.88-9.04-2.74-13.18c0.01-0.1,0.01-0.2,0-0.3
c-0.07-0.11-0.15-0.22-0.24-0.32C66.39,6.9,58.57,1.91,49.99,1.96c-13.3,0-22.94,11.18-22.94,26.54
c-0.37,10.06,4.09,19.69,12,25.92C22.69,57.7,11.66,68.34,11.66,82.14c-0.2,3.81,1.18,7.53,3.8,10.29
c5.13,5.1,14.54,5.6,26.54,5.6h14.74c13.12,0,22.59,0,27.75-5.01c2.73-2.94,4.11-6.88,3.83-10.88
C88.33,68.34,77.3,57.7,60.93,54.42L60.93,54.42z M49.99,68.02l-6.66-8.35c4.43-0.55,8.9-0.55,13.33,0L49.99,68.02z M49.99,7.86
c5.34-0.06,10.34,2.61,13.27,7.08c-18.67,8.23-27.84,5.25-28.93,4.81C36.34,12.75,42.71,7.91,49.99,7.86L49.99,7.86z M32.95,28.5
c0-1,0-1.98,0.15-2.95c2.46,0.69,5.02,1.02,7.58,0.97c8.73-0.33,17.29-2.47,25.15-6.28c0.83,2.67,1.24,5.46,1.21,8.26
c0,13-7.64,23.59-17.04,23.59C40.58,52.09,32.95,41.51,32.95,28.5L32.95,28.5z M80.36,88.87c-3.42,3.36-11.8,3.33-23.59,3.27
H46.54c-12.3,0-22.88,0-26.92-3.89c-1.51-1.66-2.26-3.87-2.06-6.1c0-9.91,7.61-17.69,19.29-21.11l10.85,13.54
c0,0,0.15,0,0.21,0.18c0.07,0.11,0.16,0.21,0.27,0.3c0.12,0.09,0.25,0.17,0.38,0.24l0.32,0.18c0.35,0.15,0.74,0.23,1.12,0.24
c0.39,0,0.77-0.09,1.12-0.27l0.32-0.15c0.13-0.07,0.26-0.15,0.38-0.24c0.1-0.08,0.19-0.18,0.27-0.3s0.15,0,0.21-0.18l10.85-13.62
c11.8,3.33,19.29,11.21,19.29,21.11C82.75,84.52,82,87,80.36,88.87L80.36,88.87z M80.36,88.87"/>
</g>
</g>
<g id="DEFAULT_x5F_AVATOR">
</g>
<g id="COLOR">
</g>
<g id="NAV_x5F_BAR">
<g id="ICON_x5F_SETTING">
</g>
<g id="ICON_x5F_INFO">
</g>
<g id="ICON_x5F_KCB">
</g>
</g>
<g id="HEADER_x5F_BAR">
<g id="BUTTON">
</g>
<g id="TOP">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
<style type="text/css">
.st0{fill:#3EA3D8;}
</style>
<path class="st0" d="M839.8,71.8H715.5c-18.5-34.5-55.1-58.2-96.9-58.2H414.1c-41.9,0-78.3,23.6-96.9,58.2H192.9
C131,71.8,80.8,122.2,80.8,184v711.4c0,61.9,50.2,112.1,112.1,112.1h646.9c61.9,0,112.1-50.2,112.1-112.1V184
C951.8,122.1,901.6,71.8,839.8,71.8L839.8,71.8z M414.1,72.2h204.5c28.3,0,51.4,23.1,51.4,51.4S646.9,175,618.6,175H414.1
c-28.3,0-51.4-23.1-51.4-51.4C362.6,95.3,385.8,72.2,414.1,72.2L414.1,72.2z M893.4,895.4c0,29.6-24,53.6-53.6,53.6H192.9
c-29.6,0-53.6-24-53.6-53.6V184c0-29.6,24-53.6,53.6-53.6h111.6c3.5,57.5,51.4,103.1,109.6,103.1h204.5
c58.3,0,106.1-45.6,109.6-103.1h111.6c29.6,0,53.6,24,53.6,53.6L893.4,895.4L893.4,895.4z"/>
<path class="st0" d="M314.6,730.6H459v-350c0-15.8,9.9-24.4,29.7-25.7c19.8,1.3,30.3,9.9,31.6,25.7v96.9h172
c17.1,1.3,26.4,11.2,27.7,29.7c-1.3,19.8-10.6,29.7-27.7,29.7h-172v193.8H722c14.5,1.3,22.4,9.9,23.7,25.7
c-1.3,18.4-9.2,28.3-23.7,29.7H314.6c-15.8-1.3-24.4-11.2-25.7-29.7C290.2,740.4,298.8,731.9,314.6,730.6L314.6,730.6z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
<style type="text/css">
.st0{fill:#3EA3D8;}
</style>
<path class="st0" d="M838.4,71.7H713.8c-18.5-34.6-55.2-58.3-97.1-58.3H412c-42,0-78.4,23.7-97,58.3H190.4
c-62,0-112.2,50.5-112.2,112.3v712.6c0,62,50.3,112.2,112.2,112.2h648c62,0,112.2-50.3,112.2-112.2V184.1
C950.6,122.1,900.3,71.7,838.4,71.7z M412,72.1h204.8c28.4,0,51.4,23.1,51.4,51.4c0,28.4-23.1,51.5-51.4,51.5H412
c-28.4,0-51.4-23.1-51.4-51.5C360.4,95.2,383.6,72.1,412,72.1z M892,896.6c0,29.6-24.1,53.7-53.7,53.7h-648
c-29.6,0-53.7-24.1-53.7-53.7V184.1c0-29.6,24.1-53.7,53.7-53.7h111.8c3.5,57.6,51.4,103.3,109.8,103.3h204.8
c58.4,0,106.3-45.7,109.8-103.3h111.8c29.6,0,53.7,24.1,53.7,53.7C892,184.1,892,896.6,892,896.6z"/>
<path class="st0" d="M308.4,358h411.9c15.8,1.3,25.1,11.2,27.7,29.7c-1.3,18.5-9.9,27.7-25.7,27.7H528.2V461
c52.8,33,103.6,72,152.5,116.8c18.5,19.8,21.8,38.3,9.9,55.4c-13.2,11.9-30.4,8.6-51.5-9.9c-42.3-39.6-79.2-71.3-110.9-95.1V764
c-1.3,14.5-11.2,22.4-29.7,23.8c-18.5-1.3-27.7-9.3-27.7-23.8V415.4H310.4c-15.8,0-24.4-9.2-25.7-27.7
C284.7,369.2,292.6,359.3,308.4,358z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="D" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
<style type="text/css">
.st0{fill:#3EA3D8;}
</style>
<path class="st0" d="M474.1,995.9l5.4,4.9c33.6,27.3,86.1,4,86.1-41.4V729.7h371.2c29.3,0,53-23.7,53-53V346.7l-0.5-7.1
c-3.6-26.3-26-45.9-52.5-45.9l-371.2,0.1V64c0-21.7-13.2-41.2-33.4-49.2c-20.2-8-43.2-3-58.1,12.8L49.9,475.3
c-19.3,20.4-19.3,52.4,0,72.9L474.1,995.9z M161.4,511.7l298.1-314.7v149.7l0.5,7.2c3.6,26.3,26,45.8,52.5,45.8l371.1,0.1v223.8
H512.5l-7.2,0.5c-26.3,3.6-45.8,26-45.8,52.5v149.8L161.4,511.7z M161.4,511.7"/>
</svg>

After

Width:  |  Height:  |  Size: 837 B

View File

@ -0,0 +1,99 @@
@import "../app.scss";
view.mask {
position: fixed;
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: .2);
z-index: 1;
}
view.layer {
position: fixed;
@include container;
height: 100%;
z-index: 2;
justify-content: center;
align-items: center;
}
view.occlude {
position: fixed;
width: 100%;
height: 100%;
z-index: 3;
}
view.mask.block, view.layer.block, view.occlude.block {
display: flex;
}
view.mask.none, view.layer.none, view.occlude.none {
display: none;
}
view.mask.show-fade, view.layer.show-fade, view.occlude.show-fade {
animation: show-fade .1s cubic-bezier(0, 0, 1, 1) both;
opacity: 1;
}
view.mask.hide-fade, view.layer.hide-fade, view.occlude.hide-fade {
animation: hide-fade .1s cubic-bezier(0, 0, 1, 1) both;
opacity: 0;
}
view.mask.show-scale, view.layer.show-scale, view.occlude.show-scale {
animation: show-scale .3s cubic-bezier(.1, .9, .2, 1) both,
show-fade .1s cubic-bezier(0, 0, 1, 1) both;
transform: scale3d(1, 1, 1);
opacity: 1;
}
view.mask.hide-scale, view.layer.hide-scale, view.occlude.hide-scale {
animation: hide-scale .3s cubic-bezier(.1, .9, .2, 1) both,
hide-fade .1s cubic-bezier(0, 0, 1, 1) both;
transform: scale3d(.9, .9, 1);
opacity: 0;
}
@media (prefers-color-scheme: dark) {
view.mask {
background-color: rgba($color: #000000, $alpha: .5);
}
}
@keyframes show-fade{
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes hide-fade{
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes show-scale{
from {
transform: scale3d(1.15, 1.15, 1);
}
to {
transform: scale3d(1, 1, 1);
}
}
@keyframes hide-scale{
from {
transform: scale3d(1, 1, 1);
}
to {
transform: scale3d(.9, .9, 1);
}
}

View File

@ -0,0 +1,309 @@
import { IAnyData } from "../core/Api";
import { Emitter } from "../core/Emitter";
import { Modular, Manager } from "../core/Module";
/**
*
*/
enum AnimateType {
fade = 1,
scale = 2,
none = 3,
}
/**
*
*/
class DisplayLayer {
/**
*
*/
public get className(): string {
let res = this.isDisplay ? "block" : "none";
switch (this.animateType) {
case AnimateType.fade:
res += " mask";
break;
case AnimateType.scale:
res += " layer";
break;
case AnimateType.none:
res += " occlude";
break;
}
switch (this.animateType) {
case AnimateType.fade:
res += this.isShow ? " show-fade" : " hide-fade";
break;
case AnimateType.scale:
res += this.isShow ? " show-scale" : " hide-scale";
break;
case AnimateType.none:
break;
}
return res;
}
/**
* Layer 使 key
*/
public key: string = "";
/**
* 使
*/
public animateType: AnimateType = AnimateType.scale;
/**
*
*/
public get animateTime(): number {
switch (this.animateType) {
case AnimateType.fade:
return 100;
case AnimateType.scale:
return 300;
case AnimateType.none:
return -1;
}
};
/**
*
*/
public isDisplay: boolean = false;
/**
*
*/
public isShow: boolean = false;
/**
*
*/
public disappearTimer?: number;
}
/**
*
*/
type IPopupLayerEvent<L extends string> = {
/**
*
*/
clickMask: void
/**
*
*/
show: L;
/**
*
*/
hide: L;
/**
*
*/
change: Readonly<DisplayLayer>;
}
type commonLayerType = "mask" | "occlude";
/**
*
*/
class PopupLayer<
L extends string,
M extends Manager = Manager
> extends Modular<M, {}, IPopupLayerEvent<L | commonLayerType>> {
/**
*
*/
public autoCloseOnClick: boolean = true;
/**
*
*/
public showOccludeWhenHide: boolean = true;
/**
* Layer
*/
public hideOtherWhenShow: boolean = true;
/**
*
*/
private layers: Map<L | commonLayerType, DisplayLayer> = new Map();
/**
*
* @param key
*/
public initLayers(key: L[]) {
for (let i = 0; i < key.length; i++) {
this.render(this.getDisplayLayer(key[i]));
}
}
public onLoad(): void {
this.on("show", this.handleShowLayer);
this.on("hide", this.handleHideLayer);
this.setFunc(this.handleClickMask, "clickMask");
// 添加蒙版层
const maskLayer = this.getDisplayLayer("mask");
maskLayer.animateType = AnimateType.fade;
this.render(maskLayer);
// 添加遮蔽层
const occludeLayer = this.getDisplayLayer("occlude");
occludeLayer.animateType = AnimateType.none;
this.render(occludeLayer);
}
/**
* Layers
*/
private render(layer: DisplayLayer) {
this.setData({ [`${ layer.key }$className`]: layer.className });
}
/**
*
*/
private getDisplayLayer<K extends L | commonLayerType>(e: K): DisplayLayer {
let displayLayer = this.layers.get(e);
if (!displayLayer) {
displayLayer = new DisplayLayer();
displayLayer.key = e;
this.layers.set(e, displayLayer);
}
return displayLayer;
}
/**
*
*/
private handleClickMask = () => {
if (!this.autoCloseOnClick) return;
// 关闭全部开启的层
this.layers.forEach((layer) => {
if (layer.isShow) (this as Emitter<IAnyData>).emit("hide", layer.key);
});
// 关闭蒙版
(this as Emitter<IAnyData>).emit("hide", "mask");
}
/**
*
*/
private handleShowLayer = <K extends L | commonLayerType>(e: K) => {
let displayLayer = this.getDisplayLayer(e);
// 阻止未发生的变化
if (displayLayer.isShow) return;
// 关闭其他层
if (e !== "mask" && e !== "occlude" && this.hideOtherWhenShow) {
this.layers.forEach((layer) => {
if (layer.key === "mask" || layer.key === "occlude") return;
if (layer.isShow) {
(this as Emitter<IAnyData>).emit("hide", layer.key);
}
});
}
// 显示蒙版
if (e !== "mask" && e !== "occlude")
(this as Emitter<IAnyData>).emit("show", "mask");
// 取消消失定时
displayLayer.disappearTimer &&
clearTimeout(displayLayer.disappearTimer);
displayLayer.isShow = true;
displayLayer.isDisplay = true;
this.render(displayLayer);
this.emit("change", displayLayer);
};
/**
*
*/
private handleHideLayer = <K extends L | commonLayerType>(e: K) => {
let displayLayer = this.getDisplayLayer(e);
// 阻止未发生的变化
if (!displayLayer.isShow) return;
if (displayLayer.animateTime <= 0) {
displayLayer.isShow = false;
displayLayer.isDisplay = false;
this.render(displayLayer);
} else {
displayLayer.isShow = false;
this.render(displayLayer);
// 开启遮蔽
if (this.showOccludeWhenHide) {
(this as Emitter<IAnyData>).emit("show", "occlude");
}
displayLayer.disappearTimer = setTimeout(() => {
displayLayer.isDisplay = false;
this.render(displayLayer);
// 取消 timer
displayLayer.disappearTimer = undefined;
// 检测是否关闭遮蔽
let needOcclude = true;
this.layers.forEach((layer) => {
if (layer === displayLayer) return;
if (layer.disappearTimer) needOcclude = false;
});
// 关闭遮蔽
if (needOcclude && this.showOccludeWhenHide) {
(this as Emitter<IAnyData>).emit("hide", "occlude");
}
}, displayLayer.animateTime);
}
// 关闭蒙版
if (e !== "mask" && e !== "occlude") {
let needMask = true;
this.layers.forEach((layer) => {
if (layer === displayLayer) return;
if (layer.isShow) needMask = false;
});
if (needMask) (this as Emitter<IAnyData>).emit("hide", "mask");
}
this.emit("change", displayLayer);
}
}
export { PopupLayer };
export default PopupLayer;

View File

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "设置"
}

View File

@ -0,0 +1,10 @@
@import "./UserCard.scss";
@import "./MainFunction.scss";
@import "./FunctionList.scss";
@import "../../modular/PopupLayer.scss";
view.container{
padding-top: 50rpx;
}

View File

@ -1,66 +1,38 @@
// pages/Account/Account.ts
Page({
import { Manager } from "../../core/Module";
import { UserCard } from "./UserCard";
import { MainFunction } from "./MainFunction";
import { FunctionList } from "./FunctionList";
import { PopupLayer } from "../../modular/PopupLayer";
import { TestLayerA } from "./TestLayerA";
/**
*
*/
data: {
(async () => {
},
// 初始化页面
const { manager, query } = await Manager.PageAsync();
/**
* --
*/
onLoad() {
// 添加弹出层 Modular
const popupLayer: PopupLayer<"layerA" | "layerB"> = manager.addModule(PopupLayer, "mask") as any;
},
// 添加 UserCard Modular
const userCard = manager.addModule(UserCard, "userCard");
/**
* --
*/
onReady() {
//#region test layer
popupLayer.initLayers(["layerA", "layerB"]);
const testLayerA = manager.addModule(TestLayerA, "testLayerA");
userCard.on("clickChangeTheme", () => {
popupLayer.emit("show", "layerA");
})
testLayerA.on("click", () => {
popupLayer.emit("show", "layerB");
})
//#endregion
},
// 添加 MainFunction Modular
manager.addModule(MainFunction, "mainFunction");
/**
* --
*/
onShow() {
// 添加 FunctionList Modular
manager.addModule(FunctionList, "functionList");
},
/**
* --
*/
onHide() {
},
/**
* --
*/
onUnload() {
},
/**
* --
*/
onPullDownRefresh() {
},
/**
*
*/
onReachBottom() {
},
/**
*
*/
onShareAppMessage() {
}
})
// 初始化全部 Modular
await manager.loadAllModule(query);
})();

View File

@ -1 +1,85 @@
<text>pages/Account/Account.wxml</text>
<!-- 层遮蔽层 -->
<view class="{{ mask$occlude$className }}" bindtap="mask$clickMask"></view>
<!-- 蒙版 -->
<view class="{{ mask$mask$className }}" bindtap="mask$clickMask"></view>
<!-- 层A -->
<view class="{{ mask$layerA$className }}" bindtap="mask$clickMask">
<view class="card" style="height: 300px; line-height: 300px; text-align:center" catchtap="testLayerA$click">layerA(点击显示layerB)</view>
</view>
<!-- 层B -->
<view class="{{ mask$layerB$className }}" bindtap="mask$clickMask">
<view class="card" style="height: 200px; line-height: 200px; text-align:center" catchtap>layerB</view>
</view>
<!-- 顶部的阴影 -->
<view class="top-shadow"></view>
<!-- 页面容器 -->
<view class="container">
<!-- 用户卡片 -->
<view class="user-card card">
<view class="avatar">
<open-data type="userAvatarUrl" />
</view>
<view class="info">
<!-- 主题变换按钮 -->
<view class="theme">
<view bindtap="userCard$changeTheme">
<image class="icon-sub" src="../../image/account/Account_Theme.svg" />
</view>
</view>
<!-- 用户昵称 -->
<view class="nick h1">
<open-data type="userNickName" />
</view>
<!-- 学生信息 -->
<view class="student">
<view class="name">秦浩轩</view>
<view class="certified">
<view class="certifi-info">已认证</view>
<image class="text-icon" src="../../image/account/Account_OK.svg"></image>
</view>
</view>
<!-- 学号信息 -->
<view class="student-id">1806240113</view>
<!-- 学校 -->
<view class="school">大连工业大学</view>
</view>
</view>
<!--主要功能-->
<view class="card main-function">
<!--每个功能的容器-->
<view class="branch-funtion" wx:for="{{ mainFunction$mainFunctionList }}" wx:key="index">
<view style="{{ index == (mainFunction$mainFunctionList - 1) ? 'border-bottom: 0px' : '' }}">
<!--每个功能的图片-->
<image class="icon" src="../../image/account/Account_{{ item.iconUrl }}.svg"></image>
<!--每个功能的文字-->
<view>{{ item.displayName }}</view>
</view>
</view>
</view>
<!-- 功能列表 -->
<view class="card function-list">
<!-- 每一行 -->
<view class="function" wx:for="{{ functionList$functionList }}" wx:key="index">
<view style="{{ index == (functionList$functionList.length - 1) ? 'border-bottom: 0px' : '' }}">
<image class="icon func-icon" src="../../image/account/Account_{{ item.iconUrl }}.svg" />
<view>{{ item.displayName }}</view>
<image class="icon-sub arrow" src="../../image/account/Account_Arrow.svg" />
</view>
</view>
</view>
</view>

View File

@ -1 +0,0 @@
/* pages/Account/Account.wxss */

View File

@ -0,0 +1,43 @@
@import "../../app.scss";
view.function-list {
margin-top: 50rpx;
margin-bottom: 50rpx;
padding: 0 0 !important;
width: 100% !important;
view.function {
padding: 0 20px;
width: calc( 100% - 40px );
height: 55px;
> view {
height: 100%;
display: flex;
align-items: center;
border-bottom: 1px solid rgba($color: #000000, $alpha: .1);
image.func-icon {
width: 26px;
height: 26px;
}
view {
margin-left: 15px;
flex-grow: 1;
font-size: .9em;
}
image.arrow {
width: 10px;
height: 10px;
}
}
}
}
@media (prefers-color-scheme: dark) {
view.function-list view.function > view {
border-bottom: 1px solid rgba($color: #ffffff, $alpha: .1);
}
}

View File

@ -0,0 +1,36 @@
import { Modular, Manager } from "../../core/Module";
interface IFunctionListItem {
/**
*
*/
displayName: string;
/**
*
*/
iconUrl: string;
}
class FunctionList<M extends Manager> extends Modular<M> {
public static readonly functionList: IFunctionListItem[] = [
{ displayName: "赞助计划", iconUrl: "Sponsor" },
{ displayName: "公众号", iconUrl: "PubilcAccount" },
{ displayName: "自助问答", iconUrl: "FAQ" },
{ displayName: "关于我们", iconUrl: "AboutUs" },
{ displayName: "联系客服", iconUrl: "Support" }
];
public data = {
functionList: FunctionList.functionList
};
public override onLoad() {
// Do something
}
}
export { FunctionList };
export default FunctionList;

View File

@ -0,0 +1,39 @@
@import "../../app.scss";
//主要功能
view.main-function {
display: flex;
margin-top: 50rpx;
padding: 0 !important;
width: 100% !important;
view.branch-funtion {
padding: 13px 0;
width: 100%;
> view {
display: flex;
flex-direction: column;
align-items: center;
justify-self: center;
border-right: 1px solid rgba($color: #000000, $alpha: .1);
image {
height: 35px;
width: 35px;
}
view {
text-align: center;
margin-top: 5px;
font-size: .9em;
}
}
}
}
@media (prefers-color-scheme: dark) {
view.main-function view.branch-funtion > view {
border-right: 1px solid rgba($color: #ffffff, $alpha: .1);
}
}

View File

@ -0,0 +1,35 @@
import { Modular, Manager } from "../../core/Module";
interface IMainFunctionItem {
/**
*
*/
displayName: string;
/**
*
*/
iconUrl: string;
}
class MainFunction<M extends Manager> extends Modular<M> {
public static readonly MainFunctionList: IMainFunctionItem[] = [
{ displayName: "账号信息", iconUrl: "UserInfo" },
{ displayName: "课表缓存", iconUrl: "DateList" },
{ displayName: "功能定制", iconUrl: "Customer" },
{ displayName: "更多设置", iconUrl: "Settings" }
];
public data? = {
mainFunctionList: MainFunction.MainFunctionList
}
public override onLoad() {
// Do something
}
}
export { MainFunction };
export default MainFunction;

View File

@ -0,0 +1,26 @@
import { Modular, Manager } from "../../core/Module";
type IUserCardEvent = {
/**
*
*/
click: void;
}
class TestLayerA<M extends Manager> extends Modular<M, {}, IUserCardEvent> {
public override onLoad() {
this.setFunc(this.handleClick, "click");
}
/**
*
*/
private handleClick() {
this.emit("click");
}
}
export { TestLayerA };
export default TestLayerA;

View File

@ -0,0 +1,92 @@
@import "../../app.scss";
// 用户卡片
view.user-card {
display: flex;
align-items: center;
padding-top: 20px;
padding-bottom: 20px;
view.avatar {
flex-basis: 80px;
width: 80px;
height: 80px;
border-radius: 1000px;
flex-shrink: 0;
overflow: hidden;
}
view.info {
flex-grow: 1;
padding-left: 20px;
max-width: calc(100% - 80px - 20px);
view.theme {
width: 100%;
padding: 20px 0 10px 0;
display: flex;
justify-content: flex-end;
view {
width: 23px;
height: 23px;
padding: 20px;
margin: -20px;
border-radius: 20px;
image {
width: 100%;
height: 100%;
}
}
}
view.nick {
margin-bottom: 6px;
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
// 学生信息
view.student {
display: flex;
align-items: center;
view.certified {
color: $theme-color-blue;
border: 1px solid $theme-color-blue;
border-radius: 4px;
margin-left: .3em;
font-size: .85em;
height: 1.2em;
padding: 0 2px;
display: flex;
justify-content: center;
align-items: center;
image.text-icon {
margin-left: .25em;
width: 10px;
height: 10px;
}
}
}
view.student-id {
margin-bottom: 3px;
}
view.school {
text-align: right;
padding: 10px 0 20px 0;
}
}
}
@media (prefers-color-scheme: dark) {
view.container view.user-card view.avatar{
filter: brightness(.8);
}
}

View File

@ -0,0 +1,26 @@
import { Modular, Manager } from "../../core/Module";
type IUserCardEvent = {
/**
*
*/
clickChangeTheme: void;
}
class UserCard<M extends Manager> extends Modular<M, {}, IUserCardEvent> {
public override onLoad() {
this.setFunc(this.handleChangeTheme, "changeTheme");
}
/**
*
*/
private handleChangeTheme() {
this.emit("clickChangeTheme");
}
}
export { UserCard };
export default UserCard;

View File

@ -1 +0,0 @@
/* pages/Information/Information.wxss */

View File

@ -0,0 +1,120 @@
@import "../../app.scss";
$status-bar-left-top-icon-width: 30px;
$status-bar-middle-icon-width: 15px;
view.status-bar {
top: 0;
width: 100%;
display: flex;
position: fixed;
justify-content: space-between;
background-color: $theme-color-light-layout;
view.select {
flex: 1;
display: flex;
height: 100%;
align-items: center;
padding-left: 18px;
image {
width: $status-bar-left-top-icon-width;
height: $status-bar-left-top-icon-width;
filter: $black-filter;
}
view.semester {
height: 100%;
display: flex;
padding-left: 5px;
flex-direction: column;
justify-content: center;
view.semester-title {
@extend %status-bar-title;
font-size: .9em;
line-height: .9em;
margin-bottom: 5px;
}
view.semester-intro {
@extend %status-bar-subtitle;
font-size: .9em;
line-height: .9em;
}
}
}
view.capsule-holder {
flex: 1;
height: 100%;
}
view.content {
flex: 1;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
image {
width: $status-bar-middle-icon-width;
height: $status-bar-middle-icon-width;
filter: $black-filter;
}
view.week {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
height: 100%;
view.week-title {
@extend %status-bar-title;
font-weight: 600;
font-size: 1.15em;
line-height: 1.15em;
margin-bottom: 5px;
}
view.week-intro {
@extend %status-bar-subtitle;
font-size: .85em;
line-height: .85em;
}
}
}
}
view.status-bar-blank {
width: 100%;
}
%status-bar-title {
color: $theme-color-light-title;
}
%status-bar-subtitle {
color: $theme-color-light-text;
}
@media (prefers-color-scheme: dark){
%status-bar-title {
color: $theme-color-dark-title;
}
%status-bar-subtitle {
color: $theme-color-dark-text;
}
view.status-bar {
background-color: $theme-color-dark-layout;
view.select image {
filter: $white-filter;
}
}
}

View File

@ -0,0 +1,117 @@
import { Modular, Manager, ILifetime } from "../../core/Module";
import { Logger, LogLabel, LevelLogLabel, LifeCycleLogLabel, NormalStyle } from "../../core/Logger";
/**
* UI
*/
interface IDisplayData {
/**
*
*/
val:string;
/**
*
*/
key:string;
};
/**
*
*/
interface StatusBarEvent {
m: IDisplayData
};
/**
*
*/
class StatusBar<M extends Manager> extends Modular<M, {}, StatusBarEvent>
implements Partial<ILifetime> {
/**
*
*/
public static readonly StatusBarHeightExtend:number = 2;
/**
*
*/
public static readonly StatusBarLabel = new LogLabel(
"StatusBar", NormalStyle
);
data = {
// 导航栏高度
barHeight: 65,
// 状态栏高度
barTop: 20,
// 胶囊占位
capsule: 94
};
/**
*
*/
public setHeight() {
let systemInfo = wx.getSystemInfoSync();
let headerPos = wx.getMenuButtonBoundingClientRect();
//状态栏高度
let statusBarHeight = Number(systemInfo.statusBarHeight);
// 胶囊实际位置,坐标信息不是左上角原点
let btnPosI = {
// 胶囊实际高度
height: headerPos.height,
width: headerPos.width,
// 胶囊top - 状态栏高度
top: headerPos.top - statusBarHeight,
// 胶囊bottom - 胶囊height - 状态栏height 胶囊实际bottom 为距离导航栏底部的长度)
bottom: headerPos.bottom - headerPos.height - statusBarHeight,
// 这里不能获取 屏幕宽度PC端打开小程序会有BUG要获取窗口高度 - 胶囊right
right: systemInfo.windowWidth - headerPos.right
}
// 计算顶部导航栏高度
let barHeight = btnPosI.height + btnPosI.top + btnPosI.bottom;
// 计算胶囊展位
let capsule = btnPosI.right + btnPosI.width;
this.setData({
// 不知道为什么总是差 4px 距离
// 别问为什么 加上就对了
barHeight: barHeight + 4 + StatusBar.StatusBarHeightExtend,
barTop: statusBarHeight - StatusBar.StatusBarHeightExtend,
capsule: capsule
});
Logger.log(`计算并设置 StatusBar 的高度为: ${ barHeight + 4 }px, ` +
`状态栏高度: ${ statusBarHeight }px, 胶囊占位: ${ capsule }px`,
LevelLogLabel.InfoLabel, StatusBar.StatusBarLabel);
}
public onLoad() {
Logger.log("StatusBar 模块加载...",
LevelLogLabel.InfoLabel, LifeCycleLogLabel.OnLoadLabel, StatusBar.StatusBarLabel);
this.setHeight();
}
}
export default StatusBar;
export { StatusBar };

View File

@ -0,0 +1,44 @@
import { Modular, Manager, ILifetime } from "../../core/Module";
import { Login } from "../../api/Login";
import { Schedlue } from "../../api/Schedule"
import { Storage } from "../../core/Storage";
/**
*
*/
class TestCore<M extends Manager> extends Modular<M>
implements Partial<ILifetime> {
public override onLoad() {
let s = new Storage("test", {
a: new Date(),
be: 2
});
let s2 = new Storage("test", {
be: 1,
aa: "abc"
});
s2.set("be", 4);
console.log(s, s2);
setTimeout(() => {
s.set("be", 12);
}, 1000)
// new Login().param({studentId: "2017060129", password: ""})
// .request().wait({
// ok: (w) => {console.log("ok", w)},
// no: (w) => {console.log("no", w)},
// done: (w) => {console.log("done", w)}
// });
// new Schedlue().param({cookie:"C729D1AB1B17077485ACCD9279135C22",semester:"2020-2021-2"})
// .request()
}
}
export default TestCore;
export { TestCore };

View File

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"navigationStyle": "custom"
}

View File

@ -0,0 +1,2 @@
@import "./StatusBar.scss"

View File

@ -1,66 +1,22 @@
// pages/Timetable/Timetable.ts
Page({
import { Manager} from "../../core/Module";
import { StatusBar } from "./StatusBar";
import { TestCore } from "./TestCore";
/**
*
*/
data: {
/**
* 使 Manager
* Modular Manager
*/
(async () => {
},
// 初始化页面
const { manager, query } = await Manager.PageAsync();
/**
* --
*/
onLoad() {
// 添加 StatusBar Modular
manager.addModule(StatusBar, "statusBar");
// 添加 TestCore Modular
manager.addModule(TestCore, "testCore");
},
/**
* --
*/
onReady() {
},
/**
* --
*/
onShow() {
},
/**
* --
*/
onHide() {
},
/**
* --
*/
onUnload() {
},
/**
* --
*/
onPullDownRefresh() {
},
/**
*
*/
onReachBottom() {
},
/**
*
*/
onShareAppMessage() {
}
})
// 初始化全部 Modular
await manager.loadAllModule(query);
})()

View File

@ -1 +1,30 @@
<text>pages/Timetable/Timetable.wxml</text>
<!-- 顶部状态栏 -->
<view class="status-bar" style="height:{{ statusBar$barHeight }}px; padding-top:{{ statusBar$barTop }}px;">
<!-- 学期选择 -->
<view class="select">
<image src="/image/ui/last_semester.svg"/>
<view class="semester">
<view class="semester-title">大四-上</view>
<view class="semester-intro">2021-2022</view>
</view>
</view>
<!-- 周选择 -->
<view class="content">
<view class="week">
<view class="week-title">第1周</view>
<view class="week-intro">双击返回本周</view>
</view>
<image src="/image/ui/selectArror.svg"/>
</view>
<!-- 胶囊占位 -->
<view class="capsule-holder" style="width: {{ statusBar$capsule }}px"></view>
</view>
<!-- 状态栏占位 -->
<view class="status-bar-blank" style="height: {{ statusBar$barHeight + statusBar$barTop }}px"></view>
<!-- <text>afdff</text> -->

View File

@ -1,6 +1,6 @@
{
"light": {
"navigationBarBackgroundColor": "#f6f6f6",
"navigationBarBackgroundColor": "#f8f8f8",
"navigationBarTextStyle": "black",
"backgroundColor": "#f4f0f1",
@ -11,9 +11,9 @@
},
"dark": {
"navigationBarBackgroundColor": "#191919",
"navigationBarBackgroundColor": "#1f1f1f",
"navigationBarTextStyle": "white",
"backgroundColor": "#1f1f1f",
"backgroundColor": "#191919",
"tabBarColor": "#666666",
"tabBarImage0": "image/navBar/0_dark.png",

View File

@ -1,43 +0,0 @@
import {LogLabel, LogStyle} from "./Logger";
// 成功
export const SuccessLabel = new LogLabel(
"SUCCESS", new LogStyle().setColor("#FFFFFF", "#EE113D").setBorder("5px")
);
// 失败
export const FailedLabel = new LogLabel(
"SUCCESS", new LogStyle().setColor("#FFFFFF", "#33ff66").setBorder("3px")
);
// 致命
export const FatalLabel = new LogLabel(
"FATAL", new LogStyle().setColor("#FFFFFF", "#FF00CC").setBorder("3px")
);
// 错误
export const ErrorLabel = new LogLabel(
"ERROR", new LogStyle().setColor("#FFFFFF", "#FF0000").setBorder("3px")
);
// 警告
export const WarnLabel = new LogLabel(
"WARN", new LogStyle().setColor("#FFFFFF", "#FF9900").setBorder("3px")
);
// 消息
export const InfoLabel = new LogLabel(
"INFO", new LogStyle().setColor("#FFFFFF", "#99FF00").setBorder("3px")
);
// 调试
export const DebugLabel = new LogLabel(
"DEBUG", new LogStyle().setColor("#FFFFFF", "#00FF99").setBorder("3px")
);
// 追踪
export const TraceLabel = new LogLabel(
"TRACE", new LogStyle().setColor("#FFFFFF", "#00CCFF").setBorder("3px")
);

View File

@ -1,391 +0,0 @@
import {LOGGER_CONSOLE, LOGGER_FILTER} from "./Config";
/**
*
*/
class LogStyle {
/**
*
*/
private color:string | undefined;
/**
*
*/
private backgroundColor:string | undefined;
/**
*
*/
private weight:string | undefined;
/**
*
*/
private size:string | undefined;
/**
*
*/
private family:string | undefined;
/**
*
*/
private borderRadius:string | undefined;
/**
*
*/
private border:string | undefined;
/**
*
* @param color
* @param backgroundColor
*/
public setColor(color:string, backgroundColor?:string):LogStyle {
this.color = color;
this.backgroundColor = backgroundColor;
return this;
}
/**
*
* @param borderRadius
* @param border
*/
public setBorder(borderRadius:string, border?:string):LogStyle {
this.borderRadius = borderRadius;
this.border = border;
return this;
}
/**
*
* @param weight
* @param family
*/
public setFont(weight:string, family:string):LogStyle {
this.weight = weight;
this.family = family;
return this;
}
/**
*
* @param size
*/
public setSize(size:string):LogStyle {
this.size = size;
return this;
}
/**
*
*/
public stringify():string {
let stringArr:string[] = [];
this.color && stringArr.push(`color:${ this.color }`);
this.backgroundColor && stringArr.push(`background-color:${ this.backgroundColor }`);
this.weight && stringArr.push(`font-weight:${ this.weight }`);
this.family && stringArr.push(`font-family:${ this.family }`);
this.borderRadius && stringArr.push(`border-radius:${ this.borderRadius }`);
this.border && stringArr.push(`border:${ this.border }`);
this.size && stringArr.push(`font-size:${ this.size }`);
stringArr.push(`margin-bottom:5px`);
return stringArr.join(";");
}
}
/**
*
*/
class LogLabel {
/**
*
*
*/
public key:string;
/**
*
*/
public style:LogStyle;
/**
* @param key
* @param style
*/
constructor(key:string, style:LogStyle) {
this.key = key;
this.style = style;
}
/**
* Logger 使
*/
public getLoggerOutput():string {
return `%c ${ this.key } `;
}
/**
* Text
*/
public getTextOutput():string {
return `[${ this.key }]`;
}
/**
* style
*/
public getStyleOutput():string {
return this.style.stringify();
}
}
/**
*
*/
class StackInfo {
/**
*
*/
public functionName:string | undefined;
/**
*
*/
public fileName:string | undefined;
/**
*
*/
public url:string | undefined;
public setInfo(functionName:string, fileName:string, url:string):StackInfo {
this.functionName = functionName;
this.fileName = fileName;
this.url = url;
return this;
}
/**
*
*/
static getCallStack():StackInfo[] {
// 获取堆栈信息
let stack:string | undefined = new Error().stack;
if (stack === void 0) return [];
// 去除 Error
stack = stack.replace(/^(Error)\s/, "");
// 获取堆栈信息
let stackList:string[] = stack.split(/\n/);
let callStack:StackInfo[] = [];
for(let i = 0; i < stackList.length; i++) {
let matcher = stackList[i].match(/^\s+at\s+(.+)\s(\(.+\))/);
if (matcher === null || matcher.length < 3) continue;
let fileName = matcher[2].match(/.+\/(.+\..+:\d+:\d+)\)/);
if (fileName === null || matcher.length < 2) continue;
callStack.push(new StackInfo().setInfo(
matcher[1], fileName[1], matcher[2]
))
}
return callStack;
}
/**
*
*/
static readonly excludeFile:RegExp = /^Logger\.js:\d+:\d+/;
/**
*
*/
static getFirstStack():StackInfo | undefined {
let callStack = this.getCallStack();
for(let i = 0; i < callStack.length; i++) {
if(!callStack[i].fileName) continue;
if(!StackInfo.excludeFile.test(callStack[i].fileName ?? "")) {
return callStack[i];
}
}
return;
}
}
/**
*
* log
*/
class MultipleLogContent {
/**
*
*/
private content:any[];
/**
* @param content
*/
public constructor(...content:any[]) {
this.content = content;
}
/**
*
*/
public getContent():any[] {
return this.content;
}
}
/**
*
*/
class Logger {
/**
*
*/
static readonly pathStyle:LogStyle = new LogStyle().setColor("#CCCCCC");
/**
*
*/
static filterLog(filter:Array<RegExp | string>, labels:LogLabel[]):boolean {
let passNum:number = 0;
for(let i = 0; i < filter.length; i++) {
let pass:boolean = false;
for(let j = 0; j < labels.length; j++) {
if(filter[i] instanceof RegExp) {
pass = (filter[i] as RegExp).test(labels[j].key)
} else {
pass = (filter[i] as String) === labels[j].key;
}
if(pass) break;
}
if(pass) passNum ++;
}
return passNum === filter.length;
}
/**
*
* @param labels 使
*/
static testLog(...labels:LogLabel[]):boolean {
if(!LOGGER_CONSOLE) return false;
let isLogging = false;
for(let i = 0; i < LOGGER_FILTER.length; i++) {
// 判断是否进行输出
isLogging = Logger.filterLog(LOGGER_FILTER[i], labels);
if(isLogging) break;
}
return isLogging;
}
/**
*
* @param styledLabel calcStyle的处理结果
*/
static addFileNameLabel():LogLabel {
// 获得调用堆栈
let stack = StackInfo.getFirstStack();
return new LogLabel(stack?.fileName ?? "", Logger.pathStyle);
}
/**
*
* @param labels 使
*/
static calcStyle(...labels:LogLabel[]):[string[], string[]] {
let consoleLabels:string[] = [];
let consoleStyles:string[] = [];
// 放置标签
for(let i = 0; i < labels.length; i++) {
consoleLabels.push(labels[i].getLoggerOutput());
if (i !== ( labels.length - 1))
consoleLabels.push("%c ");
consoleStyles.push(labels[i].getStyleOutput());
if (i !== ( labels.length - 1))
consoleStyles.push("");
}
return [consoleLabels, consoleStyles];
}
/**
*
* @param content
* @param label 使
*/
static log<T>(content:T, ...labels:LogLabel[]):T {
let fileNameLabel = Logger.addFileNameLabel();
if(!Logger.testLog(...labels, fileNameLabel)) return content;
let styledLabel = Logger.calcStyle(...labels);
console.log(
styledLabel[0].join("") + fileNameLabel.getLoggerOutput(),
...[...styledLabel[1], fileNameLabel.getStyleOutput()],
content
);
return content;
}
/**
*
* @param labels
* @param content 使
*/
static logM<T>(labels:LogLabel[], ...content:T[]):T[] {
return Logger.log<T[]>(content, ...labels);
}
}
export default Logger;
export {Logger, LogStyle, LogLabel}

View File

@ -1,11 +1,12 @@
{
"description": "项目配置文件",
"description": "项目配置文件详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": []
"ignore": [],
"include": []
},
"miniprogramRoot": "miniprogram/",
"compileType": "miniprogram",
"libVersion": "2.21.0",
"libVersion": "2.16.1",
"projectname": "mini-dlpu-v3",
"setting": {
"urlCheck": false,
@ -35,7 +36,7 @@
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"useIsolateContext": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
@ -46,10 +47,16 @@
"useCompilerPlugins": [
"typescript",
"sass"
]
],
"useStaticServer": true
},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"appid": "wx7d809f5e8955843d",
"condition": {}
"condition": {},
"srcMiniprogramRoot": "miniprogram/",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}

View File

@ -0,0 +1,19 @@
{
"condition": {
"miniprogram": {
"list": [
{
"name": "Account",
"pathName": "pages/Account/Account",
"query": "",
"scene": null
}
]
}
},
"projectname": "mini-dlpu-v3",
"setting": {
"compileHotReLoad": true
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
}

View File

@ -19,7 +19,11 @@
"lib": ["ES2020"],
"typeRoots": [
"./typings"
]
],
"baseUrl": "./miniprogram/",
"paths": {
"@logger": ["logger/"]
}
},
"include": [
"./**/*.ts"