efront 3.24.3 → 3.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/apps/{index.html → _index.html} +1 -1
  2. package/apps/{zimoli/index.html → index.jsp} +22 -6
  3. package/apps/kugou/main.js +1 -3
  4. package/coms/basic/bdecode.js +38 -0
  5. package/coms/basic/bdecode_test.js +13 -0
  6. package/coms/basic/bencode.js +14 -0
  7. package/coms/basic/bencode_test.js +20 -0
  8. package/coms/basic/combine.js +21 -0
  9. package/coms/basic/cross_.js +11 -4
  10. package/coms/basic/queue.js +2 -2
  11. package/coms/basic/submit_.js +3 -1
  12. package/{apps → coms}/kugou/api.js +2 -0
  13. package/coms/kugou/buildList.js +7 -1
  14. package/coms/kugou/player.js +1 -0
  15. package/coms/kugou/song.html +1 -1
  16. package/coms/kugou/song.js +1 -0
  17. package/coms/kugou/song.less +12 -1
  18. package/coms/zimoli/button.less +49 -0
  19. package/coms/zimoli/cloneVisible.js +1 -0
  20. package/coms/zimoli/data.js +8 -2
  21. package/coms/zimoli/input.js +6 -4
  22. package/coms/zimoli/picture.js +6 -5
  23. package/coms/zimoli/picture_.js +4 -2
  24. package/coms/zimoli/render.js +2 -1
  25. package/package.json +1 -1
  26. package/public/efront.js +1 -1
  27. package/readme.md +0 -1
  28. package/apps/zimoli/book/main.js +0 -8
  29. package/apps/zimoli/broadcast/main.js +0 -8
  30. package/apps/zimoli/collection/add.html +0 -13
  31. package/apps/zimoli/collection/add.js +0 -14
  32. package/apps/zimoli/collection/add.less +0 -0
  33. package/apps/zimoli/collection/main.html +0 -0
  34. package/apps/zimoli/collection/main.js +0 -13
  35. package/apps/zimoli/collection/main.less +0 -8
  36. package/apps/zimoli/config.js +0 -14
  37. package/apps/zimoli/extra/pending.html +0 -1
  38. package/apps/zimoli/extra/pending.js +0 -8
  39. package/apps/zimoli/extra/pending.less +0 -15
  40. package/apps/zimoli/files/info.js +0 -7
  41. package/apps/zimoli/files/main.js +0 -108
  42. package/apps/zimoli/files/main.less +0 -26
  43. package/apps/zimoli/images/avatar.png +0 -0
  44. package/apps/zimoli/images/background.jpg +0 -0
  45. package/apps/zimoli/kugou/font/demo.css +0 -539
  46. package/apps/zimoli/kugou/font/demo_index.html +0 -1159
  47. package/apps/zimoli/kugou/font/iconfont.css +0 -189
  48. package/apps/zimoli/kugou/font/iconfont.eot +0 -0
  49. package/apps/zimoli/kugou/font/iconfont.js +0 -1
  50. package/apps/zimoli/kugou/font/iconfont.svg +0 -155
  51. package/apps/zimoli/kugou/font/iconfont.ttf +0 -0
  52. package/apps/zimoli/kugou/font/iconfont.woff +0 -0
  53. package/apps/zimoli/kugou/font/iconfont.woff2 +0 -0
  54. package/apps/zimoli/kugou/listen.html +0 -15
  55. package/apps/zimoli/kugou/listen.js +0 -37
  56. package/apps/zimoli/kugou/listen.less +0 -114
  57. package/apps/zimoli/kugou/mine.html +0 -53
  58. package/apps/zimoli/kugou/mine.js +0 -21
  59. package/apps/zimoli/kugou/mine.less +0 -106
  60. package/apps/zimoli/kugou/search.js +0 -109
  61. package/apps/zimoli/kugou/search.less +0 -50
  62. package/apps/zimoli/kugou/sing.js +0 -42
  63. package/apps/zimoli/kugou/sing.less +0 -93
  64. package/apps/zimoli/kugou/view.html +0 -39
  65. package/apps/zimoli/kugou/view.js +0 -17
  66. package/apps/zimoli/kugou/view.less +0 -84
  67. package/apps/zimoli/login/qq.js +0 -20
  68. package/apps/zimoli/login/qq_callback.html +0 -15
  69. package/apps/zimoli/main.js +0 -87
  70. package/apps/zimoli/main.less +0 -81
  71. package/apps/zimoli/message/chatList.js +0 -57
  72. package/apps/zimoli/message/chatList.less +0 -52
  73. package/apps/zimoli/message/commentList.js +0 -55
  74. package/apps/zimoli/message/commentList.less +0 -55
  75. package/apps/zimoli/message/informList.js +0 -69
  76. package/apps/zimoli/message/informList.less +0 -51
  77. package/apps/zimoli/message/main.js +0 -59
  78. package/apps/zimoli/message/main.less +0 -51
  79. package/apps/zimoli/message/praiseList.js +0 -3
  80. package/apps/zimoli/message/praiseList.less +0 -7
  81. package/apps/zimoli/nearby/main.js +0 -8
  82. package/apps/zimoli/skin/main.js +0 -47
  83. package/apps/zimoli/skin/main.less +0 -31
  84. package/apps/zimoli/user/getPassword.js +0 -82
  85. package/apps/zimoli/user/getPassword.less +0 -14
  86. package/apps/zimoli/user/login.html +0 -12
  87. package/apps/zimoli/user/login.js +0 -50
  88. package/apps/zimoli/user/login.less +0 -139
  89. package/apps/zimoli/user/profile-bg.jpg +0 -0
  90. package/apps/zimoli/user/profile.html +0 -32
  91. package/apps/zimoli/user/profile.js +0 -63
  92. package/apps/zimoli/user/profile.less +0 -50
  93. package/apps/zimoli/user/register.js +0 -20
  94. package/apps/zimoli/user/register.less +0 -3
  95. package/apps/zimoli/user/setting.js +0 -90
  96. package/apps/zimoli/user/setting.less +0 -11
  97. package/apps/zimoli/user/welcome.js +0 -36
  98. package/apps/zimoli/user/welcome.less +0 -136
  99. package/apps/zimoli/watch/main.html +0 -22
  100. package/apps/zimoli/watch/main.js +0 -76
  101. package/apps/zimoli/watch/main.less +0 -54
  102. package/apps/zimoli/yuanfen/main.js +0 -55
  103. package/apps/zimoli/yuanfen/main.json +0 -0
