@jx3box/jx3box-common-ui 5.5.24 → 5.5.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,13 @@
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_size = 4
6
+ indent_style = space
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
package/.prettierrc ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "tabWidth": 4,
3
+ "useTabs": false,
4
+ "endOfLine": "lf",
5
+ "printWidth": 120,
6
+ "semi": true,
7
+ "singleQuote": false,
8
+ "quoteProps": "as-needed",
9
+ "jsxSingleQuote": false,
10
+ "trailingComma": "es5",
11
+ "bracketSpacing": true,
12
+ "bracketSameLine": false,
13
+ "jsxBracketSameLine": false,
14
+ "arrowParens": "always",
15
+ "requirePragma": false,
16
+ "insertPragma": false,
17
+ "proseWrap": "preserve",
18
+ "htmlWhitespaceSensitivity": "css",
19
+ "vueIndentScriptAndStyle": false,
20
+ "embeddedLanguageFormatting": "auto"
21
+ }
@@ -3,6 +3,7 @@
3
3
  .clearfix;
4
4
  .db;
5
5
  .mb(10px);
6
+ .pr;
6
7
  }
7
8
  .u-avatar {
8
9
  .fl;
@@ -10,12 +11,19 @@
10
11
  .size(68px);
11
12
  }
12
13
  .u-name {
13
- .lh(2);
14
+ .lh(1.6);
14
15
  .bold;
15
16
  color: @darkblue;
16
17
  &:hover {
17
18
  color: #f39;
18
19
  }
20
+ .break(2);
21
+ }
22
+ .u-info{
23
+ .h(68px);
24
+ display: flex;
25
+ flex-direction: column;
26
+ justify-content: center;
19
27
  }
20
28
  .u-bio {
21
29
  .mb(10px);
@@ -24,6 +32,46 @@
24
32
  color: #888;
25
33
  padding: 0 5px;
26
34
  }
35
+ .u-extend {
36
+ display: flex;
37
+ }
38
+ .u-level {
39
+ padding: 2px 8px;
40
+ .fz(12px, 14px);
41
+ color: #fff;
42
+ background-color: #f39;
43
+ border-radius: 2px;
44
+ }
45
+ .u-vip {
46
+ .ml(5px);
47
+ .db;
48
+ .i-icon-vip {
49
+ .db;
50
+ vertical-align: baseline;
51
+ padding: 2px 6px;
52
+ .fz(12px, 14px);
53
+ font-style: normal;
54
+ border-radius: 2px;
55
+ background-color: #ddd;
56
+ color: #fff;
57
+ &.on {
58
+ background-color: #6f42c1;
59
+ }
60
+ }
61
+ }
62
+ .u-superauthor {
63
+ margin-left: 4px;
64
+ display: inline-block;
65
+ vertical-align: -2px;
66
+ img {
67
+ width: 16px;
68
+ }
69
+ }
70
+ .u-tips {
71
+ .db;
72
+ color: #555;
73
+ font-size: 12px;
74
+ }
27
75
  .u-link {
28
76
  border-top: 1px dashed #eee;
29
77
  border-bottom: 1px dashed #eee;
@@ -109,11 +157,11 @@
109
157
  .db;
110
158
  background-color: #f2f6fc;
111
159
  .mb(6px);
112
- &:hover{
160
+ &:hover {
113
161
  background-color: #e6f0fb;
114
162
  // color:@color-link;
115
163
  }
116
- padding:2px 0;
164
+ padding: 2px 0;
117
165
  }
118
166
  .u-team-logo {
119
167
  .size(26px);
@@ -125,30 +173,6 @@
125
173
  color: #555;
126
174
  }
127
175
  }
128
-
129
- .u-vip {
130
- margin-left: 4px;
131
- .i-icon-vip{
132
- .dbi;vertical-align: baseline;
133
- padding:2px 5px;
134
- .fz(12px,14px);
135
- font-style: normal;
136
- border-radius: 2px;
137
- background-color:#ddd;
138
- color:#fff;
139
- &.on{
140
- background-color: #6f42c1;
141
- }
142
- }
143
- }
144
- .u-superauthor {
145
- margin-left: 4px;
146
- display: inline-block;
147
- vertical-align: -2px;
148
- img {
149
- width: 16px;
150
- }
151
- }
152
176
  }
