@jx3box/jx3box-common-ui 5.5.25 → 5.5.28
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 +13 -0
- package/.prettierrc +21 -0
- package/assets/css/author.less +51 -27
- package/jsconfig.json +9 -0
- package/package.json +65 -63
- package/service/author.js +14 -5
- package/service/fav.js +55 -38
- package/src/App.vue +3 -3
- package/src/Author.vue +66 -110
- package/src/author/Authorposts.vue +29 -32
- package/src/header/user.vue +42 -7
- package/src/interact/Fav.vue +24 -48
- package/src/interact/Fav2.vue +89 -126
- package/src/single/Thx.vue +2 -2
- package/vue.config.js +11 -3
package/.editorconfig
ADDED
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
|
+
}
|
package/assets/css/author.less
CHANGED
|
@@ -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(
|
|
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
package/package.json
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
+
"version": "5.5.28",
|
|
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
|
-
"
|
|
16
|
-
|
|
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
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
60
|
-
return $
|
|
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
|
-
|
|
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
|
-
|
|
6
|
-
return
|
|
7
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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 />
|
package/src/Author.vue
CHANGED
|
@@ -1,56 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="c-author" v-if="data">
|
|
3
3
|
<div class="u-author">
|
|
4
|
-
<Avatar
|
|
5
|
-
|
|
6
|
-
:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
<Avatar class="u-avatar" :uid="uid" :url="data.user_avatar" :size="68" :frame="data.user_avatar_frame" />
|
|
5
|
+
<div class="u-info">
|
|
6
|
+
<a class="u-name" :href="authorLink(uid)">
|
|
7
|
+
<span>{{ data.display_name.slice(0, 12) }}</span>
|
|
8
|
+
<el-tooltip class="item" effect="dark" content="签约作者" placement="top" v-if="isSuperAuthor">
|
|
9
|
+
<a class="u-superauthor" href="/dashboard/#/cooperation" target="_blank">
|
|
10
|
+
<img :src="super_author_icon" alt="superauthor" />
|
|
11
|
+
</a>
|
|
12
|
+
</el-tooltip>
|
|
13
13
|
</a>
|
|
14
|
-
<
|
|
15
|
-
class="item"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
:content="vipTypeTitle"
|
|
29
|
-
placement="top"
|
|
30
|
-
v-if="isPRO || isVIP"
|
|
31
|
-
>
|
|
32
|
-
<a class="u-vip" href="/vip/premium?from=sidebar_author" target="_blank">
|
|
33
|
-
<i class="i-icon-vip on">{{ vipType }}</i>
|
|
34
|
-
</a>
|
|
35
|
-
</el-tooltip>
|
|
14
|
+
<div class="u-extend">
|
|
15
|
+
<el-tooltip class="item u-level" effect="dark" placement="top">
|
|
16
|
+
<div slot="content">
|
|
17
|
+
<span class="u-tips">经验值:{{ data.experience }}</span>
|
|
18
|
+
</div>
|
|
19
|
+
<span>Lv.{{ level }}</span>
|
|
20
|
+
</el-tooltip>
|
|
21
|
+
<el-tooltip class="item" effect="dark" :content="vipTypeTitle" placement="top" v-if="isVip">
|
|
22
|
+
<a class="u-vip" href="/vip/premium?from=sidebar_author" target="_blank">
|
|
23
|
+
<i class="i-icon-vip on">{{ vipType }}</i>
|
|
24
|
+
</a>
|
|
25
|
+
</el-tooltip>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
36
28
|
</div>
|
|
37
29
|
<div class="u-bio">{{ data.user_bio }}</div>
|
|
38
30
|
<div class="u-link" v-if="hasLink">
|
|
39
|
-
<a
|
|
40
|
-
v-if="data.weibo_name"
|
|
41
|
-
class="u-weibo"
|
|
42
|
-
:href="weiboLink(data.weibo_id)"
|
|
43
|
-
target="_blank"
|
|
44
|
-
>
|
|
31
|
+
<a v-if="data.weibo_name" class="u-weibo" :href="weiboLink(data.weibo_id)" target="_blank">
|
|
45
32
|
<img svg-inline src="../assets/img/author/weibo.svg" />
|
|
46
33
|
{{ data.weibo_name }}
|
|
47
34
|
</a>
|
|
48
|
-
<a
|
|
49
|
-
v-if="data.github_name"
|
|
50
|
-
class="u-github"
|
|
51
|
-
:href="githubLink(data.github_name)"
|
|
52
|
-
target="_blank"
|
|
53
|
-
>
|
|
35
|
+
<a v-if="data.github_name" class="u-github" :href="githubLink(data.github_name)" target="_blank">
|
|
54
36
|
<img svg-inline src="../assets/img/author/github.svg" />
|
|
55
37
|
{{ data.github_name }}
|
|
56
38
|
</a>
|
|
@@ -87,9 +69,9 @@
|
|
|
87
69
|
<i class="el-icon-school"></i>
|
|
88
70
|
<span>所属团队</span>
|
|
89
71
|
</div>
|
|
90
|
-
<a class="u-team" v-for="(item,i) in teams" :key="i" :href="teamLink(item.team_id)" target="_blank">
|
|
72
|
+
<a class="u-team" v-for="(item, i) in teams" :key="i" :href="teamLink(item.team_id)" target="_blank">
|
|
91
73
|
<img class="u-team-logo" :src="showTeamLogo(item.team_logo)" />
|
|
92
|
-
<span class="u-team-name">{{item.team_name}}@{{item.team_server}}</span>
|
|
74
|
+
<span class="u-team-name">{{ item.team_name }}@{{ item.team_server }}</span>
|
|
93
75
|
</a>
|
|
94
76
|
</div>
|
|
95
77
|
<Authorposts :uid="uid" />
|
|
@@ -100,27 +82,16 @@
|
|
|
100
82
|
const liveStatusMap = ["等待开播", "直播中", "直播结束"];
|
|
101
83
|
import Avatar from "./author/Avatar.vue";
|
|
102
84
|
import Authorposts from "./author/Authorposts.vue";
|
|
103
|
-
import {
|
|
104
|
-
authorLink,
|
|
105
|
-
tvLink,
|
|
106
|
-
getLink,
|
|
107
|
-
getThumbnail,
|
|
108
|
-
} from "@jx3box/jx3box-common/js/utils";
|
|
85
|
+
import { authorLink, tvLink, getLink, getThumbnail } from "@jx3box/jx3box-common/js/utils";
|
|
109
86
|
import { __server, __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
110
|
-
import {
|
|
111
|
-
getUserInfo,
|
|
112
|
-
getDouyu,
|
|
113
|
-
getUserMedals,
|
|
114
|
-
getUserPublicTeams,
|
|
115
|
-
getSuperAuthor,
|
|
116
|
-
getIdentity,
|
|
117
|
-
} from "../service/author";
|
|
87
|
+
import { getUserInfo, getDouyu, getUserMedals, getUserPublicTeams } from "../service/author";
|
|
118
88
|
import { user as medal_map } from "@jx3box/jx3box-common/data/medals.json";
|
|
119
89
|
import User from "@jx3box/jx3box-common/js/user";
|
|
90
|
+
import { __userLevel } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
120
91
|
export default {
|
|
121
92
|
name: "Author",
|
|
122
93
|
props: ["uid"],
|
|
123
|
-
data: function
|
|
94
|
+
data: function() {
|
|
124
95
|
return {
|
|
125
96
|
data: "",
|
|
126
97
|
tv: "",
|
|
@@ -133,50 +104,52 @@ export default {
|
|
|
133
104
|
// team_server : "蝶恋花"
|
|
134
105
|
// }
|
|
135
106
|
],
|
|
136
|
-
isSuperAuthor: false,
|
|
137
|
-
isPRO: false,
|
|
138
107
|
isVIP: false,
|
|
139
108
|
};
|
|
140
109
|
},
|
|
141
110
|
computed: {
|
|
142
|
-
tv_type: function
|
|
111
|
+
tv_type: function() {
|
|
143
112
|
return this.data && this.data.tv_type;
|
|
144
113
|
},
|
|
145
|
-
tv_id: function
|
|
114
|
+
tv_id: function() {
|
|
146
115
|
return (this.data && this.data.tv_id) || 0;
|
|
147
116
|
},
|
|
148
|
-
tv_img: function
|
|
117
|
+
tv_img: function() {
|
|
149
118
|
return __imgPath + "image/tv/" + this.tv_type + ".png";
|
|
150
119
|
},
|
|
151
|
-
tv_link: function
|
|
120
|
+
tv_link: function() {
|
|
152
121
|
return tvLink(this.tv_type, this.tv_id) || "";
|
|
153
122
|
},
|
|
154
|
-
tv_status: function
|
|
123
|
+
tv_status: function() {
|
|
155
124
|
return (this.tv && this.tv.show_status == 1) || false;
|
|
156
125
|
},
|
|
157
|
-
super_author_icon: function
|
|
126
|
+
super_author_icon: function() {
|
|
158
127
|
return __imgPath + "image/user/" + "superauthor.svg";
|
|
159
128
|
},
|
|
160
|
-
hasLink: function
|
|
161
|
-
return
|
|
162
|
-
this.data.weibo_name ||
|
|
163
|
-
this.data.github_name ||
|
|
164
|
-
this.data.tuilan_id ||
|
|
165
|
-
this.data.tv_id
|
|
166
|
-
);
|
|
129
|
+
hasLink: function() {
|
|
130
|
+
return this.data.weibo_name || this.data.github_name || this.data.tuilan_id || this.data.tv_id;
|
|
167
131
|
},
|
|
168
|
-
hasTrophy: function
|
|
132
|
+
hasTrophy: function() {
|
|
169
133
|
return this.medals.length;
|
|
170
134
|
},
|
|
171
|
-
vipType: function
|
|
172
|
-
return this.
|
|
135
|
+
vipType: function() {
|
|
136
|
+
return this.data?.is_pro ? "PRO" : "PRE";
|
|
137
|
+
},
|
|
138
|
+
vipTypeTitle: function() {
|
|
139
|
+
return this.data?.is_pro ? "专业版会员" : "高级版会员";
|
|
140
|
+
},
|
|
141
|
+
isVip: function() {
|
|
142
|
+
return this.data?.is_pro || this.data?.is_pre;
|
|
143
|
+
},
|
|
144
|
+
isSuperAuthor: function() {
|
|
145
|
+
return this.data?.sign;
|
|
173
146
|
},
|
|
174
|
-
|
|
175
|
-
return this.
|
|
147
|
+
level: function() {
|
|
148
|
+
return User.getLevel(this.data?.experience);
|
|
176
149
|
},
|
|
177
150
|
},
|
|
178
151
|
methods: {
|
|
179
|
-
loadData: function
|
|
152
|
+
loadData: function() {
|
|
180
153
|
return getUserInfo(this.uid)
|
|
181
154
|
.then((data) => {
|
|
182
155
|
this.data = data;
|
|
@@ -184,11 +157,9 @@ export default {
|
|
|
184
157
|
.then(() => {
|
|
185
158
|
this.loadMedals();
|
|
186
159
|
this.loadTeams();
|
|
187
|
-
this.checkSuperAuthor();
|
|
188
|
-
this.loadIdentity();
|
|
189
160
|
});
|
|
190
161
|
},
|
|
191
|
-
loadTV: function
|
|
162
|
+
loadTV: function() {
|
|
192
163
|
if (this.tv_type == "douyu") {
|
|
193
164
|
if (!this.tv_id || isNaN(this.tv_id)) return;
|
|
194
165
|
getDouyu(this.tv_id).then((data) => {
|
|
@@ -196,59 +167,44 @@ export default {
|
|
|
196
167
|
});
|
|
197
168
|
}
|
|
198
169
|
},
|
|
199
|
-
loadMedals: function
|
|
170
|
+
loadMedals: function() {
|
|
200
171
|
getUserMedals(this.uid).then((data) => {
|
|
201
172
|
this.medals = data;
|
|
202
173
|
});
|
|
203
174
|
},
|
|
204
|
-
loadTeams: function
|
|
175
|
+
loadTeams: function() {
|
|
205
176
|
getUserPublicTeams(this.uid).then((data) => {
|
|
206
177
|
this.teams = data && data.slice(0, 5);
|
|
207
178
|
});
|
|
208
179
|
},
|
|
209
|
-
async checkVIP() {
|
|
210
|
-
this.isPRO = await User.isPRO();
|
|
211
|
-
this.isVIP = await User.isVIP();
|
|
212
|
-
},
|
|
213
|
-
checkSuperAuthor: function () {
|
|
214
|
-
getSuperAuthor(this.uid).then((res) => {
|
|
215
|
-
this.isSuperAuthor = res.data.data;
|
|
216
|
-
});
|
|
217
|
-
},
|
|
218
|
-
loadIdentity: function () {
|
|
219
|
-
getIdentity(this.uid).then((res) => {
|
|
220
|
-
this.isPRO = res.data.data.isPRO;
|
|
221
|
-
this.isVIP = res.data.data.isPRE;
|
|
222
|
-
});
|
|
223
|
-
},
|
|
224
180
|
|
|
225
181
|
// filters
|
|
226
|
-
showMedalIcon: function
|
|
182
|
+
showMedalIcon: function(val) {
|
|
227
183
|
return __imgPath + "image/medals/user/" + val + ".gif";
|
|
228
184
|
},
|
|
229
|
-
showMedalDesc
|
|
230
|
-
return item.medal_desc || medal_map[item.medal]
|
|
185
|
+
showMedalDesc: function(item) {
|
|
186
|
+
return item.medal_desc || medal_map[item.medal];
|
|
231
187
|
},
|
|
232
188
|
authorLink,
|
|
233
|
-
weiboLink: function
|
|
189
|
+
weiboLink: function(val) {
|
|
234
190
|
return "https://weibo.com/" + val;
|
|
235
191
|
},
|
|
236
|
-
githubLink: function
|
|
192
|
+
githubLink: function(val) {
|
|
237
193
|
return "https://github.com/" + val;
|
|
238
194
|
},
|
|
239
|
-
teamLink: function
|
|
195
|
+
teamLink: function(team_id) {
|
|
240
196
|
return getLink("org", team_id);
|
|
241
197
|
},
|
|
242
|
-
showTeamLogo: function
|
|
198
|
+
showTeamLogo: function(val) {
|
|
243
199
|
return getThumbnail(val, 32);
|
|
244
200
|
},
|
|
245
201
|
},
|
|
246
202
|
watch: {
|
|
247
|
-
uid: function
|
|
203
|
+
uid: function() {
|
|
248
204
|
this.loadData();
|
|
249
205
|
},
|
|
250
206
|
},
|
|
251
|
-
mounted: function
|
|
207
|
+
mounted: function() {
|
|
252
208
|
this.uid && this.loadData();
|
|
253
209
|
},
|
|
254
210
|
components: {
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="c-authorposts">
|
|
2
|
+
<div class="c-authorposts" v-if="uid">
|
|
3
3
|
<div class="u-label">
|
|
4
4
|
<i class="el-icon-notebook-2"></i>
|
|
5
5
|
<span>作者最新作品</span>
|
|
6
|
-
<a :href="
|
|
6
|
+
<a :href="uid | authorLink" class="u-more" target="_blank">全部 »</a>
|
|
7
7
|
</div>
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
<ul v-if="data && data.length">
|
|
10
10
|
<li v-for="(item, i) in data" :key="i">
|
|
11
|
-
<a
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<span><i class="u-icon el-icon-reading"></i> {{ item.post_title || item.post_type + '/无标题' }}</span>
|
|
11
|
+
<a class="u-item" :href="url(item.ID, item.post_type)" target="_blank">
|
|
12
|
+
<span
|
|
13
|
+
><i class="u-icon el-icon-reading"></i>
|
|
14
|
+
{{ item.post_title || item.post_type + "/无标题" }}</span
|
|
15
|
+
>
|
|
17
16
|
</a>
|
|
18
17
|
</li>
|
|
19
18
|
</ul>
|
|
@@ -22,42 +21,40 @@
|
|
|
22
21
|
|
|
23
22
|
<script>
|
|
24
23
|
import { getUserPosts } from "../../service/author";
|
|
25
|
-
import {authorLink,getLink} from
|
|
24
|
+
import { authorLink, getLink } from "@jx3box/jx3box-common/js/utils";
|
|
26
25
|
export default {
|
|
27
26
|
name: "Authorposts",
|
|
28
27
|
props: ["uid"],
|
|
29
28
|
data: function() {
|
|
30
29
|
return {
|
|
31
30
|
data: [],
|
|
32
|
-
id : this.uid || 0,
|
|
33
31
|
};
|
|
34
32
|
},
|
|
35
|
-
computed
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
computed: {},
|
|
34
|
+
watch: {
|
|
35
|
+
uid: {
|
|
36
|
+
immediate: true,
|
|
37
|
+
handler: function(user_id) {
|
|
38
|
+
if (user_id) this.init();
|
|
39
|
+
},
|
|
40
|
+
},
|
|
42
41
|
},
|
|
43
42
|
methods: {
|
|
44
43
|
url: function(pid, type) {
|
|
45
|
-
return getLink(type,pid)
|
|
44
|
+
return getLink(type, pid);
|
|
45
|
+
},
|
|
46
|
+
init: function() {
|
|
47
|
+
getUserPosts(this.uid)
|
|
48
|
+
.then((data) => {
|
|
49
|
+
this.data = data.slice(0, 5);
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
console.log(err);
|
|
53
|
+
});
|
|
46
54
|
},
|
|
47
|
-
init : function (){
|
|
48
|
-
if (!this.id) return;
|
|
49
|
-
getUserPosts(this.id).then((data) => {
|
|
50
|
-
this.data = data.slice(0, 5);
|
|
51
|
-
}).catch((err) => {
|
|
52
|
-
console.log(err)
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
filters : {
|
|
57
|
-
authorLink
|
|
58
55
|
},
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
filters: {
|
|
57
|
+
authorLink,
|
|
61
58
|
},
|
|
62
59
|
};
|
|
63
60
|
</script>
|
package/src/header/user.vue
CHANGED
|
@@ -119,7 +119,10 @@ import {
|
|
|
119
119
|
} from "@jx3box/jx3box-common/data/jx3box.json";
|
|
120
120
|
import panel from "../../assets/data/panel.json";
|
|
121
121
|
import { getMsg, getMenu } from "../../service/header";
|
|
122
|
-
import {
|
|
122
|
+
import { getMyInfo, userSignIn } from "../../service/author";
|
|
123
|
+
import dayjs from 'dayjs';
|
|
124
|
+
import isToday from 'dayjs/plugin/isToday';
|
|
125
|
+
dayjs.extend(isToday);
|
|
123
126
|
export default {
|
|
124
127
|
props: [],
|
|
125
128
|
data: function () {
|
|
@@ -201,6 +204,12 @@ export default {
|
|
|
201
204
|
return __imgPath + "image/user/" + "superauthor.svg";
|
|
202
205
|
},
|
|
203
206
|
},
|
|
207
|
+
watch: {
|
|
208
|
+
fold(val) {
|
|
209
|
+
if (!val) {
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
204
213
|
methods: {
|
|
205
214
|
// 消息
|
|
206
215
|
checkMSG: function () {
|
|
@@ -242,6 +251,31 @@ export default {
|
|
|
242
251
|
});
|
|
243
252
|
});
|
|
244
253
|
},
|
|
254
|
+
// 签到
|
|
255
|
+
signIn: function (){
|
|
256
|
+
try {
|
|
257
|
+
let user_last_login = localStorage.getItem('user_last_login');
|
|
258
|
+
user_last_login = user_last_login && JSON.parse(user_last_login) || ''
|
|
259
|
+
|
|
260
|
+
if (user_last_login && dayjs(user_last_login).isToday()) {
|
|
261
|
+
console.log('已签到')
|
|
262
|
+
} else {
|
|
263
|
+
userSignIn().then(res => {
|
|
264
|
+
this.$message({
|
|
265
|
+
type: 'success',
|
|
266
|
+
message: '签到成功',
|
|
267
|
+
customClass: 'c-header-signin'
|
|
268
|
+
})
|
|
269
|
+
localStorage.setItem('user_last_login', JSON.stringify(dayjs()))
|
|
270
|
+
}).catch(err => {
|
|
271
|
+
localStorage.setItem('user_last_login', JSON.stringify(dayjs()))
|
|
272
|
+
console.log(dayjs.tz.guess())
|
|
273
|
+
}).finally(() => {})
|
|
274
|
+
}
|
|
275
|
+
} catch(e) {
|
|
276
|
+
console.log(e)
|
|
277
|
+
}
|
|
278
|
+
},
|
|
245
279
|
|
|
246
280
|
// 资产
|
|
247
281
|
loadAsset: function () {
|
|
@@ -249,10 +283,10 @@ export default {
|
|
|
249
283
|
this.asset = data;
|
|
250
284
|
});
|
|
251
285
|
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
this.isSuperAuthor = res.
|
|
255
|
-
})
|
|
286
|
+
loadMyInfo: function () {
|
|
287
|
+
getMyInfo().then(res => {
|
|
288
|
+
this.isSuperAuthor = !!res.sign
|
|
289
|
+
})
|
|
256
290
|
},
|
|
257
291
|
|
|
258
292
|
// 初始化
|
|
@@ -262,7 +296,8 @@ export default {
|
|
|
262
296
|
this.checkMSG();
|
|
263
297
|
this.loadPanel();
|
|
264
298
|
this.loadAsset();
|
|
265
|
-
this.
|
|
299
|
+
this.loadMyInfo()
|
|
300
|
+
this.signIn()
|
|
266
301
|
}
|
|
267
302
|
},
|
|
268
303
|
|
|
@@ -284,4 +319,4 @@ export default {
|
|
|
284
319
|
},
|
|
285
320
|
components: {},
|
|
286
321
|
};
|
|
287
|
-
</script>
|
|
322
|
+
</script>
|
package/src/interact/Fav.vue
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-button class="w-fav" size="mini" type="primary" @click="doFav">
|
|
3
|
-
<i
|
|
4
|
-
<
|
|
5
|
-
<span v-if="!favorited">收藏</span>
|
|
6
|
-
<span v-else>取消收藏</span>
|
|
3
|
+
<i :class="favorite ? 'el-icon-star-on' : 'el-icon-star-off'"></i>
|
|
4
|
+
<span>{{ favorite ? "取消收藏" : "收藏" }}</span>
|
|
7
5
|
</el-button>
|
|
8
6
|
</template>
|
|
9
7
|
|
|
@@ -12,63 +10,41 @@ import User from "@jx3box/jx3box-common/js/user";
|
|
|
12
10
|
import { hasFav, addFav, delFav } from "../../service/fav";
|
|
13
11
|
export default {
|
|
14
12
|
name: "Fav",
|
|
15
|
-
props: ["postType", "postId"],
|
|
16
|
-
data: function() {
|
|
13
|
+
props: ["postType", "postId", "postTitle"],
|
|
14
|
+
data: function () {
|
|
17
15
|
return {
|
|
18
16
|
login: User.isLogin(),
|
|
19
|
-
|
|
17
|
+
favorite: false,
|
|
20
18
|
};
|
|
21
19
|
},
|
|
22
20
|
methods: {
|
|
23
|
-
doFav: function() {
|
|
21
|
+
doFav: function () {
|
|
24
22
|
if (this.login) {
|
|
25
|
-
this.
|
|
23
|
+
this.favorite ? this.delFav() : this.addFav();
|
|
26
24
|
} else {
|
|
27
25
|
User.toLogin();
|
|
28
26
|
}
|
|
29
27
|
},
|
|
30
|
-
hasFav: function() {
|
|
31
|
-
hasFav(this.postType, this.postId).then(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.favorited = data.code === 200 && data.data.favorited > 0;
|
|
35
|
-
},
|
|
36
|
-
(err) => {
|
|
37
|
-
this.fail(err);
|
|
38
|
-
}
|
|
39
|
-
);
|
|
28
|
+
hasFav: function () {
|
|
29
|
+
hasFav(this.postType, this.postId).then((res) => {
|
|
30
|
+
this.favorite = res.id || false;
|
|
31
|
+
});
|
|
40
32
|
},
|
|
41
|
-
addFav: function() {
|
|
42
|
-
addFav(this.postType, this.postId).then(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.favorited = true;
|
|
46
|
-
} else this.fail(data.data.message);
|
|
47
|
-
},
|
|
48
|
-
(err) => {
|
|
49
|
-
this.fail(err);
|
|
50
|
-
}
|
|
51
|
-
);
|
|
33
|
+
addFav: function () {
|
|
34
|
+
addFav(this.postType, this.postId, this.postTitle).then((res) => {
|
|
35
|
+
this.favorite = res.id;
|
|
36
|
+
});
|
|
52
37
|
},
|
|
53
|
-
delFav: function() {
|
|
54
|
-
delFav(this.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.favorited = false;
|
|
58
|
-
} else this.fail(data.data.message);
|
|
59
|
-
},
|
|
60
|
-
(err) => {
|
|
61
|
-
this.fail(err);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
38
|
+
delFav: function () {
|
|
39
|
+
delFav(this.favorite).then(() => {
|
|
40
|
+
this.favorite = false;
|
|
41
|
+
});
|
|
64
42
|
},
|
|
65
|
-
fail: function(err) {
|
|
43
|
+
fail: function (err) {
|
|
66
44
|
if (err.response && err.response.data && err.response.data.code) {
|
|
67
|
-
this.$message.error(
|
|
68
|
-
`[${err.response.data.code}] ${err.response.data.msg}`
|
|
69
|
-
);
|
|
45
|
+
this.$message.error(`[${err.response.data.code}] ${err.response.data.msg}`);
|
|
70
46
|
} else {
|
|
71
|
-
this.$message.error(typeof err ===
|
|
47
|
+
this.$message.error(typeof err === "string" ? err : "网络请求异常");
|
|
72
48
|
}
|
|
73
49
|
console.log(err);
|
|
74
50
|
},
|
|
@@ -78,8 +54,8 @@ export default {
|
|
|
78
54
|
immediate: true,
|
|
79
55
|
handler() {
|
|
80
56
|
if (this.login && this.postType && this.postId) this.hasFav();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
57
|
+
},
|
|
58
|
+
},
|
|
83
59
|
},
|
|
84
60
|
};
|
|
85
61
|
</script>
|
package/src/interact/Fav2.vue
CHANGED
|
@@ -1,126 +1,89 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="w-fav2" :class="{ disabled:
|
|
3
|
-
<el-tooltip effect="dark" :content="favContent" placement="top-start">
|
|
4
|
-
<div>
|
|
5
|
-
<img class="u-icon" svg-inline src="../../assets/img/widget/star.svg" />
|
|
6
|
-
<span class="u-count" v-if="total">{{ total }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
</el-tooltip>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import User from "@jx3box/jx3box-common/js/user";
|
|
14
|
-
import { hasFav, addFav, delFav } from "../../service/fav";
|
|
15
|
-
export default {
|
|
16
|
-
name: "Fav2",
|
|
17
|
-
props: ["postType", "postId"],
|
|
18
|
-
data: function () {
|
|
19
|
-
return {
|
|
20
|
-
login: User.isLogin(),
|
|
21
|
-
|
|
22
|
-
total: 0,
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
computed: {
|
|
26
|
-
favContent() {
|
|
27
|
-
return this.
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
methods: {
|
|
31
|
-
doFav: function () {
|
|
32
|
-
if (this.login) {
|
|
33
|
-
this.
|
|
34
|
-
} else {
|
|
35
|
-
User.toLogin();
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
hasFav: function () {
|
|
39
|
-
hasFav(this.postType, this.postId).then(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
console.log(err);
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
watch: {
|
|
95
|
-
postId: {
|
|
96
|
-
immediate: true,
|
|
97
|
-
handler() {
|
|
98
|
-
if (this.postType && this.postId) this.hasFav();
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<style lang="less" scoped>
|
|
106
|
-
.w-fav2 {
|
|
107
|
-
.pointer;
|
|
108
|
-
.dbi;
|
|
109
|
-
.u-icon {
|
|
110
|
-
.size(32px);
|
|
111
|
-
.y;
|
|
112
|
-
.pr;
|
|
113
|
-
top: -1px;
|
|
114
|
-
}
|
|
115
|
-
.u-count {
|
|
116
|
-
color: #888;
|
|
117
|
-
.ml(10px);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
&.disabled {
|
|
121
|
-
svg * {
|
|
122
|
-
fill: #aaa;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-fav2" :class="{ disabled: favorite }" @click="doFav">
|
|
3
|
+
<el-tooltip effect="dark" :content="favContent" placement="top-start">
|
|
4
|
+
<div>
|
|
5
|
+
<img class="u-icon" svg-inline src="../../assets/img/widget/star.svg" />
|
|
6
|
+
<span class="u-count" v-if="total">{{ total }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
</el-tooltip>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
14
|
+
import { hasFav, addFav, delFav } from "../../service/fav";
|
|
15
|
+
export default {
|
|
16
|
+
name: "Fav2",
|
|
17
|
+
props: ["postType", "postId", "postTitle"],
|
|
18
|
+
data: function () {
|
|
19
|
+
return {
|
|
20
|
+
login: User.isLogin(),
|
|
21
|
+
favorite: false,
|
|
22
|
+
total: 0,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
favContent() {
|
|
27
|
+
return this.favorite ? "取消收藏" : "收藏";
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
methods: {
|
|
31
|
+
doFav: function () {
|
|
32
|
+
if (this.login) {
|
|
33
|
+
this.favorite ? this.delFav() : this.addFav();
|
|
34
|
+
} else {
|
|
35
|
+
User.toLogin();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
hasFav: function () {
|
|
39
|
+
hasFav(this.postType, this.postId).then((res) => {
|
|
40
|
+
this.favorite = res.id || false;
|
|
41
|
+
this.total = res.totalFavorites || 0;
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
addFav: function () {
|
|
45
|
+
addFav(this.postType, this.postId, this.postTitle).then((res) => {
|
|
46
|
+
this.favorite = res.id;
|
|
47
|
+
this.total++;
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
delFav: function () {
|
|
51
|
+
delFav(this.favorite).then(() => {
|
|
52
|
+
this.favorite = false;
|
|
53
|
+
this.total && this.total--;
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
postId: {
|
|
59
|
+
immediate: true,
|
|
60
|
+
handler() {
|
|
61
|
+
if (this.postType && this.postId) this.hasFav();
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="less" scoped>
|
|
69
|
+
.w-fav2 {
|
|
70
|
+
.pointer;
|
|
71
|
+
.dbi;
|
|
72
|
+
.u-icon {
|
|
73
|
+
.size(32px);
|
|
74
|
+
.y;
|
|
75
|
+
.pr;
|
|
76
|
+
top: -1px;
|
|
77
|
+
}
|
|
78
|
+
.u-count {
|
|
79
|
+
color: #888;
|
|
80
|
+
.ml(10px);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&.disabled {
|
|
84
|
+
svg * {
|
|
85
|
+
fill: #aaa;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|
package/src/single/Thx.vue
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="w-thx-panel">
|
|
4
4
|
<boxcoin-admin :postId="postId" :postType="postType" v-if="hasRight && adminBoxcoinEnable && boxcoin_enable" :userId="userId" :own="admin_left" :points="admin_points" :authors="authors" @updateRecord="updateRecord" />
|
|
5
5
|
<Like :postId="postId" :postType="postType"></Like>
|
|
6
|
-
<fav :postId="postId" :postType="postType"></fav>
|
|
6
|
+
<fav :postId="postId" :postType="postType" :postTitle="postTitle"></fav>
|
|
7
7
|
<boxcoin-user :postId="postId" :postType="postType" :boxcoin="boxcoin" :userId="userId" :own="user_left" :points="user_points" :authors="authors" v-if="userBoxcoinEnable && boxcoin_enable" @updateRecord="updateRecord" />
|
|
8
8
|
<Share :postId="postId" :postType="postType" />
|
|
9
9
|
</div>
|
|
@@ -28,7 +28,7 @@ import User from '@jx3box/jx3box-common/js/user'
|
|
|
28
28
|
import {getPostBoxcoinConfig,getBoxcoinStatus} from '../../service/thx'
|
|
29
29
|
export default {
|
|
30
30
|
name: "Thx",
|
|
31
|
-
props: ["postId", "postType","userId","adminBoxcoinEnable","userBoxcoinEnable",'mode', 'authors'],
|
|
31
|
+
props: ["postId", "postType", "postTitle", "userId","adminBoxcoinEnable","userBoxcoinEnable",'mode', 'authors'],
|
|
32
32
|
components: {
|
|
33
33
|
Like,
|
|
34
34
|
Share,
|
package/vue.config.js
CHANGED
|
@@ -39,8 +39,7 @@ module.exports = {
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
"/api/team": {
|
|
42
|
-
target: "
|
|
43
|
-
// "target": "https://team.api.jx3box.com",
|
|
42
|
+
"target": "https://team.api.jx3box.com",
|
|
44
43
|
onProxyReq: function(request) {
|
|
45
44
|
request.setHeader("origin", "");
|
|
46
45
|
},
|
|
@@ -48,6 +47,9 @@ module.exports = {
|
|
|
48
47
|
"/api/cms": {
|
|
49
48
|
target: process.env["DEV_SERVER"] == "true" ? "http://localhost:5120" : "https://cms.jx3box.com",
|
|
50
49
|
},
|
|
50
|
+
"/api/article": {
|
|
51
|
+
target: "https://next2.jx3box.com",
|
|
52
|
+
},
|
|
51
53
|
"/api/messages": {
|
|
52
54
|
target: "https://helper.jx3box.com",
|
|
53
55
|
},
|
|
@@ -57,8 +59,14 @@ module.exports = {
|
|
|
57
59
|
"/api/wiki": {
|
|
58
60
|
target: "https://helper.jx3box.com",
|
|
59
61
|
},
|
|
62
|
+
"/api/personal": {
|
|
63
|
+
target: "https://pay.jx3box.com",
|
|
64
|
+
onProxyReq: function(request) {
|
|
65
|
+
request.setHeader("origin", "");
|
|
66
|
+
},
|
|
67
|
+
},
|
|
60
68
|
"/api": {
|
|
61
|
-
target: "https://
|
|
69
|
+
target: "https://next2.jx3box.com",
|
|
62
70
|
onProxyReq: function(request) {
|
|
63
71
|
request.setHeader("origin", "");
|
|
64
72
|
},
|