@@ -1,84 +0,0 @@
1
- @font-face {
2
- font-family: "kugouicons";
3
- @font-path: "kugou/font/";
4
- src: url('@{font-path}iconfont.eot?t=1496068931776');
5
- /* IE9*/
6
- src: url('@{font-path}iconfont.eot?t=1496068931776#iefix') format('embedded-opentype'),
7
- /* IE6-IE8 */
8
- url('@{font-path}iconfont.woff?t=1496068931776') format('woff'),
9
- /* chrome, firefox */
10
- url('@{font-path}iconfont.ttf?t=1496068931776') format('truetype'),
11
- /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
12
- url('@{font-path}iconfont.svg?t=1496068931776#iconfont') format('svg');
13
- /* iOS 4.1- */
14
- }
15
-
16
- i {
17
- font-family: kugouicons;
18
- font-style: normal;
19
- }
20
-
21
- .rank-area {
22
- background-color: #fff;
23
- padding: 10px 16px;
24
- margin-bottom: 10px;
25
- >div {
26
- display: inline-block;
27
- >.disp {
28
- font-size: 12px;
29
- color: #7f7f7f;
30
- }
31
- }
32
- }
33
-
34
- .filter-buttons {
35
- background-color: #fff;
36
- padding: 10px 6px;
37
- text-align: left;
38
- >div {
39
- width: 20%;
40
- text-align: center;
41
- max-width: 80px;
42
- height: 40px;
43
- font-size: 14px;
44
- display: inline-block;
45
- >.icon {
46
- display: block;
47
- margin: 0 auto;
48
- height: 40px;
49
- width: 40px;
50
- border-radius: 50%;
51
- background: #886;
52
- }
53
- >.name {
54
- height: 30px;
55
- line-height: 30px;
56
- }
57
- }
58
- }
59
-
60
- lattice {
61
- background-color: #fff;
62
- position: relative;
63
- padding: 0 10px 10px 10px;
64
- height: 100%;
65
- .img {
66
- width: 100%;
67
- height: 140px;
68
- background-repeat: no-repeat;
69
- background-size: cover;
70
- background-position: center;
71
- display: block;
72
- }
73
- >div {
74
- position: relative;
75
- display: inline-block;
76
- white-space: nowrap;
77
- overflow: hidden;
78
- text-overflow: ellipsis;
79
- width: 100%;
80
- height: auto;
81
- background-color: #cee;
82
- border: 2px solid #fff;
83
- }
84
- }
@@ -1,20 +0,0 @@
1
- var qc_loader = script("http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js");
2
- appendChild(document.body, qc_loader);
3
- qc_loader.async = true;
4
- qc_loader.setAttribute("data-appid", "1107914671");
5
- qc_loader.setAttribute("data-redirecturi", location.href.replace(/[^\/]+$/, "zimoli/login/qq_callback.html"));
6
- qc_loader.onload = function () {
7
- remove(qc_loader);
8
- };
9
-
10
- function main() {
11
- window.QC && window.QC.Login.showPopup();
12
- var interval = setInterval(function () {
13
- if (/#.*?qq$/.test(location.href)) {
14
- history.back();
15
- } else {
16
- clearInterval(interval);
17
- }
18
- }, 20);
19
- return div();
20
- }
@@ -1,15 +0,0 @@
1
- <!doctype html>
2
- <html>
3
-
4
- <head>
5
- <script src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" charset="utf-8" data-callback="true"></script>
6
- <script >
7
- if (QC.Login.check()) {
8
- QC.Login.getMe(function (openId, accessToken) {
9
- console.log(openId, accessToken);
10
- })
11
- }
12
- </script>
13
- </head>
14
-
15
- </html>
@@ -1,87 +0,0 @@
1
- // 中文编码 utf-8
2
- "use strict";
3
- var menu = div();
4
- var config = require("./config");
5
- appendChild(menu, kugou$menu, kugou$page);
6
- i18n.loadSource({
7
- zh: {
8
- "name": "用户名"
9
- },
10
- });
11
- i18n = i18n.local({
12
- zh: {
13
- badDevice: "运行环境不佳,可能出现卡顿现象!"
14
- },
15
- en: {
16
- badDevice: "Operating environment is not good, there may be a Katon phenomenon! uuuuuuuuuuu"
17
- }
18
- });
19
- var _state = state();
20
- if (_state.isRight) {
21
- kugou$dragview.toRight();
22
- }
23
- kugou$dragview.onchange = function () {
24
- _state.isRight = kugou$dragview.isRight;
25
- state(_state);
26
- };
27
- var view = layer$leftCenter(menu);
28
- menu.initialStyle = "transform:scale(.92)";
29
- css(menu, "background-image: linear-gradient(0deg, #0b3b5d, 5%, #031341, 90%, #235b71);height:100%;width:100%");
30
- css("body", "background:url('images/background.jpg') no-repeat;background-size:cover;");
31
- css(":after,:before,*", "box-sizing:border-box;");
32
- css(".titlebar", { backgroundColor: "rgb(44, 162, 249,.7)" });
33
- zimoli.setStorage(localStorage);
34
- api.setBaseUrl(config.api_base, cross);
35
- api.setHeaders({}, false);
36
- api.onerror = function (error) {
37
- try {
38
- error = JSON.parse(error).reason
39
- } catch (e) {
40
- }
41
- alert.error(i18n(error));
42
- };
43
- cross.digest = render.digest;
44
- user.setLoginPath("/user/welcome");
45
- var mainView = function () {
46
- return view;
47
- };
48
-
49
- user.setUserDataLoader(function () {
50
- api("get", "/_users/" + user._id).success(function (result) {
51
- for (var k in user) {
52
- if (!(user[k] instanceof Function)) {
53
- delete user[k];
54
- }
55
- }
56
- extendIfNeeded(user, result);
57
- user.avatarref = `${cross.getCrossUrl(config.api_base)}_users/${result._id}/avatar?rev=${result._rev}`;
58
- if (result._attachments && result._attachments.avatar) {
59
- user.avatar = user.avatarref;
60
- } else {
61
- user.avatar = '';
62
- }
63
- });
64
- });
65
- var main = new Promise(function (ok, oh) {
66
- var logout = function () {
67
- user.Logout().then(function () {
68
- ok(mainView);
69
- }).catch(function () {
70
- ok(mainView);
71
- });
72
- };
73
- user.loadSession().then(function (session) {
74
- if (!session) return ok(mainView);
75
- cross.addCookie(session, config.api_domain);
76
- api("get", "_session").success(function (result) {
77
- if (result.ok && result.userCtx && result.userCtx.name) {
78
- ok(mainView);
79
- } else {
80
- logout();
81
- }
82
- }).error(function (error) {
83
- logout();
84
- alert.error(JSON.parse(error).reason);
85
- });
86
- });
87
- });
@@ -1,81 +0,0 @@
1
- @font-face {
2
- font-family: "kugouicons";
3
- @font-path: "kugou/font/";
4
- src: url('@{font-path}iconfont.eot?t=1496068931776');
5
- /* IE9*/
6
- src: url('@{font-path}iconfont.eot?t=1496068931776#iefix') format('embedded-opentype'),
7
- /* IE6-IE8 */
8
- url('@{font-path}iconfont.woff?t=1496068931776') format('woff'),
9
- /* chrome, firefox */
10
- url('@{font-path}iconfont.ttf?t=1496068931776') format('truetype'),
11
- /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
12
- url('@{font-path}iconfont.svg?t=1496068931776#iconfont') format('svg');
13
- /* iOS 4.1- */
14
- }
15
-
16
- i {
17
- font-family: kugouicons;
18
- font-style: normal;
19
- }
20
-
21
- >[layer=main] {
22
- background-color: #f2f6f9;
23
- }
24
-
25
- & {
26
- user-select: none;
27
- }
28
-
29
- >[layer=main]:empty:before {
30
- color: #bbb;
31
- content: "efront.cc";
32
- font-style: italic;
33
- line-height: 30px;
34
- height: 30px;
35
- width: 100%;
36
- padding: 0 20px;
37
- bottom: 0;
38
- text-align: right;
39
- font-size: 16px;
40
- position: absolute;
41
- }
42
-
43
- .player+body>& {
44
- >[layer=left]>:not(.titlebar) {
45
- >.menu {
46
- .setting-button {
47
- margin-bottom: 0;
48
- }
49
- }
50
- }
51
-
52
- >[layer] {
53
-
54
- >.vbox,
55
- :not(.vbox)>.vbox {
56
- padding-bottom: 0;
57
- }
58
- }
59
-
60
- transition: padding-bottom .2s ease-out;
61
- }
62
-
63
- .player.play+body>&,
64
- .player.pause+body>& {
65
- >[layer=left]>:not(.titlebar) {
66
- >.menu {
67
- .setting-button {
68
- margin-bottom: 60px;
69
- }
70
- }
71
-
72
- }
73
-
74
- >[layer] {
75
-
76
- >.vbox,
77
- :not(.vbox)>.vbox {
78
- padding-bottom: 60px;
79
- }
80
- }
81
- }
@@ -1,57 +0,0 @@
1
- var _chat = div();
2
- _chat.innerHTML = `
3
- <list></list>
4
- `;
5
- var _state = extend({
6
- messages: [
7
- {
8
- avatar: "",
9
- from: "酷小狗",
10
- disp: "你已经成功购买1首付费歌曲,立即试听!",
11
- time: new Date("2018-10-14 19:19"),
12
- },
13
- {
14
- avatar: "",
15
- time: new Date("2018-10-11 23:57"),
16
- disp: "DADA(妲妲)的新专辑【漫天落叶】上线了,快来抢先听!",
17
- from: "新专上线"
18
- },
19
- {
20
- avatar: "",
21
- time: new Date("2017-4-14 22:42"),
22
- disp: "快来看看哪些通讯录好友也在使用酷狗。",
23
- from: "好友推荐"
24
- },
25
- ]
26
- }, state());
27
- var createItem = function (data) {
28
- var body = createWithClass(div, "item");
29
- body.innerHTML = `
30
- <div class=avatar><div></div></div>
31
- <div class=body>
32
- <div class=from>${data.from}</div>
33
- <div class=disp>${data.disp}</div>
34
- <div class=time>${filterTime(data.time)}</div>
35
- </div>`.replace(/>\s+</g, "><");
36
- var item = button(body);
37
- return item;
38
- };
39
- render(_chat, {
40
- go,
41
- list() {
42
- var _list = list(function (index) {
43
- if (index >= _state.messages.length) {
44
- return;
45
- };
46
- var data = _state.messages[index];
47
- var item = createItem(data);
48
- return item;
49
- });
50
- touchList(_list);
51
- onappend(_list, e => _list.go(0));
52
- return _list;
53
- }
54
- })
55
- function main() {
56
- return _chat;
57
- }
@@ -1,52 +0,0 @@
1
- .button {
2
- display: block;
3
- margin: 0;
4
- padding: 0;
5
- height: auto;
6
- padding: 0;
7
- overflow: hidden;
8
- position: relative;
9
- background-color: #fff;
10
- color: #333;
11
- text-shadow: none;
12
- }
13
-
14
- .item {
15
- padding-right: 60px;
16
- padding-left: 16px;
17
- font-size: 14px;
18
- line-height: 20px;
19
- .time {
20
- position: absolute;
21
- top: 10px;
22
- right: 16px;
23
- font-size: 10px;
24
- }
25
- >div {
26
- vertical-align: top;
27
- text-align: left;
28
- display: inline-block;
29
- }
30
- .avatar {
31
- width: 60px;
32
- padding: 10px 0;
33
- >div{
34
- border-radius: 50%;
35
- overflow: hidden;
36
- background-color: #eee;
37
- width: 60px;
38
- height: 60px;
39
- }
40
- }
41
- .from {
42
- font-size: 16px;
43
- line-height: 24px;
44
- }
45
- .body {
46
- padding: 10px;
47
- width: 100%;
48
- >div {
49
- white-space: normal;
50
- }
51
- }
52
- }
@@ -1,55 +0,0 @@
1
- var _chat = div();
2
- _chat.innerHTML = `
3
- <list></list>
4
- `;
5
- var _state = extend({
6
- messages: [
7
- {
8
- avatar: "",
9
- from: "酷小狗",
10
- disp: "嘿嘿,是我想提醒你,你关注的妲己发了评论,去回复一下呗",
11
- link: "妲已音乐名已改为:DADA妲妲,新歌狐",
12
- time: new Date("2018-7-12 11:32"),
13
- },
14
- {
15
- avatar: "",
16
- time: new Date("2018-5-30 15:03"),
17
- link: "谢谢赶来听歌的你,把这首歌打包带走",
18
- disp: "嘿嘿,是我想提醒你,你关注的妲己发了评论,去回复一下呗",
19
- from: "酷小狗"
20
- },
21
- ]
22
- }, state());
23
- var createItem = function (data) {
24
- var body = createWithClass(div, "item");
25
- body.innerHTML = `
26
- <div class=avatar><div></div></div>
27
- <div class=body>
28
- <div class=from>${data.from}</div>
29
- <div class=disp>${data.disp}</div>
30
- <div class=time>${filterTime(data.time)}</div>
31
- </div>
32
- <div class=link>${data.link}</div>
33
- `.replace(/>\s+</g, "><");
34
- var item = button(body);
35
- return item;
36
- };
37
- render(_chat, {
38
- go,
39
- list() {
40
- var _list = list(function (index) {
41
- if (index >= _state.messages.length) {
42
- return;
43
- };
44
- var data = _state.messages[index];
45
- var item = createItem(data);
46
- return item;
47
- });
48
- touchList(_list);
49
- onappend(_list, e => _list.go(0));
50
- return _list;
51
- }
52
- })
53
- function main() {
54
- return _chat;
55
- }
@@ -1,55 +0,0 @@
1
- .button {
2
- display: block;
3
- margin: 0;
4
- padding: 0;
5
- height: auto;
6
- padding: 0;
7
- overflow: hidden;
8
- position: relative;
9
- background-color: #fff;
10
- color: #333;
11
- text-shadow: none;
12
- }
13
-
14
- .item {
15
- padding-right: 120px;
16
- padding-left: 16px;
17
- font-size: 14px;
18
- line-height: 20px;
19
- >div {
20
- vertical-align: top;
21
- text-align: left;
22
- display: inline-block;
23
- }
24
- .time {
25
- color: #999;
26
- }
27
- .avatar {
28
- width: 60px;
29
- padding: 10px 0;
30
- >div {
31
- border-radius: 50%;
32
- overflow: hidden;
33
- background-color: #eee;
34
- width: 60px;
35
- height: 60px;
36
- }
37
- }
38
- .from {
39
- font-size: 16px;
40
- line-height: 24px;
41
- }
42
- .body {
43
- padding: 10px;
44
- width: 100%;
45
- white-space: normal;
46
- }
47
- .link {
48
- width: 60px;
49
- padding: 10px 16px 10px 0;
50
- white-space: normal;
51
- font-size: 10px;
52
- color: #999;
53
- line-height: 16px;
54
- }
55
- }
@@ -1,69 +0,0 @@
1
- var _chat = div();
2
- _chat.innerHTML = `
3
- <list></list>
4
- `;
5
- var _state = extend({
6
- messages: [
7
- {
8
- avatar: "",
9
- from: "消费提示",
10
- disp: "你于2018-10-14 18:05:52成功充值3元,当前酷币账户余额为3元。",
11
- time: new Date("2018-10-14 18:05"),
12
- },
13
- {
14
- avatar: "",
15
- time: new Date("2018-10-9 23:57"),
16
- disp: "超喜欢你的,可以跟你在一起吗?",
17
- from: "短视频"
18
- },
19
- {
20
- avatar: "",
21
- time: new Date("2018-10-5 18:37"),
22
- disp: "升级㕷,你的等级已达Lv6,快去看看吧!",
23
- from: "升级提醒"
24
- },
25
- {
26
- avatar: "",
27
- time: new Date("2018-8-13 20:56"),
28
- disp: "恭喜主人首个个人作品诞生!想让作品出现在“附近在唱”里吗?秘籍在此:设置你的个性头像和昵称,并且作品时长60秒以上,赶紧上传更多作品,让全世界听到你的声音吧~",
29
- from: "K歌助手"
30
- },
31
- {
32
- avatar: "",
33
- time: new Date("2018-4-20 20:00"),
34
- disp: "红到爆!孙语赛携《不仅仅是喜欢》酷狗首秀",
35
- from: "系统通知"
36
- },
37
- ]
38
- }, state());
39
- var createItem = function (data) {
40
- var body = createWithClass(div, "item");
41
- body.innerHTML = `
42
- <div class=avatar><div></div></div>
43
- <div class=body>
44
- <div class=from>${data.from}</div>
45
- <div class=disp>${data.disp}</div>
46
- <div class=time>${filterTime(data.time)}</div>
47
- </div>`.replace(/>\s+</g, "><");
48
- var item = button(body);
49
- return item;
50
- };
51
- render(_chat, {
52
- go,
53
- list() {
54
- var _list = list(function (index) {
55
- if (index >= _state.messages.length) {
56
- return;
57
- };
58
- var data = _state.messages[index];
59
- var item = createItem(data);
60
- return item;
61
- });
62
- touchList(_list);
63
- onappend(_list, e => _list.go(0));
64
- return _list;
65
- }
66
- })
67
- function main() {
68
- return _chat;
69
- }
@@ -1,51 +0,0 @@
1
- .button {
2
- display: block;
3
- margin: 0;
4
- padding: 0;
5
- height: auto;
6
- padding: 0;
7
- overflow: hidden;
8
- position: relative;
9
- background-color: #fff;
10
- color: #333;
11
- text-shadow: none;
12
- }
13
- .item {
14
- padding-right: 60px;
15
- padding-left: 16px;
16
- font-size: 14px;
17
- line-height: 20px;
18
- .time {
19
- position: absolute;
20
- top: 10px;
21
- right: 16px;
22
- font-size: 10px;
23
- }
24
- >div {
25
- vertical-align: top;
26
- text-align: left;
27
- display: inline-block;
28
- }
29
- .avatar {
30
- width: 60px;
31
- padding: 10px 0;
32
- >div{
33
- border-radius: 50%;
34
- overflow: hidden;
35
- background-color: #eee;
36
- width: 60px;
37
- height: 60px;
38
- }
39
- }
40
- .from {
41
- font-size: 16px;
42
- line-height: 24px;
43
- }
44
- .body {
45
- padding: 10px;
46
- width: 100%;
47
- >div {
48
- white-space: normal;
49
- }
50
- }
51
- }
@@ -1,59 +0,0 @@
1
- var page = div();
2
- var _titlebar = titlebar("消息中心", [button("…")]);
3
- var _list = div();
4
- _list.innerHTML = `<btn>一键已读</btn><btn>消息设置</btn>`;
5
- render(_list, {
6
- btn(node) {
7
- var btn = button(node, "white");
8
- css(btn, {
9
- padding: "0 20px",
10
- display: "block",
11
- width: "auto",
12
- });
13
- return btn;
14
- }
15
- });
16
- select(_titlebar.querySelector(".button.menu"), _list);
17
- var options = [
18
- "聊天:chatList",
19
- "评论:commentList",
20
- "赞:praiseList",
21
- "通知:informList",
22
- ].map(function (a) {
23
- var labels = a.split(":");
24
- return { name: labels[0], url: labels[1] }
25
- });
26
- var _state = extend({ ing: 0 }, state());
27
- onback(function () {
28
- _state.ing = 0;
29
- state(_state);
30
- });
31
- page.innerHTML = `
32
- <div class='options'>
33
- ${options.map((a, i) => `<btn -class={ing:state.ing===${i}} -click=go('${a.url}',${i})>${a.name}</btn>`).join("")}
34
- </div>
35
- <div class=page>
36
- </div>
37
- `.replace(/>\s+</g, "><");
38
- render(page, {
39
- options,
40
- state: _state,
41
- btn: button,
42
- page,
43
- go(path, i) {
44
- if (_state.ing === i) return;
45
- _state.ing = i;
46
- state(_state);
47
- options.ing = options[i];
48
- remove(listPage.children);
49
- go(path, null, listPage);
50
- }
51
- });
52
- var listPage = page.querySelector(".page");
53
- page.initialStyle = 'marginLeft:100%;z-index:2';
54
- function main() {
55
- remove(listPage.children, false);
56
- listPage.activate = null;
57
- go(options[_state.ing].url, null, listPage);
58
- return page;
59
- }