153
177
 
154
178
  .c-sidebar-left .c-author {
package/jsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "paths": {
5
+ "@/*": ["./src/*"]
6
+ }
7
+ },
8
+ "exclude": ["node_modules"]
9
+ }
package/package.json CHANGED
@@ -1,68 +1,70 @@
1
1
  {
2
- "name": "@jx3box/jx3box-common-ui",
3
- "version": "5.5.24",
4
- "description": "JX3BOX UI",
5
- "main": "index.js",
6
- "scripts": {
7
- "dev": "env DEV_SERVER=true vue-cli-service serve",
8
- "serve": "vue-cli-service serve",
9
- "build": "vue-cli-service build",
10
- "lint": "vue-cli-service lint",
11
- "inspect": "vue inspect > output.js",
12
- "update": "npm --registry https://registry.npmjs.org install @jx3box/jx3box-common@latest @jx3box/jx3box-data@latest @jx3box/jx3box-editor@latest @jx3box/jx3box-comment-ui@latest",
13
- "header": "vue-cli-service build --target lib --name newheader src/Header.vue && cp public/index.html dist/newheader.html"
2
+ "name": "@jx3box/jx3box-common-ui",
3
+ "version": "5.5.27",
4
+ "description": "JX3BOX UI",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "dev": "cross-env DEV_SERVER=true vue-cli-service serve",
8
+ "serve": "vue-cli-service serve",
9
+ "build": "vue-cli-service build",
10
+ "lint": "vue-cli-service lint",
11
+ "inspect": "vue inspect > output.js",
12
+ "update": "npm --registry https://registry.npmjs.org install @jx3box/jx3box-common@latest @jx3box/jx3box-data@latest @jx3box/jx3box-editor@latest @jx3box/jx3box-comment-ui@latest",
13
+ "header": "vue-cli-service build --target lib --name newheader src/Header.vue && cp public/index.html dist/newheader.html"
14
+ },
15
+ "eslintConfig": {
16
+ "root": true,
17
+ "env": {
18
+ "node": true
14
19
  },
15
- "eslintConfig": {
16
- "root": true,
17
- "env": {
18
- "node": true
19
- },
20
- "extends": [
21
- "plugin:vue/essential"
22
- ],
23
- "rules": {},
24
- "parserOptions": {
25
- "parser": "babel-eslint"
26
- }
27
- },
28
- "browserslist": [
29
- "> 1%",
30
- "last 2 versions"
20
+ "extends": [
21
+ "plugin:vue/essential"
31
22
  ],
32
- "dependencies": {
33
- "@jx3box/jx3box-comment-ui": "^1.6.8",
34
- "@jx3box/jx3box-common": "^7.0.21",
35
- "@jx3box/jx3box-data": "^1.8.3",
36
- "@jx3box/jx3box-editor": "^1.2.6",
37
- "axios": "^0.26.1",
38
- "element-ui": "^2.13.2",
39
- "jquery": "^3.5.1",
40
- "lodash": "^4.17.15",
41
- "qrcode.vue": "^1.7.0",
42
- "url": "^0.11.0",
43
- "vue": "^2.6.11"
44
- },
45
- "devDependencies": {
46
- "@babel/plugin-proposal-optional-chaining": "^7.14.5",
47
- "@vue/cli-plugin-babel": "~4.3.0",
48
- "@vue/cli-plugin-eslint": "~4.3.0",
49
- "@vue/cli-plugin-vuex": "^4.0.0",
50
- "@vue/cli-service": "~4.3.0",
51
- "babel-eslint": "^10.1.0",
52
- "core-js": "^3.6.5",
53
- "csslab": "^4.0.3",
54
- "eslint": "^6.7.2",
55
- "eslint-plugin-vue": "^6.2.2",
56
- "less": "^3.0.4",
57
- "less-loader": "^5.0.0",
58
- "style-resources-loader": "^1.3.3",
59
- "vue-cli-plugin-element": "~1.0.1",
60
- "vue-svg-inline-loader": "^1.4.6",
61
- "vue-template-compiler": "^2.6.11",
62
- "weixin-js-sdk": "^1.6.0"
63
- },
64
- "repository": {
65
- "type": "git",
66
- "url": "git+https://github.com/JX3BOX/jx3box-common-ui.git"
23
+ "rules": {},
24
+ "parserOptions": {
25
+ "parser": "babel-eslint"
67
26
  }
27
+ },
28
+ "browserslist": [
29
+ "> 1%",
30
+ "last 2 versions"
31
+ ],
32
+ "dependencies": {
33
+ "@jx3box/jx3box-comment-ui": "^1.6.8",
34
+ "@jx3box/jx3box-common": "^7.0.24",
35
+ "@jx3box/jx3box-data": "^1.8.6",
36
+ "@jx3box/jx3box-editor": "^1.2.6",
37
+ "axios": "^0.26.1",
38
+ "dayjs": "^1.11.0",
39
+ "element-ui": "^2.13.2",
40
+ "jquery": "^3.5.1",
41
+ "lodash": "^4.17.15",
42
+ "qrcode.vue": "^1.7.0",
43
+ "url": "^0.11.0",
44
+ "vue": "^2.6.11"
45
+ },
46
+ "devDependencies": {
47
+ "@babel/plugin-proposal-optional-chaining": "^7.14.5",
48
+ "@vue/cli-plugin-babel": "~4.3.0",
49
+ "@vue/cli-plugin-eslint": "~4.3.0",
50
+ "@vue/cli-plugin-vuex": "^4.0.0",
51
+ "@vue/cli-service": "~4.3.0",
52
+ "babel-eslint": "^10.1.0",
53
+ "core-js": "^3.6.5",
54
+ "cross-env": "^7.0.3",
55
+ "csslab": "^4.0.3",
56
+ "eslint": "^6.7.2",
57
+ "eslint-plugin-vue": "^6.2.2",
58
+ "less": "^3.0.4",
59
+ "less-loader": "^5.0.0",
60
+ "style-resources-loader": "^1.3.3",
61
+ "vue-cli-plugin-element": "~1.0.1",
62
+ "vue-svg-inline-loader": "^1.4.6",
63
+ "vue-template-compiler": "^2.6.11",
64
+ "weixin-js-sdk": "^1.6.0"
65
+ },
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "git+https://github.com/JX3BOX/jx3box-common-ui.git"
69
+ }
68
70
  }
package/service/author.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios from "axios";
2
2
  import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
3
- import { $next, $cms, $team } from "@jx3box/jx3box-common/js/https.js";
3
+ import { $next, $cms, $team, $pay } from "@jx3box/jx3box-common/js/https.js";
4
4
 
5
5
  function getUserInfo(uid) {
6
6
  return $cms({ mute: true })
@@ -10,11 +10,19 @@ function getUserInfo(uid) {
10
10
  });
11
11
  }
12
12
 
13
+ function getMyInfo(){
14
+ return $cms({ mute: true })
15
+ .get(`/api/cms/user/my/info`)
16
+ .then(res => {
17
+ return res.data.data
18
+ })
19
+ }
20
+
13
21
  function getUserPosts(uid) {
14
22
  return $cms({ mute: true })
15
23
  .get(`/api/cms/posts/user/${uid}/latest`)
16
24
  .then((res) => {
17
- return res.data.data;
25
+ return res.data.data.list || [];
18
26
  });
19
27
  }
20
28
 
@@ -56,8 +64,8 @@ function getSuperAuthor(uid) {
56
64
  return $cms().get('/api/cms/user/is_super_author/' + uid)
57
65
  }
58
66
 
59
- function getIdentity(uid) {
60
- return $cms().get(`/api/cms/user/${uid}/identity`)
67
+ function userSignIn(){
68
+ return $pay({ mute: true }).get(`/api/personal/task/everyday/sign-in`)
61
69
  }
62
70
 
63
71
  export {
@@ -68,5 +76,6 @@ export {
68
76
  getFrames,
69
77
  getUserPublicTeams,
70
78
  getSuperAuthor,
71
- getIdentity
79
+ getMyInfo,
80
+ userSignIn,
72
81
  };
package/service/fav.js CHANGED
@@ -1,44 +1,61 @@
1
- import qs from "qs";
2
- import { $helper } from "@jx3box/jx3box-common/js/https.js";
1
+ // import qs from "qs";
2
+ // import { $helper } from "@jx3box/jx3box-common/js/https.js";
3
+
4
+ // function hasFav(post_type, post_id) {
5
+ // if (post_type && post_id) {
6
+ // return $helper({ popType: "notify" }).get(
7
+ // `/api/post/favorite/favorited`,
8
+ // {
9
+ // params: {
10
+ // post_type: post_type,
11
+ // post_id: post_id,
12
+ // },
13
+ // }
14
+ // );
15
+ // } else return null;
16
+ // }
17
+
18
+ // function addFav(post_type, post_id) {
19
+ // if (post_type && post_id) {
20
+ // return $helper({ popType: "notify" }).post(
21
+ // `/api/post/favorite`,
22
+ // qs.stringify({
23
+ // post_type: post_type,
24
+ // post_id: post_id,
25
+ // cancel: 0,
26
+ // })
27
+ // );
28
+ // } else return null;
29
+ // }
30
+
31
+ // function delFav(post_type, post_id) {
32
+ // if (post_type && post_id) {
33
+ // return $helper({ popType: "notify" }).post(
34
+ // `/api/post/favorite`,
35
+ // qs.stringify({
36
+ // post_type: post_type,
37
+ // post_id: post_id,
38
+ // cancel: 1,
39
+ // })
40
+ // );
41
+ // } else return null;
42
+ // }
43
+
44
+ // export { hasFav, addFav, delFav };
45
+ import { $next } from "@jx3box/jx3box-common/js/https.js";
46
+ const $n = $next();
3
47
 
4
48
  function hasFav(post_type, post_id) {
5
- if (post_type && post_id) {
6
- return $helper({ popType: "notify" }).get(
7
- `/api/post/favorite/favorited`,
8
- {
9
- params: {
10
- post_type: post_type,
11
- post_id: post_id,
12
- },
13
- }
14
- );
15
- } else return null;
49
+ return $n.get(`api/article/favorites/is-my/${post_id}/${post_type}`).then((res) => {
50
+ return res.data.data;
51
+ });
16
52
  }
17
-
18
- function addFav(post_type, post_id) {
19
- if (post_type && post_id) {
20
- return $helper({ popType: "notify" }).post(
21
- `/api/post/favorite`,
22
- qs.stringify({
23
- post_type: post_type,
24
- post_id: post_id,
25
- cancel: 0,
26
- })
27
- );
28
- } else return null;
53
+ function addFav(post_type, post_id, post_title) {
54
+ return $n.post(`api/article/favorites/add/${post_id}/${post_type}`, { post_title }).then((res) => {
55
+ return res.data.data;
56
+ });
29
57
  }
30
-
31
- function delFav(post_type, post_id) {
32
- if (post_type && post_id) {
33
- return $helper({ popType: "notify" }).post(
34
- `/api/post/favorite`,
35
- qs.stringify({
36
- post_type: post_type,
37
- post_id: post_id,
38
- cancel: 1,
39
- })
40
- );
41
- } else return null;
58
+ function delFav(id) {
59
+ return $n.delete(`api/article/favorites/my/${id}`);
42
60
  }
43
-
44
61
  export { hasFav, addFav, delFav };
package/src/App.vue CHANGED
@@ -41,15 +41,15 @@
41
41
  <UserPop title="添加用户" v-model="visible" @confirm="addUser" />
42
42
  <el-button @click="visible = true">用户POP</el-button>
43
43
 
44
- <Thx :postId="23865" postType="bbs" :userId="7" :adminBoxcoinEnable="true" :userBoxcoinEnable="true" />
44
+ <Thx :postId="23865" postType="bbs" postTitle="bbs23865的标题" :userId="7" :adminBoxcoinEnable="true" :userBoxcoinEnable="true" />
45
45
 
46
46
  <hr />
47
47
 
48
48
  <Like mode="heart" :count="100" :showCount="true" />
49
49
  <Down :count="100" :showCount="true" />
50
50
  <Mark label="KEY" value="VALUE" BGL="#000" BGR="#F39" />
51
- <Fav post-id="90" post-type="jx3dat" />
52
- <Feed post-id="90" post-type="jx3dat" />
51
+ <Fav post-id="90" post-type="jx3dat" post-title="jx3dat测试标题" />
52
+ <Feed post-id="90" post-type="jx3dat"/>
53
53
  <Print title="传入标题" />
54
54
  <QRcode />
55
55
  <Sharing />